Commit a7baffc1ded7bcd8cafa8d1fca203564ba053945

Authored by 邱嘉伟
1 parent d9b53821

feat: 与接口数据结构保持一致

... ... @@ -244,12 +244,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
244 244 },
245 245 {
246 246 title: '默认值',
247   - dataIndex: 'mappingValues',
  247 + dataIndex: 'valueMapping',
248 248 width: '15%',
249 249 editable: true,
250   - key: 'mappingValues',
  250 + key: 'valueMapping',
251 251 render: (text) =>
252   - text || [].map((item) => {
  252 + text?.mappingValues || [].map((item) => {
253 253 return <span key={item}>{item.indexOf('-') > -1 ? item : ''}</span>;
254 254 }),
255 255 },
... ... @@ -788,7 +788,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
788 788 ) : (
789 789 qxPropsRemark()
790 790 )
791   - ) : dataIndex == 'mappingValues' ?
  791 + ) : dataIndex == 'valueMapping' ?
792 792 qxPropsDefault() :
793 793 (
794 794 // @ts-ignore
... ...
... ... @@ -45,8 +45,8 @@ const valueOptions = [
45 45 { key: 'BOOL', label: '布尔' },
46 46 { key: 'OBJECT', label: '对象' },
47 47 { key: 'ARRAY', label: '数组' },
48   -/* { key: 'ANNEX', label: '附件' },
49   - { key: 'PIC', label: '图片' },*/
  48 + /* { key: 'ANNEX', label: '附件' },
  49 + { key: 'PIC', label: '图片' },*/
50 50 { key: 'FORM', label: '表单' },
51 51 { key: 'USER', label: '人员' },
52 52 { key: 'ORG', label: '部门' },
... ... @@ -267,7 +267,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
267 267 if (code == 'qxProps') {
268 268 _qxProps = value;
269 269 } else {
270   - _qxProps = {...data.qxProps};
  270 + _qxProps = { ...data.qxProps };
271 271 _qxProps[_newCode] = value;
272 272 }
273 273 treeList[i].qxProps = {
... ... @@ -565,12 +565,16 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
565 565 // const _qxProps = {};
566 566
567 567 const loopChangeTree = (treeList: ParamDesignModel[]) => {
  568 + let newMappingValues = [];
568 569 for (let i = 0; i < treeList.length; i++) {
569 570 if (treeList[i].id == data.id) {
570   -
571   - treeList[i].mappingValues = val.map((item: any) =>
  571 + newMappingValues = val.map((item: any) =>
572 572 item?.extVal ? item?.extVal : item?.value,
573 573 );
  574 + treeList[i].valueMapping = {
  575 + ...data.valueMapping,
  576 + mappingValues: newMappingValues
  577 + }
574 578 treeList[i].valuesObj = val;
575 579 // if (!treeList[i].qxProps) {
576 580 // treeList[i].qxProps = _qxProps;
... ...