diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue index a871931a..c2fddb98 100644 --- a/src/views/system/tenant/index.vue +++ b/src/views/system/tenant/index.vue @@ -54,6 +54,8 @@ const { t } = useI18n(); /**左侧导航是否可收起 */ let collapsible = ref(true); +const showButtonsKey = ref(null); + /**改变收起状态 */ function changeCollapsible() { collapsible.value = !collapsible.value; @@ -362,7 +364,7 @@ function fnModalOk() { duration: 2, }); modalState.visibleByEdit = false; - // 新增时清空上级部门树重新获取 + modalStateFrom.resetFields(); fnGetList(undefined, 'tree'); //渲染树状 tableState.data = []; //清空表格数据 @@ -477,7 +479,7 @@ function fnModalTypeOk() { duration: 2, }); modalState.visibleByType = false; - // 新增时清空上级部门树重新获取 + fnGetList(from.parentId, 'table'); //渲染表格 modalStateTypeFrom.resetFields(); } else { @@ -528,28 +530,15 @@ function fnTypeRecordDelete( }, }); } +function showButtons(key: any) { + console.log(key); + showButtonsKey.value = key; +} +function hideButtons() { + showButtonsKey.value = null; +} onMounted(() => { - // 获取网元网元列表 - listDept({}).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { - // 渲染左侧树列表 - console.log(res.data); - state.selectedNode = res.data[1]?.tenantId; - //fnSelectNode(res.data[1]?.tenantId); - - res.data.forEach((item: any) => { - if (item.parentId === '0') { - state.tenantTreeData.push({ - childern: undefined, - title: item.tenantName, - key: item.tenantId, - ...item, - }); - } - }); - } - }); Promise.allSettled([ getDict('sys_normal_disable'), getDict('tenancy_type'), @@ -561,6 +550,9 @@ onMounted(() => { dict.sysTenancyType = resArr[1].value; } }); + + // 初始渲染左侧树状数据 + fnGetList(undefined, 'tree'); });