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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { userFacingText } from '../../../lib/user-facing-text'
|
||||
import { NCheckbox, NFormItem, NInput, NInputNumber, NSelect } from 'naive-ui'
|
||||
import FieldLabel from '../../../components/ui/FieldLabel.vue'
|
||||
import type { GenerationOptionSchema, GenerationOptions } from '../types'
|
||||
@@ -26,10 +27,15 @@ function selectValue(value: string | number | boolean | undefined) {
|
||||
return typeof value === 'string' || typeof value === 'number' ? value : null
|
||||
}
|
||||
|
||||
/**
|
||||
* 只翻译参数选项名称,模型要求的取值保持不变。
|
||||
* @param schema 当前模型的参数定义
|
||||
* @returns 可显示的中文选项及原始取值
|
||||
*/
|
||||
function selectOptions(schema: GenerationOptionSchema) {
|
||||
return [...(schema.options || []), ...(schema.specialValues || [])].flatMap(option =>
|
||||
typeof option.value === 'string' || typeof option.value === 'number'
|
||||
? [{ label: option.label, value: option.value }]
|
||||
? [{ label: userFacingText(option.label, option.label), value: option.value }]
|
||||
: []
|
||||
)
|
||||
}
|
||||
@@ -42,7 +48,12 @@ function optionKey(value: string | number) {
|
||||
return `${typeof value}:${value}`
|
||||
}
|
||||
|
||||
/** 尺寸和时长使用有限选项,避免用户输入 Provider 不支持的自由值。 */
|
||||
/**
|
||||
* 尺寸和时长使用模型支持的有限选项,只转换展示文字。
|
||||
* @param schema 当前模型参数定义
|
||||
* @param current 当前已保存取值
|
||||
* @returns 保留原始值且去重的可选项
|
||||
*/
|
||||
function constrainedOptions(schema: GenerationOptionSchema, current: string | number | boolean | undefined) {
|
||||
const options = selectOptions(schema)
|
||||
if (schema.type === 'size') {
|
||||
@@ -59,10 +70,10 @@ function constrainedOptions(schema: GenerationOptionSchema, current: string | nu
|
||||
}
|
||||
}
|
||||
if (typeof schema.providerDefault === 'string' || typeof schema.providerDefault === 'number') {
|
||||
options.push({ label: String(schema.providerDefault), value: schema.providerDefault })
|
||||
options.push({ label: userFacingText(String(schema.providerDefault), String(schema.providerDefault)), value: schema.providerDefault })
|
||||
}
|
||||
if (typeof current === 'string' || typeof current === 'number') {
|
||||
options.push({ label: String(current), value: current })
|
||||
options.push({ label: userFacingText(String(current), String(current)), value: current })
|
||||
}
|
||||
const seen = new Set<string>()
|
||||
return options.filter(option => {
|
||||
@@ -79,14 +90,14 @@ function constrainedOptions(schema: GenerationOptionSchema, current: string | nu
|
||||
<NFormItem
|
||||
v-for="schema in schemas"
|
||||
:key="schema.key"
|
||||
:label="`${schema.label}${schema.required ? ' *' : ''}`"
|
||||
:label="`${userFacingText(schema.label, schema.label)}${schema.required ? ' *' : ''}`"
|
||||
:show-feedback="false"
|
||||
>
|
||||
<!-- 以下是参数标签与按需说明模块 -->
|
||||
<template #label>
|
||||
<FieldLabel
|
||||
:label="`${schema.label}${schema.required ? ' *' : ''}`"
|
||||
:description="schema.description"
|
||||
:label="`${userFacingText(schema.label, schema.label)}${schema.required ? ' *' : ''}`"
|
||||
:description="userFacingText(schema.description)"
|
||||
/>
|
||||
</template>
|
||||
<NCheckbox
|
||||
@@ -118,7 +129,7 @@ function constrainedOptions(schema: GenerationOptionSchema, current: string | nu
|
||||
v-else
|
||||
:value="typeof modelValue[schema.key] === 'string' ? (modelValue[schema.key] as string) : ''"
|
||||
:disabled="disabled"
|
||||
placeholder="例如 2048x2048 或 auto"
|
||||
placeholder="例如 2048x2048;也可使用当前模型的默认值"
|
||||
clearable
|
||||
@update:value="update(modelValue, schema.key, $event)"
|
||||
/>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { NCollapse, NCollapseItem } from 'naive-ui'
|
||||
import type { ProjectQualityPolicy } from '../../projects/types'
|
||||
import { actionResourceOptions } from '../../projects/quality-policy'
|
||||
|
||||
/** 已有例外仅供核对,基础配置不再创建没有镜头依据的空白行。 */
|
||||
defineProps<{
|
||||
/** 服务端实际保存的完整例外。 */
|
||||
exceptions: NonNullable<ProjectQualityPolicy['actionExceptions']>
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是已有动作例外的只读核对模块,新增入口统一放在拆解问题修订中 -->
|
||||
<NCollapse v-if="exceptions.length" class="quality-policy-exceptions">
|
||||
<NCollapseItem name="existing" :title="`已有动作例外 · ${exceptions.length} 项`">
|
||||
<p class="text-xs leading-6 text-muted">这些例外会继续保留。新增例外请在拆解后的具体动作问题中填写。</p>
|
||||
<ul class="mt-3 space-y-3">
|
||||
<li v-for="(item, index) in exceptions" :key="index" class="space-y-1 break-words text-sm">
|
||||
<p>{{ item.ownerRef }} · {{ actionResourceOptions.find(option => option.value === item.resource)?.label || item.resource }}</p>
|
||||
<p class="text-xs leading-6 text-muted">{{ item.reason }}</p>
|
||||
</li>
|
||||
</ul>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
</template>
|
||||
@@ -1,12 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { computed, h, onScopeDispose, ref, watch } from 'vue'
|
||||
import { NButton, NCheckbox, NFormItem, NInput, NSelect } from 'naive-ui'
|
||||
import { Trash2 } from '@lucide/vue'
|
||||
import type { SelectRenderLabel, SelectRenderTag } from 'naive-ui'
|
||||
import { projectsApi } from '../../projects/api'
|
||||
import { actionResourceOptions, policyDraft, policyIssue } from '../../projects/quality-policy'
|
||||
import type { ProjectQualityPolicy } from '../../projects/types'
|
||||
import { policyDraft, policyIssue } from '../../projects/quality-policy'
|
||||
import type { ProjectQualityPolicy, ProjectQualityPolicyResult } from '../../projects/types'
|
||||
import { invalidateQualityPolicyConfirmation, qualityPolicySignature } from '../../projects/quality-policy-confirmation'
|
||||
import { errorMessage } from '../../../lib/http'
|
||||
import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHeading.vue'
|
||||
import QualityPolicyExceptions from './QualityPolicyExceptions.vue'
|
||||
|
||||
/** 项目质量策略独立编辑表单。 */
|
||||
const props = defineProps<{
|
||||
@@ -14,6 +16,8 @@ const props = defineProps<{
|
||||
projectId: string
|
||||
/** 项目有活动操作时禁止保存。 */
|
||||
disabled: boolean
|
||||
/** 启动入口已经读取的真实回执,复用时不重复请求或使用默认值。 */
|
||||
initialPolicy?: ProjectQualityPolicyResult
|
||||
}>()
|
||||
/** 保存状态交给弹窗锁定关闭与标签切换。 */
|
||||
const emit = defineEmits<{ busy: [value: boolean]; saved: [] }>()
|
||||
@@ -27,11 +31,50 @@ const error = ref('')
|
||||
const notice = ref('')
|
||||
/** 服务端策略的独立草稿。 */
|
||||
const policy = ref<ProjectQualityPolicy | null>(null)
|
||||
/** 模式选择不自动修改允许范围。 */
|
||||
/** 已保存内容用于区分真实规则变更与无变化保存。 */
|
||||
let savedSignature = ''
|
||||
/** 基础规则的原始内容,用于阻止覆盖其他入口并发修改的通用规则。 */
|
||||
let savedGeneralSignature = ''
|
||||
/** 整体表现方式及通俗示例,仅说明含义,不自动修改动作许可。 */
|
||||
const physicsOptions = [
|
||||
{ value: 'realistic', label: '写实物理' },
|
||||
{ value: 'stylized', label: '风格化表现' },
|
||||
{ value: 'fantasy', label: '幻想表现' }
|
||||
{ value: 'realistic', label: '写实物理', description: '按现实生活中的规律设计动作,例如跳起需要借力,物品失去支撑会落下。' },
|
||||
{ value: 'stylized', label: '风格化表现', description: '适合卡通、喜剧,让动作更有戏剧感;具体允许哪些夸张动作,还需在下方勾选。' },
|
||||
{ value: 'fantasy', label: '幻想表现', description: '适合仙侠、魔法等故事,按故事设定设计动作;飞行、法术等能力仍需在下方明确允许。' }
|
||||
]
|
||||
/** 当前选择的说明始终显示,关闭下拉菜单后也能了解含义。 */
|
||||
const physicsDescription = computed(() => physicsOptions.find(option => option.value === policy.value?.physicsMode)?.description ?? '')
|
||||
|
||||
/**
|
||||
* 下拉选项同时展示名称与说明,窄屏可自然换行。
|
||||
* @param option Naive UI 提供的当前选项
|
||||
* @returns 包含通俗说明的选项内容
|
||||
*/
|
||||
const renderPhysicsLabel: SelectRenderLabel = option => h('div', { class: 'grid min-w-0 gap-1 py-1 whitespace-normal' }, [
|
||||
h('span', { class: 'text-sm leading-6' }, String(option.label ?? '')),
|
||||
h('span', { class: 'text-xs leading-5 text-muted' }, String(option.description ?? ''))
|
||||
])
|
||||
|
||||
/**
|
||||
* 选择框只显示简短名称,完整说明放在控件下方,避免撑高或截断控件。
|
||||
* @param info 当前选择的信息
|
||||
* @returns 当前表现方式的名称
|
||||
*/
|
||||
const renderPhysicsSelection: SelectRenderTag = info => String(info.option.label ?? '')
|
||||
|
||||
/** 动作许可选项共用同一种标题与说明布局,字段仍映射原有后端契约。 */
|
||||
interface MotionPermissionOption {
|
||||
/** 对应规则中的独立布尔字段。 */
|
||||
field: 'allowExaggeratedMotion' | 'allowNonPhysicalActions' | 'allowSupernaturalAbilities'
|
||||
/** 用户可见的动作许可名称。 */
|
||||
label: string
|
||||
/** 使用日常语言说明允许范围与例子。 */
|
||||
description: string
|
||||
}
|
||||
/** 三类许可的区别直接展示,不依赖悬停或术语理解。 */
|
||||
const motionPermissions: MotionPermissionOption[] = [
|
||||
{ field: 'allowExaggeratedMotion', label: '允许夸张动作', description: '把正常动作做得更夸张,例如惊讶时大幅后仰、跑步时摆臂更大;不等于允许悬空或法术。' },
|
||||
{ field: 'allowNonPhysicalActions', label: '允许非物理动作', description: '允许现实中做不到的动作,例如身体像橡皮一样拉长、没有支撑也能悬空。' },
|
||||
{ field: 'allowSupernaturalAbilities', label: '允许超自然能力', description: '允许角色使用法术或特殊能力,例如瞬间移动、隔空移动物品、凭空变出火焰。' }
|
||||
]
|
||||
/** 仅在用户点击保存时产生校验反馈,不在读取或新增空白例外时提前报错。 */
|
||||
const issue = ref('')
|
||||
@@ -72,9 +115,11 @@ async function load() {
|
||||
notice.value = ''
|
||||
issue.value = ''
|
||||
try {
|
||||
const result = await projectsApi.qualityPolicy(id, controller.signal)
|
||||
const result = props.initialPolicy ?? await projectsApi.qualityPolicy(id, controller.signal)
|
||||
if (current !== version) return
|
||||
if (result.projectId !== id) throw new Error('质量策略所属项目不一致,请重新读取。')
|
||||
savedSignature = qualityPolicySignature(result.policy)
|
||||
savedGeneralSignature = qualityPolicySignature({ ...result.policy, actionExceptions: [] })
|
||||
policy.value = policyDraft(result.policy)
|
||||
rulesText.value = policy.value.customRules.join('\n')
|
||||
} catch (cause) {
|
||||
@@ -84,37 +129,46 @@ async function load() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 新增一项精确例外,必须填写主体和依据后才可保存。 */
|
||||
function addException() {
|
||||
if (!policy.value || props.disabled || saving.value) return
|
||||
const items = (policy.value.actionExceptions ??= [])
|
||||
if (items.length < 30)
|
||||
items.push({ code: 'action_resource_conflict', ownerRef: '', resource: 'left_hand', reason: '' })
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除当前草稿中的精确例外,保存前不改变后端。
|
||||
* @param index 例外在草稿中的位置
|
||||
* 在用户明确提交时校验并返回独立草稿,不提前显示错误。
|
||||
* @returns 完整草稿,未就绪或校验失败时为空
|
||||
*/
|
||||
function removeException(index: number) {
|
||||
policy.value?.actionExceptions?.splice(index, 1)
|
||||
function validatedDraft(): ProjectQualityPolicy | null {
|
||||
if (!canSave.value || !policy.value) return null
|
||||
issue.value = policyIssue(policy.value)
|
||||
return issue.value ? null : policyDraft(policy.value)
|
||||
}
|
||||
|
||||
/** 点击保存时校验完整策略,通过后再提交并核对项目归属。 */
|
||||
async function save() {
|
||||
if (!canSave.value || !policy.value) return
|
||||
issue.value = policyIssue(policy.value)
|
||||
if (issue.value) return
|
||||
const input = validatedDraft()
|
||||
if (!input) return
|
||||
const id = props.projectId
|
||||
const current = version
|
||||
const input = policyDraft(policy.value)
|
||||
saving.value = true
|
||||
loading.value = true
|
||||
controller?.abort()
|
||||
controller = new AbortController()
|
||||
error.value = ''
|
||||
notice.value = ''
|
||||
try {
|
||||
const latest = await projectsApi.qualityPolicy(id, controller.signal)
|
||||
if (current !== version || props.disabled) return
|
||||
if (latest.projectId !== id) throw new Error('质量规则所属项目不一致,请重新读取。')
|
||||
qualityPolicySignature(latest.policy)
|
||||
if (qualityPolicySignature({ ...latest.policy, actionExceptions: [] }) !== savedGeneralSignature)
|
||||
throw new Error('质量规则已在其他位置更新,请重新打开配置后再保存。')
|
||||
// 例外由问题修订入口管理,基础配置永远合并服务端最新例外,不提交隐藏的旧副本。
|
||||
if (latest.policy.actionExceptions) input.actionExceptions = latest.policy.actionExceptions.map(item => ({ ...item }))
|
||||
else delete input.actionExceptions
|
||||
loading.value = false
|
||||
saving.value = true
|
||||
const result = await projectsApi.saveQualityPolicy(id, input)
|
||||
if (current !== version) return
|
||||
if (result.projectId !== id) throw new Error('质量策略保存回执所属项目不一致。')
|
||||
const signature = qualityPolicySignature(result.policy)
|
||||
if (signature !== savedSignature) invalidateQualityPolicyConfirmation(id)
|
||||
savedSignature = signature
|
||||
savedGeneralSignature = qualityPolicySignature({ ...result.policy, actionExceptions: [] })
|
||||
policy.value = policyDraft(result.policy)
|
||||
rulesText.value = policy.value.customRules.join('\n')
|
||||
notice.value = '质量策略已保存,后续创作、拆解和生成使用此策略。'
|
||||
@@ -122,7 +176,7 @@ async function save() {
|
||||
} catch (cause) {
|
||||
if (current === version) error.value = errorMessage(cause)
|
||||
} finally {
|
||||
if (current === version) saving.value = false
|
||||
if (current === version) { saving.value = false; loading.value = false }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +187,7 @@ onScopeDispose(() => {
|
||||
controller?.abort()
|
||||
})
|
||||
/** 弹窗底栏复用同一个保存入口。 */
|
||||
defineExpose({ save, canSave })
|
||||
defineExpose({ save, canSave, validatedDraft })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -149,87 +203,47 @@ defineExpose({ save, canSave })
|
||||
<section class="space-y-4" aria-label="动作与物理规则">
|
||||
<WorkspaceSectionHeading
|
||||
title="动作与物理规则"
|
||||
description="选择表现方式后,仍需明确勾选允许的动作范围。保存不会重新生成已有资产。"
|
||||
description="先选整体表现方式,再勾选故事中允许的动作。切换方式不会自动勾选,也不会自动添加剧情或重新生成已有内容。"
|
||||
/>
|
||||
<NFormItem label="物理表现方式" :label-props="{ id: 'quality-physics-mode-label' }">
|
||||
<NSelect
|
||||
v-model:value="policy.physicsMode"
|
||||
aria-labelledby="quality-physics-mode-label"
|
||||
:options="physicsOptions"
|
||||
:disabled="disabled || saving"
|
||||
/>
|
||||
<div class="quality-policy-field">
|
||||
<NSelect
|
||||
v-model:value="policy.physicsMode"
|
||||
aria-labelledby="quality-physics-mode-label"
|
||||
aria-describedby="quality-physics-mode-help"
|
||||
:options="physicsOptions"
|
||||
:render-label="renderPhysicsLabel"
|
||||
:render-tag="renderPhysicsSelection"
|
||||
:virtual-scroll="false"
|
||||
:disabled="disabled || saving"
|
||||
/>
|
||||
<p id="quality-physics-mode-help" class="text-xs leading-6 text-muted">{{ physicsDescription }}</p>
|
||||
</div>
|
||||
</NFormItem>
|
||||
<!-- 以下是动作许可及其日常示例,桌面按列对齐,手机逐项展示 -->
|
||||
<div class="grid gap-4 sm:grid-cols-3">
|
||||
<NCheckbox v-model:checked="policy.allowExaggeratedMotion" :disabled="disabled || saving"
|
||||
>允许夸张动作</NCheckbox
|
||||
>
|
||||
<NCheckbox v-model:checked="policy.allowNonPhysicalActions" :disabled="disabled || saving"
|
||||
>允许非物理动作</NCheckbox
|
||||
>
|
||||
<NCheckbox v-model:checked="policy.allowSupernaturalAbilities" :disabled="disabled || saving"
|
||||
>允许超自然能力</NCheckbox
|
||||
>
|
||||
<div v-for="permission in motionPermissions" :key="permission.field" class="min-w-0 space-y-2">
|
||||
<NCheckbox v-model:checked="policy[permission.field]" :disabled="disabled || saving" :aria-describedby="`quality-${permission.field}-help`">{{ permission.label }}</NCheckbox>
|
||||
<p :id="`quality-${permission.field}-help`" class="pl-6 text-xs leading-6 text-muted">{{ permission.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- 以下是逐行声明的自定义规则模块 -->
|
||||
<NFormItem label="自定义规则" :label-props="{ for: 'quality-custom-rules' }">
|
||||
<NInput
|
||||
v-model:value="rulesText"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 3, maxRows: 8 }"
|
||||
:input-props="{ id: 'quality-custom-rules' }"
|
||||
placeholder="每行一条,最多 30 条;请写明具体允许的例外"
|
||||
:disabled="disabled || saving"
|
||||
/>
|
||||
</NFormItem>
|
||||
<!-- 以下是主体和具体动作资源的精确例外模块 -->
|
||||
<section class="space-y-4" aria-label="精确动作例外">
|
||||
<!-- 以下是与生成配置统一间距的模块标题、说明和操作模块 -->
|
||||
<WorkspaceSectionHeading
|
||||
title="精确动作例外"
|
||||
description="仅对填写的主体与资源放宽动作资源冲突,需记录明确依据。"
|
||||
>
|
||||
<template #actions>
|
||||
<NButton
|
||||
size="small"
|
||||
:disabled="disabled || saving || (policy.actionExceptions?.length ?? 0) >= 30"
|
||||
@click="addException"
|
||||
>添加例外</NButton
|
||||
>
|
||||
</template>
|
||||
</WorkspaceSectionHeading>
|
||||
<div v-for="(item, index) in policy.actionExceptions" :key="index" class="quality-exception-row">
|
||||
<NFormItem label="主体引用"
|
||||
><NInput
|
||||
v-model:value="item.ownerRef"
|
||||
:aria-label="`例外 ${index + 1} 主体引用`"
|
||||
placeholder="填写镜头中的主体引用"
|
||||
:disabled="disabled || saving"
|
||||
/></NFormItem>
|
||||
<NFormItem label="动作资源"
|
||||
><NSelect
|
||||
v-model:value="item.resource"
|
||||
:aria-label="`例外 ${index + 1} 动作资源`"
|
||||
:options="actionResourceOptions"
|
||||
:disabled="disabled || saving"
|
||||
/></NFormItem>
|
||||
<NFormItem label="确认依据"
|
||||
><NInput
|
||||
v-model:value="item.reason"
|
||||
:aria-label="`例外 ${index + 1} 确认依据`"
|
||||
:disabled="disabled || saving"
|
||||
/></NFormItem>
|
||||
<!-- 以下是与输入框底部对齐的图标移除操作,保留明确的可访问名称 -->
|
||||
<NButton
|
||||
class="icon-button quality-exception-remove"
|
||||
:aria-label="`移除例外 ${index + 1}`"
|
||||
title="移除例外"
|
||||
<div class="quality-policy-field">
|
||||
<p id="quality-custom-rules-help" class="text-xs leading-6 text-muted">补充这个故事允许的特殊情况或需要遵守的要求,每行一条,最多 30 条。</p>
|
||||
<NInput
|
||||
v-model:value="rulesText"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 3, maxRows: 8 }"
|
||||
:input-props="{ id: 'quality-custom-rules', 'aria-describedby': 'quality-custom-rules-help' }"
|
||||
placeholder="例如:跳跃可以夸张,但落地后必须恢复正常姿势。"
|
||||
:disabled="disabled || saving"
|
||||
@click="removeException(index)"
|
||||
><Trash2 :size="16" aria-hidden="true"
|
||||
/></NButton>
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
</NFormItem>
|
||||
<!-- 以下是已有例外的只读核对模块,首次拆解没有例外时完全隐藏 -->
|
||||
<QualityPolicyExceptions :exceptions="policy.actionExceptions ?? []" />
|
||||
<p v-if="issue" role="status" class="text-xs leading-6 text-danger">{{ issue }}</p>
|
||||
</template>
|
||||
<p v-if="notice" role="status" class="text-xs leading-6 text-muted">{{ notice }}</p>
|
||||
@@ -242,19 +256,10 @@ defineExpose({ save, canSave })
|
||||
gap: 24px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.quality-exception-row {
|
||||
.quality-policy-field {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(120px, 1fr) minmax(100px, 0.7fr) minmax(160px, 1.5fr) auto;
|
||||
align-items: end;
|
||||
gap: 16px;
|
||||
}
|
||||
.quality-exception-remove {
|
||||
justify-self: end;
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.quality-exception-row {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
gap: 12px;
|
||||
}
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
gap: 8px;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user