【代码评审】Bpm:触发器
parent
e3db7d3014
commit
7db5ac81ae
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue