fix: access control, voices options
This commit is contained in:
@@ -5,7 +5,6 @@ import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import React, {
|
||||
forwardRef,
|
||||
memo,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useId,
|
||||
@@ -194,4 +193,4 @@ const ParamsSettings: React.FC<ParamsSettingsProps> = forwardRef(
|
||||
}
|
||||
);
|
||||
|
||||
export default memo(ParamsSettings);
|
||||
export default ParamsSettings;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { setRouteCache } from '@/atoms/route-cache';
|
||||
import AlertInfo from '@/components/alert-info';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import AutoComplete from '@/components/seal-form/auto-complete';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import SpeechContent from '@/components/speech-content';
|
||||
import routeCachekey from '@/config/route-cachekey';
|
||||
@@ -274,17 +275,20 @@ const GroundTTS: React.FC<MessageProps> = forwardRef((props, ref) => {
|
||||
|
||||
const renderExtra = useMemo(() => {
|
||||
return paramsConfig.map((item: ParamsSchema) => {
|
||||
const comProps = {
|
||||
...item.attrs,
|
||||
options: item.name === 'voice' ? voiceList : item.options,
|
||||
label: item.label.isLocalized
|
||||
? intl.formatMessage({ id: item.label.text })
|
||||
: item.label.text
|
||||
};
|
||||
return (
|
||||
<Form.Item name={item.name} rules={item.rules} key={item.name}>
|
||||
<SealSelect
|
||||
{...item.attrs}
|
||||
options={item.name === 'voice' ? voiceList : item.options}
|
||||
label={
|
||||
item.label.isLocalized
|
||||
? intl.formatMessage({ id: item.label.text })
|
||||
: item.label.text
|
||||
}
|
||||
></SealSelect>
|
||||
{item.type === 'AutoComplete' ? (
|
||||
<AutoComplete {...comProps} />
|
||||
) : (
|
||||
<SealSelect {...comProps}></SealSelect>
|
||||
)}
|
||||
</Form.Item>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ export const imageSizeOptions: {
|
||||
|
||||
export const TTSParamsConfig: ParamsSchema[] = [
|
||||
{
|
||||
type: 'Select',
|
||||
type: 'AutoComplete',
|
||||
name: 'voice',
|
||||
options: [],
|
||||
label: {
|
||||
@@ -41,7 +41,7 @@ export const TTSParamsConfig: ParamsSchema[] = [
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
required: false,
|
||||
message: 'Voice is required'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -38,13 +38,13 @@ export interface MessageItem {
|
||||
type SchemaType =
|
||||
| 'Input'
|
||||
| 'InputNumber'
|
||||
| 'Textarea'
|
||||
| 'TextArea'
|
||||
| 'Select'
|
||||
| 'Slider'
|
||||
| 'TextArea'
|
||||
| 'Checkbox'
|
||||
| 'Textarea'
|
||||
| 'Switch';
|
||||
| 'Checkbox'
|
||||
| 'Switch'
|
||||
| 'AutoComplete';
|
||||
|
||||
export interface ParamsSchema {
|
||||
type: SchemaType;
|
||||
|
||||
Reference in New Issue
Block a user