|
|
@@ -1,12 +1,14 @@
|
|
|
import * as React from 'react';
|
|
|
-import { Form, Input, Select, Cascader, Tag, InputNumber, ColorPicker, Button, Space, message } from 'antd';
|
|
|
-import { PlusCircleOutlined, MinusCircleOutlined, CloseCircleOutlined, LinkOutlined } from '@ant-design/icons';
|
|
|
+import { Drawer, Form, Input, Select, Cascader, Tag, InputNumber, ColorPicker, Button, Space, Switch, Divider, message, Tooltip } from 'antd';
|
|
|
+import { PlusCircleOutlined, MinusCircleOutlined, CloseCircleOutlined, InfoCircleOutlined } from '@ant-design/icons';
|
|
|
import * as AllIcons from '@ant-design/icons';
|
|
|
import IconPicker from './IconPicker';
|
|
|
import VipSelector from './VipSelector';
|
|
|
-import './style.scss';
|
|
|
+import './DrawerForm.scss';
|
|
|
|
|
|
interface Step1BasicProps {
|
|
|
+ open: boolean;
|
|
|
+ onClose: () => void;
|
|
|
form: any;
|
|
|
appTypeList: any[];
|
|
|
appVisibleList: any[];
|
|
|
@@ -15,12 +17,17 @@ interface Step1BasicProps {
|
|
|
visibleFlag: string | number;
|
|
|
vipList: any[];
|
|
|
userInfo: any;
|
|
|
+ inputs: Array<{ id: number; value: string }>;
|
|
|
+ selectedIcon: string | null;
|
|
|
+ previewBg: string;
|
|
|
onAppChange: (typeId: number) => void;
|
|
|
onVisibleChange: (value: any) => void;
|
|
|
onRemoveVip: (userId: string) => void;
|
|
|
onVipConfirm: (users: any[]) => void;
|
|
|
onNext: () => void;
|
|
|
- onBack: () => void;
|
|
|
+ onIconChange: (icon: string | null) => void;
|
|
|
+ onBgColorChange: (color: string) => void;
|
|
|
+ onInputsChange: (inputs: Array<{ id: number; value: string }>) => void;
|
|
|
}
|
|
|
|
|
|
interface InputItem {
|
|
|
@@ -30,6 +37,8 @@ interface InputItem {
|
|
|
|
|
|
const Step1Basic: React.FC<Step1BasicProps> = (props) => {
|
|
|
const {
|
|
|
+ open,
|
|
|
+ onClose,
|
|
|
form,
|
|
|
appTypeList,
|
|
|
appVisibleList,
|
|
|
@@ -38,19 +47,21 @@ const Step1Basic: React.FC<Step1BasicProps> = (props) => {
|
|
|
visibleFlag,
|
|
|
vipList,
|
|
|
userInfo,
|
|
|
+ inputs,
|
|
|
+ selectedIcon,
|
|
|
+ previewBg,
|
|
|
onAppChange,
|
|
|
onVisibleChange,
|
|
|
- onAddVip,
|
|
|
onRemoveVip,
|
|
|
+ onVipConfirm,
|
|
|
onNext,
|
|
|
- onBack,
|
|
|
+ onIconChange,
|
|
|
+ onBgColorChange,
|
|
|
+ onInputsChange,
|
|
|
} = props;
|
|
|
|
|
|
- const [inputs, setInputs] = React.useState<InputItem[]>([{ id: 1, value: '' }]);
|
|
|
const [iconPickerVisible, setIconPickerVisible] = React.useState(false);
|
|
|
const [vipSelectorVisible, setVipSelectorVisible] = React.useState(false);
|
|
|
- const [selectedIcon, setSelectedIcon] = React.useState<string | null>(null);
|
|
|
- const [previewBg, setPreviewBg] = React.useState<string>('#005D80');
|
|
|
|
|
|
const getContrastColor = (hex: string) => {
|
|
|
const c = hex.replace('#', '');
|
|
|
@@ -66,7 +77,7 @@ const Step1Basic: React.FC<Step1BasicProps> = (props) => {
|
|
|
|
|
|
const addInput = () => {
|
|
|
const newId = inputs.length + 1;
|
|
|
- setInputs([...inputs, { id: newId, value: '' }]);
|
|
|
+ onInputsChange([...inputs, { id: newId, value: '' }]);
|
|
|
};
|
|
|
|
|
|
const delInput = (id: number) => {
|
|
|
@@ -74,197 +85,309 @@ const Step1Basic: React.FC<Step1BasicProps> = (props) => {
|
|
|
message.warning("至少保留 1 个预设问题");
|
|
|
return;
|
|
|
}
|
|
|
- setInputs(inputs.filter(input => input.id !== id));
|
|
|
+ onInputsChange(inputs.filter(input => input.id !== id));
|
|
|
};
|
|
|
|
|
|
const handleChange = (id: number, value: string) => {
|
|
|
- setInputs(inputs.map(input => (input.id === id ? { ...input, value } : input)));
|
|
|
- form.setFieldValue('questionList', inputs.map(input => input.value));
|
|
|
+ const newInputs = inputs.map(input => (input.id === id ? { ...input, value } : input));
|
|
|
+ onInputsChange(newInputs);
|
|
|
+ form.setFieldValue('questionList', newInputs.map(input => input.value));
|
|
|
};
|
|
|
|
|
|
- const handleNext = () => {
|
|
|
- form.validateFields(['name', 'desc', 'appProId', 'iconType']).then((values) => {
|
|
|
+ const handleNext = async () => {
|
|
|
+ try {
|
|
|
+ const values = await form.validateFields(['name', 'desc', 'appProId', 'iconType']);
|
|
|
form.setFieldValue('questionList', inputs.map(input => input.value));
|
|
|
onNext();
|
|
|
- }).catch((error) => {
|
|
|
- console.error(error);
|
|
|
- });
|
|
|
+ } catch (error) {
|
|
|
+ console.error('验证失败:', error);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
return (
|
|
|
- <div className='create-step1'>
|
|
|
- <Form.Item
|
|
|
- label='请选择应用图标'
|
|
|
- tooltip='用于在应用广场展示'
|
|
|
- name='iconType'
|
|
|
- rules={[{ required: true, message: '请选择图标' }]}
|
|
|
+ <>
|
|
|
+ <Drawer
|
|
|
+ title="创建 RAG 应用"
|
|
|
+ placement="right"
|
|
|
+ width={720}
|
|
|
+ open={open}
|
|
|
+ onClose={onClose}
|
|
|
+ className='rag-drawer'
|
|
|
+ destroyOnClose
|
|
|
+ footer={
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'flex-end', gap: '8px' }}>
|
|
|
+ <Button onClick={onClose}>取消</Button>
|
|
|
+ <Button type="primary" onClick={handleNext}>下一步</Button>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
>
|
|
|
- <div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
|
|
|
- <div style={{ width: 84, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
- <div style={{
|
|
|
- width: 64,
|
|
|
- height: 64,
|
|
|
- borderRadius: 8,
|
|
|
- display: 'flex',
|
|
|
- alignItems: 'center',
|
|
|
- justifyContent: 'center',
|
|
|
- background: previewBg,
|
|
|
- border: '1px solid #e8e8e8'
|
|
|
- }}>
|
|
|
- {selectedIcon ? (() => {
|
|
|
- const C = (AllIcons as any)[selectedIcon];
|
|
|
- const iconColor = getContrastColor(previewBg);
|
|
|
- return C ? <C style={{ fontSize: 28, color: iconColor }} /> : <span style={{ fontSize: 12 }}>{selectedIcon}</span>;
|
|
|
- })() : <span style={{ color: '#999', fontSize: 12 }}>预览</span>}
|
|
|
+ <div className='drawer-form-container'>
|
|
|
+ {/* 图标选择区域 */}
|
|
|
+ <div className='icon-select-section'>
|
|
|
+ <div className='icon-preview-wrapper'>
|
|
|
+ <div
|
|
|
+ className='icon-preview-box'
|
|
|
+ style={{ background: previewBg }}
|
|
|
+ >
|
|
|
+ {selectedIcon ? (() => {
|
|
|
+ const C = (AllIcons as any)[selectedIcon];
|
|
|
+ const iconColor = getContrastColor(previewBg);
|
|
|
+ return C ? <C style={{ fontSize: 28, color: iconColor }} /> : <span>{selectedIcon}</span>;
|
|
|
+ })() : (
|
|
|
+ <span className='icon-preview-placeholder'>预览</span>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
|
|
|
- <a onClick={() => setIconPickerVisible(true)} style={{ fontSize: 13, color: '#1677ff', cursor: 'pointer' }}>
|
|
|
- 选择图标
|
|
|
- </a>
|
|
|
- <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
|
|
- <div style={{ fontSize: 12, color: '#666' }}>背景色:</div>
|
|
|
- <ColorPicker
|
|
|
- presets={presetItems}
|
|
|
- value={previewBg}
|
|
|
- onChange={(color) => {
|
|
|
- const hex = color.toHexString?.() || color?.toString?.() || previewBg;
|
|
|
- setPreviewBg(hex);
|
|
|
- form.setFieldValue('iconColor', hex);
|
|
|
- }}
|
|
|
- />
|
|
|
+ <div className='icon-actions'>
|
|
|
+ <Button type="link" onClick={() => setIconPickerVisible(true)}>
|
|
|
+ 选择图标
|
|
|
+ </Button>
|
|
|
+ <Space size="small">
|
|
|
+ <span className='color-label'>背景色:</span>
|
|
|
+ <ColorPicker
|
|
|
+ presets={presetItems}
|
|
|
+ value={previewBg}
|
|
|
+ onChange={(color) => {
|
|
|
+ const hex = color.toHexString?.() || color?.toString?.() || previewBg;
|
|
|
+ onBgColorChange(hex);
|
|
|
+ form.setFieldValue('iconColor', hex);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </Space>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </Form.Item>
|
|
|
|
|
|
- <Form.Item
|
|
|
- label='问答应用名称'
|
|
|
- tooltip='尽量概括应用的主要功能'
|
|
|
- name='name'
|
|
|
- rules={[{ required: true, message: '问答应用名称不能为空' }]}
|
|
|
- >
|
|
|
- <Input placeholder="请输入问答应用名称" className='form-input' />
|
|
|
- </Form.Item>
|
|
|
+ <Divider className='section-divider'>基础设置</Divider>
|
|
|
|
|
|
- <Form.Item
|
|
|
- label='应用类型'
|
|
|
- tooltip='应用的实际分类'
|
|
|
- name='typeId'
|
|
|
- >
|
|
|
- <Select
|
|
|
- className='form-input'
|
|
|
- placeholder='请选择问答应用类型'
|
|
|
- onChange={onAppChange}
|
|
|
- allowClear
|
|
|
- >
|
|
|
- {appTypeList.map((item) => (
|
|
|
- <Select.Option key={item.value} value={item.value}>
|
|
|
- {item.label}
|
|
|
- </Select.Option>
|
|
|
- ))}
|
|
|
- </Select>
|
|
|
- </Form.Item>
|
|
|
+ <div className='form-section'>
|
|
|
+ <Form.Item
|
|
|
+ shouldUpdate
|
|
|
+ children={() => {
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <Form.Item
|
|
|
+ label={
|
|
|
+ <span>
|
|
|
+ 应用名称
|
|
|
+ <Tooltip title="尽量概括应用的主要功能">
|
|
|
+ <InfoCircleOutlined style={{ marginLeft: 4, color: '#999' }} />
|
|
|
+ </Tooltip>
|
|
|
+ </span>
|
|
|
+ }
|
|
|
+ name='name'
|
|
|
+ rules={[{ required: true, message: '请输入应用名称' }]}
|
|
|
+ >
|
|
|
+ <Input placeholder="请输入应用名称" maxLength={50} showCount />
|
|
|
+ </Form.Item>
|
|
|
|
|
|
- {isAppPro && (
|
|
|
- <Form.Item
|
|
|
- label='项目'
|
|
|
- tooltip='应用所属项目'
|
|
|
- name='appProId'
|
|
|
- rules={[{ required: true, message: '项目不能为空' }]}
|
|
|
- >
|
|
|
- <Cascader
|
|
|
- options={appProjectList}
|
|
|
- placeholder="请选择项目"
|
|
|
- showSearch
|
|
|
- className='form-input'
|
|
|
- />
|
|
|
- </Form.Item>
|
|
|
- )}
|
|
|
+ <Form.Item
|
|
|
+ label={
|
|
|
+ <span>
|
|
|
+ 应用类型
|
|
|
+ <Tooltip title="应用的实际分类">
|
|
|
+ <InfoCircleOutlined style={{ marginLeft: 4, color: '#999' }} />
|
|
|
+ </Tooltip>
|
|
|
+ </span>
|
|
|
+ }
|
|
|
+ name='typeId'
|
|
|
+ >
|
|
|
+ <Select placeholder='请选择应用类型' allowClear>
|
|
|
+ {appTypeList.map((item) => (
|
|
|
+ <Select.Option key={item.value} value={item.value}>
|
|
|
+ {item.label}
|
|
|
+ </Select.Option>
|
|
|
+ ))}
|
|
|
+ </Select>
|
|
|
+ </Form.Item>
|
|
|
|
|
|
- <Form.Item
|
|
|
- label='是否公开'
|
|
|
- tooltip='公开应用后,所有用户均可使用该应用,私有应用仅限自己和指定用户使用'
|
|
|
- name='visible'
|
|
|
- >
|
|
|
- <Select
|
|
|
- className='form-input'
|
|
|
- placeholder='请选择是否公开'
|
|
|
- allowClear
|
|
|
- onChange={(value) => {
|
|
|
- onVisibleChange(value);
|
|
|
- }}
|
|
|
- >
|
|
|
- {appVisibleList.map((item) => (
|
|
|
- <Select.Option key={item.value} value={item.value}>
|
|
|
- {item.label}
|
|
|
- </Select.Option>
|
|
|
- ))}
|
|
|
- </Select>
|
|
|
- </Form.Item>
|
|
|
+ {isAppPro && (
|
|
|
+ <Form.Item
|
|
|
+ label={
|
|
|
+ <span>
|
|
|
+ 所属项目
|
|
|
+ <Tooltip title="应用所属的项目">
|
|
|
+ <InfoCircleOutlined style={{ marginLeft: 4, color: '#999' }} />
|
|
|
+ </Tooltip>
|
|
|
+ </span>
|
|
|
+ }
|
|
|
+ name='appProId'
|
|
|
+ rules={[{ required: true, message: '请选择项目' }]}
|
|
|
+ >
|
|
|
+ <Cascader
|
|
|
+ options={appProjectList}
|
|
|
+ placeholder="请选择项目"
|
|
|
+ showSearch
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ )}
|
|
|
|
|
|
- {userInfo?.tenantId === '000000' && (visibleFlag === '0' || visibleFlag === 0) && (
|
|
|
- <Form.Item
|
|
|
- label='集团公开'
|
|
|
- tooltip='集团下所有用户均可使用该应用'
|
|
|
- name='groupVisible'
|
|
|
- layout='horizontal'
|
|
|
- valuePropName='checked'
|
|
|
- >
|
|
|
- <Select />
|
|
|
- </Form.Item>
|
|
|
- )}
|
|
|
+ <Form.Item
|
|
|
+ label={
|
|
|
+ <span>
|
|
|
+ 可见性
|
|
|
+ <Tooltip title="公开应用后,所有用户均可使用;私有应用仅限自己和指定用户使用">
|
|
|
+ <InfoCircleOutlined style={{ marginLeft: 4, color: '#999' }} />
|
|
|
+ </Tooltip>
|
|
|
+ </span>
|
|
|
+ }
|
|
|
+ name='visible'
|
|
|
+ >
|
|
|
+ <Select
|
|
|
+ placeholder='请选择是否公开'
|
|
|
+ allowClear
|
|
|
+ onChange={(value) => {
|
|
|
+ onVisibleChange(value);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {appVisibleList.map((item) => (
|
|
|
+ <Select.Option key={item.value} value={item.value}>
|
|
|
+ {item.label}
|
|
|
+ </Select.Option>
|
|
|
+ ))}
|
|
|
+ </Select>
|
|
|
+ </Form.Item>
|
|
|
|
|
|
- <Form.Item
|
|
|
- label='显示顺序'
|
|
|
- name='sort'
|
|
|
- tooltip='用于应用广场的显示顺序'
|
|
|
- >
|
|
|
- <InputNumber placeholder="请输入显示顺序" className='form-input' style={{ height: '36px' }} />
|
|
|
- </Form.Item>
|
|
|
+ {userInfo?.tenantId === '000000' && (visibleFlag === '0' || visibleFlag === 0) && (
|
|
|
+ <Form.Item
|
|
|
+ label={
|
|
|
+ <span>
|
|
|
+ 集团公开
|
|
|
+ <Tooltip title="集团下所有用户均可使用该应用">
|
|
|
+ <InfoCircleOutlined style={{ marginLeft: 4, color: '#999' }} />
|
|
|
+ </Tooltip>
|
|
|
+ </span>
|
|
|
+ }
|
|
|
+ name='groupVisible'
|
|
|
+ valuePropName='checked'
|
|
|
+ >
|
|
|
+ <Switch />
|
|
|
+ </Form.Item>
|
|
|
+ )}
|
|
|
|
|
|
- {(visibleFlag === '1' || visibleFlag === 1) && (
|
|
|
- <Form.Item
|
|
|
- label='指定用户'
|
|
|
- tooltip='私有应用的指定用户'
|
|
|
- >
|
|
|
- <div className='tags-info'>
|
|
|
- <div className='tags-list'>
|
|
|
- {vipList.map((item: any) => (
|
|
|
- <Tag
|
|
|
- key={item.userId}
|
|
|
- color="blue"
|
|
|
- closable
|
|
|
- onClose={(e) => {
|
|
|
- e?.preventDefault();
|
|
|
- onRemoveVip(item.userId);
|
|
|
- }}
|
|
|
+ <Form.Item
|
|
|
+ label={
|
|
|
+ <span>
|
|
|
+ 显示顺序
|
|
|
+ <Tooltip title="用于应用广场的显示顺序">
|
|
|
+ <InfoCircleOutlined style={{ marginLeft: 4, color: '#999' }} />
|
|
|
+ </Tooltip>
|
|
|
+ </span>
|
|
|
+ }
|
|
|
+ name='sort'
|
|
|
+ >
|
|
|
+ <InputNumber placeholder="请输入显示顺序" style={{ width: '100%' }} />
|
|
|
+ </Form.Item>
|
|
|
+
|
|
|
+ {(visibleFlag === '1' || visibleFlag === 1) && (
|
|
|
+ <Form.Item
|
|
|
+ label={
|
|
|
+ <span>
|
|
|
+ 指定用户
|
|
|
+ <Tooltip title="私有应用的指定用户">
|
|
|
+ <InfoCircleOutlined style={{ marginLeft: 4, color: '#999' }} />
|
|
|
+ </Tooltip>
|
|
|
+ </span>
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <div className='tags-info'>
|
|
|
+ <div className='tags-list'>
|
|
|
+ {vipList.map((item: any) => (
|
|
|
+ <Tag
|
|
|
+ key={item.userId}
|
|
|
+ color="blue"
|
|
|
+ closable
|
|
|
+ onClose={(e) => {
|
|
|
+ e?.preventDefault();
|
|
|
+ onRemoveVip(item.userId);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {item.userName}
|
|
|
+ </Tag>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ <Space>
|
|
|
+ {vipList.length > 0 && (
|
|
|
+ <CloseCircleOutlined
|
|
|
+ className='clear-all'
|
|
|
+ onClick={() => onRemoveVip('all')}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ <Button type="primary" variant="outlined" onClick={() => setVipSelectorVisible(true)}>
|
|
|
+ 选择用户
|
|
|
+ </Button>
|
|
|
+ </Space>
|
|
|
+ </div>
|
|
|
+ </Form.Item>
|
|
|
+ )}
|
|
|
+
|
|
|
+ <Form.Item
|
|
|
+ label={
|
|
|
+ <span>
|
|
|
+ 应用描述
|
|
|
+ <Tooltip title="简要介绍应用的主要功能和特点">
|
|
|
+ <InfoCircleOutlined style={{ marginLeft: 4, color: '#999' }} />
|
|
|
+ </Tooltip>
|
|
|
+ </span>
|
|
|
+ }
|
|
|
+ name='desc'
|
|
|
+ rules={[{ required: true, message: '请输入应用描述' }]}
|
|
|
+ >
|
|
|
+ <Input.TextArea
|
|
|
+ showCount
|
|
|
+ maxLength={500}
|
|
|
+ placeholder="请输入应用描述"
|
|
|
+ rows={3}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </>
|
|
|
+ );
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <Divider className='section-divider'>引导问题</Divider>
|
|
|
+
|
|
|
+ <div className='preset-questions'>
|
|
|
+ <div className='questions-list'>
|
|
|
+ {inputs.map((input, index) => (
|
|
|
+ <Form.Item
|
|
|
+ key={input.id}
|
|
|
+ label={`问题 ${index + 1}`}
|
|
|
+ required={false}
|
|
|
+ className='question-form-item'
|
|
|
>
|
|
|
- {item.userName}
|
|
|
- </Tag>
|
|
|
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
|
+ <Input
|
|
|
+ className='question-input'
|
|
|
+ type="text"
|
|
|
+ value={input.value}
|
|
|
+ onChange={e => handleChange(input.id, e.target.value)}
|
|
|
+ placeholder="请输入引导问题"
|
|
|
+ />
|
|
|
+ <div className='question-actions'>
|
|
|
+ {index === 0 ? (
|
|
|
+ <PlusCircleOutlined className='question-icon add' onClick={addInput} />
|
|
|
+ ) : (
|
|
|
+ <>
|
|
|
+ <PlusCircleOutlined className='question-icon add' onClick={addInput} />
|
|
|
+ <MinusCircleOutlined className='question-icon del' onClick={() => delInput(input.id)} />
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Form.Item>
|
|
|
))}
|
|
|
</div>
|
|
|
- <Space>
|
|
|
- {vipList.length > 0 && (
|
|
|
- <CloseCircleOutlined
|
|
|
- className='cup'
|
|
|
- onClick={() => onRemoveVip('all')}
|
|
|
- />
|
|
|
- )}
|
|
|
- <Button type="primary" variant="outlined" onClick={() => setVipSelectorVisible(true)}>
|
|
|
- 选择
|
|
|
- </Button>
|
|
|
- </Space>
|
|
|
</div>
|
|
|
- </Form.Item>
|
|
|
- )}
|
|
|
+ </div>
|
|
|
+ </Drawer>
|
|
|
|
|
|
{/* IconPicker 弹窗 */}
|
|
|
<IconPicker
|
|
|
open={iconPickerVisible}
|
|
|
onClose={() => setIconPickerVisible(false)}
|
|
|
onSelect={(iconName) => {
|
|
|
- setSelectedIcon(iconName);
|
|
|
+ onIconChange(iconName);
|
|
|
form.setFieldValue('iconType', iconName);
|
|
|
}}
|
|
|
value={selectedIcon}
|
|
|
@@ -275,56 +398,12 @@ const Step1Basic: React.FC<Step1BasicProps> = (props) => {
|
|
|
open={vipSelectorVisible}
|
|
|
onClose={() => setVipSelectorVisible(false)}
|
|
|
onConfirm={(users) => {
|
|
|
- props.onVipConfirm(users);
|
|
|
+ onVipConfirm(users);
|
|
|
setVipSelectorVisible(false);
|
|
|
}}
|
|
|
existingUsers={vipList}
|
|
|
/>
|
|
|
-
|
|
|
- <Form.Item
|
|
|
- label='问答应用描述'
|
|
|
- tooltip='对当前应用功能的描述使用户更了解应用的使用范围'
|
|
|
- name='desc'
|
|
|
- rules={[{ required: true, message: '问答应用描述不能为空' }]}
|
|
|
- >
|
|
|
- <Input.TextArea
|
|
|
- showCount
|
|
|
- maxLength={500}
|
|
|
- placeholder="请输入当前应用的描述"
|
|
|
- className='form-textarea'
|
|
|
- />
|
|
|
- </Form.Item>
|
|
|
-
|
|
|
- <div className='preset-questions'>
|
|
|
- <h4>添加引导问题</h4>
|
|
|
- <div>
|
|
|
- {inputs.map(input => (
|
|
|
- <div key={input.id} className='question-item'>
|
|
|
- <label>引导问题 {input.id}</label>
|
|
|
- <Input
|
|
|
- className='question-input'
|
|
|
- type="text"
|
|
|
- value={input.value}
|
|
|
- onChange={e => handleChange(input.id, e.target.value)}
|
|
|
- />
|
|
|
- <div className='question-actions'>
|
|
|
- <PlusCircleOutlined className='question-icon' onClick={addInput} />
|
|
|
- <MinusCircleOutlined className='question-icon' onClick={() => delInput(input.id)} />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- ))}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div className='step-actions'>
|
|
|
- <Button onClick={onBack}>
|
|
|
- 返回
|
|
|
- </Button>
|
|
|
- <Button type='primary' onClick={handleNext}>
|
|
|
- 下一步
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </>
|
|
|
);
|
|
|
};
|
|
|
|