|
|
@@ -116,17 +116,19 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
|
|
|
- created() {
|
|
|
- this.initData();
|
|
|
- },
|
|
|
+ created() {},
|
|
|
destroyed() {},
|
|
|
methods: {
|
|
|
openDialog(planId, closeCallback) {
|
|
|
this.planId = planId
|
|
|
this.showDialog = true
|
|
|
this.closeCallback = closeCallback
|
|
|
+ this.initData()
|
|
|
},
|
|
|
initData: function () {
|
|
|
+ this.currentPage= 1;
|
|
|
+ this.count= 15;
|
|
|
+ this.total= 0;
|
|
|
this.getChannelList();
|
|
|
},
|
|
|
currentChange: function (val) {
|
|
|
@@ -168,32 +170,13 @@ export default {
|
|
|
handleSelectionChange: function (val){
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
- add: function (row) {
|
|
|
- let channels = []
|
|
|
- for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
|
- channels.push(this.multipleSelection[i].gbId)
|
|
|
- }
|
|
|
- if (channels.length === 0) {
|
|
|
- this.$message.info({
|
|
|
- showClose: true,
|
|
|
- message: "请选择通道"
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- this.loading = true
|
|
|
- this.linkPlan({
|
|
|
- planId: this.planId,
|
|
|
- channelIds: channels
|
|
|
- }).cache
|
|
|
|
|
|
-
|
|
|
- this.$axios({
|
|
|
+ linkPlan: function (data){
|
|
|
+ this.loading = true
|
|
|
+ return this.$axios({
|
|
|
method: 'post',
|
|
|
url: `/api/record/plan/link`,
|
|
|
- data: {
|
|
|
- planId: this.planId,
|
|
|
- channelIds: channels
|
|
|
- }
|
|
|
+ data: data
|
|
|
}).then((res)=> {
|
|
|
if (res.data.code === 0) {
|
|
|
this.$message.success({
|
|
|
@@ -203,18 +186,36 @@ export default {
|
|
|
this.getChannelList()
|
|
|
}else {
|
|
|
this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: res.data.msg
|
|
|
- })
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.msg
|
|
|
+ })
|
|
|
}
|
|
|
this.loading = false
|
|
|
}).catch((error)=> {
|
|
|
this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: error
|
|
|
- })
|
|
|
+ showClose: true,
|
|
|
+ message: error
|
|
|
+ })
|
|
|
this.loading = false
|
|
|
- });
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ add: function (row) {
|
|
|
+ let channels = []
|
|
|
+ for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
|
+ channels.push(this.multipleSelection[i].gbId)
|
|
|
+ }
|
|
|
+ if (channels.length === 0) {
|
|
|
+ this.$message.info({
|
|
|
+ showClose: true,
|
|
|
+ message: "请选择通道"
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.linkPlan({
|
|
|
+ planId: this.planId,
|
|
|
+ channelIds: channels
|
|
|
+ })
|
|
|
},
|
|
|
addAll: function (row) {
|
|
|
this.$confirm("确定全部添加?", '提示', {
|
|
|
@@ -223,36 +224,11 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.loading = true
|
|
|
- this.$axios({
|
|
|
- method: 'post',
|
|
|
- url: `/api/record/plan/link`,
|
|
|
- data: {
|
|
|
- planId: this.planId,
|
|
|
- all: true
|
|
|
- }
|
|
|
- }).then((res)=> {
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.$message.success({
|
|
|
- showClose: true,
|
|
|
- message: "保存成功"
|
|
|
- })
|
|
|
- this.getChannelList()
|
|
|
- }else {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: res.data.msg
|
|
|
- })
|
|
|
- }
|
|
|
- this.loading = false
|
|
|
- }).catch((error)=> {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: error
|
|
|
- })
|
|
|
- this.loading = false
|
|
|
- });
|
|
|
- }).catch(() => {
|
|
|
+ this.linkPlan({
|
|
|
+ planId: this.planId,
|
|
|
+ allLink: true
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
@@ -262,34 +238,10 @@ export default {
|
|
|
for (let i = 0; i < rows.length; i++) {
|
|
|
deviceIds.push(rows[i].id)
|
|
|
}
|
|
|
- this.$axios({
|
|
|
- method: 'post',
|
|
|
- url: `/api/record/plan/link`,
|
|
|
- data: {
|
|
|
- planId: this.planId,
|
|
|
- deviceDbIds: deviceIds
|
|
|
- }
|
|
|
- }).then((res)=> {
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.$message.success({
|
|
|
- showClose: true,
|
|
|
- message: "保存成功"
|
|
|
- })
|
|
|
- this.getChannelList()
|
|
|
- }else {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: res.data.msg
|
|
|
- })
|
|
|
- }
|
|
|
- this.loading = false
|
|
|
- }).catch((error)=> {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: error
|
|
|
- })
|
|
|
- this.loading = false
|
|
|
- });
|
|
|
+ this.linkPlan({
|
|
|
+ planId: this.planId,
|
|
|
+ deviceDbIds: deviceIds
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
|
|
|
@@ -299,33 +251,9 @@ export default {
|
|
|
for (let i = 0; i < rows.length; i++) {
|
|
|
deviceIds.push(rows[i].id)
|
|
|
}
|
|
|
- this.$axios({
|
|
|
- method: 'post',
|
|
|
- url: `/api/record/plan/link`,
|
|
|
- data: {
|
|
|
- deviceDbIds: deviceIds
|
|
|
- }
|
|
|
- }).then((res)=> {
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.$message.success({
|
|
|
- showClose: true,
|
|
|
- message: "保存成功"
|
|
|
- })
|
|
|
- this.getChannelList()
|
|
|
- }else {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: res.data.msg
|
|
|
- })
|
|
|
- }
|
|
|
- this.loading = false
|
|
|
- }).catch((error)=> {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: error
|
|
|
- })
|
|
|
- this.loading = false
|
|
|
- });
|
|
|
+ this.linkPlan({
|
|
|
+ deviceDbIds: deviceIds
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
remove: function (row) {
|
|
|
@@ -340,36 +268,10 @@ export default {
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
- this.loading = true
|
|
|
|
|
|
- this.$axios({
|
|
|
- method: 'delete',
|
|
|
- url: `/api/platform/channel/remove`,
|
|
|
- data: {
|
|
|
- platformId: this.platformId,
|
|
|
- channelIds: channels
|
|
|
- }
|
|
|
- }).then((res)=> {
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.$message.success({
|
|
|
- showClose: true,
|
|
|
- message: "保存成功"
|
|
|
- })
|
|
|
- this.getChannelList()
|
|
|
- }else {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: res.data.msg
|
|
|
- })
|
|
|
- }
|
|
|
- this.loading = false
|
|
|
- }).catch((error)=> {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: error
|
|
|
- })
|
|
|
- this.loading = false
|
|
|
- });
|
|
|
+ this.linkPlan({
|
|
|
+ channelIds: channels
|
|
|
+ })
|
|
|
},
|
|
|
removeAll: function (row) {
|
|
|
|
|
|
@@ -379,62 +281,11 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.loading = true
|
|
|
- this.$axios({
|
|
|
- method: 'delete',
|
|
|
- url: `/api/platform/channel/remove`,
|
|
|
- data: {
|
|
|
- platformId: this.platformId,
|
|
|
- all: true
|
|
|
- }
|
|
|
- }).then((res)=> {
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.$message.success({
|
|
|
- showClose: true,
|
|
|
- message: "保存成功"
|
|
|
- })
|
|
|
- this.getChannelList()
|
|
|
- }else {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: res.data.msg
|
|
|
- })
|
|
|
- }
|
|
|
- this.loading = false
|
|
|
- }).catch((error)=> {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: error
|
|
|
- })
|
|
|
- this.loading = false
|
|
|
- });
|
|
|
- }).catch(() => {
|
|
|
- });
|
|
|
-
|
|
|
- },
|
|
|
- saveCustom: function (row) {
|
|
|
- this.$axios({
|
|
|
- method: 'post',
|
|
|
- url: `/api/platform/channel/custom/update`,
|
|
|
- data: row
|
|
|
- }).then((res)=> {
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.$message.success({
|
|
|
- showClose: true,
|
|
|
- message: "保存成功"
|
|
|
- })
|
|
|
- this.initData()
|
|
|
- }else {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: res.data.msg
|
|
|
- })
|
|
|
- }
|
|
|
- }).catch((error)=> {
|
|
|
- this.$message.error({
|
|
|
- showClose: true,
|
|
|
- message: error
|
|
|
+ this.linkPlan({
|
|
|
+ planId: this.planId,
|
|
|
+ allLink: false
|
|
|
})
|
|
|
+ }).catch(() => {
|
|
|
});
|
|
|
},
|
|
|
search: function () {
|