收藏列表

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
+2 -2
View File
@@ -283,7 +283,7 @@
},
/** 上传文件的回调 */
uploadSuccess(data) {
console.log(data)
// console.log(data)
let attIdList = []
if(data && data.length>0){
data.map(item => {
@@ -343,7 +343,7 @@
rules[res.db_field_name] = rule
}
})
console.log(rules)
// console.log(rules)
this.$set(this, 'rules', rules)
this.isFormInline = true
this.confirmLoading = false
@@ -10,13 +10,13 @@
:model="queryParams"
ref="tagEditForm"
>
<a-row :gutter="44">
<a-col :md="6" :sm="12">
<a-row :gutter="24" type="flex" justify="start">
<a-col :md="6" :sm="8">
<a-form-model-item :label="'编号'">
<j-input :placeholder="'请输入编号'" v-model="queryParams.serialNumber"></j-input>
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="12">
<a-col :md="6" :sm="8">
<a-form-model-item :label="'标题'">
<j-input :placeholder="'请输入标题'" v-model="queryParams.title"></j-input>
</a-form-model-item>
@@ -37,21 +37,18 @@
</a-form>
</div>
</div>
<div class="table-operator" style="margin-top: 10px">
<a-button @click="handleBatCancel" type="primary">批量取消收藏</a-button>
<div class="table-operator">
<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">
@@ -59,6 +56,7 @@
:show-total="total => ` ${total} `"
show-quick-jumper
show-size-changer
:current="queryParams.pageNo"
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"
@@ -71,6 +69,7 @@
</template>
<script>
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
import eventBUs from '../../../common/event'
// import search from '@/components/search'
export default {
name:'collection',
@@ -122,6 +121,8 @@
}
],
tableData:[], //列表数据
selecIds:'',
loading:false
}
},
mounted() {
@@ -133,9 +134,11 @@
let params={
...this.queryParams
}
this.loading=true
getAction(`collection/onlCgformCollection/page`,params).then(res=>{
if(res.success){
this.tableData= { ...res.result.records }
this.tableData= [ ...res.result.records ]
this.loading=false
}
})
},//搜索
@@ -144,11 +147,52 @@
},
//批量取消收藏
handleBatCancel(){
let params={
ids:this.selecIds
}
if(this.selecIds){
this.$confirm({
title: '确认批量取消收藏?',
content: '',
onOk:
async () => {
deleteAction(`collection/onlCgformCollection/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(`collection/onlCgformCollection/delete`,params).then(res=> {
if(res.success){
this.$message.success(res.message)
this.loadData()
}else{
this.$message.warning(res.message)
}
})
},
onCancel() {},
});
},
//清空
searchReset(){
@@ -170,8 +214,15 @@
},
//选择框
onSelectChange(selectedRowKeys,rows) {
console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys;
this.selectedRowKeys = selectedRowKeys
let ids=[]
if(rows && rows.length>0){
rows.forEach(item=>{
ids.push(item.id)
})
}
this.selecIds=ids.join(',')
// console.log('selectedRowKeys changed: ', ids);
},
//点击编号
numberClick(records){
@@ -186,7 +237,17 @@
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.collection{
.collection-search-wrapper{
margin-bottom: 20px;
}
.colloction-table{
.page{
margin-top: 20px;
}
}
}
</style>
<style lang="less">
.collection{
+13 -13
View File
@@ -4,20 +4,20 @@
<div class="table-page-search-wrapper">
<search :flag="'2'" :url="url"/>
</div>
<div class="table-operator">
<div class="operator-text" @click="handleUpload">
<a-icon type="plus" />
上传
</div>
<div class="operator-text" @click="handleFileExport">
<a-icon type="export" />
调取已入库文件
</div>
<div class="operator-text" @click="handleDel">
<a-icon type="delete" />
批量删除
</div>
<div class="table-operator">
<div class="operator-text" @click="handleUpload">
<a-icon type="plus" />
上传
</div>
<div class="operator-text" @click="handleFileExport">
<a-icon type="export" />
调取已入库文件
</div>
<div class="operator-text" @click="handleDel">
<a-icon type="delete" />
批量删除
</div>
</div>
<!-- 上传弹框-->
<a-modal
@@ -0,0 +1,15 @@
<template>
<div class="split-detail">
splitDetail
</div>
</template>
<script>
export default {
name: 'splitDetail'
}
</script>
<style scoped>
</style>
@@ -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">
@@ -69,8 +69,8 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="展示区域" prop="showArea">
<a-select placeholder="请选择展示区域" v-model="form.showArea" @change="handleChange">
<a-form-model-item label="展示区域" prop="areaId">
<a-select placeholder="请选择展示区域" v-model="form.areaId" @change="handleChange">
<a-select-option v-for="(item,index) in areaOptions" :key="item.id" :value="item.id">
{{item.showArea}}
</a-select-option>
@@ -195,7 +195,7 @@
isShowForm: [
{ required: true, message: '请选择是否显示文档库列表',trigger: 'change'},
],
showArea: [
areaId: [
{ required: true, message: '请输入展示区域!',trigger: 'change'},
],
isQuery: [
@@ -337,7 +337,7 @@
})
},
popupCallback(row){
this.form.setFieldsValue(pick(row,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowForm','showArea','isQuery','isShowLawsList','isShowSearch'))
this.form.setFieldsValue(pick(row,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowForm','areaId','isQuery','isShowLawsList','isShowSearch'))
},
//正则替换小数点
limitNumber(value) {
@@ -31,6 +31,7 @@
:show-total="total => ` ${total} `"
show-quick-jumper
show-size-changer
:current="queryParams.pageNo"
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"