201 lines
6.4 KiB
Vue
201 lines
6.4 KiB
Vue
<template>
|
|
<a-card :bordered="false">
|
|
<div class="table-page-search-wrapper">
|
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
|
<a-row :gutter="24">
|
|
<!--标题-->
|
|
<a-col :md="6" :sm="12">
|
|
<a-form-item :label="$t('title')">
|
|
<a-input :placeholder="$t('pleaseEnter') + $t('title')" v-model="queryParam.dynamicHeading" />
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :md="6" :sm="12">
|
|
<a-form-item :label="$t('standardRegulationLibrary.dynamicMessage.releaseStatus')">
|
|
<j-dict-select-tag :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.dynamicMessage.releaseStatus')"
|
|
dict-code="send_status"
|
|
v-model="queryParam.releaseStatus"/>
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :md="6" :sm="8">
|
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
|
<a-button type="primary"
|
|
@click="searchQuery"
|
|
icon="search"
|
|
style="margin-left: 8px"
|
|
v-has="'dynamicMessage:search'">
|
|
{{ $t('query') }}
|
|
</a-button>
|
|
<a-button type="primary" @click="searchReset" icon="reload" ghost>{{ $t('reset') }}</a-button>
|
|
</span>
|
|
</a-col>
|
|
</a-row>
|
|
</a-form>
|
|
</div>
|
|
<div class="table-operator">
|
|
<!--新增-->
|
|
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'dynamicMessage:add'">{{ $t('newlyAdded') }}</a-button>
|
|
<!--批量删除-->
|
|
<a-button type="danger" icon="delete" ghost @click="batchDel" v-has="'dynamicMessage:deleteBatch'">{{ $t('batchDelete') }}
|
|
</a-button>
|
|
</div>
|
|
<div>
|
|
<j-table
|
|
:columns="columns"
|
|
:dataSource="dataSource"
|
|
:can-drag="true"
|
|
rowKey="id"
|
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
:pagination="ipagination"
|
|
:scroll="{x: 1000, y: yScrollHeight}"
|
|
:loading="loading"
|
|
:operation-list="operationList"
|
|
@change="handleTableChange"
|
|
@operationClick="operationClick">
|
|
|
|
<!-- 标准编号-->
|
|
<template v-slot:click="{text, record}">
|
|
<a-tooltip overlay-class-name="tooltip-style">
|
|
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
|
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{ text }}</div>
|
|
<div v-else class="table-text">{{ global.emptyLine }}</div>
|
|
</a-tooltip>
|
|
</template>
|
|
|
|
</j-table>
|
|
</div>
|
|
|
|
</a-card>
|
|
</template>
|
|
|
|
<script>
|
|
import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
|
|
import JTable from '../../../components/jero/JTable.vue'
|
|
import { mapGetters } from 'vuex'
|
|
|
|
export default {
|
|
name: 'DynamicMessageList',
|
|
components: { JTable },
|
|
mixins: [JeroListMixin],
|
|
computed: {
|
|
...mapGetters(['userInfo']),
|
|
// 是否管理员
|
|
isAdmin () {
|
|
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
|
|
const userRoleList = this.userInfo.roleCode.split(',')
|
|
return userRoleList.some(tt => adminRoleList.includes(tt))
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
operationList: [
|
|
// 编辑
|
|
{
|
|
text: this.$t('edit'),
|
|
clickEvent: 'handleEdit',
|
|
has: 'dynamicMessage:edit',
|
|
// 管理员可以编辑/删除所有,编辑人能修改/删除自己发布的,其他用户只能收藏/查看和分享
|
|
show: (record) => {
|
|
return this.isAdmin || record.writer === this.userInfo.id
|
|
}
|
|
},
|
|
// 删除
|
|
{
|
|
text: this.$t('delete'),
|
|
clickEvent: 'handleDelete',
|
|
has: 'dynamicMessage:delete',
|
|
// 管理员可以编辑/删除所有,编辑人能修改/删除自己发布的,其他用户只能收藏/查看和分享
|
|
show: (record) => {
|
|
return this.isAdmin || record.writer === this.userInfo.id
|
|
}
|
|
}
|
|
],
|
|
columns: [
|
|
// 动态标题
|
|
{
|
|
dataIndex: 'dynamicHeading',
|
|
title: this.$t('standardRegulationLibrary.dynamicMessage.dynamicHeading'),
|
|
width: 200,
|
|
scopedSlots: { customRender: 'click' }
|
|
},
|
|
// 动态分类
|
|
{
|
|
dataIndex: 'dynamicClassification_dictText',
|
|
title: this.$t('standardRegulationLibrary.dynamicMessage.dynamicCataloging'),
|
|
width: 150,
|
|
scopedSlots: { customRender: 'dictText' }
|
|
},
|
|
// 来源
|
|
{
|
|
dataIndex: 'source',
|
|
title: this.$t('standardRegulationLibrary.dynamicMessage.source'),
|
|
width: 150
|
|
},
|
|
// 编辑人
|
|
{
|
|
dataIndex: 'writer_dictText',
|
|
title: this.$t('docTool.split.editor'),
|
|
width: 150
|
|
},
|
|
// 发布状态
|
|
{
|
|
dataIndex: 'releaseStatus_dictText',
|
|
title: this.$t('standardRegulationLibrary.dynamicMessage.releaseStatus'),
|
|
width: 150,
|
|
scopedSlots: { customRender: 'dictText' }
|
|
},
|
|
// 发布时间
|
|
{
|
|
dataIndex: 'releaseTime',
|
|
title: this.$t('standardRegulationLibrary.dynamicMessage.releaseTime'),
|
|
width: 150
|
|
},
|
|
// 操作
|
|
{
|
|
title: this.$t('operation'),
|
|
fixed: 'right',
|
|
width: 150,
|
|
scopedSlots: { customRender: 'action' }
|
|
}
|
|
],
|
|
url: {
|
|
list: '/laws/standard/lawsNewsFeed/page',
|
|
delete: '/laws/standard/lawsNewsFeed/delete',
|
|
deleteBatch: '/laws/standard/lawsNewsFeed/deleteBatch'
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
handleAdd () {
|
|
this.$router.push({
|
|
path: '/standardRegulationLibrary/DynamicMessageFormPage',
|
|
query: {
|
|
title: this.$t('newlyAdded')
|
|
}
|
|
})
|
|
},
|
|
handleEdit ({ id }) {
|
|
this.$router.push({
|
|
path: '/standardRegulationLibrary/DynamicMessageFormPage',
|
|
query: {
|
|
title: this.$t('edit'),
|
|
id
|
|
}
|
|
})
|
|
},
|
|
toDetailPage ({ id }) {
|
|
this.$router.push({
|
|
path: '/standardRegulationLibrary/DynamicMessageDetail',
|
|
query: {
|
|
id
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
@import '~@assets/less/common.less';
|
|
|
|
</style>
|