update 文档拆分
This commit is contained in:
@@ -17,13 +17,13 @@ const getDocSplitSearch = (params) => getAction('/clause/split/getQueryCondition
|
||||
// 文档拆分编辑-表单字段
|
||||
const getDocSplitEditForm = (params) => getAction('/clause/split/getFormModel', params)
|
||||
// 文档拆分编辑-表单值
|
||||
const getDocSplitEditFormData = (params) => getAction('/split/sarFileSplitItems/getSplitItemsById', params)
|
||||
const getDocSplitEditFormData = (params) => getAction('/laws/DocumentTool/documentSplit/queryDocumentSplitDetailById', params)
|
||||
// 文档拆分编辑-新增条款
|
||||
const addClause = (params) => postAction('/split/sarFileSplitItems/addSplitItems', params)
|
||||
// 文档拆分编辑-编辑条款
|
||||
const editClause = (params) => postAction('/split/sarFileSplitItems/updateSplitItems', params)
|
||||
const editClause = (params) => postAction('/laws/DocumentTool/documentSplit/editDocumentSplitDetail', params)
|
||||
// 文档拆分编辑-获取条款内容
|
||||
const getEditClauseContent = (params) => getAction('/split/sarFileSplitItemsVal/getItemsValList', params)
|
||||
const getEditClauseContent = (params) => getAction('/laws/DocumentTool/documentSplit/queryItemsValList', params)
|
||||
// 文档拆分编辑-删除树节点
|
||||
const deleteClauseTreeNode = (params) => getAction('/split/sarFileSplitMenu/deleteMenu', params)
|
||||
// 文档拆分编辑-树节点下移
|
||||
@@ -31,7 +31,7 @@ const moveUpOrDownClauseTreeNode = (params) => postAction('/split/sarFileSplitMe
|
||||
// 文档拆分编辑-批量复制
|
||||
const batchCopyClause = (params) => getAction('/split/sarFileSplitItems/batchCopyItems', params)
|
||||
// 文档拆分编辑-合并条款
|
||||
const merageClause = (params) => getAction('/split/sarFileSplitItems/batchMergeItems', params)
|
||||
const merageClause = (params) => postAction('/laws/DocumentTool/documentSplit/mergeDocumentSplitDetail', params)
|
||||
// 文档拆分编辑-批量编辑-新增
|
||||
const addBatchEditClause = (params) => postAction('/split/sarFileSplitItems/addSplitItems', params)
|
||||
// 文档拆分编辑-批量编辑-编辑
|
||||
@@ -42,6 +42,10 @@ const getFormForBatchEditClause = (params) => getAction('/split/sarFileSplitItem
|
||||
const getFormDataForBatchEditClause = (params) => getAction('/split/sarFileSplitItems/batchSet', params)
|
||||
// 文档拆分编辑-获取左侧树数据
|
||||
const getClauseTreeData = (params) => getAction('/split/sarFileSplitMenu/getSplitMenusByInfoId', params)
|
||||
// 文档拆分-编辑-树节点新增
|
||||
const addClauseTreeNode = (params) => postAction('/split/sarFileSplitMenu/addMenu', params)
|
||||
// 文档拆分-编辑-树节点编辑
|
||||
const editClauseTreeNode = (params) => postAction('/split/sarFileSplitMenu/updateMenu', params)
|
||||
|
||||
// 文档对比-发布/撤回
|
||||
const withdrawPublication = (params) => postAction('/compare/sarFileCompareInfo/changeState', params)
|
||||
@@ -92,6 +96,8 @@ export {
|
||||
getFormForBatchEditClause,
|
||||
getFormDataForBatchEditClause,
|
||||
getClauseTreeData,
|
||||
addClauseTreeNode,
|
||||
editClauseTreeNode,
|
||||
|
||||
// 文档比对
|
||||
withdrawPublication,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<a-modal
|
||||
v-model="visible"
|
||||
v-model="uploadVisible"
|
||||
:maskClosable="false"
|
||||
:footer="[]"
|
||||
:title="title"
|
||||
@@ -41,7 +41,7 @@ export default {
|
||||
],
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
uploadVisible: false,
|
||||
uploadAction: window._CONFIG.domianURL + '/split/sarFileSplitItems/upload',
|
||||
downLoadFileUrl: window._CONFIG.domianPreviewURL + '/sys/common/static',
|
||||
fileList: [],
|
||||
@@ -58,7 +58,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open () {
|
||||
this.visible = true
|
||||
this.uploadVisible = true
|
||||
},
|
||||
perentHandleFunc (data) {
|
||||
this.myFileList = data
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
})
|
||||
this.$emit('uploadSuccess', this.fileList, fileList)
|
||||
if (this.uploadFileFlag === 0) {
|
||||
this.visible = false
|
||||
this.uploadVisible = false
|
||||
}
|
||||
if (this.myFileList.length > 0) {
|
||||
this.$message.destroy()
|
||||
@@ -162,7 +162,7 @@ export default {
|
||||
// console.log('file111111',this.fileList,fileList,file,this.uploadFileFlag)
|
||||
this.$emit('uploadSuccess', file, this.fileList, fileList)
|
||||
if (this.uploadFileFlag === 0) {
|
||||
this.visible = false
|
||||
this.uploadVisible = false
|
||||
}
|
||||
// console.log('uplossss',this.fileList,fileList)
|
||||
if (this.myFileList.length > 0) {
|
||||
@@ -187,7 +187,7 @@ export default {
|
||||
this.previewImage = file.response.path
|
||||
},
|
||||
handlePreImgCancel () {
|
||||
this.visible = false
|
||||
this.uploadVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,3 +96,10 @@ export const SplitStatus = {
|
||||
EDITING: { text: '编辑中', value: '1' },
|
||||
RELEASED: { text: '已发布', value: '2' }
|
||||
}
|
||||
|
||||
// 文档拆分-条款内容类型
|
||||
export const TypeOfClauseItem = {
|
||||
TEXT: { text: '文本', value: 'TEXT' },
|
||||
TABLE: { text: '表格', value: 'TABLE' },
|
||||
IMG: { text: '图片', value: 'IMG' }
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ export default {
|
||||
},
|
||||
// 文件状态
|
||||
{
|
||||
dataIndex: 'fileType',
|
||||
dataIndex: 'fileType_dictText',
|
||||
title: this.$t('docTool.split.fileStatus'),
|
||||
width: 150
|
||||
},
|
||||
@@ -202,9 +202,9 @@ export default {
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/split/sarFileSplitInfo/page', // 表格数据
|
||||
deleteBatch: '/split/sarFileSplitInfo/deleteBatch', // 批量删除
|
||||
deleteUrl: '/split/sarFileSplitInfo/delete',
|
||||
list: '/laws/DocumentTool/documentSplit/queryByPage', // 表格数据
|
||||
deleteBatch: '/laws/DocumentTool/documentSplit/deleteBatch', // 批量删除
|
||||
delete: '/laws/DocumentTool/documentSplit/delete',
|
||||
backDocument: '' // 回传至文档库
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="page-left-right-layout">
|
||||
<!--树部分-->
|
||||
<div class="page-left-box">
|
||||
<a-input-search class="tree-search" v-model="searchValue" :placeholder="$t('nodeQuickLookup')" @search="onSearch" />
|
||||
<a-input-search class="tree-search" v-model="searchValue" :placeholder="$t('nodeQuickLookup')" @search="onSearch"/>
|
||||
<div class="page-tree-box page-tree-box-has-search">
|
||||
<a-spin :spinning="loading">
|
||||
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData" :selected-keys="selectedKeys">
|
||||
@@ -12,7 +12,7 @@
|
||||
@mouseenter="handleTreeMouseover(record.id)"
|
||||
@mouseleave="handleTreeMouseout(record.id)"
|
||||
@click="handleSelectTreeNode(record)">
|
||||
<a-icon class="parent-node-icon" type="folder" v-if="record.dataRef.children && record.dataRef.children.length > 0" />
|
||||
<a-icon class="parent-node-icon" type="folder" v-if="record.dataRef.children && record.dataRef.children.length > 0"/>
|
||||
<a-tooltip>
|
||||
<template #title>
|
||||
{{ record.name }}{{ record.itemName }}
|
||||
@@ -24,21 +24,20 @@
|
||||
<a-button icon="plus"
|
||||
class="tree-operate-node-btn"
|
||||
@click.stop="orgAdd(record)"
|
||||
v-has="'split:sarFileSplitMenu:add'">
|
||||
</a-button>
|
||||
v-has="'split:sarFileSplitMenu:add'"></a-button>
|
||||
<!--编辑-->
|
||||
<a-button class="tree-operate-node-btn"
|
||||
@click.stop="orgEdit(record)"
|
||||
v-if="record.pid"
|
||||
v-has="'split:sarFileSplitMenu:update'">
|
||||
<i class="iconfont icon-bianji" />
|
||||
<i class="iconfont icon-bianji"/>
|
||||
</a-button>
|
||||
<!--删除,根节点不能删除-->
|
||||
<a-button class="tree-operate-node-btn"
|
||||
v-if="record.pid"
|
||||
v-has="'split:sarFileSplitMenu:delete'"
|
||||
@click.stop="orgDelete(record)">
|
||||
<i class="iconfont icon-shanchu_" />
|
||||
<i class="iconfont icon-shanchu_"/>
|
||||
</a-button>
|
||||
<!--节点上移,是否可以上移在树形数据中应该有字段标识-->
|
||||
<a-button icon="up"
|
||||
@@ -55,26 +54,6 @@
|
||||
v-has="'split:sarFileSplitMenu:moveDown'">
|
||||
</a-button>
|
||||
</div>
|
||||
<!--<template #overlay>-->
|
||||
<!-- <a-menu v-if="$route.query.createBy === userInfo.username || administrators"-->
|
||||
<!-- @click="({ key: menuKey }) => onContextMenuClick(treeKey, menuKey, record)">-->
|
||||
<!-- <a-menu-item key="1" @click="orgAdd" v-has="'split:sarFileSplitMenu:add'">-->
|
||||
<!-- {{ $t('newNode') }}-->
|
||||
<!-- </a-menu-item>-->
|
||||
<!-- <a-menu-item key="2" @click="orgEdit" v-has="'split:sarFileSplitMenu:update'">-->
|
||||
<!-- {{ $t('modifyNode') }}-->
|
||||
<!-- </a-menu-item>-->
|
||||
<!-- <a-menu-item key="3" @click="orgDelete" v-if="deleteNode"-->
|
||||
<!-- v-has="'split:sarFileSplitMenu:delete'">{{ $t('deleteNode') }}-->
|
||||
<!-- </a-menu-item>-->
|
||||
<!-- <a-menu-item key="4" @click="orgMoveUp" v-if="deleteNode && moveUpFlag"-->
|
||||
<!-- v-has="'split:sarFileSplitMenu:moveUp'">{{ $t('moveUp') }}-->
|
||||
<!-- </a-menu-item>-->
|
||||
<!-- <a-menu-item key="5" @click="orgmoveDown" v-if="deleteNode && moveDownFlag"-->
|
||||
<!-- v-has="'split:sarFileSplitMenu:moveDown'">{{ $t('moveDown') }}-->
|
||||
<!-- </a-menu-item>-->
|
||||
<!-- </a-menu>-->
|
||||
<!--</template>-->
|
||||
</div>
|
||||
</template>
|
||||
</a-tree>
|
||||
@@ -89,12 +68,12 @@
|
||||
:get-query-condition-func="getQueryConditionFunc"
|
||||
search-has="split:sarFileSplitItems:search"
|
||||
@search="searchQuery"
|
||||
@reset="searchReset" />
|
||||
@reset="searchReset"/>
|
||||
</div>
|
||||
<!--操作按钮-->
|
||||
<div class="table-operator">
|
||||
<!--新增-->
|
||||
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'split:sarFileSplitItems:add'">{{ $t('newlyAdded') }}</a-button>
|
||||
<!--<a-button icon="plus" type="primary" @click="handleAdd" v-has="'split:sarFileSplitItems:add'">{{ $t('newlyAdded') }}</a-button>-->
|
||||
<!--导入-->
|
||||
<a-upload name="file"
|
||||
:showUploadList="false"
|
||||
@@ -114,7 +93,10 @@
|
||||
{{ $t('export') }}
|
||||
</a-button>
|
||||
<!--批量删除-->
|
||||
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'split:sarFileSplitItems:delete'">{{ $t('batchDelete') }}</a-button>
|
||||
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'split:sarFileSplitItems:delete'">{{
|
||||
$t('batchDelete')
|
||||
}}
|
||||
</a-button>
|
||||
<!--模板下载-->
|
||||
<a-button type="primary"
|
||||
icon="download"
|
||||
@@ -124,7 +106,7 @@
|
||||
{{ $t('templateDownload') }}
|
||||
</a-button>
|
||||
<!--批量复制-->
|
||||
<a-button type="primary" ghost @click="handleCopyManage" v-has="'split:sarFileSplitItems:copy'">
|
||||
<a-button type="primary" ghost @click="handleCopy" v-has="'split:sarFileSplitItems:copy'">
|
||||
{{ $t('docTool.split.batchCopy') }}
|
||||
</a-button>
|
||||
<!--批量编辑-->
|
||||
@@ -132,7 +114,7 @@
|
||||
{{ $t('docTool.split.batchEdit') }}
|
||||
</a-button>
|
||||
<!--合并条款-->
|
||||
<a-button type="primary" ghost @click="handleMergeManage" v-has="'split:sarFileSplitItems:merge'">
|
||||
<a-button type="primary" ghost @click="handleMerge" v-has="'split:sarFileSplitItems:merge'">
|
||||
{{ $t('docTool.split.mergerClause') }}
|
||||
</a-button>
|
||||
</div>
|
||||
@@ -147,7 +129,8 @@
|
||||
:pagination="ipagination"
|
||||
:scroll="{x: '100%'}"
|
||||
:operation-list="operationList"
|
||||
@change="tableOnChange">
|
||||
@change="tableOnChange"
|
||||
@operationClick="operationClick">
|
||||
|
||||
<!-- 详情-->
|
||||
<template slot="detailClick" slot-scope="{text, record}">
|
||||
@@ -159,7 +142,7 @@
|
||||
</template>
|
||||
|
||||
<!--条文内容-->
|
||||
<template slot="Item_content" slot-scope="{text, record}">
|
||||
<template slot="item_content" slot-scope="{text, record}">
|
||||
<div class="table-text" @click="showContent(text,record)">
|
||||
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
|
||||
</div>
|
||||
@@ -171,15 +154,15 @@
|
||||
</div>
|
||||
|
||||
<!-- 条款详情 -->
|
||||
<split-clause-detail ref="splitClauseDetail"></split-clause-detail>
|
||||
<split-clause-detail ref="splitClauseDetail"/>
|
||||
<!-- 添加节点 -->
|
||||
<split-detail-node-add ref="splitDetailNodeAdd" @ok="nodeAddOk" @update="nodeUpdateOk"></split-detail-node-add>
|
||||
<split-detail-node-add ref="splitDetailNodeAdd" @ok="nodeAddOk"/>
|
||||
<!-- 批量设置弹框 -->
|
||||
<split-detail-batch-setting ref="splitDetailBatchSetting" @ok="batchSettingOk"></split-detail-batch-setting>
|
||||
<split-detail-batch-setting ref="splitDetailBatchSetting" @ok="batchSettingOk"/>
|
||||
<!--条款添加-->
|
||||
<split-add-form ref="modalForm" :flag="'4'"
|
||||
:url="url" :infoId="infoId" :menuId="menuId" :itemId="itemId"
|
||||
@sumber="sumber"></split-add-form>
|
||||
@sumber="sumber"/>
|
||||
</internal-detail-page>
|
||||
</template>
|
||||
|
||||
@@ -269,15 +252,15 @@ export default {
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/split/sarFileSplitItems/getSplitItemsByPage',
|
||||
list: '/laws/DocumentTool/documentSplit/queryDocumentSplitDetail',
|
||||
importUrl: '/split/sarFileSplitItems/importSplitItems', // 导入
|
||||
exportXlsUrl: '/split/sarFileSplitItems/exportSplitInfoZip', // 导出
|
||||
delete: '/split/sarFileSplitItems/batchDeleteItems', // 删除
|
||||
deleteBatch: '/split/sarFileSplitItems/batchDeleteItems', // 批量删除
|
||||
delete: '/laws/DocumentTool/documentSplit/deleteDocumentSplitDetail', // 删除
|
||||
deleteBatch: '/laws/DocumentTool/documentSplit/deleteBatchDocumentSplitDetail', // 批量删除
|
||||
downTemplateUrl: '/split/sarFileSplitItems/exportTemplate' // 模板下载
|
||||
},
|
||||
disabledMixinsCreate: true,
|
||||
tableSlotField: ['Item_content']
|
||||
tableSlotField: ['item_content']
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -375,15 +358,13 @@ export default {
|
||||
this.$refs.splitDetailNodeAdd.edit(record.dataRef, this.infoId)
|
||||
},
|
||||
// 添加节点完成后的回调
|
||||
nodeAddOk () {
|
||||
nodeAddOk (expandId) {
|
||||
if (expandId && expandId.length > 0) {
|
||||
this.onExpand(expandId)
|
||||
}
|
||||
this.loadMenuData()
|
||||
this.loadData()
|
||||
},
|
||||
// 修改节点完成后的回调
|
||||
nodeUpdateOk (expandId) {
|
||||
this.onExpand(expandId)
|
||||
this.loadMenuData()
|
||||
},
|
||||
// 树形删除
|
||||
orgDelete (record) {
|
||||
this.$confirm({
|
||||
@@ -428,7 +409,7 @@ export default {
|
||||
const query = {
|
||||
moveFlag: 'down',
|
||||
infoId: this.infoId,
|
||||
SarFileSplitMenu: {
|
||||
sarFileSplitMenu: {
|
||||
id: record.dataRef.id,
|
||||
pId: record.dataRef.pid,
|
||||
displaySeq: record.dataRef.displaySeq
|
||||
@@ -444,11 +425,14 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
onContextMenuClick (treeKey, menuKey) {
|
||||
// console.log(`treeKey: ${treeKey}, menuKey: ${menuKey}`);
|
||||
},
|
||||
// 复制按钮
|
||||
handleCopyManage (record) {
|
||||
/**
|
||||
* 批量复制
|
||||
*/
|
||||
handleCopy () {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
return
|
||||
}
|
||||
const ids = []
|
||||
const infoIds = []
|
||||
const menuIds = []
|
||||
@@ -485,42 +469,40 @@ export default {
|
||||
},
|
||||
// 新增
|
||||
handleAdd () {
|
||||
// console.log('this.menuId',this.menuId)
|
||||
if (!this.menuId) {
|
||||
this.$message.warning(this.$t('docTool.split.selectDirectoryTerms'))
|
||||
return
|
||||
}
|
||||
if (this.menuId) {
|
||||
this.formTitle = this.$t('add')
|
||||
this.itemId = ''
|
||||
this.addVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.modalForm.add()
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectDirectoryTerms'))
|
||||
this.$refs.modalForm.add()
|
||||
}
|
||||
},
|
||||
// 合并条款
|
||||
handleMergeManage () {
|
||||
handleMerge () {
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length < 2) {
|
||||
this.$message.warning(this.$t('leastTwo'))
|
||||
} else {
|
||||
const ids = this.selectedRowKeys.join(',')
|
||||
this.$confirm({
|
||||
title: this.$t('docTool.split.mergeTerms'),
|
||||
content: '',
|
||||
onOk: () => {
|
||||
merageClause({ ids: ids }).then(res => {
|
||||
if (res.data.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.onClearSelected()
|
||||
this.loadMenuData()
|
||||
this.loadData()
|
||||
this.selectedRowKeys = []
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.selectedRowKeys.join(',')
|
||||
this.$confirm({
|
||||
title: this.$t('docTool.split.mergeTerms'),
|
||||
content: '',
|
||||
onOk: () => {
|
||||
merageClause({ ids: ids }).then(res => {
|
||||
if (res.data.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.onClearSelected()
|
||||
this.loadMenuData()
|
||||
this.loadData()
|
||||
this.selectedRowKeys = []
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 批量设置
|
||||
handleManage () {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
switchFullscreen
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<p v-html="contentValue"></p>
|
||||
<div class="clause-content" v-html="contentValue"></div>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
@@ -35,5 +35,10 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.clause-content {
|
||||
max-height: calc(100vh - 200px - 55px);
|
||||
overflow: auto;
|
||||
margin: 0 -24px;
|
||||
padding: 0 24px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<j-modal
|
||||
:title="title"
|
||||
class="split-table-title"
|
||||
:visible="visible"
|
||||
:visible="tableVisible"
|
||||
switchFullscreen
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="handleOkTable"
|
||||
@@ -21,7 +21,7 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
title: this.$t('docTool.split.table'),
|
||||
visible: false,
|
||||
tableVisible: false,
|
||||
confirmLoading: false,
|
||||
ueContent: '',
|
||||
// UE编辑器配置
|
||||
@@ -123,7 +123,7 @@ export default {
|
||||
methods: {
|
||||
open (tableStr) {
|
||||
console.log('$$$$$$$$$$$$', tableStr)
|
||||
this.visible = true
|
||||
this.tableVisible = true
|
||||
this.ueContent = tableStr
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ueditor.setContent(this.ueContent)
|
||||
@@ -153,7 +153,7 @@ export default {
|
||||
this.close()
|
||||
},
|
||||
close () {
|
||||
this.visible = false
|
||||
this.tableVisible = false
|
||||
this.isTableEdit = false
|
||||
this.ueContent = ''
|
||||
this.$nextTick(() => {
|
||||
|
||||
@@ -6,22 +6,22 @@
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
@cancel="handleCancel">
|
||||
|
||||
<div class="title-wraper">
|
||||
<div class="title-top">
|
||||
<span class="title-flex title-text-flex"
|
||||
:class="{'title-flex-active':selected==='TEXT'}"
|
||||
@click="selectTitle('TEXT')">{{ $t('docTool.split.text') }}</span>
|
||||
:class="{'title-flex-active':selected===TypeOfClauseItem.TEXT.value}"
|
||||
@click="selectTitle(TypeOfClauseItem.TEXT.value)">{{ $t('docTool.split.text') }}</span>
|
||||
<span class="title-flex title-pic"
|
||||
:class="{'title-flex-active':selected==='IMG'}"
|
||||
@click="selectTitle('IMG')">{{ $t('docTool.split.picture') }}</span>
|
||||
:class="{'title-flex-active':selected===TypeOfClauseItem.IMG.value}"
|
||||
@click="selectTitle(TypeOfClauseItem.IMG.value)">{{ $t('docTool.split.picture') }}</span>
|
||||
<span class="title-flex title-table"
|
||||
:class="{'title-flex-active':selected==='TABLE'}"
|
||||
@click="selectTitle('TABLE')">{{ $t('docTool.split.table') }}</span>
|
||||
:class="{'title-flex-active':selected===TypeOfClauseItem.TABLE.value}"
|
||||
@click="selectTitle(TypeOfClauseItem.TABLE.value)">{{ $t('docTool.split.table') }}</span>
|
||||
</div>
|
||||
<!-- 选择文本类型时,需要填写个数 -->
|
||||
<div class="title-num" v-if="selected==='TEXT'">
|
||||
<div class="title-num" v-if="selected===TypeOfClauseItem.TEXT.value">
|
||||
<a-form>
|
||||
<a-form-model
|
||||
class="number-content"
|
||||
@@ -44,7 +44,7 @@
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 选择表格时,需要填写行列数 -->
|
||||
<div class="title-num" v-if="selected==='TABLE'">
|
||||
<div class="title-num" v-if="selected===TypeOfClauseItem.TABLE.value">
|
||||
<a-form>
|
||||
<a-form-model
|
||||
class="number-content"
|
||||
@@ -97,13 +97,14 @@
|
||||
import SplitAddClauseUploadImage from '../../../../components/splitUpload/SplitAddClauseUploadImage.vue'
|
||||
// 编辑表格的弹框
|
||||
import SplitDetailAddTable from './SplitDetailAddTable.vue'
|
||||
import { TypeOfClauseItem } from '../../../../enums/commonEnums'
|
||||
|
||||
export default {
|
||||
name: 'SplitDetailAddTypeCheck',
|
||||
components: { SplitAddClauseUploadImage, SplitDetailAddTable },
|
||||
watch: {
|
||||
selected (val) {
|
||||
if (this.selected === 'TEXT') {
|
||||
if (this.selected === TypeOfClauseItem.TEXT.value) {
|
||||
this.selectedNum = true
|
||||
} else {
|
||||
this.selectedNum = false
|
||||
@@ -112,9 +113,10 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
TypeOfClauseItem,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
selected: 'TEXT',
|
||||
selected: TypeOfClauseItem.TEXT.value,
|
||||
selectedNum: true,
|
||||
numberForm: {},
|
||||
validatorRules: {
|
||||
@@ -146,39 +148,45 @@ export default {
|
||||
},
|
||||
selectTitle (val) {
|
||||
this.selected = val
|
||||
if (val === 'TEXT') {
|
||||
if (val === TypeOfClauseItem.TEXT.value) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.numberForm.clearValidate()
|
||||
this.$refs.numberForm && this.$refs.numberForm.clearValidate()
|
||||
})
|
||||
} else if (val === 'TABLE') {
|
||||
} else if (TypeOfClauseItem.TABLE.value) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.numberRowColForm.clearValidate()
|
||||
this.$refs.numberRowColForm && this.$refs.numberRowColForm.clearValidate()
|
||||
})
|
||||
}
|
||||
},
|
||||
// 上传文件
|
||||
uploadSuccess (file, data, imgs) {
|
||||
this.$emit('addImageOk', file, data, imgs)
|
||||
this.$emit('ok', TypeOfClauseItem.IMG.value, { file, data, imgs })
|
||||
this.visible = false
|
||||
// this.$emit('addImageOk', file, data, imgs)
|
||||
},
|
||||
// 确定增加的类型
|
||||
handleOk () {
|
||||
if (this.confirmLoading) {
|
||||
return
|
||||
}
|
||||
if (this.selected === 'TEXT') { // 文本类型
|
||||
if (this.selected === TypeOfClauseItem.TEXT.value) { // 文本类型
|
||||
this.$refs.numberForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.confirmLoading = true
|
||||
this.$emit('addTextOk', this.numberForm.textNumber)
|
||||
this.$emit('ok', TypeOfClauseItem.TEXT.value, this.numberForm.textNumber)
|
||||
this.visible = false
|
||||
this.confirmLoading = false
|
||||
this.numberForm.textNumber = null
|
||||
}
|
||||
})
|
||||
} else if (this.selected === 'IMG') { // 图片类型
|
||||
return
|
||||
}
|
||||
if (this.selected === TypeOfClauseItem.IMG.value) { // 图片类型
|
||||
this.$refs.uploadFile.open()
|
||||
this.visible = false
|
||||
} else if (this.selected === 'TABLE') { // 表格类型
|
||||
// this.visible = false
|
||||
return
|
||||
}
|
||||
if (this.selected === TypeOfClauseItem.TABLE.value) { // 表格类型
|
||||
this.$refs.numberRowColForm.validate(valid => {
|
||||
if (valid) {
|
||||
if (this.rowColForm.rowCount > 0 && this.rowColForm.colCount > 0) {
|
||||
@@ -205,7 +213,7 @@ export default {
|
||||
this.$refs.splitDetailAddTable.isTableEdit = false
|
||||
this.$refs.splitDetailAddTable.open(tableStr)
|
||||
})
|
||||
this.visible = false
|
||||
// this.visible = false
|
||||
this.rowColForm = {}
|
||||
}
|
||||
}
|
||||
@@ -217,7 +225,8 @@ export default {
|
||||
},
|
||||
// 添加表格的回调
|
||||
tableAddOk (ueContent) {
|
||||
this.$emit('addTableOk', ueContent)
|
||||
this.$emit('ok', TypeOfClauseItem.TABLE.value, ueContent)
|
||||
this.visible = false
|
||||
},
|
||||
// 正则替换小数点
|
||||
limitNumber (value) {
|
||||
@@ -251,8 +260,8 @@ export default {
|
||||
}
|
||||
|
||||
.title-flex-active {
|
||||
background: #00B3BE;
|
||||
border-color: #00B3BE;
|
||||
background: @primary-color;
|
||||
border-color: @primary-color;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,22 +6,23 @@
|
||||
:confirm-loading="confirmLoading"
|
||||
switchFullscreen
|
||||
@cancel="handleCancel"
|
||||
@ok="handleOk"
|
||||
>
|
||||
@ok="handleOk">
|
||||
<a-form-model
|
||||
class="split-click-right-form"
|
||||
ref="ruleForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
:wrapper-col="wrapperCol">
|
||||
<!--条款号-->
|
||||
<a-form-model-item :label="$t('docTool.split.clauseNo')" prop="name">
|
||||
<a-input class="box-input" v-model="form.name" :placeholder="$t('pleaseEnter')+$t('docTool.split.clauseNo')" :maxLength="200" />
|
||||
</a-form-model-item>
|
||||
<!--条款名称-->
|
||||
<a-form-model-item :label="$t('docTool.split.clauseName')" prop="itemName">
|
||||
<a-input class="box-input" v-model="form.itemName" :placeholder="$t('pleaseEnter')+$t('docTool.split.clauseName')" :maxLength="200" />
|
||||
</a-form-model-item>
|
||||
<!--序号-->
|
||||
<a-form-model-item :label="$t('serialNumber')" prop="displaySeq">
|
||||
<a-input-number v-model="form.displaySeq" :min="1" :max="99999"
|
||||
class="box-input"
|
||||
@@ -34,7 +35,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { postAction, putAction } from '../../../../api/manage.js'
|
||||
import { addClauseTreeNode,editClauseTreeNode } from '../../../../api/documentToolApi'
|
||||
|
||||
export default {
|
||||
name: 'SplitDetailNodeAdd',
|
||||
data () {
|
||||
@@ -57,7 +59,6 @@ export default {
|
||||
// { min: 1, max: 99999, message: this.$t('cantExeed') + '99999' + this.$t('characters'), trigger: 'blur' },
|
||||
]
|
||||
},
|
||||
isEdit: false,
|
||||
nodeItem: {},
|
||||
infoId: ''
|
||||
}
|
||||
@@ -65,7 +66,6 @@ export default {
|
||||
methods: {
|
||||
add (nodeItem, infoId) {
|
||||
this.title = this.$t('add')
|
||||
this.isEdit = false
|
||||
this.form = {}
|
||||
this.visible = true
|
||||
this.nodeItem = nodeItem
|
||||
@@ -73,7 +73,6 @@ export default {
|
||||
},
|
||||
edit (nodeItem, infoId) {
|
||||
this.title = this.$t('edit')
|
||||
this.isEdit = true
|
||||
this.nodeItem = nodeItem
|
||||
this.form.id = nodeItem.id
|
||||
this.form.pid = nodeItem.pid
|
||||
@@ -91,55 +90,39 @@ export default {
|
||||
if (this.confirmLoading) {
|
||||
return
|
||||
}
|
||||
const expandId = []
|
||||
expandId.push(this.form.pid)
|
||||
if (!this.isEdit) {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.confirmLoading = true
|
||||
const params = {
|
||||
infoId: this.infoId,
|
||||
pid: this.nodeItem.id,
|
||||
...this.form
|
||||
}
|
||||
postAction(`split/sarFileSplitMenu/addMenu`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
// this.onExpand(expandId)
|
||||
this.form = {}
|
||||
this.visible = false
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
const expandId = []
|
||||
expandId.push(this.form.pid)
|
||||
let submitFunc
|
||||
const params = Object.assign({
|
||||
infoId: this.infoId,
|
||||
pid: this.nodeItem.id
|
||||
}, this.form)
|
||||
if (this.form.id) {
|
||||
submitFunc = editClauseTreeNode
|
||||
} else {
|
||||
submitFunc = addClauseTreeNode
|
||||
}
|
||||
this.confirmLoading = true
|
||||
submitFunc(params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.form = {}
|
||||
this.visible = false
|
||||
if (this.form.id) {
|
||||
this.$emit('ok', expandId)
|
||||
} else {
|
||||
this.$emit('ok')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.confirmLoading = true
|
||||
const params = {
|
||||
info_id: this.infoId,
|
||||
...this.form
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
putAction(`split/sarFileSplitMenu/updateMenu`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.form = {}
|
||||
this.visible = false
|
||||
this.$emit('update', expandId)
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 正则替换小数点
|
||||
limitNumber (value) {
|
||||
|
||||
Reference in New Issue
Block a user