|
@@ -1,39 +1,18 @@
|
|
|
<template>
|
|
|
- <div class="root-panel" v-if="state.nodeData">
|
|
|
- <div class="flex justify-between items-center mb-2">
|
|
|
- <div class="text-sm">输入字段</div>
|
|
|
- <SvgIcon name="czr_add" size="12" class="__hover" @click="onAddVars"/>
|
|
|
- </div>
|
|
|
- <div class="vars">
|
|
|
- <template v-for="(item, index) in state.nodeData.outVars">
|
|
|
- <div class="item">
|
|
|
- <varsItem
|
|
|
- :item="item"
|
|
|
- :edit="true"
|
|
|
- :del="true"
|
|
|
- @onEdit="onEditVars(item, index)"
|
|
|
- @onDel="onDelVars(item, index)"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- <div class="w-full h-[1px] bg-[#1018281f] my-2"/>
|
|
|
- <div class="vars">
|
|
|
- <template v-for="item in state.nodeData.sysVars">
|
|
|
- <div class="item">
|
|
|
- <varsItem :item="item"/>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <div class="panel-block" v-if="state.nodeData">
|
|
|
+ <div class="_p-title" style="margin-top: 0">
|
|
|
+ <div class="text-sm">可用变量</div>
|
|
|
</div>
|
|
|
+ <varsSelect :node="props.node"/>
|
|
|
</div>
|
|
|
- <varsDetail v-model:show="state.vars.show" :transfer="state.vars.transfer" @refresh="val => setVars(val)"/>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import {getCurrentInstance, reactive, ref, watch} from "vue";
|
|
|
-import varsItem from "@/views/workflow/instance/component/vars/vars-item.vue";
|
|
|
-import varsDetail from "@/views/workflow/instance/component/vars/vars-detail.vue";
|
|
|
+import varsSelect from "@/views/workflow/instance/component/vars/vars-select.vue";
|
|
|
+import {useWorkflowStore} from "@/stores";
|
|
|
|
|
|
+const WorkflowStore = useWorkflowStore()
|
|
|
const emits = defineEmits([])
|
|
|
const props = defineProps({
|
|
|
node: <any>{}
|
|
@@ -51,43 +30,8 @@ watch(() => props.node, (n) => {
|
|
|
state.nodeData = n.data
|
|
|
}
|
|
|
}, {immediate: true})
|
|
|
-const onAddVars = () => {
|
|
|
- state.vars.transfer = {
|
|
|
- mode: 'add'
|
|
|
- }
|
|
|
- state.vars.show = true
|
|
|
-}
|
|
|
-const onEditVars = (row, index) => {
|
|
|
- state.vars.transfer = {
|
|
|
- mode: 'edit',
|
|
|
- row: JSON.parse(JSON.stringify(row)),
|
|
|
- index: index,
|
|
|
- }
|
|
|
- state.vars.show = true
|
|
|
-}
|
|
|
-const onDelVars = (row, index) => {
|
|
|
- state.nodeData.outVars.splice(index, 1)
|
|
|
-}
|
|
|
-const setVars = (val) => {
|
|
|
- if (state.vars.transfer.mode === 'add') {
|
|
|
- state.nodeData.outVars.push(val)
|
|
|
- } else {
|
|
|
- state.nodeData.outVars[state.vars.transfer.index] = val
|
|
|
- }
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.root-panel {
|
|
|
- .vars {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- gap: 6px;
|
|
|
- .item {
|
|
|
- padding: 6px 10px;
|
|
|
- border: 1px solid rgb(234 236 240);
|
|
|
- border-radius: 8px;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+@import "@/views/workflow/instance/component/style";
|
|
|
</style>
|