完成通道共享

This commit is contained in:
648540858
2024-08-16 16:23:54 +08:00
parent 976c089b7f
commit 326025ee85
10 changed files with 426 additions and 357 deletions

View File

@@ -27,7 +27,9 @@
<el-button v-if="hasShare ==='true'" size="mini" type="danger" @click="remove()">
移除
</el-button>
<el-button icon="el-icon-refresh-right" circle size="mini" @click="getChannelList()"></el-button>
<el-button size="mini" @click="addAll()">全部添加</el-button>
<el-button size="mini" @click="removeAll()">全部移除</el-button>
<el-button size="mini" @click="getChannelList()">刷新</el-button>
</div>
</div>
</div>
@@ -86,6 +88,7 @@
export default {
name: 'shareChannelAdd',
components: {},
props: [ 'platformId'],
data() {
return {
channelList: [],
@@ -190,6 +193,42 @@ export default {
this.$message.error(error)
this.loading = false
});
},
addAll: function (row) {
this.$confirm("确定全部添加?", '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.loading = true
this.$axios({
method: 'post',
url: `/api/platform/channel/add`,
data: {
platformId: this.platformId,
all: true
}
}).then((res)=> {
if (res.data.code === 0) {
this.$message.success("保存成功")
this.getChannelList()
}else {
this.$message.error(res.data.msg)
}
this.loading = false
}).catch((error)=> {
this.$message.error(error)
this.loading = false
});
}).catch(() => {
});
},
remove: function (row) {
let channels = []
@@ -203,9 +242,10 @@ export default {
this.loading = true
this.$axios({
method: 'post',
url: `/api/platform/channel/delete`,
method: 'delete',
url: `/api/platform/channel/remove`,
data: {
platformId: this.platformId,
channelIds: channels
}
}).then((res)=> {
@@ -221,6 +261,38 @@ export default {
this.loading = false
});
},
removeAll: function (row) {
this.$confirm("确定全部移除?", '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
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("保存成功")
this.getChannelList()
}else {
this.$message.error(res.data.msg)
}
this.loading = false
}).catch((error)=> {
this.$message.error(error)
this.loading = false
});
}).catch(() => {
});
},
search: function () {
this.currentPage = 1;
this.total = 0;