From ea3772736c2e603fbfc5214f497404e00630068e Mon Sep 17 00:00:00 2001 From: JY <1140938202@qq.com> Date: Tue, 23 Jul 2024 19:36:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Directory/views/listMode.tsx | 103 -------------------- 1 file changed, 103 deletions(-) diff --git a/src/components/Directory/views/listMode.tsx b/src/components/Directory/views/listMode.tsx index e97db07b8..5c08d1850 100644 --- a/src/components/Directory/views/listMode.tsx +++ b/src/components/Directory/views/listMode.tsx @@ -254,109 +254,6 @@ const ListMode = ({
e.stopPropagation()} style={{ width: '100%', height: '100%' }}> - - {content.map((item, index) => ( - - {(provided: any) => ( -
-
- { - fileOpen(item, false); - }} - onDoubleClick={() => { - fileOpen(item, true); - }} - onContextMenu={() => setCxtItem(item)} - actions={[ -
- {showChatTime(item.updateTime)} -
, - ]}> - -
{item.name}
- {renderSpecialTags(item)} - {!isDynamic && - item.groupTags - .filter((i) => i.length > 0) - .map((label) => { - return ( - - {label} - - ); - })} - {isNav ? ( - <> - - { - (item as IPageTemplate).directory.target - .name - } - - - { - (item as IPageTemplate).directory.target - .space.name - } - - - ) : isDynamic ? ( - <> - {item.typeName} - - ) : ( - <> - )} - {'dev' in item && - 'score' in item && - 'conduct' in item && - item.score != 0 && ( - - - {item.score as number} - - - )} - - } - avatar={ - - - - } - description={ - // TODO 后期需要优化 -
-
- {item.remark || item.code} -
-
- } - /> -
-
-
- )} -
- ))} - {provided.placeholder} -
e.stopPropagation()} style={{ width: '100%', height: '100%' }}> -- Gitee From 2a0dc3145374a4a668bfa05d15e3aaf0184482c8 Mon Sep 17 00:00:00 2001 From: JY <1140938202@qq.com> Date: Tue, 23 Jul 2024 19:38:09 +0800 Subject: [PATCH 2/2] fix --- src/components/Directory/views/listMode.tsx | 283 ++++++++++---------- 1 file changed, 139 insertions(+), 144 deletions(-) diff --git a/src/components/Directory/views/listMode.tsx b/src/components/Directory/views/listMode.tsx index 5c08d1850..ecad1d019 100644 --- a/src/components/Directory/views/listMode.tsx +++ b/src/components/Directory/views/listMode.tsx @@ -254,159 +254,154 @@ const ListMode = ({
e.stopPropagation()} style={{ width: '100%', height: '100%' }}> -
e.stopPropagation()} - style={{ width: '100%', height: '100%' }}> - - {content.length > 0 && ( - - {content.map((item, index) => ( - - {(provided: any) => ( + + {content.length > 0 && ( + + {content.map((item, index) => ( + + {(provided: any) => ( +
-
- {!groups && href.indexOf('home') != -1 && ( - { - const { checked, value } = e.target; - if (checked) { - setSelectedKeys([...selectedKeys, value]); - } else { - setSelectedKeys( - selectedKeys.filter( - (k: any) => k !== value, - ), - ); - } - }} - checked={selectedKeys.includes(item)}> - )} - { - fileOpen(item, false); - }} - onDoubleClick={() => { - fileOpen(item, true); + style={{ display: 'flex', alignItems: 'center' }} + className={getItemClassName(item)}> + {!groups && href.indexOf('home') != -1 && ( + { + const { checked, value } = e.target; + if (checked) { + setSelectedKeys([...selectedKeys, value]); + } else { + setSelectedKeys( + selectedKeys.filter( + (k: any) => k !== value, + ), + ); + } }} - onContextMenu={() => setCxtItem(item)} - actions={[ -
- {showChatTime(item.updateTime)} -
, - ]}> - -
- {item.name} -
- {renderSpecialTags(item)} - {!isDynamic && - item.groupTags - .filter((i) => i.length > 0) - .map((label) => { - return ( - - {label} - - ); - })} - {isNav ? ( - <> - - { - (item as IPageTemplate).directory - .target.name - } - - - { - (item as IPageTemplate).directory - .target.space.name - } - - - ) : isDynamic ? ( - <> - - {item.typeName} - - - ) : ( - <> + checked={selectedKeys.includes(item)}>
+ )} + { + fileOpen(item, false); + }} + onDoubleClick={() => { + fileOpen(item, true); + }} + onContextMenu={() => setCxtItem(item)} + actions={[ +
+ {showChatTime(item.updateTime)} +
, + ]}> + +
+ {item.name} +
+ {renderSpecialTags(item)} + {!isDynamic && + item.groupTags + .filter((i) => i.length > 0) + .map((label) => { + return ( + + {label} + + ); + })} + {isNav ? ( + <> + + { + (item as IPageTemplate).directory + .target.name + } + + + { + (item as IPageTemplate).directory + .target.space.name + } + + + ) : isDynamic ? ( + <> + + {item.typeName} + + + ) : ( + <> + )} + {'dev' in item && + 'score' in item && + 'conduct' in item && + item.score != 0 && ( + + + {item.score as number} + + )} - {'dev' in item && - 'score' in item && - 'conduct' in item && - item.score != 0 && ( - - - {item.score as number} - - - )} - - } - avatar={ - - - - } - description={ - // TODO 后期需要优化 -
-
- {item.remark || item.code} -
+ + } + avatar={ + + + + } + description={ + // TODO 后期需要优化 +
+
+ {item.remark || item.code}
- } - /> - -
+
+ } + /> +
- )} - - ))} - {provided.placeholder} - - )} - {content.length === 0 && ( -
{emptyElement()}
- )} - -
setCxtItem(undefined)}> -
-
+
+ )} +
+ ))} + {provided.placeholder} +
+ )} + {content.length === 0 && ( +
{emptyElement()}
+ )} +
+
setCxtItem(undefined)}>
)} - +
-- Gitee