@lm_fe/pages 0.1.201 → 0.2.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 (173) hide show
  1. package/README.md +0 -0
  2. package/dist/a_chunks/.root.js +1610 -222
  3. package/dist/a_chunks/.root10.js +494 -462
  4. package/dist/a_chunks/.root11.js +231 -159
  5. package/dist/a_chunks/.root12.js +245 -186
  6. package/dist/a_chunks/.root13.js +1898 -104
  7. package/dist/a_chunks/.root14.js +147 -716
  8. package/dist/a_chunks/.root15.js +27 -44
  9. package/dist/a_chunks/.root16.js +18 -168
  10. package/dist/a_chunks/.root17.js +20 -255
  11. package/dist/a_chunks/.root18.js +168 -385
  12. package/dist/a_chunks/.root19.js +119 -403
  13. package/dist/a_chunks/.root2.js +101 -73
  14. package/dist/a_chunks/.root20.js +74 -945
  15. package/dist/a_chunks/.root21.js +168 -202
  16. package/dist/a_chunks/.root22.js +677 -144
  17. package/dist/a_chunks/.root23.js +27 -956
  18. package/dist/a_chunks/.root24.js +126 -742
  19. package/dist/a_chunks/.root25.js +214 -265
  20. package/dist/a_chunks/.root26.js +391 -0
  21. package/dist/a_chunks/.root27.js +395 -0
  22. package/dist/a_chunks/.root28.js +948 -0
  23. package/dist/a_chunks/.root29.js +214 -0
  24. package/dist/a_chunks/.root3.js +56 -1044
  25. package/dist/a_chunks/.root30.js +130 -0
  26. package/dist/a_chunks/.root31.js +914 -0
  27. package/dist/a_chunks/.root32.js +860 -0
  28. package/dist/a_chunks/.root33.js +102 -0
  29. package/dist/a_chunks/.root34.js +157 -0
  30. package/dist/a_chunks/.root4.js +1004 -581
  31. package/dist/a_chunks/.root5.js +610 -1414
  32. package/dist/a_chunks/.root6.js +1399 -155
  33. package/dist/a_chunks/.root7.js +151 -123
  34. package/dist/a_chunks/.root8.js +82 -504
  35. package/dist/a_chunks/.root9.js +97 -60
  36. package/dist/a_chunks/data.js +572 -0
  37. package/dist/a_chunks/func.js +86 -0
  38. package/dist/a_chunks/index.js +942 -265
  39. package/dist/a_chunks/use_fetus.js +138 -0
  40. package/dist/a_chunks/utils.js +100 -0
  41. package/dist/a_chunks/utils2.js +36 -0
  42. package/dist/block//346/243/200/351/252/214/346/243/200/346/237/245/Inner.d.ts +1 -0
  43. package/dist/components/BF_Form/Wrap.d.ts +2 -2
  44. package/dist/components/BF_Form/index.d.ts +4 -2
  45. package/dist/components/BF_Form/types.d.ts +7 -0
  46. package/dist/components/BF_Form/use_table_config.d.ts +1 -5
  47. package/dist/components/Base_List/Helper.d.ts +0 -5
  48. package/dist/components/Base_List/_MyBaseList.d.ts +1 -0
  49. package/dist/components/Base_List/index.d.ts +2 -1
  50. package/dist/components/Base_List/types.d.ts +6 -3
  51. package/dist/components/Base_List/use_MyBaseList.d.ts +10 -0
  52. package/dist/components/Base_List/utils.d.ts +11 -0
  53. package/dist/components/IdNOButton/index copy.d.ts +1 -1
  54. package/dist/components/Layout_Sider/Inner.d.ts +2 -4
  55. package/dist/components/Layout_Sider/index.d.ts +2 -2
  56. package/dist/components/Layout_Sider/utils.d.ts +13 -0
  57. package/dist/components/Layout_TabButton/Inner.d.ts +2 -10
  58. package/dist/components/Layout_TabButton/index.d.ts +3 -8
  59. package/dist/components/Layout_TabButton/types.d.ts +8 -0
  60. package/dist/components/Login/Inner.d.ts +0 -1
  61. package/dist/components/Login/index.d.ts +2 -1
  62. package/dist/components/MenuSearch/Inner.d.ts +6 -0
  63. package/dist/components/MenuSearch/index.d.ts +2 -0
  64. package/dist/components/QuickDocButton/index.d.ts +5 -1
  65. package/dist/components/doctor_end/HeaderInfo/FuckTag.d.ts +6 -0
  66. package/dist/components/doctor_end/HeaderInfo/index.d.ts +1 -0
  67. package/dist/components/doctor_end/HeaderInfo/types.d.ts +1 -3
  68. package/dist/components/doctor_end/HeaderInfo/use_headinfo_color.d.ts +8 -0
  69. package/dist/components/exception/index.d.ts +1 -0
  70. package/dist/components/index.d.ts +1 -0
  71. package/dist/curve/components/BmiCanvas/index.d.ts +11 -0
  72. package/dist/curve/components/FetusCanvas/FetuGrowsEdit.d.ts +7 -0
  73. package/dist/curve/components/FetusCanvas/config.d.ts +3 -0
  74. package/dist/curve/components/FetusCanvas/index.d.ts +4 -0
  75. package/dist/curve/components/FetusCanvas/requestMethods.d.ts +7 -0
  76. package/dist/curve/components/FetusCanvasNICHD/config.d.ts +3 -0
  77. package/dist/curve/components/FetusCanvasNICHD/data.d.ts +84 -0
  78. package/dist/curve/components/FetusCanvasNICHD/index.d.ts +4 -0
  79. package/dist/curve/components/Pregnogram/index.d.ts +11 -0
  80. package/dist/curve/components/api.d.ts +17 -0
  81. package/dist/curve/components-new/FetusCanvas/config.d.ts +2 -0
  82. package/dist/curve/components-new/FetusCanvas/requestMethods.d.ts +7 -0
  83. package/dist/curve/components-new/FetusCanvasNICHD/config.d.ts +2 -0
  84. package/dist/curve/components-new/FetusCanvasNICHD/data.d.ts +84 -0
  85. package/dist/curve/data.d.ts +125 -0
  86. package/dist/curve/func.d.ts +12 -0
  87. package/dist/curve/func.test.d.ts +1 -0
  88. package/dist/curve/index.d.ts +7 -0
  89. package/dist/curve/intro-steps.d.ts +7 -0
  90. package/dist/curve/utils.d.ts +8 -0
  91. package/dist/form_config/conceiveMode.d.ts +2 -0
  92. package/dist/form_config/index.d.ts +4 -0
  93. package/dist/form_config/mlUltrasounds.d.ts +2 -0
  94. package/dist/form_config/not_yes_input.d.ts +4 -0
  95. package/dist/form_config/pressure.d.ts +4 -0
  96. package/dist/hooks/index.d.ts +1 -0
  97. package/dist/index.d.ts +2 -0
  98. package/dist/index.js +8 -33
  99. package/dist/modals/entries/StupidTemplateModal2/index copy.d.ts +22 -0
  100. package/dist/modals/entries/StupidTemplateModal2/index.d.ts +1 -2
  101. package/dist/modals/entries/box/index.d.ts +6 -0
  102. package/dist/modals/entries/modal_form/index.d.ts +1 -1
  103. package/dist/modals/entries/result_template/index.d.ts +24 -0
  104. package/dist/modals/entries/template_modal3/components/TemplateSelect.d.ts +2 -1
  105. package/dist/modals/entries/template_modal3/index copy 2.d.ts +1 -1
  106. package/dist/modals/entries/template_modal3/index.d.ts +5 -3
  107. package/dist/modals/entries/text_search/index.d.ts +1 -1
  108. package/dist/modals/entries//344/271/231/350/202/235/347/256/241/347/220/206/index.d.ts +1 -1
  109. 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/utils.d.ts +5 -0
  110. 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 +2 -7
  111. 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 +2 -1
  112. 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 +2 -7
  113. 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 +2 -2
  114. 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 +3 -3
  115. 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 +2 -2
  116. 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 +4 -5
  117. 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 +1 -1
  118. package/dist/modals/entries//351/253/230/345/215/261/345/233/240/347/264/240/347/256/241/347/220/206/Tag.d.ts +12 -0
  119. package/dist/modals/entries//351/253/230/345/215/261/345/233/240/347/264/240/347/256/241/347/220/206/utils.d.ts +8 -0
  120. package/dist/modals/entries//351/253/230/345/215/261/351/232/217/350/256/277/form_config.d.ts +4 -2
  121. package/dist/modals/index.d.ts +2 -0
  122. package/dist/modals/meta.d.ts +2 -0
  123. package/dist/pages/doc_record/index.d.ts +1 -1
  124. package/dist/pages/index.d.ts +1 -0
  125. package/dist/pages/questionnaire/Inner.d.ts +4 -0
  126. package/dist/pages/questionnaire/Qn.d.ts +3 -0
  127. package/dist/pages/questionnaire/SelectButton.d.ts +4 -0
  128. package/dist/pages/questionnaire/create/Step2Right.d.ts +11 -0
  129. package/dist/pages/questionnaire/create/common.d.ts +46 -0
  130. package/dist/pages/questionnaire/create/fakeData.d.ts +6 -0
  131. package/dist/pages/questionnaire/create/question-item.d.ts +14 -0
  132. package/dist/pages/questionnaire/create/step1.d.ts +12 -0
  133. package/dist/pages/questionnaire/create/step2.d.ts +10 -0
  134. package/dist/pages/questionnaire/create/step3.d.ts +8 -0
  135. package/dist/pages/questionnaire/create/step4.d.ts +8 -0
  136. package/dist/pages/questionnaire/index.d.ts +3 -0
  137. package/dist/pages/questionnaire/types.d.ts +10 -0
  138. package/dist/utils/helper.d.ts +5 -0
  139. package/dist/utils/index.d.ts +2 -1
  140. package/package.json +34 -16
  141. package/dist/a_chunks/.root.js.map +0 -1
  142. package/dist/a_chunks/.root10.js.map +0 -1
  143. package/dist/a_chunks/.root11.js.map +0 -1
  144. package/dist/a_chunks/.root12.js.map +0 -1
  145. package/dist/a_chunks/.root13.js.map +0 -1
  146. package/dist/a_chunks/.root14.js.map +0 -1
  147. package/dist/a_chunks/.root15.js.map +0 -1
  148. package/dist/a_chunks/.root16.js.map +0 -1
  149. package/dist/a_chunks/.root17.js.map +0 -1
  150. package/dist/a_chunks/.root18.js.map +0 -1
  151. package/dist/a_chunks/.root19.js.map +0 -1
  152. package/dist/a_chunks/.root2.js.map +0 -1
  153. package/dist/a_chunks/.root20.js.map +0 -1
  154. package/dist/a_chunks/.root21.js.map +0 -1
  155. package/dist/a_chunks/.root22.js.map +0 -1
  156. package/dist/a_chunks/.root23.js.map +0 -1
  157. package/dist/a_chunks/.root24.js.map +0 -1
  158. package/dist/a_chunks/.root25.js.map +0 -1
  159. package/dist/a_chunks/.root3.js.map +0 -1
  160. package/dist/a_chunks/.root4.js.map +0 -1
  161. package/dist/a_chunks/.root5.js.map +0 -1
  162. package/dist/a_chunks/.root6.js.map +0 -1
  163. package/dist/a_chunks/.root7.js.map +0 -1
  164. package/dist/a_chunks/.root8.js.map +0 -1
  165. package/dist/a_chunks/.root9.js.map +0 -1
  166. package/dist/a_chunks/extends.js +0 -11
  167. package/dist/a_chunks/extends.js.map +0 -1
  168. package/dist/a_chunks/index.js.map +0 -1
  169. package/dist/components/BF_Form/use_table_config copy.d.ts +0 -13
  170. package/dist/index.js.map +0 -1
  171. package/dist/modals/entries/StupidTemplateModal2/methods/index.d.ts +0 -16
  172. 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 +0 -12
  173. 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" +0 -12
@@ -1,170 +1,242 @@
1
- import 'antd/es/modal/style';
2
- import _Modal from 'antd/es/modal';
3
- import { _ as _extends } from './extends.js';
4
- import 'antd/es/form/style';
5
- import _Form from 'antd/es/form';
6
- import { d as __rest, f as BF_Wrap2, b as __assign, _ as __awaiter, a as __generator, E as ErrorBoundarySmall } from './index.js';
7
- import React, { useState, useEffect } from 'react';
8
- import { mchcDriver, mchcEvent } from '@lm_fe/env';
9
- import { FormSection } from '@lm_fe/components_m';
10
- import { safe_async_call } from '@lm_fe/utils';
11
- import 'antd/es/row/style';
12
- import 'antd/es/row';
13
- import 'antd/es/col/style';
14
- import 'antd/es/col';
15
- import '@lm_fe/components';
16
- import 'antd/es/result/style';
17
- import 'antd/es/result';
18
- import 'lodash/keys';
19
- import 'lodash/get';
20
- import '@ant-design/icons';
21
- import '@lm_fe/service';
22
- import 'antd/es/list/style';
23
- import 'antd/es/list';
24
- import 'antd/es/tooltip/style';
25
- import 'antd/es/tooltip';
1
+ import { s as styleInject, b as __awaiter, c as __generator, g as curve_api } from './index.js';
2
+ import { MyIcon } from '@lm_fe/components';
3
+ import { use_provoke } from '@lm_fe/provoke';
4
+ import { Radio, Button } from 'antd';
5
+ import { get, cloneDeep, forEach } from 'lodash';
6
+ import React, { useRef, useEffect } from 'react';
7
+ import ReactToPrint from 'react-to-print';
8
+ import { g as get_line_color, a as get_text_color, p as printCanvas, j as judgeAreas, b as get_fetus_color, c as get_abnormal_color, d as get_canvas_el, e as draw_info, s as setVerRules, f as setHorRules } from './func.js';
9
+ import { b as bmiData1, a as bmiData2, c as bmiData3, d as bmiData4 } from './data.js';
10
+ import '@lm_fe/utils';
26
11
  import 'classnames';
27
- import 'antd/es/button/style';
28
- import 'antd/es/button';
29
- import 'antd/es/spin/style';
30
- import 'antd/es/spin';
31
- import 'antd/es/menu/style';
32
- import 'antd/es/menu';
33
- import 'antd/es/message/style';
34
- import 'antd/es/message';
35
- import 'antd/es/space/style';
36
- import 'antd/es/space';
37
- import 'antd/es/divider/style';
38
- import 'antd/es/divider';
39
- function MyModalForm(_a) {
40
- var _this = this;
41
- var _b;
42
- var modal_data = _a.modal_data,
43
- _onOk = _a.onOk,
44
- _c = _a.bodyStyle,
45
- bodyStyle = _c === void 0 ? {} : _c,
46
- width = _a.width,
47
- others = __rest(_a, ["modal_data", "onOk", "bodyStyle", "width"]);
48
- var _d = modal_data.title,
49
- title = _d === void 0 ? "" : _d,
50
- bf_title = modal_data.bf_title,
51
- _e = modal_data.formDescriptions,
52
- formDescriptions = _e === void 0 ? [] : _e,
53
- _f = modal_data.targetLabelCol,
54
- targetLabelCol = _f === void 0 ? 4 : _f,
55
- defaultFormItemLayout = modal_data.defaultFormItemLayout,
56
- _onFieldsChange = modal_data.onFieldsChange,
57
- _onValuesChange = modal_data.onValuesChange,
58
- onSubmit = modal_data.onSubmit,
59
- getInitialData = modal_data.getInitialData,
60
- disableAll = modal_data.disableAll,
61
- _g = modal_data.modalFormSize,
62
- modalFormSize = _g === void 0 ? 'middle' : _g;
63
- var _form = _Form.useForm()[0];
64
- var form = (_b = modal_data.form) !== null && _b !== void 0 ? _b : _form;
65
- var _h = useState({}),
66
- data = _h[0],
67
- setData = _h[1];
68
- var _j = BF_Wrap2({
69
- default_conf: {
70
- title: bf_title,
71
- tableColumns: formDescriptions
72
- }
73
- }),
74
- Wrap = _j.Wrap,
75
- config = _j.config;
76
- useEffect(function () {
77
- var _a, _b;
78
- (_b = (_a = safe_async_call(function () {
79
- return getInitialData === null || getInitialData === void 0 ? void 0 : getInitialData();
80
- })).then) === null || _b === void 0 ? void 0 : _b.call(_a, function (v) {
81
- setData(v);
82
- form.setFieldsValue(v);
83
- });
84
- return function () {};
85
- }, []);
12
+ import '@lm_fe/components_m';
13
+ import '@lm_fe/env';
14
+ import '@lm_fe/service';
15
+ var css_248z = ".bmi-wrapper {\n width: 700px;\n position: relative;\n}\n.bmi-wrapper .bmi-radio {\n position: absolute;\n top: 16px;\n left: 45px;\n}\n.bmi-wrapper .print-btn {\n position: absolute;\n top: 102px;\n right: 52px;\n}\n";
16
+ styleInject(css_248z);
17
+ var recordOptions = [{
18
+ label: '全部',
19
+ value: 0
20
+ }, {
21
+ label: '产检记录',
22
+ value: 1
23
+ }, {
24
+ label: '居家记录',
25
+ value: 2
26
+ }];
27
+ function BmiCanvas(props) {
28
+ var _a;
29
+ var _b = use_provoke('sys_theme', 'config'),
30
+ sys_theme = _b.sys_theme,
31
+ config = _b.config;
32
+ var headerInfo = props.headerInfo,
33
+ id = props.id;
34
+ props.isAllPregnancies;
35
+ var line_color = get_line_color(sys_theme);
36
+ var font_color = get_text_color(sys_theme);
37
+ get(headerInfo, "id") || id;
38
+ var imageRef = useRef();
39
+ var bmi_Data = useRef(bmiData1);
40
+ var bmiNum = useRef('');
41
+ var bmiTz = useRef('');
42
+ var bmiList = useRef([]);
43
+ var resdata = useRef({});
44
+ var default_type = (_a = config.医生端_BMI曲线类型) !== null && _a !== void 0 ? _a : 0;
86
45
  useEffect(function () {
87
- return mchcDriver.on_rm('data', function (e) {
88
- if (e.type === 'ReadCard') {
89
- var res = e.data;
90
- form.setFieldsValue({
91
- idNO: res.idNO,
92
- name: res.name
93
- });
94
- }
46
+ getResData().then(function () {
47
+ ste_data_and_draw(default_type);
95
48
  });
96
49
  }, []);
97
- function renderEditContent() {
98
- if (bf_title) return /*#__PURE__*/React.createElement(Wrap, null, /*#__PURE__*/React.createElement(FormSection, {
99
- formDescriptions: config === null || config === void 0 ? void 0 : config.tableColumns,
100
- disableAll: disableAll,
101
- defaultFormItemLayout: defaultFormItemLayout,
102
- targetLabelCol: targetLabelCol,
103
- form: form
104
- }), ";");
105
- return /*#__PURE__*/React.createElement(FormSection, {
106
- formDescriptions: formDescriptions,
107
- disableAll: disableAll,
108
- defaultFormItemLayout: defaultFormItemLayout,
109
- targetLabelCol: targetLabelCol,
110
- form: form
50
+ function getResData() {
51
+ return __awaiter(this, void 0, void 0, function () {
52
+ var pregnancyId, res0, res1, res2;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0:
56
+ pregnancyId = get(headerInfo, 'id') || id;
57
+ return [4, curve_api.curve.getBmi(pregnancyId, 0)];
58
+ case 1:
59
+ res0 = _a.sent();
60
+ return [4, curve_api.curve.getBmi(pregnancyId, 1)];
61
+ case 2:
62
+ res1 = _a.sent();
63
+ return [4, curve_api.curve.getBmi(pregnancyId, 2)];
64
+ case 3:
65
+ res2 = _a.sent();
66
+ resdata.current = {
67
+ 0: res0,
68
+ 1: res1,
69
+ 2: res2
70
+ };
71
+ return [2];
72
+ }
73
+ });
111
74
  });
112
75
  }
113
- return /*#__PURE__*/React.createElement(_Modal, _extends({
114
- title: (data === null || data === void 0 ? void 0 : data.id) ? "\u4FEE\u6539".concat(title) : "\u6DFB\u52A0".concat(title),
115
- centered: true,
116
- destroyOnClose: true,
117
- width: width !== null && width !== void 0 ? width : "60vw",
118
- bodyStyle: __assign({
119
- padding: '12px 20px',
120
- height: '70vh',
121
- overflowY: 'scroll'
122
- }, bodyStyle),
123
- onOk: function onOk(e) {
124
- form.validateFields().then(function () {
125
- return __awaiter(_this, void 0, void 0, function () {
126
- var formData, a;
127
- return __generator(this, function (_a) {
128
- switch (_a.label) {
129
- case 0:
130
- formData = form.getFieldsValue();
131
- return [4, safe_async_call(onSubmit, __assign(__assign({}, data), formData))];
132
- case 1:
133
- a = _a.sent();
134
- if (!a) return [2];
135
- _onOk === null || _onOk === void 0 ? void 0 : _onOk(e);
136
- return [2];
137
- }
138
- });
139
- });
140
- })["catch"](function (error) {
141
- console.error('modal_form 发生错误', error);
76
+ function ste_data_and_draw(type) {
77
+ return __awaiter(this, void 0, void 0, function () {
78
+ var res;
79
+ return __generator(this, function (_a) {
80
+ res = get(resdata.current, "".concat(type));
81
+ if (get(res, 'preBmi') < 18.5) {
82
+ bmi_Data.current = bmiData1;
83
+ } else if (get(res, 'preBmi') < 25) {
84
+ bmi_Data.current = bmiData2;
85
+ } else if (get(res, 'preBmi') < 30) {
86
+ bmi_Data.current = bmiData3;
87
+ } else if (get(res, 'preBmi') >= 30) {
88
+ bmi_Data.current = bmiData4;
89
+ }
90
+ bmiNum.current = get(res, 'preBmi');
91
+ bmiTz.current = get(res, 'weight');
92
+ bmiList.current = get(res, 'items');
93
+ drawBmiCanvas();
94
+ return [2];
142
95
  });
96
+ });
97
+ }
98
+ function handleRadioChange(e) {
99
+ ste_data_and_draw(e.target.value);
100
+ }
101
+ function drawScaleLine(canvas, ctx, oringin, steps, data, point, color, shape, lineWidth) {
102
+ for (var i = 0; i < data.length; i++) {
103
+ ctx.beginPath();
104
+ ctx.setLineDash(shape);
105
+ ctx.lineWidth = lineWidth;
106
+ if (i < data.length - 1) {
107
+ ctx.moveTo(oringin[0] + steps[0] * data[i].x, oringin[1] - steps[1] * data[i].y);
108
+ ctx.lineTo(oringin[0] + steps[0] * data[i + 1].x, oringin[1] - steps[1] * data[i + 1].y);
109
+ }
110
+ ctx.strokeStyle = color;
111
+ ctx.stroke();
112
+ if (point[0]) {
113
+ ctx.beginPath();
114
+ ctx.setLineDash([]);
115
+ ctx.arc(oringin[0] + steps[0] * data[i].x, oringin[1] - steps[1] * data[i].y, 3, 0, 2 * Math.PI);
116
+ ctx.fillStyle = point[1];
117
+ ctx.fill();
118
+ }
143
119
  }
144
- }, others), /*#__PURE__*/React.createElement(ErrorBoundarySmall, null, /*#__PURE__*/React.createElement(_Form, {
145
- size: modalFormSize,
146
- onFieldsChange: function onFieldsChange(a, b) {
147
- _onFieldsChange === null || _onFieldsChange === void 0 ? void 0 : _onFieldsChange(a, b, form);
148
- },
149
- onValuesChange: function onValuesChange(changedValues, b) {
150
- var k = Object.keys(changedValues)[0];
151
- var v = changedValues[k];
152
- _onValuesChange === null || _onValuesChange === void 0 ? void 0 : _onValuesChange(changedValues, b, form);
153
- mchcEvent.emit('my_form', {
154
- type: 'onChange',
155
- name: k,
156
- value: v,
157
- values: b,
158
- form: form,
159
- setValue: function setValue(name, value) {
160
- var _a;
161
- form.setFieldsValue((_a = {}, _a[name] = value, _a));
120
+ }
121
+ function setVertical(context, xCount, yCount, xStep, yStep, baseLeft, baseTop) {
122
+ context.strokeStyle = line_color;
123
+ for (var i = 0; i < xCount; i++) {
124
+ context.beginPath();
125
+ context.lineWidth = 1;
126
+ context.moveTo(baseLeft, baseTop + xStep * i);
127
+ context.lineTo(baseLeft + (yCount - 1) * yStep, baseTop + xStep * i);
128
+ context.textBaseline = 'middle';
129
+ context.fillStyle = font_color;
130
+ context.font = 'bold 12px consolas';
131
+ context.fillText(i * 2 + -8, baseLeft - 20, (xCount - 1) * xStep + baseTop - i * xStep);
132
+ context.stroke();
133
+ }
134
+ context.font = 'bold 12px normal';
135
+ context.fillText('体重增长(kg)', baseLeft - 20, baseTop - 20);
136
+ }
137
+ function setHorizontal(context, xCount, yCount, xStep, yStep, baseLeft, baseTop) {
138
+ var count = 0;
139
+ for (var i = 0; i < yCount; i++) {
140
+ count++;
141
+ context.beginPath();
142
+ context.lineWidth = 1;
143
+ context.moveTo(yStep * i + baseLeft, baseTop);
144
+ context.lineTo(yStep * i + baseLeft, baseTop + xStep * (xCount - 1));
145
+ context.textAlign = 'center';
146
+ context.fillStyle = font_color;
147
+ context.font = 'bold 12px consolas';
148
+ if (count === 1 || count === 4) {
149
+ count = count === 4 ? 1 : count;
150
+ context.fillText(i + 1, baseLeft + i * yStep, xStep * xCount + baseTop - 15);
151
+ }
152
+ context.stroke();
153
+ }
154
+ context.font = 'bold 12px normal';
155
+ context.fillText('孕周(周)', yStep * yCount + baseLeft + 15, (xCount - 1) * xStep + baseTop);
156
+ }
157
+ function drawBmiCanvas() {
158
+ var _a = bmi_Data.current,
159
+ bmiBottomLine = _a.bmiBottomLine,
160
+ bmiIntro = _a.bmiIntro,
161
+ bmiLinesPoints = _a.bmiLinesPoints,
162
+ bmiTopLine = _a.bmiTopLine;
163
+ var newBmiList = cloneDeep(bmiList.current);
164
+ newBmiList.map(function (item) {
165
+ if (!item.weight || !item.week) {
166
+ item.weight = 0;
167
+ item.week = -1;
168
+ } else {
169
+ item.weight = item.weight - Number(bmiTz.current);
170
+ if (item.week.indexOf('+') !== -1) {
171
+ var arr = item.week.split('+');
172
+ item.week = Number(arr[0]) + Number(arr[1]) / 7;
162
173
  }
163
- });
174
+ item.week = item.week - 1;
175
+ }
176
+ });
177
+ newBmiList = newBmiList.filter(function (i) {
178
+ return i.week >= 0 && i.week <= 39 && i.weight >= -8 && i.weight <= 24;
179
+ });
180
+ newBmiList.length > 0 && newBmiList.map(function (item) {
181
+ item.x = item.week;
182
+ item.y = item.weight;
183
+ });
184
+ var unusualColor = newBmiList.length > 0 && judgeAreas(newBmiList[newBmiList.length - 1], bmiLinesPoints) ? get_fetus_color(sys_theme, 0) : get_abnormal_color(sys_theme);
185
+ var canvas = get_canvas_el('bmi-canvas', sys_theme);
186
+ var context = canvas.getContext('2d');
187
+ canvas.width = 700;
188
+ canvas.height = 710;
189
+ var baseLeft = 60;
190
+ var baseTop = 190;
191
+ var xStep = 30;
192
+ var yStep = 15;
193
+ var xCount = 17;
194
+ var yCount = 40;
195
+ context.fillStyle = font_color;
196
+ context.font = 'bold 16px normal';
197
+ context.textAlign = 'center';
198
+ context.fillText("".concat(draw_info(headerInfo)), canvas.width / 2, baseTop - 120);
199
+ context.fillText('BMI孕期体重管理曲线', canvas.width / 2, baseTop - 80);
200
+ context.fillStyle = '#52aaff';
201
+ context.font = 'normal 12px normal';
202
+ context.fillText("\u5B55\u524DBMI: ".concat(bmiNum.current, " kg/\u33A1"), canvas.width / 2, baseTop - 50);
203
+ context.fillText(bmiIntro, canvas.width / 2, baseTop - 30);
204
+ context.fillStyle = font_color;
205
+ setVertical(context, xCount, yCount, xStep, yStep, baseLeft, baseTop);
206
+ setHorizontal(context, xCount, yCount, xStep, yStep, baseLeft, baseTop);
207
+ setVerRules(context, [baseLeft, baseTop + (xCount - 1) * xStep], (yCount - 1) * yStep, line_color, 1, yStep, 5);
208
+ setHorRules(context, [baseLeft, baseTop + (xCount - 1) * xStep], (xCount - 1) * xStep, line_color, 1, xStep, 5);
209
+ var endLineArr = [bmiBottomLine, bmiTopLine];
210
+ forEach(endLineArr, function (line) {
211
+ drawScaleLine(canvas, context, [baseLeft, baseTop + (xCount - 5) * xStep], [yStep, xStep / 2], line, [true, '#787878'], '#787878', [8], 2);
212
+ });
213
+ drawScaleLine(canvas, context, [baseLeft, baseTop + (xCount - 5) * xStep], [yStep, xStep / 2], newBmiList, [true, unusualColor], unusualColor, [], 2);
214
+ imageRef.current = canvas === null || canvas === void 0 ? void 0 : canvas.toDataURL('image/jpg');
215
+ props.onLoad && props.onLoad();
216
+ }
217
+ return /*#__PURE__*/React.createElement("div", {
218
+ className: "bmi-wrapper"
219
+ }, /*#__PURE__*/React.createElement(Radio.Group, {
220
+ className: "bmi-radio",
221
+ options: recordOptions,
222
+ defaultValue: default_type,
223
+ onChange: handleRadioChange
224
+ }), !get(props, 'hidePrintBtn') && (/*#__PURE__*/React.createElement(ReactToPrint, {
225
+ trigger: function trigger() {
226
+ return /*#__PURE__*/React.createElement(Button, {
227
+ type: "primary",
228
+ size: "small",
229
+ className: "print-btn"
230
+ }, /*#__PURE__*/React.createElement(MyIcon, {
231
+ value: 'PrinterOutlined'
232
+ }), " \u6253\u5370");
164
233
  },
165
- autoComplete: "off",
166
- form: form
167
- }, renderEditContent())));
234
+ content: function content() {
235
+ return printCanvas('bmi-canvas');
236
+ }
237
+ })), /*#__PURE__*/React.createElement("canvas", {
238
+ id: "bmi-canvas",
239
+ className: "bmi-canvas"
240
+ }, "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301canvas\uFF0C\u8BF7\u66F4\u6362\u6D4F\u89C8\u5668."));
168
241
  }
169
- export { MyModalForm as default };
170
- //# sourceMappingURL=.root11.js.map
242
+ export { BmiCanvas as default };