update 文档拆分
This commit is contained in:
@@ -42,12 +42,14 @@
|
||||
<!--拆分已入库文本-->
|
||||
<a-button icon="plus" type="primary" @click="handleModule" v-has="'split:sarFileSplitInfo:splitFile'">{{ $t('docTool.split.splitText') }}
|
||||
</a-button>
|
||||
<!--导入拆分结果-->
|
||||
<!--TODO 导入拆分结果-->
|
||||
<a-button icon="download" type="primary" ghost @click="handleExport" v-has="'split:sarFileSplitInfo:splitResult'">
|
||||
{{ $t('docTool.split.importResults') }}
|
||||
</a-button>
|
||||
<!--批量删除-->
|
||||
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'split:sarFileSplitInfo:deleteBatch'">{{ $t('batchDelete') }}</a-button>
|
||||
<!--更改权限-->
|
||||
<a-button type="primary" icon="sync" ghost @click="handleChangePermission">{{ $t('docTool.split.changePermissions') }}</a-button>
|
||||
</div>
|
||||
<div>
|
||||
<j-table
|
||||
@@ -59,28 +61,9 @@
|
||||
:pagination="ipagination"
|
||||
:scroll="{x: '100%'}"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
|
||||
<template v-slot:operation="{text, record}">
|
||||
<a @click="operationClick(operationList[0],record)">{{ operationList[0].text }}</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-dropdown placement="bottomCenter">
|
||||
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
|
||||
<a @click="operationClick(operation,record)">
|
||||
<div class="operate-btn">
|
||||
<!-- 编辑图标-->
|
||||
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
|
||||
<!-- 删除图标-->
|
||||
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
|
||||
{{ operation.text }}
|
||||
</div>
|
||||
</a>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
:operation-list="operationList"
|
||||
@change="handleTableChange"
|
||||
@operationClick="operationClick">
|
||||
|
||||
</j-table>
|
||||
</div>
|
||||
@@ -89,6 +72,8 @@
|
||||
<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>
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,10 +158,11 @@
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<template slot="showContent" slot-scope="text, record">
|
||||
<span class="content-show"
|
||||
@click="showContent(text,record)">{{ record.iterms_conditions && record.iterms_conditions !== 'null' ? record.iterms_conditions.replace(/<.*?>/ig, ' ') : ''
|
||||
}}</span>
|
||||
<!--条文内容-->
|
||||
<template slot="Item_content" slot-scope="{text, record}">
|
||||
<div class="table-text" @click="showContent(text,record)">
|
||||
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</j-table>
|
||||
@@ -205,6 +206,7 @@ import {
|
||||
getClauseTreeData
|
||||
} from '../../../api/documentToolApi.js'
|
||||
import Search from '../../../components/customField/Search.vue'
|
||||
import { isHasPermission } from '../../../utils/hasPermission.js'
|
||||
|
||||
export default {
|
||||
name: 'DocumentSplitDetail',
|
||||
@@ -236,9 +238,9 @@ export default {
|
||||
fullWidth: '',
|
||||
parameter: {},
|
||||
administrators: false,
|
||||
showAction: this.isCanOperate,
|
||||
showAction: false,
|
||||
flag: '4', // 查询要用到
|
||||
|
||||
operateSlotName: 'action',
|
||||
getQueryConditionFunc: getDocSplitSearch,
|
||||
getTableHeaderFunc: getDocSplitTableHeader,
|
||||
treeData: [],
|
||||
@@ -247,15 +249,23 @@ export default {
|
||||
mouseInNodeKey: null, // 鼠标悬浮的节点key值
|
||||
// 操作栏
|
||||
operationList: [
|
||||
// 编辑
|
||||
{
|
||||
text: this.$t('edit'),
|
||||
clickEvent: 'handleEdit',
|
||||
has: 'split:sarFileSplitItems:update'
|
||||
clickEvent: 'handleEdit'
|
||||
// has: 'split:sarFileSplitItems:update'
|
||||
},
|
||||
// 复制
|
||||
{
|
||||
text: this.$t('copy'),
|
||||
clickEvent: 'handleEdit'
|
||||
// has: 'split:sarFileSplitItems:update'
|
||||
},
|
||||
// 删除
|
||||
{
|
||||
text: this.$t('delete'),
|
||||
clickEvent: 'handleDelete',
|
||||
has: 'split:sarFileSplitItems:delete'
|
||||
clickEvent: 'handleDelete'
|
||||
// has: 'split:sarFileSplitItems:delete'
|
||||
}
|
||||
],
|
||||
url: {
|
||||
@@ -265,26 +275,32 @@ export default {
|
||||
delete: '/split/sarFileSplitItems/batchDeleteItems', // 删除
|
||||
deleteBatch: '/split/sarFileSplitItems/batchDeleteItems', // 批量删除
|
||||
downTemplateUrl: '/split/sarFileSplitItems/exportTemplate' // 模板下载
|
||||
}
|
||||
},
|
||||
disabledMixinsCreate: true,
|
||||
tableSlotField: ['Item_content']
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isCanOperate () {
|
||||
return !!(this.$route.query.createBy === this.userInfo.username || this.administrators)
|
||||
},
|
||||
// 页面标题是标准名称
|
||||
pageTitle () {
|
||||
return this.$route.query.standardName
|
||||
},
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
created () {
|
||||
mounted () {
|
||||
this.operateColumn.scopedSlots.customRender = 'action'
|
||||
this.showAction = this.$route.query.createBy === this.userInfo.username || this.administrators
|
||||
this.infoId = this.$route.query.infoId
|
||||
this.filters = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getTableHeader()
|
||||
this.loadData()
|
||||
// 过滤没有权限的按钮
|
||||
if (this.needFilterTableBtn) {
|
||||
this.operationList = this.operationList.filter(item => !item.has || isHasPermission(item.has))
|
||||
}
|
||||
this.administrators = false
|
||||
if (this.userInfo.userRoleList && this.userInfo.userRoleList.length > 0) {
|
||||
this.userInfo.userRoleList.forEach(res => {
|
||||
@@ -340,7 +356,6 @@ export default {
|
||||
getClauseTreeData(params).then(res => {
|
||||
if (res.success) {
|
||||
this.treeData = res.result || []
|
||||
console.log(this.treeData)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<j-modal
|
||||
:title="$t('docTool.split.clauseContent')"
|
||||
:visible="contentVisible"
|
||||
:width="1000"
|
||||
:confirm-loading="confirmLoading"
|
||||
:footer="false"
|
||||
switchFullscreen
|
||||
|
||||
@@ -164,7 +164,12 @@ export default {
|
||||
const nameSuffix = name[name.length - 1]
|
||||
if (nameSuffix.toLowerCase() === 'doc' || nameSuffix.toLowerCase() === 'docx') {
|
||||
const params = {
|
||||
fileId: file.id
|
||||
fileId: file.id,
|
||||
standardId: file.standardId,
|
||||
serialNumber: file.standardNumber,
|
||||
title: file.standardName,
|
||||
fileType: file.standardFileType,
|
||||
fileName: file.fileName
|
||||
}
|
||||
this.loading = true
|
||||
addDocSplit(params).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user