临时提交

dev/数据库统合
648540858 2024-11-23 14:51:13 +08:00
parent a35c1193f2
commit c2ad767d89
1 changed files with 20 additions and 16 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div id="linkChannelRecord" style="width: 100%; background-color: #FFFFFF; display: grid; grid-template-columns: 200px auto;"> <div id="linkChannelRecord" style="width: 100%; background-color: #FFFFFF; display: grid; grid-template-columns: 200px auto;">
<el-dialog title="通道共享" v-loading="dialogLoading" v-if="showDialog" top="2rem" width="80%" :close-on-click-modal="false" :visible.sync="showDialog" :destroy-on-close="true" @close="close()"> <el-dialog title="通道关联" v-loading="dialogLoading" v-if="showDialog" top="2rem" width="80%" :close-on-click-modal="false" :visible.sync="showDialog" :destroy-on-close="true" @close="close()">
<div style="display: grid; grid-template-columns: 100px auto;"> <div style="display: grid; grid-template-columns: 100px auto;">
<el-tabs tab-position="left" style="" v-model="hasLink" @tab-click="search"> <el-tabs tab-position="left" style="" v-model="hasLink" @tab-click="search">
<el-tab-pane label="未关联" name="false"></el-tab-pane> <el-tab-pane label="未关联" name="false"></el-tab-pane>
@ -181,13 +181,17 @@ export default {
return; return;
} }
this.loading = true this.loading = true
this.linkPlan({
planId: this.planId,
channelIds: channels
}).cache
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: `/api/record/plan/link`, url: `/api/record/plan/link`,
data: { data: {
planId: this.planId, planId: this.planId,
all: true,
channelIds: channels channelIds: channels
} }
}).then((res)=> { }).then((res)=> {
@ -220,20 +224,19 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.loading = true this.loading = true
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: `/api/platform/channel/add`, url: `/api/record/plan/link`,
data: { data: {
platformId: this.platformId, planId: this.planId,
all: true all: true
} }
}).then((res)=> { }).then((res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$message.success({ this.$message.success({
showClose: true, showClose: true,
message: "保存成功" message: "保存成功"
}) })
this.getChannelList() this.getChannelList()
}else { }else {
this.$message.error({ this.$message.error({
@ -261,10 +264,10 @@ export default {
} }
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: `/api/platform/channel/device/add`, url: `/api/record/plan/link`,
data: { data: {
platformId: this.platformId, planId: this.planId,
deviceIds: deviceIds, deviceDbIds: deviceIds
} }
}).then((res)=> { }).then((res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {
@ -272,13 +275,14 @@ export default {
showClose: true, showClose: true,
message: "保存成功" message: "保存成功"
}) })
this.initData() this.getChannelList()
}else { }else {
this.$message.error({ this.$message.error({
showClose: true, showClose: true,
message: res.data.msg message: res.data.msg
}) })
} }
this.loading = false
}).catch((error)=> { }).catch((error)=> {
this.$message.error({ this.$message.error({
showClose: true, showClose: true,
@ -297,10 +301,9 @@ export default {
} }
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: `/api/platform/channel/device/remove`, url: `/api/record/plan/link`,
data: { data: {
platformId: this.platformId, deviceDbIds: deviceIds
deviceIds: deviceIds,
} }
}).then((res)=> { }).then((res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {
@ -308,13 +311,14 @@ export default {
showClose: true, showClose: true,
message: "保存成功" message: "保存成功"
}) })
this.initData() this.getChannelList()
}else { }else {
this.$message.error({ this.$message.error({
showClose: true, showClose: true,
message: res.data.msg message: res.data.msg
}) })
} }
this.loading = false
}).catch((error)=> { }).catch((error)=> {
this.$message.error({ this.$message.error({
showClose: true, showClose: true,