编辑发起变更获取字段为空判断修改

This commit is contained in:
2026-10-12 09:43:26 +08:00
parent 2756ed15e2
commit 7c5f0dea0b
3 changed files with 5 additions and 5 deletions
@@ -590,8 +590,8 @@ defineExpose({form, questions, applyAiResult, generateLevel: useAiLevel})
<div class="flex flex-1 flex-wrap items-center gap-2 rounded-lg bg-slate-50 px-3 py-2">
<NButton size="small" round v-for="t in RISK_TOOLS_FORM" :key="t.key" @click="toggleTool(t)" title="点击选用 / 取消;AI 辅助分析在各工具插件内使用"
class="text-sm"
:ghost="form.risk_tools.includes(t.key) ? false : true"
:type="form.risk_tools.includes(t.key) ? 'primary' : 'default'"
:ghost="form.risk_tools?.includes(t.key) ? false : true"
:type="form.risk_tools?.includes(t.key) ? 'primary' : 'default'"
>
{{ t.label }}
</NButton>
@@ -25,7 +25,7 @@ const generateLoading = ref<boolean>(false);
// 风险预分析loading
const analyzing = ref<boolean>(false);
// 是否显示险预分析
const preRiskShow = computed(() => form.value.severity !== '' || form.value.probability !== '' || form.value.protection !== '');
const preRiskShow = computed(() => form.value.severity || form.value.probability || form.value.protection);
// 是否显示变更识别结果
const identifyShow = computed(() => form.value.compare_rows.length > 0);
// 表单
@@ -134,7 +134,7 @@ watch(() => props.currentForm, (newVal:any) => {
<Icon icon="lucide:sparkles" class="size-16px text-violet-500" />
<span class="font-semibold text-base ml-2">变更内容描述</span>
</div>
<NButton ghost type="primary" @click="runIdentify" :disabled="btnDisabled || !form.description.trim()">
<NButton ghost type="primary" @click="runIdentify" :disabled="btnDisabled || !form.description?.trim()">
<Icon v-if="preLoading" icon="ri:loader-4-fill" class="size-16px animate-spin" />
<Icon v-else icon="fluent:wand-24-regular" class="size-16px" />
变更识别