[add] 业务支持-资料中心迁移

This commit is contained in:
lideqin
2023-08-18 15:09:47 +08:00
parent b6c91bd17e
commit 4f7c939bb3
8 changed files with 1222 additions and 148 deletions
+112 -1
View File
@@ -118,6 +118,60 @@
}
// 新增编辑表单样式
.form-add{
margin-bottom: 40px;
/deep/ .ant-form-item-label {
width: 130px;
}
/deep/ .ant-form-item-control-wrapper {
display: inline-block;
width: 100%;
}
}
.item-model{
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
height: 40px;
margin-bottom: 24px;
/deep/ .ant-form-item-control-wrapper {
width: 100%;
}
}
.item-model-textarea {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
/deep/ .ant-form-item-control-wrapper {
width: 100% !important;
}
}
.box-input {
/deep/ .ant-select-selection--single {
height: 38px;
}
/deep/ .ant-select-selection--multiple {
height: 38px;
.ant-select-selection__rendered > ul > li{
margin-top: 6px;
}
}
/deep/ .ant-select-selection__rendered {
line-height: 38px;
height: 38px;
}
/deep/ .ant-calendar-picker {
line-height: 38px;
height: 38px;
}
/deep/ .ant-calendar-picker-input {
height: 38px;
}
/deep/ .ant-input-number-input-wrap {
line-height: 38px;
height: 38px;
}
}
.box-title-text {
line-height: 1.4;
display: flex;
@@ -186,4 +240,61 @@
height: 38px;
}
}
}
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.header-text {
font-size: 16px;
font-weight: bold;
margin-left: 15px;
/*border-bottom: 1px #d9d9d9 dashed;*/
height: 30px;
margin-bottom: 30px;
}
.button-text {
height: 38px;
width: calc(100% - 100px);
line-height: 38px;
background: #fff;
border: 1px #1890ff solid;
color: #1890ff;
}
// 新增编辑表单样式--完
// 左树右表布局
.left-tree-div {
.div-left {
/*height: 100%;*/
width: 230px;
float: left;
padding-right: 20px;
/*border-right: 1px solid #E6E7EC;*/
overflow-y: auto;
}
.div-right {
padding-left: 20px;
width: calc(100% - 230px);
float: right;
border-left: 1px solid #E6E7EC;
/*flex: 1;*/
.right-search-header {
margin-bottom: 20px;
.table-page-search-submitButtons {
display: flex;
}
}
}
}
+23 -2
View File
@@ -96,6 +96,7 @@ module.exports = {
essentialInformation: 'General Information',
download: 'Download',
fileName: 'File Name',
fileDeclaration: 'File Declaration',
newNode: 'New node',
modifyNode: 'Modify Node',
deleteNode: 'Delete Node',
@@ -113,11 +114,24 @@ module.exports = {
confirmRelease: 'Confirm Release?',
confirmWithdraw: 'Confirm to Withdraw?',
doNotHavePermissionDeleteData: 'Do not have permission to delete this data',
noData: 'No Data',
dataLoading: 'Data loading...',
confirmDelete: 'Confirm the listing title you want to delete?',
uploadedBy: 'Uploaded By',
uploadTime: 'Upload Time',
uploadFileBtn: 'Upload File',
// 树右键
treeRight: {
addFolder: 'Create New Folder',
addSubFolders: 'Add A Subfolder',
editFolder: 'Edit Folder',
deleteFolders: 'Delete Folders',
folderName: 'Folder Name',
administrativePrivileges: 'Administrative Permissions',
checkPermissions: 'Read Permissions',
folderOrder: 'Folder Order',
deleteNode: 'If there is any file information, the file will be deleted. Are you sure to delete this data?'
},
// 页面头部
header: {
userMenuSearchMenu: 'Search menu',
@@ -417,6 +431,13 @@ module.exports = {
replyToComments: 'Reply To Comments'
}
},
// 业务支持
businessSupp: {
dataCenter: {
selectDirectoryLocation: 'Please select the directory location to add the folder',
fileUploaded: 'File uploaded, please wait'
}
},
// 标准选择器
standardSelect: {
standardSelection: 'Standard Selection'
+23
View File
@@ -96,6 +96,7 @@ module.exports = {
essentialInformation: '基本信息',
download: '下载',
fileName: '文件名称',
fileDeclaration: '文件说明',
newNode: '新增节点',
modifyNode: '修改节点',
deleteNode: '删除节点',
@@ -116,6 +117,21 @@ module.exports = {
noData: '暂无数据',
dataLoading: '数据加载中...',
confirmDelete: '确定删除?',
uploadedBy: '上传人',
uploadTime: '上传时间',
uploadFileBtn: '上传文件',
// 树右键
treeRight: {
addFolder: '新增文件夹',
addSubFolders: '新增子文件夹',
editFolder: '编辑文件夹',
deleteFolders: '删除文件夹',
folderName: '文件夹名称',
administrativePrivileges: '管理权限',
checkPermissions: '查看权限',
folderOrder: '文件夹顺序',
deleteNode: '若有文件信息将同步删除,确认删除该条数据?'
},
// 页面头部
header: {
userMenuSearchMenu: '搜索菜单',
@@ -415,6 +431,13 @@ module.exports = {
replyToComments: '回复评论'
}
},
// 业务支持
businessSupp: {
dataCenter: {
selectDirectoryLocation: '请选择添加文件夹的目录位置',
fileUploaded: '文件上传中,请稍后'
}
},
// 标准选择器
standardSelect: {
standardSelection: '标准选择'
+1 -109
View File
@@ -504,113 +504,5 @@ export default {
</script>
<style scoped lang="less">
.form-add{
margin-bottom: 40px;
/deep/ .ant-form-item-label {
width: 130px;
}
/deep/ .ant-form-item-control-wrapper {
display: inline-block;
width: 100%;
}
}
.item-model{
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
height: 40px;
margin-bottom: 24px;
/deep/ .ant-form-item-control-wrapper {
width: 100%;
}
}
.item-model-textarea {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
/deep/ .ant-form-item-control-wrapper {
width: 100% !important;
}
}
.box-input {
/deep/ .ant-select-selection--single {
height: 38px;
}
/deep/ .ant-select-selection--multiple {
height: 38px;
.ant-select-selection__rendered > ul > li{
margin-top: 6px;
}
}
/deep/ .ant-select-selection__rendered {
line-height: 38px;
height: 38px;
}
/deep/ .ant-calendar-picker {
line-height: 38px;
height: 38px;
}
/deep/ .ant-calendar-picker-input {
height: 38px;
}
/deep/ .ant-input-number-input-wrap {
line-height: 38px;
height: 38px;
}
}
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
.title-text {
width: 114px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 42px;
}
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.header-text {
font-size: 16px;
font-weight: bold;
margin-left: 15px;
/*border-bottom: 1px #d9d9d9 dashed;*/
height: 30px;
margin-bottom: 30px;
}
.formAdd {
margin-bottom: 40px;
}
.button-text {
height: 38px;
width: calc(100% - 100px);
line-height: 38px;
background: #fff;
border: 1px #1890ff solid;
color: #1890ff;
}
@import '~@assets/less/common.less';
</style>
+18
View File
@@ -327,6 +327,24 @@ export const constantRouterMap = [
name: 'documentIndex',
component: () => import(/* webpackChunkName: "user" */ '@/views/documentManage/modules/LibraryDetail')
},
// 文档对比-发起对比
{
path: '/initiateDocumentComparison',
name: 'initiateDocumentComparison',
component: () => import(/* webpackChunkName: "user" */ '@/views/documentTool/modules/InitiateComparison')
},
// 文档对比-发起对比
{
path: '/documentDataComparison',
name: 'documentDataComparison',
component: () => import(/* webpackChunkName: "user" */ '@/views/documentTool/modules/DocumentDataComparison')
},
// 文档对比-对比结果
{
path: '/comparisonResults',
name: 'comparisonResults',
component: () => import(/* webpackChunkName: "user" */ '@/views/documentTool/modules/ComparisonResults')
},
// {
// path: '/',
// name: 'index',
+829
View File
@@ -0,0 +1,829 @@
<template>
<a-card :bordered="false">
<div class="left-tree-div">
<div class="div-left">
<div class="split-detail-left-tree">
<a-input-search style="margin-bottom: 8px" :placeholder="$t('nodeQuickLookup')" @change="onLeftChange"
@search="onSearch"/>
<a-tree
:selected-keys="selectedKeys"
:expanded-keys.sync="expandedKeys"
:auto-expand-parent="autoExpandParent"
:defaultExpandAll="true"
:tree-data="gData"
@expand="onExpand"
@rightClick="rightClick"
@select="onSelect"
>
<template #title="{ key: treeKey, title }">
<a-dropdown :trigger="['contextmenu']">
<!-- <span>{{ title }}</span>-->
<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) }}
</span>
<span
v-else-if="title.indexOf(searchValue) >= -1 && title.length > 18 && title.indexOf(searchValue)>18"
:title="title">
{{title && title.length > 18?title.slice(0,17)+'...':title}}
</span>
<span
v-else-if="title.indexOf(searchValue) >= -1 && title.length > 18 && title.indexOf(searchValue)<=18"
:title="title">
{{ title.substr(0, title.indexOf(searchValue)) }}<span style="color: #f50">{{ 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 v-else :title="title">
{{title && title.length > 18?title.slice(0,17)+'...':title}}
</span>
<template #overlay v-if='manager'>
<a-menu>
<a-menu-item key="1" @click="orgAdd">{{$t('treeRight.addFolder')}}</a-menu-item>
<a-menu-item key="4" @click="orgAdds" v-if="notAddChildNode">{{$t('treeRight.addSubFolders')}}</a-menu-item>
<a-menu-item key="2" @click="orgEdit">{{$t('treeRight.editFolder')}}</a-menu-item>
<a-menu-item key="3" @click="orgDelete">{{$t('treeRight.deleteFolders')}}</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</template>
</a-tree>
</div>
</div>
<div class="div-right">
<div class="div-right-wrapper">
<div class="right-search-header table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="8" :sm="8">
<a-form-item :label="$t('fileName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('fileName')"
v-model="queryParam.fileName"></a-input>
</a-form-item>
</a-col>
<a-col :md="8" :sm="8">
<a-form-item :label="$t('uploadedBy')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('uploadedBy')"
v-model="queryParam.createBy"></a-input>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="8" :sm="8">
<a-form-item :label="$t('uploadTime')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style='margin-left: -1px'
v-model="queryParam.time"
:disabled="false"/>
</a-form-item>
</a-col>
</template>
<span style="float: right;overflow: hidden;margin-right: 11px"
class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a @click="handleToggleSearch">
<span class="icon-open">{{ !toggleSearchStatus ? $t('open') : $t('putAway') }}</span>
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
<a-button class="box-button" style="margin-left: 8px"
@click="searchReset">{{ $t('reset') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{ $t('query') }}</a-button>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<div class="table-operator" style="overflow:hidden;margin-bottom: 20px">
<div style="float: right;margin-bottom: 0px;margin-left: 20px">
<!-- v-has="'externalReport:upload'"-->
<div class="operator-text"
@click="handleuploadFile" v-if='authmanage'>
<a-icon type="cloud-upload"/>
{{ $t('uploadFileBtn') }}
</div>
<div class="operator-text"
v-has="'externalReport:batchDelete'"
@click="handleDel" v-if='authmanage'>
<a-icon type="delete"/>
{{ $t('batchDelete') }}
</div>
</div>
</div>
<div>
<a-table
ref="table"
size="middle"
:components="drag(columns,'columns')"
:loading="loading"
:pagination="ipagination"
rowKey="id"
:scroll="{x: '100%',y:'calc(100vh - 180px)'}"
:data-source="dataSource"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
@change="handleTableChange"
>
<span slot="projectName" slot-scope="text" :title="text">
{{ text }}
</span>
<span slot="fileName" slot-scope="text" :title="text">
{{ text }}
</span>
<span slot="operation" slot-scope="text,record">
<a class="text-operation"
v-has="'externalReport:download'"
@click="download(record)">{{$t('download')}}</a>
<a class="text-operation"
v-has="'externalReport:edit'"
@click="handleEdit(record)" v-if='authmanage'>{{$t('edit')}}</a>
<a class="text-operation"
v-has="'externalReport:delete'"
@click="batchDel(record)" v-if='authmanage'>{{$t('delete')}}</a>
</span>
</a-table>
</div>
<!-- 上传文件-->
<addModel ref="addModelRef" @addModelList="addModelList"/>
<!-- 添加节点-->
<a-modal
class="add-menus"
:title="menuTitle"
:width="600"
:visible="menuRightVisible"
:confirm-loading="confirmLoading"
@cancel="handleCancelMenuRight"
@ok="hideModalMenuRight"
>
<a-form-model
class="split-click-right-form"
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text"
:title="$t('treeRight.folderName')">{{$t('treeRight.folderName')}}</span>
</div>
<a-form-model-item prop="folderName" style='width: 72%'>
<a-input
v-model.trim="form.folderName"
style='width: 130%'
class="box-input add-input"
maxLength="100"
:placeholder="$t('pleaseEnter')+$t('treeRight.folderName')"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('treeRight.administrativePrivileges')">{{$t('treeRight.administrativePrivileges')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="authManageIdsName">
<a-select
mode="multiple"
v-model="form.authManageIdsName"
:placeholder="$t('pleaseSelect')+$t('treeRight.administrativePrivileges')"
:filter-option="false"
:not-found-content="null"
allowClear
@search="personSearch"
>
<a-select-option v-for="item in personList" :key="item.id" :value="item.id">
{{ item.realname }}
</a-select-option>
<template slot="notFoundContent">
<a-empty></a-empty>
</template>
</a-select>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('treeRight.checkPermissions')">{{$t('treeRight.checkPermissions')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="authViewIdsName">
<a-select
mode="multiple"
v-model="form.authViewIds"
:placeholder="$t('pleaseSelect')+$t('treeRight.administrativePrivileges')"
:filter-option="false"
:not-found-content="null"
allowClear
@search="personSearch"
>
<a-select-option v-for="item in personList" :key="item.id" :value="item.id">
{{ item.realname }}
</a-select-option>
<template slot="notFoundContent">
<a-empty></a-empty>
</template>
</a-select>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text"
:title="$t('treeRight.folderOrder')">{{$t('treeRight.folderOrder')}}</span>
</div>
<a-form-model-item class="itemModel" prop="orderId">
<a-input-number v-model.trim="form.orderId" :min="1" :max="9999" class="box-input add-input"
:placeholder="$t('pleaseEnter')+$t('treeRight.folderOrder')" :formatter="limitNumber"
:parser="limitNumber"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
</div>
</div>
</div>
</a-card>
</template>
<script>
import AddModel from './modules/AddModel'
import { getAction, postAction, downloadFile, deleteAction, putAction } from '@/api/manage'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { getUserList } from '@/api/api'
export default {
name: 'DataCenter',
components: {
AddModel
},
mixins: [ResizeHeader, ResizeColumnProvide, JeroListMixin],
data () {
return {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
personList: [],
disabled: false,
manager: false, // 是否有树右键菜单
addSub: true,
dataSource: [],
expandedKeys: [],
searchValue: '',
autoExpandParent: true,
dataList: [],
gData: [],
loading: false,
attId: '',
data: [],
confirmLoading: false,
nodeTreeItem: null, // 右键菜单
tmpStyle: '', // 右键菜单位置
menuTitle: this.$t('add'),
menuRightVisible: false,
form: {},
rules: {
folderName: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('treeRight.folderName'), trigger: 'blur' }
],
// authManageIdsName: [
// { required: true, message: this.$t('pleaseSelect') + this.$t('treeRight.administrativePrivileges'), trigger: 'change' },
// ],
// authViewIdsName: [
// { required: true, message: this.$t('pleaseSelect') + this.$t('treeRight.checkPermissions'), trigger: 'change' },
// ],
orderId: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('treeRight.folderOrder'), trigger: 'blur' }
]
},
infoId: '',
menuId: '',
itemId: '',
itemVal: {},
isEdit: false,
columns: [
{
title: this.$t('fileName'),
align: 'left',
ellipsis: true,
dataIndex: 'fileName',
scopedSlots: { customRender: 'fileName' },
width: 270
},
{
title: this.$t('fileDeclaration'),
align: 'left',
ellipsis: true,
dataIndex: 'fileDescription',
scopedSlots: { customRender: 'projectName' },
width: 390
},
{
title: this.$t('uploadedBy'),
align: 'left',
ellipsis: true,
dataIndex: 'createBy',
width: 150
},
{
title: this.$t('uploadTime'),
align: 'left',
ellipsis: true,
dataIndex: 'createTime',
width: 150
},
{
title: this.$t('operation'),
align: 'left',
fixed: 'right',
ellipsis: true,
width: 240,
scopedSlots: { customRender: 'operation' }
}
],
url: {
list: 'com.jero.modules.extRepo/extRepoData/page',
getSysCategoryTree: '/sys/category/getSysCategoryTree'
},
// upAccept:'.zip', //导入文件类型
selectedKeys: [],
notAddChildNode: false,
authmanage: false,
fullWidth: ''
}
},
mounted () {
this.loadMenuData()
this.generateList(this.gData)
},
methods: {
personSearch (value) {
getUserList({ pageNo: 1, pageSize: 20, realname: '*' + value + '*' }).then(res => {
if (res.success) {
this.personList = res.result.records || []
}
})
},
// 获取左侧菜单的下级
generateList (data) {
for (let i = 0; i < data.length; i++) {
const node = data[i]
const key = node.key
this.dataList.push({ key, title: key })
if (node.children) {
this.generateList(node.children)
}
}
},
// 获取传入的树中最上层的key
getParentKey (key, tree) {
let parentKey
for (let i = 0; i < tree.length; i++) {
const node = tree[i]
if (node.children) {
if (node.children.some(item => item.key === key)) {
parentKey = node.key
} else if (this.getParentKey(key, node.children)) {
parentKey = this.getParentKey(key, node.children)
}
}
}
return parentKey
},
// 树的展开
onExpand (expandedKeys) {
this.expandedKeys = expandedKeys
this.autoExpandParent = false
},
// 左侧搜索框的改变
onLeftChange (e) {
const value = e.target.value
const expandedKeys = this.dataList
.map(item => {
if (item.title.indexOf(value) > -1) {
return this.getParentKey(item.key, this.gData)
}
return null
})
.filter((item, i, self) => item && self.indexOf(item) === i)
Object.assign(this, {
expandedKeys,
searchValue: value,
autoExpandParent: true
})
this.onSearch()
},
// 获取左侧目录数据
loadMenuData () {
// let params = {
// infoId: this.infoId
// }
this.loading = true
getAction(`extRepo/extRepoFolder/list`, {}).then(res => {
if (res.success) {
this.data = res.result.list
this.menuId = this.data[0].key
this.loadData()
this.gData = [...this.data]
Object.assign(this, {
expandedKeys: this.expandedKeys,
autoExpandParent: true
})
}
}).finally(() => {
this.loading = false
})
},
// 鼠标右键
rightClick ({ event, node }) {
this.notAddChildNode = node._props.dataRef.level !== 4
this.manager = node._props.dataRef.manager === true
const x = event.currentTarget.offsetLeft + event.currentTarget.clientWidth
const y = event.currentTarget.offsetTop
console.log(node._props.dataRef)
this.nodeTreeItem = {
pageX: x,
pageY: y,
authManageIdsName: node._props.dataRef.authManageIdsName,
authViewIds: node._props.dataRef.authViewIds,
key: node._props.dataRef.key,
authManageIds: node._props.dataRef.authManageIds,
authViewIdsName: node._props.dataRef.authViewIdsName,
title: node._props.dataRef.title,
folderName: node._props.dataRef.folderName,
orderId: node._props.dataRef.orderId
}
this.nodeItem = JSON.parse(JSON.stringify(this.nodeTreeItem))
this.tmpStyle = {
position: 'absolute',
maxHeight: 40,
textAlign: 'center',
left: `${x + 10 - 0}px`,
top: `${y + 6 - 0}px`,
background: `#FFFFFF`,
zIndex: `2`
}
},
// 用于点击空白处隐藏增删改菜单
clearMenu () {
this.nodeTreeItem = null
},
// 选择树节点
onSelect (selectedKeys) {
this.menuId = selectedKeys[0]
this.selectedKeys = selectedKeys
this.searchQuery()
},
// 树形新增文件夹
orgAdd () {
this.menuTitle = this.$t('treeRight.addFolder')
this.isEdit = false
this.form = {}
this.supFolder = this.nodeItem.key
this.addSub = false
const params = {}
params.id = this.supFolder
postAction(`extRepo/extRepoFolder/isAllowSiblingFolder`, params).then(res => {
if (res.success) {
this.menuRightVisible = true
} else {
this.$message.warning(res.message)
}
})
},
// 树形新增子文件夹
orgAdds () {
this.menuTitle = this.$t('treeRight.addSubFolders')
this.isEdit = false
this.form = {}
this.supFolder = this.nodeItem.key
this.addSub = true
this.menuRightVisible = true
},
// 树形修改
orgEdit () {
this.menuTitle = this.$t('treeRight.editFolder')
this.isEdit = true
this.form.id = this.nodeItem.key
this.form.authManageIds = this.nodeItem.authManageIds
this.form.authViewIds = this.nodeItem.authViewIds
this.form.authManageIdsName = this.nodeItem.authManageIdsName
this.form.authViewIdsName = this.nodeItem.authViewIdsName
this.form.folderName = this.nodeItem.folderName
this.form.orderId = this.nodeItem.orderId
this.form = { ...this.form }
this.menuRightVisible = true
},
// 树形删除
orgDelete () {
this.$confirm({
content: this.$t('treeRight.deleteNode'),
onOk:
async () => {
deleteAction(`extRepo/extRepoFolder/delete`, { id: this.nodeItem.key }).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadMenuData()
this.searchQuery()
} else {
this.$message.warning(res.message)
}
})
}
})
},
// 取消文件夹的新增或编辑
handleCancelMenuRight () {
this.menuRightVisible = false
this.$refs.ruleForm.clearValidate()
},
// 增加文件夹确定
hideModalMenuRight () {
if (this.confirmLoading) {
return
}
if (!this.isEdit) {
const params = {
supFolder: this.supFolder,
addSub: this.addSub,
...this.form
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.confirmLoading = true
postAction(`extRepo/extRepoFolder/add`, params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.form = {}
this.expandedKeys.push(this.nodeItem.id)
this.loadMenuData()
this.searchQuery()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
this.menuRightVisible = false
})
}
})
} else {
const params = {
...this.form
}
putAction(`extRepo/extRepoFolder/edit`, params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.form = {}
this.loadMenuData()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
this.menuRightVisible = false
})
}
},
// 上传文件弹框成功后的回调
addModelList () {
this.ipagination.current = 1
this.loadData()
},
// 获取列表数据
loadData (item) {
this.queryParam.supFolder = this.menuId
this.queryParam.pageNo = this.ipagination.current
this.queryParam.pageSize = this.ipagination.pageSize
const params = {
...this.queryParam,
...item
}
this.loading = true
getAction(this.url.list, params).then(res => {
if (res.success) {
if (res.result.pageList.current > 1 && res.result.pageList.records.length === 0) {
this.ipagination.current = 1
this.loadData()
return
}
this.dataSource = res.result.pageList.records || []
this.authmanage = res.result.auth_manage
this.ipagination.total = res.result.pageList.total
}
}).finally(() => {
this.loading = false
})
},
// 搜索
searchQuery (item) {
this.ipagination.current = 1
if (this.queryParam.time && this.queryParam.time instanceof Array) {
this.queryParam.time = this.queryParam.time.join(',')
}
this.loadData(item)
},
// 清空
searchReset () {
this.ipagination.current = 1
this.queryParam = {}
this.loadData()
},
// 查看
handlelist () {
this.$refs.handleModelRef.addModel()
},
// 编辑
handleEdit (item) {
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(item)))
},
// 下载
download (item) {
const query = {
id: item.fileKey
}
downloadFile('/sys/common/downLoadFile', item.fileName, query)
},
// 删除
batchDel (val) {
this.$confirm({
content: this.$t('confirmDeletion'),
onOk: () => {
deleteAction('com.jero.modules.extRepo/extRepoData/delete', { id: val.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warning(res.message)
}
})
}
})
},
// 批量删除
handleDel () {
if (this.selectedRowKeys.length > 0) {
this.$confirm({
content: this.$t('confirmBatchDeletion'),
onOk: () => {
const idList = this.selectedRowKeys
deleteAction('com.jero.modules.extRepo/extRepoData/deleteBatch', { ids: idList.join(',') }).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.selectedRowKeys = []
this.loadData()
} else {
this.$message.warning(res.message)
}
})
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
// 选择框
onSelectChange (selectedRowKeys, rows) {
this.selectedRowKeys = selectedRowKeys
this.selectedRows = rows
},
// 上传文件
handleuploadFile (e) {
if (this.menuId) {
this.$refs.addModelRef.addModel(this.menuId)
} else {
this.$message.warning(this.$t('businessSupp.dataCenter.selectDirectorylocation'))
}
},
onSearch () {
const self = this
const tree = JSON.parse(JSON.stringify(this.data))
this.expandedKeys = []
if (this.searchValue.trim() === '') {
this.gData = JSON.parse(JSON.stringify(this.data))
return
}
if (tree && tree.length > 0) {
tree.forEach((n, i, a) => {
self.searchEach(n, this.searchValue)
})
// 没有叶子节点的根节点也要清理掉
const length = tree.length
for (let i = length - 1; i >= 0; i--) {
const e2 = tree[i]
if (!this.isHasChildren(e2) && e2.title.indexOf(this.searchValue) <= -1) {
tree.splice(i, 1)
this.expandedKeys.push(e2.key)
}
}
this.gData = [...tree]
}
},
searchEach (node, value) {
const depth = this.getTreeDepth(node)
const self = this
for (let i = 0; i < depth - 1; i++) {
let spliceCounter = 0
this.traverseTree(node, n => {
if (self.isHasChildren(n)) {
const children = n.children
const length = children.length
for (let j = length - 1; j >= 0; j--) {
const e3 = children[j]
if (!self.isHasChildren(e3) && e3.title.indexOf(value) <= -1) {
children.splice(j, 1)
spliceCounter++
} else {
this.expandedKeys.push(e3.key)
}
}
}
})
if (spliceCounter === 0) {
break
}
}
},
// 判断树形结构中的一个节点是否具有孩子节点
isHasChildren (node) {
let flag = false
if (node.children && node.children.length > 0) {
flag = true
}
return flag
},
// 通过传入根节点获得树的深度
getTreeDepth (node) {
if (undefined === node || node == null) {
return 0
}
let r = 0
let currentLevelNodes = [node]
while (currentLevelNodes.length > 0) {
r++
let nextLevelNodes = []
for (let i = 0; i < currentLevelNodes.length; i++) {
const e = currentLevelNodes[i]
if (this.isHasChildren(e)) {
nextLevelNodes = nextLevelNodes.concat(e.children)
}
}
currentLevelNodes = nextLevelNodes
}
return r
},
traverseTree (node, callback) {
if (!node) {
return
}
const stack = []
stack.push(node)
let tmpNode
while (stack.length > 0) {
tmpNode = stack.pop()
callback(tmpNode)
if (tmpNode.children && tmpNode.children.length > 0) {
for (let i = tmpNode.children.length - 1; i >= 0; i--) {
stack.push(tmpNode.children[i])
}
}
}
},
// 正则替换小数点
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
}
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,182 @@
<template>
<div>
<a-modal
:title="title"
:maskClosable="false"
:width="600"
placement="right"
:closable="true"
@cancel="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :tip="this.$t('businessSupp.dataCenter.fileUploaded')" :spinning="spinning">
<a-form>
<a-form-model :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text"
:title="$t('fileName')">{{$t('fileName')}}</span>
</div>
<a-form-model-item class="item-model" prop="fileKey">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('fileKey')">
{{ (formInline.fileKey === 'null' || formInline.fileKey === '' ||
formInline.fileKey == null) ? $t('uploadFile.clickUpload') : $t('uploadFile.viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('fileDeclaration')">{{$t('fileDeclaration')}}</span>
</div>
<a-form-model-item class="item-model-textarea" prop="fileDescription">
<a-textarea :placeholder="$t('pleaseEnter')+$t('fileDeclaration')"
:maxLength="200"
:rows="4"
v-model.trim="formInline.fileDescription"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-form>
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: 8px" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary">{{$t('submit')}}</a-button>
</div>
</a-modal>
<upload-file ref="uploadFile" @change="uploadFileChange" :return-url="false"></upload-file>
</div>
</template>
<script>
import UploadFile from '@/components/UploadFile'
import { postAction, putAction } from '@/api/manage'
export default {
name: 'AddModel',
components: { UploadFile },
data () {
return {
formInline: {},
spinning: false,
menuId: '',
visible: false,
url: {
add: 'com.jero.modules.extRepo/extRepoData/add',
edit: 'com.jero.modules.extRepo/extRepoData/edit'
},
rules: {
fileDescription: [
// { required: true, message: this.$t('pleaseEnter')+this.$t('fileDeclaration'), trigger: 'blur' },
],
fileKey: [
{
required: true,
message: this.$t('fileName') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
disabled: false,
title: ''
}
},
methods: {
addModel (menuId) {
this.visible = true
this.title = this.$t('uploadFileBtn')
this.disabled = false
this.menuId = menuId
this.formInline = {}
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
},
editModel (value) {
this.visible = true
this.title = this.$t('edit')
this.disabled = true
this.$nextTick(() => {
this.formInline = value
this.$refs.ruleForm.clearValidate()
})
},
handleCancel () {
if (this.spinning === true) {
this.visible = true
} else {
this.$refs.ruleForm.clearValidate()
this.visible = false
}
},
handleSubmit () {
if (this.spinning) {
return
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.spinning = true
let url = ''
let Action
if (this.formInline.id) {
url = this.url.edit
Action = putAction
} else {
url = this.url.add
Action = postAction
}
this.formInline.supFolder = this.menuId
const query = JSON.parse(JSON.stringify(this.formInline))
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',')
}
})
Action(url, query).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.visible = false
this.$emit('addModelList')
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.spinning = false
})
}
})
},
// 文件上传改变后的回调
uploadFileChange (data) {
const attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline }
this.$refs.ruleForm.clearValidate(['fileKey'])
},
clickButtonToUpload (item) {
this.$refs.uploadFile.open(this.formInline[item])
this.uploadName = item
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
+34 -36
View File
@@ -1,43 +1,41 @@
<template>
<div class="splitting">
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<search flag="3" :url="url"/>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<search flag="3" :url="url"/>
</div>
<div class="table-operator">
<!-- v-has="'split:sarFileSplitInfo:splitFile'"-->
<div class="operator-text" @click="handleModule">
<a-icon type="plus"/>
{{ $t('docTool.split.splitText') }}
</div>
<div class="table-operator">
<!-- v-has="'split:sarFileSplitInfo:splitFile'"-->
<div class="operator-text" @click="handleModule">
<a-icon type="plus"/>
{{ $t('docTool.split.splitText') }}
</div>
<!-- v-has="'split:sarFileSplitInfo:splitResult'"-->
<div class="operator-text" @click="handleExport">
<a-icon type="import" :rotate="-90"/>
{{ $t('docTool.split.importResults') }}
</div>
<!-- v-has="'split:sarFileSplitInfo:deleteBatch'"-->
<div class="operator-text" @click="handleDel">
<a-icon type="delete"/>
{{ $t('batchDelete') }}
</div>
<!-- v-has="'split:sarFileSplitInfo:splitResult'"-->
<div class="operator-text" @click="handleExport">
<a-icon type="import" :rotate="-90"/>
{{ $t('docTool.split.importResults') }}
</div>
<div class="splitting-table">
<table-data
:url="url"
:flag="'3'"
:operationList="operationList"
showAction
ref="tableData"
@onSelectChange="onSelectChange"
@backDocument="backDocument"
@deleteDetail="deleteDetail"
@detailClick="detailClick"
></table-data>
<!-- v-has="'split:sarFileSplitInfo:deleteBatch'"-->
<div class="operator-text" @click="handleDel">
<a-icon type="delete"/>
{{ $t('batchDelete') }}
</div>
<split-text ref="splitText" @visible="splitTextVisible"></split-text>
<import-result ref="importResult" @visible="importResultVisible"></import-result>
</a-card>
</div>
</div>
<div class="splitting-table">
<table-data
:url="url"
:flag="'3'"
:operationList="operationList"
showAction
ref="tableData"
@onSelectChange="onSelectChange"
@backDocument="backDocument"
@deleteDetail="deleteDetail"
@detailClick="detailClick"
></table-data>
</div>
<split-text ref="splitText" @visible="splitTextVisible"></split-text>
<import-result ref="importResult" @visible="importResultVisible"></import-result>
</a-card>
</template>
<script>