diff --git a/src/app.tsx b/src/app.tsx
index 83e48a5..0d89cc9 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -112,7 +112,7 @@ export const layout: RunTimeLayoutConfig = ({
waterMarkProps: {
content: initialState?.currentUser?.user.nickname,
},
- footerRender: () => ,
+ // footerRender: () => ,
onPageChange: () => {
const { location } = history;
// 如果没有登录,重定向到 login
diff --git a/src/pages/ai/sample-tag/config.tsx b/src/pages/ai/sample-tag/config.tsx
index 9568029..393df65 100644
--- a/src/pages/ai/sample-tag/config.tsx
+++ b/src/pages/ai/sample-tag/config.tsx
@@ -20,21 +20,49 @@ export const baseTenantColumns: ProColumns[] = [
ellipsis: true,
},
{
- title: '文件格式',
- width: 100,
- dataIndex: 'sampleMineType',
+ title: '枚举标签',
+ dataIndex: 'enumTags',
+ width: 120,
+ ellipsis: true,
+ render: (_, record) => {
+ return (
+ record.enumTags?.map((tag) => {
+ return (
+ <>
+ {tag.enumValue}:{tag.tagName}
+ >
+ );
+ }) || '-'
+ );
+ },
},
+
{
- title: '标签',
+ title: '个性标签',
dataIndex: 'tags',
width: 200,
hideInSearch: true,
render: (_, record) => {
return record.tags?.map((tag) => {
- return {tag.tagName};
+ return (
+
+ {tag.tagName}
+
+ );
});
},
},
+ {
+ title: '关联模型',
+ width: 100,
+ dataIndex: 'relatedModels',
+ },
+ {
+ title: '文件格式',
+ width: 100,
+ dataIndex: 'sampleMineType',
+ },
+
{
title: '注释',
width: 100,
diff --git a/src/pages/ai/sample-tag/detail.tsx b/src/pages/ai/sample-tag/detail.tsx
index d63a059..ab4c5d2 100644
--- a/src/pages/ai/sample-tag/detail.tsx
+++ b/src/pages/ai/sample-tag/detail.tsx
@@ -1,5 +1,6 @@
import { ProForm, ProFormGroup, ProFormText } from '@ant-design/pro-components';
-import { Button, message, Space, Tag } from 'antd';
+import { Button, Empty, Input, message, Space, Tag } from 'antd';
+import FormItem from 'antd/es/form/FormItem';
import type { RowSelectionType } from 'antd/es/table/interface';
import type { FormInstance } from 'antd/lib';
import dayjs from 'dayjs';
@@ -13,6 +14,7 @@ import React, {
import GroupTagModal from '@/components/GroupTag/GroupTagModal';
import type { TagItem } from '@/components/GroupTag/types';
import type { FileItem } from '@/components/RenameRule';
+import TagEditor from '@/components/TagEditor';
import {
createSampleTag,
createSampleTagGroup,
@@ -177,28 +179,50 @@ const SampleTagDetail = >(
<>
{data!.length > 0 ? (
<>
-
- {type === 'radio' && (
-
- {data?.[0].sampleFilePath && (
-
- )}
-
- )}
-
+
+
{type === 'radio' && (
+
+ {data?.[0].sampleFilePath && (
+
+ )}
+
+ )}
+
+ {type === 'radio' && (
+ {
+ if (e.target.value) {
+ const newData =
+ data?.map((sample) => {
+ return {
+ id: sample.id,
+ sampleName: e.target.value,
+ };
+ }) || [];
+ await updateSamples(newData);
+ props?.onRefresh?.();
+ message.success('更新样本名称成功');
+ }
+ },
+ }}
+ rules={[{ required: true, message: '样本名称不能为空' }]}
+ />
+ )}
{
if (e.target.value) {
@@ -206,136 +230,96 @@ const SampleTagDetail = >(
data?.map((sample) => {
return {
id: sample.id,
- sampleName: e.target.value,
+ remark: e.target.value,
};
}) || [];
await updateSamples(newData);
props?.onRefresh?.();
- message.success('更新样本名称成功');
+ message.success('更新注释成功');
}
},
}}
- rules={[{ required: true, message: '样本名称不能为空' }]}
+ name="remark"
+ placeholder="请输入注释"
/>
- )}
- {
- if (e.target.value) {
- const newData =
- data?.map((sample) => {
- return {
- id: sample.id,
- remark: e.target.value,
- };
- }) || [];
- await updateSamples(newData);
- props?.onRefresh?.();
- message.success('更新注释成功');
- }
- },
- }}
- name="remark"
- placeholder="请输入注释"
- />
-
+
+
+
+
+
+
+
+
+
+ {/* */}
+ {forMap(value.tags || [])}
+
+
+
+
+ 添加日期:
+
+ {dayjs(value.createTime).format('YYYY-MM-DD HH:mm:ss')}
+
+
+
+ 修改日期
+
+ {dayjs(value.updateTime).format('YYYY-MM-DD HH:mm:ss')}
+
+
+
+ 文件大小:
+ {value.sampleSize}
+
+
+ 格式:
+ {value.sampleMineType}
+
+
+
setModalVisible(false)}
+ onChange={onListAddTag}
+ editable={false}
+ value={value?.tags}
+ request={{
+ groupsApi: {
+ get: getSampleTagGroup,
+ create: createSampleTagGroup,
+ delete: deleteSampleTagGroup,
+ update: updateSampleTagGroup,
+ },
+ tagsApi: {
+ get: getSampleTagPage,
+ create: createSampleTag,
+ delete: deleteSampleTag,
+ update: updateSampleTag,
+ },
+ }}
+ title="管理技术标签"
+ width={800}
+ height={500}
+ />
+
-
- {/* */}
- {forMap(value.tags || [])}
-
-
-
-
- 添加日期:
-
- {dayjs(value.createTime).format('YYYY-MM-DD HH:mm:ss')}
-
-
-
- 修改日期
-
- {dayjs(value.updateTime).format('YYYY-MM-DD HH:mm:ss')}
-
-
-
- 文件大小:
- {value.sampleSize}
-
-
- 格式:
- {value.sampleMineType}
-
-
- {type === 'checkbox' && (
- <>
-
-
-
-
- >
- )}
-
- setModalVisible(false)}
- onChange={onListAddTag}
- editable={false}
- value={value?.tags}
- request={{
- groupsApi: {
- get: getSampleTagGroup,
- create: createSampleTagGroup,
- delete: deleteSampleTagGroup,
- update: updateSampleTagGroup,
- },
- tagsApi: {
- get: getSampleTagPage,
- create: createSampleTag,
- delete: deleteSampleTag,
- update: updateSampleTag,
- },
- }}
- title="管理技术标签"
- width={800}
- height={500}
- />
setTagManagerVisible(false)}
>
- {type === 'radio' && (
+ {type === 'radio' ? (
+ ) : (
+
+
+
+
+
)}
>
) : (
- '暂无数据-请选择样本'
+
)}
>
);
diff --git a/src/pages/ai/sample-tag/index.module.less b/src/pages/ai/sample-tag/index.module.less
index 645d561..e268a53 100644
--- a/src/pages/ai/sample-tag/index.module.less
+++ b/src/pages/ai/sample-tag/index.module.less
@@ -1,28 +1,38 @@
.tag-content {
background: #fff;
width: 100%;
- overflow: auto;
+ height: calc(100vh - 90px);
+ display: flex;
+ overflow: hidden;
:global {
.left {
- padding-right: 385px;
+ background: #fff;
+ overflow: auto;
+ flex: 1;
}
- .uploader-card {
- padding-right: 400px;
- }
-
.detail {
display: flex;
flex-direction: column;
border-left: 1px solid #e8e8e8;
- border-top: 1px solid #e8e8e8;
- width: 400px;
- padding: 16px;
- top: 74px;
+ width: 360px;
height: calc(100vh - 80px);
- overflow: auto;
+ overflow-y: auto;
background: #fff;
- position: fixed;
- right: 0;
+ overflow-x: hidden;
+ position: relative;
+ .ant-pro-form-group-title {
+ margin-bottom: 20px;
+ }
+ .sample-tag-detail {
+ padding: 16px;
+ }
+ .tag-manager-btns {
+ position: sticky;
+ bottom: 10px;
+ background: #fff;
+ box-shadow: 0 0 10px #e8e8e8;
+ align-items: center;
+ }
form {
flex: 1;
}
diff --git a/src/services/ai/sample/index.ts b/src/services/ai/sample/index.ts
index 0726567..1bd7843 100644
--- a/src/services/ai/sample/index.ts
+++ b/src/services/ai/sample/index.ts
@@ -87,6 +87,7 @@ export interface AiSampleRespVO {
*/
sampleTime?: string;
tags?: { tagName?: string; id?: number }[];
+ enumTags?: { tagName?: string; id?: number; enumValue?: string }[];
}
export interface SampleReqVo extends PageParam {