From 69d9692f6194d1e03ec81cf87ea8f0e7a62f7173 Mon Sep 17 00:00:00 2001
From: wangyimeng <421132955@qq.com>
Date: 星期三, 16 三月 2022 15:27:12 +0800
Subject: [PATCH] 删除重复字段
---
web_src/src/components/dialog/StreamProxyEdit.vue | 88 +++++++++++++++++++++++++------------------
1 files changed, 51 insertions(+), 37 deletions(-)
diff --git a/web_src/src/components/dialog/StreamProxyEdit.vue b/web_src/src/components/dialog/StreamProxyEdit.vue
index a6a2058..dea93de 100644
--- a/web_src/src/components/dialog/StreamProxyEdit.vue
+++ b/web_src/src/components/dialog/StreamProxyEdit.vue
@@ -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,
@@ -185,6 +169,7 @@
timeout_ms: [{ required: true, message: "璇疯緭鍏Fmpeg鎺ㄦ祦鎴愬姛瓒呮椂鏃堕棿", trigger: "blur" }],
ffmpeg_cmd_key: [{ required: false, message: "璇疯緭鍏Fmpeg鍛戒护鍙傛暟妯℃澘锛堝彲閫夛級", trigger: "blur" }],
},
+ isUpdate: false,
};
},
methods: {
@@ -192,6 +177,7 @@
this.showDialog = true;
this.listChangeCallback = callback;
if (proxyParam != null) {
+ this.isUpdate=true
this.proxyParam = proxyParam;
}
@@ -207,6 +193,7 @@
this.mediaServer.getOnlineMediaServerList((data)=>{
this.mediaServerList = data.data;
this.proxyParam.mediaServerId = this.mediaServerList[0].id
+ this.mediaServerIdChange()
})
},
mediaServerIdChange:function (){
@@ -220,6 +207,7 @@
}
}).then(function (res) {
that.ffmpegCmdList = res.data.data;
+ that.proxyParam.ffmpeg_cmd_key = Object.keys(res.data.data)[0];
}).catch(function (error) {
console.log(error);
});
@@ -229,28 +217,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