Commit ff0e30ef359d0013b429c221a370fa1f8259d16e

Authored by 陈洋
1 parent 6b8f2467

pref: 修改参数设计器传参

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