@bit-sun/business-component 4.0.13-alpha.9 → 4.2.0-alpha.1

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 (76) hide show
  1. package/.umirc.ts +21 -10
  2. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +5 -2
  3. package/dist/components/Business/DetailPageWrapper/index.d.ts +6 -0
  4. package/dist/components/Business/ItemPropertySelector/index.d.ts +3 -0
  5. package/dist/components/Business/ModalUtils/index.d.ts +8 -0
  6. package/dist/components/Business/SearchSelect/utils.d.ts +4 -2
  7. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +3 -2
  8. package/dist/components/Business/columnSettingTable/index.d.ts +19 -2
  9. package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +20 -3
  10. package/dist/components/Functional/DataValidation/index.d.ts +11 -1
  11. package/dist/components/Functional/QueryMutipleInput/index.d.ts +2 -1
  12. package/dist/components/Functional/SearchSelect/utils.d.ts +2 -1
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.esm.js +2233 -1001
  15. package/dist/index.js +2233 -1000
  16. package/dist/plugin/TableColumnSetting/index.d.ts +1 -0
  17. package/package.json +16 -14
  18. package/src/assets/btn-cancel.svg +3 -0
  19. package/src/assets/btn-copy.svg +3 -0
  20. package/src/assets/btn-delete.svg +2 -29
  21. package/src/assets/btn-edit.svg +2 -19
  22. package/src/assets/btn-hangUp.svg +3 -0
  23. package/src/assets/btn-print.svg +3 -0
  24. package/src/assets/btn-refresh.svg +3 -0
  25. package/src/assets/btn-unhook.svg +3 -0
  26. package/src/components/Business/AddSelectBusiness/index.md +8 -2
  27. package/src/components/Business/AddSelectBusiness/index.tsx +3 -0
  28. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +1 -1
  29. package/src/components/Business/BsLayouts/Components/RightContent/home.less +1 -1
  30. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +2 -2
  31. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +6 -4
  32. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +0 -4
  33. package/src/components/Business/BsSulaQueryTable/index.less +5 -3
  34. package/src/components/Business/BsSulaQueryTable/index.md +45 -32
  35. package/src/components/Business/BsSulaQueryTable/index.tsx +153 -76
  36. package/src/components/Business/BsSulaQueryTable/setting.tsx +40 -10
  37. package/src/components/Business/BsSulaQueryTable/utils.less +1 -1
  38. package/src/components/Business/BsSulaQueryTable/utils.tsx +15 -12
  39. package/src/components/Business/CommodityEntry/index.md +1 -1
  40. package/src/components/Business/CommodityEntry/index.tsx +11 -9
  41. package/src/components/Business/DetailPageWrapper/index.less +1 -1
  42. package/src/components/Business/DetailPageWrapper/index.tsx +24 -5
  43. package/src/components/Business/DetailPageWrapper/utils.tsx +7 -2
  44. package/src/components/Business/HomePageWrapper/index.less +1 -1
  45. package/src/components/Business/ItemPropertySelector/index.tsx +88 -0
  46. package/src/components/Business/JsonQueryTable/function.ts +1 -1
  47. package/src/components/Business/ModalUtils/index.tsx +45 -0
  48. package/src/components/Business/SearchSelect/BusinessUtils.tsx +284 -57
  49. package/src/components/Business/SearchSelect/index.md +4 -4
  50. package/src/components/Business/SearchSelect/utils.ts +26 -4
  51. package/src/components/Business/columnSettingTable/columnSetting.tsx +27 -11
  52. package/src/components/Business/columnSettingTable/index.less +5 -3
  53. package/src/components/Business/columnSettingTable/index.md +200 -136
  54. package/src/components/Business/columnSettingTable/index.tsx +167 -39
  55. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +178 -47
  56. package/src/components/Functional/AddSelect/index.tsx +39 -12
  57. package/src/components/Functional/BillEntry/index.less +3 -0
  58. package/src/components/Functional/DataValidation/index.md +1 -0
  59. package/src/components/Functional/DataValidation/index.tsx +138 -23
  60. package/src/components/Functional/QueryMutipleInput/index.tsx +11 -2
  61. package/src/components/Functional/QueryMutipleSelect/index.tsx +2 -1
  62. package/src/components/Functional/SearchSelect/index.less +4 -0
  63. package/src/components/Functional/SearchSelect/index.tsx +61 -20
  64. package/src/components/Functional/SearchSelect/utils.tsx +13 -10
  65. package/src/components/Functional/TreeSearchSelect/index.tsx +2 -1
  66. package/src/components/Solution/RuleComponent/InnerSelect.tsx +1 -0
  67. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +2 -1
  68. package/src/components/Solution/RuleComponent/index.js +74 -4
  69. package/src/components/Solution/RuleComponent/ruleFiled.js +1 -1
  70. package/src/index.ts +1 -0
  71. package/src/plugin/TableColumnSetting/index.less +5 -3
  72. package/src/plugin/TableColumnSetting/index.tsx +79 -12
  73. package/src/styles/bsDefault.less +9 -3
  74. package/src/utils/TableUtils.less +1 -1
  75. package/src/utils/request.ts +8 -4
  76. package/src/utils/utils.ts +11 -15
@@ -688,6 +688,7 @@ class RuleObjectComponent extends Component {
688
688
  initialThresholdQuery = {},
689
689
  disabled,
690
690
  systemVariableList,
691
+ needShowInsertSQL,
691
692
  } = this.props;
692
693
  let thresholdQuery = {
693
694
  ...initialThresholdQuery,
@@ -825,6 +826,9 @@ class RuleObjectComponent extends Component {
825
826
  itemDetail.metaObjectCode =
826
827
  nodeInfo.triggerNode.props.metaObjectCode;
827
828
  itemDetail.isInsertParam = false;
829
+ if(needShowInsertSQL) {
830
+ itemDetail.isInsertSQL = false;
831
+ }
828
832
  this.setState(
829
833
  {
830
834
  ruleClassData,
@@ -862,7 +866,7 @@ class RuleObjectComponent extends Component {
862
866
  ),
863
867
  )}
864
868
  </Select>
865
- {!itemDetail?.isInsertParam ? (
869
+ {(needShowInsertSQL ? (!itemDetail?.isInsertParam&&!itemDetail?.isInsertSQL): !itemDetail?.isInsertParam) ? (
866
870
  <RuleField
867
871
  customerWidth={this.props.customerWidth}
868
872
  selectOperation={itemDetail?.operationCode || ''}
@@ -926,6 +930,30 @@ class RuleObjectComponent extends Component {
926
930
  ))
927
931
  : null}
928
932
  </Select>
933
+ <Input
934
+ disabled={disabled}
935
+ value={itemDetail?.params?.[0]||''}
936
+ style={{
937
+ width: '150px',
938
+ marginLeft: '10px',
939
+ display: needShowInsertSQL && itemDetail?.isInsertSQL ? '' : 'none',
940
+ }}
941
+ onChange={(e) => {
942
+ const value = e.target.value;
943
+ const { ruleClassData } = this.state;
944
+ itemDetail.params = [value || ''];
945
+ itemDetail.paramNames = [''];
946
+ this.setState(
947
+ {
948
+ ruleClassData,
949
+ },
950
+ () => {
951
+ callBack(ruleClassData);
952
+ },
953
+ );
954
+ }}
955
+ >
956
+ </Input>
929
957
  <PlusCircleOutlined
930
958
  className={'icon_btn_style'}
931
959
  onClick={() => {
@@ -985,6 +1013,36 @@ class RuleObjectComponent extends Component {
985
1013
  >
986
1014
  {itemDetail?.isInsertParam ? '取消插入参数' : '插入参数'}
987
1015
  </Button>
1016
+ <Button
1017
+ type="link"
1018
+ disabled={
1019
+ disabled ||
1020
+ (itemDetail.operationCode === '' || !itemDetail.operationCode
1021
+ ? true
1022
+ : false)
1023
+ }
1024
+ style={needShowInsertSQL?{}:{ display: 'none'}}
1025
+ onClick={() => {
1026
+ const { ruleClassData } = this.state;
1027
+ itemDetail.isInsertSQL = !itemDetail.isInsertSQL;
1028
+ if (itemDetail.isInsertSQL) {
1029
+ itemDetail.type = 30;
1030
+ itemDetail.paramNames = [];
1031
+ itemDetail.params = [];
1032
+ }
1033
+
1034
+ this.setState(
1035
+ {
1036
+ ruleClassData,
1037
+ },
1038
+ () => {
1039
+ callBack(ruleClassData);
1040
+ },
1041
+ );
1042
+ }}
1043
+ >
1044
+ {itemDetail?.isInsertSQL ? '取消插入SQL' : '插入SQL'}
1045
+ </Button>
988
1046
  </div>
989
1047
  )}
990
1048
  <div
@@ -1082,7 +1140,12 @@ class RuleObjectComponent extends Component {
1082
1140
  let value = val;
1083
1141
  if (isObj(code)) {
1084
1142
  Object.keys(code).forEach((ite) => {
1085
- this.handleEditExtraInfoResponse(ite, code[ite], parentDetail,classDataIndex);
1143
+ this.handleEditExtraInfoResponse(
1144
+ ite,
1145
+ code[ite],
1146
+ parentDetail,
1147
+ classDataIndex,
1148
+ );
1086
1149
  });
1087
1150
  return;
1088
1151
  }
@@ -1090,9 +1153,16 @@ class RuleObjectComponent extends Component {
1090
1153
  value = val.map((m) => m.value || m).join(',');
1091
1154
  }
1092
1155
  if (isObj(val)) {
1093
- value = val.value || val.PCDCode?.join('/');
1156
+ value = val?.value || val.PCDCode?.join('/') || val;
1094
1157
  }
1095
- this.handleEditExtraInfoResponse('value', value, parentDetail,classDataIndex,code);
1158
+
1159
+ this.handleEditExtraInfoResponse(
1160
+ 'value',
1161
+ value,
1162
+ parentDetail,
1163
+ classDataIndex,
1164
+ code,
1165
+ );
1096
1166
  };
1097
1167
 
1098
1168
  return (
@@ -286,7 +286,7 @@ export default class RuleField extends Component {
286
286
  } = this.props;
287
287
  const { thresholdList } = this.state;
288
288
  const styleCommon = {
289
- width: customerWidth || '150px',
289
+ width: customerWidth || '180px',
290
290
  };
291
291
  if (!selectOperation) return <Input disabled style={styleCommon}></Input>;
292
292
  const SET_TYPE = ['in', 'nin', 'cn', 'ncn','5']; //集合类型 (数字为 兼容用户管理子应用使用规则组件)
package/src/index.ts CHANGED
@@ -37,6 +37,7 @@ export { default as TableColumnSetting} from './plugin/TableColumnSetting';
37
37
  export { default as AuthButton } from './components/Functional/AuthButton';
38
38
  export { default as CustomSelector } from './components/Solution/RuleComponent/CustomPlugin/CustomSelector';
39
39
  export { default as PropertySelector} from './components/Business/PropertyModal';
40
+ export { default as ModalUtils } from './components/Business/ModalUtils';
40
41
 
41
42
  export { default as EllipsisTooltip} from './components/Functional/EllipsisTooltip';
42
43
  export * from './components/Functional/BsAntdSula/index';
@@ -151,16 +151,18 @@
151
151
  }
152
152
  }
153
153
 
154
- .ant-table-wrapper::-webkit-scrollbar {
154
+ .ant-table-tbody::-webkit-scrollbar {
155
155
  display: none;
156
156
  }
157
157
 
158
158
  .ant-table-wrapper {
159
159
  margin-top: 10px;
160
- height: 364px;
161
- overflow: scroll;
162
160
  padding-bottom: 50px;
163
161
 
162
+ tbody tr:first-child {
163
+ display: none;
164
+ }
165
+
164
166
  tr {
165
167
  height: 30px;
166
168
  td {
@@ -411,7 +411,7 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
411
411
  DraggableContainer = (props: any) => (
412
412
  <SortableBody
413
413
  useDragHandle
414
- disableAutoscroll
414
+ lockAxis='y'
415
415
  helperClass="row-dragging"
416
416
  onSortEnd={this.onSortEnd}
417
417
  {...props}
@@ -422,9 +422,9 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
422
422
  const { sortDataSource } = this.state;
423
423
  // function findIndex base on Table rowKey props and should always be a right array index
424
424
  const index = sortDataSource.findIndex(
425
- (x:any) => x.key === restProps['data-row-key'],
425
+ (x:any) => (x.key||x.dataIndex) == restProps['data-row-key'],
426
426
  );
427
- return <SortableItem index={index} {...restProps} />;
427
+ return <SortableItem key={restProps['data-row-key']} index={index} {...restProps} />;
428
428
  };
429
429
 
430
430
  onChange = (e: any, title: any) => {
@@ -495,6 +495,56 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
495
495
  this.setInitValue(datasource);
496
496
  };
497
497
 
498
+ handleResetSetting = () => {
499
+ const { setShowColumns, datasource = [], setInitialTableInfo, appRequestConfig }: any = this.props;
500
+ let that = this;
501
+ let { bsTableCode } = this.state;
502
+
503
+ return new Promise((resolve: any, reject: any) => {
504
+ request({
505
+ url: handleRequestUrl('/user','/appConfig/saveUserOrder', appRequestConfig),
506
+ method: 'POST',
507
+ data: {
508
+ code: that.state.bsTableCode,
509
+ detail: '',
510
+ },
511
+ }).then((res:any) => {
512
+ if (judgeIsRequestSuccess(res?.data)) {
513
+ let config =
514
+ localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
515
+ let configArray = JSON.parse(config);
516
+ let currentSetting = configArray.filter(
517
+ (item) => item.code === bsTableCode,
518
+ );
519
+ if (currentSetting.length) {
520
+ currentSetting[0].detail = JSON.stringify([]);
521
+ } else {
522
+ configArray.push({
523
+ code: bsTableCode,
524
+ detail: JSON.stringify([]),
525
+ });
526
+ }
527
+
528
+ localStorage.setItem(
529
+ ENUM.BROWSER_CACHE.COLUMN_CONDITION,
530
+ JSON.stringify(configArray),
531
+ );
532
+
533
+ message.success('重置表头列成功!');
534
+
535
+ setInitialTableInfo(true);
536
+ this.setState({
537
+ visible: false,
538
+ });
539
+ } else {
540
+ message.error('重置表头列自定义失败,请稍后尝试');
541
+ reject('');
542
+ }
543
+ });
544
+ })
545
+ };
546
+
547
+
498
548
  onSearch = (e: any) => {
499
549
  this.setState({
500
550
  searchDataSource: e.target.value,
@@ -532,15 +582,31 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
532
582
  onOk={this.handleOk}
533
583
  onCancel={this.handleCancel}
534
584
  footer={[
535
- <Button key="back" onClick={this.handleReset}>
536
- 恢复默认
537
- </Button>,
538
- <Button key="submit" onClick={this.handleOk}>
539
- 取消
540
- </Button>,
541
- <Button key="submit" type="primary" onClick={this.handleOk}>
542
- 确认
543
- </Button>,
585
+ <div>
586
+ <Button
587
+ key="back"
588
+ onClick={this.handleReset}
589
+ style={{ marginRight: 0 }}
590
+ >
591
+ 恢复默认
592
+ </Button>
593
+ <Button key="back" onClick={this.handleResetSetting}>
594
+ 重置设置
595
+ </Button>
596
+ <span style={{fontSize: '12px', color: '8A8F8D'}}>(列表字段变更会影响列设置功能,变更后请点击重置然后重新设置)</span>
597
+ </div>,
598
+ <div>
599
+ <Button
600
+ key="submit"
601
+ onClick={this.handleCancel}
602
+ style={{ marginRight: 0 }}
603
+ >
604
+ 取消
605
+ </Button>
606
+ <Button key="submit" type="primary" onClick={this.handleOk}>
607
+ 确认
608
+ </Button>
609
+ </div>,
544
610
  ]}
545
611
  >
546
612
  <div className={'sort_table'}>
@@ -709,6 +775,7 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
709
775
  row: this.DraggableBodyRow,
710
776
  },
711
777
  }}
778
+ scroll={{ y: 364 }}
712
779
  />
713
780
  </div>
714
781
  </div>
@@ -1469,8 +1469,12 @@ body .ant-table .ant-table-container .ant-table-thead > tr > th {
1469
1469
  .table_odd {
1470
1470
  background: #f7f8fb;
1471
1471
  }
1472
+ .table_gray {
1473
+ background: #D3D3D3;
1474
+ }
1472
1475
  // 浮起的列 设置斑马
1473
1476
  .table_base,
1477
+ .table_gray,
1474
1478
  .table_odd {
1475
1479
 
1476
1480
  .ant-table-cell-fix-left,
@@ -1908,16 +1912,18 @@ body .ant-table .ant-table-container .ant-table-thead > tr > th {
1908
1912
  }
1909
1913
  }
1910
1914
 
1911
- .ant-table-wrapper::-webkit-scrollbar {
1915
+ .ant-table-tbody::-webkit-scrollbar {
1912
1916
  display: none;
1913
1917
  }
1914
1918
 
1915
1919
  .ant-table-wrapper {
1916
1920
  margin-top: 10px;
1917
- height: 364px;
1918
- overflow: scroll;
1919
1921
  padding-bottom: 50px;
1920
1922
 
1923
+ tbody tr:first-child {
1924
+ display: none;
1925
+ }
1926
+
1921
1927
  tr {
1922
1928
  height: 30px;
1923
1929
  td {
@@ -48,5 +48,5 @@
48
48
  }
49
49
 
50
50
  .card_department {
51
- color: #005cff !important;
51
+ color: #005CFF !important;
52
52
  }
@@ -7,27 +7,31 @@ const get = (url, params?: any) => {
7
7
  }).then(handleResponseData);
8
8
  };
9
9
 
10
- const post = (url, data?: any) => {
10
+ const post = (url, data?: any, params?: any) => {
11
11
  return request.post(url, {
12
12
  data,
13
+ ...params,
13
14
  }).then(handleResponseData);
14
15
  };
15
16
 
16
- const patch = (url, data?: any) => {
17
+ const patch = (url, data?: any, params?: any) => {
17
18
  return request.patch(url, {
18
19
  data,
20
+ ...params,
19
21
  }).then(handleResponseData);
20
22
  };
21
23
 
22
- const put = (url, data?: any) => {
24
+ const put = (url, data?: any, params?: any) => {
23
25
  return request.put(url, {
24
26
  data,
27
+ ...params,
25
28
  }).then(handleResponseData);
26
29
  };
27
30
 
28
- const deleteS = (url, data?: any) => {
31
+ const deleteS = (url, data?: any, params?: any) => {
29
32
  return request.delete(url, {
30
33
  data,
34
+ ...params,
31
35
  }).then(handleResponseData);
32
36
  };
33
37
 
@@ -87,16 +87,13 @@ export const handleBssulaColumnsSpecialParams = (col: any) => {
87
87
  } else if (col.timeRender) {
88
88
  // 处理不显示 时分秒的时间
89
89
  col.render = ({ text }: any) => handleTooltip(text, col.timeRender);
90
- }
91
- // 处理有问题,弃用
92
- // else if (col.textOverflow) {
93
- // // 处理文字太长
94
- // const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width));
95
- // const originalRender = col?.render;
96
- // const renderText = (params) => originalRender ? originalRender(params) : params.text;
97
- // col.render = (params) => handleTextOverflowNoTooltip(renderText(params), colWidth);
98
- // }
99
- else if (col.images) {
90
+ } else if (col.textOverflow) {
91
+ // 处理文字太长
92
+ const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width));
93
+ const originalRender = col?.render;
94
+ const renderText = (params) => originalRender ? originalRender(params) : params.text;
95
+ col.render = (params) => handleTextOverflowNoTooltip(renderText(params), colWidth);
96
+ } else if (col.images) {
100
97
  col.render = ({ text }: any) => tableColumnsImage(text);
101
98
  } else if (col.double) {
102
99
  col.render = ({ record }: any) =>
@@ -127,12 +124,11 @@ export const handleBssulaColumnsSpecialParams = (col: any) => {
127
124
  if (col.timeRender) {
128
125
  col.render = (text: any) => handleTooltip(text, col.timeRender);
129
126
  }
130
- // 处理有问题,弃用
131
127
  // 处理文字太长
132
- // if (col.textOverflow) {
133
- // const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width))
134
- // col.render = (text: any) => handleTextOverflow(text,colWidth);
135
- // }
128
+ if (col.textOverflow) {
129
+ const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width))
130
+ col.render = (text: any) => handleTextOverflow(text,colWidth);
131
+ }
136
132
  if (col.images) {
137
133
  col.render = (text: any) => tableColumnsImage(text);
138
134
  }