From 999ca5f71919a1cdf31b9f4f61ed10faf22a1705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Thu, 12 Oct 2023 17:42:03 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=96=87=E6=A1=A3=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/documentToolApi.js | 9 +- src/common/lang/en-us.js | 3 + src/common/lang/workCenter/en.js | 6 + src/common/lang/workCenter/zh.js | 6 + src/common/lang/zh-cn.js | 3 + src/components/selection/UserSelectModal.vue | 10 + src/enums/commonEnums.js | 6 + src/mixins/ConfigurableTableMixin.js | 7 +- .../documentSplit/DocumentSplit.vue | 138 ++++++++++---- .../documentSplit/DocumentSplitDetail.vue | 51 ++++-- .../modules/SplitClauseDetail.vue | 1 + .../documentSplit/modules/SplitText.vue | 7 +- src/views/workCenter/NewProcess.vue | 2 +- .../StandardConsultationProcess.vue | 171 ++++++++++++++++++ .../modules/SelectStandardFileModal.vue | 30 +++ 15 files changed, 388 insertions(+), 62 deletions(-) create mode 100644 src/views/workCenter/standardConsultationProcess/StandardConsultationProcess.vue create mode 100644 src/views/workCenter/standardConsultationProcess/modules/SelectStandardFileModal.vue diff --git a/src/api/documentToolApi.js b/src/api/documentToolApi.js index e835fd1b..a06908e7 100644 --- a/src/api/documentToolApi.js +++ b/src/api/documentToolApi.js @@ -2,7 +2,12 @@ import { getAction, postAction } from './manage' // 文档拆分-发布 -const releaseSplitStandard = (params) => postAction('', params) +const releaseSplitStandard = (params) => postAction('/split/sarFileSplitInfo/publish', params) +// 文档拆分-更改权限 +const changePermission = (params) => postAction('/split/sarFileSplitInfo/updatePermissions', params) +// 文档拆分-撤回 +const withdraw = (params) => postAction('', params) + // 文档拆分-拆分已入库文本-拆分 const addDocSplit = (params) => postAction('/split/sarFileSplitInfo/add', params) // 文档拆分编辑-表头 @@ -66,6 +71,8 @@ const getCommentList = (params) => getAction('/compare/sarFileCompareResComment/ export { // 文档拆分 releaseSplitStandard, + changePermission, + withdraw, // 文档拆分-详情 getDocSplitTableHeader, diff --git a/src/common/lang/en-us.js b/src/common/lang/en-us.js index a144b998..0786d7b8 100644 --- a/src/common/lang/en-us.js +++ b/src/common/lang/en-us.js @@ -121,6 +121,7 @@ module.exports = { confirmRelease: 'Confirm Release?', confirmReleaseContent: 'Confirm to publish the data?', confirmWithdraw: 'Confirm to Withdraw?', + confirmWithdrawContent: 'Confirm the withdrawal of this data?', doNotHavePermissionDeleteData: 'Do not have permission to delete this data', noData: 'No Data', dataLoading: 'Data loading...', @@ -406,6 +407,8 @@ module.exports = { formatRequirementContentTwo: '2.The images are in jpg, jpeg, png, gif format', formatRequirementContentThree: '3.The image in the document is displayed in the form of a link in the exported excel, click the link to jump to the specified local file', formatRequirementContentFour: '4.The table in the document is displayed in the form of a link in the exported excel. Click the link to jump to the specified sheet page', + changePermissions: 'Change permissions', + pleaseSelectUser: 'Please select a user', selectFileType: 'Please select a file type', onlyWord: 'Only word files can be imported', diff --git a/src/common/lang/workCenter/en.js b/src/common/lang/workCenter/en.js index aa5b3da2..b3b82401 100644 --- a/src/common/lang/workCenter/en.js +++ b/src/common/lang/workCenter/en.js @@ -102,5 +102,11 @@ module.exports = { timeConsuming: '耗时', approvalOpinion: '审批意见', opinionContent: '意见内容' + }, + // 标准征求意见 + standardConsultationProcess: { + standardText: '标准文本', + selectText: '选择文本', + selectionStandardFile: '选择标准文件' } } diff --git a/src/common/lang/workCenter/zh.js b/src/common/lang/workCenter/zh.js index bab8b724..be578da8 100644 --- a/src/common/lang/workCenter/zh.js +++ b/src/common/lang/workCenter/zh.js @@ -123,5 +123,11 @@ module.exports = { finishTime: '完成时间', processState: '流程状态', processTime: '流程耗时(小时)' + }, + // 标准征求意见 + standardConsultationProcess: { + standardText: '标准文本', + selectText: '选择文本', + selectionStandardFile: '选择标准文件' } } diff --git a/src/common/lang/zh-cn.js b/src/common/lang/zh-cn.js index ce7226e4..2bd10bef 100644 --- a/src/common/lang/zh-cn.js +++ b/src/common/lang/zh-cn.js @@ -121,6 +121,7 @@ module.exports = { confirmRelease: '确认发布?', confirmReleaseContent: '确认发布该条数据?', confirmWithdraw: '确认撤回?', + confirmWithdrawContent: '确认撤回该条数据?', doNotHavePermissionDeleteData: '没有权限删除此数据', noData: '暂无数据', dataLoading: '数据加载中...', @@ -409,6 +410,8 @@ module.exports = { formatRequirementContentTwo: '2.图片为jpg、jpeg、png、gif格式', formatRequirementContentThree: '3.文档中的图片,在导出excel中以链接的形式展示,点击链接跳转到本地指定的文件', formatRequirementContentFour: '4.文档中的表格,在导出excel中以链接的形式展示,点击链接跳转到指定的sheet页面', + changePermissions: '更改权限', + pleaseSelectUser: '请选择一个用户', selectFileType: '请选择文件类型', onlyWord: '只能导入word文件', diff --git a/src/components/selection/UserSelectModal.vue b/src/components/selection/UserSelectModal.vue index bc729d85..d8ab48f8 100644 --- a/src/components/selection/UserSelectModal.vue +++ b/src/components/selection/UserSelectModal.vue @@ -100,6 +100,12 @@ export default { default: () => { return '' } + }, + // 是否校验必选 + checkRequired: { + type: Boolean, + required: false, + default: false } }, watch: { @@ -297,6 +303,10 @@ export default { this.selectedRowKeys = this.selectedRowKeys.filter(item => item !== record.id) }, handleOk () { + if (this.checkRequired && (!this.selectedRowKeys || this.selectedRowKeys.length === 0)) { + this.$message.warning(this.$t('docTool.split.pleaseSelectUser')) + return + } this.$emit('change', this.selectedRowKeys.join(',')) this.$emit('nameChange', this.dataSourceRight.map(item => item.realname + '(' + item.username + ')').join(',')) this.close() diff --git a/src/enums/commonEnums.js b/src/enums/commonEnums.js index 733f704d..fbec5008 100644 --- a/src/enums/commonEnums.js +++ b/src/enums/commonEnums.js @@ -75,3 +75,9 @@ export const OperationType = { ENTRY: { text: '标准法规入库', value: '1' }, CHANGE: { text: '标准法规变更', value: '2' } } + +// 文档拆分-拆分状态 +export const SplitStatus = { + EDITING: { text: '编辑中', value: '1' }, + RELEASED: { text: '已发布', value: '2' } +} diff --git a/src/mixins/ConfigurableTableMixin.js b/src/mixins/ConfigurableTableMixin.js index 2155b077..e0eec074 100644 --- a/src/mixins/ConfigurableTableMixin.js +++ b/src/mixins/ConfigurableTableMixin.js @@ -56,7 +56,8 @@ export const ConfigurableTableMixin = { needFilterTableBtn: true, // 是否需要过滤没有权限的按钮 tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) }, getTableHeaderFunc: null, // 获取表头的方法 - tableSlotField: [] // 表格需要使用插槽的字段,dbFieldName + tableSlotField: [], // 表格需要使用插槽的字段,dbFieldName + disabledMixinsCreate: false } }, computed: { @@ -65,6 +66,9 @@ export const ConfigurableTableMixin = { } }, mounted () { + if (this.disabledMixinsCreate) { + return + } this.getTableHeader() this.loadData() // 过滤没有权限的按钮 @@ -174,6 +178,7 @@ export const ConfigurableTableMixin = { const param = Object.assign({}, this.searchParams, this.isorter, this.filters) param.pageNo = this.ipagination.current param.pageSize = this.ipagination.pageSize + console.log(param) return filterObj(param) }, loadData (arg) { diff --git a/src/views/documentTool/documentSplit/DocumentSplit.vue b/src/views/documentTool/documentSplit/DocumentSplit.vue index f643a785..4c5cf978 100644 --- a/src/views/documentTool/documentSplit/DocumentSplit.vue +++ b/src/views/documentTool/documentSplit/DocumentSplit.vue @@ -42,12 +42,14 @@ {{ $t('docTool.split.splitText') }} - + {{ $t('docTool.split.importResults') }} {{ $t('batchDelete') }} + + {{ $t('docTool.split.changePermissions') }}
- - + :operation-list="operationList" + @change="handleTableChange" + @operationClick="operationClick">
@@ -89,6 +72,8 @@ + + @@ -97,21 +82,39 @@ import '../../../assets/less/common.less' import JTable from '../../../components/jero/JTable.vue' import SplitText from './modules/SplitText.vue' import { JeroListMixin } from '../../../mixins/JeroListMixin.js' -import { releaseSplitStandard } from '../../../api/documentToolApi.js' +import { releaseSplitStandard, changePermission, withdraw } from '../../../api/documentToolApi.js' import ImportSplitResultModal from './modules/ImportSplitResultModal.vue' +import UserSelectModal from '../../../components/selection/UserSelectModal.vue' +import { SplitStatus } from '../../../enums/commonEnums.js' +import { mapState } from 'vuex' export default { name: 'DocumentSplit', - components: { JTable, SplitText, ImportSplitResultModal }, + components: { JTable, SplitText, ImportSplitResultModal, UserSelectModal }, mixins: [JeroListMixin], data () { return { + userInfo: this.$store.getters.userInfo, operationList: [ // 发布 { text: this.$t('release'), clickEvent: 'handleRelease', - has: 'split:sarFileSplitInfo:release' + has: 'split:sarFileSplitInfo:release', + show: (record) => { + // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为编辑中可以发布 + return record.createBy === this.userInfo.username && record.splitStatus === SplitStatus.EDITING.value + } + }, + // 撤回 + { + text: this.$t('withdraw'), + clickEvent: 'handleWithdraw', + has: 'split:sarFileSplitInfo:release', + show: (record) => { + // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为已发布可以撤回 + return record.createBy === this.userInfo.username && record.splitStatus === SplitStatus.RELEASED.value + } }, // 查看 { @@ -123,25 +126,33 @@ export default { { text: this.$t('edit'), clickEvent: 'handleEdit', - has: 'split:sarFileSplitItems:edit' + has: 'split:sarFileSplitItems:edit', + show: (record) => { + // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为编辑中可以编辑 + return record.createBy === this.userInfo.username && record.splitStatus === SplitStatus.EDITING.value + } }, // 删除 { text: this.$t('delete'), clickEvent: 'handleDelete', - has: 'split:sarFileSplitInfo:delete' + has: 'split:sarFileSplitInfo:delete', + show: (record) => { + // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为编辑中可以删除 + return record.createBy === this.userInfo.username && record.splitStatus === SplitStatus.EDITING.value + } } ], columns: [ // 标准号 { - dataIndex: 'standardNumber', + dataIndex: 'serialNumber', title: this.$t('standardSelect.standardNumber'), width: 150 }, // 标准名称 { - dataIndex: 'standardName', + dataIndex: 'title', title: this.$t('standardSelect.standardName'), width: 150 }, @@ -155,17 +166,17 @@ export default { { dataIndex: 'fileName', title: this.$t('fileName'), - width: 150 + width: 180 }, // 拆分状态 { - dataIndex: '5', + dataIndex: 'splitStatus_dictText', title: this.$t('docTool.split.splitState'), width: 150 }, // 编辑人 { - dataIndex: '6', + dataIndex: 'author', title: this.$t('docTool.split.editor'), width: 150 }, @@ -187,18 +198,15 @@ export default { title: this.$t('operation'), fixed: 'right', width: 150, - scopedSlots: { customRender: 'operation' } + scopedSlots: { customRender: 'action' } } ], url: { list: '/split/sarFileSplitInfo/page', // 表格数据 - deleteBatch: '', // 批量删除 - deleteUrl: '', + deleteBatch: '/split/sarFileSplitInfo/deleteBatch', // 批量删除 + deleteUrl: '/split/sarFileSplitInfo/delete', backDocument: '' // 回传至文档库 - }, - dataSource: [ - { id: 1 } - ] + } } }, methods: { @@ -232,6 +240,29 @@ export default { } }) }, + /** + * TODO 撤回 + * @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({ @@ -262,6 +293,33 @@ export default { if (num === 1) { this.$refs.tableData.$emit('searchGetData') } + }, + /** + * 更改权限 + */ + handleChangePermission () { + if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) { + this.$message.warning(this.$t('selectARecord')) + 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 + }) } } } diff --git a/src/views/documentTool/documentSplit/DocumentSplitDetail.vue b/src/views/documentTool/documentSplit/DocumentSplitDetail.vue index 7e19e6d7..3171ed02 100644 --- a/src/views/documentTool/documentSplit/DocumentSplitDetail.vue +++ b/src/views/documentTool/documentSplit/DocumentSplitDetail.vue @@ -158,10 +158,11 @@ -