fix(ui): 完善界面交互与开发配置

This commit is contained in:
zhanjunhao
2026-11-18 19:09:00 +08:00
parent 4147fac38f
commit 28fb53ceae
87 changed files with 2212 additions and 2823 deletions
@@ -19,7 +19,9 @@ For commercial licensing, please contact support@quantumnous.com
import React, { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Alert, Button, Empty, Table, Tag } from 'antd';
import { Button, Empty, Tag } from 'antd';
import { Table } from '@/components/ui';
import { ConsoleAlert as Alert } from '../console/ConsolePrimitives';
import { listDecisions } from './api';
import { gateText, jevReasonText, srcText } from './labels';
@@ -138,14 +140,12 @@ const DecisionTable = ({ mode, orgId }) => {
columns={columns}
dataSource={data.items || []}
scroll={{ x: 'max-content' }}
locale={{
emptyText: (
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description={t('还没有智能路由请求')}
/>
),
}}
empty={
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description={t('还没有智能路由请求')}
/>
}
pagination={{
// 接口固定 page_size=20,不提供每页条数切换
current: page,
+12 -7
View File
@@ -20,7 +20,6 @@ For commercial licensing, please contact support@quantumnous.com
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
Alert,
Button,
Form,
Input,
@@ -33,6 +32,7 @@ import {
Tag,
Typography,
} from 'antd';
import { ConsoleAlert as Alert } from '../console/ConsolePrimitives';
import { showError, showSuccess } from '../../helpers';
import { getAdminStatus, loadOptions, saveOption, setJevKey } from './api';
@@ -333,7 +333,7 @@ const GlobalSettings = () => {
case 'int':
return (
<InputNumber
style={{ width: 200 }}
className='smart-router-setting-control'
min={f.min}
max={f.max}
value={Number(v) || 0}
@@ -353,7 +353,7 @@ const GlobalSettings = () => {
case 'select':
return (
<Select
style={{ width: 200 }}
className='smart-router-setting-control'
value={v}
options={f.options.map((o) => ({ label: o, value: o }))}
onChange={set}
@@ -371,7 +371,7 @@ const GlobalSettings = () => {
default:
return (
<Input
style={{ maxWidth: 360 }}
className='smart-router-setting-control'
value={v}
onChange={(e) => set(e.target.value)}
/>
@@ -470,7 +470,12 @@ const GlobalSettings = () => {
<div key={sec} className='smart-router-card'>
<div className='smart-router-card-title'>{t(title)}</div>
{/* 受控字段沿用 values 状态,Form 只提供竖排标签布局,不接管取值与提交 */}
<Form layout='vertical' component='div' requiredMark={false}>
<Form
layout='vertical'
component='div'
requiredMark={false}
className='smart-router-settings-form'
>
{FIELDS.filter((f) => f.section === sec).map((f) => (
<Form.Item
key={f.key}
@@ -501,9 +506,9 @@ const GlobalSettings = () => {
</span>
}
>
<Space size={8} wrap>
<Space size={8} wrap className='smart-router-key-tools'>
<Input.Password
style={{ width: 320 }}
className='smart-router-key-input'
placeholder={t('输入新密钥;留空表示不修改')}
value={keys[p]}
onChange={(e) =>
@@ -24,7 +24,6 @@ import {
Button,
Checkbox,
Collapse,
Drawer,
Form,
Input,
InputNumber,
@@ -33,6 +32,7 @@ import {
Switch,
Typography,
} from 'antd';
import { ConsoleDrawer as Drawer } from '../console/ConsolePrimitives';
import { Plus, Trash2 } from '../common/icons/ActionIcons';
import { showError, showSuccess } from '../../helpers';
import { saveProfile } from './api';
+15 -24
View File
@@ -19,16 +19,9 @@ For commercial licensing, please contact support@quantumnous.com
import React, { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
Alert,
Button,
Empty,
Popconfirm,
Space,
Table,
Tag,
Typography,
} from 'antd';
import { Button, Empty, Popconfirm, Space, Tag, Typography } from 'antd';
import { Table } from '@/components/ui';
import { ConsoleAlert as Alert } from '../console/ConsolePrimitives';
import { Plus } from '../common/icons/ActionIcons';
import { copy, showError, showSuccess } from '../../helpers';
import { deleteProfile, listCandidateModels, listProfiles } from './api';
@@ -230,20 +223,18 @@ const ProfileTable = ({ mode, orgId, canWrite = true, emptyHint }) => {
dataSource={list}
pagination={false}
scroll={{ x: 'max-content' }}
locale={{
emptyText: (
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description={t('还没有智能路由集合')}
>
{canWrite && (
<Button type='primary' onClick={() => setEditing({})}>
{t('新建集合')}
</Button>
)}
</Empty>
),
}}
empty={
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description={t('还没有智能路由集合')}
>
{canWrite && (
<Button type='primary' onClick={() => setEditing({})}>
{t('新建集合')}
</Button>
)}
</Empty>
}
/>
)}
<ProfileEditor
@@ -19,7 +19,11 @@ For commercial licensing, please contact support@quantumnous.com
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Alert, Button, Input, Modal, Progress, Tag, Typography } from 'antd';
import { Button, Input, Progress, Tag, Typography } from 'antd';
import {
ConsoleAlert as Alert,
ConsoleModal as Modal,
} from '../console/ConsolePrimitives';
import { simulateProfile } from './api';
import { gateText, reasonText, srcText } from './labels';
+69 -1
View File
@@ -16,6 +16,10 @@
min-width: 0;
}
.smart-router-page .smart-router-intro.console-alert {
margin-block: 0;
}
.smart-router-alert {
margin-bottom: 18px;
}
@@ -181,7 +185,7 @@
.smart-router-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0 16px;
gap: 0 24px;
}
.smart-router-grid-full {
@@ -274,3 +278,67 @@
min-width: 0;
word-break: break-all;
}
.smart-router-settings-form {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
column-gap: 24px;
}
.smart-router-setting-control.ant-input-number,
.smart-router-setting-control.ant-select,
.smart-router-setting-control.ant-input {
width: 100%;
}
.smart-router-key-tools {
width: 100%;
}
.smart-router-key-input {
width: min(320px, 100%);
}
.smart-router-sheet .ant-drawer-body {
padding: 24px;
scrollbar-gutter: stable;
}
.smart-router-sheet .ant-modal {
max-width: calc(100vw - 32px);
}
@media (max-width: 768px) {
.smart-router-card,
.smart-router-consent-row {
padding: 16px;
}
.smart-router-settings-form {
grid-template-columns: minmax(0, 1fr);
}
.smart-router-sheet .smart-router-inline > .ant-select,
.smart-router-sheet .smart-router-inline > .ant-input-number {
max-width: 100%;
min-width: 0;
}
.smart-router-sheet .smart-router-model-select {
flex-basis: 100%;
}
.smart-router-key-tools > .ant-space-item,
.smart-router-key-input {
max-width: 100%;
}
.smart-router-kv {
grid-template-columns: minmax(0, 1fr);
gap: 4px;
}
.smart-router-kv dd {
margin-bottom: 12px;
}
}