Commit ff0e30ef359d0013b429c221a370fa1f8259d16e

Authored by 陈洋
1 parent 6b8f2467

pref: 修改参数设计器传参

... ... @@ -27,7 +27,7 @@ import React, {
27 27 } from 'react';
28 28 import JSONEditor from './codeMirror';
29 29 import './style.less';
30   -import { QxFieldSetter, QxFormSelect, ValueOptionProps } from '@qx/common';
  30 +import { QxFieldSetter, QxFormSelect } from '@qx/common';
31 31 import { formatEnum } from './constant';
32 32 import {
33 33 typeTranslateFieIdtype,
... ... @@ -42,6 +42,11 @@ import { QxBaseIcon } from '@qx/common';
42 42 import Icon from '@ant-design/icons';
43 43 import { SubNodeIcon } from './sub-node-icon';
44 44
  45 +type ValueOptionProps = {
  46 + key: number | string;
  47 + value: string;
  48 +};
  49 +
45 50 const valueOptions = [
46 51 { key: 'STRING', title: '文本' },
47 52 { key: 'NUMBER', title: '数字' },
... ... @@ -726,11 +731,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
726 731 }
727 732
728 733 const qxPropsDefault = () => {
729   - const valuesObj = [{
730   - type: typeTranslateItemtype(record.type),
731   - value: record.mappingValues || [],
732   - }]
733   - record.valuesObj = !record.valuesObj ? valuesObj : record.valuesObj
  734 + // const valuesObj = [{
  735 + // type: typeTranslateItemtype(record.type),
  736 + // value: record.mappingValues || [],
  737 + // }]
  738 + // record.valuesObj = !record.valuesObj ? valuesObj : record.valuesObj
734 739 return (
735 740 <div>
736 741 <QxFieldSetter
... ...
... ... @@ -31,6 +31,11 @@ import { QxFieldSetter, QxBaseIcon } from '@qx/common';
31 31
32 32 import './style.less';
33 33
  34 +type ValueOptionProps = {
  35 + key: number | string;
  36 + value: string;
  37 +};
  38 +
34 39 import { SubNodeIcon } from './sub-node-icon';
35 40
36 41 const valueOptions = [
... ... @@ -582,11 +587,11 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
582 587 const renderTitle = (nodeData: any) => {
583 588 // const strTitle = (nodeData.title as string) || '';
584 589 // const strCode = nodeData.code as string;
585   - const valuesObj = [{
586   - type: typeTranslateItemtype(nodeData.type),
587   - value: nodeData.mappingValues || [],
588   - }]
589   - nodeData.valuesObj = !nodeData.valuesObj ? valuesObj : nodeData.valuesObj
  590 + // const valuesObj = [{
  591 + // type: typeTranslateItemtype(nodeData.type),
  592 + // value: nodeData.mappingValues || [],
  593 + // }]
  594 + // nodeData.valuesObj = !nodeData.valuesObj ? valuesObj : nodeData.valuesObj
590 595 // const index = strTitle.indexOf(searchValue);
591 596 const isShowTree = checkShowTree(nodeData);
592 597 const disabled = nodeData.disabled;
... ... @@ -675,6 +680,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
675 680 isMultiple={false}
676 681 onChange={(val) => changeField(val, nodeData)}
677 682 popupOnBody={true}
  683 + inputDis={true}
678 684 />
679 685 </div>
680 686 )}
... ...