fix issues #I7657W

This commit is contained in:
LiuHao 2023-05-19 01:32:24 +08:00
parent 9b6cd8b047
commit 6de98250cc
2 changed files with 6 additions and 3 deletions

View File

@ -247,13 +247,13 @@ const handleUpdate = (row: TreeVO) => {
/** 提交按钮 */
const submitForm = () => {
treeFormRef.value.validate((valid: boolean) => {
treeFormRef.value.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
updateTree(form.value).finally(() => buttonLoading.value = false);
await updateTree(form.value).finally(() => buttonLoading.value = false);
} else {
addTree(form.value).finally(() => buttonLoading.value = false);
await addTree(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;

View File

@ -8,6 +8,7 @@
<el-tree
class="mt-2"
ref="deptTreeRef"
node-key="id"
:data="deptOptions"
:props="{ label: 'label', children: 'children' }"
:expand-on-click-node="false"
@ -442,6 +443,8 @@ const resetQuery = () => {
dateRange.value = ['','']
queryFormRef.value.resetFields();
queryParams.value.pageNum = 1;
queryParams.value.deptId = undefined;
deptTreeRef.value.setCurrentKey(null);
handleQuery();
}