From 21506440d22a2f77d4bbeb4bb646a27b03bb9022 Mon Sep 17 00:00:00 2001
From: mrjackwang <30337754+mrjackwang@users.noreply.github.com>
Date: 星期一, 07 三月 2022 09:01:14 +0800
Subject: [PATCH] Merge branch 'wvp-28181-2.0' into wvp-28181-2.0

---
 web_src/src/components/dialog/StreamProxyEdit.vue |  100 ++++++++++++++++++++++++++++---------------------
 1 files changed, 57 insertions(+), 43 deletions(-)

diff --git a/web_src/src/components/dialog/StreamProxyEdit.vue b/web_src/src/components/dialog/StreamProxyEdit.vue
index 3310d9c..470e12e 100644
--- a/web_src/src/components/dialog/StreamProxyEdit.vue
+++ b/web_src/src/components/dialog/StreamProxyEdit.vue
@@ -46,7 +46,6 @@
                   style="width: 100%"
                   placeholder="璇烽�夋嫨鎷夋祦鑺傜偣"
                 >
-                  <el-option label="鑷姩閫夋嫨" value="auto"></el-option>
                   <el-option
                     v-for="item in mediaServerList"
                     :key="item.id"
@@ -106,6 +105,7 @@
                   <el-checkbox label="鍚敤" v-model="proxyParam.enable" ></el-checkbox>
                   <el-checkbox label="杞琀LS" v-model="proxyParam.enable_hls" ></el-checkbox>
                   <el-checkbox label="MP4褰曞埗" v-model="proxyParam.enable_mp4" ></el-checkbox>
+                  <el-checkbox label="鏃犱汉瑙傜湅鑷姩鍒犻櫎" v-model="proxyParam.enable_remove_none_reader" ></el-checkbox>
                 </div>
 
               </el-form-item>
@@ -131,22 +131,6 @@
   computed: {},
   created() {},
   data() {
-    // var deviceGBIdRules = async (rule, value, callback) => {
-    //   console.log(value);
-    //   if (value === "") {
-    //     callback(new Error("璇疯緭鍏ヨ澶囧浗鏍囩紪鍙�"));
-    //   } else {
-    //     var exit = await this.deviceGBIdExit(value);
-    //     console.log(exit);
-    //     console.log(exit == "true");
-    //     console.log(exit === "true");
-    //     if (exit) {
-    //       callback(new Error("璁惧鍥芥爣缂栧彿宸插瓨鍦�"));
-    //     } else {
-    //       callback();
-    //     }
-    //   }
-    // };
     return {
       listChangeCallback: null,
       showDialog: false,
@@ -160,7 +144,7 @@
           type: "default",
           app: null,
           stream: null,
-          url: "rtmp://58.200.131.2/livetv/cctv5hd",
+          url: "",
           src_url: null,
           timeout_ms: null,
           ffmpeg_cmd_key: null,
@@ -169,8 +153,9 @@
           enable: true,
           enable_hls: true,
           enable_mp4: false,
+          enable_remove_none_reader: false,
           platformGbId: null,
-          mediaServerId: "auto",
+          mediaServerId: null,
       },
       mediaServerList:{},
       ffmpegCmdList:{},
@@ -184,6 +169,7 @@
         timeout_ms: [{ required: true, message: "璇疯緭鍏Fmpeg鎺ㄦ祦鎴愬姛瓒呮椂鏃堕棿", trigger: "blur" }],
         ffmpeg_cmd_key: [{ required: false, message: "璇疯緭鍏Fmpeg鍛戒护鍙傛暟妯℃澘锛堝彲閫夛級", trigger: "blur" }],
       },
+      isUpdate: false,
     };
   },
   methods: {
@@ -191,20 +177,22 @@
       this.showDialog = true;
       this.listChangeCallback = callback;
       if (proxyParam != null) {
+        this.isUpdate=true
         this.proxyParam = proxyParam;
       }
 
       let that = this;
       this.$axios({
         method: 'get',
-        url:`/api/platform/query/10000/0`
+        url:`/api/platform/query/10000/1`
       }).then(function (res) {
         that.platformList = res.data.list;
       }).catch(function (error) {
         console.log(error);
       });
-      this.mediaServer.getMediaServerList((data)=>{
-        this.mediaServerList = data;
+      this.mediaServer.getOnlineMediaServerList((data)=>{
+        this.mediaServerList = data.data;
+        this.proxyParam.mediaServerId = this.mediaServerList[0].id
       })
     },
     mediaServerIdChange:function (){
@@ -227,28 +215,54 @@
     onSubmit: function () {
       this.dialogLoading = true;
       var that = this;
-      that.$axios({
-        method: 'post',
-        url:`/api/proxy/save`,
-        data: that.proxyParam
-      }).then(function (res) {
-        that.dialogLoading = false;
-        if (typeof (res.data.code) != "undefined" && res.data.code === 0) {
-          that.$message({
-            showClose: true,
-            message: res.data.msg,
-            type: "success",
-          });
-          that.showDialog = false;
-          if (that.listChangeCallback != null) {
-            that.listChangeCallback();
-            that.dialogLoading = false;
+      if(this.isUpdate){
+        that.$axios({
+          method: 'post',
+          url:`/api/proxy/update`,
+          data: that.proxyParam
+        }).then(function (res) {
+          that.dialogLoading = false;
+          if (typeof (res.data.code) != "undefined" && res.data.code === 0) {
+            that.$message({
+              showClose: true,
+              message: res.data.msg,
+              type: "success",
+            });
+            that.showDialog = false;
+            if (that.listChangeCallback != null) {
+              that.listChangeCallback();
+              that.dialogLoading = false;
+            }
           }
-        }
-      }).catch(function (error) {
-        console.log(error);
-        this.dialogLoading = false;
-      });
+        }).catch(function (error) {
+          console.log(error);
+          this.dialogLoading = false;
+        });
+      }else{
+        that.$axios({
+          method: 'post',
+          url:`/api/proxy/save`,
+          data: that.proxyParam
+        }).then(function (res) {
+          that.dialogLoading = false;
+          if (typeof (res.data.code) != "undefined" && res.data.code === 0) {
+            that.$message({
+              showClose: true,
+              message: res.data.msg,
+              type: "success",
+            });
+            that.showDialog = false;
+            if (that.listChangeCallback != null) {
+              that.listChangeCallback();
+              that.dialogLoading = false;
+            }
+          }
+        }).catch(function (error) {
+          console.log(error);
+          this.dialogLoading = false;
+        });
+      }
+
     },
     close: function () {
       this.showDialog = false;

--
Gitblit v1.8.0