@lm_fe/pages 0.1.201

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 (149) hide show
  1. package/README.md +31 -0
  2. package/dist/a_chunks/.root.js +245 -0
  3. package/dist/a_chunks/.root.js.map +1 -0
  4. package/dist/a_chunks/.root10.js +474 -0
  5. package/dist/a_chunks/.root10.js.map +1 -0
  6. package/dist/a_chunks/.root11.js +170 -0
  7. package/dist/a_chunks/.root11.js.map +1 -0
  8. package/dist/a_chunks/.root12.js +200 -0
  9. package/dist/a_chunks/.root12.js.map +1 -0
  10. package/dist/a_chunks/.root13.js +113 -0
  11. package/dist/a_chunks/.root13.js.map +1 -0
  12. package/dist/a_chunks/.root14.js +735 -0
  13. package/dist/a_chunks/.root14.js.map +1 -0
  14. package/dist/a_chunks/.root15.js +58 -0
  15. package/dist/a_chunks/.root15.js.map +1 -0
  16. package/dist/a_chunks/.root16.js +172 -0
  17. package/dist/a_chunks/.root16.js.map +1 -0
  18. package/dist/a_chunks/.root17.js +258 -0
  19. package/dist/a_chunks/.root17.js.map +1 -0
  20. package/dist/a_chunks/.root18.js +416 -0
  21. package/dist/a_chunks/.root18.js.map +1 -0
  22. package/dist/a_chunks/.root19.js +427 -0
  23. package/dist/a_chunks/.root19.js.map +1 -0
  24. package/dist/a_chunks/.root2.js +76 -0
  25. package/dist/a_chunks/.root2.js.map +1 -0
  26. package/dist/a_chunks/.root20.js +958 -0
  27. package/dist/a_chunks/.root20.js.map +1 -0
  28. package/dist/a_chunks/.root21.js +235 -0
  29. package/dist/a_chunks/.root21.js.map +1 -0
  30. package/dist/a_chunks/.root22.js +158 -0
  31. package/dist/a_chunks/.root22.js.map +1 -0
  32. package/dist/a_chunks/.root23.js +959 -0
  33. package/dist/a_chunks/.root23.js.map +1 -0
  34. package/dist/a_chunks/.root24.js +759 -0
  35. package/dist/a_chunks/.root24.js.map +1 -0
  36. package/dist/a_chunks/.root25.js +281 -0
  37. package/dist/a_chunks/.root25.js.map +1 -0
  38. package/dist/a_chunks/.root3.js +1054 -0
  39. package/dist/a_chunks/.root3.js.map +1 -0
  40. package/dist/a_chunks/.root4.js +629 -0
  41. package/dist/a_chunks/.root4.js.map +1 -0
  42. package/dist/a_chunks/.root5.js +1440 -0
  43. package/dist/a_chunks/.root5.js.map +1 -0
  44. package/dist/a_chunks/.root6.js +164 -0
  45. package/dist/a_chunks/.root6.js.map +1 -0
  46. package/dist/a_chunks/.root7.js +123 -0
  47. package/dist/a_chunks/.root7.js.map +1 -0
  48. package/dist/a_chunks/.root8.js +544 -0
  49. package/dist/a_chunks/.root8.js.map +1 -0
  50. package/dist/a_chunks/.root9.js +69 -0
  51. package/dist/a_chunks/.root9.js.map +1 -0
  52. package/dist/a_chunks/extends.js +11 -0
  53. package/dist/a_chunks/extends.js.map +1 -0
  54. package/dist/a_chunks/index.js +1492 -0
  55. package/dist/a_chunks/index.js.map +1 -0
  56. package/dist/block/index.d.ts +1 -0
  57. package/dist/block//346/243/200/351/252/214/346/243/200/346/237/245/Inner.d.ts +9 -0
  58. package/dist/block//346/243/200/351/252/214/346/243/200/346/237/245/form_config.d.ts +3 -0
  59. package/dist/block//346/243/200/351/252/214/346/243/200/346/237/245/index.d.ts +3 -0
  60. package/dist/components/BF_Form/Wrap.d.ts +9 -0
  61. package/dist/components/BF_Form/index.d.ts +14 -0
  62. package/dist/components/BF_Form/use_table_config copy.d.ts +13 -0
  63. package/dist/components/BF_Form/use_table_config.d.ts +13 -0
  64. package/dist/components/BF_Form/utils.d.ts +2 -0
  65. package/dist/components/Base_List/Helper.d.ts +13 -0
  66. package/dist/components/Base_List/_MyBaseList.d.ts +9 -0
  67. package/dist/components/Base_List/index.d.ts +3 -0
  68. package/dist/components/Base_List/types.d.ts +129 -0
  69. package/dist/components/HighRiskTableEntry/index.d.ts +8 -0
  70. package/dist/components/HighRiskTableEntry/utils.d.ts +23 -0
  71. package/dist/components/IdNOButton/index copy.d.ts +6 -0
  72. package/dist/components/IdNOButton/index.d.ts +12 -0
  73. package/dist/components/Layout_Sider/Inner.d.ts +17 -0
  74. package/dist/components/Layout_Sider/index.d.ts +4 -0
  75. package/dist/components/Layout_Sider/utils.d.ts +1 -0
  76. package/dist/components/Layout_TabButton/Inner.d.ts +11 -0
  77. package/dist/components/Layout_TabButton/index.d.ts +8 -0
  78. package/dist/components/Login/Inner.d.ts +8 -0
  79. package/dist/components/Login/index.d.ts +1 -0
  80. package/dist/components/QuickDocButton/form_config.d.ts +4 -0
  81. package/dist/components/QuickDocButton/index.d.ts +6 -0
  82. package/dist/components/doctor_end/ExemplaryCase/Inner.d.ts +33 -0
  83. package/dist/components/doctor_end/ExemplaryCase/config.d.ts +27 -0
  84. package/dist/components/doctor_end/ExemplaryCase/index.d.ts +3 -0
  85. package/dist/components/doctor_end/ExemplaryCase/request.d.ts +2 -0
  86. package/dist/components/doctor_end/HeaderInfo/Inner.d.ts +3 -0
  87. package/dist/components/doctor_end/HeaderInfo/index.d.ts +4 -0
  88. package/dist/components/doctor_end/HeaderInfo/types.d.ts +10 -0
  89. package/dist/components/doctor_end/HeaderInfo/utils.d.ts +20 -0
  90. package/dist/components/doctor_end/HeaderInfoLayout/index.d.ts +3 -0
  91. package/dist/components/doctor_end/index.d.ts +3 -0
  92. package/dist/components/exception/403.d.ts +4 -0
  93. package/dist/components/exception/404.d.ts +4 -0
  94. package/dist/components/exception/500.d.ts +6 -0
  95. package/dist/components/exception/ErrorBoundary.d.ts +11 -0
  96. package/dist/components/exception/ErrorBoundarySmall.d.ts +16 -0
  97. package/dist/components/exception/SelectTip.d.ts +2 -0
  98. package/dist/components/exception/index.d.ts +1 -0
  99. package/dist/components/index.d.ts +10 -0
  100. package/dist/form_config/config_table.d.ts +2 -0
  101. package/dist/form_config/index.d.ts +1 -0
  102. package/dist/index.d.ts +6 -0
  103. package/dist/index.js +36 -0
  104. package/dist/index.js.map +1 -0
  105. package/dist/modals/entries/BF_Form/index.d.ts +4 -0
  106. package/dist/modals/entries/StupidTemplateModal2/components/TemplateSelect.d.ts +2 -0
  107. package/dist/modals/entries/StupidTemplateModal2/index.d.ts +22 -0
  108. package/dist/modals/entries/StupidTemplateModal2/methods/index.d.ts +16 -0
  109. package/dist/modals/entries/modal_form/index.d.ts +29 -0
  110. package/dist/modals/entries/modal_page/index.d.ts +12 -0
  111. package/dist/modals/entries/print_modal/index.d.ts +3 -0
  112. package/dist/modals/entries/template_modal3/EditModal.d.ts +2 -0
  113. package/dist/modals/entries/template_modal3/common.d.ts +4 -0
  114. package/dist/modals/entries/template_modal3/components/TemplateSelect.d.ts +1 -0
  115. package/dist/modals/entries/template_modal3/index copy 2.d.ts +19 -0
  116. package/dist/modals/entries/template_modal3/index copy.d.ts +22 -0
  117. package/dist/modals/entries/template_modal3/index.d.ts +17 -0
  118. package/dist/modals/entries/template_modal3/methods/index.d.ts +15 -0
  119. package/dist/modals/entries/template_modal3/types.d.ts +27 -0
  120. package/dist/modals/entries/test/index.d.ts +6 -0
  121. package/dist/modals/entries/text_search/index.d.ts +8 -0
  122. package/dist/modals/entries//344/271/231/350/202/235/347/256/241/347/220/206/index.d.ts +8 -0
  123. package/dist/modals/entries//345/255/220/347/227/253/345/211/215/346/234/237/351/243/216/351/231/251/350/257/204/344/274/260/350/241/250/index.d.ts +9 -0
  124. package/dist/modals/entries//346/242/205/346/257/222/347/256/241/347/220/206/index.d.ts +8 -0
  125. package/dist/modals/entries//346/267/261/351/235/231/350/204/211/350/241/200/346/240/223/351/253/230/345/215/261/345/233/240/347/264/240/345/255/225/346/234/237/347/224/250/350/215/257/347/255/233/346/237/245/350/241/250/2015RCOG/351/231/215/344/275/216/345/246/212/345/250/240/345/217/212/344/272/247/350/244/245/346/234/237/351/235/231/350/204/211/350/241/200/346/240/223/346/240/223/345/241/236/347/232/204/351/243/216/351/231/251_/345/271/277/344/270/211/ThrombusGysy.d.ts +9 -0
  126. package/dist/modals/entries//346/267/261/351/235/231/350/204/211/350/241/200/346/240/223/351/253/230/345/215/261/345/233/240/347/264/240/345/255/225/346/234/237/347/224/250/350/215/257/347/255/233/346/237/245/350/241/250/2015RCOG/351/231/215/344/275/216/345/246/212/345/250/240/345/217/212/344/272/247/350/244/245/346/234/237/351/235/231/350/204/211/350/241/200/346/240/223/346/240/223/345/241/236/347/232/204/351/243/216/351/231/251_/345/271/277/344/270/211/components.d.ts +7 -0
  127. package/dist/modals/entries//346/267/261/351/235/231/350/204/211/350/241/200/346/240/223/351/253/230/345/215/261/345/233/240/347/264/240/345/255/225/346/234/237/347/224/250/350/215/257/347/255/233/346/237/245/350/241/250/2015RCOG/351/231/215/344/275/216/345/246/212/345/250/240/345/217/212/344/272/247/350/244/245/346/234/237/351/235/231/350/204/211/350/241/200/346/240/223/346/240/223/345/241/236/347/232/204/351/243/216/351/231/251_/345/271/277/344/270/211/config.d.ts +28 -0
  128. package/dist/modals/entries//346/267/261/351/235/231/350/204/211/350/241/200/346/240/223/351/253/230/345/215/261/345/233/240/347/264/240/345/255/225/346/234/237/347/224/250/350/215/257/347/255/233/346/237/245/350/241/250/2015RCOG/351/231/215/344/275/216/345/246/212/345/250/240/345/217/212/344/272/247/350/244/245/346/234/237/351/235/231/350/204/211/350/241/200/346/240/223/346/240/223/345/241/236/347/232/204/351/243/216/351/231/251_/345/271/277/344/270/211/utils.d.ts +9 -0
  129. package/dist/modals/entries//346/267/261/351/235/231/350/204/211/350/241/200/346/240/223/351/253/230/345/215/261/345/233/240/347/264/240/345/255/225/346/234/237/347/224/250/350/215/257/347/255/233/346/237/245/350/241/250/Default/ThrombusDefault.d.ts +8 -0
  130. package/dist/modals/entries//346/267/261/351/235/231/350/204/211/350/241/200/346/240/223/351/253/230/345/215/261/345/233/240/347/264/240/345/255/225/346/234/237/347/224/250/350/215/257/347/255/233/346/237/245/350/241/250/index.d.ts +3 -0
  131. package/dist/modals/entries//346/267/261/351/235/231/350/204/211/350/241/200/346/240/223/351/253/230/345/215/261/345/233/240/347/264/240/345/255/225/346/234/237/347/224/250/350/215/257/347/255/233/346/237/245/350/241/250/types.d.ts +5 -0
  132. package/dist/modals/entries//347/230/242/347/227/225/345/255/220/345/256/253/351/230/264/351/201/223/350/257/225/344/272/247/350/241/250/index.d.ts +7 -0
  133. package/dist/modals/entries//350/257/212/346/226/255/345/216/206/345/217/262/index.d.ts +8 -0
  134. package/dist/modals/entries//351/242/204/350/255/246/346/217/220/351/206/222_/351/253/230/345/215/261/345/277/253/350/256/257/add-diagnoses/add-diagnoses.d.ts +12 -0
  135. package/dist/modals/entries//351/242/204/350/255/246/346/217/220/351/206/222_/351/253/230/345/215/261/345/277/253/350/256/257/index.d.ts +20 -0
  136. package/dist/modals/entries//351/242/204/350/255/246/346/217/220/351/206/222_/351/253/230/345/215/261/345/277/253/350/256/257/util.d.ts +60 -0
  137. package/dist/modals/entries//351/253/230/345/215/261/345/233/240/347/264/240/347/256/241/347/220/206/HighriskSign.d.ts +13 -0
  138. package/dist/modals/entries//351/253/230/345/215/261/345/233/240/347/264/240/347/256/241/347/220/206/HighriskTimeline.d.ts +9 -0
  139. package/dist/modals/entries//351/253/230/345/215/261/345/233/240/347/264/240/347/256/241/347/220/206/index copy.d.ts" +12 -0
  140. package/dist/modals/entries//351/253/230/345/215/261/345/233/240/347/264/240/347/256/241/347/220/206/index.d.ts +13 -0
  141. package/dist/modals/entries//351/253/230/345/215/261/351/232/217/350/256/277/form_config.d.ts +2 -0
  142. package/dist/modals/entries//351/253/230/345/215/261/351/232/217/350/256/277/index.d.ts +8 -0
  143. package/dist/modals/index.d.ts +22 -0
  144. package/dist/modals/meta.d.ts +21 -0
  145. package/dist/pages/doc_record/Right.d.ts +6 -0
  146. package/dist/pages/doc_record/index.d.ts +7 -0
  147. package/dist/pages/index.d.ts +1 -0
  148. package/dist/utils/index.d.ts +2 -0
  149. package/package.json +46 -0
@@ -0,0 +1,1054 @@
1
+ import 'antd/es/button/style';
2
+ import _Button from 'antd/es/button';
3
+ import 'antd/es/divider/style';
4
+ import _Divider from 'antd/es/divider';
5
+ import { _ as _extends } from './extends.js';
6
+ import 'antd/es/space/style';
7
+ import _Space from 'antd/es/space';
8
+ import 'antd/es/message/style';
9
+ import _message from 'antd/es/message';
10
+ import 'antd/es/form/style';
11
+ import _Form from 'antd/es/form';
12
+ import _omit from 'lodash/omit';
13
+ import _isString from 'lodash/isString';
14
+ import _isNil from 'lodash/isNil';
15
+ import _isFunction from 'lodash/isFunction';
16
+ import _get from 'lodash/get';
17
+ import { s as styleInject, b as __assign, c as __spreadArray, _ as __awaiter, a as __generator, m as mchcModal__, d as __rest } from './index.js';
18
+ import { EditOutlined, CopyOutlined, PrinterOutlined, DeleteOutlined, ExportOutlined, PlusOutlined, ReloadOutlined, SearchOutlined } from '@ant-design/icons';
19
+ import { mchcConfig, mchcLogger, mchcEnv, mchcEvent } from '@lm_fe/env';
20
+ import { SMchc_FormDescriptions, ModelService } from '@lm_fe/service';
21
+ import { safe_json_parse, safe_json_parse_arr, expect_array, Browser, sleep, downloadFile, formatDateTime, safe_async_call } from '@lm_fe/utils';
22
+ import React, { useState, useEffect, useRef } from 'react';
23
+ import 'antd/es/switch/style';
24
+ import 'antd/es/switch';
25
+ import 'antd/es/input/style';
26
+ import 'antd/es/input';
27
+ import { LazyAntd, MyFormSection, OkButton, MyBaseListComponents, getDefaultRequiredRules, InterceptDisplayFC } from '@lm_fe/components_m';
28
+ import _isObject from 'lodash/isObject';
29
+ import { LazyAntd as LazyAntd$1, useMyEffectSafe } from '@lm_fe/components';
30
+ import 'antd/es/row/style';
31
+ import 'antd/es/row';
32
+ import 'antd/es/col/style';
33
+ import 'antd/es/col';
34
+ import 'antd/es/list/style';
35
+ import 'antd/es/list';
36
+ import 'antd/es/tooltip/style';
37
+ import 'antd/es/tooltip';
38
+ import 'classnames';
39
+ import 'antd/es/spin/style';
40
+ import 'antd/es/spin';
41
+ import 'antd/es/result/style';
42
+ import 'antd/es/result';
43
+ import 'antd/es/menu/style';
44
+ import 'antd/es/menu';
45
+ import 'lodash/keys';
46
+ LazyAntd.Tree;
47
+ LazyAntd.TreeSelect;
48
+ LazyAntd.Select;
49
+ LazyAntd.Table;
50
+ LazyAntd.Dropdown;
51
+ LazyAntd.Pagination;
52
+ function MyBaseListRenderFormSection(_a) {
53
+ var config = _a.config,
54
+ disabled = _a.disabled,
55
+ form = _a.form;
56
+ return /*#__PURE__*/React.createElement(MyFormSection, {
57
+ form: form,
58
+ defaultOptions: {},
59
+ inline: true,
60
+ formDescriptions: config.map(function (_) {
61
+ var _a, _b, _c;
62
+ if (!_) return _;
63
+ var props = (_b = (_a = _.inputProps) !== null && _a !== void 0 ? _a : _.props) !== null && _b !== void 0 ? _b : {};
64
+ props.allowClear = true;
65
+ if (['Select', 'select', 'MySelect', 'MS', 'MA', 'input', 'MI', 'MyInput'].includes(_.inputType) && !((_c = _.inputProps) === null || _c === void 0 ? void 0 : _c.width)) {
66
+ props.width = 128;
67
+ }
68
+ _.inputProps = props;
69
+ return _;
70
+ }),
71
+ disableAll: disabled
72
+ });
73
+ }
74
+ var css_248z = ".index-module_base-list__AUHXA {\n height: 100%;\n overflow-y: hidden;\n}\n.index-module_ant-table-ordinal__c8C7I {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n";
75
+ styleInject(css_248z);
76
+ function formatProps(props) {
77
+ var _props = __assign({}, props);
78
+ return _props;
79
+ }
80
+ function tranformQueryData(values, searchConfig, isFuck) {
81
+ if (searchConfig === void 0) {
82
+ searchConfig = [];
83
+ }
84
+ if (isFuck === void 0) {
85
+ isFuck = false;
86
+ }
87
+ var newValues = __assign({}, values);
88
+ var kvArr = searchConfig.filter(function (_) {
89
+ return _;
90
+ }).map(function (conf) {
91
+ var k = SMchc_FormDescriptions.get_form_item_name_str(conf);
92
+ var v = _get(newValues, k);
93
+ return [k, v, conf];
94
+ });
95
+ return kvArr.reduce(function (sum, _a) {
96
+ var _b, _c;
97
+ var k = _a[0],
98
+ v = _a[1],
99
+ conf = _a[2];
100
+ if (isFuck) return __assign(__assign({}, sum), (_b = {}, _b[k] = v, _b));
101
+ var res = conf ? calcKeyByType(k, v, conf) : (_c = {}, _c[k] = v, _c);
102
+ return __assign(__assign({}, sum), res);
103
+ }, {});
104
+ }
105
+ function calcKeyByType(k, v, config) {
106
+ var _a, _b, _c, _d, _e, _f, _g;
107
+ var _h, _j, _k, _l, _m;
108
+ var input_type = (_h = config.inputType) !== null && _h !== void 0 ? _h : 'input';
109
+ var filterType = (_l = (_k = (_j = config.filterType) === null || _j === void 0 ? void 0 : _j.split) === null || _k === void 0 ? void 0 : _k.call(_j, ',')) !== null && _l !== void 0 ? _l : [];
110
+ var type = (_m = config.inputProps) === null || _m === void 0 ? void 0 : _m.type;
111
+ var is_multiple = type === 'multiple' || type === 'tags';
112
+ var f1 = filterType[0];
113
+ var f2 = filterType[1];
114
+ if (['input', 'Input', 'MyInput', 'address', 'MyAddress'].includes(input_type)) {
115
+ return _a = {}, _a["".concat(k, ".").concat(f1 || 'contains')] = v, _a;
116
+ }
117
+ if (['input_number', 'InputNumber', 'DatePicker'].includes(input_type)) {
118
+ return _b = {}, _b["".concat(k, ".").concat(f1 || 'equals')] = v, _b;
119
+ }
120
+ if (['select', 'Select', 'MySelect', 'MS'].includes(input_type)) {
121
+ var obj = safe_json_parse(v, v);
122
+ if (Array.isArray(obj)) {
123
+ var arr = obj.map(function (_) {
124
+ return _isObject(_) ? _.value : _;
125
+ });
126
+ var _v = arr.length > 1 ? arr.join(',') : arr[0];
127
+ var has_comma = _isString(_v) && _v.includes(',');
128
+ var _df = is_multiple || has_comma ? 'in' : 'equals';
129
+ return _c = {}, _c["".concat(k, ".").concat(f1 || _df)] = _v, _c;
130
+ } else {
131
+ var has_comma = _isString(v) && v.includes(',');
132
+ var _df = is_multiple || has_comma ? 'in' : 'equals';
133
+ return _d = {}, _d["".concat(k, ".").concat(f1 || _df)] = v, _d;
134
+ }
135
+ }
136
+ if (['RangePicker', 'rangeDate', 'MyRangeDate', 'rangeDateTime', 'MyRangeDateTime', 'ArrayInput'].includes(input_type)) {
137
+ var value = safe_json_parse_arr(v);
138
+ return _e = {}, _e["".concat(k, ".").concat(f1 || 'greaterOrEqualThan')] = value[0], _e["".concat(k, ".").concat(f2 || 'lessOrEqualThan')] = value[1], _e;
139
+ }
140
+ return f1 ? (_f = {}, _f["".concat(k, ".").concat(f1)] = v, _f) : (_g = {}, _g[k] = v, _g);
141
+ }
142
+ function get_dataIndex(record) {
143
+ var _a, _b;
144
+ var _dataIndex = (_b = (_a = record === null || record === void 0 ? void 0 : record.dataIndex) !== null && _a !== void 0 ? _a : record === null || record === void 0 ? void 0 : record.name) !== null && _b !== void 0 ? _b : record === null || record === void 0 ? void 0 : record.key;
145
+ if (_isString(_dataIndex) && _dataIndex.includes('.')) {
146
+ return _dataIndex.split('.');
147
+ }
148
+ return _dataIndex;
149
+ }
150
+ function get_title(record) {
151
+ var _a, _b;
152
+ var _title = (_b = (_a = record === null || record === void 0 ? void 0 : record.title) !== null && _a !== void 0 ? _a : record === null || record === void 0 ? void 0 : record.label) !== null && _b !== void 0 ? _b : record === null || record === void 0 ? void 0 : record.name;
153
+ return _title;
154
+ }
155
+ function use_my_baselist(props) {
156
+ var tableColumns = props.tableColumns;
157
+ var _a = useState([]),
158
+ table_columns = _a[0],
159
+ set_table_columns = _a[1];
160
+ useEffect(function () {
161
+ SMchc_FormDescriptions.extract_form_config(tableColumns).then(function (conf) {
162
+ set_table_columns(expect_array(conf).filter(function (_) {
163
+ return !_isNil(_);
164
+ }));
165
+ });
166
+ return function () {};
167
+ }, [tableColumns]);
168
+ return {
169
+ table_columns: table_columns
170
+ };
171
+ }
172
+ var browserClient = Browser.client || {};
173
+ LazyAntd$1.Tree;
174
+ LazyAntd$1.TreeSelect;
175
+ LazyAntd$1.Select;
176
+ var Table = LazyAntd$1.Table;
177
+ LazyAntd$1.Dropdown;
178
+ LazyAntd$1.Pagination;
179
+ function _MyBaseList(_props) {
180
+ var _a, _b, _c;
181
+ var staticDefaultQuery = {
182
+ page: 0,
183
+ size: mchcConfig.get('列表一页显示条数') || 14,
184
+ sort: 'id,desc',
185
+ 'deleteFlag.equals': 0
186
+ };
187
+ var props = formatProps(_props);
188
+ var dbg_dataSource = props.dbg_dataSource,
189
+ _d = props.needPagination,
190
+ needPagination = _d === void 0 ? true : _d,
191
+ _e = props.showAdd,
192
+ showAdd = _e === void 0 ? true : _e,
193
+ _f = props.showAction,
194
+ showAction = _f === void 0 ? true : _f,
195
+ modalFormConfig = props.modalFormConfig,
196
+ useListSourceCount = props.useListSourceCount,
197
+ fuckPage = props.fuckPage,
198
+ ignore_usr = props.ignore_usr,
199
+ ignore_env = props.ignore_env,
200
+ get_fuck_page = props.get_fuck_page,
201
+ ModalForm = props.ModalForm,
202
+ baseTitle = props.baseTitle,
203
+ rowKey = props.rowKey,
204
+ showExport = props.showExport,
205
+ showPrint = props.showPrint,
206
+ showCopy = props.showCopy,
207
+ otherTableProps = props.otherTableProps,
208
+ needEditInTable = props.needEditInTable,
209
+ needChecked = props.needChecked,
210
+ requestBeforeEdit = props.requestBeforeEdit,
211
+ addText = props.addText,
212
+ name = props.name,
213
+ apiPrefix = props.apiPrefix,
214
+ ActionAddonBefore = props.ActionAddonBefore,
215
+ RenderAction = props.RenderAction,
216
+ RenderBtns = props.RenderBtns,
217
+ RenderSearchBtns = props.RenderSearchBtns,
218
+ _g = props.searchConfig,
219
+ searchConfig = _g === void 0 ? [] : _g,
220
+ _h = props.searchParams,
221
+ searchParams = _h === void 0 ? {} : _h,
222
+ _j = props.initialSearchValue,
223
+ initialSearchValue = _j === void 0 ? {} : _j,
224
+ _k = props.showRowDelBtn,
225
+ showRowDelBtn = _k === void 0 ? true : _k,
226
+ _l = props.showRowEditBtn,
227
+ showRowEditBtn = _l === void 0 ? true : _l,
228
+ _m = props.showRowPrintBtn,
229
+ showRowPrintBtn = _m === void 0 ? false : _m,
230
+ customModelService = props.customModelService,
231
+ genColumns = props.genColumns,
232
+ onAdd = props.onAdd,
233
+ onExport = props.onExport,
234
+ onPrint = props.onPrint,
235
+ beforeSearch = props.beforeSearch,
236
+ handleClickRow = props.handleClickRow,
237
+ _o = props.handleDoubleClickRow,
238
+ handleDoubleClickRow = _o === void 0 ? function (item) {
239
+ return handleEdit(item);
240
+ } : _o,
241
+ onModalOpen = props.onModalOpen,
242
+ _p = props.printDefaultConfig,
243
+ printDefaultConfig = _p === void 0 ? {} : _p,
244
+ _q = props.beforeSubmit,
245
+ beforeSubmit = _q === void 0 ? function (v) {
246
+ return v;
247
+ } : _q,
248
+ handleBeforePopup = props.handleBeforePopup,
249
+ effect_ctx = props.effect_ctx,
250
+ action_col = props.action_col;
251
+ var myBaseListService = useRef();
252
+ var _searchForm = _Form.useForm()[0];
253
+ var children = props.children;
254
+ var queryRef = useRef(null);
255
+ var wrapRef = useRef(null);
256
+ var defaultQueryValue = Object.assign({}, staticDefaultQuery, searchParams);
257
+ var defaultQuery = useRef(defaultQueryValue);
258
+ var showSearch = !!searchConfig.length;
259
+ var table_columns = use_my_baselist(props).table_columns;
260
+ var actCellWidth = (+showRowDelBtn + +showRowEditBtn + +showRowPrintBtn) * 50;
261
+ if (ActionAddonBefore) {
262
+ actCellWidth += 70;
263
+ }
264
+ var searchForm = (_a = props.searchForm) !== null && _a !== void 0 ? _a : _searchForm;
265
+ useEffect(function () {
266
+ myBaseListService.current = customModelService || new ModelService({
267
+ n: name,
268
+ useListSourceCount: useListSourceCount,
269
+ needTransferParams: false,
270
+ apiPrefix: apiPrefix,
271
+ fuckPage: fuckPage,
272
+ get_fuck_page: get_fuck_page,
273
+ ignore_env: ignore_env,
274
+ ignore_usr: ignore_usr
275
+ });
276
+ }, [name, customModelService]);
277
+ var _r = useState(0),
278
+ total = _r[0],
279
+ setTotal = _r[1];
280
+ var _s = useState([]),
281
+ dataSource = _s[0],
282
+ setDataSource = _s[1];
283
+ var _t = useState(false),
284
+ visible = _t[0],
285
+ setVisible = _t[1];
286
+ var _u = useState(false),
287
+ editable = _u[0],
288
+ setEditable = _u[1];
289
+ var _v = useState(),
290
+ ___id = _v[0],
291
+ set___Id = _v[1];
292
+ var _w = useState(),
293
+ extraModalData = _w[0],
294
+ setExtraModalData = _w[1];
295
+ var _x = useState(0),
296
+ editKey = _x[0],
297
+ setEditKey = _x[1];
298
+ var _y = useState(false),
299
+ loading = _y[0],
300
+ setLoading = _y[1];
301
+ var _z = useState(false),
302
+ longSearchForm = _z[0],
303
+ setLongSearchForm = _z[1];
304
+ var _0 = useState(500),
305
+ tableHeight = _0[0],
306
+ setTableHeight = _0[1];
307
+ var _1 = useState([]),
308
+ checkRows = _1[0],
309
+ setCheckRows = _1[1];
310
+ var form = _Form.useForm()[0];
311
+ var editKeyRef = useRef(0);
312
+ var formWrapper = useRef(null);
313
+ var propsCache = useRef(props);
314
+ propsCache.current = props;
315
+ var inited = useRef(false);
316
+ var _2 = useState(defaultQueryValue.size),
317
+ __pageSize = _2[0],
318
+ set__pageSize = _2[1];
319
+ var _3 = useState(1),
320
+ __current = _3[0],
321
+ set__current = _3[1];
322
+ function setPageSize(n) {
323
+ set__pageSize(n);
324
+ defaultQuery.current.size = n;
325
+ }
326
+ function setCurrent(n) {
327
+ set__current(n);
328
+ defaultQuery.current.page = n - 1;
329
+ }
330
+ function safe_set_edit_key(id) {
331
+ setEditKey(id);
332
+ editKeyRef.current = id;
333
+ }
334
+ useEffect(function () {
335
+ setTimeout(function () {
336
+ var _a, _b, _c, _d, _e, _f, _g;
337
+ var h = browserClient.clientHeight;
338
+ var formHeight = (_b = (_a = formWrapper.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0;
339
+ var queryHeight = (_d = (_c = queryRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0;
340
+ var tableHeaderHeight = (_g = (_f = (_e = wrapRef.current) === null || _e === void 0 ? void 0 : _e.querySelector('.ant-table-header')) === null || _f === void 0 ? void 0 : _f.clientHeight) !== null && _g !== void 0 ? _g : 0;
341
+ setTableHeight(h - queryHeight - tableHeaderHeight - 100 - 80);
342
+ if (formHeight > 40) {
343
+ setLongSearchForm(true);
344
+ }
345
+ if (dbg_dataSource) {
346
+ setDataSource(dbg_dataSource);
347
+ } else {
348
+ search();
349
+ }
350
+ inited.current = true;
351
+ }, 600);
352
+ return function () {};
353
+ }, [dbg_dataSource]);
354
+ useEffect(function () {
355
+ setTimeout(function () {
356
+ var _a, _b, _c, _d, _e, _f, _g;
357
+ var h = browserClient.clientHeight;
358
+ var formHeight = (_b = (_a = formWrapper.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0;
359
+ var queryHeight = (_d = (_c = queryRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0;
360
+ var tableHeaderHeight = (_g = (_f = (_e = wrapRef.current) === null || _e === void 0 ? void 0 : _e.querySelector('.ant-table-header')) === null || _f === void 0 ? void 0 : _f.clientHeight) !== null && _g !== void 0 ? _g : 0;
361
+ mchcLogger.log('formHeight', {
362
+ queryHeight: queryHeight,
363
+ formHeight: formHeight,
364
+ h: h,
365
+ tableHeaderHeight: tableHeaderHeight
366
+ });
367
+ }, 1000);
368
+ return function () {};
369
+ }, []);
370
+ if (effect_ctx) {
371
+ useMyEffectSafe(effect_ctx)(function () {
372
+ if (inited.current) {
373
+ _message.info('刷新成功!');
374
+ handleSearch();
375
+ }
376
+ }, []);
377
+ }
378
+ var actionCtx = {
379
+ handleSearch: handleSearch,
380
+ getSearchParams: getSearchParams,
381
+ getCheckRows: function getCheckRows() {
382
+ return checkRows;
383
+ }
384
+ };
385
+ function create_or_update(submitData) {
386
+ return __awaiter(this, void 0, void 0, function () {
387
+ var service, isUpdate, text, res;
388
+ var _a, _b, _c, _d;
389
+ return __generator(this, function (_e) {
390
+ switch (_e.label) {
391
+ case 0:
392
+ if (_isFunction(props.create_or_update)) {
393
+ return [2, props.create_or_update(submitData)];
394
+ }
395
+ service = myBaseListService.current;
396
+ if (!service) return [2];
397
+ isUpdate = !!(submitData === null || submitData === void 0 ? void 0 : submitData.id);
398
+ text = isUpdate ? '更新' : '新增';
399
+ if (!(submitData === null || submitData === void 0 ? void 0 : submitData.id)) return [3, 2];
400
+ return [4, (_b = (_a = myBaseListService.current) === null || _a === void 0 ? void 0 : _a.put) === null || _b === void 0 ? void 0 : _b.call(_a, submitData)];
401
+ case 1:
402
+ res = _e.sent();
403
+ return [3, 4];
404
+ case 2:
405
+ return [4, (_d = (_c = myBaseListService.current) === null || _c === void 0 ? void 0 : _c.post) === null || _d === void 0 ? void 0 : _d.call(_c, submitData)];
406
+ case 3:
407
+ res = _e.sent();
408
+ _e.label = 4;
409
+ case 4:
410
+ _message.info(text + '成功!');
411
+ safe_set_edit_key(0);
412
+ set___Id(undefined);
413
+ handleSearch();
414
+ return [2, res];
415
+ }
416
+ });
417
+ });
418
+ }
419
+ function _onModalOpen(rowData) {
420
+ var _this = this;
421
+ rowData === null || rowData === void 0 ? void 0 : rowData.id;
422
+ if (onModalOpen) return onModalOpen({
423
+ rowData: rowData,
424
+ handleSearch: handleSearch,
425
+ create_or_update: create_or_update,
426
+ table_columns: table_columns
427
+ });
428
+ mchcModal__.open('modal_form', __assign(__assign({}, modalFormConfig), {
429
+ modal_data: __assign(__assign({
430
+ onValuesChange: function onValuesChange(val, allval, form) {
431
+ return __awaiter(_this, void 0, void 0, function () {
432
+ return __generator(this, function (_a) {
433
+ return [2];
434
+ });
435
+ });
436
+ }
437
+ }, modalFormConfig === null || modalFormConfig === void 0 ? void 0 : modalFormConfig.modal_data), {
438
+ formDescriptions: cal_columns,
439
+ onSubmit: function onSubmit(values) {
440
+ return __awaiter(this, void 0, void 0, function () {
441
+ var _data, submitData;
442
+ return __generator(this, function (_a) {
443
+ switch (_a.label) {
444
+ case 0:
445
+ _data = Object.assign({}, rowData, values);
446
+ return [4, safe_async_call(beforeSubmit, _data)];
447
+ case 1:
448
+ submitData = _a.sent();
449
+ mchcLogger.log('submitData', submitData);
450
+ if (!submitData) return [2];
451
+ return [2, create_or_update(submitData)];
452
+ }
453
+ });
454
+ });
455
+ },
456
+ getInitialData: function getInitialData() {
457
+ return __awaiter(this, void 0, void 0, function () {
458
+ var fn, _data, res;
459
+ var _a;
460
+ return __generator(this, function (_b) {
461
+ switch (_b.label) {
462
+ case 0:
463
+ fn = handleBeforePopup;
464
+ _data = rowData !== null && rowData !== void 0 ? rowData : {};
465
+ if (!((rowData === null || rowData === void 0 ? void 0 : rowData.id) && requestBeforeEdit)) return [3, 2];
466
+ return [4, (_a = myBaseListService.current) === null || _a === void 0 ? void 0 : _a.getOne(rowData === null || rowData === void 0 ? void 0 : rowData.id)];
467
+ case 1:
468
+ res = _b.sent();
469
+ if (res) _data = res;
470
+ _b.label = 2;
471
+ case 2:
472
+ return [2, fn ? fn(_data) : _data];
473
+ }
474
+ });
475
+ });
476
+ }
477
+ })
478
+ }));
479
+ }
480
+ var render_props = {
481
+ createOrUpdate: create_or_update,
482
+ handleView: handleView,
483
+ handleDelete: handleDelete,
484
+ handleEdit: handleEdit,
485
+ handleSearch: handleSearch,
486
+ setExtraModalData: setExtraModalData,
487
+ setEditable: setEditable,
488
+ setVisible: setVisible,
489
+ setId: set___Id,
490
+ create_or_update: create_or_update
491
+ };
492
+ var actionCol = (_b = action_col === null || action_col === void 0 ? void 0 : action_col(render_props)) !== null && _b !== void 0 ? _b : {
493
+ title: '操作',
494
+ dataIndex: '__operation',
495
+ fixed: 'right',
496
+ align: 'center',
497
+ isActive: 0,
498
+ showSorter: false,
499
+ showFilter: false,
500
+ width: actCellWidth,
501
+ render: function render(value, rowData, index) {
502
+ var editable = isEditing(rowData);
503
+ if (needEditInTable && editable) {
504
+ return /*#__PURE__*/React.createElement(_Space, null, /*#__PURE__*/React.createElement(OkButton, {
505
+ size: "small",
506
+ onClick: function onClick() {
507
+ return handleItemSave();
508
+ }
509
+ }, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(OkButton, {
510
+ size: "small",
511
+ onClick: function onClick() {
512
+ return handleItemCancel();
513
+ }
514
+ }, "\u53D6\u6D88"));
515
+ }
516
+ if (RenderAction) {
517
+ return /*#__PURE__*/React.createElement(RenderAction, _extends({
518
+ rowData: rowData
519
+ }, render_props));
520
+ }
521
+ return /*#__PURE__*/React.createElement(_Space, {
522
+ size: "small"
523
+ }, ActionAddonBefore && /*#__PURE__*/React.createElement(ActionAddonBefore, _extends({
524
+ rowData: rowData
525
+ }, render_props)), showRowEditBtn ? /*#__PURE__*/React.createElement(OkButton, {
526
+ title: "\u7F16\u8F91/\u67E5\u770B",
527
+ icon: /*#__PURE__*/React.createElement(EditOutlined, null),
528
+ size: "small",
529
+ onClick: function onClick(e) {
530
+ return handleEdit(rowData);
531
+ }
532
+ }) : null, showCopy ? /*#__PURE__*/React.createElement(OkButton, {
533
+ title: "\u590D\u5236",
534
+ icon: /*#__PURE__*/React.createElement(CopyOutlined, null),
535
+ size: "small",
536
+ onClick: function onClick(e) {
537
+ return handleEdit(_omit(rowData, ['id']));
538
+ }
539
+ }) : null, showRowPrintBtn ? /*#__PURE__*/React.createElement(OkButton, {
540
+ title: "\u6253\u5370",
541
+ icon: /*#__PURE__*/React.createElement(PrinterOutlined, null),
542
+ size: "small",
543
+ onClick: function onClick(e) {
544
+ return handleRowPrint(rowData);
545
+ }
546
+ }) : null, showRowDelBtn ? /*#__PURE__*/React.createElement(OkButton, {
547
+ title: "\u5220\u9664",
548
+ icon: /*#__PURE__*/React.createElement(DeleteOutlined, null),
549
+ danger: true,
550
+ type: "primary",
551
+ size: "small",
552
+ onClick: function onClick(e) {
553
+ return handleDelete(rowData);
554
+ }
555
+ }) : null);
556
+ }
557
+ };
558
+ var _columns = !table_columns.some(function (_) {
559
+ return _.title === '操作';
560
+ }) && showAction ? __spreadArray(__spreadArray([], table_columns, true), [actionCol], false) : table_columns;
561
+ var cal_columns = (_c = genColumns === null || genColumns === void 0 ? void 0 : genColumns({
562
+ handleEdit: handleEdit,
563
+ handleDelete: handleDelete,
564
+ handleSearch: handleSearch,
565
+ handleItemCancel: handleItemCancel,
566
+ handleItemSave: handleItemSave,
567
+ editKey: editKey,
568
+ tableColumns: table_columns,
569
+ actionCol: actionCol,
570
+ getSearchParams: getSearchParams
571
+ })) !== null && _c !== void 0 ? _c : _columns;
572
+ var isEditing = function isEditing(rowData) {
573
+ return (rowData.editKey || rowData.id) === editKey;
574
+ };
575
+ function handleDelete(rowData) {
576
+ return __awaiter(this, void 0, void 0, function () {
577
+ var isOk;
578
+ var _a;
579
+ return __generator(this, function (_b) {
580
+ switch (_b.label) {
581
+ case 0:
582
+ isOk = confirm('确认是否删除?');
583
+ if (!isOk) return [2];
584
+ return [4, (_a = myBaseListService.current) === null || _a === void 0 ? void 0 : _a.del(rowData.id)];
585
+ case 1:
586
+ _b.sent();
587
+ _message.success("\u5220\u9664".concat(baseTitle, "\u6210\u529F"));
588
+ handleSearch();
589
+ return [2];
590
+ }
591
+ });
592
+ });
593
+ }
594
+ function handleRowPrint(rowData) {
595
+ return __awaiter(this, void 0, void 0, function () {
596
+ return __generator(this, function (_a) {
597
+ mchcModal__.open('print_modal', {
598
+ modal_data: {
599
+ requestData: __assign({
600
+ url: name + 'rowprint',
601
+ id: rowData === null || rowData === void 0 ? void 0 : rowData.id
602
+ }, getSearchParams())
603
+ }
604
+ });
605
+ return [2];
606
+ });
607
+ });
608
+ }
609
+ function handleItemSave(_data) {
610
+ return __awaiter(this, void 0, void 0, function () {
611
+ var rowData, submitData;
612
+ var _a;
613
+ return __generator(this, function (_b) {
614
+ switch (_b.label) {
615
+ case 0:
616
+ return [4, form.validateFields()];
617
+ case 1:
618
+ _b.sent();
619
+ rowData = (_a = _data !== null && _data !== void 0 ? _data : dataSource.find(function (_) {
620
+ return _.id === editKeyRef.current;
621
+ })) !== null && _a !== void 0 ? _a : {};
622
+ submitData = __assign(__assign({}, rowData), form.getFieldsValue());
623
+ return [4, create_or_update(submitData)];
624
+ case 2:
625
+ _b.sent();
626
+ form.resetFields();
627
+ return [2];
628
+ }
629
+ });
630
+ });
631
+ }
632
+ function handleItemCancel() {
633
+ form.resetFields();
634
+ set___Id(undefined);
635
+ safe_set_edit_key(0);
636
+ setDataSource(typeof editKey === 'string' ? dataSource.slice(1, dataSource.length) : dataSource);
637
+ }
638
+ function handleEdit(rowData) {
639
+ return __awaiter(this, void 0, void 0, function () {
640
+ var key;
641
+ return __generator(this, function (_a) {
642
+ switch (_a.label) {
643
+ case 0:
644
+ if (!needEditInTable) return [3, 4];
645
+ if (!editKeyRef.current) return [3, 3];
646
+ if (!mchcEnv["in"](['广三'])) return [3, 2];
647
+ return [4, handleItemSave()];
648
+ case 1:
649
+ _a.sent();
650
+ return [3, 3];
651
+ case 2:
652
+ _message.warning('请先保存上一条数据!');
653
+ return [2];
654
+ case 3:
655
+ form.setFieldsValue(rowData);
656
+ key = rowData.editKey || rowData.id;
657
+ set___Id(rowData.id);
658
+ safe_set_edit_key(key);
659
+ return [3, 5];
660
+ case 4:
661
+ if (ModalForm) {
662
+ setVisible(true);
663
+ setEditable(true);
664
+ set___Id(rowData.id);
665
+ } else {
666
+ _onModalOpen(rowData);
667
+ }
668
+ _a.label = 5;
669
+ case 5:
670
+ return [2];
671
+ }
672
+ });
673
+ });
674
+ }
675
+ function handleView(rowData) {
676
+ setVisible(true);
677
+ setEditable(false);
678
+ set___Id(rowData.id);
679
+ }
680
+ var handleAdd = function handleAdd() {
681
+ if (onAdd) {
682
+ onAdd();
683
+ return;
684
+ }
685
+ if (needEditInTable) {
686
+ if (editKeyRef.current) {
687
+ _message.error('请先保存上一条记录');
688
+ return;
689
+ }
690
+ var mockKey = +new Date();
691
+ safe_set_edit_key(mockKey);
692
+ setDataSource(__spreadArray([{
693
+ editKey: mockKey
694
+ }], dataSource, true));
695
+ } else {
696
+ if (ModalForm) {
697
+ setEditable(true);
698
+ setVisible(true);
699
+ } else {
700
+ _onModalOpen();
701
+ }
702
+ }
703
+ };
704
+ var handleCancel = function handleCancel() {
705
+ setVisible(false);
706
+ setEditable(false);
707
+ set___Id(undefined);
708
+ setExtraModalData(undefined);
709
+ };
710
+ var handleFieldsChange = function handleFieldsChange() {};
711
+ function getSearchParams(isFuck) {
712
+ var _a;
713
+ if (isFuck === void 0) {
714
+ isFuck = false;
715
+ }
716
+ var searchConfig = propsCache.current.searchConfig;
717
+ var values = searchForm.getFieldsValue();
718
+ var data = tranformQueryData(values, searchConfig, isFuck);
719
+ var v = (_a = beforeSearch === null || beforeSearch === void 0 ? void 0 : beforeSearch(data)) !== null && _a !== void 0 ? _a : data;
720
+ mchcLogger.log('getSearchParams', defaultQuery.current, {
721
+ values: values,
722
+ v: v,
723
+ data: data
724
+ });
725
+ return __assign(__assign({}, defaultQuery.current), v);
726
+ }
727
+ function handleSearch() {
728
+ return __awaiter(this, arguments, void 0, function (params) {
729
+ var res, data, pagination;
730
+ if (params === void 0) {
731
+ params = defaultQuery.current;
732
+ }
733
+ return __generator(this, function (_a) {
734
+ switch (_a.label) {
735
+ case 0:
736
+ if (!myBaseListService.current) return [2];
737
+ if (dataSource.some(function (_) {
738
+ return _isNil(_.id);
739
+ })) setDataSource([]);
740
+ setLoading(true);
741
+ return [4, Promise.all([myBaseListService.current.page({
742
+ params: params
743
+ }), sleep(.2)])["finally"](function () {
744
+ return setLoading(false);
745
+ })];
746
+ case 1:
747
+ res = _a.sent()[0];
748
+ data = res.data, pagination = res.pagination;
749
+ setDataSource(data);
750
+ setTotal(pagination.total);
751
+ mchcEvent.emit('BaseList_hook', {
752
+ type: 'search',
753
+ data: data,
754
+ name: name
755
+ });
756
+ return [2];
757
+ }
758
+ });
759
+ });
760
+ }
761
+ var handlePageChange = function handlePageChange(current, size) {
762
+ mchcLogger.log('handlePageChange', current, size);
763
+ setPageSize(size);
764
+ setCurrent(current);
765
+ handleSearch();
766
+ };
767
+ var handleRowSelected = function handleRowSelected(keys, rows) {
768
+ setCheckRows(rows);
769
+ };
770
+ function format_columns(cols) {
771
+ if (cols === void 0) {
772
+ cols = [];
773
+ }
774
+ return cols.filter(function (_) {
775
+ return _ && !_.hidden;
776
+ }).map(function (col) {
777
+ var _a;
778
+ if (col === void 0) {
779
+ col = {};
780
+ }
781
+ var _b = col,
782
+ inputProps = _b.inputProps,
783
+ props = _b.props,
784
+ dataIndex = _b.dataIndex,
785
+ width = _b.width;
786
+ var isOperativeCell = _isString(dataIndex) && ['__operation', 'operation'].includes(dataIndex);
787
+ var format_data = {
788
+ title: get_title(col),
789
+ dataIndex: get_dataIndex(col)
790
+ };
791
+ var a = __assign(__assign(__assign({
792
+ width: width !== null && width !== void 0 ? width : 120
793
+ }, col), format_data), {
794
+ children: format_columns(col === null || col === void 0 ? void 0 : col.children),
795
+ align: 'center',
796
+ ellipsis: (_a = col === null || col === void 0 ? void 0 : col.ellipsis) !== null && _a !== void 0 ? _a : {
797
+ showTitle: true
798
+ },
799
+ onCell: function onCell(rowData) {
800
+ return __assign(__assign(__assign({}, col), format_data), {
801
+ inputProps: inputProps !== null && inputProps !== void 0 ? inputProps : props,
802
+ record: rowData,
803
+ editing: isOperativeCell ? false : isEditing(rowData)
804
+ });
805
+ }
806
+ });
807
+ return a;
808
+ });
809
+ }
810
+ var renderEditableCell = function renderEditableCell(cell) {
811
+ var _a;
812
+ var editing = cell.editing,
813
+ dataIndex = cell.dataIndex,
814
+ title = cell.title,
815
+ _b = cell.inputType,
816
+ inputType = _b === void 0 ? 'input' : _b,
817
+ inputProps = cell.inputProps,
818
+ rules = cell.rules,
819
+ record = cell.record;
820
+ cell.index;
821
+ var children = cell.children,
822
+ inputConfig = cell.inputConfig,
823
+ render = cell.render,
824
+ restProps = __rest(cell, ["editing", "dataIndex", "title", "inputType", "inputProps", "rules", "record", "index", "children", "inputConfig", "render"]);
825
+ var C = (_a = MyBaseListComponents[inputType]) !== null && _a !== void 0 ? _a : function () {
826
+ return "Unkown Cell Component!";
827
+ };
828
+ return /*#__PURE__*/React.createElement("td", _extends({}, restProps, {
829
+ title: _get(record, dataIndex)
830
+ }), editing ? /*#__PURE__*/React.createElement(_Form.Item, {
831
+ name: dataIndex,
832
+ style: {
833
+ margin: 0
834
+ },
835
+ rules: getDefaultRequiredRules(rules, title || dataIndex)
836
+ }, /*#__PURE__*/React.createElement(C, _extends({}, inputProps, {
837
+ inputType: inputType,
838
+ config: inputConfig !== null && inputConfig !== void 0 ? inputConfig : cell
839
+ }))) : C.DisplayFC && !render ? /*#__PURE__*/React.createElement(InterceptDisplayFC, {
840
+ C: C,
841
+ config: inputConfig !== null && inputConfig !== void 0 ? inputConfig : cell,
842
+ value: _get(record, dataIndex)
843
+ }) : children);
844
+ };
845
+ var renderOthersModal = function renderOthersModal() {
846
+ return /*#__PURE__*/React.createElement(React.Fragment, null, visible && ModalForm && /*#__PURE__*/React.createElement(ModalForm, {
847
+ visible: visible,
848
+ editable: editable,
849
+ id: ___id,
850
+ extraModalData: extraModalData,
851
+ onCancel: function onCancel() {
852
+ handleCancel();
853
+ handleSearch();
854
+ },
855
+ onSearch: handleSearch,
856
+ onOk: function onOk() {
857
+ handleCancel();
858
+ handleSearch();
859
+ }
860
+ }));
861
+ };
862
+ function search() {
863
+ return __awaiter(this, void 0, void 0, function () {
864
+ var q;
865
+ return __generator(this, function (_a) {
866
+ setCheckRows([]);
867
+ setCurrent(1);
868
+ q = getSearchParams();
869
+ defaultQuery.current = q;
870
+ handleSearch(q);
871
+ return [2];
872
+ });
873
+ });
874
+ }
875
+ var renderAdd = function renderAdd() {
876
+ return /*#__PURE__*/React.createElement(_Space, null, RenderBtns === null || RenderBtns === void 0 ? void 0 : RenderBtns.call(window, actionCtx), showExport || onExport ? /*#__PURE__*/React.createElement(OkButton, {
877
+ icon: /*#__PURE__*/React.createElement(ExportOutlined, null),
878
+ type: "primary",
879
+ onClick: function onClick() {
880
+ var _a;
881
+ if (onExport) {
882
+ onExport(actionCtx);
883
+ } else {
884
+ (_a = myBaseListService.current) === null || _a === void 0 ? void 0 : _a["export"](getSearchParams()).then(function (r) {
885
+ downloadFile(r, "".concat(baseTitle).concat(formatDateTime(), ".xlsx"), 'application/vnd.ms-excel');
886
+ });
887
+ }
888
+ }
889
+ }, '导出') : null, showPrint ? /*#__PURE__*/React.createElement(OkButton, {
890
+ icon: /*#__PURE__*/React.createElement(ExportOutlined, null),
891
+ type: "primary",
892
+ onClick: function onClick() {
893
+ if (onPrint) {
894
+ onPrint(actionCtx);
895
+ } else {
896
+ mchcModal__.open('print_modal', {
897
+ modal_data: {
898
+ requestData: __assign(__assign({
899
+ url: name + 'print'
900
+ }, getSearchParams()), printDefaultConfig)
901
+ }
902
+ });
903
+ }
904
+ }
905
+ }, '打印') : null, showAdd ? /*#__PURE__*/React.createElement(OkButton, {
906
+ disabled: loading,
907
+ icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
908
+ type: "primary",
909
+ onClick: handleAdd
910
+ }, addText || '新增') : null, showSearch ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Divider, {
911
+ type: "vertical"
912
+ }), /*#__PURE__*/React.createElement(_Button.Group, null, RenderSearchBtns === null || RenderSearchBtns === void 0 ? void 0 : RenderSearchBtns.call(window, actionCtx), /*#__PURE__*/React.createElement(OkButton, {
913
+ htmlType: "reset",
914
+ icon: /*#__PURE__*/React.createElement(ReloadOutlined, null),
915
+ disabled: loading,
916
+ onClick: function onClick() {
917
+ searchForm.resetFields();
918
+ defaultQuery.current = defaultQueryValue;
919
+ setDataSource([]);
920
+ setCurrent(1);
921
+ setPageSize(defaultQueryValue.size);
922
+ handleSearch();
923
+ }
924
+ }, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(OkButton, {
925
+ type: "primary",
926
+ htmlType: "submit",
927
+ disabled: loading,
928
+ onClick: function onClick() {
929
+ return search();
930
+ },
931
+ icon: /*#__PURE__*/React.createElement(SearchOutlined, null)
932
+ }, "\u67E5\u8BE2"))) : null);
933
+ };
934
+ var renderTitle = function renderTitle() {
935
+ return /*#__PURE__*/React.createElement("div", {
936
+ ref: queryRef,
937
+ style: __assign({
938
+ padding: 4
939
+ }, longSearchForm ? {
940
+ display: 'flex',
941
+ flexDirection: 'column-reverse'
942
+ } : {
943
+ display: 'flex',
944
+ justifyContent: 'space-between'
945
+ })
946
+ }, /*#__PURE__*/React.createElement("div", {
947
+ ref: formWrapper,
948
+ style: {
949
+ display: 'flex',
950
+ alignItems: 'center',
951
+ justifyContent: 'space-between',
952
+ paddingTop: 4
953
+ }
954
+ }, showSearch ? /*#__PURE__*/React.createElement(_Form, {
955
+ initialValues: initialSearchValue,
956
+ form: searchForm,
957
+ layout: "inline",
958
+ onFinish: function onFinish() {
959
+ search();
960
+ }
961
+ }, searchConfig ? /*#__PURE__*/React.createElement(MyBaseListRenderFormSection, {
962
+ config: searchConfig,
963
+ disabled: loading
964
+ }) : null) : null), /*#__PURE__*/React.createElement("div", {
965
+ style: {
966
+ display: 'flex',
967
+ alignItems: 'center',
968
+ justifyContent: 'flex-end',
969
+ borderBottom: longSearchForm ? '1px dashed #ddd' : 0,
970
+ paddingBottom: 4,
971
+ paddingRight: 28
972
+ }
973
+ }, renderAdd()));
974
+ };
975
+ var mergedColumns = format_columns(cal_columns);
976
+ var __pagination = needPagination ? {
977
+ position: ['bottomCenter'],
978
+ total: total,
979
+ size: 'small',
980
+ showTotal: function showTotal(_total) {
981
+ return "\u603B\u5171 ".concat(total, " \u6761");
982
+ },
983
+ pageSizeOptions: [10, 20, 50, 100].map(function (_) {
984
+ return _.toString();
985
+ }),
986
+ pageSize: __pageSize,
987
+ current: __current,
988
+ onChange: handlePageChange,
989
+ onShowSizeChange: handlePageChange,
990
+ showQuickJumper: true,
991
+ showSizeChanger: true
992
+ } : {};
993
+ var __components = needEditInTable || true ? {
994
+ body: {
995
+ cell: renderEditableCell
996
+ }
997
+ } : {};
998
+ return /*#__PURE__*/React.createElement("div", {
999
+ className: "base-list",
1000
+ ref: wrapRef
1001
+ }, /*#__PURE__*/React.createElement(_Form, {
1002
+ onSubmitCapture: function onSubmitCapture(e) {
1003
+ _message.info('onSubmitCapture');
1004
+ },
1005
+ onFinish: function onFinish() {
1006
+ _message.info('onFinish');
1007
+ },
1008
+ form: form,
1009
+ component: false,
1010
+ onFieldsChange: handleFieldsChange
1011
+ }, /*#__PURE__*/React.createElement("div", {
1012
+ className: "global-base-table",
1013
+ id: "global-base-table"
1014
+ }, renderTitle === null || renderTitle === void 0 ? void 0 : renderTitle(), /*#__PURE__*/React.createElement(Table, {
1015
+ dataSource: dataSource,
1016
+ rowKey: rowKey || 'id',
1017
+ bordered: true,
1018
+ loading: loading,
1019
+ pagination: __pagination,
1020
+ title: undefined,
1021
+ style: {
1022
+ padding: '0 12px'
1023
+ },
1024
+ components: __components,
1025
+ scroll: {
1026
+ scrollToFirstRowOnChange: true,
1027
+ x: _get(otherTableProps, 'scroll.x') || 'calc(100px)',
1028
+ y: _get(otherTableProps, 'scroll.y') || tableHeight
1029
+ },
1030
+ columns: mergedColumns,
1031
+ rowSelection: needChecked ? {
1032
+ type: 'checkbox',
1033
+ onChange: handleRowSelected,
1034
+ selectedRowKeys: checkRows.map(function (_) {
1035
+ return _.id;
1036
+ })
1037
+ } : undefined,
1038
+ onRow: function onRow(record) {
1039
+ return {
1040
+ onClick: function onClick(event) {
1041
+ return handleClickRow === null || handleClickRow === void 0 ? void 0 : handleClickRow(record, render_props, event);
1042
+ },
1043
+ onDoubleClick: function onDoubleClick(event) {
1044
+ return handleDoubleClickRow === null || handleDoubleClickRow === void 0 ? void 0 : handleDoubleClickRow(record, render_props, event);
1045
+ },
1046
+ onContextMenu: function onContextMenu(event) {
1047
+ event.preventDefault();
1048
+ }
1049
+ };
1050
+ }
1051
+ }))), renderOthersModal(), children);
1052
+ }
1053
+ export { _MyBaseList, _MyBaseList as default };
1054
+ //# sourceMappingURL=.root3.js.map