@bit-sun/business-component 2.2.49 → 2.3.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/common/ENUM.d.ts +40 -0
  2. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +2 -2
  3. package/dist/components/Business/SearchSelect/common.d.ts +9 -1
  4. package/dist/components/Business/TreeSearchSelect/utils.d.ts +3 -1
  5. package/dist/components/Functional/AddSelect/helps.d.ts +13 -0
  6. package/dist/components/Functional/BsAntdSula/BsCascader/index.d.ts +18 -0
  7. package/dist/components/Functional/BsAntdSula/index.d.ts +1 -0
  8. package/dist/components/Solution/RuleComponent/Formula.d.ts +8 -0
  9. package/dist/components/Solution/RuleComponent/services.d.ts +1 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.esm.js +10845 -11311
  12. package/dist/index.js +10806 -11268
  13. package/dist/utils/LocalstorageUtils.d.ts +1 -0
  14. package/dist/utils/index.d.ts +1 -0
  15. package/dist/utils/utils.d.ts +7 -0
  16. package/package.json +2 -1
  17. package/src/common/ENUM.ts +41 -0
  18. package/src/components/Business/AddSelectBusiness/index.md +1 -0
  19. package/src/components/Business/AddSelectBusiness/index.tsx +375 -176
  20. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +1 -1
  21. package/src/components/Business/BsSulaQueryTable/index.tsx +20 -12
  22. package/src/components/Business/BsSulaQueryTable/setting.tsx +36 -16
  23. package/src/components/Business/BsSulaQueryTable/utils.tsx +31 -29
  24. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +4 -0
  25. package/src/components/Business/JsonQueryTable/index.tsx +248 -33
  26. package/src/components/Business/JsonQueryTable/static.ts +5 -5
  27. package/src/components/Business/SearchSelect/BusinessUtils.ts +37 -7
  28. package/src/components/Business/SearchSelect/common.ts +23 -1
  29. package/src/components/Business/SearchSelect/index.md +12 -2
  30. package/src/components/Business/SearchSelect/index.tsx +5 -2
  31. package/src/components/Business/TreeSearchSelect/index.md +2 -0
  32. package/src/components/Business/TreeSearchSelect/index.tsx +1 -2
  33. package/src/components/Business/TreeSearchSelect/utils.ts +7 -1
  34. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +1 -1
  35. package/src/components/Business/columnSettingTable/utils.tsx +30 -28
  36. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +1 -0
  37. package/src/components/Business/moreTreeTable/index.md +2 -2
  38. package/src/components/Business/moreTreeTable/index.tsx +24 -17
  39. package/src/components/Functional/AddSelect/helps.ts +65 -0
  40. package/src/components/Functional/AddSelect/index.tsx +13 -122
  41. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -0
  42. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -0
  43. package/src/components/Functional/BsAntdSula/index.ts +2 -0
  44. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -0
  45. package/src/components/Functional/EllipsisTooltip/index.js +36 -0
  46. package/src/components/Functional/EllipsisTooltip/index.md +30 -0
  47. package/src/components/Functional/SearchSelect/index.tsx +97 -60
  48. package/src/components/Functional/TreeSearchSelect/index.tsx +44 -7
  49. package/src/components/Solution/RuleComponent/Formula.tsx +335 -0
  50. package/src/components/Solution/RuleComponent/index.d.ts +29 -0
  51. package/src/components/Solution/RuleComponent/index.js +2032 -0
  52. package/src/components/Solution/RuleComponent/index.less +230 -0
  53. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -0
  54. package/src/components/Solution/RuleComponent/ruleFiled.js +2107 -0
  55. package/src/components/Solution/RuleComponent/services.ts +13 -0
  56. package/src/components/Solution/RuleComponent/util.js +139 -0
  57. package/src/index.ts +4 -0
  58. package/src/utils/LocalstorageUtils.ts +5 -0
  59. package/src/utils/index.ts +1 -0
  60. package/src/utils/utils.ts +29 -0
@@ -60,6 +60,7 @@ export default (props: any) => {
60
60
 
61
61
  const [height, setHeight]: any = useState('100vh');
62
62
  const sortTableRef = useRef(null);
63
+ const searchTableRef = useRef(null);
63
64
 
64
65
  const bsTableCode = tableCode || window.location.hash; //设置列字段的唯一标识
65
66
  // 获取table高度
@@ -367,20 +368,17 @@ export default (props: any) => {
367
368
  props: {
368
369
  children: (
369
370
  <span className="ant-dropdown-link">
370
- <Dropdown overlay={
371
- <Menu >
371
+ <Dropdown overlay={
372
+ <Menu>
372
373
  <Menu.Item>
373
- <SortableTable
374
- ref={sortTableRef}
375
- setShowColumns={setShowColumns}
376
- showColumn={showColumn}
377
- datasource={value?.columns || []}
378
- bsTableCode={bsTableCode}
379
- />
374
+ <div
375
+ onClick={sortTableRef?.current?.showModal}
376
+ style={{fontSize:14, textAlign: 'center'}}
377
+ >列设置</div>
380
378
  </Menu.Item>
381
379
  <Menu.Item>
382
380
  <SearchItemTable
383
- ref={sortTableRef}
381
+ ref={searchTableRef}
384
382
  setShowSearchFields={setShowSearchFields}
385
383
  showSearchFields={showSearchFields}
386
384
  datasource={value?.fields || []}
@@ -388,7 +386,7 @@ export default (props: any) => {
388
386
  />
389
387
  </Menu.Item>
390
388
  </Menu>
391
- } placement="bottom" >
389
+ } placement="bottomRight" >
392
390
  <span className="ant-dropdown-link">
393
391
  <img width={32} src={shezhi} />
394
392
  </span>
@@ -523,5 +521,15 @@ export default (props: any) => {
523
521
  }),
524
522
  [value, checkedList, showColumn, props.statusMapping, showSearchFields],
525
523
  );
526
- return <MemoQueryTable {...memoConfig} />;
524
+ return <>
525
+ <MemoQueryTable {...memoConfig} />
526
+ <SortableTable
527
+ ref={sortTableRef}
528
+ setShowColumns={setShowColumns}
529
+ showColumn={showColumn}
530
+ datasource={value?.columns || []}
531
+ bsTableCode={bsTableCode}
532
+ onlyModal
533
+ />
534
+ </>;
527
535
  };
@@ -8,6 +8,7 @@ import {
8
8
  Input,
9
9
  Button,
10
10
  Tooltip,
11
+ Typography,
11
12
  } from 'antd';
12
13
  import {
13
14
  SortableContainer,
@@ -56,19 +57,23 @@ class SortableTable extends React.Component {
56
57
  fixed: item.fixed,
57
58
  }))
58
59
  : '';
59
- axios({
60
- url: '/user/appConfig/saveUserOrder',
61
- method: 'POST',
62
- data: {
63
- code: that.state.bsTableCode,
64
- detail: configvalue ? JSON.stringify(configvalue) : '',
65
- },
66
- }).then((res:any) => {
67
- if (res?.data?.status === '0') {
68
- this.patchConfigToLocalstorage(configvalue)
69
- } else {
70
- message.error('保存表头列自定义失败,请稍后尝试');
71
- }
60
+ return new Promise((resolve: any, reject: any) => {
61
+ axios({
62
+ url: '/user/appConfig/saveUserOrder',
63
+ method: 'POST',
64
+ data: {
65
+ code: that.state.bsTableCode,
66
+ detail: configvalue ? JSON.stringify(configvalue) : '',
67
+ },
68
+ }).then((res:any) => {
69
+ if (res?.data?.status === '0') {
70
+ this.patchConfigToLocalstorage(configvalue);
71
+ resolve({ status: '0' });
72
+ } else {
73
+ message.error('保存表头列自定义失败,请稍后尝试');
74
+ reject('');
75
+ }
76
+ })
72
77
  })
73
78
  };
74
79
 
@@ -447,7 +452,7 @@ class SortableTable extends React.Component {
447
452
  // this.patchUserColumnConfig('');
448
453
  // return;
449
454
  // }
450
- this.patchUserColumnConfig(sortDataSource);
455
+ return this.patchUserColumnConfig(sortDataSource);
451
456
  };
452
457
 
453
458
  handleCancel = (e: React.MouseEvent<HTMLElement>) => {
@@ -478,7 +483,17 @@ class SortableTable extends React.Component {
478
483
  ],
479
484
  },
480
485
  () => {
481
- this.handleOk();
486
+ this.handleOk()
487
+ .then((res: any) => {
488
+ if (res.status === '0') {
489
+ message.success(<span>
490
+ 字段已隐藏,如需重新显示请前往<Typography.Link
491
+ underline
492
+ onClick={this.showModal}
493
+ >列设置</Typography.Link>
494
+ </span>)
495
+ }
496
+ });
482
497
  },
483
498
  );
484
499
  };
@@ -606,6 +621,7 @@ class SortableTable extends React.Component {
606
621
  };
607
622
 
608
623
  render() {
624
+ const { onlyModal } = this.props;
609
625
  const {
610
626
  dataSource,
611
627
  searchDataSource,
@@ -823,7 +839,11 @@ class SortableTable extends React.Component {
823
839
  </div>
824
840
  </Modal>
825
841
  )}
826
- <div onClick={this.showModal} style={{fontSize:14}}>列设置</div>
842
+ {
843
+ !onlyModal
844
+ ? <div onClick={this.showModal} style={{fontSize:14}}>列设置</div>
845
+ : ''
846
+ }
827
847
  </div>
828
848
  );
829
849
  }
@@ -572,33 +572,35 @@ export const renderFixed2 = (text: any) => text;
572
572
  //设置queryTable默认列宽
573
573
  export const getItemDefaultWidth = (item: any) => {
574
574
  let defaultWidth = 200;
575
- let lowerCaseKey = (item.key || item.dataIndex).toLowerCase();
576
- switch (true) {
577
- case item?.title === '操作' || lowerCaseKey === 'operate':
578
- defaultWidth = 60;
579
- break;
580
- case lowerCaseKey.indexOf('number') > -1:
581
- case lowerCaseKey.indexOf('quantity') > -1:
582
- case lowerCaseKey.indexOf('amount') > -1:
583
- defaultWidth = 90;
584
- break;
585
- case (lowerCaseKey.indexOf('no') > -1):
586
- defaultWidth = 200;
587
- break;
588
- case lowerCaseKey.indexOf('code') > -1:
589
- defaultWidth = 170;
590
- break;
591
- case lowerCaseKey.indexOf('time') > -1:
592
- defaultWidth = 130;
593
- break;
594
- case lowerCaseKey.indexOf('status') > -1:
595
- defaultWidth = 100;
596
- break;
597
- case lowerCaseKey.indexOf('user') > -1:
598
- defaultWidth = 130;
599
- break;
600
- default:
601
- break;
575
+ let lowerCaseKey = (item.key || item.dataIndex)?.toLowerCase();
576
+ if (lowerCaseKey) {
577
+ switch (true) {
578
+ case item?.title === '操作' || lowerCaseKey === 'operate':
579
+ defaultWidth = 60;
580
+ break;
581
+ case lowerCaseKey.indexOf('number') > -1:
582
+ case lowerCaseKey.indexOf('quantity') > -1:
583
+ case lowerCaseKey.indexOf('amount') > -1:
584
+ defaultWidth = 90;
585
+ break;
586
+ case (lowerCaseKey.indexOf('no') > -1):
587
+ defaultWidth = 200;
588
+ break;
589
+ case lowerCaseKey.indexOf('code') > -1:
590
+ defaultWidth = 170;
591
+ break;
592
+ case lowerCaseKey.indexOf('time') > -1:
593
+ defaultWidth = 130;
594
+ break;
595
+ case lowerCaseKey.indexOf('status') > -1:
596
+ defaultWidth = 100;
597
+ break;
598
+ case lowerCaseKey.indexOf('user') > -1:
599
+ defaultWidth = 130;
600
+ break;
601
+ default:
602
+ break;
603
+ }
602
604
  }
603
605
  return defaultWidth;
604
606
  };
@@ -608,7 +610,7 @@ export const getItemDefaultWidth = (item: any) => {
608
610
  * @param params 要应用于查询的参数
609
611
  * @returns 返回处理后的查询参数
610
612
  */
611
- export function queryParams(params: any, flag?: any) {
613
+ export function queryParams(params: any, flag?: any) {
612
614
  for (const key in params) {
613
615
  if (Object.prototype.hasOwnProperty.call(params, key)) {
614
616
  const element = params[key];
@@ -678,7 +680,7 @@ export const getItemDefaultWidth = (item: any) => {
678
680
  * @param code 对应权限值
679
681
  * @returns boolean
680
682
  */
681
- export const authFn = (code?: any) => {
683
+ export const authFn = (code?: any) => {
682
684
  const authButton = localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES)
683
685
  ? JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES) as string)
684
686
  : [];
@@ -12,6 +12,7 @@ export default (props:any)=>{
12
12
  codeProps='',
13
13
  moduleType,
14
14
  moduleRelationId,
15
+ tableFlag = false
15
16
  } = props;
16
17
 
17
18
  const ref = useRef(null);
@@ -108,6 +109,9 @@ export default (props:any)=>{
108
109
  key: 'codeSnippet',
109
110
  title: '代码片段',
110
111
  render: ({text,record}:any) => {
112
+ if(tableFlag){
113
+ return <div> 列表:{`{"key": "extensionFields,${record.code}","dataIndex": "extensionFields,${record.code}","title": "${record.name}"},`}</div>
114
+ }
111
115
  if (!codeProps.columns) {
112
116
  return <div>表单:{`{"name": "extensionFields,${record.code}","label": "${record.name}"},`}</div>
113
117
  }
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
- import React, { useState, useRef, useEffect } from 'react';
3
- import { message, Button, Table } from 'antd';
2
+ import React, { useState, useRef, useEffect, Fragment } from 'react';
3
+ import { message, Button, Table, Tabs } from 'antd';
4
4
  import Drawer from './drawer';
5
5
  import ConfigButton from './configButton';
6
6
  import Editor from './jsonEditor';
@@ -76,13 +76,28 @@ function convertFileds (fields, falltValue, faltFieldRange, containerName) {
76
76
  field.fields.forEach(item => {
77
77
  const targetValue = convertFileds(item, falltValue, faltFieldRange, field?.container?.name);
78
78
  if(targetValue){
79
+ if(item.dependency) {
80
+ targetValue.dependency = {
81
+ visible: {
82
+ ...item.dependency.visible,
83
+ type: (new Function('axios','ctx', item.dependency.visible.type)).bind(null, axios)
84
+ }
85
+ }
86
+ }
79
87
  filedsValue.push(targetValue)
80
88
  }
81
89
  })
82
90
  } else {
83
91
  const returnField = field.isStaticCode ? falltValue[containerName ? (containerName + field.name) : field.name] : faltFieldRange[field.name];
84
92
  if (returnField) {
85
- returnField.label = field?.label;
93
+ returnField.label = field?.label;
94
+ if(field?.disabled){ // 字段设置只读属性
95
+ returnField.field.props.disabled = true;
96
+ }
97
+ if(field?.invisible){ // 字段设置不可见属性
98
+ returnField.initialVisible = false;
99
+ }
100
+
86
101
  if(Array.isArray(returnField.name)&&returnField.name?.includes("extensionFields")){
87
102
  returnField.notShowLabel = true;
88
103
  }
@@ -120,16 +135,45 @@ function faltCustomerFieldRange(fileds) {
120
135
  return columnsValue;
121
136
  }
122
137
 
123
- function hanleCallbackValue(codeProps, value, customerFields) {
124
- const faltFieldRange = faltCustomerFieldRange(customerFields)
125
- const falltValue = flatFileds({fields: codeProps.fields})
138
+ //form存在新加container属性分组得情况 组合操作
139
+ function combineContainer(originFields, currentFields){
140
+ let newCurrentFields = [...originFields];
141
+ currentFields.map((item: any) => {
142
+ if(!originFields.find((i: any) => i?.container?.props?.name == item?.container?.name)){
143
+ newCurrentFields = [...newCurrentFields, {
144
+ container: {
145
+ type: 'card',
146
+ props: {
147
+ title: item?.container?.title,
148
+ level: 1,
149
+ id: Math.random(),
150
+ isWhiteCard: true,
151
+ bordered: false,
152
+ name: item?.container?.name,
153
+ },
154
+ },
155
+ fields: item?.fields || []
156
+ }];
157
+ }
158
+ })
159
+ return newCurrentFields;
160
+ }
161
+
162
+ function hanleCallbackValue(codeProps, value, customerFields, cacheColumns = []) {
163
+ const faltFieldRange = faltCustomerFieldRange(customerFields);
164
+ // const falltValue = flatFileds({fields: codeProps.fields})
165
+ const falltValue = flatFileds({fields: combineContainer(codeProps.fields, value?.fields)})
126
166
  let newCodeProps = {...codeProps};
127
167
  newCodeProps.fields = convertFileds({fields: value.fields}, falltValue, faltFieldRange).fields;
128
168
  if (codeProps.columns) {
129
169
  const faltColumnsValue = faltColumns(codeProps.columns)
130
170
  newCodeProps.columns = value.columns.map(item => {
131
171
  if (item.isStaticCode) {
132
- return faltColumnsValue[item.key]
172
+ const cacheFieldProperty = cacheColumns.find(k => (k.key||k.dataIndex) == (item.key||item.dataIndex));
173
+ return {
174
+ ...faltColumnsValue[item.key],
175
+ ...cacheFieldProperty
176
+ }
133
177
  } else {
134
178
  //自定义字段-列字段
135
179
  if(item?.key&&item?.key.includes('extensionFields')&&item?.key.includes(',')){
@@ -137,10 +181,19 @@ function hanleCallbackValue(codeProps, value, customerFields) {
137
181
  ...item,
138
182
  render: ({ record }: any) => {
139
183
  try{
140
- const lastName1= item?.key.split(',')[1]; //兼容没有fieldName的情况
141
- const lastName2 = `${lastName1}Name`;
142
- const target = record?.extensionFields || {};
143
- return target[lastName2] || target[lastName1] || '';
184
+ const { extensionFields = {} } = record;
185
+ const fieldName1= item?.key.split(',')[1]; //兼容没有fieldName的情况
186
+ const fieldName2 = `${fieldName1}Name`;
187
+ if(customerFields.length){
188
+ const targetField = customerFields.find(k => k.name.includes(fieldName1));
189
+ if(targetField){
190
+ const { initialSource = [] } = targetField
191
+ if(initialSource.length){
192
+ return initialSource.find((d => d.value == extensionFields[fieldName1]))?.text || extensionFields[fieldName1];
193
+ }
194
+ }
195
+ }
196
+ return extensionFields[fieldName2] || extensionFields[fieldName1] || '';
144
197
  }catch(e){
145
198
  console.log('e',e);
146
199
  }
@@ -205,11 +258,13 @@ const tableStyleList = [
205
258
  ];
206
259
  const JsonQueryTable = React.memo(props => {
207
260
  const {
208
- callBack,
209
- codeProps,
210
- customerFields,
211
- initialSetting,
212
- pageType
261
+ callBack, // 主保存函数回调
262
+ codeProps, // 整体的配置数据
263
+ customerFields, //可选的配置字段
264
+ initialSetting, //上一次添加自定义字段后保存的数据
265
+ pageType, //页面权限code
266
+ detailTablesSetting = [], //详情明细表格列配置数据
267
+ saveTableCallBack, //详情明细保存函数回调
213
268
  } = props;
214
269
 
215
270
  let codeFilter = {};
@@ -229,7 +284,6 @@ const JsonQueryTable = React.memo(props => {
229
284
  } else {
230
285
  codeFilter.fields = iterFileds({fields: codeProps.fields}).fields
231
286
  }
232
- console.log('codeFilter',codeFilter)
233
287
 
234
288
  const styleRef = useRef(null);
235
289
 
@@ -238,6 +292,9 @@ const JsonQueryTable = React.memo(props => {
238
292
  const [init, setInit] = useState(true);
239
293
  const [jsonEditorVal, setJsonEditorVal] = useState(initialSetting || codeFilter);
240
294
  const [moduleParams, setModuleParams] = useState({});
295
+ const [activeKey, setActiveKey] = useState('main'); //默认详情页配置
296
+ const [tablesConfigParams, setTablesConfigParams] = useState({});
297
+ const [tableJsonEditorValsArr, setTableJsonEditorValsArr] = useState([]);
241
298
 
242
299
  useEffect(()=>{
243
300
  Promise.all([
@@ -258,6 +315,69 @@ const JsonQueryTable = React.memo(props => {
258
315
  })
259
316
  },[]);
260
317
 
318
+ useEffect(()=>{
319
+ //明细表的配置数据
320
+ const axiosArr = detailTablesSetting.map((item:any) => axios.get(`/basic/flow/businessFieldGroup/one?moduleType=2&layoutPoint=${item.tableCode}`));
321
+ Promise.all(axiosArr).then(([...resArr])=> {
322
+ let configParams = {};
323
+ detailTablesSetting.map((item:any, index:number)=>{
324
+ const { code, data } = resArr[index]?.data || {};
325
+ if(data){
326
+ const { businessType, code:fieldGroup, moduleType } = data;
327
+ configParams [item.tableCode] = {
328
+ businessType,
329
+ fieldGroup,
330
+ moduleType,
331
+ tableFlag: true
332
+ }
333
+ }
334
+ })
335
+ setTablesConfigParams({
336
+ ...configParams,
337
+ });
338
+ })
339
+
340
+ const detailTableCodeFilter = detailTablesSetting.map(item => {
341
+ if(item?.initialSetting && item?.initialSetting.length){
342
+ return {
343
+ ...item,
344
+ columns: item?.initialSetting
345
+ }
346
+ }
347
+ return {
348
+ ...item,
349
+ columns: item?.columns.map(childItem => ({
350
+ key: childItem.key || childItem.dataIndex,
351
+ dataIndex: childItem.dataIndex || childItem.key,
352
+ isStaticCode: true,
353
+ title: childItem.title
354
+ }))
355
+ }
356
+ });
357
+ setTableJsonEditorValsArr([...detailTableCodeFilter]);
358
+ const lastRes = detailTableCodeFilter.map(item => {
359
+ if(item?.initialSetting && item?.initialSetting.length){
360
+ const codeProps = {
361
+ fields: [],
362
+ columns: item?.columns,
363
+ };
364
+ const newValue = {
365
+ fields: [],
366
+ columns: item.initialSetting
367
+ };
368
+ const result = hanleCallbackValue(codeProps, newValue, item?.customerFields, item?.cacheColumns);
369
+ return {
370
+ ...item,
371
+ columns: result?.columns
372
+ }
373
+ }
374
+ return item;
375
+ });
376
+ if(lastRes.length){
377
+ saveTableCallBack(lastRes, false);
378
+ }
379
+ },[detailTablesSetting.length]);
380
+
261
381
  const onClickRun = (value, isSave) => {
262
382
  setJsonEditorVal(value);
263
383
 
@@ -269,6 +389,38 @@ const JsonQueryTable = React.memo(props => {
269
389
  }
270
390
  };
271
391
 
392
+ //明细表保存
393
+ const onClickRunDetailTables = (value, isSave, tableCode, tableSouce) =>{
394
+ const targetCode = tableCode || activeKey;
395
+ const targetTableSource = tableSouce || tableJsonEditorValsArr;
396
+ const newArr = targetTableSource.map(item => {
397
+ if(item.tableCode == targetCode){
398
+ return {
399
+ ...item,
400
+ columns: value
401
+ }
402
+ }
403
+ return item
404
+ });
405
+ setTableJsonEditorValsArr([...newArr]);
406
+
407
+ try {
408
+ const target = targetTableSource.find(item=>item.tableCode == targetCode);
409
+ const codeProps = {
410
+ fields: [],
411
+ columns: target?.columns,
412
+ };
413
+ const newValue = {
414
+ fields: [],
415
+ columns: value
416
+ };
417
+ const result = hanleCallbackValue(codeProps, newValue, target?.customerFields, target?.cacheColumns);
418
+ saveTableCallBack({ columns: result.columns, tableCode: targetCode }, isSave, value);
419
+ } catch (e) {
420
+ message.error(e);
421
+ }
422
+ }
423
+
272
424
  React.useEffect(() => {
273
425
  localStorage.setItem('jsonEditorVal',JSON.stringify(jsonEditorVal||{}))
274
426
  }, [jsonEditorVal]);
@@ -291,25 +443,88 @@ const JsonQueryTable = React.memo(props => {
291
443
 
292
444
  return (
293
445
  <div>
294
- <Drawer visible={visible} width={800} onClose={() => setVisible(false)} className={'customFieldsDrawer'}>
295
- <div ref={styleRef}>
296
-
297
- </div>
298
- {
299
- isEmpty(moduleParams)?(
300
- <div style={{padding:"10px 0", fontSize:"16px", fontWeight:"bolder"}}>
301
- 提示:业务对象未维护,请在通用单据对应业务类型下维护业务对象
446
+ <Drawer visible={visible} width={1400} onClose={() => setVisible(false)} className={'customFieldsDrawer'}>
447
+ {
448
+ detailTablesSetting.length == 0 &&(
449
+ <div style={{display: 'flex'}}>
450
+ <div style={{flex: 1, width: 500}}>
451
+ {
452
+ isEmpty(moduleParams)?(
453
+ <div style={{padding:"10px 0", fontSize:"16px", fontWeight:"bolder"}}>
454
+ 提示:业务对象未维护,请在通用单据对应业务类型下维护业务对象
455
+ </div>
456
+ ):(
457
+ <FieldsSettingsTable {...tableParams}/>
458
+ )
459
+ }
460
+ </div>
461
+ <div style={{flex: 1}}>
462
+ <Editor
463
+ type="table"
464
+ onRun={onClickRun}
465
+ value={jsonEditorVal}
466
+ shallowHeight={height}
467
+ />
468
+ </div>
302
469
  </div>
303
- ):(
304
- <FieldsSettingsTable {...tableParams}/>
305
470
  )
306
471
  }
307
- <Editor
308
- type="table"
309
- onRun={onClickRun}
310
- value={jsonEditorVal}
311
- shallowHeight={height}
312
- />
472
+ {
473
+ detailTablesSetting.length > 0 && (
474
+ <Tabs defaultActiveKey={activeKey} onChange={(v: any) => setActiveKey(v)}>
475
+ <Tabs.TabPane tab="详情页配置" key="main">
476
+ <div style={{display: 'flex'}}>
477
+ <div style={{flex: 1, width: 500}}>
478
+ {
479
+ isEmpty(moduleParams)?(
480
+ <div style={{padding:"10px 0", fontSize:"16px", fontWeight:"bolder"}}>
481
+ 提示:业务对象未维护,请在通用单据对应业务类型下维护业务对象
482
+ </div>
483
+ ):(
484
+ <FieldsSettingsTable {...tableParams}/>
485
+ )
486
+ }
487
+ </div>
488
+ <div style={{flex: 1}}>
489
+ <Editor
490
+ type="table"
491
+ onRun={onClickRun}
492
+ value={jsonEditorVal}
493
+ shallowHeight={height}
494
+ />
495
+ </div>
496
+ </div>
497
+ </Tabs.TabPane>
498
+ {
499
+ tableJsonEditorValsArr.map((k:any)=>(
500
+ <Tabs.TabPane tab={k.title} key={k.tableCode}>
501
+ <div style={{display: 'flex'}}>
502
+ <div style={{flex: 1, width: 500}}>
503
+ {
504
+ !tablesConfigParams[k.tableCode]?(
505
+ <div style={{padding:"10px 0", fontSize:"16px", fontWeight:"bolder"}}>
506
+ 提示:业务对象未维护,请在通用单据对应业务类型下维护业务对象
507
+ </div>
508
+ ):(
509
+ <FieldsSettingsTable {...tablesConfigParams[k.tableCode]}/>
510
+ )
511
+ }
512
+ </div>
513
+ <div style={{flex: 1}}>
514
+ <Editor
515
+ type="table"
516
+ onRun={onClickRunDetailTables}
517
+ value={k.columns}
518
+ shallowHeight={height}
519
+ />
520
+ </div>
521
+ </div>
522
+ </Tabs.TabPane>
523
+ ))
524
+ }
525
+ </Tabs>
526
+ )
527
+ }
313
528
  </Drawer>
314
529
 
315
530
  {!visible && isAdmin() && <ConfigButton type='primary' onClick={() => setVisible(true)}>setting</ConfigButton>}
@@ -13,7 +13,7 @@ const normalMultipleSelectProps = {
13
13
  },
14
14
  };
15
15
  // inputType显示类型 10输入框 20单选 30多选 40公式 ||||| valueType字段类型
16
- export const inputTypes:any = {
16
+ export const inputTypes: any = {
17
17
  20: {
18
18
  10: {
19
19
  type: 'select',
@@ -128,7 +128,7 @@ export const inputTypes:any = {
128
128
  type: 'bs-employeeSearchSelect',
129
129
  props: {
130
130
  ...normalSingleSelectProps,
131
- requestConfig: { mappingValueField: 'employeeNumber' },
131
+ requestConfig: { mappingValueField: 'employeeNumber', filterInit: 'qp-employeeNumber-like', },
132
132
  },
133
133
  },
134
134
  280: {
@@ -291,7 +291,7 @@ export const inputTypes:any = {
291
291
  type: 'bs-employeeSearchSelect',
292
292
  props: {
293
293
  ...normalMultipleSelectProps,
294
- requestConfig: { mappingValueField: 'employeeNumber' },
294
+ requestConfig: { mappingValueField: 'employeeNumber', filterInit: 'qp-employeeNumber-like', },
295
295
  },
296
296
  },
297
297
  280: {
@@ -368,13 +368,13 @@ export const choiceType = Object.freeze({
368
368
  340: '规则模板选择器',
369
369
  350: '营销区域选择器',
370
370
  });
371
- export const inputType:any ={
371
+ export const inputType: any = {
372
372
  10: '输入',
373
373
  20: '单选',
374
374
  30: '多选',
375
375
  40: '公式',
376
376
  };
377
- export const valueType:any = {
377
+ export const valueType: any = {
378
378
  10: '文本',
379
379
  20: '短整数',
380
380
  21: '长整数',