From d13301f62c028d8632b92d0c97a3c24b62f53b52 Mon Sep 17 00:00:00 2001 From: fanxb Date: Fri, 19 Jul 2019 17:31:05 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Perf:=20[=E5=89=8D=E5=8F=B0]:?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=93=BE=E6=8E=A5=E6=A0=87=E7=AD=BE=E4=B8=BA?= =?UTF-8?q?a,=E5=8E=BB=E9=99=A4=E6=96=87=E5=AD=97=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/pages/manage/OverView/function.js | 20 +++++++++++-------- .../pages/manage/OverView/index.module.less | 17 ++++++++++++++-- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/front/src/pages/manage/OverView/function.js b/front/src/pages/manage/OverView/function.js index 3099092..4400391 100644 --- a/front/src/pages/manage/OverView/function.js +++ b/front/src/pages/manage/OverView/function.js @@ -1,6 +1,6 @@ import httpUtil from "../../../util/httpUtil"; import React from "react"; -import { Modal, Button, Tooltip, Tree, message } from "antd"; +import { Modal, Button, Tree, message } from "antd"; import styles from "./index.module.less"; import IconFont from "../../../components/IconFont"; const { TreeNode } = Tree; @@ -32,12 +32,16 @@ export function renderNodeContent(item) { ); return ( - - - {item.name} - + + {item.type === 0 ? ( + + {item.name} + + ) : ( + {item.name} + )} {isEdit ? btns : null} - + ); } @@ -203,8 +207,8 @@ export function onDrop(info) { } httpUtil.post("/bookmark/moveNode", body).then(res => { message.success("移动完成"); + updateTreeData([...treeData]); }); - updateTreeData({ treeData: [...treeData] }); } /** @@ -242,7 +246,7 @@ function insertToArray(item, index, arr) { } /** - * 更新节点的path信息 + * 更新修改节点的子节点节点path信息 * @param {*} children 孩子数组 * @param {*} oldPath 旧path * @param {*} newPath 新path diff --git a/front/src/pages/manage/OverView/index.module.less b/front/src/pages/manage/OverView/index.module.less index ddcf867..344b9a9 100644 --- a/front/src/pages/manage/OverView/index.module.less +++ b/front/src/pages/manage/OverView/index.module.less @@ -18,12 +18,25 @@ } } - .title { + .nodeContent { display: inline-block; - max-width: 70%; + align-items: center; margin-right: 1em; overflow-x: hidden; text-overflow: ellipsis; + + .url { + display: inline-block; + min-width: 3em; + } + } + + :global { + .ant-tree-title { + display: inline-flex; + align-items: center; + width: 100%; + } } .btns {