筛选符修改

This commit is contained in:
caixiaofeng 2024-05-07 23:04:07 +08:00
parent edc39d8b42
commit 2b1ec33594
6 changed files with 12 additions and 11 deletions

View File

@ -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<{

View File

@ -14,7 +14,7 @@ export interface Condition {
*
*/
export interface FilterRules {
logicalOperator: 'or' | 'and',
operator: 'or' | 'and',
conditions: Condition[]
groups: FilterRules[]
}

View File

@ -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"

View File

@ -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,

View File

@ -64,6 +64,7 @@ const converterBpmn = () => {
const processModel = {
code: 'test',
name: '测试',
enable: true,
icon: {
name: 'el:HomeFilled',
color: '#409EFF',

View File

@ -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[]
}