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

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
+1 -1
View File
@@ -41,7 +41,7 @@ export function useRouterPush(inSetup = true) {
const meta = allRoutes.find(item => item.name === key)?.meta || null; const meta = allRoutes.find(item => item.name === key)?.meta || null;
// 处理 my_initiatechange 路由,如果 id 存在,直接跳转 // 处理 my_initiatechange 路由,如果 id 存在,直接跳转
// 判断发起变更是否是编辑 // 判断发起变更是否是编辑
if(route.value?.name==='my_initiatechange' && route.value?.query?.id){ if(meta?.title==='发起变更' && route.value?.query?.id){
return return
} }
@@ -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"> <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 辅助分析在各工具插件内使用" <NButton size="small" round v-for="t in RISK_TOOLS_FORM" :key="t.key" @click="toggleTool(t)" title="点击选用 / 取消;AI 辅助分析在各工具插件内使用"
class="text-sm" class="text-sm"
:ghost="form.risk_tools.includes(t.key) ? false : true" :ghost="form.risk_tools?.includes(t.key) ? false : true"
:type="form.risk_tools.includes(t.key) ? 'primary' : 'default'" :type="form.risk_tools?.includes(t.key) ? 'primary' : 'default'"
> >
{{ t.label }} {{ t.label }}
</NButton> </NButton>
@@ -25,7 +25,7 @@ const generateLoading = ref<boolean>(false);
// 风险预分析loading // 风险预分析loading
const analyzing = ref<boolean>(false); 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); 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" /> <Icon icon="lucide:sparkles" class="size-16px text-violet-500" />
<span class="font-semibold text-base ml-2">变更内容描述</span> <span class="font-semibold text-base ml-2">变更内容描述</span>
</div> </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-if="preLoading" icon="ri:loader-4-fill" class="size-16px animate-spin" />
<Icon v-else icon="fluent:wand-24-regular" class="size-16px" /> <Icon v-else icon="fluent:wand-24-regular" class="size-16px" />
变更识别 变更识别