update 文档拆分
This commit is contained in:
@@ -6,21 +6,22 @@
|
||||
<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="false" :tree-data="treeData" :selected-keys="selectedKeys">
|
||||
<a-tree :show-line="true" :show-icon="false" :tree-data="treeData"
|
||||
:replace-fields="{key: 'id', title: 'name'}" :selected-keys="selectedKeys">
|
||||
|
||||
<template #title="record">
|
||||
<div class="tree-operate-node"
|
||||
@mouseenter="handleTreeMouseover(record.key)"
|
||||
@mouseleave="handleTreeMouseout(record.key)"
|
||||
@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-tooltip>
|
||||
<template #title>
|
||||
{{ record.title }}
|
||||
{{ record.name }}
|
||||
</template>
|
||||
<span class="tree-node-custom-title">{{ record.title }}</span>
|
||||
<span class="tree-node-custom-title">{{ record.name }}</span>
|
||||
</a-tooltip>
|
||||
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.key !== mouseInNodeKey}">
|
||||
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.id !== mouseInNodeKey}">
|
||||
<!--新增-->
|
||||
<a-button icon="plus"
|
||||
class="tree-operate-node-btn"
|
||||
@@ -182,17 +183,25 @@
|
||||
import InternalDetailPage from '../../../components/InternalDetailPage.vue'
|
||||
import JTable from '../../../components/jero/JTable.vue'
|
||||
// 条款添加
|
||||
import SplitAddForm from '../modules/SplitAddForm.vue'
|
||||
import SplitAddForm from './modules/SplitAddForm.vue'
|
||||
// 条款内容弹框
|
||||
import SplitClauseDetail from '../modules/SplitClauseDetail.vue'
|
||||
import SplitClauseDetail from './modules/SplitClauseDetail.vue'
|
||||
// 添加左侧树节点弹框
|
||||
import SplitDetailNodeAdd from '../modules/SplitDetailNodeAdd.vue'
|
||||
import SplitDetailNodeAdd from './modules/SplitDetailNodeAdd.vue'
|
||||
// 批量设置弹框
|
||||
import SplitDetailBatchSetting from '../modules/SplitDetailBatchSetting.vue'
|
||||
import SplitDetailBatchSetting from './modules/SplitDetailBatchSetting.vue'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { postAction, getAction } from '../../../api/manage.js'
|
||||
import { getAction } from '../../../api/manage.js'
|
||||
import { ConfigurableTableMixin } from '../../../mixins/ConfigurableTableMixin.js'
|
||||
import { getDocSplitTableHeader, getDocSplitSearch } from '../../../api/documentToolApi.js'
|
||||
import {
|
||||
getDocSplitTableHeader,
|
||||
getDocSplitSearch,
|
||||
deleteClauseTreeNode,
|
||||
moveUpOrDownClauseTreeNode,
|
||||
batchCopyClause,
|
||||
merageClause,
|
||||
getClauseTreeData
|
||||
} from '../../../api/documentToolApi.js'
|
||||
import Search from '../../../components/customField/Search.vue'
|
||||
|
||||
export default {
|
||||
@@ -305,9 +314,12 @@ export default {
|
||||
* @param dataRef
|
||||
*/
|
||||
handleSelectTreeNode ({ dataRef }) {
|
||||
this.selectedKeys = [dataRef.key]
|
||||
this.filters.nodeCode = dataRef.nodeCode
|
||||
this.loadData(1)
|
||||
this.selectedKeys = [dataRef.id]
|
||||
this.menuId = this.selectedKeys[0]
|
||||
this.uploadMenuId = this.selectedKeys[0]
|
||||
this.filters.info_id = this.infoId
|
||||
this.filters.menu_id = this.menuId
|
||||
this.loadData()
|
||||
},
|
||||
|
||||
// 显示条款内容弹框
|
||||
@@ -320,10 +332,11 @@ export default {
|
||||
infoId: this.infoId
|
||||
}
|
||||
this.loading = true
|
||||
getAction(`split/sarFileSplitMenu/getSplitMenusByInfoId`, params).then(res => {
|
||||
getClauseTreeData(params).then(res => {
|
||||
if (res.success) {
|
||||
this.data = this.toTree(res.result)
|
||||
this.treeData = [...this.data]
|
||||
// this.treeData = res.result || []
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
@@ -364,22 +377,14 @@ export default {
|
||||
clearMenu () {
|
||||
this.nodeTreeItem = null
|
||||
},
|
||||
// 选择树节点
|
||||
onSelect (selectedKeys) {
|
||||
this.menuId = selectedKeys[0]
|
||||
this.uploadMenuId = selectedKeys[0]
|
||||
this.selectedKeys = selectedKeys
|
||||
this.filters.info_id = this.infoId
|
||||
this.filters.menu_id = this.menuId
|
||||
this.loadData()
|
||||
},
|
||||
// 树形新增
|
||||
orgAdd () {
|
||||
this.$refs.splitDetailNodeAdd.add(this.nodeItem, this.infoId)
|
||||
orgAdd (record) {
|
||||
console.log(record)
|
||||
this.$refs.splitDetailNodeAdd.add(record.dataRef, this.infoId)
|
||||
},
|
||||
// 树形修改
|
||||
orgEdit () {
|
||||
this.$refs.splitDetailNodeAdd.edit(this.nodeItem, this.infoId)
|
||||
orgEdit (record) {
|
||||
this.$refs.splitDetailNodeAdd.edit(record.dataRef, this.infoId)
|
||||
},
|
||||
// 添加节点完成后的回调
|
||||
nodeAddOk () {
|
||||
@@ -392,12 +397,12 @@ export default {
|
||||
this.loadMenuData()
|
||||
},
|
||||
// 树形删除
|
||||
orgDelete () {
|
||||
orgDelete (record) {
|
||||
this.$confirm({
|
||||
content: this.$t('confirmDeleteNodes'),
|
||||
onOk:
|
||||
async () => {
|
||||
getAction(`split/sarFileSplitMenu/deleteMenu`, { id: this.nodeItem.id }).then(res => {
|
||||
deleteClauseTreeNode({ id: record.dataRef.id }).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.loadMenuData()
|
||||
@@ -410,17 +415,17 @@ export default {
|
||||
})
|
||||
},
|
||||
// 树上移
|
||||
orgMoveUp () {
|
||||
orgMoveUp (record) {
|
||||
const query = {
|
||||
moveFlag: 'up',
|
||||
infoId: this.infoId,
|
||||
sarFileSplitMenu: {
|
||||
id: this.nodeItem.id,
|
||||
pId: this.nodeItem.pid,
|
||||
displaySeq: this.nodeItem.displaySeq
|
||||
id: record.dataRef.id,
|
||||
pId: record.dataRef.pid,
|
||||
displaySeq: record.dataRef.displaySeq
|
||||
}
|
||||
}
|
||||
postAction(`split/sarFileSplitMenu/moveUpOrDown`, query).then(res => {
|
||||
moveUpOrDownClauseTreeNode(query).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.loadMenuData()
|
||||
@@ -431,17 +436,17 @@ export default {
|
||||
})
|
||||
},
|
||||
// 树下移
|
||||
orgmoveDown () {
|
||||
orgmoveDown (record) {
|
||||
const query = {
|
||||
moveFlag: 'down',
|
||||
infoId: this.infoId,
|
||||
SarFileSplitMenu: {
|
||||
id: this.nodeItem.id,
|
||||
pId: this.nodeItem.pid,
|
||||
displaySeq: this.nodeItem.displaySeq
|
||||
id: record.dataRef.id,
|
||||
pId: record.dataRef.pid,
|
||||
displaySeq: record.dataRef.displaySeq
|
||||
}
|
||||
}
|
||||
postAction(`split/sarFileSplitMenu/moveUpOrDown`, query).then(res => {
|
||||
moveUpOrDownClauseTreeNode(query).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.loadMenuData()
|
||||
@@ -474,7 +479,7 @@ export default {
|
||||
title: this.$t('confirmReplication'),
|
||||
content: '',
|
||||
onOk: () => {
|
||||
getAction('/split/sarFileSplitItems/batchCopyItems', params).then((res) => {
|
||||
batchCopyClause(params).then((res) => {
|
||||
if (res.data.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.onClearSelected()
|
||||
@@ -491,12 +496,18 @@ export default {
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
handleAddManage () {
|
||||
handleAdd () {
|
||||
// console.log('this.menuId',this.menuId)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.splitForm.add()
|
||||
this.$refs.splitForm.formTitle = this.$t('add')
|
||||
})
|
||||
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'))
|
||||
}
|
||||
},
|
||||
// 合并条款
|
||||
handleMergeManage () {
|
||||
@@ -508,7 +519,7 @@ export default {
|
||||
title: this.$t('docTool.split.mergeTerms'),
|
||||
content: '',
|
||||
onOk: () => {
|
||||
getAction('/split/sarFileSplitItems/batchMergeItems', { ids: ids }).then(res => {
|
||||
merageClause({ ids: ids }).then(res => {
|
||||
if (res.data.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.onClearSelected()
|
||||
|
||||
Reference in New Issue
Block a user