feat(short-drama-agent-front): 完善质量规则确认与中文交互
This commit is contained in:
1 parent
190333d4f9
commit
c4b43b9725
85 files changed
+2059
-480
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { userFacingText } from '../../../lib/user-facing-text'
|
||||
import { computed } from 'vue'
|
||||
import { NFormItem, NInputNumber, NSelect, NSwitch, NTag } from 'naive-ui'
|
||||
import FieldLabel from '../../../components/ui/FieldLabel.vue'
|
||||
@@ -53,10 +54,15 @@ function updateOption(key: string, value: string | number | boolean | null) {
|
||||
emit('update:options', next)
|
||||
}
|
||||
|
||||
/**
|
||||
* 为模型参数生成中文选项,保留真实取值和支持的时长范围。
|
||||
* @param item 当前模型参数
|
||||
* @returns 参数选项
|
||||
*/
|
||||
function choices(item: GenerationModelItem['generationOptions'][number]): SelectOption[] {
|
||||
const options = [...(item.options ?? []), ...(item.specialValues ?? [])]
|
||||
.filter(option => typeof option.value === 'string' || typeof option.value === 'number')
|
||||
.map(option => ({ label: option.label, value: option.value as string | number }))
|
||||
.map(option => ({ label: userFacingText(option.label, option.label), value: option.value as string | number }))
|
||||
if (
|
||||
/duration|时长/i.test(`${item.key} ${item.label}`) &&
|
||||
Number.isInteger(item.min) &&
|
||||
@@ -93,11 +99,11 @@ function selectValue(key: string): string | number | null {
|
||||
v-for="item in model.generationOptions"
|
||||
:key="item.key"
|
||||
class="generation-model-field"
|
||||
:label="item.label"
|
||||
:label="userFacingText(item.label, item.label)"
|
||||
:show-feedback="false"
|
||||
>
|
||||
<!-- 以下是生成参数标签与说明提示模块 -->
|
||||
<template #label><FieldLabel :label="item.label" :description="item.description" /></template>
|
||||
<template #label><FieldLabel :label="userFacingText(item.label, item.label)" :description="userFacingText(item.description)" /></template>
|
||||
<div class="generation-model-field-control">
|
||||
<div v-if="item.type === 'boolean'" class="generation-model-toggle">
|
||||
<NSwitch
|
||||
|
||||
Reference in new issue
Block a user