档案目录管理
This commit is contained in:
parent
e4768977e5
commit
6588115a52
|
|
@ -141,6 +141,7 @@ export default {
|
|||
this.$refs.ruleForm.clearValidate(['contentName', 'sort']);
|
||||
}
|
||||
});
|
||||
this.form.level = selectedNode.level;
|
||||
this.getMaxSort(selectedNode.id);
|
||||
},
|
||||
/** 查找父节点层级 */
|
||||
|
|
@ -186,7 +187,9 @@ export default {
|
|||
this.findParentLevel(this.treeDataList, this.form.parentId);
|
||||
}
|
||||
|
||||
await this.getMaxSort(value);
|
||||
if(value){
|
||||
await this.getMaxSort(value);
|
||||
}
|
||||
},
|
||||
// 树数据过滤 - 支持无限层级转换,去除层级为3的数据
|
||||
convertToVueTree(data) {
|
||||
|
|
@ -270,6 +273,7 @@ export default {
|
|||
target: this.$el.querySelector('.el-dialog') || document.body
|
||||
})
|
||||
let params = _.cloneDeep(this.form);
|
||||
|
||||
if (this.isAdd === 'add') {
|
||||
addArchiveLeftApi(params).then(res => {
|
||||
this.loading.close();
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getArchivalCatalogueTreeApi } from '@/api/archivesManagement/index.js'
|
||||
import { getArchivalCatalogueTreeApi,delArchiveApi } from '@/api/archivesManagement/index.js'
|
||||
import AddTreeData from './addTreeData.vue'
|
||||
export default {
|
||||
name: 'LeftTree',
|
||||
|
|
@ -67,6 +67,7 @@ export default {
|
|||
isAdd: '',
|
||||
row: {},
|
||||
selectedNodeId: null, // 保存当前选中的节点ID
|
||||
delArchiveApi
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -120,6 +121,29 @@ export default {
|
|||
this.row = data;
|
||||
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) {
|
||||
// 保存选中的节点ID
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ export default {
|
|||
this.title = "修改";
|
||||
this.isAdd = 'edit';
|
||||
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.isflag = true;
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue