diff --git a/src/views/photographicDevice/index.vue b/src/views/photographicDevice/index.vue index 9166cc7..fe24f73 100644 --- a/src/views/photographicDevice/index.vue +++ b/src/views/photographicDevice/index.vue @@ -261,7 +261,7 @@ 打开 @@ -595,10 +595,13 @@ export default { }) .then(() => { // 行设置向后台请求删除数据 - deleteTerminalJoggle({ list: this.deleteArr }).then((res) => { - console.log(res); - this.terminalList(); //刷新 - }); + deleteTerminalJoggle({ list: this.deleteArr, type: 0 }).then( + (res) => { + console.log(res); + this.deleteArr = []; + this.terminalList(); //刷新 + } + ); this.$message({ duration: 1500, type: "success", @@ -615,6 +618,43 @@ export default { // }); }); }, + //打开该装置 + handleOpen(data) { + console.log(data); + this.deleteArr.push({ + termid: data.id, + }); + console.log(this.deleteArr); + this.$confirm("确定要打开该装置?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "success", + }) + .then(() => { + // 行设置向后台请求删除数据 + deleteTerminalJoggle({ list: this.deleteArr, type: 1 }).then( + (res) => { + console.log(res); + this.deleteArr = []; + this.terminalList(); //刷新 + } + ); + this.$message({ + duration: 1500, + type: "success", + message: "打开成功!", + showClose: true, + }); + }) + .catch(() => { + // this.$message({ + // duration: 1500, + // type: "info", + // message: "已取消删除", + // showClose: true, + // }); + }); + }, //点击分页 handleCurrentChange(val) { this.page = val; diff --git a/vue.config.js b/vue.config.js index dae853c..a1e43d3 100644 --- a/vue.config.js +++ b/vue.config.js @@ -21,11 +21,11 @@ module.exports = defineConfig({ proxy: { "/api": { //表示拦截以/api开头的请求路径 - //target: "http://47.96.238.157:8093", //阿里云服务器环境 - target: "http://180.166.218.222:40080", //dell + target: "http://47.96.238.157:8093", //阿里云服务器环境 + //target: "http://180.166.218.222:40080", //dell changOrigin: true, //是否开启跨域 pathRewrite: { - "^/api": "/api", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的 + "^/api": "", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的 }, }, },