From 1818eb00ee5449c7acdb9d3db99bbbe89090cfcb Mon Sep 17 00:00:00 2001 From: Yuanjianghong Date: Tue, 30 Nov 2021 16:16:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E5=9C=B0=E5=9D=80=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=80=BC=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/util.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/utils/util.js b/src/utils/util.js index eaf6311..a7bcb72 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -100,7 +100,7 @@ export function dictToTree(list, tree, parentId) { if (child.children.length <= 0) { delete child.children - }else{ + } else { child.selectable = false; } @@ -110,18 +110,7 @@ export function dictToTree(list, tree, parentId) { return tree } -//列表转🌲 -// export function list2Tree(list, parentId) { -// let obj = [] -// list.forEach(item => { -// item.children = [] -// obj[item.id] = item -// }) -// return list.filter(item => { -// if (item.parentId !== parentId) { -// obj[item.parentId].children.push(item) -// return false -// } -// return true -// }) -// } +//拿地址路径中的参数,不能用$route取的就用这个取 +export function getUrlKey(name) { + return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null +}