[update] 文档拆分的弹框拆分出来
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
>
|
||||
<template #title="{ key: treeKey, title, record }">
|
||||
<a-dropdown :trigger="['contextmenu']">
|
||||
<span v-if="title.indexOf(searchValue) >= -1 && title.length <= 18" :title="title"
|
||||
<span v-if="title.indexOf(searchValue) >= -1 && title.length <= 18" :title="title"
|
||||
class="expand-title">
|
||||
{{ title.substr(0, title.indexOf(searchValue)) }}<span style="color: #f50">{{ searchValue }}</span>
|
||||
{{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
|
||||
@@ -35,11 +35,10 @@
|
||||
{{ title.indexOf(searchValue) + searchValue.length > 18 ? searchValue.substr(0, 18 - title.indexOf(searchValue)) : searchValue
|
||||
}}</span>{{ title.indexOf(searchValue) + searchValue.length > 18 ? '...' : title.substr(title.indexOf(searchValue) + searchValue.length, 18 - title.indexOf(searchValue) - searchValue.length) + '...'
|
||||
}}
|
||||
|
||||
</span>
|
||||
</span>
|
||||
<span v-else :title="title">
|
||||
{{ title && title.length > 18 ? title.slice(0, 17) + '...' : title }}
|
||||
</span>
|
||||
{{ title && title.length > 18 ? title.slice(0, 17) + '...' : title }}
|
||||
</span>
|
||||
<template #overlay>
|
||||
<a-menu v-if="$route.query.createBy === userData.username || administrators"
|
||||
@click="({ key: menuKey }) => onContextMenuClick(treeKey, menuKey, record)">
|
||||
@@ -72,9 +71,9 @@
|
||||
:menuId="menuId" @resetSearch="resetSearch" @queryParams="queryParamsValues" />
|
||||
</div>
|
||||
<div class="table-operator">
|
||||
<div class="operator-text" @click="handleCopyManage"
|
||||
v-if="$route.query.createBy === userData.username || administrators"
|
||||
v-has="'split:sarFileSplitItems:copy'">
|
||||
<div class="operator-text" @click="handleCopyManage">
|
||||
<!-- v-if="$route.query.createBy === userData.username || administrators"-->
|
||||
<!-- v-has="'split:sarFileSplitItems:copy'"-->
|
||||
<a-icon type="copy" />
|
||||
{{ $t('copy') }}
|
||||
</div>
|
||||
@@ -140,67 +139,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 条款详情 -->
|
||||
<a-modal
|
||||
:title="$t('docTool.split.clauseContent')"
|
||||
:visible="contentVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
:footer="false"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<p v-html="contentValue"></p>
|
||||
</a-modal>
|
||||
<split-clause-detail ref="splitClauseDetail"></split-clause-detail>
|
||||
<!-- 添加节点 -->
|
||||
<a-modal
|
||||
class="add-menus"
|
||||
:title="menuTitle"
|
||||
:visible="menuRightVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@cancel="handleCancelMenuRight"
|
||||
@ok="hideModalMenuRight"
|
||||
>
|
||||
<a-form-model
|
||||
v-if="menuRightVisible"
|
||||
class="split-click-right-form"
|
||||
ref="ruleForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="labelCol"
|
||||
: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('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('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"
|
||||
:placeholder="$t('pleaseEnter')+$t('serialNumber')"
|
||||
:formatter="limitNumber"
|
||||
:parser="limitNumber" style="width: 100%" />
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
<split-detail-node-add ref="splitDetailNodeAdd" @ok="nodeAddOk" @update="nodeUpdateOk"></split-detail-node-add>
|
||||
<!-- 批量设置弹框 -->
|
||||
<a-modal
|
||||
class="show-setting"
|
||||
:title="$t('docTool.split.batchSetting')"
|
||||
:visible="batSetVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="modalOk"
|
||||
@cancel="batSetCancel"
|
||||
style="width: 1000px;height: auto"
|
||||
>
|
||||
<add-form
|
||||
ref="fileForm"
|
||||
@submitFormData="submitFormData"
|
||||
:flag="'4'"
|
||||
v-if="batSetVisible&&ids"
|
||||
:url="urlBatSet">
|
||||
</add-form>
|
||||
</a-modal>
|
||||
<split-add-form ref="splitForm" :formTitle="formTitle" :flag="'4'"
|
||||
<split-detail-batch-setting ref="splitDetailBatchSetting" @ok="batchSettingOk"></split-detail-batch-setting>
|
||||
<split-add-form ref="splitForm" :flag="'4'"
|
||||
:url="url" :infoId="infoId" :menuId="menuId" :itemId="itemId" @closeVisible="closeVisible"
|
||||
@sumber="sumber"></split-add-form>
|
||||
|
||||
@@ -211,11 +155,18 @@
|
||||
<script>
|
||||
import Search from '@/components/customField/Search'
|
||||
import TableData from '@/components/customField/TableData'
|
||||
import AddForm from '@/components/customField/AddForm'
|
||||
// 条款添加
|
||||
import SplitAddForm from './SplitAddForm'
|
||||
// 条款内容弹框
|
||||
import SplitClauseDetail from './SplitClauseDetail'
|
||||
// 添加左侧树节点弹框
|
||||
import SplitDetailNodeAdd from './SplitDetailNodeAdd'
|
||||
// 批量设置弹框
|
||||
import SplitDetailBatchSetting from './SplitDetailBatchSetting'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { postAction, getAction, putAction, downloadFile } from '@/api/manage'
|
||||
import { postAction, getAction, downloadFile } from '@/api/manage'
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
@@ -223,13 +174,14 @@ export default {
|
||||
components: {
|
||||
Search,
|
||||
TableData,
|
||||
AddForm
|
||||
SplitAddForm,
|
||||
SplitClauseDetail,
|
||||
SplitDetailNodeAdd,
|
||||
SplitDetailBatchSetting
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
userData: {},
|
||||
labelCol: { span: 6 },
|
||||
wrapperCol: { span: 16 },
|
||||
contentVisible: false, // 条款内容弹框显示
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
@@ -246,26 +198,10 @@ export default {
|
||||
confirmLoading: false,
|
||||
nodeTreeItem: null, // 右键菜单
|
||||
tmpStyle: '', // 右键菜单位置
|
||||
menuTitle: this.$t('add'),
|
||||
menuRightVisible: false,
|
||||
form: {},
|
||||
rules: {
|
||||
name: [
|
||||
// { required: true, message: this.$t('PleaseEnter') + this.$t('clauseNo'), trigger: 'blur' },
|
||||
],
|
||||
itemName: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('docTool.split.clauseName'), trigger: 'blur' }
|
||||
],
|
||||
displaySeq: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('serialNumber'), trigger: 'blur' }
|
||||
// { min: 1, max: 99999, message: this.$t('cantExeed') + '99999' + this.$t('characters'), trigger: 'blur' },
|
||||
]
|
||||
},
|
||||
infoId: '',
|
||||
menuId: '',
|
||||
itemId: '',
|
||||
itemVal: {},
|
||||
isEdit: false,
|
||||
// 操作栏
|
||||
operationList: [
|
||||
{
|
||||
@@ -282,17 +218,9 @@ export default {
|
||||
searchList: 'split/sarFileSplitItems/queryCondition', // 搜索字段
|
||||
tableList: 'split/sarFileSplitItems/getSplitItemsByPage', // 表格数据
|
||||
getAddForm: 'split/sarFileSplitItems/getForm', // 表单的字段
|
||||
addInfo: '/jero-boot/split/sarFileSplitItems/addSplitItems', // 新增
|
||||
updateInfo: '/jero-boot/split/sarFileSplitItems/updateSplitItems', // 编辑
|
||||
getDocumentInfo: 'split/sarFileSplitItems/getSplitItemsById',
|
||||
importZipUrl: '/split/sarFileSplitItems/importSplitItems' // 导入
|
||||
},
|
||||
urlBatSet: {
|
||||
getAddForm: 'split/sarFileSplitItems/getBatchSetForm',
|
||||
addInfo: '/jero-boot/split/sarFileSplitItems/batchSet'
|
||||
},
|
||||
batSetVisible: false, // 批量设置弹框显示
|
||||
ids: '',
|
||||
token: Vue.ls.get(ACCESS_TOKEN),
|
||||
uploadMenuId: '',
|
||||
deleteNode: false,
|
||||
@@ -321,12 +249,7 @@ export default {
|
||||
...mapGetters(['userInfo']),
|
||||
// 显示条款内容弹框
|
||||
showContent (val) {
|
||||
this.contentVisible = true
|
||||
this.contentValue = val
|
||||
},
|
||||
// 关闭条款内容弹框
|
||||
handleCancel () {
|
||||
this.contentVisible = false
|
||||
this.$refs.splitClauseDetail.open(val)
|
||||
},
|
||||
generateList (data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
@@ -463,7 +386,6 @@ export default {
|
||||
const queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
|
||||
}
|
||||
this.parameter.info_id = this.infoId
|
||||
this.parameter.menu_id = this.menuId
|
||||
@@ -471,22 +393,26 @@ export default {
|
||||
},
|
||||
// 树形新增
|
||||
orgAdd () {
|
||||
this.menuTitle = this.$t('add')
|
||||
this.isEdit = false
|
||||
this.form = {}
|
||||
this.menuRightVisible = true
|
||||
this.$refs.splitDetailNodeAdd.add(this.nodeItem, this.infoId)
|
||||
},
|
||||
// 树形修改
|
||||
orgEdit () {
|
||||
this.menuTitle = this.$t('edit')
|
||||
this.isEdit = true
|
||||
this.form.id = this.nodeItem.id
|
||||
this.form.pid = this.nodeItem.pid
|
||||
this.form.name = this.nodeItem.name
|
||||
this.form.itemName = this.nodeItem.itemName
|
||||
this.form.displaySeq = this.nodeItem.displaySeq
|
||||
this.form = { ...this.form }
|
||||
this.menuRightVisible = true
|
||||
this.$refs.splitDetailNodeAdd.edit(this.nodeItem, this.infoId)
|
||||
},
|
||||
// 添加节点完成后的回调
|
||||
nodeAddOk () {
|
||||
this.expandedKeys.push(this.nodeItem.id)
|
||||
this.loadMenuData()
|
||||
const queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
}
|
||||
this.$refs.splitDetailTable.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||
},
|
||||
// 修改节点完成后的回调
|
||||
nodeUpdateOk (expandId) {
|
||||
this.onExpand(expandId)
|
||||
this.loadMenuData()
|
||||
},
|
||||
// 树形删除
|
||||
orgDelete () {
|
||||
@@ -570,71 +496,6 @@ export default {
|
||||
this.uploadMenuId = ''
|
||||
this.selectedKeys = []
|
||||
},
|
||||
handleCancelMenuRight () {
|
||||
this.menuRightVisible = false
|
||||
},
|
||||
// 增加条款确定
|
||||
hideModalMenuRight () {
|
||||
const expandId = []
|
||||
expandId.push(this.form.pid)
|
||||
if (!this.isEdit) {
|
||||
const params = {
|
||||
infoId: this.infoId,
|
||||
pid: this.nodeItem.id,
|
||||
...this.form
|
||||
}
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
if (!this.flag) {
|
||||
this.flag = true
|
||||
postAction(`split/sarFileSplitMenu/addMenu`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.menuRightVisible = false
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
// this.onExpand(expandId)
|
||||
this.form = {}
|
||||
this.expandedKeys.push(this.nodeItem.id)
|
||||
// console.log('expandedKeys1111',this.expandedKeys)
|
||||
this.loadMenuData()
|
||||
const queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
}
|
||||
this.$refs.splitDetailTable.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
}).finally(() => {
|
||||
this.flag = false
|
||||
this.menuRightVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const params = {
|
||||
info_id: this.infoId,
|
||||
...this.form
|
||||
}
|
||||
if (!this.flag) {
|
||||
this.flag = true
|
||||
// console.log('parms',params)
|
||||
putAction(`split/sarFileSplitMenu/updateMenu`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.onExpand(expandId)
|
||||
this.form = {}
|
||||
this.loadMenuData()
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
}).finally(() => {
|
||||
this.flag = false
|
||||
this.menuRightVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
// 复制按钮
|
||||
handleCopyManage (record) {
|
||||
const ids = []
|
||||
@@ -679,17 +540,21 @@ export default {
|
||||
// 新增
|
||||
handleAddManage () {
|
||||
// console.log('this.menuId',this.menuId)
|
||||
if (this.menuId) {
|
||||
this.formTitle = this.$t('add')
|
||||
this.itemId = ''
|
||||
this.addVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.splitForm.add()
|
||||
this.$refs.splitForm.formTitle = this.$t('add')
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(this.$t('docTool.split.selectDirectoryTerms'))
|
||||
}
|
||||
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.splitForm.add()
|
||||
// this.$refs.splitForm.formTitle = this.$t('add')
|
||||
// })
|
||||
// } else {
|
||||
// this.$message.warning(this.$t('docTool.split.selectDirectoryTerms'))
|
||||
// }
|
||||
},
|
||||
// 关闭新增弹框
|
||||
closeVisible (val) {
|
||||
@@ -788,43 +653,21 @@ export default {
|
||||
},
|
||||
// 批量设置
|
||||
handleManage () {
|
||||
this.ids = this.selectedRowKeys.join(',')
|
||||
const ids = this.selectedRowKeys.join(',')
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length < 1) {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
} else {
|
||||
this.batSetVisible = true
|
||||
this.$refs.splitDetailBatchSetting.open(ids)
|
||||
}
|
||||
},
|
||||
// 批量设置确定
|
||||
modalOk () {
|
||||
this.$refs.fileForm.submit()
|
||||
},
|
||||
// 批量设置取消
|
||||
batSetCancel () {
|
||||
this.batSetVisible = false
|
||||
},
|
||||
submitFormData (formInline) {
|
||||
let url = ''
|
||||
if (this.formInline.id) {
|
||||
url = this.url.updateInfo
|
||||
} else {
|
||||
url = this.url.addInfo
|
||||
// 批量设置完成的回调
|
||||
batchSettingOk () {
|
||||
this.selectClear()
|
||||
const queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
}
|
||||
formInline.ids = this.ids
|
||||
postAction(url, formInline).then((res) => {
|
||||
if (res.data.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.batSetVisible = false
|
||||
this.selectClear()
|
||||
const queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
}
|
||||
this.$refs.splitDetailTable.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam)))
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
this.$refs.splitDetailTable.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam)))
|
||||
},
|
||||
// 批量删除
|
||||
handleBatCancel () {
|
||||
@@ -997,16 +840,6 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 正则替换小数点
|
||||
limitNumber (value) {
|
||||
if (typeof value === 'string') {
|
||||
return !isNaN(Number(value)) ? value.replace(/\./g, '') : 0
|
||||
} else if (typeof value === 'number') {
|
||||
return !isNaN(value) ? String(value).replace(/\./g, '') : 0
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
|
||||
Reference in New Issue
Block a user