|
@@ -127,12 +127,8 @@
|
|
|
|
|
|
<!-- 请求体 - 仅 POST/PUT 显示 -->
|
|
|
<el-form-item label="请求体" v-show="formData.webhook.method === 'POST' || formData.webhook.method === 'PUT'">
|
|
|
- <el-input :disabled="readonly" type="textarea" v-model="formData.webhook.body" :autosize="{ minRows: 10, maxRows: 10 }" />
|
|
|
- <!-- <WebHookParams-->
|
|
|
- <!-- ref="bodyRef"-->
|
|
|
- <!-- v-model="formData.webhook.body"-->
|
|
|
- <!-- title="请求体参数"-->
|
|
|
- <!-- @setParams="setWebHookBody" />-->
|
|
|
+ <!-- <el-input :disabled="readonly" type="textarea" v-model="formData.webhook.body" :autosize="{ minRows: 10, maxRows: 10 }" />-->
|
|
|
+ <webhook-params v-model="formData.webhook.body" title="请求体参数" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
|
|
@@ -143,7 +139,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
-import { NodeConditionData, WebHookParamData } from '/@/components/gFlow/propertySetting/model'
|
|
|
+import { NodeConditionData } from '/@/components/gFlow/propertySetting/model'
|
|
|
import selectUser from '/@/components/selectUser/index.vue'
|
|
|
import LogicFlow from '@logicflow/core'
|
|
|
import { computed, getCurrentInstance, onMounted, reactive, ref, toRefs } from 'vue'
|
|
@@ -167,19 +163,23 @@ import {
|
|
|
NodeTypeWebHook,
|
|
|
} from '/@/components/gFlow/consts'
|
|
|
import systemApi from '/@/api/system'
|
|
|
+import WebhookParams from '/@/components/gFlow/propertySetting/webhookParams.vue'
|
|
|
|
|
|
interface PostInfo {
|
|
|
postId: number
|
|
|
postName: string
|
|
|
}
|
|
|
|
|
|
+interface DeptInfo {
|
|
|
+ deptId: number
|
|
|
+ deptName: string
|
|
|
+ children?: DeptInfo[]
|
|
|
+}
|
|
|
+
|
|
|
const getDeptTree = () => systemApi.dept.getList({ status: -1 })
|
|
|
const getParams = () => systemApi.user.params()
|
|
|
|
|
|
const branchRef = ref()
|
|
|
-const paramsRef = ref()
|
|
|
-const headersRef = ref()
|
|
|
-const bodyRef = ref()
|
|
|
const { proxy } = <any>getCurrentInstance()
|
|
|
const props = defineProps({
|
|
|
nodeData: {
|
|
@@ -207,7 +207,7 @@ const state = reactive({
|
|
|
text: '',
|
|
|
roleList: [], //角色选项列表
|
|
|
postList: [] as PostInfo[], //岗位选项列表
|
|
|
- deptData: [], //部门选项列表
|
|
|
+ deptData: [] as DeptInfo[], //部门选项列表
|
|
|
actionRuleOption: [
|
|
|
{
|
|
|
label: '任何人',
|
|
@@ -297,10 +297,8 @@ const state = reactive({
|
|
|
webhook: {
|
|
|
url: '',
|
|
|
method: 'POST',
|
|
|
- params: [] as WebHookParamData[],
|
|
|
- headers: [] as WebHookParamData[],
|
|
|
bodyType: 'json',
|
|
|
- body: [] as WebHookParamData[],
|
|
|
+ body: undefined,
|
|
|
},
|
|
|
},
|
|
|
})
|
|
@@ -311,12 +309,6 @@ onMounted(() => {
|
|
|
state.formData = Object.assign({}, state.formData, properties)
|
|
|
//设置条件
|
|
|
branchRef.value?.initNodeData(state.formData.nodeExt)
|
|
|
- //设置WebHook参数
|
|
|
- if (nodeType.value === NodeTypeWebHook) {
|
|
|
- paramsRef.value?.initParams(state.formData.webhook?.params || [])
|
|
|
- headersRef.value?.initParams(state.formData.webhook?.headers || [])
|
|
|
- bodyRef.value?.initParams(state.formData.webhook?.body || [])
|
|
|
- }
|
|
|
}
|
|
|
if (text && text.value) {
|
|
|
state.formData.text = text.value
|
|
@@ -346,7 +338,7 @@ const getSelector = () => {
|
|
|
state.roleList = proxy.handleTree(roles ?? [], 'id', 'parentId', 'children')
|
|
|
state.postList = res.posts ?? []
|
|
|
})
|
|
|
- getDeptTree().then((res) => {
|
|
|
+ getDeptTree().then((res: DeptInfo[]) => {
|
|
|
state.deptData = res
|
|
|
})
|
|
|
}
|
|
@@ -368,18 +360,5 @@ const onSubmit = () => {
|
|
|
const setNodeExt = (data: Array<NodeConditionData[]>) => {
|
|
|
state.formData.nodeExt = data
|
|
|
}
|
|
|
-
|
|
|
-// WebHook 参数处理方法
|
|
|
-const setWebHookParams = (data: WebHookParamData[]) => {
|
|
|
- state.formData.webhook.params = data
|
|
|
-}
|
|
|
-
|
|
|
-const setWebHookHeaders = (data: WebHookParamData[]) => {
|
|
|
- state.formData.webhook.headers = data
|
|
|
-}
|
|
|
-
|
|
|
-const setWebHookBody = (data: WebHookParamData[]) => {
|
|
|
- state.formData.webhook.body = data
|
|
|
-}
|
|
|
</script>
|
|
|
<style scoped></style>
|