|
|
@@ -1,17 +1,79 @@
|
|
|
<template>
|
|
|
- <div class="">
|
|
|
- <div
|
|
|
- class="_n_content mb-2 flex items-center"
|
|
|
- v-if="state.nodeData.__modelConfig?.modelName"
|
|
|
- >
|
|
|
- <img
|
|
|
- src="@/assets/images/model/model-default-logo.png"
|
|
|
- class="mr-2 size-4"
|
|
|
- />
|
|
|
- <span v-title>
|
|
|
- {{ state.nodeData.__modelConfig.modelName }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
+ <div class="pb-3" v-if="state.nodeData">
|
|
|
+ <template v-if="state.nodeData.advancedSettings.groupEnabled">
|
|
|
+ <template
|
|
|
+ v-for="(group, index) in state.nodeData.advancedSettings.groups"
|
|
|
+ >
|
|
|
+ <div class="flex items-center justify-between text-sm font-bold">
|
|
|
+ <SvgIcon name="file" color="#000000" />
|
|
|
+ <div class="flex-1">
|
|
|
+ <CzrFormColumn
|
|
|
+ :span="24"
|
|
|
+ label-width="0px"
|
|
|
+ v-model:param="group.groupName"
|
|
|
+ :transparent="true"
|
|
|
+ :must="true"
|
|
|
+ :max-length="20"
|
|
|
+ :clearable="false"
|
|
|
+ :regex="/^[a-zA-Z][a-zA-Z0-9_]*$/"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <varsPopover
|
|
|
+ :node="props.node"
|
|
|
+ @setVars="(val) => group.__variables.push(val)"
|
|
|
+ :selected="group.__variables"
|
|
|
+ class="ml-auto"
|
|
|
+ >
|
|
|
+ <SvgIcon name="add" size="16" />
|
|
|
+ </varsPopover>
|
|
|
+ </div>
|
|
|
+ <template v-for="(item, index) in group.__variables">
|
|
|
+ <div class="mt-1.5 flex w-full items-center">
|
|
|
+ <div
|
|
|
+ class="flex w-full items-center rounded-sm bg-[#c8ceda40] p-1 text-xs"
|
|
|
+ >
|
|
|
+ <varsPopover
|
|
|
+ class="w-full"
|
|
|
+ :node="props.node"
|
|
|
+ @setVars="(val) => (group.__variables[index] = val)"
|
|
|
+ :selected="group.__variables"
|
|
|
+ >
|
|
|
+ <varsValue :vars="item" />
|
|
|
+ </varsPopover>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <div class="flex items-center justify-between text-sm font-bold">
|
|
|
+ 变量赋值
|
|
|
+ <varsPopover
|
|
|
+ :node="props.node"
|
|
|
+ @setVars="(val) => state.nodeData.__variables.push(val)"
|
|
|
+ :selected="state.nodeData.__variables"
|
|
|
+ class="ml-auto"
|
|
|
+ >
|
|
|
+ <SvgIcon name="add" size="16" />
|
|
|
+ </varsPopover>
|
|
|
+ </div>
|
|
|
+ <template v-for="(item, index) in state.nodeData.__variables">
|
|
|
+ <div class="mt-1.5 flex w-full items-center">
|
|
|
+ <div
|
|
|
+ class="flex w-full items-center rounded-sm bg-[#c8ceda40] p-1 text-xs"
|
|
|
+ >
|
|
|
+ <varsPopover
|
|
|
+ class="w-full"
|
|
|
+ :node="props.node"
|
|
|
+ @setVars="(val) => (state.nodeData.__variables[index] = val)"
|
|
|
+ :selected="state.nodeData.__variables"
|
|
|
+ >
|
|
|
+ <varsValue :vars="item" />
|
|
|
+ </varsPopover>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -24,6 +86,11 @@ import {
|
|
|
reactive,
|
|
|
ref,
|
|
|
} from 'vue'
|
|
|
+import { Plus } from '@element-plus/icons-vue'
|
|
|
+import { v4 } from 'uuid'
|
|
|
+import SvgIcon from '@/components/SvgIcon/index.vue'
|
|
|
+import varsPopover from '@/views/workflow/instance/component/vars/vars-popover.vue'
|
|
|
+import varsValue from '@/views/workflow/instance/component/vars/vars-value.vue'
|
|
|
|
|
|
const emit = defineEmits([])
|
|
|
const props = defineProps({
|
|
|
@@ -31,7 +98,7 @@ const props = defineProps({
|
|
|
})
|
|
|
const { proxy }: any = getCurrentInstance()
|
|
|
const state: any = reactive({
|
|
|
- nodeData: {},
|
|
|
+ nodeData: null,
|
|
|
})
|
|
|
onMounted(() => {
|
|
|
state.nodeData = props.node.data.workflowData
|