From cc844b6b7c6a012ac41237c58cb598886694c6a6 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期一, 25 四月 2022 10:28:40 +0800 Subject: [PATCH] 修改树形选择器组件 --- src/views/system/menu/index.vue | 38 ++++++++++++++++++++------------------ 1 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index c221f4e..6ead733 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -103,11 +103,13 @@ <el-row> <el-col :span="24"> <el-form-item label="涓婄骇鑿滃崟"> - <tree-select - v-model:value="form.parentId" - :options="menuOptions" - :objMap="{ value: 'menuId', label: 'menuName', children: 'children' }" + <el-tree-select + v-model="form.parentId" + :data="menuOptions" + :props="{ value: 'menuId', label: 'menuName', children: 'children' }" + value-key="menuId" placeholder="閫夋嫨涓婄骇鑿滃崟" + check-strictly /> </el-form-item> </el-col> @@ -161,7 +163,7 @@ <template #label> <span> <el-tooltip content="閫夋嫨鏄閾惧垯璺敱鍦板潃闇�瑕佷互`http(s)://`寮�澶�" placement="top"> - <i class="el-icon-question"></i> + <el-icon><question-filled /></el-icon> </el-tooltip>鏄惁澶栭摼 </span> </template> @@ -176,7 +178,7 @@ <template #label> <span> <el-tooltip content="璁块棶鐨勮矾鐢卞湴鍧�锛屽锛歚user`锛屽澶栫綉鍦板潃闇�鍐呴摼璁块棶鍒欎互`http(s)://`寮�澶�" placement="top"> - <i class="el-icon-question"></i> + <el-icon><question-filled /></el-icon> </el-tooltip> 璺敱鍦板潃 </span> @@ -189,7 +191,7 @@ <template #label> <span> <el-tooltip content="璁块棶鐨勭粍浠惰矾寰勶紝濡傦細`system/user/index`锛岄粯璁ゅ湪`views`鐩綍涓�" placement="top"> - <i class="el-icon-question"></i> + <el-icon><question-filled /></el-icon> </el-tooltip> 缁勪欢璺緞 </span> @@ -203,7 +205,7 @@ <template #label> <span> <el-tooltip content="鎺у埗鍣ㄤ腑瀹氫箟鐨勬潈闄愬瓧绗︼紝濡傦細@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top"> - <i class="el-icon-question"></i> + <el-icon><question-filled /></el-icon> </el-tooltip> 鏉冮檺瀛楃 </span> @@ -216,7 +218,7 @@ <template #label> <span> <el-tooltip content='璁块棶璺敱鐨勯粯璁や紶閫掑弬鏁帮紝濡傦細`{"id": 1, "name": "ry"}`' placement="top"> - <i class="el-icon-question"></i> + <el-icon><question-filled /></el-icon> </el-tooltip> 璺敱鍙傛暟 </span> @@ -228,7 +230,7 @@ <template #label> <span> <el-tooltip content="閫夋嫨鏄垯浼氳`keep-alive`缂撳瓨锛岄渶瑕佸尮閰嶇粍浠剁殑`name`鍜屽湴鍧�淇濇寔涓�鑷�" placement="top"> - <i class="el-icon-question"></i> + <el-icon><question-filled /></el-icon> </el-tooltip> 鏄惁缂撳瓨 </span> @@ -244,7 +246,7 @@ <template #label> <span> <el-tooltip content="閫夋嫨闅愯棌鍒欒矾鐢卞皢涓嶄細鍑虹幇鍦ㄤ晶杈规爮锛屼絾浠嶇劧鍙互璁块棶" placement="top"> - <i class="el-icon-question"></i> + <el-icon><question-filled /></el-icon> </el-tooltip> 鏄剧ず鐘舵�� </span> @@ -263,7 +265,7 @@ <template #label> <span> <el-tooltip content="閫夋嫨鍋滅敤鍒欒矾鐢卞皢涓嶄細鍑虹幇鍦ㄤ晶杈规爮锛屼篃涓嶈兘琚闂�" placement="top"> - <i class="el-icon-question"></i> + <el-icon><question-filled /></el-icon> </el-tooltip> 鑿滃崟鐘舵�� </span> @@ -332,9 +334,9 @@ }); } /** 鏌ヨ鑿滃崟涓嬫媺鏍戠粨鏋� */ -async function getTreeselect() { +function getTreeselect() { menuOptions.value = []; - await listMenu().then(response => { + listMenu().then(response => { const menu = { menuId: 0, menuName: "涓荤被鐩�", children: [] }; menu.children = proxy.handleTree(response.data, "menuId"); menuOptions.value.push(menu); @@ -373,8 +375,8 @@ } /** 鍏抽棴寮圭獥闅愯棌鍥炬爣閫夋嫨 */ function handleClose() { - cancel(); - showChooseIcon.value = false; + cancel(); + showChooseIcon.value = false; } /** 鎼滅储鎸夐挳鎿嶄綔 */ function handleQuery() { @@ -386,9 +388,9 @@ handleQuery(); } /** 鏂板鎸夐挳鎿嶄綔 */ -async function handleAdd(row) { +function handleAdd(row) { reset(); - await getTreeselect(); + getTreeselect(); if (row != null && row.menuId) { form.value.parentId = row.menuId; } else { -- Gitblit v1.9.3