update 资料中心

This commit is contained in:
赵霄
2023-10-31 15:47:40 +08:00
parent 9ac308e17e
commit b8c3bcd3de
6 changed files with 149 additions and 76 deletions
@@ -10,29 +10,40 @@
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData" :selected-keys="selectedTreeKeys">
<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-icon class="parent-node-icon"
type="folder"
v-if="record.dataRef.children && record.dataRef.children.length > 0" />
<a-tooltip>
<template #title>
{{ record.title }}
{{ record.folderName }}
</template>
<span class="tree-node-custom-title">{{ record.title }}</span>
<span class="tree-node-custom-title">{{ record.folderName }}</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"
@click.stop="handleAddTreeNode(record)" />
<!-- 编辑根节点不能编辑-->
@click.stop="handleAddPeerFolder(record)"
v-has="'profileCenter:addPeer'" />
<!--新增子级-->
<a-button class="tree-operate-node-btn"
@click.stop="handleEditTreeNode(record)">
@click.stop="handleAddChildrenFolder(record)"
v-has="'profileCenter:addChildren'">
<i class="iconfont icon-wenjian-tianjia" />
</a-button>
<!--编辑根节点不能编辑-->
<a-button class="tree-operate-node-btn"
@click.stop="handleEditTreeNode(record)"
v-has="'profileCenter:editFolder'">
<i class="iconfont icon-bianji" />
</a-button>
<!-- 删除根节点不能删除-->
<!--删除根节点不能删除-->
<a-button class="tree-operate-node-btn"
@click.stop="handleDelTreeNode(record)">
@click.stop="handleDelTreeNode(record)"
v-has="'profileCenter:deleteFolder'">
<i class="iconfont icon-shanchu_" />
</a-button>
</div>
@@ -50,13 +61,13 @@
<!--文件名称-->
<a-col :md="6" :sm="12">
<a-form-item :label="$t('fileName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-input :placeholder="$t('pleaseEnter') + $t('fileName')" v-model="queryParam.projectName"></j-input>
<j-input :placeholder="$t('pleaseEnter') + $t('fileName')" v-model="queryParam.fileName"></j-input>
</a-form-item>
</a-col>
<!--上传人-->
<a-col :md="6" :sm="12">
<a-form-item :label="$t('uploadedBy')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-input :placeholder="$t('pleaseEnter') + $t('uploadedBy')" v-model="queryParam.projectName"></j-input>
<a-input :placeholder="$t('pleaseEnter') + $t('uploadedBy')" v-model="queryParam.uploader"></a-input>
</a-form-item>
</a-col>
@@ -64,9 +75,12 @@
<a-col :md="6" :sm="12">
<a-form-item :label="$t('uploadTime')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
:placeholder="[$t('pleaseSelectTime'), $t('pleaseSelectTime')]"
style="width: 100%"
showTime
value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.planApprovalDate">
v-model="queryParam.uploadTime">
</a-range-picker>
</a-form-item>
</a-col>
@@ -74,7 +88,11 @@
<a-col :md="6" :sm="8">
<div style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchReset" icon="reload" ghost>{{ $t('reset') }}</a-button>
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px" v-has="'split:sarFileSplitInfo:search'">
<a-button type="primary"
@click="searchQuery"
icon="search"
style="margin-left: 8px"
v-has="'profileCenter:table'">
{{ $t('query') }}
</a-button>
</div>
@@ -85,9 +103,11 @@
<div class="table-operator">
<!-- 新增-->
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'profileCenter:table'">{{ $t('newlyAdded') }}</a-button>
<!-- 批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel">{{ $t('batchDelete') }}</a-button>
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'profileCenter:table'">
{{ $t('batchDelete') }}
</a-button>
</div>
<div>
<j-table
@@ -100,7 +120,8 @@
:scroll="{x: '100%'}"
:loading="loading"
:operation-list="operationList"
@change="handleTableChange">
@change="handleTableChange"
@operationClick="operationClick">
</j-table>
</div>
@@ -109,7 +130,7 @@
<!--表格数据新增编辑-->
<profile-center-modal ref="modalForm" @ok="modalFormOk" />
<!--树节点新增编辑-->
<profile-center-tree-modal ref="treeModal" @ok="modalFormOk"/>
<profile-center-tree-modal ref="treeModal" @ok="modalFormOk" />
</a-card>
</template>
@@ -119,6 +140,8 @@ import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
import { deleteProfileCenterTree, getProfileCenterTree } from '../../../api/standardRegulationLibraryApi.js'
import ProfileCenterModal from './modules/ProfileCenterModal.vue'
import ProfileCenterTreeModal from './modules/ProfileCenterTreeModal.vue'
import { filterObj } from '../../../utils/util'
import { downloadFile } from '../../../api/manage'
export default {
name: 'ProfileCenterList',
@@ -132,25 +155,25 @@ export default {
columns: [
// 文件名称
{
dataIndex: 'standardNumber',
dataIndex: 'fileName',
title: this.$t('fileName'),
width: 150
},
// 文件说明
{
dataIndex: 'standardName',
dataIndex: 'fileDescription',
title: this.$t('fileDeclaration'),
width: 150
},
// 上传人
{
dataIndex: 'fileType',
dataIndex: 'uploader',
title: this.$t('uploadedBy'),
width: 150
},
// 上传时间
{
dataIndex: 'fileName',
dataIndex: 'createTime',
title: this.$t('uploadTime'),
width: 150
},
@@ -167,30 +190,33 @@ export default {
{
text: this.$t('download'),
clickEvent: 'handleDownload',
has: ''
has: 'profileCenter:table'
},
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: ''
has: 'profileCenter:table'
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: ''
has: 'profileCenter:table'
}
],
url: {
list: '',
delete: '',
deleteBatch: ''
list: '/laws/dataCenter/lawsDataCenterFile/page',
delete: '/laws/dataCenter/lawsDataCenterFile/delete',
deleteBatch: '/laws/dataCenter/lawsDataCenterFile/deleteBatch'
},
selectedTreeKeys: [], // 选中的树节点key
treeLoading: false
}
},
created () {
this.initTreeData()
},
methods: {
/**
* 获取树数据
@@ -198,10 +224,10 @@ export default {
initTreeData () {
this.treeLoading = true
const params = {
nodeName: this.treeInput
folderName: this.treeInput
}
if (!params.nodeName) {
delete params.nodeName
if (!params.folderName) {
delete params.folderName
}
getProfileCenterTree(params).then(res => {
this.treeData = []
@@ -256,11 +282,19 @@ export default {
this.onClearSelected()
},
/**
* 新增节点
* 新增同级节点
* @param dataRef
*/
handleAddTreeNode ({ dataRef }) {
this.$refs.treeModal.add({ parentId: dataRef.id, parentCode: dataRef.nodeCode })
handleAddPeerFolder ({ dataRef }) {
console.log(dataRef)
this.$refs.treeModal.add({ parentId: dataRef.parentId }, true)
},
/**
* 新增子节点
* @param dataRef
*/
handleAddChildrenFolder ({ dataRef }) {
this.$refs.treeModal.add({ parentId: dataRef.id }, false)
},
/**
* 编辑树节点
@@ -296,6 +330,27 @@ export default {
this.queryParam = {}
this.selectedTreeKeys = []
this.loadData(1)
},
getQueryParams () {
// 获取查询条件
const sqp = {}
if (this.superQueryParams) {
sqp.superQueryParams = encodeURI(this.superQueryParams)
sqp.superQueryMatchType = this.superQueryMatchType
}
const param = Object.assign(sqp, this.queryParam, this.isorter, this.filters)
param.field = this.getQueryField()
param.pageNo = this.ipagination.current
param.pageSize = this.ipagination.pageSize
Object.keys(param).forEach(val => {
if (param[val] instanceof Array) {
param[val] = param[val].join(',')
}
})
return filterObj(param)
},
handleDownload ({ id, fileName }) {
downloadFile(`/laws/dataCenter/lawsDataCenterFile/download?id=${id}`, fileName)
}
}
}