mirror of
https://gitee.com/cai_xiao_feng/lowflow-design.git
synced 2025-12-07 08:38:23 +08:00
筛选符修改
This commit is contained in:
parent
edc39d8b42
commit
2b1ec33594
@ -6,20 +6,20 @@ const $props = defineProps<{
|
||||
}>()
|
||||
const operatorOptions = [
|
||||
{
|
||||
value: 'equal',
|
||||
value: 'eq',
|
||||
label: '等于'
|
||||
},
|
||||
{
|
||||
value: 'not_equal',
|
||||
value: 'ne',
|
||||
label: '不等于'
|
||||
},
|
||||
{
|
||||
label: '包含',
|
||||
value: 'contains'
|
||||
value: 'lk'
|
||||
},
|
||||
{
|
||||
label: '不包含',
|
||||
value: 'not_contain'
|
||||
value: 'nl'
|
||||
}
|
||||
]
|
||||
const $emits = defineEmits<{
|
||||
|
||||
@ -14,7 +14,7 @@ export interface Condition {
|
||||
* 筛选规则
|
||||
*/
|
||||
export interface FilterRules {
|
||||
logicalOperator: 'or' | 'and',
|
||||
operator: 'or' | 'and',
|
||||
conditions: Condition[]
|
||||
groups: FilterRules[]
|
||||
}
|
||||
@ -25,7 +25,7 @@ const addRule = () => {
|
||||
filterRules.value.conditions.push(
|
||||
{
|
||||
field: null,
|
||||
operator: 'equal',
|
||||
operator: 'eq',
|
||||
value: null
|
||||
}
|
||||
)
|
||||
@ -46,7 +46,7 @@ const handleDel = (index: number) => {
|
||||
*/
|
||||
const addGroup = () => {
|
||||
filterRules.value.groups.push({
|
||||
logicalOperator: 'and',
|
||||
operator: 'and',
|
||||
conditions: [{
|
||||
field: null,
|
||||
operator: '',
|
||||
@ -69,7 +69,7 @@ const delGroup = (index: number) => {
|
||||
<div class="logical-operator">
|
||||
<div class="logical-operator__line"></div>
|
||||
<el-switch
|
||||
v-model="filterRules.logicalOperator"
|
||||
v-model="filterRules.operator"
|
||||
inline-prompt
|
||||
style="--el-switch-on-color: #409EFF; --el-switch-off-color: #67C23A"
|
||||
active-value="and"
|
||||
|
||||
@ -81,7 +81,7 @@ const useNode = (node: Ref<FlowNode>, fields: Ref<Field[]>) => {
|
||||
def: false,
|
||||
name: `条件${exclusive.children.length + 1}`,
|
||||
conditions: {
|
||||
logicalOperator: 'and',
|
||||
operator: 'and',
|
||||
conditions: [],
|
||||
groups: []
|
||||
} as FilterRules,
|
||||
|
||||
@ -64,6 +64,7 @@ const converterBpmn = () => {
|
||||
const processModel = {
|
||||
code: 'test',
|
||||
name: '测试',
|
||||
enable: true,
|
||||
icon: {
|
||||
name: 'el:HomeFilled',
|
||||
color: '#409EFF',
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { FlowNode } from '../Node/index'
|
||||
import type { FlowNode } from '../Node/index'
|
||||
export interface ConditionNode extends FlowNode {
|
||||
def: boolean
|
||||
conditions: FilterRules
|
||||
@ -9,7 +9,7 @@ export interface ConditionNode extends FlowNode {
|
||||
* 筛选规则
|
||||
*/
|
||||
export interface FilterRules {
|
||||
logicalOperator: 'or' | 'and',
|
||||
operator: 'or' | 'and',
|
||||
conditions: Condition[]
|
||||
groups: FilterRules[]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user