diff --git a/src/components/Directory/views/listMode.tsx b/src/components/Directory/views/listMode.tsx index e97db07b858b6832edfedea4ca9f90aa995b2d49..ecad1d0195259141dc5cd2ce96ede43a2ace24b0 100644 --- a/src/components/Directory/views/listMode.tsx +++ b/src/components/Directory/views/listMode.tsx @@ -254,262 +254,154 @@ 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%' }}> - - {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)}>
)} - +