【功能优化】 代码评审修改

This commit is contained in:
jason 2025-02-17 13:34:21 +08:00
parent 6be64a219e
commit 78d8782b5d
2 changed files with 6 additions and 6 deletions

View File

@ -747,9 +747,9 @@ export enum TriggerTypeEnum {
*/ */
HTTP_REQUEST = 1, HTTP_REQUEST = 1,
/** /**
* *
*/ */
UPDATE_NORMAL_FORM = 2 // TODO @jasonFORM_UPDATE FORM_UPDATE = 2
} }
/** /**
@ -782,5 +782,5 @@ export type FormTriggerSetting = {
export const TRIGGER_TYPES: DictDataVO[] = [ export const TRIGGER_TYPES: DictDataVO[] = [
{ label: 'HTTP 请求', value: TriggerTypeEnum.HTTP_REQUEST }, { label: 'HTTP 请求', value: TriggerTypeEnum.HTTP_REQUEST },
{ label: '修改表单数据', value: TriggerTypeEnum.UPDATE_NORMAL_FORM } { label: '修改表单数据', value: TriggerTypeEnum.FORM_UPDATE }
] ]

View File

@ -122,7 +122,7 @@
</el-form-item> </el-form-item>
</div> </div>
<!-- 表单数据修改触发器 --> <!-- 表单数据修改触发器 -->
<div v-if="configForm.type === TriggerTypeEnum.UPDATE_NORMAL_FORM"> <div v-if="configForm.type === TriggerTypeEnum.FORM_UPDATE">
<div v-for="(formSetting, index) in configForm.formSettings" :key="index"> <div v-for="(formSetting, index) in configForm.formSettings" :key="index">
<el-card class="w-580px mt-4"> <el-card class="w-580px mt-4">
<template #header> <template #header>
@ -404,7 +404,7 @@ const saveConfig = async () => {
if (configForm.value.type === TriggerTypeEnum.HTTP_REQUEST) { if (configForm.value.type === TriggerTypeEnum.HTTP_REQUEST) {
configForm.value.formSettings = undefined configForm.value.formSettings = undefined
} }
if (configForm.value.type === TriggerTypeEnum.UPDATE_NORMAL_FORM) { if (configForm.value.type === TriggerTypeEnum.FORM_UPDATE) {
configForm.value.httpRequestSetting = undefined configForm.value.httpRequestSetting = undefined
} }
currentNode.value.triggerSetting = configForm.value currentNode.value.triggerSetting = configForm.value
@ -417,7 +417,7 @@ const getShowText = (): string => {
let showText = '' let showText = ''
if (configForm.value.type === TriggerTypeEnum.HTTP_REQUEST) { if (configForm.value.type === TriggerTypeEnum.HTTP_REQUEST) {
showText = `${configForm.value.httpRequestSetting?.url}` showText = `${configForm.value.httpRequestSetting?.url}`
} else if (configForm.value.type === TriggerTypeEnum.UPDATE_NORMAL_FORM) { } else if (configForm.value.type === TriggerTypeEnum.FORM_UPDATE) {
for (const [index, setting] of configForm.value.formSettings!.entries()) { for (const [index, setting] of configForm.value.formSettings!.entries()) {
if (!setting.updateFormFields || Object.keys(setting.updateFormFields).length === 0) { if (!setting.updateFormFields || Object.keys(setting.updateFormFields).length === 0) {
message.warning(`请添加表单设置${index + 1}的修改字段`) message.warning(`请添加表单设置${index + 1}的修改字段`)