feat: 优化 dict
This commit is contained in:
@@ -5,7 +5,7 @@ import { ref } from 'vue';
|
||||
|
||||
import { Form, Input, Select } from 'ant-design-vue';
|
||||
|
||||
import { DICT_TYPE, getIntDictOptions } from '#/utils';
|
||||
import { DICT_TYPE, getDictOptions } from '#/utils';
|
||||
|
||||
// 创建本地数据副本
|
||||
const modelData = defineModel<any>();
|
||||
@@ -57,7 +57,7 @@ defineExpose({ validate });
|
||||
placeholder="请选择状态"
|
||||
>
|
||||
<Select.Option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||
v-for="dict in getDictOptions(DICT_TYPE.COMMON_STATUS, 'number')"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Button, message, Textarea } from 'ant-design-vue';
|
||||
import {
|
||||
AiWriteTypeEnum,
|
||||
DICT_TYPE,
|
||||
getIntDictOptions,
|
||||
getDictOptions,
|
||||
WriteExample,
|
||||
} from '#/utils';
|
||||
|
||||
@@ -211,22 +211,22 @@ function submit() {
|
||||
<ReuseLabel label="长度" />
|
||||
<Tag
|
||||
v-model="formData.length"
|
||||
:tags="getIntDictOptions(DICT_TYPE.AI_WRITE_LENGTH)"
|
||||
:tags="getDictOptions(DICT_TYPE.AI_WRITE_LENGTH, 'number')"
|
||||
/>
|
||||
<ReuseLabel label="格式" />
|
||||
<Tag
|
||||
v-model="formData.format"
|
||||
:tags="getIntDictOptions(DICT_TYPE.AI_WRITE_FORMAT)"
|
||||
:tags="getDictOptions(DICT_TYPE.AI_WRITE_FORMAT, 'number')"
|
||||
/>
|
||||
<ReuseLabel label="语气" />
|
||||
<Tag
|
||||
v-model="formData.tone"
|
||||
:tags="getIntDictOptions(DICT_TYPE.AI_WRITE_TONE)"
|
||||
:tags="getDictOptions(DICT_TYPE.AI_WRITE_TONE, 'number')"
|
||||
/>
|
||||
<ReuseLabel label="语言" />
|
||||
<Tag
|
||||
v-model="formData.language"
|
||||
:tags="getIntDictOptions(DICT_TYPE.AI_WRITE_LANGUAGE)"
|
||||
:tags="getDictOptions(DICT_TYPE.AI_WRITE_LANGUAGE, 'number')"
|
||||
/>
|
||||
|
||||
<div class="mt-3 flex items-center justify-center">
|
||||
|
||||
Reference in New Issue
Block a user