Commit e95c3b61cee578ff2610c1dabbd32c4a98d7dc7a

Authored by 陈洋
1 parent 0e3f416d

fix:type 类型转换为数据流类型展示 暂时处理方式

... ... @@ -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',
... ...
... ... @@ -9,4 +9,15 @@
9 9 justify-content: space-between;
10 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 }
... ...
... ... @@ -9,9 +9,7 @@ group:
9 9 order: 0
10 10 ---
11 11
12   -## QxBaseCondition 条件配置
13   -
14   -### 条件配置
  12 +## QxCondition 条件配置
15 13
16 14 ```tsx
17 15 import { QxCondition } from '@qx/common';
... ...
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 },
... ...