feat: 完善节点树的静态展示和修复删除文件的bug

develop2
donghao 11 months ago
parent 9f5cd5caf1
commit 3a2db5a76c

@ -0,0 +1,3 @@
<svg>
<path d="M0,0 Q150,150 300,300" stroke="black" fill="transparent" />
</svg>

After

Width:  |  Height:  |  Size: 85 B

@ -52,3 +52,32 @@
.base_tree_wrap .tree_search_form .ant-form-item { .base_tree_wrap .tree_search_form .ant-form-item {
margin: 0; margin: 0;
} }
/* 节点树优化 */
.base_tree_wrap .ant-tree-treenode:not(.tree_node_0) {
padding-top: 0;
padding-bottom: 0;
line-height: 32px;
}
.base_tree_wrap .ant-tree-treenode:not(.tree_node_0) .ant-tree-switcher,
.base_tree_wrap .ant-tree-treenode:not(.tree_node_0) .ant-tree-node-content-wrapper {
line-height: 32px;
}
.base_tree_wrap .ant-tree.ant-tree-show-line .ant-tree-indent-unit:before,
.base_tree_wrap .ant-tree .ant-tree-switcher-leaf-line:before {
border-inline-end: 1px solid #154ddd;
}
.base_tree_wrap .ant-tree .ant-tree-switcher-leaf-line:after {
border-bottom: 1px solid #154ddd;
}
.base_tree_wrap .ant-tree .ant-tree-treenode {
padding-left: 17px;
width: 100%;
}
.ant-tree-indent-unit:before {
position: absolute;
top: 0;
bottom: -4px;
content: '';
inset-inline-end: 12px;
border-inline-end: 1px solid red;
}

@ -61,3 +61,47 @@
} }
} }
} }
/* 节点树优化 */
.base_tree_wrap {
.ant-tree-treenode:not(.tree_node_0) {
padding-top: 0;
padding-bottom: 0;
line-height: 32px;
.ant-tree-switcher,
.ant-tree-node-content-wrapper {
line-height: 32px;
}
}
.ant-tree {
&.ant-tree-show-line .ant-tree-indent-unit:before,
.ant-tree-switcher-leaf-line:before {
border-inline-end: 1px solid #154ddd;
}
.ant-tree-switcher-leaf-line:after {
border-bottom: 1px solid #154ddd;
}
.ant-tree-treenode {
width: 100%;
padding-left: 17px;
}
// &.ant-tree-show-line {
// .tree_node_1 {
// .ant-tree-indent-unit:before {
// border-inline-end: 1px solid transparent;
// }
// }
// }
}
}
.ant-tree-indent-unit:before {
position: absolute;
top: 0;
bottom: -4px;
content: '';
inset-inline-end: 12px;
border-inline-end: 1px solid red;
}

@ -168,7 +168,7 @@ const BaseTree: React.FC<BaseTreeProps> = (props) => {
const renderTreeItem = (node) => { const renderTreeItem = (node) => {
return ( return (
<div className="flex w-full"> <div className="flex w-full">
<span className="w-[130px]">{node.title}</span> <span className="pr-[20px]">{node.title}</span>
{!props?.hideInDelete ? ( {!props?.hideInDelete ? (
<span <span
className="action_list" className="action_list"
@ -217,6 +217,7 @@ const BaseTree: React.FC<BaseTreeProps> = (props) => {
)} )}
<div style={{ maxHeight: 'calc(100vh - 210px)', overflowY: 'auto', overflowX: 'hidden' }}> <div style={{ maxHeight: 'calc(100vh - 210px)', overflowY: 'auto', overflowX: 'hidden' }}>
<Tree <Tree
showLine
selectedKeys={currSeleted} selectedKeys={currSeleted}
defaultExpandAll defaultExpandAll
onSelect={(selectedKeys, info) => { onSelect={(selectedKeys, info) => {

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd * @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-26 11:11:05 * @Date: 2024-04-26 11:11:05
* @LastEditors: donghao donghao@supervision.ltd * @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-29 14:19:24 * @LastEditTime: 2024-06-26 14:41:15
* @FilePath: \general-ai-manage\src\components\Tree\src\deviceGroupTree.tsx * @FilePath: \general-ai-manage\src\components\Tree\src\deviceGroupTree.tsx
* @Description: * @Description:
* @ * @
@ -52,6 +52,7 @@ const DeviceGroupTree: React.FC<DeviceGroupTreeProps> = (props) => {
e.stopPropagation(); e.stopPropagation();
handleAdd(node); handleAdd(node);
}} }}
className={node?.key ? '' : 'pl-[5px]'}
style={{ color: token.colorPrimary }} style={{ color: token.colorPrimary }}
key={node?.key || 'add'} key={node?.key || 'add'}
> >

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd * @Author: donghao donghao@supervision.ltd
* @Date: 2024-06-04 15:14:27 * @Date: 2024-06-04 15:14:27
* @LastEditors: donghao donghao@supervision.ltd * @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-17 14:23:18 * @LastEditTime: 2024-06-26 15:16:52
* @FilePath: \general-ai-platform-web\src\components\UploadFile\src\FormUploadDraggerToken.tsx * @FilePath: \general-ai-platform-web\src\components\UploadFile\src\FormUploadDraggerToken.tsx
* @Description: * @Description:
* // TODO 需要支持多文件上传 * // TODO 需要支持多文件上传
@ -84,7 +84,7 @@ const FormUploadDraggerToken: React.FC<FormUploadDraggerTokenProps> = (props) =>
const onRemoveFile = async (file: UploadFile<R<string>>) => { const onRemoveFile = async (file: UploadFile<R<string>>) => {
console.log(file, 'onRemoveFile_file', fileList); console.log(file, 'onRemoveFile_file', fileList);
const currFile = fileList.find((item) => item.uid === file.uid); const currFile = fileList.find((item) => item.uid === file.uid);
const resp = await apiFileDelete({ file_md5: currFile?.fileId }); const resp = await apiFileDelete({ file_md5: currFile?.fileId || file?.uid });
console.log(resp, 'apiFileDelete_resp'); console.log(resp, 'apiFileDelete_resp');
props.afterRemoveFile(resp, file); props.afterRemoveFile(resp, file);
setPreviewFile(null); setPreviewFile(null);

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd * @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-08 10:36:06 * @Date: 2024-04-08 10:36:06
* @LastEditors: donghao donghao@supervision.ltd * @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-25 14:32:10 * @LastEditTime: 2024-06-26 09:16:11
* @FilePath: \general-ai-manage\src\pages\Model\ModelDetail\index.tsx * @FilePath: \general-ai-manage\src\pages\Model\ModelDetail\index.tsx
* @Description: * @Description:
* @ * @
@ -321,7 +321,7 @@ const ModelDetail: React.FC = () => {
search={false} search={false}
options={{ fullScreen: false, setting: false, density: false, reload: false }} options={{ fullScreen: false, setting: false, density: false, reload: false }}
actionRef={actionRef} actionRef={actionRef}
rowKey="id" rowKey="version_id"
onDataSourceChange={(data) => { onDataSourceChange={(data) => {
console.log(data, 'onDataSourceChange_data'); console.log(data, 'onDataSourceChange_data');
// let CategoryFkIdIds: any = data.map((v) => { // let CategoryFkIdIds: any = data.map((v) => {

Loading…
Cancel
Save