Commit 7db5ac81 by YunaiV

【代码评审】Bpm:触发器

parent e3db7d30
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
import { SimpleFlowNode, NodeType, TriggerSetting, TRIGGER_TYPES, TriggerTypeEnum } from '../consts' import { SimpleFlowNode, NodeType, TriggerSetting, TRIGGER_TYPES, TriggerTypeEnum } from '../consts'
import { useWatchNode, useDrawer, useNodeName } from '../node' import { useWatchNode, useDrawer, useNodeName } from '../node'
import HttpRequestParamSetting from './components/HttpRequestParamSetting.vue' import HttpRequestParamSetting from './components/HttpRequestParamSetting.vue'
defineOptions({ defineOptions({
name: 'TriggerNodeConfig' name: 'TriggerNodeConfig'
}) })
...@@ -104,7 +105,7 @@ const configForm = ref<TriggerSetting>({ ...@@ -104,7 +105,7 @@ const configForm = ref<TriggerSetting>({
} }
}) })
// 保存配置 /** 保存配置 */
const saveConfig = async () => { const saveConfig = async () => {
if (!formRef) return false if (!formRef) return false
const valid = await formRef.value.validate() const valid = await formRef.value.validate()
...@@ -116,7 +117,7 @@ const saveConfig = async () => { ...@@ -116,7 +117,7 @@ const saveConfig = async () => {
settingVisible.value = false settingVisible.value = false
return true return true
} }
// 获取节点展示内容 /** 获取节点展示内容 */
const getShowText = (): string => { const getShowText = (): string => {
let showText = '' let showText = ''
if (configForm.value.type === TriggerTypeEnum.HTTP_REQUEST) { if (configForm.value.type === TriggerTypeEnum.HTTP_REQUEST) {
...@@ -125,7 +126,7 @@ const getShowText = (): string => { ...@@ -125,7 +126,7 @@ const getShowText = (): string => {
return showText return showText
} }
// 显示触发器节点配置, 由父组件传过来 /** 显示触发器节点配置, 由父组件传过来 */
const showTriggerNodeConfig = (node: SimpleFlowNode) => { const showTriggerNodeConfig = (node: SimpleFlowNode) => {
nodeName.value = node.name nodeName.value = node.name
if (node.triggerSetting) { if (node.triggerSetting) {
......
...@@ -166,14 +166,14 @@ const props = defineProps({ ...@@ -166,14 +166,14 @@ const props = defineProps({
const formFieldOptions = useFormFields() const formFieldOptions = useFormFields()
const addHttpRequestParam = (arr) => { const addHttpRequestParam = (arr: ListenerParam[]) => {
arr.push({ arr.push({
key: '', key: '',
type: 1, type: ListenerParamTypeEnum.FIXED_VALUE,
value: '' value: ''
}) })
} }
const deleteHttpRequestParam = (arr, index) => { const deleteHttpRequestParam = (arr: ListenerParam[], index: number) => {
arr.splice(index, 1) arr.splice(index, 1)
} }
</script> </script>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
> >
<el-input v-model="configForm[`task${listener.type}ListenerPath`]" /> <el-input v-model="configForm[`task${listener.type}ListenerPath`]" />
</el-form-item> </el-form-item>
<HttpRequestParamSetting <HttpRequestParamSetting
:header="configForm[`task${listener.type}Listener`].header" :header="configForm[`task${listener.type}Listener`].header"
:body="configForm[`task${listener.type}Listener`].body" :body="configForm[`task${listener.type}Listener`].body"
:bind="`task${listener.type}Listener`" :bind="`task${listener.type}Listener`"
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
// import { LISTENER_MAP_TYPES, ListenerParamTypeEnum } from '../../consts'
import HttpRequestParamSetting from './HttpRequestParamSetting.vue' import HttpRequestParamSetting from './HttpRequestParamSetting.vue'
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
type: Object, type: Object,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment