bug修改

This commit is contained in:
caoyang
2022-03-10 14:41:42 +08:00
parent bf2e8cf916
commit 90a1ee53eb
16 changed files with 638 additions and 241 deletions
@@ -17,16 +17,38 @@
</div>
</div>
<div class="colloction-table">
<tableData
:url="url"
:flag="'1'"
:OperationList="OperationList"
showAction
@titleClick="titleClick"
@onCancel="onCancel"
@onSelectChange="onSelectChange"
@detailClick="detailClick"
></tableData>
<a-table
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:dataSource="tableData"
:pagination="false"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
>
<span slot="serialNumber" slot-scope="text, record">
<a class="table-del" @click="onDetail(record)">{{record.serialNumber}}</a>
</span>
<span slot="serialtitle" slot-scope="text, record">
<a class="table-del" @click="onDetail(record)">{{record.title}}</a>
</span>
<span slot="action" slot-scope="text, record">
<a class="table-del" @click="onCancel(record)">{{$t('CancelCollection')}}</a>
</span>
</a-table>
<div class="page" v-if="tableData.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+ $t('strip')"
show-quick-jumper
show-size-changer
:current="queryParams.pageNo"
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"
@showSizeChange="SizeChange"
/>
</div>
</div>
<sub-area v-if="visible" :subVisible="visible" @visible="areaVisible"></sub-area>
</a-card>
@@ -56,29 +78,31 @@
//列表表头
columns: [
{
title: '编号',
title: this.$t('standard'),
dataIndex: 'serialNumber',
key: 'serialNumber',
align: "center",
width: 100,
scopedSlots: {customRender: 'serialNumber'},
ellipsis: true,
},
{
title: '标题',
title: this.$t('title'),
align: "center",
width: 100,
dataIndex: 'title',
scopedSlots: {customRender: 'serialtitle'},
ellipsis: true,
},
{
title: '状态',
title: this.$t('status'),
align: "center",
width: 100,
dataIndex: 'state',
ellipsis: true,
},
{
title: '订阅时间',
title: this.$t('subscriptionTime'),
align: "center",
width: 100,
dataIndex: 'createTime',
@@ -94,7 +118,7 @@
],
tableData:[], //列表数据
visible:false,
selecIds:'',
selecIds:[],
loading:false,
url:{
tableHeader: 'subscribe/onlCgformSubscribe/getHeader', //表格头部字段
@@ -136,20 +160,21 @@
//批量取消收藏
handleBatCancel(){
let params={
ids:this.selecIds
ids:this.selecIds.join(',')
}
if(this.selecIds){
if(this.selecIds&&this.selecIds.length>0){
this.$confirm({
title: '确认批量取消订阅?',
title: this.$t('confirmBulkUnsubscribe'),
content: '',
onOk:
async () => {
deleteAction(`subscribe/onlCgformSubscribe/deleteBatch`,params).then(res=> {
if(res.success){
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
// this.selectedRowKeys = []
// this.loadData()
if(this.selecIds.length==this.tableData.length&&this.queryParams.pageNo!==1){
this.queryParams.pageNo=this.queryParams.pageNo-1
}
this.loadData()
}else{
this.$message.warning(this.$t('operationFailed'))
}
@@ -158,24 +183,26 @@
onCancel() {},
});
}else{
this.$message.warning('请选择至少一条数据')
this.$message.warning(this.$t('selectLeastOne'))
}
},
//取消收藏
//取消订阅
onCancel(record){
let params={
id:record.id
}
this.$confirm({
title: '确认取消订阅?',
title: this.$t('unsubscribeConfirm'),
content: '',
onOk:
async () => {
deleteAction(`subscribe/onlCgformSubscribe/delete`,params).then(res=> {
if(res.success){
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
// this.loadData()
if(this.tableData.length==1&&this.queryParams.pageNo!==1){
this.queryParams.pageNo=this.queryParams.pageNo-1
}
this.loadData()
}else{
this.$message.warning(this.$t('operationFailed'))
}
@@ -211,7 +238,7 @@
// ids.push(item.id)
// })
// }
this.selecIds=rows.join(',')
this.selecIds=rows
},
//点击编号
numberClick(records){
@@ -224,7 +251,8 @@
areaVisible(val){
this.visible=val
},
detailClick(item) {
//跳转详情
onDetail(item) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: item
@@ -242,6 +270,7 @@
}
.page{
margin-top: 20px;
text-align: right;
}
}
@@ -76,13 +76,14 @@
getAction(`sys/category/getSysCategoryTree`,params).then(res=> {
if(res.success){
this.data=[...res.result]
this.treeData=this.addAttr(this.data)
this.treeData=[...this.addAttr(this.data)]
// console.log('treeData',this.treeData)
}
})
},
onSearch(){
this.loadData()
// this.treeData=[]
// this.treeData=this.getSearch(this.data)
},
//获取用户的订阅
getSubscribtion(){
@@ -95,7 +96,7 @@
})
this.checkedKeys=[...ids]
// this.selectedKeys=this.checkedKeys
console.log('checkKeys',this.checkedKeys)
// console.log('checkKeys',this.checkedKeys)
}
})
},
@@ -103,9 +104,6 @@
if((Array.isArray(dataI)) && dataI.length>0){
dataI.forEach((item,index)=>{
this.$set(item,'key',item.id)
// if(item.title.indexOf(this.searchValue)!==-1){
// console.log('item.title',item.title)
// }
let arr = [];
this.addAttr(item.children,arr);
});
@@ -113,8 +111,24 @@
// console.log('dataI',dataI)
return dataI
},
getSearch(dataI){
let dataSearch=[]
console.log('tree',this.treeData,this.data)
if((Array.isArray(dataI)) && dataI.length>0){
dataI.forEach((item,index)=>{
this.$set(item,'key',item.id)
if(item.title.indexOf(this.searchValue)>-1){
dataSearch.push(item)
}
let arr = [];
this.addAttr(item.children,arr);
});
}
console.log('dataSearch',dataSearch)
return dataSearch
},
afterVisibleChange(val) {
console.log('visible', val);
// console.log('visible', val);
},
handleOk(e) {
this.confirmLoading = true;
@@ -175,7 +189,7 @@
return null;
})
.filter((item, i, self) => item && self.indexOf(item) === i);
console.log('item',item)
Object.assign(this, {
expandedKeys,
searchValue: value,