add 资料中心

This commit is contained in:
赵霄
2023-09-26 17:58:58 +08:00
parent 6e8362a6c5
commit 488bb40845
4 changed files with 316 additions and 1 deletions
+6
View File
@@ -16,6 +16,12 @@ let importModalLoading
export const JeroListMixin = {
data () {
return {
labelCol: {
span: 4
},
wrapperCol: {
span: 14
},
/* 查询条件-请不要在queryParam中声明非字符串值的属性 */
queryParam: {},
/* 数据源 */
@@ -2,7 +2,6 @@
<a-card :bordered="false" class="page-left-right-layout">
<!-- 树部分-->
<div class="page-left-box">
<!-- $t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')-->
<a-input-search v-model="treeInput" class="tree-search"
:placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
@search="handleTreeSearch" />
@@ -378,6 +377,8 @@ export default {
})
},
modalFormOk () {
this.selectedTreeKeys = []
this.filters.nodeCode = null
this.initTreeData()
// 新增/修改 成功时,重载列表
this.loadData()
@@ -378,6 +378,8 @@ export default {
})
},
modalFormOk () {
this.selectedTreeKeys = []
this.filters.nodeCode = null
this.initTreeData()
// 新增/修改 成功时,重载列表
this.loadData()
@@ -0,0 +1,306 @@
<template>
<a-card :bordered="false" class="page-left-right-layout">
<!-- 树部分-->
<div class="page-left-box">
<a-input-search v-model="treeInput" class="tree-search"
:placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
@search="handleTreeSearch" />
<div class="page-tree-box page-tree-box-has-search">
<a-spin :spinning="treeLoading">
<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)"
@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 }}
</template>
<span class="tree-node-custom-title">{{ record.title }}</span>
</a-tooltip>
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.key !== mouseInNodeKey}">
<!-- 新增-->
<a-button icon="plus"
class="tree-operate-node-btn"
@click.stop="handleAddTreeNode(record)"
v-if="record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
v-has="'domesticStandard:tree:add'"></a-button>
<!-- 编辑根节点不能编辑-->
<a-button class="tree-operate-node-btn"
@click.stop="handleEditTreeNode(record)"
v-has="'domesticStandard:tree:edit'"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value">
<i class="iconfont icon-bianji" />
</a-button>
<!-- 删除根节点不能删除-->
<a-button class="tree-operate-node-btn"
v-has="'domesticStandard:tree:delete'"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
@click.stop="handleDelTreeNode(record)">
<i class="iconfont icon-shanchu_" />
</a-button>
</div>
</div>
</template>
</a-tree>
</a-spin>
</div>
</div>
<!-- 表格部分-->
<div class="page-right-box">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<!--文件名称-->
<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>
</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-form-item>
</a-col>
<!--上传时间-->
<a-col :md="6" :sm="12">
<a-form-item :label="$t('enterpriseStandardLibrary.plan.planApprovalDate')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.planApprovalDate">
</a-range-picker>
</a-form-item>
</a-col>
<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'">
{{ $t('query') }}
</a-button>
</div>
</a-col>
</a-row>
</a-form>
</div>
<div class="table-operator">
<!-- 新增-->
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
<!-- 批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel">{{ $t('batchDelete') }}</a-button>
</div>
<div>
<j-table
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:scroll="{x: '100%'}"
:loading="loading"
:operation-list="operationList"
@change="handleTableChange">
</j-table>
</div>
</div>
</a-card>
</template>
<script>
import JTable from '../../../components/jero/JTable.vue'
import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
import { deleteDomesticSystemTree } from '../../../api/standardRegulationLibraryApi.js'
export default {
name: 'ProfileCenterList',
components: { JTable },
mixins: [JeroListMixin],
data () {
return {
treeInput: null, // 树查询绑定值
treeData: [],
mouseInNodeKey: null, // 鼠标悬浮的节点key值
columns: [
// 文件名称
{
dataIndex: 'standardNumber',
title: this.$t('fileName'),
width: 150
},
// 文件说明
{
dataIndex: 'standardName',
title: this.$t('fileDeclaration'),
width: 150
},
// 上传人
{
dataIndex: 'fileType',
title: this.$t('uploadedBy'),
width: 150
},
// 上传时间
{
dataIndex: 'fileName',
title: this.$t('uploadTime'),
width: 150
},
// 操作
{
title: this.$t('operation'),
fixed: 'right',
width: 150,
scopedSlots: { customRender: 'action' }
}
],
operationList: [
// 下载
{
text: this.$t('download'),
clickEvent: 'handleDownload',
has: ''
},
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: ''
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: ''
}
],
url: {
list: '',
delete: '',
deleteBatch: ''
},
selectedTreeKeys: [], // 选中的树节点key
treeLoading: false
}
},
methods: {
/**
* 获取树数据
*/
initTreeData () {
this.treeLoading = true
const params = {
nodeName: this.treeInput
}
if (!params.nodeName) {
delete params.nodeName
}
// (params).then(res => {
// this.treeData = []
// this.selectedTreeKeys = []
// this.selectedTreeNodeCodes = []
// this.filters.nodeCode = null
// if (res.success) {
// this.treeData = res.result || []
// } else {
// this.$message.warn(res.message)
// }
// }).finally(() => {
// this.treeLoading = false
// })
},
/**
* 树节点查询
*/
handleTreeSearch () {
this.initTreeData()
},
/**
* 树节点鼠标移入
* @param key
*/
handleTreeMouseover (key) {
this.mouseInNodeKey = key
},
/**
* 树节点鼠标移出
* @param key
*/
handleTreeMouseout (key) {
if (this.mouseInNodeKey === key) {
this.mouseInNodeKey = null
}
},
/**
* 选中树节点
* @param dataRef
*/
handleSelectTreeNode ({ dataRef }) {
this.selectedTreeKeys = [dataRef.key]
this.loadData(1)
},
modalFormOk () {
this.selectedTreeKeys = []
this.initTreeData()
// 新增/修改 成功时,重载列表
this.loadData()
// 清空列表选中
this.onClearSelected()
},
/**
* 新增树节点
* @param dataRef
*/
handleAddTreeNode ({ dataRef }) {
this.$refs.treeModal.add({ parentId: dataRef.id, parentCode: dataRef.nodeCode })
},
/**
* 编辑树节点
* @param dataRef
*/
handleEditTreeNode ({ dataRef }) {
this.$refs.treeModal.edit(dataRef)
},
/**
* 删除树节点
* @param dataRef
*/
handleDelTreeNode ({ dataRef }) {
this.$confirm({
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
deleteDomesticSystemTree({ id: dataRef.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warning(res.message)
}
})
}
})
},
/**
* 重置查询
*/
searchReset () {
this.queryParam = {}
this.selectedTreeKeys = []
this.loadData(1)
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>