@lm_fe/pages 0.1.201 → 0.2.5

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 (191) hide show
  1. package/README.md +1 -1
  2. package/dist/a_chunks/{.root5.js → components.doctor_end.ExemplaryCase.js} +36 -68
  3. package/dist/a_chunks/components.doctor_end.HeaderInfo.js +635 -0
  4. package/dist/a_chunks/curve.components.BmiCanvas.js +242 -0
  5. package/dist/a_chunks/curve.components.FetusCanvas.js +259 -0
  6. package/dist/a_chunks/curve.components.FetusCanvasNICHD.js +1907 -0
  7. package/dist/a_chunks/curve.components.Pregnogram.js +166 -0
  8. package/dist/a_chunks/data.js +572 -0
  9. package/dist/a_chunks/func.js +86 -0
  10. package/dist/a_chunks/index.js +1049 -286
  11. package/dist/a_chunks/modals.entries.BF_Form.js +41 -0
  12. package/dist/a_chunks/modals.entries.StupidTemplateModal2.js +22 -0
  13. package/dist/a_chunks/modals.entries.box.js +23 -0
  14. package/dist/a_chunks/{.root11.js → modals.entries.modal_form.js} +99 -70
  15. package/dist/a_chunks/modals.entries.modal_page.js +143 -0
  16. package/dist/a_chunks/{.root13.js → modals.entries.print_modal.js} +22 -48
  17. package/dist/a_chunks/modals.entries.result_template.js +201 -0
  18. package/dist/a_chunks/{.root14.js → modals.entries.template_modal3.js} +80 -124
  19. package/dist/a_chunks/modals.entries.test.js +30 -0
  20. package/dist/a_chunks/{.root16.js → modals.entries.text_search.js} +20 -49
  21. package/dist/a_chunks/{.root17.js → modals.entries./344/271/231/350/202/235/347/256/241/347/220/206.js} +17 -45
  22. package/dist/a_chunks/{.root18.js → 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.js} +68 -93
  23. package/dist/a_chunks/modals.entries./346/213/223/345/261/225/351/207/217/350/241/250.js +257 -0
  24. package/dist/a_chunks/{.root19.js → modals.entries./346/242/205/346/257/222/347/256/241/347/220/206.js} +58 -90
  25. package/dist/a_chunks/{.root20.js → 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.js} +144 -154
  26. package/dist/a_chunks/{.root21.js → 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.js} +27 -48
  27. package/dist/a_chunks/{.root22.js → modals.entries./350/257/212/346/226/255/345/216/206/345/217/262.js} +9 -37
  28. package/dist/a_chunks/{.root23.js → 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.js} +127 -172
  29. package/dist/a_chunks/{.root24.js → modals.entries./351/253/230/345/215/261/345/233/240/347/264/240/347/256/241/347/220/206.js} +438 -336
  30. package/dist/a_chunks/modals.entries./351/253/230/345/215/261/351/232/217/350/256/277.js +102 -0
  31. package/dist/a_chunks/modals.entries./351/253/230/345/215/261/351/232/217/350/256/2772.js +157 -0
  32. package/dist/a_chunks/{.root8.js → src.block./346/243/200/351/252/214/346/243/200/346/237/245.js} +69 -208
  33. package/dist/a_chunks/{.root3.js → src.components.Base_List.js} +329 -320
  34. package/dist/a_chunks/src.components.Layout_Sider.js +101 -0
  35. package/dist/a_chunks/src.components.Layout_TabButton.js +69 -0
  36. package/dist/a_chunks/src.components.Login.js +151 -0
  37. package/dist/a_chunks/src.components.MenuSearch.js +106 -0
  38. package/dist/a_chunks/{.root7.js → src.components.QuickDocButton.js} +1 -2
  39. package/dist/a_chunks/src.pages.questionnaire.js +1633 -0
  40. package/dist/a_chunks/use_fetus.js +138 -0
  41. package/dist/a_chunks/utils.js +100 -0
  42. package/dist/a_chunks/utils2.js +36 -0
  43. package/dist/block//346/243/200/351/252/214/346/243/200/346/237/245/Inner.d.ts +1 -0
  44. package/dist/components/BF_Form/Wrap.d.ts +2 -2
  45. package/dist/components/BF_Form/index.d.ts +4 -2
  46. package/dist/components/BF_Form/types.d.ts +7 -0
  47. package/dist/components/BF_Form/use_table_config.d.ts +1 -5
  48. package/dist/components/Base_List/Helper.d.ts +0 -5
  49. package/dist/components/Base_List/_MyBaseList.d.ts +1 -0
  50. package/dist/components/Base_List/index.d.ts +2 -1
  51. package/dist/components/Base_List/types.d.ts +6 -3
  52. package/dist/components/Base_List/use_MyBaseList.d.ts +10 -0
  53. package/dist/components/Base_List/utils.d.ts +11 -0
  54. package/dist/components/HighRiskTableEntry/utils.d.ts +4 -3
  55. package/dist/components/IdNOButton/index copy.d.ts +1 -1
  56. package/dist/components/Layout_Sider/Inner.d.ts +2 -4
  57. package/dist/components/Layout_Sider/index.d.ts +2 -2
  58. package/dist/components/Layout_Sider/utils.d.ts +13 -0
  59. package/dist/components/Layout_TabButton/Inner.d.ts +2 -10
  60. package/dist/components/Layout_TabButton/index.d.ts +3 -8
  61. package/dist/components/Layout_TabButton/types.d.ts +8 -0
  62. package/dist/components/Login/Inner.d.ts +0 -1
  63. package/dist/components/Login/index.d.ts +2 -1
  64. package/dist/components/MenuSearch/Inner.d.ts +6 -0
  65. package/dist/components/MenuSearch/index.d.ts +2 -0
  66. package/dist/components/QuickDocButton/index.d.ts +5 -1
  67. package/dist/components/doctor_end/HeaderInfo/FuckTag.d.ts +6 -0
  68. package/dist/components/doctor_end/HeaderInfo/index.d.ts +1 -0
  69. package/dist/components/doctor_end/HeaderInfo/types.d.ts +1 -3
  70. package/dist/components/doctor_end/HeaderInfo/use_headinfo_color.d.ts +8 -0
  71. package/dist/components/exception/index.d.ts +1 -0
  72. package/dist/components/index.d.ts +1 -0
  73. package/dist/curve/components/BmiCanvas/index.d.ts +11 -0
  74. package/dist/curve/components/FetusCanvas/FetuGrowsEdit.d.ts +7 -0
  75. package/dist/curve/components/FetusCanvas/config.d.ts +3 -0
  76. package/dist/curve/components/FetusCanvas/index.d.ts +4 -0
  77. package/dist/curve/components/FetusCanvas/requestMethods.d.ts +7 -0
  78. package/dist/curve/components/FetusCanvas/use_fetus.d.ts +33 -0
  79. package/dist/curve/components/FetusCanvasNICHD/config.d.ts +3 -0
  80. package/dist/curve/components/FetusCanvasNICHD/data.d.ts +84 -0
  81. package/dist/curve/components/FetusCanvasNICHD/index.d.ts +4 -0
  82. package/dist/curve/components/Pregnogram/index.d.ts +11 -0
  83. package/dist/curve/components/api.d.ts +17 -0
  84. package/dist/curve/components-new/BmiCanvas/index.d.ts +23 -0
  85. package/dist/curve/components-new/FetusCanvas/config.d.ts +2 -0
  86. package/dist/curve/components-new/FetusCanvas/index.d.ts +19 -0
  87. package/dist/curve/components-new/FetusCanvas/requestMethods.d.ts +7 -0
  88. package/dist/curve/components-new/FetusCanvasNICHD/config.d.ts +2 -0
  89. package/dist/curve/components-new/FetusCanvasNICHD/data.d.ts +84 -0
  90. package/dist/curve/components-new/FetusCanvasNICHD/index.d.ts +21 -0
  91. package/dist/curve/components-new/Pregnogram/index.d.ts +13 -0
  92. package/dist/curve/data.d.ts +125 -0
  93. package/dist/curve/func.d.ts +12 -0
  94. package/dist/curve/func.test.d.ts +1 -0
  95. package/dist/curve/index.d.ts +7 -0
  96. package/dist/curve/intro-steps.d.ts +7 -0
  97. package/dist/curve/utils.d.ts +8 -0
  98. package/dist/form_config/conceiveMode.d.ts +2 -0
  99. package/dist/form_config/index.d.ts +4 -0
  100. package/dist/form_config/mlUltrasounds.d.ts +2 -0
  101. package/dist/form_config/not_yes_input.d.ts +4 -0
  102. package/dist/form_config/pressure.d.ts +4 -0
  103. package/dist/hooks/index.d.ts +1 -0
  104. package/dist/hooks/use_duck_form.d.ts +18 -0
  105. package/dist/index.d.ts +2 -0
  106. package/dist/index.js +8 -33
  107. package/dist/modals/entries/StupidTemplateModal2/index copy.d.ts +22 -0
  108. package/dist/modals/entries/StupidTemplateModal2/index.d.ts +1 -2
  109. package/dist/modals/entries/StupidTemplateModal2/methods/index.d.ts +7 -1
  110. package/dist/modals/entries/box/index.d.ts +6 -0
  111. package/dist/modals/entries/modal_form/index.d.ts +1 -1
  112. package/dist/modals/entries/result_template/index.d.ts +24 -0
  113. package/dist/modals/entries/template_modal3/components/TemplateSelect.d.ts +2 -1
  114. package/dist/modals/entries/template_modal3/index copy 2.d.ts +1 -1
  115. package/dist/modals/entries/template_modal3/index.d.ts +6 -3
  116. package/dist/modals/entries/text_search/index.d.ts +1 -1
  117. package/dist/modals/entries//344/271/231/350/202/235/347/256/241/347/220/206/index.d.ts +1 -1
  118. 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
  119. package/dist/modals/entries//346/213/223/345/261/225/351/207/217/350/241/250/History.d.ts +10 -0
  120. package/dist/modals/entries//346/213/223/345/261/225/351/207/217/350/241/250/index.d.ts +9 -0
  121. 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
  122. 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
  123. 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
  124. 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
  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/types.d.ts +3 -3
  126. 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
  127. 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
  128. 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
  129. 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
  130. 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
  131. package/dist/modals/entries//351/253/230/345/215/261/351/232/217/350/256/277/form_config.d.ts +4 -2
  132. package/dist/modals/index.d.ts +4 -1
  133. package/dist/modals/meta.d.ts +4 -1
  134. package/dist/pages/doc_record/index.d.ts +1 -1
  135. package/dist/pages/index.d.ts +1 -0
  136. package/dist/pages/questionnaire/Inner.d.ts +4 -0
  137. package/dist/pages/questionnaire/Qn.d.ts +3 -0
  138. package/dist/pages/questionnaire/SelectButton.d.ts +4 -0
  139. package/dist/pages/questionnaire/create/Step2Right.d.ts +11 -0
  140. package/dist/pages/questionnaire/create/common.d.ts +46 -0
  141. package/dist/pages/questionnaire/create/fakeData.d.ts +6 -0
  142. package/dist/pages/questionnaire/create/question-item.d.ts +14 -0
  143. package/dist/pages/questionnaire/create/step1.d.ts +12 -0
  144. package/dist/pages/questionnaire/create/step2.d.ts +10 -0
  145. package/dist/pages/questionnaire/create/step3.d.ts +8 -0
  146. package/dist/pages/questionnaire/create/step4.d.ts +8 -0
  147. package/dist/pages/questionnaire/index.d.ts +3 -0
  148. package/dist/pages/questionnaire/types.d.ts +10 -0
  149. package/dist/utils/helper.d.ts +5 -0
  150. package/dist/utils/index.d.ts +2 -1
  151. package/package.json +34 -16
  152. package/dist/a_chunks/.root.js +0 -245
  153. package/dist/a_chunks/.root.js.map +0 -1
  154. package/dist/a_chunks/.root10.js +0 -474
  155. package/dist/a_chunks/.root10.js.map +0 -1
  156. package/dist/a_chunks/.root11.js.map +0 -1
  157. package/dist/a_chunks/.root12.js +0 -200
  158. package/dist/a_chunks/.root12.js.map +0 -1
  159. package/dist/a_chunks/.root13.js.map +0 -1
  160. package/dist/a_chunks/.root14.js.map +0 -1
  161. package/dist/a_chunks/.root15.js +0 -58
  162. package/dist/a_chunks/.root15.js.map +0 -1
  163. package/dist/a_chunks/.root16.js.map +0 -1
  164. package/dist/a_chunks/.root17.js.map +0 -1
  165. package/dist/a_chunks/.root18.js.map +0 -1
  166. package/dist/a_chunks/.root19.js.map +0 -1
  167. package/dist/a_chunks/.root2.js +0 -76
  168. package/dist/a_chunks/.root2.js.map +0 -1
  169. package/dist/a_chunks/.root20.js.map +0 -1
  170. package/dist/a_chunks/.root21.js.map +0 -1
  171. package/dist/a_chunks/.root22.js.map +0 -1
  172. package/dist/a_chunks/.root23.js.map +0 -1
  173. package/dist/a_chunks/.root24.js.map +0 -1
  174. package/dist/a_chunks/.root25.js +0 -281
  175. package/dist/a_chunks/.root25.js.map +0 -1
  176. package/dist/a_chunks/.root3.js.map +0 -1
  177. package/dist/a_chunks/.root4.js +0 -629
  178. package/dist/a_chunks/.root4.js.map +0 -1
  179. package/dist/a_chunks/.root5.js.map +0 -1
  180. package/dist/a_chunks/.root6.js +0 -164
  181. package/dist/a_chunks/.root6.js.map +0 -1
  182. package/dist/a_chunks/.root7.js.map +0 -1
  183. package/dist/a_chunks/.root8.js.map +0 -1
  184. package/dist/a_chunks/.root9.js +0 -69
  185. package/dist/a_chunks/.root9.js.map +0 -1
  186. package/dist/a_chunks/extends.js +0 -11
  187. package/dist/a_chunks/extends.js.map +0 -1
  188. package/dist/a_chunks/index.js.map +0 -1
  189. package/dist/components/BF_Form/use_table_config copy.d.ts +0 -13
  190. package/dist/index.js.map +0 -1
  191. 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
@@ -0,0 +1,1633 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
+ import { s as styleInject, _ as __spreadArray, a as __assign, b as __awaiter, c as __generator } from './index.js';
3
+ import React, { useRef, useState, Fragment, useEffect } from 'react';
4
+ import { MyIcon, Select_L, SimpleForm, Table_L } from '@lm_fe/components';
5
+ import { mchcEnv } from '@lm_fe/env';
6
+ import { identity } from '@lm_fe/utils';
7
+ import { List, Card, Checkbox, Input, Row, Col, InputNumber, Button, Form, Tabs, message, Radio, Rate, Space, Steps } from 'antd';
8
+ import { mchcEnums, SMchc_Questionnaire } from '@lm_fe/service';
9
+ import 'classnames';
10
+ import 'lodash';
11
+ import '@lm_fe/components_m';
12
+ import '@lm_fe/provoke';
13
+ var css_248z$3 = ".step1-module_questionnaire-steps__WyY-T {\n background-color: white;\n height: 70px;\n display: flex;\n align-items: center;\n padding: 0 15% !important;\n margin-bottom: 8px;\n}\n.step1-module_questionnaire-steps-content__aeFQi {\n padding: 16px;\n background-color: white;\n}\n.step1-module_follow-up-step1__9gMs- .ant-col {\n height: 100% !important;\n}\n.step1-module_follow-up-step1__9gMs- .ant-list-item {\n height: 100%;\n border-radius: 4px;\n}\n.step1-module_follow-up-step1__9gMs- .ant-list-item .step1-module_ant-card-meta-detail__jATy- .step1-module_ant-card-meta-description__36HNp,\n.step1-module_follow-up-step1__9gMs- .ant-list-item .step1-module_ant-card-meta-detail__jATy- .step1-module_ant-card-actions__y6sR6,\n.step1-module_follow-up-step1__9gMs- .ant-list-item .step1-module_ant-card-meta-detail__jATy- .step1-module_ant-card-meta-title__ka5tA {\n color: #333;\n}\n.step1-module_follow-up-step1__9gMs- .ant-list-item .step1-module_ant-card-actions__y6sR6 > li {\n color: #333;\n}\n.step1-module_follow-up-step1__9gMs- .step1-module_item-top__OsDF4 {\n text-align: center;\n}\n.step1-module_follow-up-step1__9gMs- .step1-module_item-top-img__-H7xD {\n height: 100px;\n width: auto;\n margin: 10px 0;\n}\n.step1-module_follow-up-new-item__ttnj1 {\n width: 100%;\n height: 80%;\n padding-top: 20px;\n color: #5050e8;\n background-color: #fff;\n border-color: red;\n border-radius: 2px;\n display: flex;\n align-items: center;\n flex-direction: column;\n background-image: url('/lm_imgs/qn/questionnaire-item-bg.png');\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n cursor: pointer;\n}\n.step1-module_follow-up-new-item__ttnj1:hover {\n border-color: transparent;\n box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09);\n}\n.step1-module_follow-up-new-item__ttnj1 span {\n display: block;\n font-weight: bold;\n font-size: 18px;\n}\n.step1-module_follow-up-new-item__ttnj1 .step1-module_anticon__U4Mhm {\n font-size: 56px;\n}\n";
14
+ var styles$3 = {
15
+ "questionnaire-steps": "step1-module_questionnaire-steps__WyY-T",
16
+ "questionnaire-steps-content": "step1-module_questionnaire-steps-content__aeFQi",
17
+ "follow-up-step1": "step1-module_follow-up-step1__9gMs-",
18
+ "ant-card-meta-detail": "step1-module_ant-card-meta-detail__jATy-",
19
+ "ant-card-meta-description": "step1-module_ant-card-meta-description__36HNp",
20
+ "ant-card-actions": "step1-module_ant-card-actions__y6sR6",
21
+ "ant-card-meta-title": "step1-module_ant-card-meta-title__ka5tA",
22
+ "item-top": "step1-module_item-top__OsDF4",
23
+ "item-top-img": "step1-module_item-top-img__-H7xD",
24
+ "follow-up-new-item": "step1-module_follow-up-new-item__ttnj1",
25
+ "anticon": "step1-module_anticon__U4Mhm"
26
+ };
27
+ styleInject(css_248z$3);
28
+ var itemBgColors = ['#FFEFDD', '#FBDDDD', '#DDF3FB', '#DDFBE4', '#E8DDFB'];
29
+ function Step1(props) {
30
+ var handleInitQuestions = props.handleInitQuestions,
31
+ templateList = props.templateList,
32
+ onDeleteTemplate = props.onDeleteTemplate,
33
+ _a = props.selected,
34
+ selected = _a === void 0 ? [] : _a,
35
+ onSelect = props.onSelect;
36
+ function handleNewTemplate() {
37
+ handleInitQuestions({});
38
+ }
39
+ return /*#__PURE__*/React.createElement("div", {
40
+ className: styles$3["follow-up-step1"]
41
+ }, /*#__PURE__*/React.createElement(List, {
42
+ rowKey: function rowKey(item) {
43
+ return (item === null || item === void 0 ? void 0 : item.id) || -1;
44
+ },
45
+ grid: {
46
+ gutter: 24,
47
+ column: 4
48
+ },
49
+ dataSource: __spreadArray([null], templateList, true),
50
+ renderItem: function renderItem(item, idx) {
51
+ var selected_idx = selected.findIndex(function (s) {
52
+ return s.id === (item === null || item === void 0 ? void 0 : item.id);
53
+ });
54
+ return item ? (/*#__PURE__*/React.createElement(List.Item, {
55
+ key: item.id
56
+ }, /*#__PURE__*/React.createElement(Card, {
57
+ hoverable: true,
58
+ bodyStyle: {
59
+ paddingBottom: 20
60
+ },
61
+ cover: /*#__PURE__*/React.createElement("div", {
62
+ className: styles$3["item-top"],
63
+ style: {
64
+ backgroundColor: itemBgColors[idx % 5] || '#FFEFDD'
65
+ }
66
+ }, /*#__PURE__*/React.createElement("img", {
67
+ className: styles$3["item-top-img"],
68
+ src: mchcEnv.gs(function (_) {
69
+ return _.lm_imgs.qn['questionnaire-item-top.png'];
70
+ }),
71
+ alt: ""
72
+ })),
73
+ actions: [/*#__PURE__*/React.createElement("div", {
74
+ onClick: function onClick() {
75
+ return handleInitQuestions(item);
76
+ }
77
+ }, /*#__PURE__*/React.createElement(MyIcon, {
78
+ value: 'EditOutlined',
79
+ key: "edit"
80
+ }), "\u7F16\u8F91"), /*#__PURE__*/React.createElement("div", {
81
+ onClick: function onClick(e) {
82
+ e.stopPropagation();
83
+ handleInitQuestions(item, true);
84
+ }
85
+ }, /*#__PURE__*/React.createElement(MyIcon, {
86
+ value: 'CopyOutlined',
87
+ key: "copy"
88
+ }), "\u590D\u5236"), /*#__PURE__*/React.createElement("div", {
89
+ onClick: function onClick(e) {
90
+ e.stopPropagation();
91
+ onDeleteTemplate(item);
92
+ }
93
+ }, /*#__PURE__*/React.createElement(MyIcon, {
94
+ value: 'DeleteOutlined',
95
+ key: "delete"
96
+ }), "\u5220\u9664"), /*#__PURE__*/React.createElement("div", {
97
+ onClick: function onClick(e) {
98
+ e.stopPropagation();
99
+ handleInitQuestions(item, false, 3);
100
+ }
101
+ }, /*#__PURE__*/React.createElement(MyIcon, {
102
+ value: 'PieChartOutlined',
103
+ key: "delete"
104
+ }), "\u7EDF\u8BA1"), onSelect ? /*#__PURE__*/React.createElement("div", {
105
+ onClick: function onClick(e) {
106
+ return onSelect(item);
107
+ }
108
+ }, /*#__PURE__*/React.createElement(Checkbox, {
109
+ checked: selected_idx > -1
110
+ })) : null].filter(identity)
111
+ }, /*#__PURE__*/React.createElement(Card.Meta, {
112
+ style: {
113
+ cursor: 'pointer'
114
+ },
115
+ title: item.questionnaireTitle,
116
+ description: /*#__PURE__*/React.createElement("div", {
117
+ title: item.description,
118
+ style: {
119
+ overflow: 'hidden',
120
+ textOverflow: 'ellipsis',
121
+ whiteSpace: 'nowrap'
122
+ }
123
+ }, item.description)
124
+ })))) : (/*#__PURE__*/React.createElement(List.Item, null, /*#__PURE__*/React.createElement("div", {
125
+ className: styles$3["follow-up-new-item"],
126
+ onClick: handleNewTemplate
127
+ }, /*#__PURE__*/React.createElement("span", null, "\u65B0\u5EFA\u8C03\u67E5\u95EE\u5377"))));
128
+ }
129
+ }));
130
+ }
131
+ var QuestionTypeEnums = mchcEnums.Questionnaire.type;
132
+ var chooseArray = [{
133
+ title: '单选题',
134
+ iconImg: mchcEnv.gs(function (_) {
135
+ return _.lm_imgs.qn['radio.png'];
136
+ })
137
+ }, {
138
+ title: '多选题',
139
+ iconImg: mchcEnv.gs(function (_) {
140
+ return _.lm_imgs.qn['checkbox.png'];
141
+ })
142
+ }, {
143
+ title: '下拉题',
144
+ iconImg: mchcEnv.gs(function (_) {
145
+ return _.lm_imgs.qn['select.png'];
146
+ })
147
+ }, {
148
+ title: '填空题',
149
+ iconImg: mchcEnv.gs(function (_) {
150
+ return _.lm_imgs.qn['vacancy.png'];
151
+ })
152
+ }];
153
+ var starArray = [{
154
+ title: '打分题',
155
+ iconImg: mchcEnv.gs(function (_) {
156
+ return _.lm_imgs.qn['stars.png'];
157
+ })
158
+ }];
159
+ var descArray = [{
160
+ title: '段落说明',
161
+ iconImg: mchcEnv.gs(function (_) {
162
+ return _.lm_imgs.qn['description.png'];
163
+ })
164
+ }];
165
+ var labelsArray = __spreadArray(__spreadArray(__spreadArray([], chooseArray, true), starArray, true), descArray, true);
166
+ var labelsArrayMapping = labelsArray.reduce(function (a, b) {
167
+ var _a;
168
+ return Object.assign(a, (_a = {}, _a[b.title] = b, _a));
169
+ }, {});
170
+ var defaultSelectOptions = [{
171
+ optionIndex: 1000,
172
+ optionScore: 0,
173
+ optionTitle: '选项1'
174
+ }, {
175
+ optionIndex: 1001,
176
+ optionScore: 0,
177
+ optionTitle: '选项2'
178
+ }];
179
+ var defaultOtherOptions = [{
180
+ optionIndex: 1000,
181
+ optionScore: 0,
182
+ optionTitle: 'contain'
183
+ }];
184
+ var initQuestionMap = {
185
+ '单选题': {
186
+ questionOptionList: defaultSelectOptions,
187
+ questionTitle: '',
188
+ questionType: QuestionTypeEnums.getValue('单选题')
189
+ },
190
+ '多选题': {
191
+ questionOptionList: defaultSelectOptions,
192
+ questionTitle: '',
193
+ questionType: QuestionTypeEnums.getValue('多选题')
194
+ },
195
+ '下拉题': {
196
+ questionOptionList: defaultSelectOptions,
197
+ questionTitle: '',
198
+ questionType: QuestionTypeEnums.getValue('下拉题')
199
+ },
200
+ '填空题': {
201
+ questionOptionList: defaultOtherOptions,
202
+ questionTitle: '',
203
+ questionType: QuestionTypeEnums.getValue('填空题')
204
+ },
205
+ '打分题': {
206
+ questionOptionList: defaultOtherOptions,
207
+ questionTitle: '',
208
+ questionType: QuestionTypeEnums.getValue('打分题')
209
+ },
210
+ '段落说明': {
211
+ questionOptionList: defaultOtherOptions,
212
+ questionTitle: '',
213
+ questionType: QuestionTypeEnums.getValue('段落说明')
214
+ }
215
+ };
216
+ function getTargetQuestionInGroup(allQuestions, groupIndex, group) {
217
+ if (typeof groupIndex !== 'number' || !group) return undefined;
218
+ var allIdx = allQuestions.map(function (_) {
219
+ return _.questionIndex;
220
+ });
221
+ var list = group.questionIndexList.filter(function (_) {
222
+ return allIdx.includes(_);
223
+ });
224
+ var realQuestionIndex = list[groupIndex];
225
+ var activeQuestion = typeof realQuestionIndex === 'number' ? allQuestions.find(function (_) {
226
+ return _.questionIndex === realQuestionIndex;
227
+ }) : undefined;
228
+ return activeQuestion;
229
+ }
230
+ function getQuestionsInGroup(allQuestions, groups) {
231
+ var _a;
232
+ var data = ((_a = groups === null || groups === void 0 ? void 0 : groups.questionIndexList) === null || _a === void 0 ? void 0 : _a.map(function (_) {
233
+ return allQuestions.find(function (q) {
234
+ return q.questionIndex === _;
235
+ });
236
+ }).filter(function (_) {
237
+ return !!_;
238
+ })) || [];
239
+ return data;
240
+ }
241
+ var css_248z$2 = ".step2-module_questionnaire-steps__Tmek- {\n background-color: white;\n height: 70px;\n display: flex;\n align-items: center;\n padding: 0 15% !important;\n margin-bottom: 8px;\n}\n.step2-module_questionnaire-steps-content__iPKvu {\n padding: 16px;\n background-color: white;\n}\n.step2-module_question-step-two__panel-question__ZL9Vg {\n height: auto;\n position: fixed;\n width: 15%;\n}\n.step2-module_question-step-two__panel-question-card__k-PsK {\n font-size: 16px;\n}\n.step2-module_question-step-two__panel-question-card-item__dMEYF {\n display: flex;\n border-bottom: 1px solid #edeef5;\n margin: 16px 0;\n}\n.step2-module_question-step-two__panel-question-card-item__title__-pIiv {\n display: block;\n font-weight: 400;\n flex: 1;\n}\n.step2-module_question-step-two__panel-question-card-item__btns__Vq7EU {\n display: flex;\n flex: 2;\n flex-flow: column wrap;\n justify-content: space-between;\n margin-left: 8px;\n}\n.step2-module_question-step-two__panel-question-card-item__btns-btn__cJpyM {\n margin: 8px 0;\n display: flex;\n cursor: pointer;\n}\n.step2-module_question-step-two__panel-question-card-item__btns-btn__cJpyM img {\n width: 24px;\n height: 24px;\n margin-right: 8px;\n}\n.step2-module_question-step-two__panel-question-card-item__btns-btn__cJpyM:first-child {\n margin-top: 0;\n}\n.step2-module_question-step-two__panel-preview__V4Yrk {\n border: 1px solid #d9d9d9;\n}\n.step2-module_question-step-two__panel-preview-top__JKlcS {\n background-color: white;\n padding: 24px 8px;\n margin-bottom: 12px;\n}\n.step2-module_question-step-two__panel-preview-top__desc__NiNHZ {\n margin-top: 8px;\n}\n.step2-module_question-step-two__panel-preview-middle__start__K-mFG {\n height: 250px;\n line-height: 250px;\n border: 1px dotted skyblue;\n text-align: center;\n}\n.step2-module_question-step-two__panel-preview-middle__question__9FMJJ {\n background-color: white;\n padding: 16px 8px;\n margin-bottom: 8px;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-bottom: 1px solid #d9d9d9;\n}\n.step2-module_question-step-two__panel-preview-middle__question__9FMJJ:hover {\n background-color: #eee;\n}\n.step2-module_question-step-two__panel-preview-middle__question-tip__hFCnM {\n font-size: 12px;\n color: #5050e8;\n}\n.step2-module_question-step-two__panel-preview-middle__question-title__RbFRH {\n margin-bottom: 4px;\n display: flex;\n flex-flow: row wrap;\n justify-content: space-between;\n}\n.step2-module_question-step-two__panel-preview-middle__question-title-icon-delete__oMlIQ {\n display: none;\n cursor: pointer;\n}\n.step2-module_question-step-two__panel-preview-middle__question-title-icon-delete__oMlIQ:hover {\n color: red;\n}\n.step2-module_question-step-two__panel-preview-middle__question-options__2xnxR {\n margin: 4px 0;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n}\n.step2-module_question-step-two__panel-preview-middle__question-options-input__En0jC {\n width: 100% !important;\n}\n.step2-module_question-step-two__panel-preview-middle__question-options-delete__3nTdj {\n display: none;\n width: 10%;\n cursor: pointer;\n}\n.step2-module_question-step-two__panel-preview-middle__question-options-delete__3nTdj:hover {\n color: red;\n}\n.step2-module_question-step-two__panel-preview-middle__question-options__2xnxR:hover .step2-module_question-step-two__panel-preview-middle__question-options-delete__3nTdj {\n display: block;\n}\n.step2-module_question-step-two__panel-preview-middle__question__9FMJJ:hover .step2-module_question-step-two__panel-preview-middle__question-title-icon-delete__oMlIQ {\n display: block;\n}\n.step2-module_question-step-two__panel-preview-middle__question-border-top__TNoP1 {\n border-top: 2px solid red;\n}\n.step2-module_question-step-two__panel-preview-middle__question-border-bottom__v925w {\n border-bottom: 2px solid red;\n}\n.step2-module_question-step-two__panel-preview-bottom__GP3N2 {\n background-color: white;\n padding: 16px 8px;\n margin-top: 8px;\n}\n.step2-module_question-step-two__panel-preview-bottom__title__VxEKf {\n text-align: center;\n padding-bottom: 8px;\n}\n.step2-module_question-step-two__panel-preview-bottom__btns__WaBXA {\n display: flex;\n justify-content: center;\n flex-flow: row nowrap;\n margin-top: 16px;\n}\n.step2-module_question-step-two__panel-preview-bottom__btns-btn__9Oq-J {\n margin: 0 8px;\n}\n.step2-module_question-step-two__panel-func__ocCVy {\n background-color: white;\n padding: 24px 14px;\n height: auto;\n width: 20%;\n position: fixed;\n}\n.step2-module_question-step-two__panel-func__title__ekVbP {\n padding: 2px 4px;\n background-color: black;\n color: white;\n border-radius: 2px;\n display: inline-block;\n}\n.step2-module_question-step-two__panel-func__item__3dqE- {\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n margin: 16px 0;\n}\n.step2-module_question-step-two__panel-func__item__3dqE- span,\n.step2-module_question-step-two__panel-func__item__3dqE- a {\n display: block;\n}\n.step2-module_question-step-two__panel-func__item-btn__SzNsJ {\n width: 40% !important;\n}\n";
242
+ var styles$2 = {
243
+ "questionnaire-steps": "step2-module_questionnaire-steps__Tmek-",
244
+ "questionnaire-steps-content": "step2-module_questionnaire-steps-content__iPKvu",
245
+ "question-step-two__panel-question": "step2-module_question-step-two__panel-question__ZL9Vg",
246
+ "question-step-two__panel-question-card": "step2-module_question-step-two__panel-question-card__k-PsK",
247
+ "question-step-two__panel-question-card-item": "step2-module_question-step-two__panel-question-card-item__dMEYF",
248
+ "question-step-two__panel-question-card-item__title": "step2-module_question-step-two__panel-question-card-item__title__-pIiv",
249
+ "question-step-two__panel-question-card-item__btns": "step2-module_question-step-two__panel-question-card-item__btns__Vq7EU",
250
+ "question-step-two__panel-question-card-item__btns-btn": "step2-module_question-step-two__panel-question-card-item__btns-btn__cJpyM",
251
+ "question-step-two__panel-preview": "step2-module_question-step-two__panel-preview__V4Yrk",
252
+ "question-step-two__panel-preview-top": "step2-module_question-step-two__panel-preview-top__JKlcS",
253
+ "question-step-two__panel-preview-top__desc": "step2-module_question-step-two__panel-preview-top__desc__NiNHZ",
254
+ "question-step-two__panel-preview-middle__start": "step2-module_question-step-two__panel-preview-middle__start__K-mFG",
255
+ "question-step-two__panel-preview-middle__question": "step2-module_question-step-two__panel-preview-middle__question__9FMJJ",
256
+ "question-step-two__panel-preview-middle__question-tip": "step2-module_question-step-two__panel-preview-middle__question-tip__hFCnM",
257
+ "question-step-two__panel-preview-middle__question-title": "step2-module_question-step-two__panel-preview-middle__question-title__RbFRH",
258
+ "question-step-two__panel-preview-middle__question-title-icon-delete": "step2-module_question-step-two__panel-preview-middle__question-title-icon-delete__oMlIQ",
259
+ "question-step-two__panel-preview-middle__question-options": "step2-module_question-step-two__panel-preview-middle__question-options__2xnxR",
260
+ "question-step-two__panel-preview-middle__question-options-input": "step2-module_question-step-two__panel-preview-middle__question-options-input__En0jC",
261
+ "question-step-two__panel-preview-middle__question-options-delete": "step2-module_question-step-two__panel-preview-middle__question-options-delete__3nTdj",
262
+ "question-step-two__panel-preview-middle__question-border-top": "step2-module_question-step-two__panel-preview-middle__question-border-top__TNoP1",
263
+ "question-step-two__panel-preview-middle__question-border-bottom": "step2-module_question-step-two__panel-preview-middle__question-border-bottom__v925w",
264
+ "question-step-two__panel-preview-bottom": "step2-module_question-step-two__panel-preview-bottom__GP3N2",
265
+ "question-step-two__panel-preview-bottom__title": "step2-module_question-step-two__panel-preview-bottom__title__VxEKf",
266
+ "question-step-two__panel-preview-bottom__btns": "step2-module_question-step-two__panel-preview-bottom__btns__WaBXA",
267
+ "question-step-two__panel-preview-bottom__btns-btn": "step2-module_question-step-two__panel-preview-bottom__btns-btn__9Oq-J",
268
+ "question-step-two__panel-func": "step2-module_question-step-two__panel-func__ocCVy",
269
+ "question-step-two__panel-func__title": "step2-module_question-step-two__panel-func__title__ekVbP",
270
+ "question-step-two__panel-func__item": "step2-module_question-step-two__panel-func__item__3dqE-",
271
+ "question-step-two__panel-func__item-btn": "step2-module_question-step-two__panel-func__item-btn__SzNsJ"
272
+ };
273
+ styleInject(css_248z$2);
274
+ function QuestionItem(props) {
275
+ var _a;
276
+ var _b, _c;
277
+ var index = props.index,
278
+ question = props.question,
279
+ onChangeIndex = props.onChangeIndex,
280
+ onQuestionClick = props.onQuestionClick,
281
+ onQuestionItemDelete = props.onQuestionItemDelete,
282
+ onQuesionChange = props.onQuesionChange,
283
+ groupQuestions = props.groupQuestions;
284
+ var questionType = question.questionType,
285
+ _d = question.questionOptionList,
286
+ questionOptionList = _d === void 0 ? [] : _d;
287
+ var ref = useRef(null);
288
+ var _e = useState(''),
289
+ hoverTargetQuestionPlace = _e[0],
290
+ setHoverTargetQuestionPlace = _e[1];
291
+ var bind = (_b = question.logic) === null || _b === void 0 ? void 0 : _b.bind;
292
+ var handleQuestionDragOver = function handleQuestionDragOver(e) {
293
+ var _a = ref.current.getBoundingClientRect(),
294
+ y = _a.y,
295
+ height = _a.height;
296
+ var normalClientY = y + height / 2;
297
+ var clientY = e.clientY;
298
+ if (clientY) {
299
+ var hoverTargetQuestionPlace_1 = 'Bottom';
300
+ var newQuestionIndex = index + 1;
301
+ if (clientY < normalClientY) {
302
+ hoverTargetQuestionPlace_1 = 'Top';
303
+ newQuestionIndex = index;
304
+ }
305
+ setHoverTargetQuestionPlace(hoverTargetQuestionPlace_1);
306
+ onChangeIndex(newQuestionIndex);
307
+ }
308
+ };
309
+ var handleQuestionDragLeave = function handleQuestionDragLeave() {
310
+ setHoverTargetQuestionPlace('');
311
+ };
312
+ var renderQuestionInput = function renderQuestionInput() {
313
+ var typeLabel = QuestionTypeEnums.getLabel(questionType);
314
+ if (typeLabel === '单选题' || typeLabel === '多选题' || typeLabel === '下拉题') {
315
+ var icons_1 = {
316
+ '单选题': /*#__PURE__*/React.createElement(MyIcon, {
317
+ value: 'CheckCircleOutlined'
318
+ }),
319
+ '多选题': /*#__PURE__*/React.createElement(MyIcon, {
320
+ value: 'BorderOutlined'
321
+ }),
322
+ '下拉题': /*#__PURE__*/React.createElement(MyIcon, {
323
+ value: 'CaretDownOutlined'
324
+ })
325
+ };
326
+ return questionOptionList.map(function (option, optionIndex) {
327
+ return /*#__PURE__*/React.createElement(Row, {
328
+ key: optionIndex,
329
+ className: styles$2["question-step-two__panel-preview-middle__question-options"]
330
+ }, /*#__PURE__*/React.createElement(Col, {
331
+ span: 14
332
+ }, /*#__PURE__*/React.createElement(Input, {
333
+ className: styles$2["question-step-two__panel-preview-middle__question-options-input"],
334
+ addonBefore: icons_1[typeLabel],
335
+ value: option.optionTitle,
336
+ onChange: function onChange(e) {
337
+ questionOptionList.splice(optionIndex, 1, __assign(__assign({}, option), {
338
+ optionTitle: e.target.value
339
+ }));
340
+ onQuesionChange(__assign(__assign({}, question), {
341
+ questionOptionList: __spreadArray([], questionOptionList, true)
342
+ }));
343
+ },
344
+ size: "small"
345
+ })), /*#__PURE__*/React.createElement(Col, {
346
+ span: 7,
347
+ offset: 1,
348
+ style: {
349
+ display: 'flex'
350
+ }
351
+ }, /*#__PURE__*/React.createElement("div", {
352
+ style: {
353
+ width: 80
354
+ }
355
+ }, "\u5206\u503C\uFF1A"), /*#__PURE__*/React.createElement(InputNumber, {
356
+ className: styles$2["question-step-two__panel-preview-middle__question-options-input"],
357
+ value: option.optionScore,
358
+ onChange: function onChange(score) {
359
+ questionOptionList.splice(optionIndex, 1, __assign(__assign({}, option), {
360
+ optionScore: score
361
+ }));
362
+ onQuesionChange(__assign(__assign({}, question), {
363
+ questionOptionList: __spreadArray([], questionOptionList, true)
364
+ }));
365
+ },
366
+ size: "small"
367
+ })), /*#__PURE__*/React.createElement(Col, {
368
+ span: 1,
369
+ offset: 1
370
+ }, /*#__PURE__*/React.createElement(MyIcon, {
371
+ value: 'CloseCircleOutlined',
372
+ onClick: function onClick(e) {
373
+ e.stopPropagation();
374
+ questionOptionList.splice(optionIndex, 1);
375
+ onQuesionChange(__assign(__assign({}, question), {
376
+ questionOptionList: __spreadArray([], questionOptionList, true)
377
+ }));
378
+ },
379
+ className: styles$2["question-step-two__panel-preview-middle__question-options-delete"]
380
+ })));
381
+ });
382
+ }
383
+ if (typeLabel === '填空题') {
384
+ return /*#__PURE__*/React.createElement("div", {
385
+ className: styles$2["question-step-two__panel-preview-middle__question-completion"]
386
+ }, /*#__PURE__*/React.createElement(Input, {
387
+ className: styles$2["question-step-two__panel-preview-middle__question-completion-input"],
388
+ size: "small",
389
+ style: {
390
+ marginTop: 4
391
+ }
392
+ }), questionOptionList.map(function (option, optionIndex) {
393
+ return /*#__PURE__*/React.createElement(Row, {
394
+ key: optionIndex,
395
+ className: styles$2["question-step-two__panel-preview-middle__question-options"]
396
+ }, /*#__PURE__*/React.createElement(Col, {
397
+ span: 6,
398
+ style: {
399
+ display: 'flex'
400
+ }
401
+ }, /*#__PURE__*/React.createElement("div", {
402
+ style: {
403
+ width: '100%'
404
+ }
405
+ }, "\u8BA1\u5206\u89C4\u5219\uFF1A"), /*#__PURE__*/React.createElement(Select_L, {
406
+ className: styles$2["question-step-two__panel-preview-middle__question-options-input"],
407
+ value: option.optionTitle,
408
+ onSelect: function onSelect(value) {
409
+ questionOptionList.splice(optionIndex, 1, __assign(__assign({}, option), {
410
+ optionTitle: value
411
+ }));
412
+ onQuesionChange(__assign(__assign({}, question), {
413
+ questionOptionList: __spreadArray([], questionOptionList, true)
414
+ }));
415
+ },
416
+ popupMatchSelectWidth: true,
417
+ size: "small"
418
+ }, /*#__PURE__*/React.createElement(Select_L.Option, {
419
+ value: "equal"
420
+ }, "\u76F8\u7B49"), /*#__PURE__*/React.createElement(Select_L.Option, {
421
+ value: "contain"
422
+ }, "\u5305\u542B"))), /*#__PURE__*/React.createElement(Col, {
423
+ span: 7,
424
+ offset: 1,
425
+ style: {
426
+ display: 'flex'
427
+ }
428
+ }, /*#__PURE__*/React.createElement("div", {
429
+ style: {
430
+ width: '100%'
431
+ }
432
+ }, "\u6807\u51C6\u7B54\u6848\uFF1A"), /*#__PURE__*/React.createElement(Input, {
433
+ className: styles$2["question-step-two__panel-preview-middle__question-options-input"],
434
+ value: option.fillTemplate,
435
+ onChange: function onChange(e) {
436
+ questionOptionList.splice(optionIndex, 1, __assign(__assign({}, option), {
437
+ fillTemplate: e.target.value
438
+ }));
439
+ onQuesionChange(__assign(__assign({}, question), {
440
+ questionOptionList: __spreadArray([], questionOptionList, true)
441
+ }));
442
+ },
443
+ size: "small"
444
+ })), /*#__PURE__*/React.createElement(Col, {
445
+ span: 7,
446
+ offset: 1,
447
+ style: {
448
+ display: 'flex'
449
+ }
450
+ }, /*#__PURE__*/React.createElement("div", {
451
+ style: {
452
+ width: 80
453
+ }
454
+ }, "\u5206\u503C\uFF1A"), /*#__PURE__*/React.createElement(InputNumber, {
455
+ className: styles$2["question-step-two__panel-preview-middle__question-options-input"],
456
+ value: option.optionScore,
457
+ onChange: function onChange(score) {
458
+ questionOptionList.splice(optionIndex, 1, __assign(__assign({}, option), {
459
+ optionScore: score
460
+ }));
461
+ onQuesionChange(__assign(__assign({}, question), {
462
+ questionOptionList: __spreadArray([], questionOptionList, true)
463
+ }));
464
+ },
465
+ size: "small"
466
+ })));
467
+ }));
468
+ }
469
+ if (typeLabel === '段落说明') {
470
+ return /*#__PURE__*/React.createElement("div", {
471
+ className: styles$2["question-step-two__panel-preview-middle__question-options"]
472
+ });
473
+ }
474
+ if (typeLabel === '打分题') {
475
+ return /*#__PURE__*/React.createElement("div", {
476
+ className: styles$2["question-step-two__panel-preview-middle__question-options"]
477
+ }, /*#__PURE__*/React.createElement(MyIcon, {
478
+ value: 'StarOutlined'
479
+ }), /*#__PURE__*/React.createElement(MyIcon, {
480
+ value: 'StarOutlined'
481
+ }), /*#__PURE__*/React.createElement(MyIcon, {
482
+ value: 'StarOutlined'
483
+ }), /*#__PURE__*/React.createElement(MyIcon, {
484
+ value: 'StarOutlined'
485
+ }), /*#__PURE__*/React.createElement(MyIcon, {
486
+ value: 'StarOutlined'
487
+ }));
488
+ }
489
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
490
+ };
491
+ var renderBottomBtns = function renderBottomBtns() {
492
+ if (QuestionTypeEnums.getValues(['单选题', '多选题', '下拉题']).includes(question.questionType)) {
493
+ return /*#__PURE__*/React.createElement("div", {
494
+ style: {
495
+ marginTop: 20
496
+ }
497
+ }, /*#__PURE__*/React.createElement(Button, {
498
+ size: "small",
499
+ onClick: function onClick(e) {
500
+ onQuesionChange(__assign(__assign({}, question), {
501
+ questionOptionList: __spreadArray(__spreadArray([], questionOptionList, true), [{
502
+ optionTitle: '新增选项',
503
+ optionIndex: questionOptionList.reduce(function (a, b) {
504
+ return Math.max(a, b.optionIndex);
505
+ }, 1000) + 1,
506
+ optionScore: 0,
507
+ questionType: question.questionType
508
+ }], false)
509
+ }));
510
+ }
511
+ }, "\u6DFB\u52A0\u9009\u9879"));
512
+ }
513
+ };
514
+ return /*#__PURE__*/React.createElement("div", {
515
+ style: hoverTargetQuestionPlace ? (_a = {}, _a["border".concat(hoverTargetQuestionPlace)] = '4px solid #ff0000', _a) : {},
516
+ ref: ref,
517
+ className: styles$2["question-step-two__panel-preview-middle__question"],
518
+ onDragOver: handleQuestionDragOver,
519
+ onDragLeave: handleQuestionDragLeave,
520
+ onClick: function onClick() {
521
+ onQuestionClick(__assign(__assign({}, question), {
522
+ questionIndex: index
523
+ }));
524
+ }
525
+ }, /*#__PURE__*/React.createElement("div", {
526
+ className: styles$2["question-step-two__panel-preview-middle__question-title"]
527
+ }, /*#__PURE__*/React.createElement("h4", null, index + 1, ".", labelsArrayMapping[QuestionTypeEnums.getLabel(question.questionType)].title), /*#__PURE__*/React.createElement(MyIcon, {
528
+ value: 'DeleteOutlined',
529
+ onClick: function onClick(e) {
530
+ e.stopPropagation();
531
+ onQuestionItemDelete();
532
+ },
533
+ className: styles$2["question-step-two__panel-preview-middle__question-title-icon-delete"]
534
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
535
+ className: styles$2["question-step-two__panel-preview-middle__question-options-input"],
536
+ value: question.questionTitle,
537
+ size: "small",
538
+ placeholder: "\u8BF7\u8F93\u5165\u6807\u9898",
539
+ onChange: function onChange(e) {
540
+ onQuesionChange(__assign(__assign({}, question), {
541
+ questionTitle: e.target.value
542
+ }));
543
+ }
544
+ }), renderQuestionInput()), !!((_c = question.logic) === null || _c === void 0 ? void 0 : _c.selectOption.length) && groupQuestions.findIndex(function (_) {
545
+ return _.questionIndex === bind;
546
+ }) > -1 && (/*#__PURE__*/React.createElement("div", {
547
+ className: styles$2["question-step-two__panel-preview-middle__question-tip"]
548
+ }, "\u4F9D\u8D56\u4E8E\u7B2C", groupQuestions.findIndex(function (_) {
549
+ var _a;
550
+ return _.questionIndex === ((_a = question.logic) === null || _a === void 0 ? void 0 : _a.bind);
551
+ }) + 1, "\u9898\u7684\u7B2C", question.logic.selectOption.map(function (value) {
552
+ return value + 1;
553
+ }).join('、'), "\u9009\u9879")), renderBottomBtns());
554
+ }
555
+ function Step2Right(props) {
556
+ var _a, _b, _c;
557
+ var groupQuestions = props.groupQuestions,
558
+ activeQuestion = props.activeQuestion,
559
+ onQuesionChange = props.onQuesionChange;
560
+ props.activeGroup;
561
+ props.index;
562
+ var bind = (_a = activeQuestion.logic) === null || _a === void 0 ? void 0 : _a.bind;
563
+ var realIndex = groupQuestions.findIndex(function (_) {
564
+ return _.questionIndex === activeQuestion.questionIndex;
565
+ });
566
+ var selectQuestions = groupQuestions.filter(function (q, idx) {
567
+ return idx < realIndex;
568
+ });
569
+ var targetBind = groupQuestions.find(function (_) {
570
+ return _.questionIndex === bind;
571
+ });
572
+ console.log('aax', bind, targetBind);
573
+ var boxOptions = (targetBind === null || targetBind === void 0 ? void 0 : targetBind.questionOptionList) || [];
574
+ function _onChange(selectOption, bind) {
575
+ var _a;
576
+ if (bind === void 0) {
577
+ bind = (_a = activeQuestion.logic) === null || _a === void 0 ? void 0 : _a.bind;
578
+ }
579
+ onQuesionChange(__assign(__assign({}, activeQuestion), {
580
+ logic: {
581
+ selectOption: selectOption,
582
+ bind: bind
583
+ }
584
+ }));
585
+ }
586
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u5F53\u524D\u9898\u76EE\uFF1A"), /*#__PURE__*/React.createElement("span", null, activeQuestion.questionTitle)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
587
+ label: "\u5173\u8054\u9898\u76EE\uFF1A"
588
+ }, /*#__PURE__*/React.createElement(Select_L, {
589
+ style: {
590
+ width: 300
591
+ },
592
+ popupMatchSelectWidth: 300,
593
+ allowClear: true,
594
+ placeholder: "\u8BF7\u9009\u62E9",
595
+ value: (_b = activeQuestion.logic) === null || _b === void 0 ? void 0 : _b.bind,
596
+ onChange: function onChange(value) {
597
+ _onChange([], value);
598
+ },
599
+ options: selectQuestions.map(function (_, index) {
600
+ return {
601
+ label: "".concat(index + 1, ".").concat(_.questionTitle),
602
+ value: _.questionIndex,
603
+ disabled: !QuestionTypeEnums.getValues(['多选题', '单选题', '下拉题']).includes(_.questionType)
604
+ };
605
+ })
606
+ })), targetBind && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u5F53\u201C\u5173\u8054\u9898\u76EE\u201D\u9009\u62E9\u4E0B\u9762\u7684\u9009\u9879\uFF1A"), /*#__PURE__*/React.createElement(Checkbox.Group, {
607
+ value: ((_c = activeQuestion.logic) === null || _c === void 0 ? void 0 : _c.selectOption) || [],
608
+ onChange: function onChange(value) {
609
+ return _onChange(value);
610
+ }
611
+ }, boxOptions.map(function (option, index) {
612
+ return /*#__PURE__*/React.createElement(Fragment, {
613
+ key: index
614
+ }, /*#__PURE__*/React.createElement(Checkbox, {
615
+ key: index,
616
+ value: index
617
+ }, option.optionTitle), /*#__PURE__*/React.createElement("br", null));
618
+ })), /*#__PURE__*/React.createElement("div", null, "\u4E2D\u7684\u4EFB\u610F\u4E00\u4E2A\u65F6\uFF0C\u201C\u5F53\u524D\u9898\u76EE\u201D\u624D\u51FA\u73B0")))), /*#__PURE__*/React.createElement(Form.Item, {
619
+ label: "\u662F\u5426\u5168\u5C4F\u663E\u793A"
620
+ }, /*#__PURE__*/React.createElement(Checkbox, {
621
+ checked: activeQuestion.fullscreen,
622
+ onChange: function onChange(e) {
623
+ onQuesionChange(__assign(__assign({}, activeQuestion), {
624
+ fullscreen: e.target.checked
625
+ }));
626
+ }
627
+ })));
628
+ }
629
+ var btns = [{
630
+ id: 1,
631
+ title: '选择填空',
632
+ value: chooseArray
633
+ }, {
634
+ id: 2,
635
+ title: '评分题',
636
+ value: starArray
637
+ }, {
638
+ id: 3,
639
+ title: '文字说明',
640
+ value: descArray
641
+ }];
642
+ function Step2(props) {
643
+ var _a;
644
+ var data = props.data,
645
+ onPreview = props.onPreview,
646
+ onChangeStep = props.onChangeStep;
647
+ props.onEditorUpload;
648
+ var _b = useState(data.questionnaireTitle),
649
+ questionnaireTitle = _b[0],
650
+ setQuestionnaireTitle = _b[1];
651
+ var _c = useState(data.questionList || []),
652
+ questions = _c[0],
653
+ setQuestions = _c[1];
654
+ var _d = useState(data.description),
655
+ description = _d[0],
656
+ setDescription = _d[1];
657
+ var _e = useState(),
658
+ dragItemType = _e[0],
659
+ setDragItemType = _e[1];
660
+ var _f = useState(data.groupVOList || [{
661
+ groupIndex: 0,
662
+ groupDescription: '',
663
+ code: '',
664
+ groupTitle: '第一组',
665
+ questionIndexList: ((_a = data.questionList) === null || _a === void 0 ? void 0 : _a.map(function (_) {
666
+ return _.questionIndex;
667
+ })) || []
668
+ }]),
669
+ groups = _f[0],
670
+ setGroups = _f[1];
671
+ var _g = useState(0),
672
+ activeGroupIdx = _g[0],
673
+ setActiveGroupIdx = _g[1];
674
+ var _h = useState(-1),
675
+ activeQuestionIndexInGroup = _h[0],
676
+ setActiveQuestionIndexInGroup = _h[1];
677
+ var activeGroup = groups.find(function (_) {
678
+ return _.groupIndex === activeGroupIdx;
679
+ });
680
+ var activeQuestion = getTargetQuestionInGroup(questions, activeQuestionIndexInGroup, activeGroup);
681
+ var groupQuestions = getQuestionsInGroup(questions, activeGroup);
682
+ console.log('idx', activeQuestionIndexInGroup, activeQuestion);
683
+ var indexRef = useRef(0);
684
+ function generateQuestionByType(type) {
685
+ return initQuestionMap[type];
686
+ }
687
+ function handleBtnClick(type) {
688
+ return function () {
689
+ addQuesion(type, questions.length);
690
+ };
691
+ }
692
+ function handleChangeIndex(idx) {
693
+ indexRef.current = idx;
694
+ }
695
+ function addQuesion(t, idx) {
696
+ var maxIndex = questions.reduce(function (a, b) {
697
+ return Math.max(a, b.questionIndex);
698
+ }, 1000) + 1;
699
+ var newQuestions = JSON.parse(JSON.stringify(questions));
700
+ var newItem = generateQuestionByType(t);
701
+ newItem.questionIndex = maxIndex;
702
+ var targetGroup = groups.find(function (_) {
703
+ return _.groupIndex === activeGroupIdx;
704
+ });
705
+ if (targetGroup === null || targetGroup === void 0 ? void 0 : targetGroup.questionIndexList) {
706
+ targetGroup.questionIndexList.splice(idx, 0, maxIndex);
707
+ }
708
+ newQuestions.push(newItem);
709
+ setQuestions(newQuestions);
710
+ setGroups(__spreadArray([], groups, true));
711
+ }
712
+ function handleDragEnd() {
713
+ if (!dragItemType) return;
714
+ addQuesion(dragItemType, indexRef.current);
715
+ }
716
+ function modifyQuestion(item) {
717
+ var idx = questions.findIndex(function (_) {
718
+ return _.questionIndex === item.questionIndex;
719
+ });
720
+ questions[idx] = item;
721
+ setQuestions(__spreadArray([], questions, true));
722
+ }
723
+ function renderQuestions(q) {
724
+ return q.map(function (question, index) {
725
+ var lastQuestion = questions[questions.length - 1];
726
+ return /*#__PURE__*/React.createElement(QuestionItem, {
727
+ groupQuestions: groupQuestions,
728
+ key: index,
729
+ index: index,
730
+ question: question,
731
+ lastQuestion: lastQuestion,
732
+ onChangeIndex: handleChangeIndex,
733
+ onQuestionClick: function onQuestionClick() {
734
+ return setActiveQuestionIndexInGroup(index);
735
+ },
736
+ onQuesionChange: modifyQuestion,
737
+ onQuestionItemDelete: function onQuestionItemDelete() {
738
+ var _a, _b;
739
+ if (!activeGroup) return;
740
+ var logicBindIds = [];
741
+ questions.forEach(function (question) {
742
+ var _a;
743
+ typeof ((_a = question.logic) === null || _a === void 0 ? void 0 : _a.bind) === 'number' && logicBindIds.push(question.logic.bind);
744
+ });
745
+ if (logicBindIds.indexOf(question.questionIndex) > -1) {
746
+ message.error('该题有逻辑关联,无法删除');
747
+ return;
748
+ }
749
+ var realIndex = questions.findIndex(function (_) {
750
+ return _.questionIndex === question.questionIndex;
751
+ });
752
+ questions.splice(realIndex, 1);
753
+ var indexOfGroup = (_a = activeGroup.questionIndexList) === null || _a === void 0 ? void 0 : _a.indexOf(question.questionIndex);
754
+ if (typeof indexOfGroup === 'number' && indexOfGroup > -1) {
755
+ (_b = activeGroup.questionIndexList) === null || _b === void 0 ? void 0 : _b.splice(indexOfGroup, 1);
756
+ groups.splice(activeGroupIdx, 1, __assign({}, activeGroup));
757
+ }
758
+ setQuestions(__spreadArray([], questions, true));
759
+ }
760
+ });
761
+ });
762
+ }
763
+ function renderBtns() {
764
+ return /*#__PURE__*/React.createElement("div", {
765
+ className: styles$2["question-step-two__panel-question"]
766
+ }, /*#__PURE__*/React.createElement("div", {
767
+ className: styles$2["question-step-two__panel-question-card"]
768
+ }, btns.map(function (btn, index) {
769
+ return /*#__PURE__*/React.createElement("div", {
770
+ key: index,
771
+ className: styles$2["question-step-two__panel-question-card-item"]
772
+ }, /*#__PURE__*/React.createElement("span", {
773
+ className: styles$2["question-step-two__panel-question-card-item__title"]
774
+ }, btn.title), /*#__PURE__*/React.createElement("div", {
775
+ className: styles$2["question-step-two__panel-question-card-item__btns"]
776
+ }, btn.value.map(function (item) {
777
+ return /*#__PURE__*/React.createElement("div", {
778
+ key: item.title,
779
+ className: styles$2["question-step-two__panel-question-card-item__btns-btn"],
780
+ draggable: true,
781
+ onDragStart: function onDragStart() {
782
+ setDragItemType(item.title);
783
+ },
784
+ onDragEnd: handleDragEnd,
785
+ onClick: handleBtnClick(item.title)
786
+ }, /*#__PURE__*/React.createElement("img", {
787
+ src: item.iconImg,
788
+ alt: ""
789
+ }), /*#__PURE__*/React.createElement("div", null, item.title));
790
+ })));
791
+ })));
792
+ }
793
+ function renderLogicEdit() {
794
+ return activeQuestion && (/*#__PURE__*/React.createElement("div", {
795
+ className: styles$2["question-step-two__panel-func"]
796
+ }, /*#__PURE__*/React.createElement("div", {
797
+ className: styles$2["question-step-two__panel-func__title"]
798
+ }, "\u9898\u76EE", activeQuestionIndexInGroup + 1, "\u8BBE\u7F6E"), activeGroup && activeQuestion && (/*#__PURE__*/React.createElement(Step2Right, {
799
+ activeGroup: activeGroup,
800
+ onQuesionChange: modifyQuestion,
801
+ index: activeQuestionIndexInGroup,
802
+ groupQuestions: groupQuestions,
803
+ activeQuestion: activeQuestion
804
+ }))));
805
+ }
806
+ function setCurrentGroup(key, value) {
807
+ if (activeGroup) {
808
+ activeGroup[key] = value;
809
+ groups.splice(activeGroupIdx, 1, __assign({}, activeGroup));
810
+ setGroups(__spreadArray([], groups, true));
811
+ }
812
+ }
813
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
814
+ className: styles$2["question-step-two__panel"]
815
+ }, /*#__PURE__*/React.createElement(Col, {
816
+ span: 4
817
+ }, renderBtns()), /*#__PURE__*/React.createElement(Col, {
818
+ span: 12,
819
+ offset: 1,
820
+ className: styles$2["question-step-two__panel-preview"]
821
+ }, /*#__PURE__*/React.createElement("div", {
822
+ className: styles$2["question-step-two__panel-preview-top"]
823
+ }, /*#__PURE__*/React.createElement(Input, {
824
+ className: styles$2["question-step-two__panel-preview-top__title"],
825
+ value: questionnaireTitle,
826
+ placeholder: "\u8BF7\u8F93\u5165\u6807\u9898",
827
+ onChange: function onChange(e) {
828
+ setQuestionnaireTitle(e.target.value);
829
+ }
830
+ }), /*#__PURE__*/React.createElement(Input.TextArea, {
831
+ className: styles$2["question-step-two__panel-preview-top__title"],
832
+ value: description,
833
+ style: {
834
+ marginTop: 12
835
+ },
836
+ placeholder: "\u8BF7\u8F93\u5165\u63CF\u8FF0",
837
+ onChange: function onChange(e) {
838
+ setDescription(e.target.value);
839
+ }
840
+ })), /*#__PURE__*/React.createElement(Tabs, {
841
+ type: "editable-card",
842
+ activeKey: activeGroupIdx.toString(),
843
+ onChange: function onChange(e) {
844
+ return setActiveGroupIdx(+e);
845
+ },
846
+ onEdit: function onEdit(key, action) {
847
+ if (action === 'add') {
848
+ groups.push({
849
+ groupIndex: groups.length,
850
+ groupTitle: "\u7B2C".concat(groups.length + 1, "\u7EC4"),
851
+ questionIndexList: [],
852
+ groupDescription: '',
853
+ code: ''
854
+ });
855
+ } else {
856
+ groups.splice(+key, 1);
857
+ }
858
+ setGroups(__spreadArray([], groups, true));
859
+ }
860
+ }, groups.map(function (_, idx) {
861
+ var active = _.groupIndex === activeGroupIdx;
862
+ var q = getQuestionsInGroup(questions, _);
863
+ return /*#__PURE__*/React.createElement(Tabs.TabPane, {
864
+ tab: _.groupTitle,
865
+ key: _.groupIndex
866
+ }, /*#__PURE__*/React.createElement(Form.Item, {
867
+ label: "\u6807\u9898",
868
+ wrapperCol: {
869
+ span: 17
870
+ },
871
+ style: {
872
+ padding: '0 8px'
873
+ }
874
+ }, /*#__PURE__*/React.createElement(Input, {
875
+ size: "small",
876
+ value: activeGroup === null || activeGroup === void 0 ? void 0 : activeGroup.groupTitle,
877
+ onChange: function onChange(e) {
878
+ setCurrentGroup('groupTitle', e.target.value);
879
+ }
880
+ })), /*#__PURE__*/React.createElement(Form.Item, {
881
+ label: "\u63CF\u8FF0",
882
+ wrapperCol: {
883
+ span: 17
884
+ },
885
+ style: {
886
+ padding: '0 8px'
887
+ }
888
+ }, /*#__PURE__*/React.createElement(Input, {
889
+ size: "small",
890
+ value: activeGroup === null || activeGroup === void 0 ? void 0 : activeGroup.groupDescription,
891
+ onChange: function onChange(e) {
892
+ setCurrentGroup('groupDescription', e.target.value);
893
+ }
894
+ })), /*#__PURE__*/React.createElement(Form.Item, {
895
+ label: "\u89C4\u5219",
896
+ wrapperCol: {
897
+ span: 17
898
+ },
899
+ style: {
900
+ padding: '0 8px'
901
+ }
902
+ }, /*#__PURE__*/React.createElement(Input.TextArea, {
903
+ size: "small",
904
+ placeholder: "\u4F8B\u5982\uFF1A".concat(JSON.stringify([["[9,13)", "轻度"], ["[13,~)", "中重度"]])),
905
+ value: activeGroup === null || activeGroup === void 0 ? void 0 : activeGroup.code,
906
+ onChange: function onChange(e) {
907
+ setCurrentGroup('code', e.target.value);
908
+ }
909
+ })), /*#__PURE__*/React.createElement("div", {
910
+ className: styles$2["question-step-two__panel-preview-middle"]
911
+ }, !q.length ? (/*#__PURE__*/React.createElement("div", {
912
+ className: styles$2["question-step-two__panel-preview-middle__start"]
913
+ }, "\u70B9\u51FB\u9898\u578B \u6216\u8005 \u5C06\u9898\u578B\u62D6\u5165\u6B64\u533A\u57DF")) : active && renderQuestions(q)));
914
+ })), /*#__PURE__*/React.createElement("div", {
915
+ className: styles$2["question-step-two__panel-preview-bottom"]
916
+ }, /*#__PURE__*/React.createElement("div", {
917
+ className: styles$2["question-step-two__panel-preview-bottom__btns"]
918
+ }, /*#__PURE__*/React.createElement(Button, {
919
+ className: styles$2["question-step-two__panel-preview-bottom__btns-btn"],
920
+ onClick: function onClick() {
921
+ onChangeStep(0);
922
+ }
923
+ }, "\u4E0A\u4E00\u6B65"), /*#__PURE__*/React.createElement(Button, {
924
+ type: "primary",
925
+ className: styles$2["question-step-two__panel-preview-bottom__btns-btn"],
926
+ onClick: function onClick() {
927
+ onPreview(__assign(__assign({}, data), {
928
+ groupVOList: groups,
929
+ questionnaireTitle: questionnaireTitle,
930
+ description: description,
931
+ questionList: questions
932
+ }));
933
+ }
934
+ }, "\u4E0B\u4E00\u6B65")))), /*#__PURE__*/React.createElement(Col, {
935
+ span: 6,
936
+ offset: 1
937
+ }, !!questions.length && renderLogicEdit())));
938
+ }
939
+ var css_248z$1 = ".step3-module_questionnaire-steps__xqOsx {\n background-color: white;\n height: 70px;\n display: flex;\n align-items: center;\n padding: 0 15% !important;\n margin-bottom: 8px;\n}\n.step3-module_questionnaire-steps-content__6TfTB {\n padding: 16px;\n background-color: white;\n}\n.step3-module_question-step-three__panel__uUelu {\n width: 100%;\n padding: 16px 8px;\n}\n.step3-module_question-step-three__panel-bottom__Cv0IG {\n width: 100%;\n display: flex;\n justify-content: center;\n margin-top: 50px;\n}\n.step3-module_question-step-three__panel-radio__LAbCm {\n text-align: center;\n}\n.step3-module_question-step-three__panel-mobile__bbjSM {\n display: flex;\n margin-top: 16px;\n justify-content: center;\n}\n.step3-module_question-step-three__panel-mobile-preview__q-RTq {\n height: 640px;\n width: 360px;\n background-size: contain;\n background-image: url('/lm_imgs/qn/phone.jpg');\n background-repeat: no-repeat;\n background-position: center;\n}\n.step3-module_question-step-three__panel-mobile-preview_content__WmLii {\n height: 100%;\n padding: 72px 44px 74px 45px;\n}\n.step3-module_question-step-three__panel-mobile-preview_content__WmLii .ant-form {\n padding: 8px;\n overflow-y: scroll;\n height: 100%;\n}\n.step3-module_question-step-three__panel-mobile-preview_content__WmLii .ant-form .step3-module_questions-title__f23Wo {\n text-align: center;\n}\n.step3-module_question-step-three__panel-mobile-preview_content__WmLii .ant-form .step3-module_questions-desc__3gE4i {\n margin: 8px 0;\n}\n.step3-module_question-step-three__panel-mobile-preview_content__WmLii .ant-form .ant-form-item {\n padding: 8px;\n border: 1px solid #d9d9d9;\n}\n.step3-module_question-step-three__panel-mobile-preview_content__WmLii .ant-form .ant-form-item:last-child {\n width: 100%;\n border: none;\n}\n.step3-module_question-step-three__panel-mobile-preview_content__WmLii .ant-form .ant-form-item:last-child button {\n width: 100%;\n}\n.step3-module_question-step-three__panel-compute__pUL6- {\n margin: 10px auto;\n background-image: url('/lm_imgs/qn/mackbook.png');\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n display: flex;\n justify-content: center;\n padding: 70px 0 100px 0;\n height: 600px;\n width: 1000px;\n}\n.step3-module_question-step-three__panel-compute__pUL6- .step3-module_questions-title__f23Wo {\n text-align: center;\n font-size: 20px;\n}\n.step3-module_question-step-three__panel-compute__pUL6- .step3-module_questions-desc__3gE4i {\n margin: 10px;\n}\n.step3-module_question-step-three__panel-compute__pUL6- .ant-form {\n padding: 8px;\n overflow-y: scroll;\n height: 100%;\n width: 60%;\n}\n.step3-module_question-step-three__panel-compute__pUL6- .ant-form .step3-module_questions-title__f23Wo {\n text-align: center;\n}\n.step3-module_question-step-three__panel-compute__pUL6- .ant-form .step3-module_questions-desc__3gE4i {\n margin: 8px 0;\n}\n.step3-module_question-step-three__panel-compute__pUL6- .ant-form .ant-form-item {\n padding: 8px;\n border: 1px solid #d9d9d9;\n}\n.step3-module_question-step-three__panel-compute__pUL6- .ant-form .ant-form-item:last-child {\n width: 100%;\n border: none;\n}\n.step3-module_question-step-three__panel-compute__pUL6- .ant-form .ant-form-item:last-child button {\n width: 100%;\n}\n.step3-module_question-step-three__panel-tablet__tz3LY {\n margin: 10px auto;\n background-image: url('/lm_imgs/qn/tablet.png');\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n display: flex;\n justify-content: center;\n padding: 70px 0 100px 0;\n height: 500px;\n width: 800px;\n}\n.step3-module_question-step-three__panel-tablet__tz3LY .step3-module_questions-title__f23Wo {\n text-align: center;\n font-size: 20px;\n}\n.step3-module_question-step-three__panel-tablet__tz3LY .step3-module_questions-desc__3gE4i {\n margin: 10px;\n}\n.step3-module_question-step-three__panel-tablet__tz3LY .ant-form {\n padding: 8px;\n overflow-y: scroll;\n height: 100%;\n width: 60%;\n}\n.step3-module_question-step-three__panel-tablet__tz3LY .ant-form .step3-module_questions-title__f23Wo {\n text-align: center;\n}\n.step3-module_question-step-three__panel-tablet__tz3LY .ant-form .step3-module_questions-desc__3gE4i {\n margin: 8px 0;\n}\n.step3-module_question-step-three__panel-tablet__tz3LY .ant-form .ant-form-item {\n padding: 8px;\n border: 1px solid #d9d9d9;\n}\n.step3-module_question-step-three__panel-tablet__tz3LY .ant-form .ant-form-item:last-child {\n width: 100%;\n border: none;\n}\n.step3-module_question-step-three__panel-tablet__tz3LY .ant-form .ant-form-item:last-child button {\n width: 100%;\n}\n";
940
+ var styles$1 = {
941
+ "questionnaire-steps": "step3-module_questionnaire-steps__xqOsx",
942
+ "questionnaire-steps-content": "step3-module_questionnaire-steps-content__6TfTB",
943
+ "question-step-three__panel": "step3-module_question-step-three__panel__uUelu",
944
+ "question-step-three__panel-bottom": "step3-module_question-step-three__panel-bottom__Cv0IG",
945
+ "question-step-three__panel-radio": "step3-module_question-step-three__panel-radio__LAbCm",
946
+ "question-step-three__panel-mobile": "step3-module_question-step-three__panel-mobile__bbjSM",
947
+ "question-step-three__panel-mobile-preview": "step3-module_question-step-three__panel-mobile-preview__q-RTq",
948
+ "question-step-three__panel-mobile-preview_content": "step3-module_question-step-three__panel-mobile-preview_content__WmLii",
949
+ "questions-title": "step3-module_questions-title__f23Wo",
950
+ "questions-desc": "step3-module_questions-desc__3gE4i",
951
+ "question-step-three__panel-compute": "step3-module_question-step-three__panel-compute__pUL6-",
952
+ "question-step-three__panel-tablet": "step3-module_question-step-three__panel-tablet__tz3LY"
953
+ };
954
+ styleInject(css_248z$1);
955
+ var Step3 = function Step3(props) {
956
+ var _a = useState('mobile'),
957
+ device = _a[0],
958
+ setDevice = _a[1];
959
+ var _b = useState([]),
960
+ globalLogic = _b[0],
961
+ setGlobalLogic = _b[1];
962
+ var data = props.data,
963
+ onChangeStep = props.onChangeStep;
964
+ console.log('data', data);
965
+ var _c = data.questionList,
966
+ questionList = _c === void 0 ? [] : _c;
967
+ data.questionnaireTitle;
968
+ data.description;
969
+ var _d = data.groupVOList,
970
+ groupVOList = _d === void 0 ? [] : _d;
971
+ var form = Form.useForm()[0];
972
+ function handleSave() {
973
+ return __awaiter(this, void 0, void 0, function () {
974
+ var method;
975
+ return __generator(this, function (_a) {
976
+ switch (_a.label) {
977
+ case 0:
978
+ method = 'post';
979
+ if (typeof data.id === 'number') {
980
+ method = 'put';
981
+ }
982
+ return [4, SMchc_Questionnaire[method](data)];
983
+ case 1:
984
+ _a.sent();
985
+ mchcEnv.success('保存问卷成功');
986
+ onChangeStep(0);
987
+ return [2];
988
+ }
989
+ });
990
+ });
991
+ }
992
+ useEffect(function () {
993
+ var newGlobalLogic = __spreadArray([], globalLogic, true);
994
+ questionList.map(function (question, index) {
995
+ var logic = question.logic;
996
+ if (logic) {
997
+ newGlobalLogic.push({
998
+ bindIndex: logic.bind,
999
+ index: index
1000
+ });
1001
+ }
1002
+ });
1003
+ setGlobalLogic(newGlobalLogic);
1004
+ }, []);
1005
+ var handleValuesChange = function handleValuesChange(values, allValues) {
1006
+ var changedKey = Object.keys(values)[0];
1007
+ globalLogic.map(function (_a) {
1008
+ var _b;
1009
+ var bindIndex = _a.bindIndex,
1010
+ index = _a.index;
1011
+ if (changedKey == bindIndex) {
1012
+ form.setFieldsValue((_b = {}, _b[index] = undefined, _b));
1013
+ }
1014
+ });
1015
+ };
1016
+ var renderFormItem = function renderFormItem(question, index) {
1017
+ var logic = question.logic,
1018
+ _a = question.questionOptionList,
1019
+ questionOptionList = _a === void 0 ? [] : _a,
1020
+ questionTitle = question.questionTitle,
1021
+ questionType = question.questionType;
1022
+ var itemStyle = {};
1023
+ var Component = /*#__PURE__*/React.createElement(Fragment, null);
1024
+ var bindIndex = logic === null || logic === void 0 ? void 0 : logic.bind;
1025
+ var bindIndexSelectOption = (logic === null || logic === void 0 ? void 0 : logic.selectOption) || [];
1026
+ var formItemValue = form.getFieldValue(bindIndex);
1027
+ if (logic) {
1028
+ itemStyle = {
1029
+ display: 'none'
1030
+ };
1031
+ if (Array.isArray(formItemValue)) {
1032
+ formItemValue.map(function (itemOption) {
1033
+ if ((bindIndexSelectOption === null || bindIndexSelectOption === void 0 ? void 0 : bindIndexSelectOption.indexOf(itemOption)) > -1) {
1034
+ itemStyle = {};
1035
+ }
1036
+ });
1037
+ } else {
1038
+ if ((bindIndexSelectOption === null || bindIndexSelectOption === void 0 ? void 0 : bindIndexSelectOption.indexOf(formItemValue)) > -1) {
1039
+ itemStyle = {};
1040
+ }
1041
+ }
1042
+ }
1043
+ switch (QuestionTypeEnums.getLabel(questionType)) {
1044
+ case '单选题':
1045
+ Component = /*#__PURE__*/React.createElement(Radio.Group, null, questionOptionList.map(function (option, key) {
1046
+ return /*#__PURE__*/React.createElement(Radio, {
1047
+ style: {
1048
+ display: 'block'
1049
+ },
1050
+ key: key,
1051
+ value: key
1052
+ }, option.optionTitle);
1053
+ }));
1054
+ break;
1055
+ case '多选题':
1056
+ Component = /*#__PURE__*/React.createElement(Checkbox.Group, null, questionOptionList.map(function (option, key) {
1057
+ return /*#__PURE__*/React.createElement(Checkbox, {
1058
+ style: {
1059
+ display: 'block',
1060
+ margin: 0
1061
+ },
1062
+ key: key,
1063
+ value: key
1064
+ }, option.optionTitle);
1065
+ }));
1066
+ break;
1067
+ case '下拉题':
1068
+ Component = /*#__PURE__*/React.createElement(Select_L, null, questionOptionList.map(function (option, key) {
1069
+ return /*#__PURE__*/React.createElement(Select_L.Option, {
1070
+ key: key,
1071
+ value: key
1072
+ }, option.optionTitle);
1073
+ }));
1074
+ break;
1075
+ case '打分题':
1076
+ Component = /*#__PURE__*/React.createElement(Rate, null);
1077
+ break;
1078
+ case '段落说明':
1079
+ break;
1080
+ default:
1081
+ Component = /*#__PURE__*/React.createElement(Input, null);
1082
+ break;
1083
+ }
1084
+ return /*#__PURE__*/React.createElement(Form.Item, {
1085
+ style: itemStyle,
1086
+ name: index,
1087
+ label: "".concat(index + 1, ".").concat(questionTitle)
1088
+ }, Component);
1089
+ };
1090
+ var renderMobileShow = function renderMobileShow() {
1091
+ return /*#__PURE__*/React.createElement(Form, {
1092
+ autoComplete: "off",
1093
+ form: form,
1094
+ layout: "vertical",
1095
+ onValuesChange: handleValuesChange
1096
+ }, groupVOList.map(function (g) {
1097
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1098
+ className: styles$1["questions-title"]
1099
+ }, g.groupTitle), /*#__PURE__*/React.createElement("div", {
1100
+ className: styles$1["questions-desc"],
1101
+ dangerouslySetInnerHTML: {
1102
+ __html: g.groupDescription
1103
+ }
1104
+ }), getQuestionsInGroup(questionList, g).map(function (question, index) {
1105
+ return /*#__PURE__*/React.createElement(Fragment, {
1106
+ key: index
1107
+ }, renderFormItem(question, index));
1108
+ }));
1109
+ }));
1110
+ };
1111
+ var renderComputeShow = function renderComputeShow() {
1112
+ return /*#__PURE__*/React.createElement(Form, {
1113
+ autoComplete: "off",
1114
+ form: form,
1115
+ layout: "vertical",
1116
+ onValuesChange: handleValuesChange
1117
+ }, groupVOList.map(function (g) {
1118
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1119
+ className: styles$1["questions-title"]
1120
+ }, g.groupTitle), /*#__PURE__*/React.createElement("div", {
1121
+ className: styles$1["questions-desc"],
1122
+ dangerouslySetInnerHTML: {
1123
+ __html: g.groupTitle
1124
+ }
1125
+ }), getQuestionsInGroup(questionList, g).map(function (question, index) {
1126
+ return /*#__PURE__*/React.createElement(Fragment, {
1127
+ key: index
1128
+ }, renderFormItem(question, index));
1129
+ }));
1130
+ }));
1131
+ };
1132
+ return /*#__PURE__*/React.createElement("div", {
1133
+ className: styles$1["question-step-three__panel"]
1134
+ }, /*#__PURE__*/React.createElement("div", {
1135
+ className: styles$1["question-step-three__panel-radio"]
1136
+ }, /*#__PURE__*/React.createElement(Radio.Group, {
1137
+ onChange: function onChange(e) {
1138
+ return setDevice(e.target.value);
1139
+ },
1140
+ value: device
1141
+ }, /*#__PURE__*/React.createElement(Radio.Button, {
1142
+ value: "mobile"
1143
+ }, /*#__PURE__*/React.createElement(MyIcon, {
1144
+ value: 'MobileOutlined',
1145
+ style: {
1146
+ marginRight: 5
1147
+ }
1148
+ }), "\u624B\u673A"), /*#__PURE__*/React.createElement(Radio.Button, {
1149
+ value: "compute"
1150
+ }, /*#__PURE__*/React.createElement(MyIcon, {
1151
+ value: 'DesktopOutlined',
1152
+ style: {
1153
+ marginRight: 5
1154
+ }
1155
+ }), "\u7535\u8111"), /*#__PURE__*/React.createElement(Radio.Button, {
1156
+ value: "tablet"
1157
+ }, /*#__PURE__*/React.createElement(MyIcon, {
1158
+ value: 'TabletOutlined',
1159
+ style: {
1160
+ marginRight: 5
1161
+ },
1162
+ rotate: 270
1163
+ }), "\u5E8A\u5934\u5C4F"))), device === 'mobile' && (/*#__PURE__*/React.createElement("div", {
1164
+ className: styles$1["question-step-three__panel-mobile"]
1165
+ }, /*#__PURE__*/React.createElement("div", {
1166
+ className: styles$1["question-step-three__panel-mobile-preview"]
1167
+ }, /*#__PURE__*/React.createElement("div", {
1168
+ className: styles$1["question-step-three__panel-mobile-preview_content"]
1169
+ }, renderMobileShow())))), device === 'tablet' && /*#__PURE__*/React.createElement("div", {
1170
+ className: styles$1["question-step-three__panel-tablet"]
1171
+ }, renderComputeShow()), device === 'compute' && /*#__PURE__*/React.createElement("div", {
1172
+ className: styles$1["question-step-three__panel-compute"]
1173
+ }, renderComputeShow()), /*#__PURE__*/React.createElement("div", {
1174
+ className: styles$1["question-step-three__panel-bottom"]
1175
+ }, /*#__PURE__*/React.createElement(Button, {
1176
+ style: {
1177
+ marginRight: 8
1178
+ },
1179
+ onClick: function onClick() {
1180
+ onChangeStep(1);
1181
+ }
1182
+ }, "\u4E0A\u4E00\u6B65"), /*#__PURE__*/React.createElement(Button, {
1183
+ type: "primary",
1184
+ style: {
1185
+ marginRight: 8
1186
+ },
1187
+ onClick: handleSave
1188
+ }, "\u63D0\u4EA4")));
1189
+ };
1190
+ var fakeData = {
1191
+ id: 2,
1192
+ questionnaireTitle: "测试问卷2------",
1193
+ questionList: [],
1194
+ groupVOList: []
1195
+ };
1196
+ function download(content, filename) {
1197
+ if (filename === void 0) {
1198
+ filename = '问卷答题情况.xlsx';
1199
+ }
1200
+ var eleLink = document.createElement('a');
1201
+ eleLink.download = filename;
1202
+ eleLink.style.display = 'none';
1203
+ var blob = typeof content === 'string' ? new Blob([content]) : content;
1204
+ console.log(_typeof(content), blob);
1205
+ eleLink.href = URL.createObjectURL(blob);
1206
+ document.body.appendChild(eleLink);
1207
+ eleLink.click();
1208
+ document.body.removeChild(eleLink);
1209
+ }
1210
+ var d = fakeData;
1211
+ var L = function L(props) {
1212
+ var _a = props.value,
1213
+ value = _a === void 0 ? [] : _a,
1214
+ _onChange2 = props.onChange,
1215
+ questions = props.questions;
1216
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
1217
+ block: true,
1218
+ onClick: function onClick(e) {
1219
+ return _onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(__spreadArray(__spreadArray([], value, true), [{}], false));
1220
+ }
1221
+ }, "\u65B0\u589E"), value === null || value === void 0 ? void 0 : value.map(function (_, idx) {
1222
+ var _a, _b, _c;
1223
+ var target = questions.find(function (q) {
1224
+ return q.id === _.questionId;
1225
+ });
1226
+ return /*#__PURE__*/React.createElement(Row, {
1227
+ key: idx,
1228
+ style: {
1229
+ marginTop: 6
1230
+ },
1231
+ gutter: 8
1232
+ }, /*#__PURE__*/React.createElement(Col, {
1233
+ span: 6
1234
+ }, /*#__PURE__*/React.createElement(Select_L, {
1235
+ value: _.questionId,
1236
+ options: questions === null || questions === void 0 ? void 0 : questions.map(function (q) {
1237
+ return {
1238
+ label: q.questionTitle,
1239
+ value: q.id,
1240
+ disabled: value.some(function (v) {
1241
+ return v.questionId === q.id;
1242
+ })
1243
+ };
1244
+ }),
1245
+ onChange: function onChange(id) {
1246
+ var selectTarget = questions.find(function (_) {
1247
+ return _.id === id;
1248
+ });
1249
+ value.splice(idx, 1, __assign(__assign({}, _), {
1250
+ questionId: id,
1251
+ questionType: selectTarget === null || selectTarget === void 0 ? void 0 : selectTarget.questionType,
1252
+ optionIndex: ''
1253
+ }));
1254
+ _onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(__spreadArray([], value, true));
1255
+ }
1256
+ })), /*#__PURE__*/React.createElement(Col, {
1257
+ span: 16
1258
+ }, /*#__PURE__*/React.createElement(Select_L, {
1259
+ value: (_b = (_a = _.optionIndex) === null || _a === void 0 ? void 0 : _a.split(',')) === null || _b === void 0 ? void 0 : _b.filter(function (_) {
1260
+ return !!_;
1261
+ }),
1262
+ mode: "multiple",
1263
+ options: (_c = target === null || target === void 0 ? void 0 : target.questionOptionList) === null || _c === void 0 ? void 0 : _c.map(function (q) {
1264
+ var _a;
1265
+ return {
1266
+ label: q.optionTitle,
1267
+ value: (_a = q.optionIndex) === null || _a === void 0 ? void 0 : _a.toString()
1268
+ };
1269
+ }),
1270
+ onChange: function onChange(id) {
1271
+ value.splice(idx, 1, __assign(__assign({}, _), {
1272
+ optionIndex: id === null || id === void 0 ? void 0 : id.toString()
1273
+ }));
1274
+ _onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(__spreadArray([], value, true));
1275
+ }
1276
+ })), /*#__PURE__*/React.createElement(Col, {
1277
+ span: 2
1278
+ }, /*#__PURE__*/React.createElement(Button, {
1279
+ block: true,
1280
+ style: {
1281
+ marginLeft: 0
1282
+ },
1283
+ danger: true,
1284
+ onClick: function onClick(e) {
1285
+ value.splice(idx, 1);
1286
+ _onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(__spreadArray([], value, true));
1287
+ }
1288
+ }, "\u5220\u9664")));
1289
+ }));
1290
+ };
1291
+ var Step4 = function Step4(_a) {
1292
+ var _b;
1293
+ var onChangeStep = _a.onChangeStep,
1294
+ _c = _a.data,
1295
+ data = _c === void 0 ? d : _c;
1296
+ var form = Form.useForm()[0];
1297
+ var _d = useState([]),
1298
+ list = _d[0],
1299
+ setList = _d[1];
1300
+ function getReqData() {
1301
+ return __assign({
1302
+ questionnaireId: data.id
1303
+ }, form.getFieldsValue());
1304
+ }
1305
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
1306
+ style: {
1307
+ display: 'flex',
1308
+ justifyContent: 'space-between',
1309
+ alignItems: 'center',
1310
+ padding: '0 12px',
1311
+ marginBottom: 12
1312
+ }
1313
+ }, /*#__PURE__*/React.createElement("span", {
1314
+ style: {
1315
+ fontSize: 20,
1316
+ fontWeight: 'bold'
1317
+ }
1318
+ }, data.questionnaireTitle), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
1319
+ type: "primary",
1320
+ onClick: function onClick() {
1321
+ return SMchc_Questionnaire.fk_downloadResult(getReqData()).then(download);
1322
+ }
1323
+ }, "\u5BFC\u51FA"), /*#__PURE__*/React.createElement(Button, {
1324
+ type: "primary",
1325
+ onClick: function onClick() {
1326
+ return onChangeStep(0);
1327
+ }
1328
+ }, "\u8FD4\u56DE"))), /*#__PURE__*/React.createElement(SimpleForm, {
1329
+ onValuesChange: function onValuesChange(v) {
1330
+ return console.log('xxd', v);
1331
+ },
1332
+ form: form,
1333
+ blocks: [{
1334
+ title: '搜索条件',
1335
+ rows: [{
1336
+ itemsInRow: [{
1337
+ type: 'Input',
1338
+ outerOptions: {
1339
+ name: 'outpatientNo',
1340
+ label: '就诊卡号'
1341
+ }
1342
+ }, {
1343
+ type: 'RangePicker',
1344
+ outerOptions: {
1345
+ name: 'fillDate',
1346
+ label: '提交日期'
1347
+ },
1348
+ innerOptions: {
1349
+ placeholder: ['请选择', '请选择']
1350
+ }
1351
+ }, {
1352
+ type: 'InputNumber',
1353
+ outerOptions: {
1354
+ name: 'beginTotalScore',
1355
+ label: '最小分数'
1356
+ },
1357
+ innerOptions: {}
1358
+ }, {
1359
+ type: 'InputNumber',
1360
+ outerOptions: {
1361
+ name: 'endTotalScore',
1362
+ label: '最大分数'
1363
+ },
1364
+ innerOptions: {}
1365
+ }],
1366
+ layoutType: 6
1367
+ }, {
1368
+ itemsInRow: [{
1369
+ type: 'Custom',
1370
+ layoutType: 24,
1371
+ innerOptions: {
1372
+ CustomedComponent: L,
1373
+ questions: data.questionList
1374
+ },
1375
+ outerOptions: {
1376
+ name: 'questionOptionList',
1377
+ label: '题目'
1378
+ }
1379
+ }]
1380
+ }, {
1381
+ itemsInRow: [{
1382
+ customNode: /*#__PURE__*/React.createElement(Button, {
1383
+ type: "primary",
1384
+ block: true,
1385
+ style: {
1386
+ marginLeft: 0
1387
+ },
1388
+ onClick: function onClick(e) {
1389
+ SMchc_Questionnaire.fk_getResult(getReqData()).then(setList);
1390
+ }
1391
+ }, "\u641C\u7D22")
1392
+ }],
1393
+ layoutType: 24
1394
+ }]
1395
+ }]
1396
+ }), /*#__PURE__*/React.createElement(Table_L, {
1397
+ sticky: true,
1398
+ scroll: {
1399
+ x: 1500
1400
+ },
1401
+ bordered: true,
1402
+ dataSource: list,
1403
+ style: {
1404
+ marginTop: 24
1405
+ },
1406
+ columns: __spreadArray(__spreadArray([{
1407
+ dataIndex: 'outpatientNo',
1408
+ title: '就诊卡号',
1409
+ ellipsis: true,
1410
+ fixed: true,
1411
+ width: 160
1412
+ }, {
1413
+ title: '姓名',
1414
+ width: 160,
1415
+ render: function render(a, b) {
1416
+ return b.name;
1417
+ }
1418
+ }, {
1419
+ title: '年龄',
1420
+ width: 160,
1421
+ render: function render(a, b) {
1422
+ return b.age;
1423
+ }
1424
+ }, {
1425
+ title: '孕周',
1426
+ width: 160,
1427
+ render: function render(a, b) {
1428
+ return b.expandField1;
1429
+ }
1430
+ }, {
1431
+ title: '预产期',
1432
+ width: 160,
1433
+ render: function render(a, b) {
1434
+ return b.expandField2;
1435
+ }
1436
+ }, {
1437
+ title: '手机号',
1438
+ width: 160,
1439
+ render: function render(a, b) {
1440
+ return b.telephone;
1441
+ }
1442
+ }, {
1443
+ title: '居住地址',
1444
+ width: 160,
1445
+ render: function render(a, b) {
1446
+ return b.residenceAddress;
1447
+ }
1448
+ }, {
1449
+ title: '提交日期',
1450
+ width: 160,
1451
+ render: function render(a, b) {
1452
+ return b.fillDate;
1453
+ }
1454
+ }], ((_b = data.groupVOList) === null || _b === void 0 ? void 0 : _b.map(function (g) {
1455
+ var _a;
1456
+ var questionList = (_a = data.questionList) === null || _a === void 0 ? void 0 : _a.filter(function (q) {
1457
+ var _a;
1458
+ return (_a = g.questionIndexList) === null || _a === void 0 ? void 0 : _a.includes(q.questionIndex);
1459
+ });
1460
+ return {
1461
+ title: g.groupTitle,
1462
+ children: questionListMapColumn(questionList)
1463
+ };
1464
+ })) || [], true), [{
1465
+ title: '总分',
1466
+ width: 160,
1467
+ render: function render(a, b) {
1468
+ return b.totalScore;
1469
+ }
1470
+ }], false)
1471
+ }));
1472
+ };
1473
+ function questionListMapColumn(list) {
1474
+ if (list === void 0) {
1475
+ list = [];
1476
+ }
1477
+ return list.map(function (q) {
1478
+ return {
1479
+ title: q.questionTitle,
1480
+ align: 'center',
1481
+ width: 140,
1482
+ ellipsis: true,
1483
+ render: function render(a, b) {
1484
+ var _a, _b, _c, _d;
1485
+ var target = b.writeDetailList.find(function (_) {
1486
+ return _.questionId === q.id;
1487
+ });
1488
+ var optionIdxArr = ((_b = (_a = target === null || target === void 0 ? void 0 : target.optionIndex) === null || _a === void 0 ? void 0 : _a.split(',')) === null || _b === void 0 ? void 0 : _b.filter(function (_) {
1489
+ return !!_;
1490
+ })) || [];
1491
+ var displayStr = (_c = q.questionOptionList) === null || _c === void 0 ? void 0 : _c.filter(function (_) {
1492
+ var _a;
1493
+ return optionIdxArr.includes((_a = _.optionIndex) === null || _a === void 0 ? void 0 : _a.toString());
1494
+ });
1495
+ return /*#__PURE__*/React.createElement("div", null, ((_d = displayStr === null || displayStr === void 0 ? void 0 : displayStr.map(function (_) {
1496
+ return _.optionTitle;
1497
+ })) === null || _d === void 0 ? void 0 : _d.join('、')) || (target === null || target === void 0 ? void 0 : target.questionResult));
1498
+ }
1499
+ };
1500
+ }) || [];
1501
+ }
1502
+ var css_248z = ".index-module_questionnaire-steps__gTgic {\n background-color: white;\n height: 70px;\n display: flex;\n align-items: center;\n padding: 0 15% !important;\n margin-bottom: 8px;\n}\n.index-module_questionnaire-steps-content__WjTKD {\n padding: 16px;\n background-color: white;\n}\n";
1503
+ var styles = {
1504
+ "questionnaire-steps": "index-module_questionnaire-steps__gTgic",
1505
+ "questionnaire-steps-content": "index-module_questionnaire-steps-content__WjTKD"
1506
+ };
1507
+ styleInject(css_248z);
1508
+ var Inner = function Inner(props) {
1509
+ var onEditorUpload = props.onEditorUpload;
1510
+ var _a = useState(0),
1511
+ current = _a[0],
1512
+ setCurrent = _a[1];
1513
+ var _b = useState(),
1514
+ data = _b[0],
1515
+ setData = _b[1];
1516
+ var _c = useState([]),
1517
+ templateList = _c[0],
1518
+ setTemplateList = _c[1];
1519
+ function fetchTemplateList() {
1520
+ SMchc_Questionnaire.fk_list().then(setTemplateList);
1521
+ }
1522
+ function onDeleteTemplate(data) {
1523
+ return __awaiter(this, void 0, void 0, function () {
1524
+ return __generator(this, function (_a) {
1525
+ switch (_a.label) {
1526
+ case 0:
1527
+ if (!confirm('确定删除吗')) return [2];
1528
+ return [4, SMchc_Questionnaire.del(data.id)];
1529
+ case 1:
1530
+ _a.sent();
1531
+ mchcEnv.success('删除问卷成功');
1532
+ fetchTemplateList();
1533
+ return [2];
1534
+ }
1535
+ });
1536
+ });
1537
+ }
1538
+ useEffect(function () {
1539
+ current || fetchTemplateList();
1540
+ }, [current]);
1541
+ var handleChangeStep = function handleChangeStep(target) {
1542
+ setCurrent(target);
1543
+ };
1544
+ var handlePreview = function handlePreview(data) {
1545
+ setData(data);
1546
+ handleChangeStep(2);
1547
+ };
1548
+ var handleInitQuestions = function handleInitQuestions(data_1) {
1549
+ var args_1 = [];
1550
+ for (var _i = 1; _i < arguments.length; _i++) {
1551
+ args_1[_i - 1] = arguments[_i];
1552
+ }
1553
+ return __awaiter(void 0, __spreadArray([data_1], args_1, true), void 0, function (data, isCopy, step) {
1554
+ var _data;
1555
+ var _a;
1556
+ if (isCopy === void 0) {
1557
+ isCopy = false;
1558
+ }
1559
+ if (step === void 0) {
1560
+ step = 1;
1561
+ }
1562
+ return __generator(this, function (_b) {
1563
+ switch (_b.label) {
1564
+ case 0:
1565
+ if (!(typeof data.id === 'number')) return [3, 2];
1566
+ return [4, SMchc_Questionnaire.fk_byId(data.id)];
1567
+ case 1:
1568
+ _data = _b.sent();
1569
+ if (isCopy && _data) {
1570
+ delete _data.id;
1571
+ _data.questionList = (_a = _data.questionList) === null || _a === void 0 ? void 0 : _a.map(function (q) {
1572
+ var _a;
1573
+ delete q.id;
1574
+ q.questionOptionList = (_a = q.questionOptionList) === null || _a === void 0 ? void 0 : _a.map(function (o) {
1575
+ delete o.id;
1576
+ return o;
1577
+ });
1578
+ return q;
1579
+ });
1580
+ }
1581
+ return [3, 3];
1582
+ case 2:
1583
+ _data = data;
1584
+ _b.label = 3;
1585
+ case 3:
1586
+ console.log('qqq', {
1587
+ _data: _data,
1588
+ data: data,
1589
+ isCopy: isCopy
1590
+ });
1591
+ setData(_data);
1592
+ handleChangeStep(step);
1593
+ return [2];
1594
+ }
1595
+ });
1596
+ });
1597
+ };
1598
+ return /*#__PURE__*/React.createElement("div", {
1599
+ style: {
1600
+ overflow: 'auto',
1601
+ height: '100%'
1602
+ }
1603
+ }, /*#__PURE__*/React.createElement(Steps, {
1604
+ current: current,
1605
+ className: styles["questionnaire-steps"]
1606
+ }, /*#__PURE__*/React.createElement(Steps.Step, {
1607
+ title: "\u9009\u62E9\u95EE\u53771"
1608
+ }), /*#__PURE__*/React.createElement(Steps.Step, {
1609
+ title: "\u7F16\u8F91\u95EE\u5377"
1610
+ }), /*#__PURE__*/React.createElement(Steps.Step, {
1611
+ title: "\u9884\u89C8\u95EE\u5377"
1612
+ }), /*#__PURE__*/React.createElement(Steps.Step, {
1613
+ title: "\u7EDF\u8BA1\u95EE\u5377"
1614
+ })), /*#__PURE__*/React.createElement("div", {
1615
+ className: styles["questionnaire-steps-content"]
1616
+ }, current === 0 && (/*#__PURE__*/React.createElement(Step1, __assign({}, props, {
1617
+ handleInitQuestions: handleInitQuestions,
1618
+ templateList: templateList,
1619
+ onDeleteTemplate: onDeleteTemplate
1620
+ }))), current === 1 && data && (/*#__PURE__*/React.createElement(Step2, {
1621
+ onChangeStep: handleChangeStep,
1622
+ onPreview: handlePreview,
1623
+ data: data,
1624
+ onEditorUpload: onEditorUpload
1625
+ })), current === 2 && data && /*#__PURE__*/React.createElement(Step3, {
1626
+ onChangeStep: handleChangeStep,
1627
+ data: data
1628
+ }), current === 3 && data && /*#__PURE__*/React.createElement(Step4, {
1629
+ onChangeStep: handleChangeStep,
1630
+ data: data
1631
+ })));
1632
+ };
1633
+ export { Inner as default };