385 lines
12 KiB
Vue
385 lines
12 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('standardSelect.standardNumOrName')">
|
|
<a-input :placeholder="$t('pleaseEnter') + $t('standardSelect.standardNumOrName')"
|
|
v-model="queryParam.serialNumberOrName"></a-input>
|
|
</a-form-item>
|
|
</a-col>
|
|
<!--拆分状态-->
|
|
<!-- <a-col :md="6" :sm="12">-->
|
|
<!-- <a-form-item :label="$t('docTool.split.splitState')">-->
|
|
<!-- <j-dict-select-tag-->
|
|
<!-- class="box-input"-->
|
|
<!-- v-model="queryParam.splitStatus"-->
|
|
<!-- :placeholder="$t('pleaseSelect') + $t('docTool.split.splitState')"-->
|
|
<!-- :type="'select'"-->
|
|
<!-- :triggerChange="false"-->
|
|
<!-- dictCode="split_status" />-->
|
|
<!-- </a-form-item>-->
|
|
<!-- </a-col>-->
|
|
<!--编辑人-->
|
|
<!-- <a-col :md="6" :sm="12">-->
|
|
<!-- <a-form-item :label="$t('docTool.split.editor')">-->
|
|
<!-- <a-input :placeholder="$t('pleaseEnter') + $t('docTool.split.editor')" v-model="queryParam.author"></a-input>-->
|
|
<!-- </a-form-item>-->
|
|
<!-- </a-col>-->
|
|
<div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
|
|
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px">
|
|
{{ $t('query') }}
|
|
</a-button>
|
|
<a-button type="primary" @click="searchReset" icon="reload" ghost>{{ $t('reset') }}</a-button>
|
|
</div>
|
|
</a-row>
|
|
</a-form>
|
|
</div>
|
|
<div class="table-operator">
|
|
<!--拆分已入库文本-->
|
|
<a-button icon="plus" type="primary" @click="splitTextClick">
|
|
{{ $t('docTool.split.splitText') }}
|
|
</a-button>
|
|
<!--拆分上传文本-->
|
|
<a-button icon="plus" type="primary" @click="handleModule">
|
|
拆分上传文本
|
|
</a-button>
|
|
<!--导入拆分结果-->
|
|
<a-button icon="download" type="primary" ghost @click="handleExport">
|
|
{{ $t('docTool.split.importResults') }}
|
|
</a-button>
|
|
<!--批量删除-->
|
|
<a-button type="primary" icon="delete" ghost @click="batchDel">
|
|
{{ $t('batchDelete') }}
|
|
</a-button>
|
|
<!--更改权限-->
|
|
<!-- <a-button type="primary" icon="sync" ghost @click="handleChangePermission">-->
|
|
<!-- {{ $t('docTool.split.changePermissions') }}-->
|
|
<!-- </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: '100%', y: yScrollHeight}"
|
|
:loading="loading"
|
|
:operation-list="operationList"
|
|
@change="handleTableChange"
|
|
@operationClick="operationClick">
|
|
|
|
<!--跳转标准详情-->
|
|
<template v-slot:detail="{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>
|
|
|
|
<!--拆分上传文本-->
|
|
<split-is-in-storage ref="splitIsInStorageRef" @ok="modalFormOk"/>
|
|
<!--拆分已入库文本弹框-->
|
|
<split-text ref="splitText" @ok="modalFormOk" />
|
|
<!--导入拆分结果-->
|
|
<import-split-result-modal ref="importResultModal" @ok="modalFormOk" />
|
|
<!--更改权限-->
|
|
<user-select-modal ref="userSelectModal" check-required @change="continueChangePermission" />
|
|
</a-card>
|
|
</template>
|
|
|
|
<script>
|
|
import '../../../assets/less/common.less'
|
|
import JTable from '../../../components/jero/JTable.vue'
|
|
import SplitText from './modules/SplitText.vue'
|
|
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
|
import { releaseSplitStandard, changePermission, withdraw } from '@api/documentToolApi'
|
|
import ImportSplitResultModal from './modules/ImportSplitResultModal.vue'
|
|
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
|
|
import splitIsInStorage from './modules/splitIsInStorage.vue'
|
|
import { SplitStatus, StandardSource } from '@/enums/commonEnums'
|
|
|
|
export default {
|
|
name: 'DocumentSplit',
|
|
components: { JTable, ImportSplitResultModal, UserSelectModal, splitIsInStorage, SplitText },
|
|
mixins: [JeroListMixin],
|
|
computed: {},
|
|
data () {
|
|
return {
|
|
operationList: [
|
|
// 发布
|
|
// {
|
|
// text: this.$t('release'),
|
|
// clickEvent: 'handleRelease',
|
|
// show: (record) => {
|
|
// // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为编辑中可以发布
|
|
// return record.splitStatus === SplitStatus.EDITING.value
|
|
// }
|
|
// },
|
|
// 撤回
|
|
// {
|
|
// text: this.$t('withdraw'),
|
|
// clickEvent: 'handleWithdraw',
|
|
// show: (record) => {
|
|
// // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为已发布可以撤回
|
|
// return record.splitStatus === SplitStatus.RELEASED.value
|
|
// }
|
|
// },
|
|
// 查看
|
|
// {
|
|
// text: this.$t('view'),
|
|
// clickEvent: 'handleDetail'
|
|
// },
|
|
// 编辑
|
|
{
|
|
text: this.$t('view'),
|
|
clickEvent: 'handleEdit',
|
|
// show: (record) => {
|
|
// // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为编辑中可以编辑
|
|
// return record.splitStatus === SplitStatus.EDITING.value
|
|
// }
|
|
},
|
|
// 删除
|
|
{
|
|
text: this.$t('delete'),
|
|
clickEvent: 'handleDelete',
|
|
// show: (record) => {
|
|
// // 创建人(更改权限更改的是这个字段)是当前登录人或用户为管理员,且状态为编辑中可以删除
|
|
// return true
|
|
// }
|
|
}
|
|
],
|
|
columns: [
|
|
// 标准号
|
|
{
|
|
dataIndex: 'serialNumber',
|
|
title: this.$t('standardSelect.standardNumber'),
|
|
width: 150,
|
|
scopedSlots: { customRender: 'detail' }
|
|
},
|
|
// 标准名称
|
|
{
|
|
dataIndex: 'title',
|
|
title: this.$t('standardSelect.standardName'),
|
|
width: 150,
|
|
scopedSlots: { customRender: 'detail' }
|
|
},
|
|
// 文件状态
|
|
{
|
|
dataIndex: 'fileType_dictText',
|
|
title: this.$t('docTool.split.fileStatus'),
|
|
width: 150
|
|
},
|
|
// 文件名称
|
|
{
|
|
dataIndex: 'fileName',
|
|
title: this.$t('fileName'),
|
|
width: 180
|
|
},
|
|
// 拆分状态
|
|
// {
|
|
// dataIndex: 'splitStatus_dictText',
|
|
// title: this.$t('docTool.split.splitState'),
|
|
// width: 150
|
|
// },
|
|
// 编辑人
|
|
// {
|
|
// dataIndex: 'author',
|
|
// title: this.$t('docTool.split.editor'),
|
|
// width: 150
|
|
// },
|
|
// 拆分时间
|
|
{
|
|
dataIndex: 'createTime',
|
|
title: this.$t('docTool.split.splitTime'),
|
|
width: 150
|
|
},
|
|
// 拆分结果
|
|
{
|
|
dataIndex: 'splitResult',
|
|
title: this.$t('docTool.split.splitResult'),
|
|
sorter: true,
|
|
width: 150
|
|
},
|
|
// 操作
|
|
{
|
|
title: this.$t('operation'),
|
|
fixed: 'right',
|
|
width: 150,
|
|
scopedSlots: { customRender: 'action' }
|
|
}
|
|
],
|
|
url: {
|
|
list: '/laws/DocumentTool/documentSplit/queryByPage', // 表格数据
|
|
deleteBatch: '/laws/DocumentTool/documentSplit/deleteBatch', // 批量删除
|
|
delete: '/laws/DocumentTool/documentSplit/delete'
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
// 拆分已入库文本按钮点击
|
|
handleModule () {
|
|
this.$refs.splitIsInStorageRef.open()
|
|
},
|
|
splitTextClick () {
|
|
this.$refs.splitText.open()
|
|
},
|
|
// 导入拆分结果
|
|
handleExport () {
|
|
this.$refs.importResultModal.open()
|
|
},
|
|
/**
|
|
* 发布
|
|
*/
|
|
handleRelease ({ id }) {
|
|
this.$confirm({
|
|
title: this.$t('confirmRelease'),
|
|
content: this.$t('confirmReleaseContent'),
|
|
onOk: () => {
|
|
this.loading = true
|
|
releaseSplitStandard({ id }).then(res => {
|
|
if (res.success) {
|
|
this.$message.success(res.message)
|
|
this.modalFormOk()
|
|
} else {
|
|
this.$message.warn(res.message)
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
/**
|
|
* 撤回
|
|
* @param id
|
|
*/
|
|
handleWithdraw ({ id }) {
|
|
this.$confirm({
|
|
title: this.$t('confirmWithdraw'),
|
|
content: this.$t('confirmWithdrawContent'),
|
|
onOk: () => {
|
|
this.loading = true
|
|
withdraw({ id }).then(res => {
|
|
if (res.success) {
|
|
this.$message.success(res.message)
|
|
this.modalFormOk()
|
|
} else {
|
|
this.$message.warn(res.message)
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
// 编辑
|
|
handleEdit (record) {
|
|
this.$router.push({
|
|
path: '/documentTool/DocumentSplitDetail',
|
|
query: {
|
|
infoId: record.id,
|
|
infoNumber: record.serialNumber,
|
|
createBy: record.createBy,
|
|
standardName: record.title
|
|
}
|
|
})
|
|
},
|
|
/**
|
|
* 表格操作列的查看
|
|
* @param id
|
|
*/
|
|
handleDetail ({ id }) {
|
|
this.$openPageNewSheet({
|
|
path: '/documentTool/StandardSplitSheet',
|
|
query: {
|
|
id
|
|
}
|
|
})
|
|
},
|
|
splitTextVisible (val, num) {
|
|
if (num === 1) {
|
|
this.$refs.tableData.$emit('searchGetData')
|
|
}
|
|
},
|
|
importResultVisible (val, num) {
|
|
if (num === 1) {
|
|
this.$refs.tableData.$emit('searchGetData')
|
|
}
|
|
},
|
|
/**
|
|
* 更改权限
|
|
*/
|
|
handleChangePermission () {
|
|
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
|
|
this.$message.warning(this.$t('selectAtLeastOne'))
|
|
return
|
|
}
|
|
this.$refs.userSelectModal.open()
|
|
},
|
|
continueChangePermission (id) {
|
|
this.loading = true
|
|
const params = {
|
|
ids: this.selectedRowKeys.join(','),
|
|
createBy: id
|
|
}
|
|
changePermission(params).then(res => {
|
|
if (res.success) {
|
|
this.$message.success(res.message)
|
|
this.modalFormOk()
|
|
} else {
|
|
this.$message.warning(res.message)
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
})
|
|
},
|
|
/**
|
|
* 跳转标准详情
|
|
* @param record
|
|
*/
|
|
toDetailPage ({ standardId, splitStandardSource }) {
|
|
let path
|
|
// 根据来源跳转不同的详情页
|
|
switch (splitStandardSource) {
|
|
// 国内
|
|
case StandardSource.DOMESTIC.value:
|
|
path = '/standardRegulationLibrary/DomesticStandardDetail'
|
|
break
|
|
// 海外
|
|
case StandardSource.OVERSEAS.value:
|
|
path = '/standardRegulationLibrary/OverseasStandardDetail'
|
|
break
|
|
// 企标
|
|
case StandardSource.ENTERPRISE.value:
|
|
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
if (!path) {
|
|
return
|
|
}
|
|
const query = {
|
|
id: standardId
|
|
}
|
|
this.$openPageNewSheet({
|
|
path, query
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
@import '~@assets/less/common.less';
|
|
</style>
|