|
@@ -9,11 +9,7 @@
|
|
<selectPopover
|
|
<selectPopover
|
|
class="w-[60px]"
|
|
class="w-[60px]"
|
|
v-model:value="item.method"
|
|
v-model:value="item.method"
|
|
- :options="
|
|
|
|
- item.source.type === 'Number'
|
|
|
|
- ? OptionsConditionNumber
|
|
|
|
- : OptionsConditionString
|
|
|
|
- "
|
|
|
|
|
|
+ :options="getOptions(item.source.type)"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
@@ -64,9 +60,11 @@ import { getCurrentInstance, reactive, watch } from 'vue'
|
|
import {
|
|
import {
|
|
ConditionMode,
|
|
ConditionMode,
|
|
ConditionNumber,
|
|
ConditionNumber,
|
|
|
|
+ ConditionOther,
|
|
ConditionString,
|
|
ConditionString,
|
|
ConditionType,
|
|
ConditionType,
|
|
OptionsConditionNumber,
|
|
OptionsConditionNumber,
|
|
|
|
+ OptionsConditionOther,
|
|
OptionsConditionString,
|
|
OptionsConditionString,
|
|
OptionsConditionType,
|
|
OptionsConditionType,
|
|
} from '@/views/workflow/types'
|
|
} from '@/views/workflow/types'
|
|
@@ -84,8 +82,10 @@ watch(
|
|
(n) => {
|
|
(n) => {
|
|
if (n.type === 'Number') {
|
|
if (n.type === 'Number') {
|
|
props.item.method = ConditionNumber.Equals
|
|
props.item.method = ConditionNumber.Equals
|
|
- } else {
|
|
|
|
|
|
+ } else if (n.type === 'String') {
|
|
props.item.method = ConditionString.Includes
|
|
props.item.method = ConditionString.Includes
|
|
|
|
+ } else {
|
|
|
|
+ props.item.method = ConditionOther.NotEmpty
|
|
}
|
|
}
|
|
props.item.type = ConditionType.Constant
|
|
props.item.type = ConditionType.Constant
|
|
props.item.target = ''
|
|
props.item.target = ''
|
|
@@ -107,6 +107,14 @@ watch(
|
|
},
|
|
},
|
|
{ deep: true },
|
|
{ deep: true },
|
|
)
|
|
)
|
|
|
|
+const getOptions = (type) => {
|
|
|
|
+ if (type === 'Number') {
|
|
|
|
+ return OptionsConditionNumber
|
|
|
|
+ } else if (type === 'String') {
|
|
|
|
+ return OptionsConditionString
|
|
|
|
+ }
|
|
|
|
+ return OptionsConditionOther
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|