Showing
5 changed files
with
49 additions
and
7 deletions
... | ... | @@ -768,7 +768,7 @@ export const QxBaseConditionItem: React.FC<QxBaseConditionItemProps> = ({ |
768 | 768 | const display = fieldSelectorRef?.current?.getInputDisplay?.(); |
769 | 769 | isMount.current = !!display; |
770 | 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 | 3 | import { INode } from '../qx-flow-node-selector'; |
4 | 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 | 38 | export const FieldBaseType = { |
7 | 39 | STRING: 'TEXT', |
8 | 40 | DOUBLE: 'NUM', |
... | ... | @@ -42,7 +74,7 @@ export const QxBaseCondition: React.FC<QxBaseConditionProps> = (props) => { |
42 | 74 | |
43 | 75 | const getDefaultCondition = (item: QxBaseConditionField) => { |
44 | 76 | return { |
45 | - type: item.extract?.fieldType, | |
77 | + type: flowTypeByFieldType[item.extract?.fieldType] || item.extract?.fieldType, | |
46 | 78 | code: item.code, |
47 | 79 | title: item.name, |
48 | 80 | opt: 'IS', | ... | ... |
1 | 1 | import { Button } from 'antd'; |
2 | 2 | import React, { useEffect, useRef, useState } from 'react'; |
3 | 3 | import { |
4 | + flowTypeByFieldType, | |
4 | 5 | QxBaseCondition, |
5 | 6 | QxBaseConditionValueType, |
6 | 7 | } from '../qx-base-condition'; |
... | ... | @@ -68,7 +69,7 @@ export const QxCondition: React.FC<QxConditionProps> = ({ |
68 | 69 | field: val, |
69 | 70 | code: val.code, |
70 | 71 | name: val.name, |
71 | - type: val.extract?.fieldType, | |
72 | + type: flowTypeByFieldType?.[val.extract?.fieldType] || val.extract?.fieldType, | |
72 | 73 | opt: 'IS', |
73 | 74 | mappingValues: [], |
74 | 75 | }, |
... | ... | @@ -84,7 +85,7 @@ export const QxCondition: React.FC<QxConditionProps> = ({ |
84 | 85 | field: opt, |
85 | 86 | code: val, |
86 | 87 | name: opt.name, |
87 | - type: opt.extract?.fieldType, | |
88 | + type: flowTypeByFieldType?.[opt.extract?.fieldType] || opt.extract?.fieldType, | |
88 | 89 | opt: 'IS', |
89 | 90 | mappingValues: [], |
90 | 91 | }, | ... | ... |