From 9c2c4a92b1afe40d1fa67d0b76149291cd60f5a1 Mon Sep 17 00:00:00 2001
From: panlinlin <648540858@qq.com>
Date: Sat, 8 Jun 2024 23:11:56 +0800
Subject: [PATCH] =?UTF-8?q?1078-=E6=94=AF=E6=8C=81=E7=BC=96=E8=BE=91?=
=?UTF-8?q?=E9=80=9A=E9=81=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web_src/src/components/JTChannelList.vue | 28 +++++++------------
.../src/components/dialog/jtChannelEdit.vue | 16 ++++-------
2 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/web_src/src/components/JTChannelList.vue b/web_src/src/components/JTChannelList.vue
index c8537c1f2..8c3bbcbac 100755
--- a/web_src/src/components/JTChannelList.vue
+++ b/web_src/src/components/JTChannelList.vue
@@ -65,18 +65,6 @@
编辑
- 查看
-
-
-
-
-
-
-
-
-
{moreClick(command, scope.row)}">
更多功能
@@ -230,7 +218,7 @@ export default {
} else {
this.$message.error(res.data.msg);
}
- }).catch(function (e) {
+ }).catch((e)=> {
console.error(e)
this.isLoging = false;
// that.$message.error("请求超时");
@@ -405,11 +393,15 @@ export default {
},
// 编辑
handleEdit(row) {
- if (this.isEdit()) {
- this.$message.warning('请保存当前编辑项!');
- } else {
- row.edit = true;
- }
+ this.$refs.channelEdit.openDialog(row, this.deviceId, () => {
+ this.$refs.channelEdit.close();
+ this.$message({
+ showClose: true,
+ message: "修改成功",
+ type: "success",
+ });
+ setTimeout(this.getList, 200)
+ })
}
}
};
diff --git a/web_src/src/components/dialog/jtChannelEdit.vue b/web_src/src/components/dialog/jtChannelEdit.vue
index 9ff4d6099..b7fb4ee36 100755
--- a/web_src/src/components/dialog/jtChannelEdit.vue
+++ b/web_src/src/components/dialog/jtChannelEdit.vue
@@ -41,6 +41,7 @@ export default {
showDialog: false,
isLoging: false,
form: {},
+ row: "",
deviceId: "",
isEdit: false,
rules: {
@@ -53,26 +54,21 @@ export default {
console.log(row)
this.showDialog = true;
this.isEdit = false;
+ this.form = {};
if (row) {
this.isEdit = true;
- }
- this.form = {};
- this.deviceId = deviceId;
- this.listChangeCallback = callback;
- if (row != null) {
this.form = row;
}
+ this.deviceId = deviceId;
+ this.listChangeCallback = callback;
},
onSubmit: function () {
console.log("onSubmit");
+ let params = this.form
this.$axios({
method: 'post',
url:`/api/jt1078/terminal/channel/${this.isEdit?'update':'add'}/`,
- params: {
- terminalDbId: this.deviceId,
- name: this.form.name,
- channelId: this.form.channelId,
- }
+ params: params
}).then((res) => {
console.log(res.data)
if (res.data.code === 0) {