1078-支持编辑通道

This commit is contained in:
panlinlin
2024-06-08 23:11:56 +08:00
parent 18cfba612b
commit 9c2c4a92b1
2 changed files with 16 additions and 28 deletions

View File

@@ -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) {