Files
laws_weilai/jero-web/src/views/documentManage/subscribtion/index.vue
T
高嵩 b0b8f36e92 Merge remote-tracking branch 'origin/feature_dev_20221129_UI' into fix_2nd_period
# Conflicts:
#	jero-web/src/components/tableCollection/index1.vue
#	jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/components/initiatingProcess.vue
#	jero-web/src/views/documentManage/collection/index.vue
#	jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue
#	jero-web/src/views/projectManagement/components/listOfRegulations.vue
#	jero-web/src/views/projectManagement/projectStatusBoard/components/projectStatusAndProgress.vue
#	jero-web/src/views/projectManagement/projectStatusBoard/index.vue
2022-12-30 15:53:39 +08:00

414 lines
12 KiB
Java

<template>
<div class="subscribtion">
<a-card :bordered="false">
<div class="subscribtion-search-wrapper">
<div class="subscribtion-search-header">
<!-- <search :url="url" :flag="'1'"></search>-->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('standard')">
<span>{{$t('standard')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
v-model="queryParams.serialNumber"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('title')">
<span>{{$t('title')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
v-model="queryParams.title"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('status')">
<span>{{$t('status')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParams.state"
:placeholder="$t('PleaseSelect')+$t('status')"
:type="'select'"
:triggerChange="false" :dictCode="'state'"/>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px"
class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
</div>
</div>
<div class="table-operator">
<div class="operator-text" @click="handleBatManage">
<a-icon type="plus"/>
{{ $t('SubscriptionManagement') }}
</div>
<div class="operator-text" @click="handleBatCancel">
<a-icon type="delete"/>
{{ $t('BatchCancellation') }}
</div>
</div>
<div class="colloction-table">
<a-table
ref="table"
size="middle"
rowKey="id"
:scroll="{x: '100%'}"
:columns="columns"
:dataSource="tableData"
:pagination="false"
:loading="loading"
@change="tableOnChange"
: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('CancelSubscribe')}}</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>
</div>
</template>
<script>
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
import SubArea from './module/SubArea'
export default {
name: 'subscribtion',
components: {
SubArea
},
data() {
return {
selectedRowKeys: [],
queryParams: {
pageNo: 1,
pageSize: 10
}, //搜索条件
total: 0,
orderBy: '1',
orderByField: '',
//列表表头
columns: [
{
title: this.$t('standard'),
dataIndex: 'serialNumber',
key: 'serialNumber',
align: 'left',
width: 180,
scopedSlots: { customRender: 'serialNumber' },
sorter:true,
ellipsis: true
},
{
title: this.$t('title'),
align: 'left',
width: 180,
dataIndex: 'title',
scopedSlots: { customRender: 'serialtitle' },
ellipsis: true
},
{
title: this.$t('status'),
align: 'left',
width: 180,
dataIndex: 'state',
sorter:true,
ellipsis: true
},
{
title: this.$t('subscriptionTime'),
align: 'left',
width: 180,
dataIndex: 'createTime',
sorter:true,
ellipsis: true
},
{
title: this.$t('operation'),
dataIndex: 'action',
fixed: 'right',
scopedSlots: { customRender: 'action' },
align: 'left',
width: 170
}
],
tableData: [], //列表数据
visible: false,
selecIds: [],
loading: false,
url: {
tableHeader: 'subscribe/onlCgformSubscribe/getHeader', //表格头部字段
seachList: 'subscribe/onlCgformSubscribe/queryCondition', //搜索字段
tableList: 'subscribe/onlCgformSubscribe/page' //表格数据
},
OperationList: [
{
text: this.$t('CancelSubscribe'),
ClickEvent: 'onCancel'
}
]
}
},
mounted() {
this.loadData()
},
methods: {
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
if(sorter.columnKey == 'serialNumber'){
this.orderByField = 'serial_number'
} else if(sorter.columnKey == 'createTime') {
this.orderByField = 'create_time'
} else{
this.orderByField = sorter.columnKey
}
this.loadData()
},
//获取列表数据
loadData() {
let params = {
orderBy: this.orderBy,
orderByField: this.orderByField,
...this.queryParams
}
this.loading = true
postAction(`subscribe/onlCgformSubscribe/page`, params).then(res => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length == 0) {
this.queryParams.pageNo = 1
this.loadData()
return
}
this.tableData = [...res.result.records]
this.total = res.result.total
this.loading = false
}
})
},//搜索
searchQuery() {
this.loadData()
},
//订阅领域管理
handleBatManage() {
this.visible = true
},
//批量取消收藏
handleBatCancel() {
let params = {
ids: this.selecIds.join(',')
}
if (this.selecIds && this.selecIds.length > 0) {
this.$confirm({
title: this.$t('confirmBulkUnsubscribe'),
content: '',
onOk:
async () => {
deleteAction(`subscribe/onlCgformSubscribe/deleteBatch`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
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'))
}
})
},
onCancel() {
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
//取消订阅
onCancel(record) {
let params = {
id: record.id
}
this.$confirm({
title: this.$t('unsubscribeConfirm'),
content: '',
onOk:
async () => {
deleteAction(`subscribe/onlCgformSubscribe/delete`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
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'))
}
})
},
onCancel() {
}
})
},
//清空
searchReset() {
this.queryParams = {
pageNo: 1,
pageSize: 10
}
this.loadData()
},
//点击页数
onChangePage(page, pageSize) {
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page, pageSize) {
this.queryParams.pageSize = pageSize
this.queryParams.pageNo = 1
this.loadData()
},
//选择框
onSelectChange(rows) {
this.selectedRowKeys = rows
// let ids=[]
// if(rows && rows.length>0){
// rows.forEach(item=>{
// ids.push(item.id)
// })
// }
this.selecIds = rows
},
//点击编号
numberClick(records) {
},
//点击名称
titleClick(records) {
},
areaVisible(val) {
this.visible = val
},
//跳转详情
onDetail(item) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: {
id: item.documentId,
serial_number: item.serialNumber,
title: item.title
}
})
window.open(newUrl.href, '_blank')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.subscribtion {
.subscribtion-search-wrapper {
margin-bottom: 20px;
}
.page {
margin-top: 20px;
text-align: right;
}
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 100%;
height: 38px;
}
.box-button {
height: 38px;
}
</style>
<style lang="less">
.subscribtion {
.subscribtion-content {
.ant-form-item-control-wrapper {
min-width: 180px;
.ant-form-item {
display: flex;
}
}
}
}
.subscribtion-search-header {
.ant-form-item-control-wrapper {
min-width: 200px;
}
/*.table-page-search-submitButtons {*/
/* float: none !important;*/
/*}*/
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
height: 38px;
}
.box-input .ant-select-selection--single {
height: 38px;
}
</style>