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

@ -65,18 +65,6 @@
编辑 编辑
</el-button> </el-button>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-button size="medium" icon="el-icon-s-open" type="text"
v-if="scope.row.subCount > 0 || scope.row.parental === 1"
@click="changeSubchannel(scope.row)">查看
</el-button>
<el-divider v-if="scope.row.subCount > 0 || scope.row.parental === 1" direction="vertical"></el-divider>
<!-- <el-button size="medium" v-bind:disabled="device == null || device.online === 0"-->
<!-- icon="el-icon-video-camera"-->
<!-- type="text" @click="queryRecords(scope.row)">设备录像-->
<!-- </el-button>-->
<!-- <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-cloudy"-->
<!-- type="text" @click="queryCloudRecords(scope.row)">云端录像-->
<!-- </el-button>-->
<el-dropdown @command="(command)=>{moreClick(command, scope.row)}"> <el-dropdown @command="(command)=>{moreClick(command, scope.row)}">
<el-button size="medium" type="text" > <el-button size="medium" type="text" >
更多功能<i class="el-icon-arrow-down el-icon--right"></i> 更多功能<i class="el-icon-arrow-down el-icon--right"></i>
@ -230,7 +218,7 @@ export default {
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
}).catch(function (e) { }).catch((e)=> {
console.error(e) console.error(e)
this.isLoging = false; this.isLoging = false;
// that.$message.error(""); // that.$message.error("");
@ -405,11 +393,15 @@ export default {
}, },
// //
handleEdit(row) { handleEdit(row) {
if (this.isEdit()) { this.$refs.channelEdit.openDialog(row, this.deviceId, () => {
this.$message.warning('请保存当前编辑项!'); this.$refs.channelEdit.close();
} else { this.$message({
row.edit = true; showClose: true,
} message: "修改成功",
type: "success",
});
setTimeout(this.getList, 200)
})
} }
} }
}; };

View File

@ -41,6 +41,7 @@ export default {
showDialog: false, showDialog: false,
isLoging: false, isLoging: false,
form: {}, form: {},
row: "",
deviceId: "", deviceId: "",
isEdit: false, isEdit: false,
rules: { rules: {
@ -53,26 +54,21 @@ export default {
console.log(row) console.log(row)
this.showDialog = true; this.showDialog = true;
this.isEdit = false; this.isEdit = false;
this.form = {};
if (row) { if (row) {
this.isEdit = true; this.isEdit = true;
}
this.form = {};
this.deviceId = deviceId;
this.listChangeCallback = callback;
if (row != null) {
this.form = row; this.form = row;
} }
this.deviceId = deviceId;
this.listChangeCallback = callback;
}, },
onSubmit: function () { onSubmit: function () {
console.log("onSubmit"); console.log("onSubmit");
let params = this.form
this.$axios({ this.$axios({
method: 'post', method: 'post',
url:`/api/jt1078/terminal/channel/${this.isEdit?'update':'add'}/`, url:`/api/jt1078/terminal/channel/${this.isEdit?'update':'add'}/`,
params: { params: params
terminalDbId: this.deviceId,
name: this.form.name,
channelId: this.form.channelId,
}
}).then((res) => { }).then((res) => {
console.log(res.data) console.log(res.data)
if (res.data.code === 0) { if (res.data.code === 0) {