档案目录管理

This commit is contained in:
cwchen 2025-09-16 09:42:22 +08:00
parent e4768977e5
commit 6588115a52
3 changed files with 31 additions and 3 deletions

View File

@ -141,6 +141,7 @@ export default {
this.$refs.ruleForm.clearValidate(['contentName', 'sort']); this.$refs.ruleForm.clearValidate(['contentName', 'sort']);
} }
}); });
this.form.level = selectedNode.level;
this.getMaxSort(selectedNode.id); this.getMaxSort(selectedNode.id);
}, },
/** 查找父节点层级 */ /** 查找父节点层级 */
@ -186,7 +187,9 @@ export default {
this.findParentLevel(this.treeDataList, this.form.parentId); this.findParentLevel(this.treeDataList, this.form.parentId);
} }
await this.getMaxSort(value); if(value){
await this.getMaxSort(value);
}
}, },
// - 3 // - 3
convertToVueTree(data) { convertToVueTree(data) {
@ -270,6 +273,7 @@ export default {
target: this.$el.querySelector('.el-dialog') || document.body target: this.$el.querySelector('.el-dialog') || document.body
}) })
let params = _.cloneDeep(this.form); let params = _.cloneDeep(this.form);
if (this.isAdd === 'add') { if (this.isAdd === 'add') {
addArchiveLeftApi(params).then(res => { addArchiveLeftApi(params).then(res => {
this.loading.close(); this.loading.close();

View File

@ -53,7 +53,7 @@
</template> </template>
<script> <script>
import { getArchivalCatalogueTreeApi } from '@/api/archivesManagement/index.js' import { getArchivalCatalogueTreeApi,delArchiveApi } from '@/api/archivesManagement/index.js'
import AddTreeData from './addTreeData.vue' import AddTreeData from './addTreeData.vue'
export default { export default {
name: 'LeftTree', name: 'LeftTree',
@ -67,6 +67,7 @@ export default {
isAdd: '', isAdd: '',
row: {}, row: {},
selectedNodeId: null, // ID selectedNodeId: null, // ID
delArchiveApi
} }
}, },
computed: { computed: {
@ -120,6 +121,29 @@ export default {
this.row = data; this.row = data;
this.isflag = true; this.isflag = true;
}, },
/* 删除树节点 */
delTree(row, data){
this.$modal.confirm(`是否确认删除节点名称为"${row.label}"的数据项?`).then(() => {
//
this.$modal.loading("正在删除,请稍候...");
delArchiveApi({ id: data.id }).then(res => {
this.$modal.closeLoading();
if (res.code === 200) {
this.$modal.msgSuccess("删除成功");
this.handleQuery();
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.$modal.closeLoading();
this.$modal.msgError("删除失败,请重试");
console.error('删除失败:', error);
});
}).catch(() => {
//
});
},
// //
onHandleNodeClick(data) { onHandleNodeClick(data) {
// ID // ID

View File

@ -98,7 +98,7 @@ export default {
this.title = "修改"; this.title = "修改";
this.isAdd = 'edit'; this.isAdd = 'edit';
this.row = row; this.row = row;
this.row.belongName = this.selectedNode.label + '/' + this.selectedNode.parentName this.row.belongName = this.selectedNode.parentName + '/' + this.selectedNode.label
this.row.detailStatus = false; this.row.detailStatus = false;
this.isflag = true; this.isflag = true;
}, },