收藏列表

This commit is contained in:
caoyang
2022-02-25 16:07:56 +08:00
parent 59aaf52dda
commit 51484a49e1
7 changed files with 192 additions and 54 deletions
@@ -37,22 +37,22 @@
</a-form>
</div>
</div>
<div class="table-operator" style="margin-top: 10px">
<a-button @click="handleBatManage" type="primary">订阅领域管理</a-button>
<a-button @click="handleBatCancel" type="danger">批量取消</a-button>
<div class="table-operator">
<div class="operator-text" @click="handleBatManage">
<a-icon type="plus" />
订阅领域管理
</div>
<div class="operator-text" @click="handleBatCancel">
<a-icon type="delete" />
批量取消
</div>
</div>
<div class="colloction-table">
<a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" class="tag-con-table">
<a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" :loading="loading" class="tag-con-table">
<a slot="serialNumber" slot-scope="text, record" @click="numberClick(record)">{{ text }}</a>
<!-- <a slot="title" slot-scope="text, record" @click="titleClick(record)">{{ text }}</a>-->
<template slot="action" slot-scope="text, record">
<a-popconfirm
v-if="tableData.length"
title="确定取消订阅?"
@confirm="() => onCancel(record)"
>
<a class="action-delete" href="javascript:;">取消订阅</a>
</a-popconfirm>
<a class="action-delete" href="javascript:;" @click="onCancel(record)">取消订阅</a>
</template>
</a-table>
<div class="page" v-if="tableData.length > 0">
@@ -60,6 +60,7 @@
:show-total="total => ` ${total} `"
show-quick-jumper
show-size-changer
:current="queryParams.pageNo"
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"
@@ -129,6 +130,8 @@
],
tableData:[], //列表数据
visible:false,
selecIds:'',
loading:false
}
},
mounted() {
@@ -140,9 +143,11 @@
let params={
...this.queryParams
}
getAction(``,params).then(res=>{
this.loading=true
getAction(`subscribe/onlCgformSubscribe/page`,params).then(res=>{
if(res.success){
// this.tableData= { ...res.result.records }
this.tableData= [ ...res.result.records ]
this.loading=false
}
})
},//搜索
@@ -155,11 +160,52 @@
},
//批量取消收藏
handleBatCancel(){
let params={
ids:this.selecIds
}
if(this.selecIds){
this.$confirm({
title: '确认批量取消订阅?',
content: '',
onOk:
async () => {
deleteAction(`subscribe/onlCgformSubscribe/deleteBatch`,params).then(res=> {
if(res.success){
this.$message.success(res.message)
this.selectedRowKeys = []
this.loadData()
}else{
this.$message.warning(res.message)
}
})
},
onCancel() {},
});
}else{
this.$message.warning('请选择至少一条数据')
}
},
//取消收藏
onCancel(record){
let params={
id:record.id
}
this.$confirm({
title: '确认取消订阅?',
content: '',
onOk:
async () => {
deleteAction(`subscribe/onlCgformSubscribe/delete`,params).then(res=> {
if(res.success){
this.$message.success(res.message)
this.loadData()
}else{
this.$message.warning(res.message)
}
})
},
onCancel() {},
});
},
//清空
searchReset(){
@@ -181,8 +227,14 @@
},
//选择框
onSelectChange(selectedRowKeys,rows) {
console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys;
let ids=[]
if(rows && rows.length>0){
rows.forEach(item=>{
ids.push(item.id)
})
}
this.selecIds=ids.join(',')
},
//点击编号
numberClick(records){
@@ -199,6 +251,15 @@
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.subscribtion{
.subscribtion-search-wrapper{
margin-bottom: 20px;
}
.page{
margin-top: 20px;
}
}
</style>
<style lang="less">