档案管理
This commit is contained in:
parent
fab9b91529
commit
5f7e2ad5dd
|
|
@ -16,7 +16,7 @@ export function getFileManageTreeApi(params) {
|
|||
return request({
|
||||
url: '/smartArchives/fileManage/getFileManageTree',
|
||||
method: 'get',
|
||||
params,
|
||||
params:params,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -75,9 +75,9 @@ export function getArchivalCatalogueByIdApi(params) {
|
|||
}
|
||||
|
||||
// 列表
|
||||
export function getArchivalCatalogueListApi(params) {
|
||||
export function getFileManageApi(params) {
|
||||
return request({
|
||||
url: '/smartArchives/fileManage/getArchivalCatalogue',
|
||||
url: '/smartArchives/fileManage/getFileManage',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export function getArchivalCatalogueTreeApi(params) {
|
|||
return request({
|
||||
url: '/smartArchives/archive/getArchivalCatalogueTree',
|
||||
method: 'get',
|
||||
params,
|
||||
params:params,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ export function getArchivalCatalogueByIdApi(params) {
|
|||
return request({
|
||||
url: '/smartArchives/archive/getArchivalCatalogueById',
|
||||
method: 'get',
|
||||
params
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ export function getArchivalCatalogueListApi(params) {
|
|||
return request({
|
||||
url: '/smartArchives/archive/getArchivalCatalogue',
|
||||
method: 'get',
|
||||
params
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -77,6 +77,6 @@ export function geMaxSortApi(params) {
|
|||
return request({
|
||||
url: '/smartArchives/archive/geMaxSort',
|
||||
method: 'get',
|
||||
params
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
|
@ -159,7 +159,8 @@ export default {
|
|||
/** 初始化表单数据 */
|
||||
async initFormData() {
|
||||
let value = 0;
|
||||
let treeId = null;
|
||||
let treeId = this.isAdd === 'edit' && this.rowData ? this.rowData.id : null;
|
||||
await this.getLeftTreeList(treeId);
|
||||
if (this.isAdd === 'edit' && this.rowData) {
|
||||
// 编辑模式:填充表单数据
|
||||
this.form = {
|
||||
|
|
@ -170,7 +171,6 @@ export default {
|
|||
level:this.rowData.level
|
||||
};
|
||||
value = this.rowData.parentId;
|
||||
treeId = this.rowData.id;
|
||||
} else {
|
||||
// 新增模式:重置表单
|
||||
this.form = {
|
||||
|
|
@ -181,7 +181,7 @@ export default {
|
|||
};
|
||||
value = this.rowData.id;
|
||||
}
|
||||
await this.getLeftTreeList(treeId);
|
||||
|
||||
|
||||
// 如果是编辑模式,需要根据父节点ID找到对应的层级
|
||||
if (this.isAdd === 'edit' && this.form.parentId) {
|
||||
|
|
|
|||
|
|
@ -159,7 +159,8 @@ export default {
|
|||
/** 初始化表单数据 */
|
||||
async initFormData() {
|
||||
let value = 0;
|
||||
let treeId = null;
|
||||
let treeId = this.isAdd === 'edit' && this.rowData ? this.rowData.id : null;
|
||||
await this.getLeftTreeList(treeId);
|
||||
if (this.isAdd === 'edit' && this.rowData) {
|
||||
// 编辑模式:填充表单数据
|
||||
this.form = {
|
||||
|
|
@ -170,7 +171,6 @@ export default {
|
|||
level:this.rowData.level
|
||||
};
|
||||
value = this.rowData.parentId;
|
||||
treeId = this.rowData.id;
|
||||
} else {
|
||||
// 新增模式:重置表单
|
||||
this.form = {
|
||||
|
|
@ -181,7 +181,6 @@ export default {
|
|||
};
|
||||
value = this.rowData.id;
|
||||
}
|
||||
await this.getLeftTreeList(treeId);
|
||||
|
||||
// 如果是编辑模式,需要根据父节点ID找到对应的层级
|
||||
if (this.isAdd === 'edit' && this.form.parentId) {
|
||||
|
|
|
|||
|
|
@ -31,15 +31,15 @@
|
|||
<span class="node-label">{{ node.label }}</span>
|
||||
</template>
|
||||
<span class="btn-box">
|
||||
<el-button type="text" icon="el-icon-plus" v-if="node.level !== 4"
|
||||
@click.stop="() => addTree(data)" v-hasPermi="['archive:catalogue:add']">
|
||||
<el-button type="text" icon="el-icon-plus" v-if="(data.level > 1 && Number(data.isUnique) === 1) || (data.level === 1 && Number(data.isUnique) === 0)"
|
||||
@click.stop="() => addTree(data)" v-hasPermi="['file:manage:add']">
|
||||
</el-button>
|
||||
<el-button type="text" v-if="node.level > 1" icon="el-icon-edit-outline"
|
||||
style="color: #007ce0" @click.stop="() => editTree(node, data)"
|
||||
v-hasPermi="['archive:catalogue:edit']">
|
||||
<el-button type="text" v-if="data.level > 1 && Number(data.isUnique) === 1" icon="el-icon-edit-outline"
|
||||
style="color: #007ce0" @click.stop="() => editTree(data, data)"
|
||||
v-hasPermi="['file:manage:update']">
|
||||
</el-button>
|
||||
<el-button type="text" v-if="node.level > 1" icon="el-icon-delete" style="color: #f00000;"
|
||||
@click.stop="() => delTree(node, data)" v-hasPermi="['archive:catalogue:del']">
|
||||
<el-button type="text" v-if="data.level > 1 && Number(data.isUnique) === 1" icon="el-icon-delete" style="color: #f00000;"
|
||||
@click.stop="() => delTree(node, data)" v-hasPermi="['file:manage:del']">
|
||||
</el-button>
|
||||
</span>
|
||||
</span>
|
||||
|
|
@ -59,12 +59,7 @@ import AddTreeData from './addTreeData.vue'
|
|||
export default {
|
||||
name: 'FileLeftTree',
|
||||
components: { AddTreeData },
|
||||
props: {
|
||||
projectId: {
|
||||
type: [String, Number],
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
props: ["projectId"],
|
||||
data() {
|
||||
return {
|
||||
treeDataList: [],
|
||||
|
|
@ -164,13 +159,16 @@ export default {
|
|||
}
|
||||
|
||||
return data.map(item => {
|
||||
console.log(item);
|
||||
|
||||
const node = {
|
||||
id: item.id,
|
||||
label: item.contentName,
|
||||
level: item.level,
|
||||
sort: item.sort,
|
||||
parentId: item.parentId,
|
||||
parentName: item.parentName
|
||||
parentName: item.parentName,
|
||||
isUnique:item.isUnique
|
||||
};
|
||||
|
||||
// 递归处理子节点
|
||||
|
|
@ -200,9 +198,11 @@ export default {
|
|||
},
|
||||
// 获取左侧树列表
|
||||
async getLeftTreeList() {
|
||||
const res = await getFileManageTreeApi()
|
||||
const res = await getFileManageTreeApi({proId:this.projectId})
|
||||
const transformedData = this.convertToVueTree(res.data)
|
||||
this.treeDataList = transformedData;
|
||||
console.log(this.treeDataList);
|
||||
|
||||
// 保存原始数据
|
||||
this.originalTreeData = JSON.parse(JSON.stringify(this.treeDataList))
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div>
|
||||
<el-card style="min-height: calc(100vh - 190px);">
|
||||
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="tableRef"
|
||||
:columnsList="columnsList" :request-api="getArchivalCatalogueListApi" :send-params="defaultParams">
|
||||
:columnsList="columnsList" :request-api="getFileManageApi" :send-params="defaultParams">
|
||||
<template slot="btn">
|
||||
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['archive:catalogue:add']"
|
||||
@click="handleAdd" :disabled="addBtnIsShow">
|
||||
|
|
@ -38,7 +38,7 @@ import TableModel from '@/components/TableModel'
|
|||
import { columnsList, formLabel } from './config'
|
||||
import {
|
||||
delArchiveApi,
|
||||
getArchivalCatalogueListApi,
|
||||
getFileManageApi,
|
||||
} from '@/api/archivesManagement/fileManager/fileManager.js'
|
||||
import AddTableData from './addTableData'
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ export default {
|
|||
return {
|
||||
formLabel,
|
||||
columnsList,
|
||||
getArchivalCatalogueListApi,
|
||||
getFileManageApi,
|
||||
title: "",
|
||||
isflag: false,
|
||||
isAdd: '',
|
||||
|
|
|
|||
|
|
@ -12,8 +12,14 @@
|
|||
</el-tag>
|
||||
</template>
|
||||
<template slot="handle" slot-scope="{ data }">
|
||||
<el-tag v-if="!data.contentsName"
|
||||
size="mini"
|
||||
type="danger"
|
||||
>
|
||||
未配置档案类型
|
||||
</el-tag>
|
||||
<el-button plain size="mini" type="primary" icon="el-icon-document" v-hasPermi="['file:manage:set']"
|
||||
@click="openFileManager(data)">
|
||||
@click="openFileManager(data)" v-if="data.contentsName">
|
||||
档案管理
|
||||
</el-button>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue