Showing
5 changed files
with
49 additions
and
7 deletions
@@ -768,7 +768,7 @@ export const QxBaseConditionItem: React.FC<QxBaseConditionItemProps> = ({ | @@ -768,7 +768,7 @@ export const QxBaseConditionItem: React.FC<QxBaseConditionItemProps> = ({ | ||
768 | const display = fieldSelectorRef?.current?.getInputDisplay?.(); | 768 | const display = fieldSelectorRef?.current?.getInputDisplay?.(); |
769 | isMount.current = !!display; | 769 | isMount.current = !!display; |
770 | setInputDisplay(fieldSelectorRef?.current?.getInputDisplay?.()); | 770 | setInputDisplay(fieldSelectorRef?.current?.getInputDisplay?.()); |
771 | - }, 10); | 771 | + }, 100); |
772 | } | 772 | } |
773 | }); | 773 | }); |
774 | 774 |
@@ -3,6 +3,38 @@ import { QxBaseConditionItem } from '../qx-base-condition-item'; | @@ -3,6 +3,38 @@ import { QxBaseConditionItem } from '../qx-base-condition-item'; | ||
3 | import { INode } from '../qx-flow-node-selector'; | 3 | import { INode } from '../qx-flow-node-selector'; |
4 | import './index.less'; | 4 | import './index.less'; |
5 | 5 | ||
6 | +export const flowTypeByFieldType: Record<string, string> = { | ||
7 | + STRING: 'STRING', | ||
8 | + TEXT: 'STRING', | ||
9 | + ENUM: 'ENUM', | ||
10 | + ENUM_MULTI: 'ENUM', | ||
11 | + YEAR_SEC: 'TIME', | ||
12 | + TIME: 'TIME', | ||
13 | + YEAR: 'TIME', | ||
14 | + YEAR_MONTH: 'TIME', | ||
15 | + YEAR_DATE: 'TIME', | ||
16 | + YEAR_MIN: 'TIME', | ||
17 | + YEAR_HOUR: 'TIME', | ||
18 | + HOUR: 'TIME', | ||
19 | + HOUR_MIN: 'TIME', | ||
20 | + HOUR_SEC: 'TIME', | ||
21 | + BOOL: 'BOOL', | ||
22 | + INTEGER: 'NUMBER', | ||
23 | + PERCENT: 'NUMBER', | ||
24 | + DECIMAL: 'NUMBER', | ||
25 | + DOUBLE: 'NUMBER', | ||
26 | + NUMBER: 'NUMBER', | ||
27 | + FILE: 'FILE', | ||
28 | + USER: 'USER', | ||
29 | + USER_MULTI: 'USER', | ||
30 | + ORG: 'ORG', | ||
31 | + ORG_MULTI: 'ORG', | ||
32 | + REL: 'FORM', | ||
33 | + REL_MULTI: 'FORM', | ||
34 | + TABLE: 'FORM', | ||
35 | + TREE: 'FORM' | ||
36 | +}; | ||
37 | + | ||
6 | export const FieldBaseType = { | 38 | export const FieldBaseType = { |
7 | STRING: 'TEXT', | 39 | STRING: 'TEXT', |
8 | DOUBLE: 'NUM', | 40 | DOUBLE: 'NUM', |
@@ -42,7 +74,7 @@ export const QxBaseCondition: React.FC<QxBaseConditionProps> = (props) => { | @@ -42,7 +74,7 @@ export const QxBaseCondition: React.FC<QxBaseConditionProps> = (props) => { | ||
42 | 74 | ||
43 | const getDefaultCondition = (item: QxBaseConditionField) => { | 75 | const getDefaultCondition = (item: QxBaseConditionField) => { |
44 | return { | 76 | return { |
45 | - type: item.extract?.fieldType, | 77 | + type: flowTypeByFieldType[item.extract?.fieldType] || item.extract?.fieldType, |
46 | code: item.code, | 78 | code: item.code, |
47 | title: item.name, | 79 | title: item.name, |
48 | opt: 'IS', | 80 | opt: 'IS', |
@@ -9,4 +9,15 @@ | @@ -9,4 +9,15 @@ | ||
9 | justify-content: space-between; | 9 | justify-content: space-between; |
10 | margin-bottom: 16px; | 10 | margin-bottom: 16px; |
11 | } | 11 | } |
12 | + | ||
13 | + &-header__right { | ||
14 | + .ant-btn.ant-btn-sm { | ||
15 | + padding-right: 0; | ||
16 | + | ||
17 | + .anticon + span, | ||
18 | + span + .anticon { | ||
19 | + margin-left: 4px; | ||
20 | + } | ||
21 | + } | ||
22 | + } | ||
12 | } | 23 | } |
1 | import { Button } from 'antd'; | 1 | import { Button } from 'antd'; |
2 | import React, { useEffect, useRef, useState } from 'react'; | 2 | import React, { useEffect, useRef, useState } from 'react'; |
3 | import { | 3 | import { |
4 | + flowTypeByFieldType, | ||
4 | QxBaseCondition, | 5 | QxBaseCondition, |
5 | QxBaseConditionValueType, | 6 | QxBaseConditionValueType, |
6 | } from '../qx-base-condition'; | 7 | } from '../qx-base-condition'; |
@@ -68,7 +69,7 @@ export const QxCondition: React.FC<QxConditionProps> = ({ | @@ -68,7 +69,7 @@ export const QxCondition: React.FC<QxConditionProps> = ({ | ||
68 | field: val, | 69 | field: val, |
69 | code: val.code, | 70 | code: val.code, |
70 | name: val.name, | 71 | name: val.name, |
71 | - type: val.extract?.fieldType, | 72 | + type: flowTypeByFieldType?.[val.extract?.fieldType] || val.extract?.fieldType, |
72 | opt: 'IS', | 73 | opt: 'IS', |
73 | mappingValues: [], | 74 | mappingValues: [], |
74 | }, | 75 | }, |
@@ -84,7 +85,7 @@ export const QxCondition: React.FC<QxConditionProps> = ({ | @@ -84,7 +85,7 @@ export const QxCondition: React.FC<QxConditionProps> = ({ | ||
84 | field: opt, | 85 | field: opt, |
85 | code: val, | 86 | code: val, |
86 | name: opt.name, | 87 | name: opt.name, |
87 | - type: opt.extract?.fieldType, | 88 | + type: flowTypeByFieldType?.[opt.extract?.fieldType] || opt.extract?.fieldType, |
88 | opt: 'IS', | 89 | opt: 'IS', |
89 | mappingValues: [], | 90 | mappingValues: [], |
90 | }, | 91 | }, |