Merge pull request #816 from SuanmoSuanyangTechnology/feature/ui_upgrade_zy

Feature/UI upgrade zy
This commit is contained in:
yingzhao
2026-04-08 10:50:14 +08:00
committed by GitHub
3 changed files with 21 additions and 25 deletions

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2025-12-30 13:59:36
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-04-08 00:08:50
* @Last Modified time: 2026-04-08 10:40:51
*/
import { forwardRef, useImperativeHandle, useState, useRef, useMemo } from 'react';
import { Form, Input, Select, InputNumber, Button, Row, Col, Flex, Spin } from 'antd';
@@ -73,37 +73,32 @@ const ChatVariableModal = forwardRef<ChatVariableModalRef, ChatVariableModalProp
const [editIndex, setEditIndex] = useState<number | undefined>(undefined);
const type = Form.useWatch('type', form);
const max_size = 50;
const allowed_transfer_methods = Form.useWatch('allowed_transfer_methods', form);
const image_enabled = Form.useWatch('image_enabled', form);
const audio_enabled = Form.useWatch('audio_enabled', form);
const document_enabled = Form.useWatch('document_enabled', form);
const video_enabled = Form.useWatch('video_enabled', form);
const image_max_size_mb = Form.useWatch('image_max_size_mb', form);
const audio_max_size_mb = Form.useWatch('audio_max_size_mb', form);
const document_max_size_mb = Form.useWatch('document_max_size_mb', form);
const video_max_size_mb = Form.useWatch('video_max_size_mb', form);
const image_allowed_extensions = Form.useWatch('image_allowed_extensions', form);
const audio_allowed_extensions = Form.useWatch('audio_allowed_extensions', form);
const document_allowed_extensions = Form.useWatch('document_allowed_extensions', form);
const video_allowed_extensions = Form.useWatch('video_allowed_extensions', form);
const max_file_count = Form.useWatch('max_file_count', form);
const hasEnabledFileType = !!(image_enabled || audio_enabled || document_enabled || video_enabled);
const featureConfig = useMemo(() => ({
enabled: hasEnabledFileType,
enabled: true,
allowed_transfer_methods,
max_file_count,
image_enabled, image_max_size_mb, image_allowed_extensions,
audio_enabled, audio_max_size_mb, audio_allowed_extensions,
document_enabled, document_max_size_mb, document_allowed_extensions,
video_enabled, video_max_size_mb, video_allowed_extensions,
image_enabled, image_max_size_mb: max_size, image_allowed_extensions,
audio_enabled, audio_max_size_mb: max_size, audio_allowed_extensions,
document_enabled, document_max_size_mb: max_size, document_allowed_extensions,
video_enabled, video_max_size_mb: max_size, video_allowed_extensions,
}), [
hasEnabledFileType, allowed_transfer_methods, max_file_count,
image_enabled, image_max_size_mb, image_allowed_extensions,
audio_enabled, audio_max_size_mb, audio_allowed_extensions,
document_enabled, document_max_size_mb, document_allowed_extensions,
video_enabled, video_max_size_mb, video_allowed_extensions,
allowed_transfer_methods, max_file_count,
image_enabled, image_allowed_extensions,
audio_enabled, audio_allowed_extensions,
document_enabled, document_allowed_extensions,
video_enabled, video_allowed_extensions, max_size
]);
const handleClose = () => {

View File

@@ -80,8 +80,8 @@ const AssignmentList: FC<AssignmentListProps> = ({
form.setFieldValue([parentName, name, 'value'], undefined);
}}
size={size}
className="rb:w-39! rb:bg-[#F6F6F6]!"
variant="borderless"
className="rb:flex-1!"
variant="filled"
/>
</Form.Item>
<Form.Item
@@ -121,8 +121,8 @@ const AssignmentList: FC<AssignmentListProps> = ({
placeholder={t('common.pleaseSelect')}
options={dataType ? options.filter(vo => vo.dataType === dataType) : options}
size={size}
variant="borderless"
className="select"
className="rb:flex-1!"
variant="filled"
/>
: dataType === 'number'
? <InputNumber
@@ -152,8 +152,8 @@ const AssignmentList: FC<AssignmentListProps> = ({
placeholder={t('common.pleaseSelect')}
options={dataType ? options.filter(vo => vo.dataType === dataType) : options}
size={size}
variant="borderless"
className="select"
className="rb:flex-1!"
variant="filled"
/>
}
</Form.Item>

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 15:40:13
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-04-07 19:40:27
* @Last Modified time: 2026-04-08 10:48:21
*/
import { useState, useRef, useEffect, useLayoutEffect, type FC } from 'react'
import { createPortal } from 'react-dom'
@@ -191,10 +191,11 @@ const VariableSelect: FC<VariableSelectProps> = ({
<div
className={clsx(
'rb:w-full rb:flex rb:items-center rb:justify-between rb:cursor-pointer rb:rounded-md rb:px-2 rb:transition-colors',
variant === 'filled' && 'rb:bg-[#F6F6F6] rb:border-none rb:shadow-none',
variant === 'outlined' && 'rb:border rb:border-[#d9d9d9] hover:rb:border-[#4096ff] rb:bg-white',
variant === 'outlined' && open && 'rb:border-[#4096ff] rb:shadow-[0_0_0_2px_rgba(5,145,255,0.1)]',
variant === 'borderless' && 'rb:border-none rb:shadow-none rb:bg-transparent',
multiple && size === 'small' ? 'rb:min-h-6 rb:py-0.75' : multiple ? 'rb:min-h-8 rb:py-1' : size === 'small' ? 'rb:h-6 rb:text-[10px]' : size === 'large' ? 'rb:h-10' : 'rb:h-8 rb:text-[12px]',
multiple && size === 'small' ? 'rb:min-h-7 rb:py-0.75' : multiple ? 'rb:min-h-8 rb:py-1' : size === 'small' ? 'rb:h-7 rb:text-[10px]' : size === 'large' ? 'rb:h-10' : 'rb:h-8 rb:text-[12px]',
!multiple && (size === 'small' ? 'rb:text-[12px]' : 'rb:text-[12px]'),
className
)}