档案管理

This commit is contained in:
cwchen 2025-09-16 17:59:53 +08:00
parent fab9b91529
commit 5f7e2ad5dd
7 changed files with 37 additions and 32 deletions

View File

@ -16,7 +16,7 @@ export function getFileManageTreeApi(params) {
return request({ return request({
url: '/smartArchives/fileManage/getFileManageTree', url: '/smartArchives/fileManage/getFileManageTree',
method: 'get', method: 'get',
params, params:params,
}) })
} }
@ -75,9 +75,9 @@ export function getArchivalCatalogueByIdApi(params) {
} }
// 列表 // 列表
export function getArchivalCatalogueListApi(params) { export function getFileManageApi(params) {
return request({ return request({
url: '/smartArchives/fileManage/getArchivalCatalogue', url: '/smartArchives/fileManage/getFileManage',
method: 'get', method: 'get',
params params
}) })

View File

@ -5,7 +5,7 @@ export function getArchivalCatalogueTreeApi(params) {
return request({ return request({
url: '/smartArchives/archive/getArchivalCatalogueTree', url: '/smartArchives/archive/getArchivalCatalogueTree',
method: 'get', method: 'get',
params, params:params,
}) })
} }
@ -59,7 +59,7 @@ export function getArchivalCatalogueByIdApi(params) {
return request({ return request({
url: '/smartArchives/archive/getArchivalCatalogueById', url: '/smartArchives/archive/getArchivalCatalogueById',
method: 'get', method: 'get',
params params:params
}) })
} }
@ -68,7 +68,7 @@ export function getArchivalCatalogueListApi(params) {
return request({ return request({
url: '/smartArchives/archive/getArchivalCatalogue', url: '/smartArchives/archive/getArchivalCatalogue',
method: 'get', method: 'get',
params params:params
}) })
} }
@ -77,6 +77,6 @@ export function geMaxSortApi(params) {
return request({ return request({
url: '/smartArchives/archive/geMaxSort', url: '/smartArchives/archive/geMaxSort',
method: 'get', method: 'get',
params params:params
}) })
} }

View File

@ -159,7 +159,8 @@ export default {
/** 初始化表单数据 */ /** 初始化表单数据 */
async initFormData() { async initFormData() {
let value = 0; 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) { if (this.isAdd === 'edit' && this.rowData) {
// //
this.form = { this.form = {
@ -170,7 +171,6 @@ export default {
level:this.rowData.level level:this.rowData.level
}; };
value = this.rowData.parentId; value = this.rowData.parentId;
treeId = this.rowData.id;
} else { } else {
// //
this.form = { this.form = {
@ -181,7 +181,7 @@ export default {
}; };
value = this.rowData.id; value = this.rowData.id;
} }
await this.getLeftTreeList(treeId);
// ID // ID
if (this.isAdd === 'edit' && this.form.parentId) { if (this.isAdd === 'edit' && this.form.parentId) {

View File

@ -159,7 +159,8 @@ export default {
/** 初始化表单数据 */ /** 初始化表单数据 */
async initFormData() { async initFormData() {
let value = 0; 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) { if (this.isAdd === 'edit' && this.rowData) {
// //
this.form = { this.form = {
@ -170,7 +171,6 @@ export default {
level:this.rowData.level level:this.rowData.level
}; };
value = this.rowData.parentId; value = this.rowData.parentId;
treeId = this.rowData.id;
} else { } else {
// //
this.form = { this.form = {
@ -181,7 +181,6 @@ export default {
}; };
value = this.rowData.id; value = this.rowData.id;
} }
await this.getLeftTreeList(treeId);
// ID // ID
if (this.isAdd === 'edit' && this.form.parentId) { if (this.isAdd === 'edit' && this.form.parentId) {

View File

@ -31,15 +31,15 @@
<span class="node-label">{{ node.label }}</span> <span class="node-label">{{ node.label }}</span>
</template> </template>
<span class="btn-box"> <span class="btn-box">
<el-button type="text" icon="el-icon-plus" v-if="node.level !== 4" <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="['archive:catalogue:add']"> @click.stop="() => addTree(data)" v-hasPermi="['file:manage:add']">
</el-button> </el-button>
<el-button type="text" v-if="node.level > 1" icon="el-icon-edit-outline" <el-button type="text" v-if="data.level > 1 && Number(data.isUnique) === 1" icon="el-icon-edit-outline"
style="color: #007ce0" @click.stop="() => editTree(node, data)" style="color: #007ce0" @click.stop="() => editTree(data, data)"
v-hasPermi="['archive:catalogue:edit']"> v-hasPermi="['file:manage:update']">
</el-button> </el-button>
<el-button type="text" v-if="node.level > 1" icon="el-icon-delete" style="color: #f00000;" <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="['archive:catalogue:del']"> @click.stop="() => delTree(node, data)" v-hasPermi="['file:manage:del']">
</el-button> </el-button>
</span> </span>
</span> </span>
@ -59,12 +59,7 @@ import AddTreeData from './addTreeData.vue'
export default { export default {
name: 'FileLeftTree', name: 'FileLeftTree',
components: { AddTreeData }, components: { AddTreeData },
props: { props: ["projectId"],
projectId: {
type: [String, Number],
default: 0
}
},
data() { data() {
return { return {
treeDataList: [], treeDataList: [],
@ -164,13 +159,16 @@ export default {
} }
return data.map(item => { return data.map(item => {
console.log(item);
const node = { const node = {
id: item.id, id: item.id,
label: item.contentName, label: item.contentName,
level: item.level, level: item.level,
sort: item.sort, sort: item.sort,
parentId: item.parentId, parentId: item.parentId,
parentName: item.parentName parentName: item.parentName,
isUnique:item.isUnique
}; };
// //
@ -200,9 +198,11 @@ export default {
}, },
// //
async getLeftTreeList() { async getLeftTreeList() {
const res = await getFileManageTreeApi() const res = await getFileManageTreeApi({proId:this.projectId})
const transformedData = this.convertToVueTree(res.data) const transformedData = this.convertToVueTree(res.data)
this.treeDataList = transformedData; this.treeDataList = transformedData;
console.log(this.treeDataList);
// //
this.originalTreeData = JSON.parse(JSON.stringify(this.treeDataList)) this.originalTreeData = JSON.parse(JSON.stringify(this.treeDataList))
}, },

View File

@ -3,7 +3,7 @@
<div> <div>
<el-card style="min-height: calc(100vh - 190px);"> <el-card style="min-height: calc(100vh - 190px);">
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="tableRef" <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"> <template slot="btn">
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['archive:catalogue:add']" <el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['archive:catalogue:add']"
@click="handleAdd" :disabled="addBtnIsShow"> @click="handleAdd" :disabled="addBtnIsShow">
@ -38,7 +38,7 @@ import TableModel from '@/components/TableModel'
import { columnsList, formLabel } from './config' import { columnsList, formLabel } from './config'
import { import {
delArchiveApi, delArchiveApi,
getArchivalCatalogueListApi, getFileManageApi,
} from '@/api/archivesManagement/fileManager/fileManager.js' } from '@/api/archivesManagement/fileManager/fileManager.js'
import AddTableData from './addTableData' import AddTableData from './addTableData'
@ -59,7 +59,7 @@ export default {
return { return {
formLabel, formLabel,
columnsList, columnsList,
getArchivalCatalogueListApi, getFileManageApi,
title: "", title: "",
isflag: false, isflag: false,
isAdd: '', isAdd: '',

View File

@ -12,8 +12,14 @@
</el-tag> </el-tag>
</template> </template>
<template slot="handle" slot-scope="{ data }"> <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']" <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> </el-button>
</template> </template>