Skip to content

Commit 7652c41

Browse files
committed
【代码评审修改】触发器 异步 Http 改成 Http 回调
1 parent de35fd0 commit 7652c41

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

src/components/SimpleProcessDesignerV2/src/consts.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -756,20 +756,19 @@ export enum TriggerTypeEnum {
756756
* 发送 HTTP 请求触发器
757757
*/
758758
HTTP_REQUEST = 1,
759-
// TODO @jason:要不把 FORM_UPDATE、FORM_DELETE 调整从 10、11 这样?
760759
/**
761-
* 表单数据更新触发器
760+
* 发起 HTTP 回调请求触发器
762761
*/
763-
FORM_UPDATE = 2,
762+
HTTP_CALLBACK = 2,
764763
/**
765-
* 表单数据删除触发器
764+
* 表单数据更新触发器
766765
*/
767-
FORM_DELETE = 3,
768-
// TODO @jason:1)HTTP_CALLBACK 这个枚举值?然后,相关注释,朝着“HTTP 回调”走;2)枚举值改成 2?
766+
FORM_UPDATE = 10,
769767
/**
770-
* 发起异步 HTTP 请求
768+
* 表单数据删除触发器
771769
*/
772-
ASYNC_HTTP_REQUEST = 4
770+
FORM_DELETE = 11
771+
773772
}
774773

775774
/**
@@ -804,7 +803,7 @@ export type FormTriggerSetting = {
804803

805804
export const TRIGGER_TYPES: DictDataVO[] = [
806805
{ label: 'HTTP 请求', value: TriggerTypeEnum.HTTP_REQUEST },
807-
{ label: '异步 HTTP 请求', value: TriggerTypeEnum.ASYNC_HTTP_REQUEST },
806+
{ label: 'HTTP 回调', value: TriggerTypeEnum.HTTP_CALLBACK },
808807
{ label: '修改表单数据', value: TriggerTypeEnum.FORM_UPDATE },
809808
{ label: '删除表单数据', value: TriggerTypeEnum.FORM_DELETE }
810809
]

src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@
3636
</el-select>
3737
</el-form-item>
3838
<!-- HTTP 请求触发器 -->
39-
<!-- TODO @jason:可以考虑用 [].include 更简洁 -->
4039
<div
4140
v-if="
42-
(configForm.type === TriggerTypeEnum.HTTP_REQUEST ||
43-
configForm.type === TriggerTypeEnum.ASYNC_HTTP_REQUEST) &&
41+
[TriggerTypeEnum.HTTP_REQUEST, TriggerTypeEnum.HTTP_CALLBACK].includes(configForm.type) &&
4442
configForm.httpRequestSetting
4543
"
4644
>
@@ -407,9 +405,9 @@ const changeTriggerType = () => {
407405
return
408406
}
409407
410-
if (configForm.value.type === TriggerTypeEnum.ASYNC_HTTP_REQUEST) {
408+
if (configForm.value.type === TriggerTypeEnum.HTTP_CALLBACK) {
411409
configForm.value.httpRequestSetting =
412-
originalSetting?.type === TriggerTypeEnum.ASYNC_HTTP_REQUEST &&
410+
originalSetting?.type === TriggerTypeEnum.HTTP_CALLBACK &&
413411
originalSetting.httpRequestSetting
414412
? originalSetting.httpRequestSetting
415413
: {
@@ -566,7 +564,7 @@ const getShowText = (): string => {
566564
let showText = ''
567565
if (
568566
configForm.value.type === TriggerTypeEnum.HTTP_REQUEST ||
569-
configForm.value.type === TriggerTypeEnum.ASYNC_HTTP_REQUEST
567+
configForm.value.type === TriggerTypeEnum.HTTP_CALLBACK
570568
) {
571569
showText = `${configForm.value.httpRequestSetting?.url}`
572570
} else if (configForm.value.type === TriggerTypeEnum.FORM_UPDATE) {

0 commit comments

Comments
 (0)