From 62e82ea9ee6a73cf7cdcfe1ab1a7b49a23f571e3 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 15 十月 2021 17:58:28 +0800 Subject: [PATCH] 录像下载修复 --- web_src/src/components/dialog/platformEdit.vue | 86 ++++++++++++++++-------------------------- 1 files changed, 33 insertions(+), 53 deletions(-) diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index 4a916e8..968e825 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -75,7 +75,7 @@ </el-form-item> <el-form-item label="鍏朵粬閫夐」"> <el-checkbox label="鍚敤" v-model="platform.enable" @change="checkExpires"></el-checkbox> - <el-checkbox label="浜戝彴鎺у埗" v-model="platform.PTZEnable"></el-checkbox> + <el-checkbox label="浜戝彴鎺у埗" v-model="platform.ptz"></el-checkbox> <el-checkbox label="RTCP淇濇椿" v-model="platform.rtcp"></el-checkbox> </el-form-item> <el-form-item> @@ -105,9 +105,6 @@ 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 { @@ -120,39 +117,22 @@ showDialog: false, isLoging: false, onSubmit_text: "绔嬪嵆鍒涘缓", - // platform: { - // enable: false, - // PTZEnable: true, - // rtcp: false, - // name: null, - // serverGBId: null, - // serverGBDomain: null, - // serverIP: null, - // serverPort: null, - // deviceGBId: null, - // deviceIp: null, - // devicePort: null, - // username: null, - // password: null, - // expires: 300, - // keepTimeout: 60, - // transport: "UDP", - // characterSet: "GB2312", - // }, + platform: { + id: null, enable: true, - PTZEnable: true, + ptz: true, rtcp: false, - name: "娴嬭瘯001", - serverGBId: "34020000002000000001", - serverGBDomain: "3402000000", - serverIP: "192.168.1.141", - serverPort: "5060", - deviceGBId: "34020000001320001101", - deviceIp: "192.168.1.20", - devicePort: "5060", - username: "34020000001320001101", - password: "12345678", + name: null, + serverGBId: null, + serverGBDomain: null, + serverIP: null, + serverPort: null, + deviceGBId: null, + deviceIp: null, + devicePort: null, + username: null, + password: null, expires: 300, keepTimeout: 60, transport: "UDP", @@ -181,36 +161,36 @@ methods: { openDialog: function (platform, callback) { var that = this; - this.$axios - .get(`/api/platforms/serverconfig`) - .then(function (res) { + if (platform == null) { + this.onSubmit_text = "绔嬪嵆鍒涘缓"; + this.$axios({ + method: 'get', + url:`/api/platform/server_config` + }).then(function (res) { console.log(res); that.platform.deviceGBId = res.data.username; that.platform.deviceIp = res.data.deviceIp; that.platform.devicePort = res.data.devicePort; that.platform.username = res.data.username; that.platform.password = res.data.password; - }) - .catch(function (error) { + }).catch(function (error) { console.log(error); }); - this.showDialog = true; - this.listChangeCallback = callback; - if (platform != null) { + }else { this.platform = platform; this.onSubmit_text = "淇濆瓨"; - } else { - this.onSubmit_text = "绔嬪嵆鍒涘缓"; } + this.showDialog = true; + this.listChangeCallback = callback; }, onSubmit: function () { console.log("onSubmit"); var that = this; - that.$axios - .post(`/api/platforms/save`, that.platform) - .then(function (res) { - console.log(res); - console.log(res.data == "success"); + that.$axios({ + method: 'post', + url:`/api/platform/save`, + data: that.platform + }).then(function (res) { if (res.data == "success") { that.$message({ showClose: true, @@ -222,8 +202,7 @@ that.listChangeCallback(); } } - }) - .catch(function (error) { + }).catch(function (error) { console.log(error); }); }, @@ -236,8 +215,9 @@ deviceGBIdExit: async function (deviceGbId) { var result = false; var that = this; - await that.$axios - .post(`/api/platforms/exit/${deviceGbId}`) + await that.$axios({ + method: 'post', + url:`/api/platform/exit/${deviceGbId}`}) .then(function (res) { result = res.data; }) -- Gitblit v1.8.0