fix: 样本管理样式更改

This commit is contained in:
2026-03-02 14:55:24 +08:00
parent 95338a3ddf
commit f842dcaf14
6 changed files with 220 additions and 190 deletions

View File

@@ -35,7 +35,6 @@ function EnhancedProTable<T extends BaseRecord, U extends ParamsType = any>(
type={action.type} type={action.type}
danger={action.danger} danger={action.danger}
disabled={action.disabled} disabled={action.disabled}
// icon={action.icon ?? <PlusOutlined />}
onClick={() => action.onClick()} onClick={() => action.onClick()}
> >
{action.label} {action.label}
@@ -55,7 +54,6 @@ function EnhancedProTable<T extends BaseRecord, U extends ParamsType = any>(
toolBarRender={toolBarRender} toolBarRender={toolBarRender}
manualRequest={false} manualRequest={false}
showSorterTooltip showSorterTooltip
// scroll={{ x: "max-content" }}
scroll={scroll ? scroll : { x: 1200 }} scroll={scroll ? scroll : { x: 1200 }}
components={components} components={components}
search={ search={
@@ -84,6 +82,7 @@ function EnhancedProTable<T extends BaseRecord, U extends ParamsType = any>(
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
// pageSize: 10, // pageSize: 10,
defaultPageSize: 10,
showTotal: formatPaginationTotal, showTotal: formatPaginationTotal,
} }
: false : false

View File

@@ -1,5 +1,6 @@
.uploader-card { .uploader-card {
background-color: #fff; background-color: #fff;
padding: 10px;
:global { :global {
.ant-upload-drag { .ant-upload-drag {
background-color: #fff; background-color: #fff;

View File

@@ -5,7 +5,11 @@ import type {
} from '@ant-design/pro-components'; } from '@ant-design/pro-components';
import { Modal, message, Switch } from 'antd'; import { Modal, message, Switch } from 'antd';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { type AiModelRespVO, updateModelStatus } from '@/services/ai/model'; import {
type AiModelRespVO,
updateModel,
updateModelStatus,
} from '@/services/ai/model';
export const baseDeptColumns: ProColumns<AiModelRespVO>[] = [ export const baseDeptColumns: ProColumns<AiModelRespVO>[] = [
{ {
@@ -47,9 +51,9 @@ export const baseDeptColumns: ProColumns<AiModelRespVO>[] = [
}"类目吗?`, }"类目吗?`,
onOk: async () => { onOk: async () => {
console.log(checked); console.log(checked);
await updateModelStatus({ await updateModel({
...record,
status: checked ? 1 : 0, status: checked ? 1 : 0,
id: record.id,
}); });
message.success('修改成功'); message.success('修改成功');
action?.reload(); action?.reload();

View File

@@ -174,6 +174,8 @@ const SampleTagDetail = <T extends Record<string, any>>(
document.body.removeChild(link); document.body.removeChild(link);
}; };
return ( return (
<>
{data!.length > 0 ? (
<> <>
<ProForm name="validate_other" formRef={formRef} submitter={false}> <ProForm name="validate_other" formRef={formRef} submitter={false}>
{type === 'radio' && ( {type === 'radio' && (
@@ -254,11 +256,15 @@ const SampleTagDetail = <T extends Record<string, any>>(
<ProFormGroup title="文本信息" block></ProFormGroup> <ProFormGroup title="文本信息" block></ProFormGroup>
<Space size={10} style={{ width: '100%', marginBottom: 12 }}> <Space size={10} style={{ width: '100%', marginBottom: 12 }}>
<span>: </span> <span>: </span>
<span>{dayjs(value.createTime).format('YYYY-MM-DD HH:mm:ss')}</span> <span>
{dayjs(value.createTime).format('YYYY-MM-DD HH:mm:ss')}
</span>
</Space> </Space>
<Space size={10} style={{ width: '100%', marginBottom: 12 }}> <Space size={10} style={{ width: '100%', marginBottom: 12 }}>
<span></span> <span></span>
<span>{dayjs(value.updateTime).format('YYYY-MM-DD HH:mm:ss')}</span> <span>
{dayjs(value.updateTime).format('YYYY-MM-DD HH:mm:ss')}
</span>
</Space> </Space>
<Space size={10} style={{ width: '100%', marginBottom: 12 }}> <Space size={10} style={{ width: '100%', marginBottom: 12 }}>
<span>: </span> <span>: </span>
@@ -327,7 +333,10 @@ const SampleTagDetail = <T extends Record<string, any>>(
onOk={onRename} onOk={onRename}
onCancel={() => setTagManagerVisible(false)} onCancel={() => setTagManagerVisible(false)}
></TagManager> ></TagManager>
<Space style={{ width: '100%', justifyContent: 'center', padding: 12 }}> {type === 'radio' && (
<Space
style={{ width: '100%', justifyContent: 'center', padding: 12 }}
>
<Button color="danger" onClick={onDownload}> <Button color="danger" onClick={onDownload}>
</Button> </Button>
@@ -335,6 +344,11 @@ const SampleTagDetail = <T extends Record<string, any>>(
</Button> </Button>
</Space> </Space>
)}
</>
) : (
'暂无数据-请选择样本'
)}
</> </>
); );
}; };

View File

@@ -1,18 +1,28 @@
.tag-content { .tag-content {
display: flex;
background: #fff; background: #fff;
width: 100%; width: 100%;
overflow: auto; overflow: auto;
:global { :global {
.ant-pro-table { .left {
flex: 1 auto; padding-right: 385px;
} }
.uploader-card {
padding-right: 400px;
}
.detail { .detail {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-left: 1px solid #e8e8e8; border-left: 1px solid #e8e8e8;
border-top: 1px solid #e8e8e8;
width: 400px; width: 400px;
padding: 16px; padding: 16px;
top: 74px;
height: calc(100vh - 80px);
overflow: auto;
background: #fff;
position: fixed;
right: 0;
form { form {
flex: 1; flex: 1;
} }

View File

@@ -77,8 +77,9 @@ const SampleTag: React.FC = () => {
}; };
return ( return (
<> <>
<UploadCard onChange={onChangeVideo} />
<div className={styles['tag-content']}> <div className={styles['tag-content']}>
<div className="left">
<UploadCard onChange={onChangeVideo} />
<EnhancedProTable<AiSampleRespVO> <EnhancedProTable<AiSampleRespVO>
ref={tableRef} ref={tableRef}
columns={baseTenantColumns} columns={baseTenantColumns}
@@ -90,14 +91,16 @@ const SampleTag: React.FC = () => {
scroll={{ x: 400 }} scroll={{ x: 400 }}
rowSelection={{ rowSelection={{
type: selectTableType, type: selectTableType,
selectedRowKeys: selectedRows.map((item) => item.id) as React.Key[], selectedRowKeys: selectedRows.map(
(item) => item.id,
) as React.Key[],
onChange: (_, selectedRows) => { onChange: (_, selectedRows) => {
setSelectedRows(selectedRows); setSelectedRows(selectedRows);
}, },
}} }}
/> />
</div>
{selectedRows.length > 0 && (
<div className="detail"> <div className="detail">
<SampleTagDetail<AiSampleRespVO> <SampleTagDetail<AiSampleRespVO>
type={selectTableType} type={selectTableType}
@@ -105,7 +108,6 @@ const SampleTag: React.FC = () => {
onRefresh={onRefresh} onRefresh={onRefresh}
/> />
</div> </div>
)}
</div> </div>
<GroupTagModal <GroupTagModal
visible={modalVisible} visible={modalVisible}