|
@@ -0,0 +1,67 @@
|
|
|
+<template>
|
|
|
+ <div class="condition-nodes">
|
|
|
+ <template v-for="(item, index) in conditions">
|
|
|
+ <div class="condition-node">
|
|
|
+ <div class="mode" v-if="index > 0">{{String(mode).toUpperCase()}}</div>
|
|
|
+ <span>
|
|
|
+ <SvgIcon name="vars" color="#155aef" size="12"/>
|
|
|
+ </span>
|
|
|
+ <span class="text-[#155aef]">{{item.source.key}}</span>
|
|
|
+ <span>{{(item.source.type === 'Number' ? OptionsConditionNumber : OptionsConditionString).filter(v => v.value === item.method)[0]?.label || ''}}</span>
|
|
|
+ <template v-if="item.type === ConditionType.Constant">
|
|
|
+ <span class="__text-ellipsis">{{item.target}}</span>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.type === ConditionType.Variable">
|
|
|
+ <span>
|
|
|
+ <SvgIcon name="vars" color="#155aef" size="12"/>
|
|
|
+ </span>
|
|
|
+ <span class="text-[#155aef]">{{item.target.key}}</span>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import {getCurrentInstance, reactive} from "vue";
|
|
|
+import VarsValue from "@/views/workflow/instance/component/vars/vars-value.vue";
|
|
|
+import VarsItem from "@/views/workflow/instance/component/vars/vars-item.vue";
|
|
|
+import {ConditionType, OptionsConditionNumber, OptionsConditionString} from "@/views/workflow/types";
|
|
|
+
|
|
|
+const emits = defineEmits(['update:mode', 'update:conditions'])
|
|
|
+const props = defineProps({
|
|
|
+ mode: {},
|
|
|
+ conditions: {default: []}
|
|
|
+})
|
|
|
+const {proxy}: any = getCurrentInstance()
|
|
|
+const state: any = reactive({})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@use "@/views/workflow/instance/component/style";
|
|
|
+
|
|
|
+.condition-nodes {
|
|
|
+ .condition-node {
|
|
|
+ margin-top: 2px;
|
|
|
+ background-color: #f2f4f7;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 2px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 6px;
|
|
|
+ white-space: nowrap;
|
|
|
+ position: relative;
|
|
|
+ >span {
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+ .mode {
|
|
|
+ color: #155aef;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ font-size: 12px;
|
|
|
+ top: -50%;
|
|
|
+ z-index: 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|