From ef209357c628cbd3ca233930dee5b34274da2abb Mon Sep 17 00:00:00 2001 From: shixiaohua Date: Wed, 21 Feb 2024 13:28:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:css=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ItemTree/index.jsx | 8 ++++---- src/components/ItemTree/index.less | 21 ++++++++------------- src/pages/Note/Hlexical/index.jsx | 5 ++--- src/pages/Note/Hlexical/index.less | 8 ++++++-- src/pages/Note/index.jsx | 2 +- src/pages/Note/index.less | 2 +- src/redux/dirMessage_reducer.js | 3 ++- src/redux/tableBarItem_reducer.js | 1 + src/utils/PathOperate/index.jsx | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/components/ItemTree/index.jsx b/src/components/ItemTree/index.jsx index 145e9ff..280d6b6 100644 --- a/src/components/ItemTree/index.jsx +++ b/src/components/ItemTree/index.jsx @@ -307,16 +307,14 @@ const ItemTree = (prop) => { {setState("")}}>关闭菜单 ] return ( -
{menuItem} -
) } return ( -
+
{getNodeTreeRightClickMenu()} { autoExpandParent={autoExpandParent} showIcon={true} selectedKeys={[useSelector(state => state.tableBarItem.activeKey)]} - defaultExpandedKeys={useSelector(state => state.tableBarItem.expandedKeyList)} + // defaultExpandedKeys={useSelector(state => state.tableBarItem.expandedKeyList)} // treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点(key 在整个树范围内唯一) treeData={defaultValueState} onSelect={onSelect} onRightClick={treeNodeOnRightClick} + // 占据一整行 + blockNode />
); diff --git a/src/components/ItemTree/index.less b/src/components/ItemTree/index.less index ad4aed9..2e6382e 100644 --- a/src/components/ItemTree/index.less +++ b/src/components/ItemTree/index.less @@ -1,30 +1,25 @@ @import '~antd/dist/antd.less'; +.ant-tree{ + overflow: auto scroll; + height: 95.7%; +} .ant-tree-node-content-wrapper { display: inline-block; - width: 200px; white-space: nowrap; - overflow: hidden; +} +.ant-tree-treenode-switcher-close{ + display: inline-block; + white-space: nowrap; text-overflow: ellipsis; } .ant-tree-treenode-switcher-close{ display: inline-block; - width: 200px; white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -.ant-tree-treenode-switcher-close{ - display: inline-block; - width: 200px; - white-space: nowrap; - overflow: hidden; text-overflow: ellipsis; } .ant-tree-treenode-switcher-open{ display: inline-block; - width: 200px; white-space: nowrap; - overflow: hidden; text-overflow: ellipsis; } .ant-tabs{ diff --git a/src/pages/Note/Hlexical/index.jsx b/src/pages/Note/Hlexical/index.jsx index 2882822..83a60bd 100644 --- a/src/pages/Note/Hlexical/index.jsx +++ b/src/pages/Note/Hlexical/index.jsx @@ -73,7 +73,6 @@ function ImportFilePlugin(props) { useEffect(() => { if (props.filePath){ importFile(props.filePath).then(value => { - console.log("value",value,isEmpty(value)) if (isEmpty(value)){ return } @@ -174,10 +173,10 @@ export default function Hlexical(props) { return ( -
+
{/* 富文本插件 */} -
+
} placeholder={} diff --git a/src/pages/Note/Hlexical/index.less b/src/pages/Note/Hlexical/index.less index 675e83a..40b0c6f 100644 --- a/src/pages/Note/Hlexical/index.less +++ b/src/pages/Note/Hlexical/index.less @@ -50,12 +50,16 @@ body { text-align: left; border-top-left-radius: 10px; border-top-right-radius: 10px; - height: auto; + height: 100%; + } + .toolbar{ + height:4.9%; + margin-bottom:0.1% } - .editor-inner { background: #fff; position: relative; + height:95% } .editor-input { diff --git a/src/pages/Note/index.jsx b/src/pages/Note/index.jsx index 817c044..085b360 100644 --- a/src/pages/Note/index.jsx +++ b/src/pages/Note/index.jsx @@ -75,7 +75,7 @@ const Note = () => {

上善若水

- diff --git a/src/pages/Note/index.less b/src/pages/Note/index.less index 12e7bf5..a4d9cc4 100644 --- a/src/pages/Note/index.less +++ b/src/pages/Note/index.less @@ -1,6 +1,6 @@ .HlexicalName { // 顶上有标题设置100h后下面会多处一部分 - // height: 100vh; + height: 100%; width: auto; } .ant-tabs-top .ant-tabs-nav{ diff --git a/src/redux/dirMessage_reducer.js b/src/redux/dirMessage_reducer.js index f31fd5a..5ea649c 100644 --- a/src/redux/dirMessage_reducer.js +++ b/src/redux/dirMessage_reducer.js @@ -157,6 +157,7 @@ export const dirMessageSlice = createSlice({ }) }, dirFileRemove:(state,action)=>{ + console.log("dirMessage:dirFileRemove", state, action) let filePath = action.payload.filePath; state.data = state.data.filter(file=>{ if (file.filePath === filePath && !file.dirFlag) { @@ -177,7 +178,7 @@ function dirFileRemoveChild(fileList, selectDirKey) { if (file.filePath === selectDirKey && !file.dirFlag) { return false }else if (file.dirFlag && selectDirKey.startsWith(file.filePath) && Array.isArray(file.children) && file.children.length > 0) { - dirFileRemoveChild(file.children, selectDirKey) + file.children = dirFileRemoveChild(file.children, selectDirKey) return true }else { return true diff --git a/src/redux/tableBarItem_reducer.js b/src/redux/tableBarItem_reducer.js index bf01ea6..35f7121 100644 --- a/src/redux/tableBarItem_reducer.js +++ b/src/redux/tableBarItem_reducer.js @@ -77,6 +77,7 @@ export const tableBarItemSlice = createSlice({ state.expandedKeyList=Array.from(new Set([...state.expandedKeyList])) }, setExpandedKeys:(state, action)=>{ + console.log("tableBarItemSlice:setExpandedKeys",action.payload) state.expandedKeyList=action.payload }, removeExpandedKeys:(state, action)=>{ diff --git a/src/utils/PathOperate/index.jsx b/src/utils/PathOperate/index.jsx index 0b11128..91b47ee 100644 --- a/src/utils/PathOperate/index.jsx +++ b/src/utils/PathOperate/index.jsx @@ -8,7 +8,7 @@ export function getFileFullNameByPath(fileName){ } export function replaceFileNameByFilePath(filePath,fileName){ - let parsedPath = pathOperate.parse(fileName); + let parsedPath = pathOperate.parse(filePath); return pathOperate.format({"dir":parsedPath.dir,"base":fileName+parsedPath.ext}) } export function getFileDirByPath(fileName){