Răsfoiți Sursa

【代码评审】Bpm:触发器

YunaiV 6 luni în urmă
părinte
comite
7db5ac81ae

+ 4 - 3
src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue

@@ -70,6 +70,7 @@
 import { SimpleFlowNode, NodeType, TriggerSetting, TRIGGER_TYPES, TriggerTypeEnum } from '../consts'
 import { useWatchNode, useDrawer, useNodeName } from '../node'
 import HttpRequestParamSetting from './components/HttpRequestParamSetting.vue'
+
 defineOptions({
   name: 'TriggerNodeConfig'
 })
@@ -104,7 +105,7 @@ const configForm = ref<TriggerSetting>({
   }
 })
 
-// 保存配置
+/** 保存配置 */
 const saveConfig = async () => {
   if (!formRef) return false
   const valid = await formRef.value.validate()
@@ -116,7 +117,7 @@ const saveConfig = async () => {
   settingVisible.value = false
   return true
 }
-// 获取节点展示内容
+/** 获取节点展示内容 */
 const getShowText = (): string => {
   let showText = ''
   if (configForm.value.type === TriggerTypeEnum.HTTP_REQUEST) {
@@ -125,7 +126,7 @@ const getShowText = (): string => {
   return showText
 }
 
-// 显示触发器节点配置, 由父组件传过来
+/** 显示触发器节点配置, 由父组件传过来 */
 const showTriggerNodeConfig = (node: SimpleFlowNode) => {
   nodeName.value = node.name
   if (node.triggerSetting) {

+ 3 - 3
src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue

@@ -166,14 +166,14 @@ const props = defineProps({
 
 const formFieldOptions = useFormFields()
 
-const addHttpRequestParam = (arr) => {
+const addHttpRequestParam = (arr: ListenerParam[]) => {
   arr.push({
     key: '',
-    type: 1,
+    type: ListenerParamTypeEnum.FIXED_VALUE,
     value: ''
   })
 }
-const deleteHttpRequestParam = (arr, index) => {
+const deleteHttpRequestParam = (arr: ListenerParam[], index: number) => {
   arr.splice(index, 1)
 }
 </script>

+ 2 - 2
src/components/SimpleProcessDesignerV2/src/nodes-config/components/UserTaskListener.vue

@@ -31,7 +31,7 @@
         >
           <el-input v-model="configForm[`task${listener.type}ListenerPath`]" />
         </el-form-item>
-        <HttpRequestParamSetting 
+        <HttpRequestParamSetting
           :header="configForm[`task${listener.type}Listener`].header"
           :body="configForm[`task${listener.type}Listener`].body"
           :bind="`task${listener.type}Listener`"
@@ -42,8 +42,8 @@
 </template>
 
 <script setup lang="ts">
-// import { LISTENER_MAP_TYPES, ListenerParamTypeEnum } from '../../consts'
 import HttpRequestParamSetting from './HttpRequestParamSetting.vue'
+
 const props = defineProps({
   modelValue: {
     type: Object,