cnhis-design-vue 2.1.78 → 2.1.80

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 (598) hide show
  1. package/.prettierrc.js +27 -27
  2. package/CHANGELOG.md +2953 -2911
  3. package/README.md +90 -90
  4. package/commitlint.config.js +1 -1
  5. package/es/affix/index.js +8 -8
  6. package/es/age/index.js +18 -18
  7. package/es/alert/index.js +8 -8
  8. package/es/anchor/index.js +8 -8
  9. package/es/auto-complete/index.js +8 -8
  10. package/es/avatar/index.js +8 -8
  11. package/es/back-top/index.js +8 -8
  12. package/es/badge/index.js +8 -8
  13. package/es/base/index.js +8 -8
  14. package/es/big-table/index.js +358 -338
  15. package/es/big-table/style.css +1 -1
  16. package/es/breadcrumb/index.js +8 -8
  17. package/es/button/index.js +31 -31
  18. package/es/calendar/index.js +8 -8
  19. package/es/captcha/index.js +7 -7
  20. package/es/card/index.js +8 -8
  21. package/es/carousel/index.js +8 -8
  22. package/es/cascader/index.js +8 -8
  23. package/es/checkbox/index.js +17 -17
  24. package/es/col/index.js +8 -8
  25. package/es/collapse/index.js +8 -8
  26. package/es/color-picker/index.js +5 -5
  27. package/es/comment/index.js +8 -8
  28. package/es/config-provider/index.js +8 -8
  29. package/es/date-picker/index.js +30 -30
  30. package/es/descriptions/index.js +8 -8
  31. package/es/divider/index.js +8 -8
  32. package/es/drag-layout/index.js +5 -5
  33. package/es/drawer/index.js +8 -8
  34. package/es/dropdown/index.js +8 -8
  35. package/es/editor/index.js +1 -1
  36. package/es/ellipsis/index.js +1 -1
  37. package/es/empty/index.js +8 -8
  38. package/es/fabric-chart/index.js +45 -45
  39. package/es/form/index.js +8 -8
  40. package/es/form-model/index.js +8 -8
  41. package/es/form-table/index.js +144 -144
  42. package/es/grid/index.js +4 -4
  43. package/es/index/index.js +3657 -2281
  44. package/es/index/style.css +1 -1
  45. package/es/input/index.js +11 -11
  46. package/es/input-number/index.js +8 -8
  47. package/es/keep-cache/index.js +9 -9
  48. package/es/layout/index.js +8 -8
  49. package/es/list/index.js +8 -8
  50. package/es/locale-provider/index.js +8 -8
  51. package/es/map/index.js +13 -13
  52. package/es/mentions/index.js +8 -8
  53. package/es/menu/index.js +8 -8
  54. package/es/message/index.js +8 -8
  55. package/es/multi-chat/index.js +117 -117
  56. package/es/multi-chat-client/index.js +111 -111
  57. package/es/multi-chat-history/index.js +6 -6
  58. package/es/multi-chat-record/index.js +27 -27
  59. package/es/multi-chat-setting/index.js +43 -43
  60. package/es/multi-chat-sip/index.js +1 -1
  61. package/es/notification/index.js +8 -8
  62. package/es/page-header/index.js +8 -8
  63. package/es/pagination/index.js +8 -8
  64. package/es/popconfirm/index.js +8 -8
  65. package/es/popover/index.js +8 -8
  66. package/es/progress/index.js +8 -8
  67. package/es/radio/index.js +17 -17
  68. package/es/rate/index.js +8 -8
  69. package/es/result/index.js +8 -8
  70. package/es/row/index.js +8 -8
  71. package/es/scale-container/index.js +1 -1
  72. package/es/scale-view/index.js +200 -198
  73. package/es/scale-view/style.css +1 -1
  74. package/es/select/index.js +44 -44
  75. package/es/select-label/index.js +75 -73
  76. package/es/select-label/style.css +1 -1
  77. package/es/select-person/index.js +45 -41
  78. package/es/select-person/style.css +1 -1
  79. package/es/shortcut-setter/index.js +10 -10
  80. package/es/skeleton/index.js +8 -8
  81. package/es/slider/index.js +8 -8
  82. package/es/space/index.js +8 -8
  83. package/es/spin/index.js +8 -8
  84. package/es/statistic/index.js +8 -8
  85. package/es/steps/index.js +8 -8
  86. package/es/switch/index.js +8 -8
  87. package/es/table-filter/index.js +2697 -1347
  88. package/es/table-filter/style.css +1 -1
  89. package/es/tabs/index.js +8 -8
  90. package/es/tag/index.js +9 -9
  91. package/es/time-picker/index.js +8 -8
  92. package/es/timeline/index.js +8 -8
  93. package/es/tooltip/index.js +8 -8
  94. package/es/transfer/index.js +8 -8
  95. package/es/tree/index.js +8 -8
  96. package/es/tree-select/index.js +8 -8
  97. package/es/upload/index.js +8 -8
  98. package/es/utils/clickoutside.js +7 -7
  99. package/es/utils/kty.min-1.0.0.js +5 -5
  100. package/es/utils/time-domain.js +16 -16
  101. package/es/utils/utils-map.js +32 -32
  102. package/es/utils/vexutils.js +27 -27
  103. package/es/verification-code/index.js +2 -2
  104. package/lib/cui.common.js +11438 -9918
  105. package/lib/cui.umd.js +11438 -9918
  106. package/lib/cui.umd.min.js +69 -69
  107. package/package.json +110 -110
  108. package/packages/affix/index.js +12 -12
  109. package/packages/affix/src/Affix.jsx +12 -12
  110. package/packages/age/index.js +27 -27
  111. package/packages/age/src/age/index.vue +139 -139
  112. package/packages/age/src/age-com/index.vue +209 -209
  113. package/packages/alert/index.js +12 -12
  114. package/packages/alert/src/Alert.jsx +11 -11
  115. package/packages/anchor/index.js +18 -18
  116. package/packages/anchor/src/Anchor.jsx +11 -11
  117. package/packages/anchor/src/Link.jsx +11 -11
  118. package/packages/auto-complete/index.js +12 -12
  119. package/packages/auto-complete/src/AutoComplete.jsx +12 -12
  120. package/packages/avatar/index.js +12 -12
  121. package/packages/avatar/src/Avatar.jsx +11 -11
  122. package/packages/back-top/index.js +12 -12
  123. package/packages/back-top/src/BackTop.jsx +11 -11
  124. package/packages/badge/index.js +12 -12
  125. package/packages/badge/src/Badge.jsx +11 -11
  126. package/packages/base/index.js +3 -3
  127. package/packages/big-table/index.js +16 -16
  128. package/packages/big-table/src/BigTable.vue +3205 -3193
  129. package/packages/big-table/src/Fieldset.vue +2067 -2067
  130. package/packages/big-table/src/assets/iconfont/iconfont.css +21 -21
  131. package/packages/big-table/src/assets/style/table-base.less +390 -387
  132. package/packages/big-table/src/assets/style/table-global.less +175 -175
  133. package/packages/big-table/src/components/AutoLayoutButton.vue +307 -307
  134. package/packages/big-table/src/components/NoData.vue +81 -81
  135. package/packages/big-table/src/components/TextOverTooltip.vue +120 -120
  136. package/packages/big-table/src/components/edit-form/EditForm.vue +509 -509
  137. package/packages/big-table/src/components/edit-form/edit-component/config-data/index.js +68 -68
  138. package/packages/big-table/src/components/edit-form/edit-component/edit-date-picker/edit-date-picker.vue +60 -60
  139. package/packages/big-table/src/components/edit-form/edit-component/edit-digital/edit-digital.vue +54 -54
  140. package/packages/big-table/src/components/edit-form/edit-component/edit-input/edit-input.vue +39 -39
  141. package/packages/big-table/src/components/edit-form/edit-component/edit-input-password/edit-input-password.vue +79 -79
  142. package/packages/big-table/src/components/edit-form/edit-component/edit-month-picker/edit-month-picker.vue +37 -37
  143. package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue +82 -82
  144. package/packages/big-table/src/components/edit-form/edit-component/edit-search-more/edit-search-more.vue +95 -95
  145. package/packages/big-table/src/components/edit-form/edit-component/edit-select/edit-select.vue +40 -40
  146. package/packages/big-table/src/components/edit-form/edit-component/edit-select-multiple/edit-select-multiple.vue +55 -55
  147. package/packages/big-table/src/components/edit-form/edit-component/edit-switch/edit-switch.vue +43 -43
  148. package/packages/big-table/src/components/edit-form/edit-component/edit-textarea/edit-textarea.vue +41 -41
  149. package/packages/big-table/src/components/edit-form/edit-component/edit-time-picker/edit-time-picker.vue +40 -40
  150. package/packages/big-table/src/components/edit-form/edit-component/mixins/bound-date.js +3 -3
  151. package/packages/big-table/src/components/edit-form/edit-component/mixins/dateType.js +217 -217
  152. package/packages/big-table/src/components/edit-form/edit-component/mixins/item-default.js +639 -639
  153. package/packages/big-table/src/components/edit-form/edit-component/mixins/search.js +1247 -1247
  154. package/packages/big-table/src/components/edit-form/edit-component/register-com.js +26 -26
  155. package/packages/big-table/src/components/edit-form/edit-item/form-event.js +80 -80
  156. package/packages/big-table/src/components/edit-form/edit-item/global-props.js +33 -33
  157. package/packages/big-table/src/components/edit-form/edit-item/index.js +4 -4
  158. package/packages/big-table/src/components/edit-form/edit-item/render-methods.js +28 -28
  159. package/packages/big-table/src/components/edit-form/edit-item/validate-rules.js +463 -463
  160. package/packages/big-table/src/components/edit-form/edit-mixins/form-commom.js +673 -673
  161. package/packages/big-table/src/components/edit-form/edit-mixins/index.js +3 -3
  162. package/packages/big-table/src/components/edit-form/edit-utils/index.js +112 -112
  163. package/packages/big-table/src/components/password-com.vue +58 -58
  164. package/packages/big-table/src/components/player-vod/index.vue +57 -57
  165. package/packages/big-table/src/components/player-vod/player.vue +193 -193
  166. package/packages/big-table/src/components/player-vod/video-list.vue +265 -265
  167. package/packages/big-table/src/components/player-vod/video-modal.vue +126 -126
  168. package/packages/big-table/src/utils/CustomPagination.vue +86 -86
  169. package/packages/big-table/src/utils/batchEditing.js +610 -610
  170. package/packages/big-table/src/utils/bigTableProps.js +108 -108
  171. package/packages/big-table/src/utils/eventBroadcast.js +24 -24
  172. package/packages/big-table/src/utils/format.js +557 -557
  173. package/packages/big-table/src/utils/nestTable.js +109 -109
  174. package/packages/big-table/src/utils/tableParse.js +234 -234
  175. package/packages/breadcrumb/index.js +21 -21
  176. package/packages/breadcrumb/src/Breadcrumb.jsx +11 -11
  177. package/packages/breadcrumb/src/BreadcrumbItem.jsx +11 -11
  178. package/packages/breadcrumb/src/BreadcrumbSeparator.jsx +11 -11
  179. package/packages/button/index.js +21 -21
  180. package/packages/button/src/Button.jsx +11 -11
  181. package/packages/button/src/ButtonGroup.jsx +11 -11
  182. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  183. package/packages/button/src/ButtonPrint/index.vue +766 -766
  184. package/packages/button/src/ButtonPrint/mixin/his-print.js +95 -95
  185. package/packages/calendar/index.js +12 -12
  186. package/packages/calendar/src/Calendar.jsx +11 -11
  187. package/packages/captcha/index.js +9 -9
  188. package/packages/captcha/src/Captcha.vue +164 -164
  189. package/packages/captcha/src/Index.vue +47 -47
  190. package/packages/captcha/src/SlideVerify.vue +285 -285
  191. package/packages/card/index.js +21 -21
  192. package/packages/card/src/Card.jsx +12 -12
  193. package/packages/card/src/CardGrid.js +7 -7
  194. package/packages/card/src/CardMeta.js +7 -7
  195. package/packages/carousel/index.js +12 -12
  196. package/packages/carousel/src/Carousel.jsx +12 -12
  197. package/packages/cascader/index.js +12 -12
  198. package/packages/cascader/src/Cascader.jsx +11 -11
  199. package/packages/checkbox/index.js +30 -30
  200. package/packages/checkbox/src/Checkbox.jsx +11 -11
  201. package/packages/checkbox/src/CheckboxImg/index.vue +141 -141
  202. package/packages/checkbox/src/Group.jsx +11 -11
  203. package/packages/col/index.js +13 -13
  204. package/packages/col/src/Col.jsx +11 -11
  205. package/packages/collapse/index.js +18 -18
  206. package/packages/collapse/src/Collapse.jsx +11 -11
  207. package/packages/collapse/src/Panel.jsx +11 -11
  208. package/packages/color-picker/index.js +10 -10
  209. package/packages/color-picker/src/color-picker.vue +191 -191
  210. package/packages/color-picker/src/style.less +109 -109
  211. package/packages/comment/index.js +12 -12
  212. package/packages/comment/src/Comment.jsx +11 -11
  213. package/packages/config-provider/index.js +12 -12
  214. package/packages/config-provider/src/ConfigProvider.jsx +11 -11
  215. package/packages/date-picker/index.js +26 -26
  216. package/packages/date-picker/src/DatePicker.jsx +12 -12
  217. package/packages/date-picker/src/MonthPicker.jsx +11 -11
  218. package/packages/date-picker/src/RangePicker.jsx +11 -11
  219. package/packages/date-picker/src/WeekPicker.jsx +11 -11
  220. package/packages/date-picker/src/utils/index.js +374 -374
  221. package/packages/descriptions/index.js +18 -18
  222. package/packages/descriptions/src/Descriptions.jsx +11 -11
  223. package/packages/descriptions/src/Item.jsx +11 -11
  224. package/packages/divider/index.js +12 -12
  225. package/packages/divider/src/Divider.jsx +11 -11
  226. package/packages/drag-layout/DragFormLeftItem.vue +173 -173
  227. package/packages/drag-layout/DragFormRightItem.vue +284 -284
  228. package/packages/drag-layout/I18n-mixins.js +10 -10
  229. package/packages/drag-layout/drag-layout.vue +778 -778
  230. package/packages/drag-layout/index.js +12 -12
  231. package/packages/drawer/index.js +12 -12
  232. package/packages/drawer/src/Drawer.jsx +11 -11
  233. package/packages/dropdown/index.js +12 -12
  234. package/packages/dropdown/src/Dropdown.jsx +11 -11
  235. package/packages/editor/index.js +9 -9
  236. package/packages/ellipsis/index.js +8 -8
  237. package/packages/ellipsis/src/Ellipsis.vue +65 -65
  238. package/packages/empty/index.js +12 -12
  239. package/packages/empty/src/Empty.jsx +11 -11
  240. package/packages/fabric-chart/index.js +9 -9
  241. package/packages/fabric-chart/src/FabricGrid.vue +67 -67
  242. package/packages/fabric-chart/src/components/DropPopup.vue +90 -90
  243. package/packages/fabric-chart/src/components/MouseRightClick.vue +168 -168
  244. package/packages/fabric-chart/src/components/TimeScaleValue.vue +125 -125
  245. package/packages/fabric-chart/src/const/defaultVaule.js +60 -60
  246. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +617 -617
  247. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1191 -1191
  248. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +139 -139
  249. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +651 -651
  250. package/packages/fabric-chart/src/mixins/fabricCommon.js +81 -81
  251. package/packages/fabric-chart/src/mixins/fabricObject.js +193 -193
  252. package/packages/fabric-chart/src/mixins/type.js +5 -5
  253. package/packages/fabric-chart/src/utils/bus.js +2 -2
  254. package/packages/form/index.js +16 -16
  255. package/packages/form/src/Form.jsx +11 -11
  256. package/packages/form/src/Item.jsx +11 -11
  257. package/packages/form-model/index.js +14 -14
  258. package/packages/form-model/src/FormModel.jsx +11 -11
  259. package/packages/form-model/src/Item.jsx +11 -11
  260. package/packages/form-table/index.js +16 -16
  261. package/packages/form-table/src/FormTable.vue +1110 -1110
  262. package/packages/form-table/src/components/table-component/config-data/index.js +80 -80
  263. package/packages/form-table/src/components/table-component/global-props.js +22 -22
  264. package/packages/form-table/src/components/table-component/index.js +8 -8
  265. package/packages/form-table/src/components/table-component/mixins/bound-date.js +455 -455
  266. package/packages/form-table/src/components/table-component/mixins/dateType.js +217 -217
  267. package/packages/form-table/src/components/table-component/mixins/item-default.js +257 -257
  268. package/packages/form-table/src/components/table-component/mixins/search.js +1242 -1242
  269. package/packages/form-table/src/components/table-component/register-com.js +30 -30
  270. package/packages/form-table/src/components/table-component/table-age/table-age.vue +175 -175
  271. package/packages/form-table/src/components/table-component/table-date-picker/table-date-picker.vue +87 -87
  272. package/packages/form-table/src/components/table-component/table-digital/table-digital.vue +93 -93
  273. package/packages/form-table/src/components/table-component/table-input/table-input.vue +81 -81
  274. package/packages/form-table/src/components/table-component/table-input-password/table-input-password.vue +126 -126
  275. package/packages/form-table/src/components/table-component/table-month-picker/table-month-picker.vue +55 -55
  276. package/packages/form-table/src/components/table-component/table-search/table-search.vue +174 -174
  277. package/packages/form-table/src/components/table-component/table-search-more/table-search-more.vue +191 -191
  278. package/packages/form-table/src/components/table-component/table-select/table-select.vue +64 -64
  279. package/packages/form-table/src/components/table-component/table-select-multiple/table-select-multiple.vue +81 -81
  280. package/packages/form-table/src/components/table-component/table-textarea/table-textarea.vue +76 -76
  281. package/packages/form-table/src/components/table-component/table-time-picker/table-time-picker.vue +55 -55
  282. package/packages/form-table/src/components/table-component/table-tree-select/table-tree-select.vue +135 -135
  283. package/packages/form-table/src/components/table-component/text-over-tooltip/TextOverTooltip.vue +97 -97
  284. package/packages/form-table/src/components/table-item/form-event.js +81 -81
  285. package/packages/form-table/src/components/table-item/global-props.js +27 -27
  286. package/packages/form-table/src/components/table-item/index.js +4 -4
  287. package/packages/form-table/src/components/table-item/render-methods.js +28 -28
  288. package/packages/form-table/src/components/table-item/validate-rules.js +520 -520
  289. package/packages/form-table/src/components/table-mixins/form-commom.js +98 -98
  290. package/packages/form-table/src/components/table-mixins/index.js +3 -3
  291. package/packages/form-table/src/components/table-utils/index.js +112 -112
  292. package/packages/form-table/src/disabledDetail.less +46 -46
  293. package/packages/grid/index.js +10 -10
  294. package/packages/grid/src/grid.js +28 -28
  295. package/packages/icon/index.js +10 -10
  296. package/packages/icon/src/icon.js +13 -13
  297. package/packages/index.js +313 -313
  298. package/packages/input/index.js +30 -30
  299. package/packages/input/src/Group.jsx +11 -11
  300. package/packages/input/src/Input.jsx +11 -11
  301. package/packages/input/src/Password.jsx +11 -11
  302. package/packages/input/src/Search.jsx +11 -11
  303. package/packages/input/src/TextArea.jsx +11 -11
  304. package/packages/input/src/input-quick/components/quick-item.vue +284 -284
  305. package/packages/input/src/input-quick/components/quick-popover.vue +596 -596
  306. package/packages/input/src/input-quick/index.vue +137 -137
  307. package/packages/input-number/index.js +12 -12
  308. package/packages/input-number/src/InputNumber.jsx +11 -11
  309. package/packages/keep-cache/KeepCache.js +236 -236
  310. package/packages/keep-cache/index.css +2 -2
  311. package/packages/keep-cache/index.js +8 -8
  312. package/packages/layout/index.js +27 -27
  313. package/packages/layout/src/Content.jsx +11 -11
  314. package/packages/layout/src/Footer.jsx +11 -11
  315. package/packages/layout/src/Header.jsx +11 -11
  316. package/packages/layout/src/Layout.jsx +11 -11
  317. package/packages/layout/src/Sider.jsx +11 -11
  318. package/packages/list/index.js +21 -21
  319. package/packages/list/src/Item.jsx +11 -11
  320. package/packages/list/src/ItemMeta.jsx +11 -11
  321. package/packages/list/src/List.jsx +11 -11
  322. package/packages/locale-provider/index.js +12 -12
  323. package/packages/locale-provider/src/LocaleProvider.jsx +11 -11
  324. package/packages/map/index.js +9 -9
  325. package/packages/map/src/Map.vue +484 -484
  326. package/packages/map/src/popup-map.vue +53 -53
  327. package/packages/mentions/index.js +18 -18
  328. package/packages/mentions/src/Mentions.jsx +11 -11
  329. package/packages/mentions/src/Option.jsx +11 -11
  330. package/packages/menu/index.js +27 -27
  331. package/packages/menu/src/Divider.jsx +11 -11
  332. package/packages/menu/src/Item.jsx +11 -11
  333. package/packages/menu/src/ItemGroup.jsx +11 -11
  334. package/packages/menu/src/Menu.jsx +11 -11
  335. package/packages/menu/src/SubMenu.jsx +11 -11
  336. package/packages/message/index.js +8 -8
  337. package/packages/modal/index.js +10 -10
  338. package/packages/modal/src/Modal.js +7 -7
  339. package/packages/multi-chat/chat/addConference.vue +200 -200
  340. package/packages/multi-chat/chat/addMembers.vue +411 -411
  341. package/packages/multi-chat/chat/advancedFilter.vue +372 -372
  342. package/packages/multi-chat/chat/calling.vue +246 -246
  343. package/packages/multi-chat/chat/chatFooter.vue +1647 -1647
  344. package/packages/multi-chat/chat/chatHistory.vue +605 -605
  345. package/packages/multi-chat/chat/chatMain.vue +1490 -1490
  346. package/packages/multi-chat/chat/client/index.vue +149 -149
  347. package/packages/multi-chat/chat/delay.vue +177 -177
  348. package/packages/multi-chat/chat/evaluate.vue +343 -343
  349. package/packages/multi-chat/chat/messageRecord.vue +324 -324
  350. package/packages/multi-chat/chat/mixins/NoData.js +20 -20
  351. package/packages/multi-chat/chat/mixins/base.js +97 -97
  352. package/packages/multi-chat/chat/mixins/uniRTCAPI.js +80 -80
  353. package/packages/multi-chat/chat/mixins/viewerOptions.js +67 -67
  354. package/packages/multi-chat/chat/quickReply.vue +439 -439
  355. package/packages/multi-chat/chat/robot/index.vue +312 -312
  356. package/packages/multi-chat/chat/scrollList.vue +1259 -1259
  357. package/packages/multi-chat/chat/videoVoiceList.vue +348 -348
  358. package/packages/multi-chat/chat/voice.vue +431 -431
  359. package/packages/multi-chat/components/avatar.vue +113 -113
  360. package/packages/multi-chat/components/chat-tabs-header.vue +251 -251
  361. package/packages/multi-chat/components/classify-tabs.vue +185 -185
  362. package/packages/multi-chat/components/empty.vue +24 -24
  363. package/packages/multi-chat/components/modal-refuse-reason.vue +112 -112
  364. package/packages/multi-chat/components/modal-sip.vue +160 -160
  365. package/packages/multi-chat/components/modal-user-transfer.vue +98 -98
  366. package/packages/multi-chat/components/msg-describe.vue +138 -138
  367. package/packages/multi-chat/components/msg-picture.vue +68 -68
  368. package/packages/multi-chat/components/msg-prescription.vue +205 -205
  369. package/packages/multi-chat/components/read-record.vue +133 -133
  370. package/packages/multi-chat/components/read-status.vue +34 -34
  371. package/packages/multi-chat/components/user-status.vue +198 -198
  372. package/packages/multi-chat/components/vuecmf-dialog.vue +322 -322
  373. package/packages/multi-chat/index.js +7 -7
  374. package/packages/multi-chat/setting/authority/index.vue +156 -156
  375. package/packages/multi-chat/setting/authority/roleSetting.vue +204 -204
  376. package/packages/multi-chat/setting/baseInfo/index.vue +1343 -1343
  377. package/packages/multi-chat/setting/customerService/batchSelect.vue +403 -403
  378. package/packages/multi-chat/setting/customerService/index.vue +273 -273
  379. package/packages/multi-chat/setting/event/edit/condition.vue +128 -128
  380. package/packages/multi-chat/setting/event/edit/index.vue +437 -437
  381. package/packages/multi-chat/setting/event/edit/notice.vue +129 -129
  382. package/packages/multi-chat/setting/event/edit/strategy.vue +98 -98
  383. package/packages/multi-chat/setting/event/index.vue +249 -249
  384. package/packages/multi-chat/setting/index.vue +269 -269
  385. package/packages/multi-chat/setting/page.vue +14 -14
  386. package/packages/multi-chat/setting/sessionList/index.vue +412 -412
  387. package/packages/multi-chat/setting/sessionList/messageRecord.vue +372 -372
  388. package/packages/multi-chat/setting/userConfig/index.vue +124 -124
  389. package/packages/multi-chat/setting/worktime/index.vue +274 -274
  390. package/packages/multi-chat/store/actions.js +452 -452
  391. package/packages/multi-chat/store/getters.js +380 -380
  392. package/packages/multi-chat/store/helper.js +66 -66
  393. package/packages/multi-chat/store/index.js +50 -50
  394. package/packages/multi-chat/store/mutation.js +305 -305
  395. package/packages/multi-chat/store/state.js +120 -120
  396. package/packages/multi-chat/style/emoji.css +315 -315
  397. package/packages/multi-chat/style/message.mixin.less +38 -38
  398. package/packages/multi-chat/utils/chatSock.js +93 -93
  399. package/packages/multi-chat/utils/compressImage.js +115 -115
  400. package/packages/multi-chat/utils/emoji.json +68 -68
  401. package/packages/multi-chat/utils/index.js +259 -259
  402. package/packages/multi-chat/utils/observer-scroll.js +49 -49
  403. package/packages/multi-chat/utils/panelsetting.js +48 -48
  404. package/packages/multi-chat-client/index.js +7 -7
  405. package/packages/multi-chat-history/index.js +7 -7
  406. package/packages/multi-chat-record/index.js +7 -7
  407. package/packages/multi-chat-setting/index.js +7 -7
  408. package/packages/multi-chat-sip/index.js +6 -6
  409. package/packages/notification/index.js +8 -8
  410. package/packages/page-header/index.js +12 -12
  411. package/packages/page-header/src/PageHeader.jsx +11 -11
  412. package/packages/pagination/index.js +12 -12
  413. package/packages/pagination/src/Pagination.jsx +11 -11
  414. package/packages/popconfirm/index.js +12 -12
  415. package/packages/popconfirm/src/Popconfirm.jsx +11 -11
  416. package/packages/popover/index.js +12 -12
  417. package/packages/popover/src/Popover.jsx +11 -11
  418. package/packages/progress/index.js +12 -12
  419. package/packages/progress/src/Progress.jsx +11 -11
  420. package/packages/radio/index.js +33 -33
  421. package/packages/radio/src/Group.jsx +11 -11
  422. package/packages/radio/src/Radio.jsx +11 -11
  423. package/packages/radio/src/RadioButton.jsx +11 -11
  424. package/packages/radio/src/RadioImg/index.vue +124 -124
  425. package/packages/rate/index.js +12 -12
  426. package/packages/rate/src/Rate.jsx +11 -11
  427. package/packages/result/index.js +12 -12
  428. package/packages/result/src/Result.jsx +11 -11
  429. package/packages/row/index.js +12 -12
  430. package/packages/row/src/Row.jsx +11 -11
  431. package/packages/scale-container/index.js +8 -8
  432. package/packages/scale-container/src/ScaleContainer.vue +197 -197
  433. package/packages/scale-view/NoData.vue +81 -81
  434. package/packages/scale-view/answerParse.vue +133 -133
  435. package/packages/scale-view/customList.vue +801 -801
  436. package/packages/scale-view/data.js +80 -80
  437. package/packages/scale-view/evaluateCountdown.vue +155 -155
  438. package/packages/scale-view/evaluatePage.vue +202 -202
  439. package/packages/scale-view/formitem/data.js +3991 -3991
  440. package/packages/scale-view/formitem/index.js +7 -7
  441. package/packages/scale-view/formitem/r-address.vue +245 -245
  442. package/packages/scale-view/formitem/r-choice.vue +746 -746
  443. package/packages/scale-view/formitem/r-input.vue +93 -93
  444. package/packages/scale-view/formitem/r-prompt.vue +52 -52
  445. package/packages/scale-view/formitem/r-sign.vue +218 -218
  446. package/packages/scale-view/formitem/r-time.vue +285 -285
  447. package/packages/scale-view/formitem/r-upload-custom-list.vue +242 -242
  448. package/packages/scale-view/formitem/r-upload.vue +287 -287
  449. package/packages/scale-view/formitem/sign-com.vue +316 -316
  450. package/packages/scale-view/formitem/text-over-tooltip/TextOverTooltip.vue +98 -98
  451. package/packages/scale-view/index.js +17 -17
  452. package/packages/scale-view/mixin/NoData.js +38 -38
  453. package/packages/scale-view/mixin/addressVal.js +156 -156
  454. package/packages/scale-view/mixin/evaluate.js +146 -146
  455. package/packages/scale-view/mixin/index.js +337 -337
  456. package/packages/scale-view/mixin/judgeTypes.js +267 -267
  457. package/packages/scale-view/scaleView.vue +2017 -2017
  458. package/packages/select/index.js +27 -27
  459. package/packages/select/src/CustomSelect/index.vue +130 -130
  460. package/packages/select/src/OptGroup.jsx +11 -11
  461. package/packages/select/src/Option.jsx +11 -11
  462. package/packages/select/src/Select/Select.vue +231 -231
  463. package/packages/select/src/Select/index.js +12 -12
  464. package/packages/select/src/TableSelect/index.vue +514 -514
  465. package/packages/select-label/index.js +14 -14
  466. package/packages/select-label/label-classify.vue +129 -129
  467. package/packages/select-label/labelFormContent.vue +787 -787
  468. package/packages/select-label/select-label.vue +597 -581
  469. package/packages/select-person/index.js +10 -10
  470. package/packages/select-person/search-tree.vue +373 -373
  471. package/packages/select-person/select-person.vue +1703 -1696
  472. package/packages/shortcut-setter/index.js +12 -12
  473. package/packages/shortcut-setter/src/ShortcutSetter.vue +55 -55
  474. package/packages/shortcut-setter/src/ShortcutSetterItem.vue +85 -85
  475. package/packages/shortcut-setter/src/utils/index.js +63 -63
  476. package/packages/skeleton/index.js +12 -12
  477. package/packages/skeleton/src/Skeleton.jsx +11 -11
  478. package/packages/slider/index.js +12 -12
  479. package/packages/slider/src/Slider.jsx +11 -11
  480. package/packages/space/index.js +12 -12
  481. package/packages/space/src/Space.jsx +11 -11
  482. package/packages/spin/index.js +12 -12
  483. package/packages/spin/src/Spin.jsx +11 -11
  484. package/packages/statistic/index.js +18 -18
  485. package/packages/statistic/src/Countdown.jsx +11 -11
  486. package/packages/statistic/src/Statistic.jsx +11 -11
  487. package/packages/steps/index.js +18 -18
  488. package/packages/steps/src/Step.jsx +11 -11
  489. package/packages/steps/src/Steps.jsx +11 -11
  490. package/packages/switch/index.js +12 -12
  491. package/packages/switch/src/Switch.jsx +11 -11
  492. package/packages/table-filter/index.js +27 -27
  493. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2622 -2630
  494. package/packages/table-filter/src/classification/Classification-com.vue +1760 -1760
  495. package/packages/table-filter/src/classification/search-class-name.vue +266 -266
  496. package/packages/table-filter/src/classification/search-professional-model.vue +680 -680
  497. package/packages/table-filter/src/components/TextOverTooltip.vue +120 -107
  498. package/packages/table-filter/src/components/age-com/index.vue +205 -205
  499. package/packages/table-filter/src/components/button-group/ButtonGroup.vue +162 -162
  500. package/packages/table-filter/src/components/button-icon/button-icon.js +33 -33
  501. package/packages/table-filter/src/components/button-icon/getBtnIcon.js +34 -34
  502. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  503. package/packages/table-filter/src/components/checkbox-group/CheckboxGroup.vue +53 -0
  504. package/packages/table-filter/src/components/drop-button/drop-button.vue +224 -224
  505. package/packages/table-filter/src/components/drop-button/head-btn-icon.js +33 -33
  506. package/packages/table-filter/src/components/drop-view/drop-view.vue +89 -89
  507. package/packages/table-filter/src/components/multi-select/multi-select.vue +242 -236
  508. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +232 -346
  509. package/packages/table-filter/src/components/range-age/index.vue +171 -172
  510. package/packages/table-filter/src/components/render-widget/components/CheckboxGroup.vue +51 -51
  511. package/packages/table-filter/src/components/render-widget/components/DateRangeQuick.vue +212 -0
  512. package/packages/table-filter/src/components/render-widget/components/NumberRange.vue +145 -0
  513. package/packages/table-filter/src/components/render-widget/components/Select.vue +50 -50
  514. package/packages/table-filter/src/components/render-widget/components/SelectDynamic.vue +304 -0
  515. package/packages/table-filter/src/components/render-widget/components/index.js +7 -7
  516. package/packages/table-filter/src/components/render-widget/enums.js +34 -29
  517. package/packages/table-filter/src/components/render-widget/index.vue +124 -91
  518. package/packages/table-filter/src/components/render-widget/mixins/dynamic-method.js +158 -0
  519. package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +245 -140
  520. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +1907 -1907
  521. package/packages/table-filter/src/components/search-condition/fieldTypeList.js +169 -169
  522. package/packages/table-filter/src/components/search-filter/SearchFilter.vue +280 -278
  523. package/packages/table-filter/src/components/search-modal/set-classification.vue +336 -336
  524. package/packages/table-filter/src/components/table-modal/TableModal.vue +477 -477
  525. package/packages/table-filter/src/const/dataOptions.js +43 -43
  526. package/packages/table-filter/src/const/index.js +1 -1
  527. package/packages/table-filter/src/index.vue +584 -584
  528. package/packages/table-filter/src/mixins/mixins.js +773 -714
  529. package/packages/table-filter/src/mixins/out-quick-method.js +123 -0
  530. package/packages/table-filter/src/mixins/renderWidget.js +97 -89
  531. package/packages/table-filter/src/mixins/tableSearchCon.js +128 -128
  532. package/packages/table-filter/src/mixins/wordBookutils.js +113 -113
  533. package/packages/table-filter/src/quick-search/QuickSearch.vue +2190 -2167
  534. package/packages/tabs/index.js +18 -18
  535. package/packages/tabs/src/TabPane.jsx +11 -11
  536. package/packages/tabs/src/Tabs.jsx +11 -11
  537. package/packages/tag/index.js +21 -21
  538. package/packages/tag/src/CheckableTag.jsx +11 -11
  539. package/packages/tag/src/Tag.jsx +11 -11
  540. package/packages/tag/src/TagGroup.vue +621 -621
  541. package/packages/time-picker/index.js +12 -12
  542. package/packages/time-picker/src/TimePicker.jsx +11 -11
  543. package/packages/timeline/index.js +14 -14
  544. package/packages/timeline/src/Item.jsx +11 -11
  545. package/packages/timeline/src/Timeline.jsx +11 -11
  546. package/packages/tooltip/index.js +12 -12
  547. package/packages/tooltip/src/Tooltip.jsx +11 -11
  548. package/packages/transfer/index.js +12 -12
  549. package/packages/transfer/src/Transfer.jsx +11 -11
  550. package/packages/tree/index.js +18 -18
  551. package/packages/tree/src/Tree.jsx +11 -11
  552. package/packages/tree/src/TreeNode.jsx +11 -11
  553. package/packages/tree-select/index.js +18 -18
  554. package/packages/tree-select/src/TreeNode.jsx +11 -11
  555. package/packages/tree-select/src/TreeSelect.jsx +11 -11
  556. package/packages/upload/chunk-upload/chunk-upload-new.vue +1001 -1001
  557. package/packages/upload/chunk-upload/vod-chunk-upload.vue +749 -749
  558. package/packages/upload/chunk-upload/vod-upload-modal.vue +100 -100
  559. package/packages/upload/index.js +12 -12
  560. package/packages/upload/src/Upload.jsx +11 -11
  561. package/packages/verification-code/SlideVerify.vue +306 -306
  562. package/packages/verification-code/index.js +17 -17
  563. package/packages/verification-code/verification-code.vue +147 -147
  564. package/src/component/player-vod/index.vue +57 -57
  565. package/src/component/player-vod/player.vue +192 -192
  566. package/src/component/player-vod/video-list.vue +262 -262
  567. package/src/component/player-vod/video-modal.vue +128 -128
  568. package/src/component/select-options/index.vue +430 -430
  569. package/src/component/select-pages/index.vue +95 -95
  570. package/src/component/svg/index.vue +59 -59
  571. package/src/core/create.js +6 -6
  572. package/src/core/event.js +23 -23
  573. package/src/core/table-methods.js +444 -444
  574. package/src/directive/flexibleResize.js +151 -151
  575. package/src/directive/preventReClick.js +12 -12
  576. package/src/directive/scroll.js +230 -230
  577. package/src/global/variable.js +2 -2
  578. package/src/style/normalize.css +424 -424
  579. package/src/style/style.less +49 -49
  580. package/src/utils/UniRTCv2.js +626 -626
  581. package/src/utils/chatFetch.js +61 -61
  582. package/src/utils/clickoutside.js +75 -75
  583. package/src/utils/crypto.js +25 -25
  584. package/src/utils/index.js +81 -81
  585. package/src/utils/kty-sdk.js +582 -582
  586. package/src/utils/kty.min-1.0.0.js +14378 -14378
  587. package/src/utils/sip-device.js +79 -79
  588. package/src/utils/time-domain.js +249 -249
  589. package/src/utils/trtc.js +1 -1
  590. package/src/utils/utils-map.js +485 -485
  591. package/src/utils/vexutils.js +836 -836
  592. package/.idea/cnhis-design-vue.iml +0 -12
  593. package/.idea/codeStyles/Project.xml +0 -57
  594. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  595. package/.idea/git_toolbox_prj.xml +0 -15
  596. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  597. package/.idea/modules.xml +0 -8
  598. package/.idea/vcs.xml +0 -6
@@ -1,2017 +1,2017 @@
1
- <template>
2
- <div class="r-scale">
3
- <slot v-if="spinning">
4
- <a-spin :indicator="indicator" tip="加载中..." />
5
- </slot>
6
- <slot v-if="!spinning && !hasFrontAddress">
7
- <!-- <div v-if="noData">暂无数据</div> -->
8
- <NoData v-if="noData" :noDataImg="noDataImg" :noDataTip="noDataTip"></NoData>
9
- <template v-else>
10
- <evaluatePage
11
- v-if="showEvaluateEntry"
12
- :formArray="formArray"
13
- :evaluateResultConfig="config.evaluateResultConfig"
14
- :evaluateResultSetting="config.evaluateResultSetting"
15
- :isFinished="isFinished"
16
- :maxScore="maxScore"
17
- @writeGuage="writeGuage"
18
- ></evaluatePage>
19
- <template v-else>
20
- <evaluateCountdown
21
- v-if="showEvaluateCoundownPage"
22
- ref="evaluateCountdown"
23
- :formArray="formArray"
24
- :evaluateResultConfig="config.evaluateResultConfig"
25
- :evaluateResultSetting="config.evaluateResultSetting"
26
- :form="form"
27
- :isFinished="isFinished"
28
- :currentTime="currentTime"
29
- :showEvaluateCountdown="showEvaluateCountdown"
30
- @closeEvaluateCountdown="closeEvaluateCountdown"
31
- ></evaluateCountdown>
32
- <div
33
- class="scale-container"
34
- :class="{ 'scale-container-nopadding': handlePageClass }"
35
- :style="scaleStyle"
36
- >
37
- <div class="totalScore-warp" v-if="hasScore">
38
- <div>
39
- 测评总分:
40
- <span>{{ maxScore }}分</span>
41
- </div>
42
- <div>
43
- 测评分数:
44
- <span :style="{ color: getEvaResColor }">{{ config.totalScore }}分</span>
45
- </div>
46
- <template v-if="hasEvaluateSetting">
47
- <div>
48
- 测评结果:
49
- <span
50
- class="score-result"
51
- :style="{ color: getEvaResColor }"
52
- >{{ config.evaluateResult }}</span>
53
- </div>
54
- <div>
55
- 结果说明:
56
- <span>{{ config.evaluateResultExplain }}</span>
57
- </div>
58
- </template>
59
- </div>
60
- <a-form-model
61
- ref="ruleForm"
62
- :model="form"
63
- :rules="rules"
64
- :layout="form.layout"
65
- :colon="false"
66
- class="main"
67
- >
68
- <template v-for="(item, index) in formArray">
69
- <!-- 标题 -->
70
- <template v-if="item.type == 'TITLE'">
71
- <a-form-model-item
72
- v-if="isShowItem(item)"
73
- :colon="false"
74
- :key="item.id || item.seq"
75
- >
76
- <h1 class="lb-title">{{ item.title }}</h1>
77
- <div class="lb-title">{{ item.describe }}</div>
78
- </a-form-model-item>
79
- </template>
80
- <!-- 分线栏 -->
81
- <template v-else-if="item.type == 'LINEBAR'">
82
- <a-form-model-item
83
- v-if="isShowItem(item)"
84
- :colon="false"
85
- :key="item.id || item.seq"
86
- >
87
- <div class="linebar-div" v-if="item.title">
88
- <span>{{ item.title }}</span>
89
- <a-divider />
90
- </div>
91
- <template v-else>
92
- <a-divider />
93
- </template>
94
- </a-form-model-item>
95
- </template>
96
- <!-- 提示语 -->
97
- <template v-else-if="item.type == 'PROMPT'">
98
- <a-form-model-item
99
- v-if="isShowItem(item)"
100
- class="my-prompt"
101
- :colon="false"
102
- :key="item.id || item.seq"
103
- >
104
- <MyPrompt :key="item.id || item.seq" :options="item.setting" />
105
- </a-form-model-item>
106
- </template>
107
- <template v-else-if="item.type == 'IMGCARD'">
108
- <a-form-model-item
109
- v-if="isShowItem(item)"
110
- :colon="false"
111
- :key="item.id || item.seq"
112
- >
113
- <a v-if="item.setting.imgLink" :href="item.setting.imgLink" target="_blank">
114
- <img class="img-card" :src="item.setting.imgUrl" />
115
- </a>
116
- <img class="img-card" v-else :src="item.setting.imgUrl" />
117
- </a-form-model-item>
118
- </template>
119
- <!-- 富文本 -->
120
- <template v-else-if="item.type == 'RICH_TEXT'">
121
- <div
122
- :key="item.id || item.seq"
123
- class="rich-text-content"
124
- v-html="item.setting.defaultValue"
125
- ></div>
126
- </template>
127
- <template v-else>
128
- <a-form-model-item
129
- v-if="isShowItem(item)"
130
- :key="item.id || item.seq"
131
- :prop="formKey(item)"
132
- >
133
- <span slot="label">
134
- <span
135
- :class="{ 'scale-label-required': isFormBoldOpen(item) }"
136
- v-html="handleShowQuestionNumber(item)"
137
- ></span>
138
- <span class="required-text" v-if="isFormBoldOpen(item)">(必填)</span>
139
- <span
140
- class="evalute-label"
141
- v-if="showEvaluateLabel(item)"
142
- >{{ showEvaluateLabel(item) }}</span>
143
- <template v-if="showEvatip(item)">
144
- <span class="evalute-tip" @click="showEvaTipModal(item)">
145
- <svg-icon icon-class="a-xitongtubiaotishi" />查看提示
146
- </span>
147
- </template>
148
- </span>
149
- <!-- 输入框 -->
150
- <MyInput
151
- v-bind="$attrs"
152
- v-if="isInput(item.type)"
153
- v-model="form[formKey(item)]"
154
- :eleType="item.type"
155
- :type="item.valueType"
156
- :row="item.setting.inputRow || 1"
157
- :defaultPlaceHolder="item.setting.defaultPlaceHolder"
158
- :isLock="componentDisable"
159
- />
160
-
161
- <!-- 单选/下拉/多选/级联 -->
162
- <MyChoice
163
- v-bind="$attrs"
164
- v-else-if="isChoice(item.type)"
165
- v-model="form[formKey(item)]"
166
- :item="item"
167
- :isLock="componentDisable"
168
- :curIndex="index"
169
- :openType="openType"
170
- @change="handleChoice($event, item)"
171
- @radioChange="radioChange"
172
- @checkboxChange="checkboxChange"
173
- />
174
- <!-- 日期/时间 -->
175
- <MyTime
176
- v-bind="$attrs"
177
- v-else-if="isTime(item.type)"
178
- :value="getTimeValue(item)"
179
- :type="item.type"
180
- :startToStop="item.setting.startToStop"
181
- :dateType="item.setting.dateType"
182
- :isLock="componentDisable"
183
- @change="changeTime($event, item)"
184
- />
185
- <!-- 上传附件 or 图片 -->
186
- <MyUpload
187
- v-bind="$attrs"
188
- v-else-if="isUpload(item.type)"
189
- :upType="item.type"
190
- :useFileList="item.dbValue"
191
- :limitPic="item.setting.limitPic"
192
- :isLock="componentDisable"
193
- @change="changeUpload($event, item)"
194
- />
195
- <!-- 地图 -->
196
- <div
197
- v-else-if="item.type === 'LOCATION'"
198
- @click="!isLock && (mapVisible = !mapVisible)"
199
- :class="{ 'map-container': !isLock }"
200
- >
201
- <a-input
202
- placeholder="请选择"
203
- :value="handleGetAddress(form[formKey(item)])"
204
- disabled
205
- >
206
- <a-icon slot="prefix" type="info-circle" />
207
- </a-input>
208
- <MapComp
209
- v-bind="$attrs"
210
- :visible.sync="mapVisible"
211
- :locationProp="form[formKey(item)]"
212
- :isLock="componentDisable"
213
- @selectLocation="handleSelectLocation($event, item)"
214
- />
215
- </div>
216
- <!-- 地址 -->
217
- <MyAddress
218
- v-bind="$attrs"
219
- v-else-if="item.type === 'ADDRESS'"
220
- :setting="item.setting"
221
- :defaultValue="form[formKey(item)]"
222
- :isLock="componentDisable"
223
- @change="changeAddress($event, item)"
224
- />
225
- <!-- 标签 -->
226
- <label-form
227
- v-bind="$attrs"
228
- v-else-if="item.type === 'LABEL'"
229
- :item="item"
230
- :selectedList="labelSelectedList"
231
- :isLock="componentDisable"
232
- :sourceType="source"
233
- @onChange="labelChange($event, item)"
234
- />
235
- <!-- 视频 -->
236
- <vod-Chunk-upload
237
- v-bind="$attrs"
238
- v-else-if="item.type === 'VEDIO'"
239
- :source="'guage'"
240
- :formData="item"
241
- :limitNum="item.setting.limitPic"
242
- :defFileList="form[formKey(item)]"
243
- :isLock="componentDisable"
244
- @vodFileList="vodFileList($event, item)"
245
- />
246
- <!-- 签名 -->
247
- <MySign v-else-if="item.type =='SIGN'" :form="form" :item="item" :isLock="componentDisable" @scaleChange="signChange"></MySign>
248
- <!-- 答案解析 -->
249
- <answerParse v-if="showAnswerParse(item)" :item="item"></answerParse>
250
-
251
- </a-form-model-item>
252
- </template>
253
- </template>
254
- </a-form-model>
255
- </div>
256
- <template v-if="type === 'customList'">
257
- <div class="footer" v-if="!noBtn">
258
- <a-button @click="cancel" v-if="false" style="margin-right: 8px;">取消</a-button>
259
- <a-button @click="onSubmit" type="primary" :disabled="banSubmit">保存</a-button>
260
- </div>
261
- </template>
262
- <template v-else>
263
- <div class="footer" v-if="showSaveBtn">
264
- <a-button @click="cancel" style="margin-right: 8px;">取消</a-button>
265
- <a-button type="primary" v-if="!isLock" @click="onSubmit" :disabled="banSubmit">保存</a-button>
266
- </div>
267
- </template>
268
- </template>
269
- </template>
270
- </slot>
271
- </div>
272
- </template>
273
- <script>
274
- import { Icon, Checkbox, Tree, Tooltip, Input, Spin, FormModel, Divider, Button } from 'ant-design-vue';
275
- import create from '@/core/create';
276
- import { MyChoice, MyInput, MyAddress, MyUpload, MyTime, MyPrompt, MySign } from './formitem';
277
- import MapComp from '../map/src/popup-map';
278
- import labelForm from '~/select-label/select-label';
279
- import vodChunkUpload from '~/upload/chunk-upload/vod-chunk-upload.vue';
280
- // import { EventBus } from "@/common/utils/eventBus.js";
281
- import { judgeTypes } from './mixin/judgeTypes';
282
- import NoDataJs from './mixin/NoData';
283
- // import { mapGetters } from "vuex";
284
- import moment from 'moment';
285
- import utils from '@/utils/utils-map';
286
- import evaluatePage from './evaluatePage.vue';
287
- import evaluateCountdown from './evaluateCountdown.vue';
288
- import answerParse from './answerParse.vue';
289
- import vexutils from '@/utils/vexutils';
290
- import NoData from './NoData.vue';
291
- import addressVal from './mixin/addressVal'
292
- export default create({
293
- name: 'scale-view',
294
- mixins: [judgeTypes, NoDataJs, addressVal],
295
- props: {
296
- ids: {
297
- type: Object,
298
- default: () => {
299
- return { guage_id: '', db_id: undefined };
300
- }
301
- },
302
- params: { default: () => ({}), type: Object },
303
- guageData: { type: Object, default: () => ({}) },
304
- noBtn: { type: Boolean, default: false },
305
- hideBtn: { type: Boolean, default: false },
306
- source: { type: String, default: '' },
307
- isLock: { type: Boolean, default: false },
308
- type: {
309
- type: String,
310
- default: ''
311
- },
312
- styleSetting: {
313
- type: Object,
314
- default: () => ({})
315
- },
316
-
317
- fontSizeObj: {
318
- type: Object,
319
- default: () => ({
320
- large: 1.25,
321
- medium: 1.1,
322
- small: 1,
323
- extrasmall: 0.9
324
- })
325
- },
326
- openType: { type: String, default: '' },
327
- scaleApiConfig: {
328
- type: Object,
329
- default: () => ({})
330
- }
331
- },
332
- components: {
333
- MyChoice,
334
- MyInput,
335
- MapComp,
336
- MyAddress,
337
- MyUpload,
338
- MyTime,
339
- MyPrompt,
340
- MySign,
341
- labelForm,
342
- vodChunkUpload,
343
- [Icon.name]: Icon,
344
- [Spin.name]: Spin,
345
- [Tree.name]: Tree,
346
- [Input.name]: Input,
347
- [Input.Search.name]: Input.Search,
348
- [Checkbox.name]: Checkbox,
349
- [Divider.name]: Divider,
350
- [Button.name]: Button,
351
- [FormModel.name]: FormModel,
352
- [FormModel.Item.name]: FormModel.Item,
353
- [Tooltip.name]: Tooltip,
354
- evaluatePage,
355
- evaluateCountdown,
356
- answerParse,
357
- NoData
358
- },
359
- computed: {
360
- queryformBoldOpen() {
361
- return this.$route.query?.formBoldOpen == 1;
362
- },
363
- showEvatip() {
364
- return function (item) {
365
- if (!this.isEvaluation(item.type)) return false;
366
- return this.$route.query?.evatip == 1 || this.params?.evatip == 1;
367
- };
368
- },
369
- isFormBoldOpen() {
370
- return function (item) {
371
- let res = item.required;
372
- // 量表未登录时 判断 url中是否有 formBoldOpen
373
- if (!this.styleSetting || !Object.keys(this.styleSetting).length || !('formBoldOpen' in this.styleSetting)) {
374
- return res && this.queryformBoldOpen;
375
- }
376
- return res && this.styleSetting.formBoldOpen;
377
- };
378
- },
379
- scaleStyle() {
380
- let fontSize = this.fontSize;
381
- if (!fontSize || fontSize === 'S') return null;
382
- const keyValue = {
383
- L: 'large',
384
- M: 'medium',
385
- XS: 'extrasmall'
386
- };
387
- fontSize = keyValue[fontSize];
388
- const scale = (fontSize && this.fontSizeObj[fontSize]) || 1;
389
- const size = 10000;
390
- const value = Math.floor((100 / scale) * size) / size;
391
- return {
392
- width: `${value}%`,
393
- height: `${value}%`,
394
- transform: `scale(${scale})`
395
- };
396
- },
397
- handlePageClass() {
398
- if (this.type == 'customList' && !this.noBtn) return false;
399
- if (!this.noBtn && !this.hideBtn) return false;
400
- return true;
401
- },
402
- isShowItem() {
403
- return item => this.showEvent(item);
404
- },
405
- handleShowQuestionNumber() {
406
- return function (item) {
407
- let { type } = item || {};
408
- let tempTile = this.config?.autoQuestionNumber === false ? item.showTitle : `${item.softcode}、${item.showTitle}`;
409
- tempTile = this.html2Escape(tempTile);
410
- if (!this.isEvaluation(type)) return tempTile;
411
-
412
- let score = this.handleEvaluationScore(item);
413
- return `${tempTile}&nbsp;<span style="color:#2d7aff;">${score}</span>`;
414
- // if (this.noBtn) {
415
- // let score = this.handleEvaluationScore(item);
416
- // return `${tempTile}&nbsp;<span style="color:#2d7aff;">${score}</span>`;
417
- // }
418
- // if (!this.isLock) {
419
- // let score = this.handleEvaluationScore(item);
420
- // return `${tempTile}&nbsp;<span style="color:#2d7aff;">${score}</span>`;
421
- // }
422
- // if (item.questionScore !== undefined) {
423
- // return `${tempTile}&nbsp;<span style="color:#2d7aff;">(${item.questionScore}分)</span>`;
424
- // }
425
- // return tempTile;
426
- };
427
- },
428
- hasScore() {
429
- let { config } = this;
430
- if (!config || !Object.keys(config).length) return false;
431
- if ('totalScore' in config) return true;
432
- return false;
433
- },
434
- // 预览按钮打开的量表页面
435
- isPreviewScale() {
436
- let guage_id = this.ids?.guage_id;
437
- return guage_id && this.noBtn;
438
- },
439
- hasEvaluateSetting() {
440
- let { config } = this;
441
- if (!config || !Object.keys(config).length) return false;
442
- if ('evaluateResult' in config && config.evaluateResult) return true;
443
- return false;
444
- },
445
- getTimeValue() {
446
- return function (item) {
447
- let value = this.form[this.formKey(item)];
448
- return value;
449
- };
450
- },
451
- // 是否展示考试入口
452
- showEvaluateEntry() {
453
- // 非预览
454
- // 有evaluateResultSetting || url中含有固定参数
455
- // 倒计时未结束
456
- // 未填写过
457
- return !this.isPreviewScale && this.showEvaluatePage && this.showEvaluateSettingWrap && !this.isFinished && !this.noBtn && !this.hideBtn;
458
- },
459
- // 是否展示倒计时
460
- showEvaluateCoundownPage() {
461
- return !this.isPreviewScale && !this.showEvaluateEntry && this.showEvaluateCountdownWrap && !this.isFinished && !this.noBtn && !this.hideBtn;
462
- },
463
- // 是否设置 evaluateResultSetting
464
- hasEvaluateResultSetting() {
465
- let { evaluateResultSetting = {} } = this.config;
466
- // 读取优先级为测评设置值(变量) > URL参数 > 测评设置值(固定值)
467
- // 是否设置 evaluateResultSetting
468
- let valueArr =
469
- Object.values(evaluateResultSetting).filter(item => {
470
- if (item) return true;
471
- }) || [];
472
- return valueArr.length;
473
- },
474
- hasparamsEvaluate() {
475
- return this.paramsEvaluate && Object.keys(this.paramsEvaluate).length;
476
- },
477
- // url中是否有默认值
478
- hasDefault() {
479
- let hash = window.location.hash;
480
- let defaultVariable = ['evaname', 'evadesc', 'evast', 'evadur', 'evaan'];
481
- let hasDefault = defaultVariable.find(item => hash.includes(item));
482
- return this.paramsEvaluate || hasDefault;
483
- },
484
- // 是否有提交按钮
485
- showSaveBtn() {
486
- // 无测评设置 && url中无固定参数
487
- if (!this.hasEvaluateResultSetting && !this.hasDefault) {
488
- return !this.noBtn && !this.hideBtn;
489
- }
490
- return !this.noBtn && !this.hideBtn && !this.isFinished;
491
- },
492
- // 组件是否 Disable
493
- componentDisable() {
494
- // 无测评设置 && url中无固定参数
495
- if (!this.hasEvaluateResultSetting && !this.hasDefault) {
496
- return this.hideBtn || this.isLock;
497
- }
498
- return this.hideBtn || this.isLock || this.isFinished;
499
- },
500
- showEvaluateLabel() {
501
- return function (item) {
502
- let obj = {
503
- EVALUATE_RADIO_BLOCK: '单选题',
504
- EVALUATE_CHECKBOX_BLOCK: '多选题'
505
- };
506
- return obj[item.type];
507
- };
508
- },
509
- showAnswerParse() {
510
- return function (item) {
511
- let { evaluateAnswer, checkAnswerMode, evaluateStartTime, evaluateTime } = this.config?.evaluateResultSetting || {};
512
- let arr = ['EVALUATE_RADIO_BLOCK', 'EVALUATE_CHECKBOX_BLOCK', 'EVALUATE_SELECT', 'EVALUATE_INPUT'];
513
- let maxScore = item?.scoreConfigs || 0;
514
- let isShow = evaluateAnswer && this.isFinished && arr.includes(item.type) && maxScore;
515
- if (!evaluateStartTime || !evaluateTime || (checkAnswerMode && checkAnswerMode == 1)) return isShow;
516
- if (!vexutils.isValidDate(new Date(evaluateStartTime))) return isShow;
517
- // 答案解析时间 考试时间结束后
518
- let endTime = moment(evaluateStartTime).add(evaluateTime, 'minutes');
519
- let isRang = endTime.diff(moment(), 'seconds', true);
520
- return isShow && isRang <= 0;
521
- };
522
- },
523
- tipMsg() {
524
- return this.type === 'customList' ? '保存' : '提交';
525
- },
526
- formKey() {
527
- return function (item) {
528
- return item.databaseTitle || item.title;
529
- };
530
- },
531
- getEvaResColor() {
532
- let { evaluateResultConfig = [], totalScore } = this.config || {};
533
- totalScore = +totalScore || 0;
534
- if (!evaluateResultConfig?.length || !totalScore) return '#2474FF';
535
- let matchItem = evaluateResultConfig.find(item => item.startScore <= totalScore && totalScore <= item.endScore);
536
- if (!matchItem) return '#2474FF';
537
- return matchItem.color || '#2474FF';
538
- }
539
- },
540
- watch: {
541
- ids: {
542
- immediate: true,
543
- deep: true,
544
- handler(newVal, oldVal) {
545
- if (oldVal) {
546
- if (newVal.guage_id) {
547
- if (newVal.guage_id != oldVal.guage_id) {
548
- this.init(newVal);
549
- }
550
- }
551
- } else {
552
- if (newVal.guage_id) this.init(newVal);
553
- }
554
- }
555
- },
556
- guageData: {
557
- immediate: true,
558
- deep: true,
559
- handler(value) {
560
- if (value) {
561
- if (Object.keys(value || {}).length) {
562
- // guageForm打开 重新请求重置之前的答案
563
- this.form = {};
564
- this.formArray = [];
565
- const data = JSON.parse(JSON.stringify(value));
566
- this.$nextTick(() => {
567
- this.initForm(data);
568
- });
569
- }
570
- }
571
- }
572
- }
573
- },
574
- data() {
575
- return {
576
- other: '',
577
- form: {},
578
- submitForm: {},
579
- rules: {},
580
- config: {},
581
- formArray: [],
582
- mapVisible: false,
583
- mapLocation: '',
584
- labelSelectedList: [],
585
- defaultFormArray: [],
586
- fontSize: '',
587
- filterArr: ['SUCCESS_TIP', 'CALLBACK_INTERFACE', 'SPREAD_PARAMS', 'REDIRECT', 'FRONT_ADDRESS', 'RETURN_PATH'],
588
- spinning: true,
589
- indicator: <a-icon type="loading" style="font-size: 24px" spin />,
590
- totalScore: undefined,
591
- shareId: '',
592
- currentTime: moment(),
593
- showEvaluatePage: false,
594
- showEvaluateSettingWrap: true,
595
- showEvaluateCountdownWrap: false,
596
- showEvaluateCountdown: false,
597
- banSubmit: false,
598
- isFinished: false,
599
- maxScore: 0,
600
- originConfig: {},
601
- paramsEvaluate: null,
602
- hasFrontAddress: true,
603
- choiceComObj: {},
604
- evatipMap: {} // 维护一个tip map避免重复请求
605
- };
606
- },
607
- mounted() {
608
- this.handleQuery();
609
- if (this.noBtn) {
610
- // EventBus.$on("guageSubmit", this.onSubmit);
611
- }
612
- },
613
- beforeDestroy() {
614
- // EventBus.$off("guageSubmit");
615
- },
616
- methods: {
617
- init(configData) {
618
- this.spinning = true;
619
- try {
620
- this.resetNodata();
621
- this.initForm(configData);
622
- } catch (error) {
623
- this.spinning = false;
624
- this.hasFrontAddress = false;
625
- this.setNoData(true, error?.resultMsg, error?.result);
626
- }
627
- },
628
- handleQuery() {
629
- let { id } = this.$route.query;
630
- id && (this.shareId = id);
631
- },
632
- initForm(data) {
633
- this.getProvinceData()
634
- let { list = [], map = {}, isFinished = false } = data;
635
- let curUrl = this.handleFrontAddress(list);
636
- if (curUrl) {
637
- window.location.href = curUrl;
638
- return;
639
- }
640
- map.maxScore && (this.maxScore = map.maxScore);
641
- this.isFinished = isFinished;
642
- if (data.isNotFilled) {
643
- this.spinning = false;
644
- this.hasFrontAddress = false;
645
- this.setNoData(true, '未查询到量表填写记录');
646
- return;
647
- }
648
- if (data.isLackCustomer) {
649
- let _this = this;
650
- // 校验用户环境
651
- this.$info({
652
- title: '已设置填写次数限制',
653
- content: '请在包含用户信息的环境中打开此量表',
654
- onOk() {
655
- _this.$emit('onCloseSetting');
656
- }
657
- });
658
- }
659
- this.config = map;
660
-
661
- if ('evaluateResultConfig' in map && utils.isJSON(map.evaluateResultConfig)) {
662
- this.config.evaluateResultConfig = JSON.parse(map.evaluateResultConfig);
663
- }
664
- if ('evaluateResultSetting' in map && utils.isJSON(map.evaluateResultSetting)) {
665
- this.config.evaluateResultSetting = JSON.parse(map.evaluateResultSetting);
666
- // 随机测评
667
- if (this.config?.randomId && this.config.evaluateResultSetting) {
668
- this.config.evaluateResultSetting.evaluateName = this.config.name;
669
- this.config.evaluateResultSetting.evaluateExplain = this.config.remark;
670
- }
671
- }
672
-
673
- this.originConfig = JSON.parse(JSON.stringify(this.config));
674
-
675
- if (this.params && Object.keys(this.params).length) {
676
- let res = this.handleBtnParamsEvaluate(this.params);
677
- res && Object.keys(res).length && (this.paramsEvaluate = res);
678
- }
679
-
680
- this.handleEvaluateParams(this.config.evaluateResultSetting);
681
- this.handleShowEvaluate();
682
-
683
- this.defaultFormArray = JSON.parse(JSON.stringify(list));
684
- let filterArr = this.filterArr;
685
- list = list.filter(v => !filterArr.includes(v.type));
686
- this.formArray = this.formatArray(list || []);
687
- this.form = this.defaultFormValue(this.formArray);
688
- this.rules = this.formatRules(this.formArray);
689
- this.fontSize = data.fontSize;
690
- this.spinning = false;
691
- this.hasFrontAddress = false;
692
- },
693
- handleFrontAddress(list) {
694
- if (!list || !list.length) return;
695
- let matchItem = list.find(item => item.type === 'FRONT_ADDRESS');
696
- if (!matchItem || !Object.keys(matchItem).length) return;
697
- let setting;
698
- if (matchItem.setting && utils.isJSON(matchItem.setting)) {
699
- setting = JSON.parse(matchItem.setting);
700
- }
701
- if (!setting || !Object.keys(setting).length) return;
702
- let query = this.handleQueryParams();
703
- // redirect=1 代表从前置地址跳转回来了
704
- if (query?.redirect == 1) return;
705
- let { frontAddress } = setting;
706
- if (frontAddress) {
707
- let urlHref = window.location.href;
708
- let preStr = '?';
709
- if (frontAddress.includes('?')) {
710
- preStr = '&';
711
- }
712
- let curUrl = `${frontAddress}${preStr}redirect_url=${encodeURIComponent(urlHref)}`;
713
- return curUrl;
714
- }
715
- },
716
- handleBtnParamsEvaluate(params) {
717
- let defaultVariable = ['evaname', 'evadesc', 'evast', 'evadur', 'evaan'];
718
- let res = {};
719
- for (let key in params) {
720
- let value = params[key];
721
- if (defaultVariable.includes(key) && value) {
722
- res[key] = value;
723
- }
724
- }
725
- return res;
726
- },
727
- /** *
728
- * 解析测评参数
729
- */
730
- handleEvaluateParams(evaluateResultSetting) {
731
- if (!evaluateResultSetting || !Object.keys(evaluateResultSetting).length) return;
732
- // 分享测评量表链接URL支持传入测评名称-evaname 测评说明-evadesc 测评时间-evast 测评时长-evadur 固定参数
733
- let query = this.handleQueryParams();
734
- // 按钮传参
735
- if (this.hasparamsEvaluate) {
736
- query = this.paramsEvaluate;
737
- }
738
- let obj = {
739
- evaluateName: 'evaname',
740
- evaluateExplain: 'evadesc',
741
- evaluateStartTime: 'evast',
742
- evaluateTime: 'evadur',
743
- evaluateAnswer: 'evaan'
744
- };
745
- for (let key in evaluateResultSetting) {
746
- let value = evaluateResultSetting[key];
747
- let isParseKey = value && key != 'evaluateAnswer' && typeof value === 'string' && value.includes('${');
748
- if (isParseKey) {
749
- let parseValue = value.replace(/\$\{([^}]+)\}/g, (_v, $1) => {
750
- let param;
751
- if ($1.startsWith('form.')) {
752
- param = query[$1.split('.')[1]];
753
- }
754
- return param || '';
755
- });
756
- this.$set(evaluateResultSetting, key, parseValue);
757
- } else {
758
- let val = query[obj[key]];
759
- if (key == 'evaluateAnswer') {
760
- val = val === 'true' || val == 1 ? true : false;
761
- }
762
- query[obj[key]] && this.$set(evaluateResultSetting, key, val);
763
- }
764
- }
765
- // 部分evaluateResultSetting 但是却有url
766
- if (this.hasDefault) {
767
- let defaultVariable = ['evaname', 'evadesc', 'evast', 'evadur', 'evaan'];
768
- let defObj = {
769
- evaname: 'evaluateName',
770
- evadesc: 'evaluateExplain',
771
- evast: 'evaluateStartTime',
772
- evadur: 'evaluateTime',
773
- evaan: 'evaluateAnswer'
774
- };
775
- defaultVariable.forEach(item => {
776
- let key = defObj[item];
777
- if (!evaluateResultSetting[key]) {
778
- let val = query[item];
779
- if (item == 'evaan') {
780
- val = val === 'true' || val == 1 ? true : false;
781
- }
782
- query[item] && this.$set(evaluateResultSetting, key, val);
783
- }
784
- });
785
- }
786
- this.setEvaluateStartTime(evaluateResultSetting);
787
- },
788
- handleQueryParams() {
789
- let params = {};
790
- let hash = window.location.hash.split('?')[1]
791
- if(!hash) {
792
- hash= window.location.href.split('?')[1]
793
- }
794
- for (let [key, value] of new URLSearchParams(hash).entries()) {
795
- params[key] = decodeURIComponent(value);
796
- }
797
- return params;
798
- },
799
- handleShowEvaluate() {
800
- // 读取优先级为测评设置值(变量) > URL参数 > 测评设置值(固定值)
801
- // 无 evaluateResultSetting
802
- if (!this.hasEvaluateResultSetting) {
803
- // url中是否有默认值
804
- // 无默认值 不显示考试入口页面
805
- if (!this.hasDefault) return false;
806
- // 有默认值 显示考试入口页面
807
- if (!('evaluateResultSetting' in this.config)) {
808
- this.$set(this.config, 'evaluateResultSetting', {});
809
- }
810
- this.setDefaultEvaluate(this.config.evaluateResultSetting);
811
- this.showEvaluatePage = true;
812
- this.showEvaluateCountdownWrap = true;
813
- return;
814
- }
815
-
816
- let { evaluateResultSetting = {} } = this.config;
817
- if (!evaluateResultSetting || !Object.keys(evaluateResultSetting).length) return;
818
- this.showEvaluateCountdownWrap = true;
819
-
820
- // 只要有开始时间都显示测评组件
821
- let { evaluateStartTime } = evaluateResultSetting;
822
- let { evaluateName } = this.originConfig?.evaluateResultSetting || {};
823
- // 未设置开始时间 一直可以填写
824
- if (!evaluateStartTime) {
825
- this.showEvaluatePage = true;
826
- return;
827
- }
828
- if (!vexutils.isValidDate(new Date(evaluateStartTime))) {
829
- if (!evaluateName) return false;
830
- }
831
- this.showEvaluatePage = true;
832
- },
833
- setDefaultEvaluate(evaluateResultSetting) {
834
- let query = this.handleQueryParams();
835
- // 按钮传参
836
- if (this.hasparamsEvaluate) {
837
- query = this.paramsEvaluate;
838
- }
839
- if (query.evaname) {
840
- this.$set(evaluateResultSetting, 'evaluateName', query.evaname);
841
- }
842
- if (query.evadesc) {
843
- this.$set(evaluateResultSetting, 'evaluateExplain', query.evadesc);
844
- }
845
- if (query.evast) {
846
- this.$set(evaluateResultSetting, 'evaluateStartTime', query.evast);
847
- }
848
- if (query.evadur) {
849
- this.$set(evaluateResultSetting, 'evaluateTime', query.evadur);
850
- }
851
- if (query.evaan) {
852
- let evaan = query.evaan === 'true' || query.evaan == 1 ? true : false;
853
- this.$set(evaluateResultSetting, 'evaluateAnswer', evaan);
854
- }
855
-
856
- this.setEvaluateStartTime(evaluateResultSetting);
857
- },
858
- // 时间戳需要是数字
859
- setEvaluateStartTime(evaluateResultSetting) {
860
- let evaluateStartTime = evaluateResultSetting?.evaluateStartTime;
861
- if (!evaluateStartTime) return;
862
- if (!vexutils.isValidDate(new Date(evaluateStartTime)) && vexutils.isValidDate(new Date(Number(evaluateStartTime)))) {
863
- evaluateResultSetting.evaluateStartTime = Number(evaluateStartTime);
864
- }
865
- },
866
- // 量表提交数据
867
- defaultFormValue(formArray) {
868
- const formData = {};
869
- let val;
870
- formArray.forEach(item => {
871
- const key = this.formKey(item);
872
- const { type } = item;
873
- let defValue;
874
- if (item.dbValue) {
875
- defValue = item.dbValue;
876
- } else {
877
- if (item.setting?.defValType == 3) {
878
- defValue = this.handleUrlDefaultValue(item)
879
- }
880
- }
881
- switch (type) {
882
- case 'LOCATION':
883
- formData[key] = defValue || '';
884
- break;
885
- case 'SEARCH_CASCADE':
886
- formData[key] = defValue || [];
887
- break;
888
- case 'ADDRESS':
889
- formData[key] = defValue || item?.setting?.defaultValue|| {};
890
- break;
891
- case 'LABEL':
892
- formData[key] = defValue || {};
893
- if (vexutils.isObject(defValue)) {
894
- this.labelSelectedList = defValue?.labels || [];
895
- } else if (Array.isArray(defValue)) {
896
- this.labelSelectedList = defValue;
897
- } else {
898
- this.labelSelectedList = [];
899
- }
900
- break;
901
- case 'TITLE':
902
- formData[key] = item.title;
903
- break;
904
- case 'IMGCARD':
905
- formData[key] = item.setting?.imgUrl || '';
906
- break;
907
- case 'UPFILE':
908
- case 'UPPICTURE':
909
- formData[key] = defValue || [];
910
- break;
911
- // 自定义列表特殊处理
912
- case 'CHECKBOX_BLOCK':
913
- if (defValue && !Array.isArray(defValue) && this.type === 'customList') {
914
- formData[key] = defValue.split(',').filter(ii => !!ii);
915
- } else {
916
- formData[key] = this.parseVal(defValue, item);
917
- }
918
- break;
919
- case 'MOBILE':
920
- val = this.parseVal(defValue, item)
921
- if(val && typeof val === 'string' && val.length > 11) {
922
- val = val.slice(0, 11)
923
- }
924
- formData[key] = val;
925
- break;
926
- default:
927
- formData[key] = this.parseVal(defValue, item);
928
- break;
929
- }
930
- });
931
- return formData;
932
- },
933
- // 解析传参组件
934
- compileSpreadParams(spreadParams) {
935
- return spreadParams.domains.map(v => {
936
- let obj = {};
937
- if (v.valueType == '1') {
938
- obj[v.name] = v.value;
939
- } else if (v.valueType == '2') {
940
- obj[v.name] = this.getQueryVariable(v.value);
941
- }
942
- return obj;
943
- });
944
- },
945
- // 获取url链接参数
946
- getQueryVariable(variable) {
947
- let query = {};
948
- if (this.source == 'layout') {
949
- // 按钮传参
950
- query = this.params;
951
- } else {
952
- query = this.handleQueryParams() || {};
953
- }
954
- if (!query) return false;
955
- return query[variable] || false;
956
- },
957
- // 初始化量表
958
- formatArray(list) {
959
- let i = 1;
960
- const results = list.map(item => {
961
- const key = this.formKey(item);
962
- let title = (key || '').replace(/\n/g, '');
963
- this.$set(item, 'showTitle', item.title);
964
- // 表单校验rule prop如果有 . 会报错, 替换成 ~-~
965
- if (title.includes('.')) {
966
- let newTitle = title.replace(/\./g, '~-~');
967
- this.$set(item, 'title', newTitle);
968
- }
969
- this.$set(item, 'isShow', true);
970
- Object.keys(item).forEach(key => {
971
- if (utils.isJSON(item[key])) {
972
- if (item.type != 'LOCATION') {
973
- item[key] = JSON.parse(item[key]);
974
- }
975
- }
976
- });
977
- const notIndexArr = ['LINEBAR', 'TITLE', 'PROMPT', 'IMGCARD', 'RICH_TEXT'];
978
- if (notIndexArr.indexOf(item.type) < 0 && !item.hide) {
979
- this.$set(item, 'softcode', i++);
980
- }
981
-
982
- // "RADIO_BLOCK", "CHECKBOX_BLOCK" 将取值value改为key
983
- if (this.isChoice(item.type)) {
984
- this.handleFormatOptions(item.options, item.type);
985
- if (item.type != 'SEARCH_CASCADE') {
986
- if (item.dbValue) {
987
- this.nextLogicEvent(item.dbValue, item, results, true);
988
- } else {
989
- if (item.setting.defaultValue) {
990
- this.nextLogicEvent(item.setting.defaultValue, item, results, true);
991
- }
992
- }
993
- }
994
- }
995
- return item;
996
- });
997
- return results.map(item => {
998
- // 题目关联
999
- let relationLogicObj = utils.isString(item.relationLogic) ? JSON.parse(item.relationLogic) : item.relationLogic;
1000
- this.handleRelationLogic(list, relationLogicObj);
1001
-
1002
- // 跳题逻辑
1003
- this.handLenextLogic(item);
1004
-
1005
- // 自定义列表特殊处理
1006
- if (item.type === 'CHECKBOX_BLOCK' && item.dbValue && !Array.isArray(item.dbValue) && this.type === 'customList') {
1007
- item.dbValue = item.dbValue.split(',').filter(ii => !!ii);
1008
- }
1009
- return item;
1010
- });
1011
- },
1012
- /**
1013
- * "RADIO_BLOCK", "CHECKBOX_BLOCK" 将取值value改为key, relationLogic需要重新处理
1014
- */
1015
- handleRelationLogic(list, relationLogicObj) {
1016
- let { condition } = relationLogicObj || {};
1017
- if (!condition || !condition.length) return;
1018
- condition.forEach(c => {
1019
- let matchItem = list.find(f => f.seq == c.subject_seq);
1020
- if (!matchItem) return;
1021
- let isChoice = this.isRadioOrCheckBox(matchItem.options, matchItem.type);
1022
- if (!isChoice) return;
1023
- let value = c.value;
1024
- if (Array.isArray(value)) {
1025
- value = value.map(v => {
1026
- return this.replaceConditionItem(matchItem.options, v);
1027
- });
1028
- c.value = value;
1029
- } else {
1030
- c.value = this.replaceConditionItem(matchItem.options, value);
1031
- }
1032
- });
1033
- },
1034
- /**
1035
- * "RADIO_BLOCK", "CHECKBOX_BLOCK" 将取值value改为key, nextLogic需要重新处理
1036
- */
1037
- handLenextLogic(item) {
1038
- let { nextLogic, options, type } = item || {};
1039
- let isChoice = this.isRadioOrCheckBox(options, type);
1040
- if (!nextLogic || !isChoice) return;
1041
- let { condition } = nextLogic || {};
1042
- if (!condition || !condition.length) return;
1043
- condition.forEach(c => {
1044
- let value = c.value;
1045
- if (Array.isArray(value)) {
1046
- value = value.map(v => {
1047
- return this.replaceConditionItem(options, v);
1048
- });
1049
- c.value = value;
1050
- } else {
1051
- c.value = this.replaceConditionItem(options, value);
1052
- }
1053
- });
1054
- },
1055
- replaceConditionItem(options, value) {
1056
- let matchOption = options.find(v => value === v.value);
1057
- if (!matchOption) return value;
1058
- return matchOption.key;
1059
- },
1060
- isRadioOrCheckBox(options, type) {
1061
- let typeArr = ['RADIO_BLOCK', 'CHECKBOX_BLOCK'];
1062
- if (!typeArr.includes(type)) return;
1063
- if (!options) return;
1064
- if (options && utils.isJSON(options)) {
1065
- options = JSON.parse(options);
1066
- }
1067
- if (!options.length) return;
1068
- return true;
1069
- },
1070
- handleFormatOptions(options, type) {
1071
- let isChoice = this.isRadioOrCheckBox(options, type);
1072
- if (!isChoice) return;
1073
-
1074
- options.forEach((item, i) => {
1075
- if (item.key !== 'other') {
1076
- item.key = i + 1;
1077
- }
1078
- if (item.prefix || item.suffix) {
1079
- item.value = item.prefix || item.suffix;
1080
- }
1081
- });
1082
- },
1083
- // 初始化rules
1084
- formatRules(formArray) {
1085
- const rules = {};
1086
- formArray.forEach(item => {
1087
- let newTitle = this.formKey(item);
1088
- // 表单校验rule prop如果有 . 会报错, 替换成 ~-~
1089
- if (newTitle.includes('.')) {
1090
- newTitle = newTitle.replace(/\./g, '~-~');
1091
- }
1092
- rules[newTitle] = [{ required: item.required, message: '必填', trigger: 'change' }];
1093
- if (item.type == 'MOBILE' && item.validation) {
1094
- rules[newTitle].push({
1095
- pattern: /^1[3456789]\d{9}$/,
1096
- message: '格式错误',
1097
- trigger: 'blur'
1098
- });
1099
- } else if (item.type == 'ID_CARD' && item.validation) {
1100
- rules[newTitle].push({
1101
- pattern: /^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9]|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}))$/,
1102
- message: '格式错误',
1103
- trigger: 'blur'
1104
- });
1105
- } else if (item.type == 'ADDRESS' && item.required) {
1106
- if (this.handleAddressType(item)) {
1107
- rules[newTitle].push({
1108
- validator: this.checkAdress,
1109
- trigger: 'change'
1110
- });
1111
- }
1112
- } else if (item.type == 'LABEL' && item.required) {
1113
- rules[newTitle].push({
1114
- validator: this.checkLabel,
1115
- trigger: 'change'
1116
- });
1117
- } else if (item.type == 'DATETIME' && this.type == 'customList') {
1118
- // 自定义列表特殊处理日期时间 最大值
1119
- // dateMaxType 1当前日期时间 2指定日期时间 3其他日期时间字段
1120
- let dateMaxType = this.handleDateMaxType(item);
1121
- if (!dateMaxType) return;
1122
- let obj = {
1123
- 1: 'checkDateMaxCur',
1124
- 2: 'checkDateMaxSet',
1125
- 3: 'checkDateMaxOther'
1126
- };
1127
- let methodName = obj[dateMaxType];
1128
- rules[newTitle].push({
1129
- validator: (rule, value, callback) => this[methodName](rule, value, callback, item),
1130
- trigger: 'change'
1131
- });
1132
- } else if (item.type === 'RADIO_BLOCK') {
1133
- this.choiceComObj[this.formKey(item)] = {};
1134
- rules[newTitle].push({
1135
- validator: (rule, value, callback) => this.checkRadio(rule, value, callback, item),
1136
- trigger: 'change'
1137
- });
1138
- } else if (item.type === 'CHECKBOX_BLOCK') {
1139
- this.choiceComObj[this.formKey(item)] = {};
1140
- rules[newTitle].push({
1141
- validator: (rule, value, callback) => this.checkCheckbox(rule, value, callback, item),
1142
- trigger: 'change'
1143
- });
1144
- }
1145
- });
1146
- return rules;
1147
- },
1148
- handleAddressType(item) {
1149
- let setObj = { addressType: 'province-city-district-address' };
1150
- if (utils.isJSON(item.setting)) {
1151
- setObj = JSON.parse(item.setting);
1152
- } else {
1153
- setObj = item.setting;
1154
- }
1155
- let isAdress = setObj.addressType.includes('address');
1156
- return isAdress;
1157
- },
1158
- checkAdress(rule, value, callback) {
1159
- let { address } = value || {};
1160
- if (!address) {
1161
- return callback(new Error('必填'));
1162
- }
1163
- callback();
1164
- },
1165
- checkLabel(rule, value, callback) {
1166
- if (!value || !Object.keys(value).length) {
1167
- return callback(new Error('必填'));
1168
- }
1169
- let { labelStr, labels = [] } = value;
1170
- if (!labelStr || !labels.length) {
1171
- return callback(new Error('必填'));
1172
- }
1173
- callback();
1174
- },
1175
- handleDateMaxType(item) {
1176
- let setObj = item.setting;
1177
- if (utils.isJSON(setObj)) {
1178
- setObj = JSON.parse(setObj);
1179
- }
1180
- return setObj.dateMaxType;
1181
- },
1182
- // 自定义列表 日期时间 max 当前日期时间
1183
- checkDateMaxCur(rule, value, callback, item) {
1184
- if (!value) return callback();
1185
- let { dateType } = item.setting;
1186
- if (!dateType) return callback();
1187
- let dateMaxValue = this.currentTime;
1188
- if (dateType == 'time') {
1189
- dateMaxValue = this.currentTime.format('HH:mm:ss');
1190
- }
1191
- let isMax = this.handleMax(dateType, value, dateMaxValue);
1192
- if (!isMax) {
1193
- return callback(new Error('最大不能超过当前日期时间'));
1194
- }
1195
- callback();
1196
- },
1197
- // 自定义列表 日期时间 max 指定日期时间
1198
- checkDateMaxSet(rule, value, callback, item) {
1199
- if (!value) return callback();
1200
- let { dateMaxValue, dateType } = item.setting;
1201
- if (!dateMaxValue || !dateType) return callback();
1202
- let isMax = this.handleMax(dateType, value, dateMaxValue);
1203
- if (!isMax) {
1204
- return callback(new Error('最大不能超过指定日期时间'));
1205
- }
1206
- callback();
1207
- },
1208
- // 自定义列表 日期时间 max 其他日期时间字段
1209
- checkDateMaxOther(rule, value, callback, item) {
1210
- if (!value) return callback();
1211
- let { outDateMaxValue, dateType } = item.setting;
1212
- if (!outDateMaxValue || !dateType) return callback();
1213
- let matchDateItem = this.formArray.find(v => v.seq === outDateMaxValue);
1214
- if (!matchDateItem || matchDateItem.hide) return callback();
1215
- let matchValue = this.form[this.formKey(matchDateItem)];
1216
- if (!matchValue) return;
1217
- let isMax = this.handleMax(dateType, value, matchValue);
1218
- if (!isMax) {
1219
- return callback(new Error(`最大不能超过【${matchDateItem.title}】日期时间`));
1220
- }
1221
- callback();
1222
- },
1223
- checkRadio(rule, value, callback, item) {
1224
- if (!value) return callback();
1225
- let { options } = item;
1226
- if (!options.length || value === 'other') return callback();
1227
- const key = this.formKey(item);
1228
- let { optionsPreSuffixObj = {} } = this.choiceComObj[key] || {};
1229
- let matchItem = options.find((o, i) => {
1230
- if (i + 1 === value) {
1231
- return true;
1232
- }
1233
- return false;
1234
- });
1235
- if (!matchItem || matchItem.importability) return callback();
1236
- if (matchItem.prefix || matchItem.suffix) {
1237
- let inputValue = optionsPreSuffixObj[value];
1238
- if (!inputValue) {
1239
- return callback(new Error(`请完善选项`));
1240
- }
1241
- }
1242
- callback();
1243
- },
1244
- checkCheckbox(rule, value, callback, item) {
1245
- if (!value || !value.length) return callback();
1246
- let { options } = item;
1247
- if (!options.length) return callback();
1248
- let i = 0,
1249
- len = value.length,
1250
- v;
1251
- const key = this.formKey(item);
1252
- let { optionsPreSuffixObj = {} } = this.choiceComObj[key] || {};
1253
- for (; i < len; i++) {
1254
- v = value[i];
1255
- if (v === 'other') continue;
1256
- let matchItem = options.find((o, j) => {
1257
- if (j + 1 === v) {
1258
- return true;
1259
- }
1260
- return false;
1261
- });
1262
- if (!matchItem || matchItem.importability) continue;
1263
-
1264
- if (matchItem.prefix || matchItem.suffix) {
1265
- let inputValue = optionsPreSuffixObj[v];
1266
- if (!inputValue) {
1267
- return callback(new Error(`请完善选项`));
1268
- }
1269
- }
1270
- }
1271
- callback();
1272
- },
1273
- handleMax(dateType, value, dateMaxValue) {
1274
- let curValue = '';
1275
- let tempValue = '';
1276
- if (dateType == 'time') {
1277
- let curYMD = this.currentTime.format('YYYY MM DD ');
1278
- curValue = moment(curYMD + dateMaxValue).valueOf();
1279
- tempValue = moment(curYMD + value).valueOf();
1280
- } else if (dateType == 'date') {
1281
- curValue = moment(dateMaxValue).valueOf();
1282
- tempValue = moment(value).valueOf();
1283
- } else {
1284
- curValue = moment(dateMaxValue).valueOf();
1285
- tempValue = moment(value).valueOf();
1286
- }
1287
- if (tempValue > curValue) {
1288
- return false;
1289
- }
1290
- return true;
1291
- },
1292
- handleGetAddress(val) {
1293
- if (utils.isJSON(val)) {
1294
- const valObj = JSON.parse(val);
1295
- return valObj.address || valObj.name;
1296
- }
1297
- return '';
1298
- },
1299
- handleSelectLocation(e, item) {
1300
- const { locationProp, isInit } = e;
1301
- this.mapLocation = locationProp;
1302
- const key = this.formKey(item);
1303
- this.form[key] = locationProp;
1304
- this.mapVisible = isInit || false;
1305
- },
1306
- isInput(type) {
1307
- return type == 'INPUT' || type == 'ID_CARD' || type == 'MOBILE' || type == 'EVALUATE_INPUT';
1308
- },
1309
- isChoice(type) {
1310
- return (
1311
- type == 'SELECT' ||
1312
- type == 'RADIO_BLOCK' ||
1313
- type == 'CHECKBOX_BLOCK' ||
1314
- type == 'SEARCH_CASCADE' ||
1315
- type == 'EVALUATE_RADIO_BLOCK' ||
1316
- type == 'EVALUATE_CHECKBOX_BLOCK' ||
1317
- type == 'EVALUATE_SELECT'
1318
- );
1319
- },
1320
- isTime(type) {
1321
- return type == 'DATE' || type == 'TIME' || type == 'DATETIME';
1322
- },
1323
- isUpload(type) {
1324
- return type == 'UPFILE' || type == 'UPPICTURE';
1325
- },
1326
- writeGuage(showCountdown) {
1327
- this.showEvaluateSettingWrap = false;
1328
- this.showEvaluateCountdown = showCountdown;
1329
- },
1330
- closeEvaluateCountdown() {
1331
- // 倒计时结束自动提交 无需校验
1332
- this.showEvaluateCountdown = false;
1333
- if (this.isPreviewScale) return;
1334
- this.banSubmit = true;
1335
- this.submitMethod();
1336
- this.$warning({
1337
- title: '温馨提示',
1338
- content: '测评时间到了,结束测评!',
1339
- okText: '确定',
1340
- onOk: () => {}
1341
- });
1342
- },
1343
- async showEvaTipModal(item) {
1344
- if (this.evatipMap[item.id]) {
1345
- this.evatipConfirm(this.evatipMap[item.id]);
1346
- return;
1347
- }
1348
- let key = 'getSubjectAnswer';
1349
- const fn = this.scaleApiConfig?.[key] || null;
1350
- if (!fn || typeof fn !== 'function') {
1351
- this.$message.error(`${key} Is not a function`);
1352
- return;
1353
- }
1354
- let obj = await fn(item.id);
1355
- if (!obj) return;
1356
- if (!this.evatipMap[item.id]) {
1357
- this.evatipMap[item.id] = obj;
1358
- this.evatipConfirm(obj);
1359
- }
1360
- },
1361
- closeTip() {
1362
- this.$destroyAll();
1363
- },
1364
- evatipConfirm(str) {
1365
- let _this = this;
1366
- let content = h => (
1367
- <div class="evatip-container">
1368
- <a-icon type="close" class="tip-content-close" on-click={_this.closeTip} />
1369
- <span>答案解析:</span>
1370
- <p>{str}</p>
1371
- </div>
1372
- );
1373
- this.$confirm({
1374
- title: '提示',
1375
- icon: () => null,
1376
- content,
1377
- okText: '确定',
1378
- cancelText: '关闭',
1379
- onOk() {},
1380
- onCancel() {},
1381
- class: 'evatip-modal-wrap'
1382
- });
1383
- },
1384
- // 选择组件
1385
- handleChoice(choiceValue, formItem) {
1386
- let { value = '', list = [] } = choiceValue;
1387
- this.nextLogicEvent(value, formItem, this.formArray);
1388
- this.handleDynamicDataRelation(list, formItem, this.formArray);
1389
- },
1390
- // 下拉框 动态数据源关联字段
1391
- handleDynamicDataRelation(list, formItem, formArray) {
1392
- let { targetSource } = formItem;
1393
- if (!targetSource || !Object.keys(targetSource).length) return;
1394
- if (!targetSource.target_id) return;
1395
- let { relationParam = [] } = targetSource;
1396
- if (!relationParam.length) return;
1397
- relationParam.forEach(item => {
1398
- let matchEle = formArray.find(v => v.seq === item.relationElement);
1399
- const key = this.formKey(matchEle);
1400
- if (matchEle) {
1401
- if (!list.length) {
1402
- this.form[key] = '';
1403
- } else {
1404
- let relationFieldList = list.map(v => v[item.relationField] || '/') || '';
1405
- this.form[key] = relationFieldList.join(',');
1406
- }
1407
- }
1408
- });
1409
- },
1410
- // 设置的logic condition 最大next_subject
1411
- handleLogicMaxNext(condition = []) {
1412
- const arr = condition.map(({ next_subject }) => (next_subject == 'end' ? 9999 : +(next_subject || 9999)));
1413
- const max = Math.max.call(null, ...arr);
1414
- return max;
1415
- },
1416
- // 当前formItem 下一个触发logicCodition item 的seq
1417
- handleLogicList(formItem, formArray) {
1418
- const { seq } = formItem;
1419
- let list = formArray.map(item => {
1420
- if (item.seq > seq && item.isShow && item.__isLogic__) return item;
1421
- return false;
1422
- });
1423
- let nextItemMax = 0;
1424
- let i = 0,
1425
- len = list.length,
1426
- item;
1427
- for (; i < len; i++) {
1428
- item = list[i];
1429
- let curVal = this.form[this.formKey(item)];
1430
- if (!curVal) continue;
1431
- if (Array.isArray(curVal)) {
1432
- if (!curVal.length) continue;
1433
- }
1434
- const { nextLogic, seq, __isLogic__, __lastSeq__ } = item;
1435
- if (!nextLogic.next_logic_is || !nextLogic.condition.length) continue;
1436
- if (__lastSeq__) {
1437
- nextItemMax = __lastSeq__;
1438
- break;
1439
- }
1440
- }
1441
- return nextItemMax;
1442
- },
1443
- // 跳题逻辑
1444
- nextLogicEvent(choiceValue, formItem, formArray = [], isInit) {
1445
- const { nextLogic, seq } = formItem;
1446
- if (!nextLogic) return;
1447
- if (nextLogic.next_logic_is && nextLogic.condition.length) {
1448
- let nextMax = 9999,
1449
- nextItemMax = 0;
1450
- if (!isInit) {
1451
- nextMax = this.handleLogicMaxNext(nextLogic.condition);
1452
- nextItemMax = this.handleLogicList(formItem, formArray);
1453
- }
1454
- nextLogic.condition.some(con => {
1455
- const { value, next_subject } = con;
1456
- const lastSeq = next_subject == 'end' ? 9999 : next_subject;
1457
- if (nextItemMax && nextItemMax > seq && nextItemMax < nextMax) {
1458
- nextMax = nextItemMax;
1459
- }
1460
- if (nextLogic.next_logic == 'condition') {
1461
- let hasValue = false;
1462
- if (Array.isArray(choiceValue)) {
1463
- hasValue = choiceValue.includes(value);
1464
- } else {
1465
- hasValue = choiceValue === value;
1466
- }
1467
-
1468
- // 添加非响应式key __isLogic__ __lastSeq__
1469
- Object.defineProperty(formItem, '__isLogic__', {
1470
- value: hasValue,
1471
- writable: true
1472
- });
1473
- Object.defineProperty(formItem, '__lastSeq__', {
1474
- value: seq + 1,
1475
- writable: true
1476
- });
1477
-
1478
- if (hasValue) {
1479
- formArray.forEach(item => {
1480
- if (item.seq > seq && item.seq < lastSeq) {
1481
- item.isShow = false;
1482
- // 跳过时 清空已填内容
1483
- const key = this.formKey(item);
1484
- this.form[key] && (this.form[key] = '');
1485
- } else if (item.seq >= lastSeq && item.seq < nextMax) {
1486
- this.$set(item, 'isShow', true);
1487
- }
1488
- });
1489
- return true;
1490
- } else {
1491
- formArray.forEach(item => {
1492
- if (item.seq > seq && item.seq < lastSeq) {
1493
- item.isShow = true;
1494
- }
1495
- });
1496
- }
1497
- } else if (nextLogic.next_logic == 'uncondition') {
1498
- let res = utils.isEmpty(choiceValue);
1499
-
1500
- // 添加非响应式key __isLogic__ __lastSeq__
1501
- Object.defineProperty(formItem, '__isLogic__', {
1502
- value: !res,
1503
- writable: true
1504
- });
1505
- Object.defineProperty(formItem, '__lastSeq__', {
1506
- value: seq + 1,
1507
- writable: true
1508
- });
1509
-
1510
- formArray.forEach(item => {
1511
- const key = this.formKey(item);
1512
- if (item.seq > seq && item.seq < lastSeq) {
1513
- item.isShow = res;
1514
- // 跳过时 清空已填内容
1515
- if (!res) {
1516
- this.form[key] && (this.form[key] = '');
1517
- }
1518
- }
1519
- });
1520
- }
1521
- });
1522
- }
1523
- },
1524
- // 关联逻辑
1525
- showEvent(formItem, isSubmitCallback) {
1526
- if (formItem.hide) return false;
1527
- const { form } = this;
1528
- let relationLogicObj = {};
1529
- // 回调接口
1530
- if (isSubmitCallback) {
1531
- let setting = formItem.setting;
1532
- if (formItem.setting && utils.isJSON(formItem.setting)) {
1533
- setting = JSON.parse(formItem.setting);
1534
- }
1535
- relationLogicObj = utils.isString(setting.callbackCondition) ? JSON.parse(setting.callbackCondition) : setting.callbackCondition;
1536
- if (!relationLogicObj || !relationLogicObj.condition || !relationLogicObj.condition.length) return true;
1537
- } else {
1538
- relationLogicObj = utils.isString(formItem.relationLogic) ? JSON.parse(formItem.relationLogic) : formItem.relationLogic;
1539
- }
1540
- if (!relationLogicObj || !Object.keys(relationLogicObj).length) return true;
1541
- const { relation_logic_is, condition, relation_logic } = relationLogicObj;
1542
- if (relation_logic_is) {
1543
- const results = condition.map(c => {
1544
- let key = this.formKey(this.formArray.filter(f => f.seq == c.subject_seq)[0]);
1545
- if (utils.isArray(form[key])) {
1546
- return form[key].some(v => c.value.includes(v));
1547
- } else {
1548
- return c.value.includes(form[key]);
1549
- }
1550
- });
1551
- if (relation_logic == 'OR') {
1552
- formItem.isShow = results.some(el => el);
1553
- } else if (relation_logic == 'AND') {
1554
- formItem.isShow = results.every(el => el);
1555
- } else {
1556
- formItem.isShow = results[0];
1557
- }
1558
- }
1559
- return formItem.isShow;
1560
- },
1561
- // 单选组件回调
1562
- radioChange(val, item, obj) {
1563
- const key = this.formKey(item);
1564
- this.form[key] = val;
1565
- item.type === 'RADIO_BLOCK' && this.$set(this.choiceComObj, key, obj);
1566
- this.nextLogicEvent(val, item, this.formArray);
1567
- },
1568
- // 多选组件回调
1569
- checkboxChange(val, item, obj) {
1570
- const key = this.formKey(item);
1571
- this.form[key] = val;
1572
- item.type === 'CHECKBOX_BLOCK' && this.$set(this.choiceComObj, key, obj);
1573
- this.nextLogicEvent(val, item, this.formArray);
1574
- },
1575
- // 标签组件回调
1576
- labelChange(labelList, item) {
1577
- const key = this.formKey(item);
1578
- this.form[key] = this.handleGetLabelSubmit(labelList);
1579
- },
1580
-
1581
- signChange(list, item) {
1582
- const key = this.formKey(item);
1583
- this.form[key] = list;
1584
- },
1585
- // 视频组件回调
1586
- vodFileList(list, item) {
1587
- const key = this.formKey(item);
1588
- this.form[key] = list;
1589
- },
1590
- handleGetLabelSubmit(labelSelectedList) {
1591
- if (!labelSelectedList || !labelSelectedList.length)
1592
- return {
1593
- labelStr: '',
1594
- labels: []
1595
- };
1596
- const selectedList = labelSelectedList || [];
1597
- const labelStrList = [];
1598
- const labels = [];
1599
- // "cacheKey":"label_标签","isSelect":true
1600
- selectedList.forEach(v => {
1601
- labels.push(v);
1602
- labelStrList.push(v.labelName);
1603
- });
1604
- this.labelSelectedList = selectedList;
1605
- return {
1606
- labelStr: labelStrList.join(','),
1607
- labels: labels
1608
- };
1609
- },
1610
- // 地址回调
1611
- changeAddress(allValue, item) {
1612
- const key = this.formKey(item);
1613
- this.form[key] = allValue;
1614
- },
1615
- // 上传回调
1616
- changeUpload(value, item) {
1617
- const key = this.formKey(item);
1618
- this.form[key] = value;
1619
- },
1620
- // 时间回调
1621
- changeTime(value, item) {
1622
- const key = this.formKey(item);
1623
- this.form[key] = value;
1624
- this.submitForm[key] = value;
1625
- },
1626
- // 保存
1627
- onSubmit() {
1628
- // 不包含测评组件,点击提交,弹出二次确认对话框,确认要提交吗?
1629
- let hasEvaluate = this.formArray.find(item => this.isEvaluation(item.type));
1630
- if (!hasEvaluate) {
1631
- this.confirmSubmit('确认要提交吗?');
1632
- return;
1633
- }
1634
-
1635
- // 包含测评组件,不包含考试时长,点击提交,弹出二次确认对话框,确认要结束测评吗?
1636
- // 判断有无测评配置 并且在测评时间内
1637
- let { evaluateResultSetting } = this.config;
1638
- if (!evaluateResultSetting || (!Object.keys(evaluateResultSetting).length && !this.showEvaluateEntry)) {
1639
- this.confirmSubmit('确认要结束测评吗?');
1640
- return;
1641
- }
1642
-
1643
- // 表单内嵌量表, 没有开始答题, 不需要调用保存接口
1644
- if (this.openType == 'formIframe' && this.showEvaluateEntry) {
1645
- this.$emit('submitNoRequest');
1646
- return;
1647
- }
1648
-
1649
- // 无倒计时
1650
- let countdownDom = this.$refs.evaluateCountdown;
1651
- if (!countdownDom?.showEvaluateCountdown) {
1652
- this.confirmSubmit('确认要结束测评吗?');
1653
- return;
1654
- }
1655
-
1656
- // 在倒计时内
1657
- let message = '确认要提前结束测评吗?';
1658
- let setAnswered = this.$refs.evaluateCountdown?.setAnswered;
1659
- let totalLen = this.$refs.evaluateCountdown?.totalLen;
1660
- // 存在未解答题目
1661
- if (setAnswered < totalLen) {
1662
- message = '存在未解答的题目,确定要提前结束吗?';
1663
- }
1664
- this.confirmSubmit(message);
1665
- },
1666
- confirmSubmit(message) {
1667
- let _this = this;
1668
- this.$confirm({
1669
- title: '温馨提示',
1670
- content: message,
1671
- okText: '确定',
1672
- cancelText: '取消',
1673
- onOk: () => {
1674
- _this.onSubmitForm();
1675
- },
1676
- onCancel() {}
1677
- });
1678
- },
1679
- onSubmitForm() {
1680
- this.$refs['ruleForm'].validate((valid, keys) => {
1681
- if (valid) {
1682
- this.submitMethod();
1683
- } else {
1684
- if (Object.keys(keys).length > 0) {
1685
- let key = Object.keys(keys)[0];
1686
- let field = keys[key][0].field,
1687
- message = keys[key][0].message;
1688
- let matchItem = this.formArray.find(v => v.databaseTitle === field);
1689
- if (matchItem) {
1690
- field = matchItem.title;
1691
- }
1692
- this.$message.error(field + message);
1693
- }
1694
- return false;
1695
- }
1696
- });
1697
- },
1698
- submitMethod() {
1699
- const hasSpreadParams = this.defaultFormArray.find(v => v.type === 'SPREAD_PARAMS');
1700
- if (hasSpreadParams) {
1701
- if (utils.isJSON(hasSpreadParams.setting)) {
1702
- hasSpreadParams.setting = JSON.parse(hasSpreadParams.setting);
1703
- }
1704
- let spreadKey = this.formKey(hasSpreadParams);
1705
- this.submitForm[spreadKey] = this.compileSpreadParams(hasSpreadParams.setting.spreadParams);
1706
- }
1707
- // 自定义列表新增时多选特殊处理
1708
- let checkBoxKey = this.defaultFormArray.find(ii => ii.type == 'CHECKBOX_BLOCK');
1709
- if (checkBoxKey && Array.isArray(this.form[checkBoxKey.title]) && this.type === 'customList') {
1710
- this.form[checkBoxKey.title] = this.form[checkBoxKey.title].join(',');
1711
- }
1712
- const scoreJson = this.handleScoreJson();
1713
- let params;
1714
- if (this.type === 'customList') {
1715
- params = {
1716
- definedListId: this.ids.guage_id,
1717
- dbId: this.ids.db_id,
1718
- scoreJson: JSON.stringify(scoreJson)
1719
- };
1720
- } else {
1721
- const { guageId, randomId } = this.config;
1722
- params = Object.assign(this.params, {
1723
- guageId,
1724
- scoreJson: JSON.stringify(scoreJson),
1725
- randomId
1726
- });
1727
- }
1728
- if (this.shareId) {
1729
- params.shareId = this.shareId;
1730
- }
1731
- const tipSetting = this.defaultFormArray.find(item => item.type === 'SUCCESS_TIP');
1732
- if (tipSetting) {
1733
- // 提交保存成功提示设置
1734
- const tip = utils.isJSON(tipSetting.setting) ? JSON.parse(tipSetting.setting) : tipSetting.setting;
1735
- params.tipSetting = JSON.stringify({
1736
- tipMode: tip.tipMode,
1737
- tipType: tip.tipType,
1738
- tipText: tip.tipText,
1739
- tipApi: tip.tipApi
1740
- });
1741
- }
1742
- let hasCallbackItem = this.defaultFormArray.find(v => v.type === 'CALLBACK_INTERFACE');
1743
- let isCallback = false;
1744
- if (hasCallbackItem) {
1745
- isCallback = this.showEvent(hasCallbackItem, true);
1746
- }
1747
- /**
1748
- * NOTE:
1749
- * 提交数据往外推
1750
- */
1751
- this.$emit('onSubmit', params, hasCallbackItem, isCallback);
1752
- },
1753
- handleScoreJson() {
1754
- let tempObj = Object.assign({}, this.form, this.submitForm);
1755
- let res = {};
1756
- if (!Object.keys(tempObj).length) return {};
1757
- for (let key in tempObj) {
1758
- let itemTemp = this.formArray.find(item => this.formKey(item) == key);
1759
- let curValue = tempObj[key];
1760
- if (key && itemTemp) {
1761
- let keyTemp;
1762
- if (itemTemp && itemTemp.databaseTitle) keyTemp = itemTemp.databaseTitle;
1763
- if (this.type == 'customList' && itemTemp && itemTemp.setting && itemTemp.setting.startToStop != 1 && curValue && itemTemp.type == 'DATETIME') {
1764
- if (itemTemp.setting && itemTemp.setting.dateType == 'time' && curValue) curValue = moment().format('YYYY-MM-DD ') + curValue;
1765
- if (itemTemp.setting && itemTemp.setting.dateType == 'date' && curValue) curValue = moment(curValue).format('YYYY-MM-DD ') + moment().format('HH:mm:ss');
1766
- }
1767
-
1768
- // 处理地址
1769
- if (itemTemp.type === "ADDRESS") {
1770
- curValue = this.handleSubmitAddress(tempObj[key], itemTemp);
1771
- }
1772
-
1773
- // 处理choice选项 将key替换为value
1774
- let isChoice = ['RADIO_BLOCK', 'CHECKBOX_BLOCK'].includes(itemTemp.type);
1775
- if (isChoice) {
1776
- let { options } = itemTemp;
1777
- let obj = this.choiceComObj[key];
1778
- if (itemTemp.type === 'RADIO_BLOCK' && curValue) {
1779
- curValue = this.handleChoiceItem(curValue, options, obj);
1780
- }
1781
- if (itemTemp.type === 'CHECKBOX_BLOCK' && curValue?.length) {
1782
- let resArr = this.handleCheckboxParams(curValue, options, obj);
1783
- curValue = resArr;
1784
- }
1785
- }
1786
-
1787
- if (key.includes('~-~')) {
1788
- let newKey = keyTemp ? keyTemp.replace(/~-~/g, '.') : key.replace(/~-~/g, '.');
1789
- res[newKey] = curValue;
1790
- } else {
1791
- res[keyTemp || key] = !curValue ? null : curValue;
1792
- }
1793
- } else {
1794
- res[key] = curValue;
1795
- }
1796
- }
1797
- console.log('res', res);
1798
- return res;
1799
- },
1800
- handleCheckboxParams(value, options, obj) {
1801
- let res = [];
1802
- let i = 0,
1803
- len = value.length,
1804
- v;
1805
- for (; i < len; i++) {
1806
- v = value[i];
1807
- let matchItem = options.find((o, i) => {
1808
- if (i + 1 === v) {
1809
- return true;
1810
- }
1811
- return false;
1812
- });
1813
- if (matchItem && !matchItem.prefix && !matchItem.suffix) {
1814
- res.push(matchItem.value);
1815
- continue;
1816
- }
1817
- let tempValue = this.handleChoiceItem(v, options, obj);
1818
- res.push(tempValue);
1819
- }
1820
- return res;
1821
- },
1822
- handleChoiceItem(value, options, obj) {
1823
- let { othersText, optionsPreSuffixObj = {} } = obj || {};
1824
- if (value === 'other') {
1825
- return othersText || '其他';
1826
- }
1827
- let matchItem = options.find((o, i) => {
1828
- if (i + 1 === value) {
1829
- return true;
1830
- }
1831
- return false;
1832
- });
1833
- if (!matchItem) return;
1834
- if (!matchItem.prefix && !matchItem.suffix) return matchItem.value;
1835
- let resValue = optionsPreSuffixObj[value] || '';
1836
- if (matchItem.prefix) {
1837
- resValue = matchItem.prefix + resValue;
1838
- } else {
1839
- resValue += matchItem.suffix;
1840
- }
1841
- return resValue;
1842
- },
1843
- resetForm() {
1844
- this.$refs.ruleForm.resetFields();
1845
- },
1846
- cancel() {
1847
- this.$emit('onCloseSetting');
1848
- },
1849
- handleEvaluationScore(ele) {
1850
- let { minScore = 0, maxScore = 0, scoreType } = ele.scoreConfigs || {};
1851
- return `(${maxScore}分)`;
1852
- },
1853
- html2Escape(sHtml) {
1854
- if(!sHtml || typeof sHtml != 'string') return sHtml;
1855
- return sHtml.replace(/[<>&"]/g,function(c){
1856
- return {'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];
1857
- });
1858
- }
1859
- }
1860
- });
1861
- </script>
1862
- <style lang="less" scoped>
1863
- .r-scale {
1864
- position: relative;
1865
- width: 100%;
1866
- height: 100%;
1867
- overflow: hidden;
1868
- padding-top: 4px;
1869
- padding-bottom: 50px;
1870
- .scale-container {
1871
- width: 100%;
1872
- height: 100%;
1873
- padding-bottom: 10px;
1874
- transform-origin: 0 0;
1875
- overflow-y: auto;
1876
- box-sizing: border-box;
1877
- &.scale-container-nopadding {
1878
- height: 100%;
1879
- }
1880
- &::-webkit-scrollbar {
1881
- width: 10px;
1882
- }
1883
- }
1884
- /deep/ .no-data-tip {
1885
- width: 100%;
1886
- height: 100%;
1887
- }
1888
- .totalScore-warp {
1889
- padding: 16px;
1890
- margin-bottom: 16px;
1891
- font-weight: 400;
1892
- color: #666666;
1893
- background: #f2f2f4;
1894
- font-size: 14px;
1895
- border-radius: 6px;
1896
- div + div {
1897
- margin-top: 4px;
1898
- }
1899
- span {
1900
- font-weight: 500;
1901
- color: #090909;
1902
- }
1903
- .score-result {
1904
- color: #2d7aff;
1905
- }
1906
- }
1907
- /deep/ .ant-spin-spinning {
1908
- height: 100%;
1909
- width: 100%;
1910
- padding-top: 88px;
1911
- }
1912
- /deep/ .ant-select ~ div {
1913
- position: relative !important;
1914
- }
1915
- // /deep/.ant-select-dropdown {
1916
- // top: 0px !important;
1917
- // left: 1px !important;
1918
- // }
1919
- .lb-title {
1920
- text-align: center;
1921
- }
1922
- .map-container {
1923
- cursor: pointer;
1924
- /deep/ .ant-input-disabled {
1925
- color: rgba(0, 0, 0, 0.65);
1926
- background-color: #fff;
1927
- cursor: pointer;
1928
- }
1929
- }
1930
- .linebar-div {
1931
- text-align: center;
1932
- margin-top: 24px;
1933
- /deep/ .ant-divider {
1934
- margin-top: -4px;
1935
- }
1936
- }
1937
- .my-prompt {
1938
- padding: 10px;
1939
- box-shadow: 0 5px 13px rgba(0, 0, 0, 0.14);
1940
- background-color: #fff;
1941
- border-radius: 4px;
1942
- }
1943
- .img-card {
1944
- width: 100%;
1945
- }
1946
- }
1947
- .main {
1948
- // overflow: auto;
1949
- // overflow-x: hidden;
1950
- padding: 0 16px;
1951
- box-sizing: border-box;
1952
- /deep/.ant-form-item-required::before {
1953
- color: #e02828;
1954
- }
1955
- .scale-label-required {
1956
- font-weight: 700;
1957
- }
1958
- .required-text {
1959
- color: #e02828;
1960
- }
1961
- .evalute-label {
1962
- display: inline-block;
1963
- height: 20px;
1964
- line-height: 20px;
1965
- padding: 0 5px;
1966
- margin-left: 4px;
1967
- font-size: 12px;
1968
- color: #2d7aff;
1969
- border-radius: 4px;
1970
- border: 1px solid rgba(45, 122, 255, 0.5);
1971
- background: rgba(45, 122, 255, 0.1);
1972
- }
1973
- .evalute-tip {
1974
- display: inline-block;
1975
- padding: 0 5px;
1976
- margin-left: 8px;
1977
- color: #fe9626;
1978
- border-radius: 2px;
1979
- background: rgba(255, 194, 0, 0.15);
1980
- cursor: pointer;
1981
- .ant-icon {
1982
- margin-right: 2px;
1983
- }
1984
- }
1985
- /deep/ .ant-form-item-label {
1986
- // white-space: break-spaces;
1987
- white-space: unset;
1988
- text-align: left;
1989
- line-height: 20px;
1990
- padding: 6px 0;
1991
- width: 100%;
1992
- .ant-form-item-no-colon {
1993
- width: 100%;
1994
- }
1995
- }
1996
- }
1997
- .footer {
1998
- position: absolute;
1999
- bottom: 0;
2000
- left: 0;
2001
- width: 100%;
2002
- border-top: 1px solid #e8e8e8;
2003
- padding-top: 12px;
2004
- height: 50px;
2005
- box-sizing: border-box;
2006
- background: #fff;
2007
- }
2008
- .rich-text-content {
2009
- word-break: break-all;
2010
- /deep/ p {
2011
- margin-bottom: 0;
2012
- }
2013
- /deep/ img {
2014
- max-width: 100%;
2015
- }
2016
- }
2017
- </style>
1
+ <template>
2
+ <div class="r-scale">
3
+ <slot v-if="spinning">
4
+ <a-spin :indicator="indicator" tip="加载中..." />
5
+ </slot>
6
+ <slot v-if="!spinning && !hasFrontAddress">
7
+ <!-- <div v-if="noData">暂无数据</div> -->
8
+ <NoData v-if="noData" :noDataImg="noDataImg" :noDataTip="noDataTip"></NoData>
9
+ <template v-else>
10
+ <evaluatePage
11
+ v-if="showEvaluateEntry"
12
+ :formArray="formArray"
13
+ :evaluateResultConfig="config.evaluateResultConfig"
14
+ :evaluateResultSetting="config.evaluateResultSetting"
15
+ :isFinished="isFinished"
16
+ :maxScore="maxScore"
17
+ @writeGuage="writeGuage"
18
+ ></evaluatePage>
19
+ <template v-else>
20
+ <evaluateCountdown
21
+ v-if="showEvaluateCoundownPage"
22
+ ref="evaluateCountdown"
23
+ :formArray="formArray"
24
+ :evaluateResultConfig="config.evaluateResultConfig"
25
+ :evaluateResultSetting="config.evaluateResultSetting"
26
+ :form="form"
27
+ :isFinished="isFinished"
28
+ :currentTime="currentTime"
29
+ :showEvaluateCountdown="showEvaluateCountdown"
30
+ @closeEvaluateCountdown="closeEvaluateCountdown"
31
+ ></evaluateCountdown>
32
+ <div
33
+ class="scale-container"
34
+ :class="{ 'scale-container-nopadding': handlePageClass }"
35
+ :style="scaleStyle"
36
+ >
37
+ <div class="totalScore-warp" v-if="hasScore">
38
+ <div>
39
+ 测评总分:
40
+ <span>{{ maxScore }}分</span>
41
+ </div>
42
+ <div>
43
+ 测评分数:
44
+ <span :style="{ color: getEvaResColor }">{{ config.totalScore }}分</span>
45
+ </div>
46
+ <template v-if="hasEvaluateSetting">
47
+ <div>
48
+ 测评结果:
49
+ <span
50
+ class="score-result"
51
+ :style="{ color: getEvaResColor }"
52
+ >{{ config.evaluateResult }}</span>
53
+ </div>
54
+ <div>
55
+ 结果说明:
56
+ <span>{{ config.evaluateResultExplain }}</span>
57
+ </div>
58
+ </template>
59
+ </div>
60
+ <a-form-model
61
+ ref="ruleForm"
62
+ :model="form"
63
+ :rules="rules"
64
+ :layout="form.layout"
65
+ :colon="false"
66
+ class="main"
67
+ >
68
+ <template v-for="(item, index) in formArray">
69
+ <!-- 标题 -->
70
+ <template v-if="item.type == 'TITLE'">
71
+ <a-form-model-item
72
+ v-if="isShowItem(item)"
73
+ :colon="false"
74
+ :key="item.id || item.seq"
75
+ >
76
+ <h1 class="lb-title">{{ item.title }}</h1>
77
+ <div class="lb-title">{{ item.describe }}</div>
78
+ </a-form-model-item>
79
+ </template>
80
+ <!-- 分线栏 -->
81
+ <template v-else-if="item.type == 'LINEBAR'">
82
+ <a-form-model-item
83
+ v-if="isShowItem(item)"
84
+ :colon="false"
85
+ :key="item.id || item.seq"
86
+ >
87
+ <div class="linebar-div" v-if="item.title">
88
+ <span>{{ item.title }}</span>
89
+ <a-divider />
90
+ </div>
91
+ <template v-else>
92
+ <a-divider />
93
+ </template>
94
+ </a-form-model-item>
95
+ </template>
96
+ <!-- 提示语 -->
97
+ <template v-else-if="item.type == 'PROMPT'">
98
+ <a-form-model-item
99
+ v-if="isShowItem(item)"
100
+ class="my-prompt"
101
+ :colon="false"
102
+ :key="item.id || item.seq"
103
+ >
104
+ <MyPrompt :key="item.id || item.seq" :options="item.setting" />
105
+ </a-form-model-item>
106
+ </template>
107
+ <template v-else-if="item.type == 'IMGCARD'">
108
+ <a-form-model-item
109
+ v-if="isShowItem(item)"
110
+ :colon="false"
111
+ :key="item.id || item.seq"
112
+ >
113
+ <a v-if="item.setting.imgLink" :href="item.setting.imgLink" target="_blank">
114
+ <img class="img-card" :src="item.setting.imgUrl" />
115
+ </a>
116
+ <img class="img-card" v-else :src="item.setting.imgUrl" />
117
+ </a-form-model-item>
118
+ </template>
119
+ <!-- 富文本 -->
120
+ <template v-else-if="item.type == 'RICH_TEXT'">
121
+ <div
122
+ :key="item.id || item.seq"
123
+ class="rich-text-content"
124
+ v-html="item.setting.defaultValue"
125
+ ></div>
126
+ </template>
127
+ <template v-else>
128
+ <a-form-model-item
129
+ v-if="isShowItem(item)"
130
+ :key="item.id || item.seq"
131
+ :prop="formKey(item)"
132
+ >
133
+ <span slot="label">
134
+ <span
135
+ :class="{ 'scale-label-required': isFormBoldOpen(item) }"
136
+ v-html="handleShowQuestionNumber(item)"
137
+ ></span>
138
+ <span class="required-text" v-if="isFormBoldOpen(item)">(必填)</span>
139
+ <span
140
+ class="evalute-label"
141
+ v-if="showEvaluateLabel(item)"
142
+ >{{ showEvaluateLabel(item) }}</span>
143
+ <template v-if="showEvatip(item)">
144
+ <span class="evalute-tip" @click="showEvaTipModal(item)">
145
+ <svg-icon icon-class="a-xitongtubiaotishi" />查看提示
146
+ </span>
147
+ </template>
148
+ </span>
149
+ <!-- 输入框 -->
150
+ <MyInput
151
+ v-bind="$attrs"
152
+ v-if="isInput(item.type)"
153
+ v-model="form[formKey(item)]"
154
+ :eleType="item.type"
155
+ :type="item.valueType"
156
+ :row="item.setting.inputRow || 1"
157
+ :defaultPlaceHolder="item.setting.defaultPlaceHolder"
158
+ :isLock="componentDisable"
159
+ />
160
+
161
+ <!-- 单选/下拉/多选/级联 -->
162
+ <MyChoice
163
+ v-bind="$attrs"
164
+ v-else-if="isChoice(item.type)"
165
+ v-model="form[formKey(item)]"
166
+ :item="item"
167
+ :isLock="componentDisable"
168
+ :curIndex="index"
169
+ :openType="openType"
170
+ @change="handleChoice($event, item)"
171
+ @radioChange="radioChange"
172
+ @checkboxChange="checkboxChange"
173
+ />
174
+ <!-- 日期/时间 -->
175
+ <MyTime
176
+ v-bind="$attrs"
177
+ v-else-if="isTime(item.type)"
178
+ :value="getTimeValue(item)"
179
+ :type="item.type"
180
+ :startToStop="item.setting.startToStop"
181
+ :dateType="item.setting.dateType"
182
+ :isLock="componentDisable"
183
+ @change="changeTime($event, item)"
184
+ />
185
+ <!-- 上传附件 or 图片 -->
186
+ <MyUpload
187
+ v-bind="$attrs"
188
+ v-else-if="isUpload(item.type)"
189
+ :upType="item.type"
190
+ :useFileList="item.dbValue"
191
+ :limitPic="item.setting.limitPic"
192
+ :isLock="componentDisable"
193
+ @change="changeUpload($event, item)"
194
+ />
195
+ <!-- 地图 -->
196
+ <div
197
+ v-else-if="item.type === 'LOCATION'"
198
+ @click="!isLock && (mapVisible = !mapVisible)"
199
+ :class="{ 'map-container': !isLock }"
200
+ >
201
+ <a-input
202
+ placeholder="请选择"
203
+ :value="handleGetAddress(form[formKey(item)])"
204
+ disabled
205
+ >
206
+ <a-icon slot="prefix" type="info-circle" />
207
+ </a-input>
208
+ <MapComp
209
+ v-bind="$attrs"
210
+ :visible.sync="mapVisible"
211
+ :locationProp="form[formKey(item)]"
212
+ :isLock="componentDisable"
213
+ @selectLocation="handleSelectLocation($event, item)"
214
+ />
215
+ </div>
216
+ <!-- 地址 -->
217
+ <MyAddress
218
+ v-bind="$attrs"
219
+ v-else-if="item.type === 'ADDRESS'"
220
+ :setting="item.setting"
221
+ :defaultValue="form[formKey(item)]"
222
+ :isLock="componentDisable"
223
+ @change="changeAddress($event, item)"
224
+ />
225
+ <!-- 标签 -->
226
+ <label-form
227
+ v-bind="$attrs"
228
+ v-else-if="item.type === 'LABEL'"
229
+ :item="item"
230
+ :selectedList="labelSelectedList"
231
+ :isLock="componentDisable"
232
+ :sourceType="source"
233
+ @onChange="labelChange($event, item)"
234
+ />
235
+ <!-- 视频 -->
236
+ <vod-Chunk-upload
237
+ v-bind="$attrs"
238
+ v-else-if="item.type === 'VEDIO'"
239
+ :source="'guage'"
240
+ :formData="item"
241
+ :limitNum="item.setting.limitPic"
242
+ :defFileList="form[formKey(item)]"
243
+ :isLock="componentDisable"
244
+ @vodFileList="vodFileList($event, item)"
245
+ />
246
+ <!-- 签名 -->
247
+ <MySign v-else-if="item.type =='SIGN'" :form="form" :item="item" :isLock="componentDisable" @scaleChange="signChange"></MySign>
248
+ <!-- 答案解析 -->
249
+ <answerParse v-if="showAnswerParse(item)" :item="item"></answerParse>
250
+
251
+ </a-form-model-item>
252
+ </template>
253
+ </template>
254
+ </a-form-model>
255
+ </div>
256
+ <template v-if="type === 'customList'">
257
+ <div class="footer" v-if="!noBtn">
258
+ <a-button @click="cancel" v-if="false" style="margin-right: 8px;">取消</a-button>
259
+ <a-button @click="onSubmit" type="primary" :disabled="banSubmit">保存</a-button>
260
+ </div>
261
+ </template>
262
+ <template v-else>
263
+ <div class="footer" v-if="showSaveBtn">
264
+ <a-button @click="cancel" style="margin-right: 8px;">取消</a-button>
265
+ <a-button type="primary" v-if="!isLock" @click="onSubmit" :disabled="banSubmit">保存</a-button>
266
+ </div>
267
+ </template>
268
+ </template>
269
+ </template>
270
+ </slot>
271
+ </div>
272
+ </template>
273
+ <script>
274
+ import { Icon, Checkbox, Tree, Tooltip, Input, Spin, FormModel, Divider, Button } from 'ant-design-vue';
275
+ import create from '@/core/create';
276
+ import { MyChoice, MyInput, MyAddress, MyUpload, MyTime, MyPrompt, MySign } from './formitem';
277
+ import MapComp from '../map/src/popup-map';
278
+ import labelForm from '~/select-label/select-label';
279
+ import vodChunkUpload from '~/upload/chunk-upload/vod-chunk-upload.vue';
280
+ // import { EventBus } from "@/common/utils/eventBus.js";
281
+ import { judgeTypes } from './mixin/judgeTypes';
282
+ import NoDataJs from './mixin/NoData';
283
+ // import { mapGetters } from "vuex";
284
+ import moment from 'moment';
285
+ import utils from '@/utils/utils-map';
286
+ import evaluatePage from './evaluatePage.vue';
287
+ import evaluateCountdown from './evaluateCountdown.vue';
288
+ import answerParse from './answerParse.vue';
289
+ import vexutils from '@/utils/vexutils';
290
+ import NoData from './NoData.vue';
291
+ import addressVal from './mixin/addressVal'
292
+ export default create({
293
+ name: 'scale-view',
294
+ mixins: [judgeTypes, NoDataJs, addressVal],
295
+ props: {
296
+ ids: {
297
+ type: Object,
298
+ default: () => {
299
+ return { guage_id: '', db_id: undefined };
300
+ }
301
+ },
302
+ params: { default: () => ({}), type: Object },
303
+ guageData: { type: Object, default: () => ({}) },
304
+ noBtn: { type: Boolean, default: false },
305
+ hideBtn: { type: Boolean, default: false },
306
+ source: { type: String, default: '' },
307
+ isLock: { type: Boolean, default: false },
308
+ type: {
309
+ type: String,
310
+ default: ''
311
+ },
312
+ styleSetting: {
313
+ type: Object,
314
+ default: () => ({})
315
+ },
316
+
317
+ fontSizeObj: {
318
+ type: Object,
319
+ default: () => ({
320
+ large: 1.25,
321
+ medium: 1.1,
322
+ small: 1,
323
+ extrasmall: 0.9
324
+ })
325
+ },
326
+ openType: { type: String, default: '' },
327
+ scaleApiConfig: {
328
+ type: Object,
329
+ default: () => ({})
330
+ }
331
+ },
332
+ components: {
333
+ MyChoice,
334
+ MyInput,
335
+ MapComp,
336
+ MyAddress,
337
+ MyUpload,
338
+ MyTime,
339
+ MyPrompt,
340
+ MySign,
341
+ labelForm,
342
+ vodChunkUpload,
343
+ [Icon.name]: Icon,
344
+ [Spin.name]: Spin,
345
+ [Tree.name]: Tree,
346
+ [Input.name]: Input,
347
+ [Input.Search.name]: Input.Search,
348
+ [Checkbox.name]: Checkbox,
349
+ [Divider.name]: Divider,
350
+ [Button.name]: Button,
351
+ [FormModel.name]: FormModel,
352
+ [FormModel.Item.name]: FormModel.Item,
353
+ [Tooltip.name]: Tooltip,
354
+ evaluatePage,
355
+ evaluateCountdown,
356
+ answerParse,
357
+ NoData
358
+ },
359
+ computed: {
360
+ queryformBoldOpen() {
361
+ return this.$route.query?.formBoldOpen == 1;
362
+ },
363
+ showEvatip() {
364
+ return function (item) {
365
+ if (!this.isEvaluation(item.type)) return false;
366
+ return this.$route.query?.evatip == 1 || this.params?.evatip == 1;
367
+ };
368
+ },
369
+ isFormBoldOpen() {
370
+ return function (item) {
371
+ let res = item.required;
372
+ // 量表未登录时 判断 url中是否有 formBoldOpen
373
+ if (!this.styleSetting || !Object.keys(this.styleSetting).length || !('formBoldOpen' in this.styleSetting)) {
374
+ return res && this.queryformBoldOpen;
375
+ }
376
+ return res && this.styleSetting.formBoldOpen;
377
+ };
378
+ },
379
+ scaleStyle() {
380
+ let fontSize = this.fontSize;
381
+ if (!fontSize || fontSize === 'S') return null;
382
+ const keyValue = {
383
+ L: 'large',
384
+ M: 'medium',
385
+ XS: 'extrasmall'
386
+ };
387
+ fontSize = keyValue[fontSize];
388
+ const scale = (fontSize && this.fontSizeObj[fontSize]) || 1;
389
+ const size = 10000;
390
+ const value = Math.floor((100 / scale) * size) / size;
391
+ return {
392
+ width: `${value}%`,
393
+ height: `${value}%`,
394
+ transform: `scale(${scale})`
395
+ };
396
+ },
397
+ handlePageClass() {
398
+ if (this.type == 'customList' && !this.noBtn) return false;
399
+ if (!this.noBtn && !this.hideBtn) return false;
400
+ return true;
401
+ },
402
+ isShowItem() {
403
+ return item => this.showEvent(item);
404
+ },
405
+ handleShowQuestionNumber() {
406
+ return function (item) {
407
+ let { type } = item || {};
408
+ let tempTile = this.config?.autoQuestionNumber === false ? item.showTitle : `${item.softcode}、${item.showTitle}`;
409
+ tempTile = this.html2Escape(tempTile);
410
+ if (!this.isEvaluation(type)) return tempTile;
411
+
412
+ let score = this.handleEvaluationScore(item);
413
+ return `${tempTile}&nbsp;<span style="color:#2d7aff;">${score}</span>`;
414
+ // if (this.noBtn) {
415
+ // let score = this.handleEvaluationScore(item);
416
+ // return `${tempTile}&nbsp;<span style="color:#2d7aff;">${score}</span>`;
417
+ // }
418
+ // if (!this.isLock) {
419
+ // let score = this.handleEvaluationScore(item);
420
+ // return `${tempTile}&nbsp;<span style="color:#2d7aff;">${score}</span>`;
421
+ // }
422
+ // if (item.questionScore !== undefined) {
423
+ // return `${tempTile}&nbsp;<span style="color:#2d7aff;">(${item.questionScore}分)</span>`;
424
+ // }
425
+ // return tempTile;
426
+ };
427
+ },
428
+ hasScore() {
429
+ let { config } = this;
430
+ if (!config || !Object.keys(config).length) return false;
431
+ if ('totalScore' in config) return true;
432
+ return false;
433
+ },
434
+ // 预览按钮打开的量表页面
435
+ isPreviewScale() {
436
+ let guage_id = this.ids?.guage_id;
437
+ return guage_id && this.noBtn;
438
+ },
439
+ hasEvaluateSetting() {
440
+ let { config } = this;
441
+ if (!config || !Object.keys(config).length) return false;
442
+ if ('evaluateResult' in config && config.evaluateResult) return true;
443
+ return false;
444
+ },
445
+ getTimeValue() {
446
+ return function (item) {
447
+ let value = this.form[this.formKey(item)];
448
+ return value;
449
+ };
450
+ },
451
+ // 是否展示考试入口
452
+ showEvaluateEntry() {
453
+ // 非预览
454
+ // 有evaluateResultSetting || url中含有固定参数
455
+ // 倒计时未结束
456
+ // 未填写过
457
+ return !this.isPreviewScale && this.showEvaluatePage && this.showEvaluateSettingWrap && !this.isFinished && !this.noBtn && !this.hideBtn;
458
+ },
459
+ // 是否展示倒计时
460
+ showEvaluateCoundownPage() {
461
+ return !this.isPreviewScale && !this.showEvaluateEntry && this.showEvaluateCountdownWrap && !this.isFinished && !this.noBtn && !this.hideBtn;
462
+ },
463
+ // 是否设置 evaluateResultSetting
464
+ hasEvaluateResultSetting() {
465
+ let { evaluateResultSetting = {} } = this.config;
466
+ // 读取优先级为测评设置值(变量) > URL参数 > 测评设置值(固定值)
467
+ // 是否设置 evaluateResultSetting
468
+ let valueArr =
469
+ Object.values(evaluateResultSetting).filter(item => {
470
+ if (item) return true;
471
+ }) || [];
472
+ return valueArr.length;
473
+ },
474
+ hasparamsEvaluate() {
475
+ return this.paramsEvaluate && Object.keys(this.paramsEvaluate).length;
476
+ },
477
+ // url中是否有默认值
478
+ hasDefault() {
479
+ let hash = window.location.hash;
480
+ let defaultVariable = ['evaname', 'evadesc', 'evast', 'evadur', 'evaan'];
481
+ let hasDefault = defaultVariable.find(item => hash.includes(item));
482
+ return this.paramsEvaluate || hasDefault;
483
+ },
484
+ // 是否有提交按钮
485
+ showSaveBtn() {
486
+ // 无测评设置 && url中无固定参数
487
+ if (!this.hasEvaluateResultSetting && !this.hasDefault) {
488
+ return !this.noBtn && !this.hideBtn;
489
+ }
490
+ return !this.noBtn && !this.hideBtn && !this.isFinished;
491
+ },
492
+ // 组件是否 Disable
493
+ componentDisable() {
494
+ // 无测评设置 && url中无固定参数
495
+ if (!this.hasEvaluateResultSetting && !this.hasDefault) {
496
+ return this.hideBtn || this.isLock;
497
+ }
498
+ return this.hideBtn || this.isLock || this.isFinished;
499
+ },
500
+ showEvaluateLabel() {
501
+ return function (item) {
502
+ let obj = {
503
+ EVALUATE_RADIO_BLOCK: '单选题',
504
+ EVALUATE_CHECKBOX_BLOCK: '多选题'
505
+ };
506
+ return obj[item.type];
507
+ };
508
+ },
509
+ showAnswerParse() {
510
+ return function (item) {
511
+ let { evaluateAnswer, checkAnswerMode, evaluateStartTime, evaluateTime } = this.config?.evaluateResultSetting || {};
512
+ let arr = ['EVALUATE_RADIO_BLOCK', 'EVALUATE_CHECKBOX_BLOCK', 'EVALUATE_SELECT', 'EVALUATE_INPUT'];
513
+ let maxScore = item?.scoreConfigs || 0;
514
+ let isShow = evaluateAnswer && this.isFinished && arr.includes(item.type) && maxScore;
515
+ if (!evaluateStartTime || !evaluateTime || (checkAnswerMode && checkAnswerMode == 1)) return isShow;
516
+ if (!vexutils.isValidDate(new Date(evaluateStartTime))) return isShow;
517
+ // 答案解析时间 考试时间结束后
518
+ let endTime = moment(evaluateStartTime).add(evaluateTime, 'minutes');
519
+ let isRang = endTime.diff(moment(), 'seconds', true);
520
+ return isShow && isRang <= 0;
521
+ };
522
+ },
523
+ tipMsg() {
524
+ return this.type === 'customList' ? '保存' : '提交';
525
+ },
526
+ formKey() {
527
+ return function (item) {
528
+ return item.databaseTitle || item.title;
529
+ };
530
+ },
531
+ getEvaResColor() {
532
+ let { evaluateResultConfig = [], totalScore } = this.config || {};
533
+ totalScore = +totalScore || 0;
534
+ if (!evaluateResultConfig?.length || !totalScore) return '#2474FF';
535
+ let matchItem = evaluateResultConfig.find(item => item.startScore <= totalScore && totalScore <= item.endScore);
536
+ if (!matchItem) return '#2474FF';
537
+ return matchItem.color || '#2474FF';
538
+ }
539
+ },
540
+ watch: {
541
+ ids: {
542
+ immediate: true,
543
+ deep: true,
544
+ handler(newVal, oldVal) {
545
+ if (oldVal) {
546
+ if (newVal.guage_id) {
547
+ if (newVal.guage_id != oldVal.guage_id) {
548
+ this.init(newVal);
549
+ }
550
+ }
551
+ } else {
552
+ if (newVal.guage_id) this.init(newVal);
553
+ }
554
+ }
555
+ },
556
+ guageData: {
557
+ immediate: true,
558
+ deep: true,
559
+ handler(value) {
560
+ if (value) {
561
+ if (Object.keys(value || {}).length) {
562
+ // guageForm打开 重新请求重置之前的答案
563
+ this.form = {};
564
+ this.formArray = [];
565
+ const data = JSON.parse(JSON.stringify(value));
566
+ this.$nextTick(() => {
567
+ this.initForm(data);
568
+ });
569
+ }
570
+ }
571
+ }
572
+ }
573
+ },
574
+ data() {
575
+ return {
576
+ other: '',
577
+ form: {},
578
+ submitForm: {},
579
+ rules: {},
580
+ config: {},
581
+ formArray: [],
582
+ mapVisible: false,
583
+ mapLocation: '',
584
+ labelSelectedList: [],
585
+ defaultFormArray: [],
586
+ fontSize: '',
587
+ filterArr: ['SUCCESS_TIP', 'CALLBACK_INTERFACE', 'SPREAD_PARAMS', 'REDIRECT', 'FRONT_ADDRESS', 'RETURN_PATH'],
588
+ spinning: true,
589
+ indicator: <a-icon type="loading" style="font-size: 24px" spin />,
590
+ totalScore: undefined,
591
+ shareId: '',
592
+ currentTime: moment(),
593
+ showEvaluatePage: false,
594
+ showEvaluateSettingWrap: true,
595
+ showEvaluateCountdownWrap: false,
596
+ showEvaluateCountdown: false,
597
+ banSubmit: false,
598
+ isFinished: false,
599
+ maxScore: 0,
600
+ originConfig: {},
601
+ paramsEvaluate: null,
602
+ hasFrontAddress: true,
603
+ choiceComObj: {},
604
+ evatipMap: {} // 维护一个tip map避免重复请求
605
+ };
606
+ },
607
+ mounted() {
608
+ this.handleQuery();
609
+ if (this.noBtn) {
610
+ // EventBus.$on("guageSubmit", this.onSubmit);
611
+ }
612
+ },
613
+ beforeDestroy() {
614
+ // EventBus.$off("guageSubmit");
615
+ },
616
+ methods: {
617
+ init(configData) {
618
+ this.spinning = true;
619
+ try {
620
+ this.resetNodata();
621
+ this.initForm(configData);
622
+ } catch (error) {
623
+ this.spinning = false;
624
+ this.hasFrontAddress = false;
625
+ this.setNoData(true, error?.resultMsg, error?.result);
626
+ }
627
+ },
628
+ handleQuery() {
629
+ let { id } = this.$route.query;
630
+ id && (this.shareId = id);
631
+ },
632
+ initForm(data) {
633
+ this.getProvinceData()
634
+ let { list = [], map = {}, isFinished = false } = data;
635
+ let curUrl = this.handleFrontAddress(list);
636
+ if (curUrl) {
637
+ window.location.href = curUrl;
638
+ return;
639
+ }
640
+ map.maxScore && (this.maxScore = map.maxScore);
641
+ this.isFinished = isFinished;
642
+ if (data.isNotFilled) {
643
+ this.spinning = false;
644
+ this.hasFrontAddress = false;
645
+ this.setNoData(true, '未查询到量表填写记录');
646
+ return;
647
+ }
648
+ if (data.isLackCustomer) {
649
+ let _this = this;
650
+ // 校验用户环境
651
+ this.$info({
652
+ title: '已设置填写次数限制',
653
+ content: '请在包含用户信息的环境中打开此量表',
654
+ onOk() {
655
+ _this.$emit('onCloseSetting');
656
+ }
657
+ });
658
+ }
659
+ this.config = map;
660
+
661
+ if ('evaluateResultConfig' in map && utils.isJSON(map.evaluateResultConfig)) {
662
+ this.config.evaluateResultConfig = JSON.parse(map.evaluateResultConfig);
663
+ }
664
+ if ('evaluateResultSetting' in map && utils.isJSON(map.evaluateResultSetting)) {
665
+ this.config.evaluateResultSetting = JSON.parse(map.evaluateResultSetting);
666
+ // 随机测评
667
+ if (this.config?.randomId && this.config.evaluateResultSetting) {
668
+ this.config.evaluateResultSetting.evaluateName = this.config.name;
669
+ this.config.evaluateResultSetting.evaluateExplain = this.config.remark;
670
+ }
671
+ }
672
+
673
+ this.originConfig = JSON.parse(JSON.stringify(this.config));
674
+
675
+ if (this.params && Object.keys(this.params).length) {
676
+ let res = this.handleBtnParamsEvaluate(this.params);
677
+ res && Object.keys(res).length && (this.paramsEvaluate = res);
678
+ }
679
+
680
+ this.handleEvaluateParams(this.config.evaluateResultSetting);
681
+ this.handleShowEvaluate();
682
+
683
+ this.defaultFormArray = JSON.parse(JSON.stringify(list));
684
+ let filterArr = this.filterArr;
685
+ list = list.filter(v => !filterArr.includes(v.type));
686
+ this.formArray = this.formatArray(list || []);
687
+ this.form = this.defaultFormValue(this.formArray);
688
+ this.rules = this.formatRules(this.formArray);
689
+ this.fontSize = data.fontSize;
690
+ this.spinning = false;
691
+ this.hasFrontAddress = false;
692
+ },
693
+ handleFrontAddress(list) {
694
+ if (!list || !list.length) return;
695
+ let matchItem = list.find(item => item.type === 'FRONT_ADDRESS');
696
+ if (!matchItem || !Object.keys(matchItem).length) return;
697
+ let setting;
698
+ if (matchItem.setting && utils.isJSON(matchItem.setting)) {
699
+ setting = JSON.parse(matchItem.setting);
700
+ }
701
+ if (!setting || !Object.keys(setting).length) return;
702
+ let query = this.handleQueryParams();
703
+ // redirect=1 代表从前置地址跳转回来了
704
+ if (query?.redirect == 1) return;
705
+ let { frontAddress } = setting;
706
+ if (frontAddress) {
707
+ let urlHref = window.location.href;
708
+ let preStr = '?';
709
+ if (frontAddress.includes('?')) {
710
+ preStr = '&';
711
+ }
712
+ let curUrl = `${frontAddress}${preStr}redirect_url=${encodeURIComponent(urlHref)}`;
713
+ return curUrl;
714
+ }
715
+ },
716
+ handleBtnParamsEvaluate(params) {
717
+ let defaultVariable = ['evaname', 'evadesc', 'evast', 'evadur', 'evaan'];
718
+ let res = {};
719
+ for (let key in params) {
720
+ let value = params[key];
721
+ if (defaultVariable.includes(key) && value) {
722
+ res[key] = value;
723
+ }
724
+ }
725
+ return res;
726
+ },
727
+ /** *
728
+ * 解析测评参数
729
+ */
730
+ handleEvaluateParams(evaluateResultSetting) {
731
+ if (!evaluateResultSetting || !Object.keys(evaluateResultSetting).length) return;
732
+ // 分享测评量表链接URL支持传入测评名称-evaname 测评说明-evadesc 测评时间-evast 测评时长-evadur 固定参数
733
+ let query = this.handleQueryParams();
734
+ // 按钮传参
735
+ if (this.hasparamsEvaluate) {
736
+ query = this.paramsEvaluate;
737
+ }
738
+ let obj = {
739
+ evaluateName: 'evaname',
740
+ evaluateExplain: 'evadesc',
741
+ evaluateStartTime: 'evast',
742
+ evaluateTime: 'evadur',
743
+ evaluateAnswer: 'evaan'
744
+ };
745
+ for (let key in evaluateResultSetting) {
746
+ let value = evaluateResultSetting[key];
747
+ let isParseKey = value && key != 'evaluateAnswer' && typeof value === 'string' && value.includes('${');
748
+ if (isParseKey) {
749
+ let parseValue = value.replace(/\$\{([^}]+)\}/g, (_v, $1) => {
750
+ let param;
751
+ if ($1.startsWith('form.')) {
752
+ param = query[$1.split('.')[1]];
753
+ }
754
+ return param || '';
755
+ });
756
+ this.$set(evaluateResultSetting, key, parseValue);
757
+ } else {
758
+ let val = query[obj[key]];
759
+ if (key == 'evaluateAnswer') {
760
+ val = val === 'true' || val == 1 ? true : false;
761
+ }
762
+ query[obj[key]] && this.$set(evaluateResultSetting, key, val);
763
+ }
764
+ }
765
+ // 部分evaluateResultSetting 但是却有url
766
+ if (this.hasDefault) {
767
+ let defaultVariable = ['evaname', 'evadesc', 'evast', 'evadur', 'evaan'];
768
+ let defObj = {
769
+ evaname: 'evaluateName',
770
+ evadesc: 'evaluateExplain',
771
+ evast: 'evaluateStartTime',
772
+ evadur: 'evaluateTime',
773
+ evaan: 'evaluateAnswer'
774
+ };
775
+ defaultVariable.forEach(item => {
776
+ let key = defObj[item];
777
+ if (!evaluateResultSetting[key]) {
778
+ let val = query[item];
779
+ if (item == 'evaan') {
780
+ val = val === 'true' || val == 1 ? true : false;
781
+ }
782
+ query[item] && this.$set(evaluateResultSetting, key, val);
783
+ }
784
+ });
785
+ }
786
+ this.setEvaluateStartTime(evaluateResultSetting);
787
+ },
788
+ handleQueryParams() {
789
+ let params = {};
790
+ let hash = window.location.hash.split('?')[1]
791
+ if(!hash) {
792
+ hash= window.location.href.split('?')[1]
793
+ }
794
+ for (let [key, value] of new URLSearchParams(hash).entries()) {
795
+ params[key] = decodeURIComponent(value);
796
+ }
797
+ return params;
798
+ },
799
+ handleShowEvaluate() {
800
+ // 读取优先级为测评设置值(变量) > URL参数 > 测评设置值(固定值)
801
+ // 无 evaluateResultSetting
802
+ if (!this.hasEvaluateResultSetting) {
803
+ // url中是否有默认值
804
+ // 无默认值 不显示考试入口页面
805
+ if (!this.hasDefault) return false;
806
+ // 有默认值 显示考试入口页面
807
+ if (!('evaluateResultSetting' in this.config)) {
808
+ this.$set(this.config, 'evaluateResultSetting', {});
809
+ }
810
+ this.setDefaultEvaluate(this.config.evaluateResultSetting);
811
+ this.showEvaluatePage = true;
812
+ this.showEvaluateCountdownWrap = true;
813
+ return;
814
+ }
815
+
816
+ let { evaluateResultSetting = {} } = this.config;
817
+ if (!evaluateResultSetting || !Object.keys(evaluateResultSetting).length) return;
818
+ this.showEvaluateCountdownWrap = true;
819
+
820
+ // 只要有开始时间都显示测评组件
821
+ let { evaluateStartTime } = evaluateResultSetting;
822
+ let { evaluateName } = this.originConfig?.evaluateResultSetting || {};
823
+ // 未设置开始时间 一直可以填写
824
+ if (!evaluateStartTime) {
825
+ this.showEvaluatePage = true;
826
+ return;
827
+ }
828
+ if (!vexutils.isValidDate(new Date(evaluateStartTime))) {
829
+ if (!evaluateName) return false;
830
+ }
831
+ this.showEvaluatePage = true;
832
+ },
833
+ setDefaultEvaluate(evaluateResultSetting) {
834
+ let query = this.handleQueryParams();
835
+ // 按钮传参
836
+ if (this.hasparamsEvaluate) {
837
+ query = this.paramsEvaluate;
838
+ }
839
+ if (query.evaname) {
840
+ this.$set(evaluateResultSetting, 'evaluateName', query.evaname);
841
+ }
842
+ if (query.evadesc) {
843
+ this.$set(evaluateResultSetting, 'evaluateExplain', query.evadesc);
844
+ }
845
+ if (query.evast) {
846
+ this.$set(evaluateResultSetting, 'evaluateStartTime', query.evast);
847
+ }
848
+ if (query.evadur) {
849
+ this.$set(evaluateResultSetting, 'evaluateTime', query.evadur);
850
+ }
851
+ if (query.evaan) {
852
+ let evaan = query.evaan === 'true' || query.evaan == 1 ? true : false;
853
+ this.$set(evaluateResultSetting, 'evaluateAnswer', evaan);
854
+ }
855
+
856
+ this.setEvaluateStartTime(evaluateResultSetting);
857
+ },
858
+ // 时间戳需要是数字
859
+ setEvaluateStartTime(evaluateResultSetting) {
860
+ let evaluateStartTime = evaluateResultSetting?.evaluateStartTime;
861
+ if (!evaluateStartTime) return;
862
+ if (!vexutils.isValidDate(new Date(evaluateStartTime)) && vexutils.isValidDate(new Date(Number(evaluateStartTime)))) {
863
+ evaluateResultSetting.evaluateStartTime = Number(evaluateStartTime);
864
+ }
865
+ },
866
+ // 量表提交数据
867
+ defaultFormValue(formArray) {
868
+ const formData = {};
869
+ let val;
870
+ formArray.forEach(item => {
871
+ const key = this.formKey(item);
872
+ const { type } = item;
873
+ let defValue;
874
+ if (item.dbValue) {
875
+ defValue = item.dbValue;
876
+ } else {
877
+ if (item.setting?.defValType == 3) {
878
+ defValue = this.handleUrlDefaultValue(item)
879
+ }
880
+ }
881
+ switch (type) {
882
+ case 'LOCATION':
883
+ formData[key] = defValue || '';
884
+ break;
885
+ case 'SEARCH_CASCADE':
886
+ formData[key] = defValue || [];
887
+ break;
888
+ case 'ADDRESS':
889
+ formData[key] = defValue || item?.setting?.defaultValue|| {};
890
+ break;
891
+ case 'LABEL':
892
+ formData[key] = defValue || {};
893
+ if (vexutils.isObject(defValue)) {
894
+ this.labelSelectedList = defValue?.labels || [];
895
+ } else if (Array.isArray(defValue)) {
896
+ this.labelSelectedList = defValue;
897
+ } else {
898
+ this.labelSelectedList = [];
899
+ }
900
+ break;
901
+ case 'TITLE':
902
+ formData[key] = item.title;
903
+ break;
904
+ case 'IMGCARD':
905
+ formData[key] = item.setting?.imgUrl || '';
906
+ break;
907
+ case 'UPFILE':
908
+ case 'UPPICTURE':
909
+ formData[key] = defValue || [];
910
+ break;
911
+ // 自定义列表特殊处理
912
+ case 'CHECKBOX_BLOCK':
913
+ if (defValue && !Array.isArray(defValue) && this.type === 'customList') {
914
+ formData[key] = defValue.split(',').filter(ii => !!ii);
915
+ } else {
916
+ formData[key] = this.parseVal(defValue, item);
917
+ }
918
+ break;
919
+ case 'MOBILE':
920
+ val = this.parseVal(defValue, item)
921
+ if(val && typeof val === 'string' && val.length > 11) {
922
+ val = val.slice(0, 11)
923
+ }
924
+ formData[key] = val;
925
+ break;
926
+ default:
927
+ formData[key] = this.parseVal(defValue, item);
928
+ break;
929
+ }
930
+ });
931
+ return formData;
932
+ },
933
+ // 解析传参组件
934
+ compileSpreadParams(spreadParams) {
935
+ return spreadParams.domains.map(v => {
936
+ let obj = {};
937
+ if (v.valueType == '1') {
938
+ obj[v.name] = v.value;
939
+ } else if (v.valueType == '2') {
940
+ obj[v.name] = this.getQueryVariable(v.value);
941
+ }
942
+ return obj;
943
+ });
944
+ },
945
+ // 获取url链接参数
946
+ getQueryVariable(variable) {
947
+ let query = {};
948
+ if (this.source == 'layout') {
949
+ // 按钮传参
950
+ query = this.params;
951
+ } else {
952
+ query = this.handleQueryParams() || {};
953
+ }
954
+ if (!query) return false;
955
+ return query[variable] || false;
956
+ },
957
+ // 初始化量表
958
+ formatArray(list) {
959
+ let i = 1;
960
+ const results = list.map(item => {
961
+ const key = this.formKey(item);
962
+ let title = (key || '').replace(/\n/g, '');
963
+ this.$set(item, 'showTitle', item.title);
964
+ // 表单校验rule prop如果有 . 会报错, 替换成 ~-~
965
+ if (title.includes('.')) {
966
+ let newTitle = title.replace(/\./g, '~-~');
967
+ this.$set(item, 'title', newTitle);
968
+ }
969
+ this.$set(item, 'isShow', true);
970
+ Object.keys(item).forEach(key => {
971
+ if (utils.isJSON(item[key])) {
972
+ if (item.type != 'LOCATION') {
973
+ item[key] = JSON.parse(item[key]);
974
+ }
975
+ }
976
+ });
977
+ const notIndexArr = ['LINEBAR', 'TITLE', 'PROMPT', 'IMGCARD', 'RICH_TEXT'];
978
+ if (notIndexArr.indexOf(item.type) < 0 && !item.hide) {
979
+ this.$set(item, 'softcode', i++);
980
+ }
981
+
982
+ // "RADIO_BLOCK", "CHECKBOX_BLOCK" 将取值value改为key
983
+ if (this.isChoice(item.type)) {
984
+ this.handleFormatOptions(item.options, item.type);
985
+ if (item.type != 'SEARCH_CASCADE') {
986
+ if (item.dbValue) {
987
+ this.nextLogicEvent(item.dbValue, item, results, true);
988
+ } else {
989
+ if (item.setting.defaultValue) {
990
+ this.nextLogicEvent(item.setting.defaultValue, item, results, true);
991
+ }
992
+ }
993
+ }
994
+ }
995
+ return item;
996
+ });
997
+ return results.map(item => {
998
+ // 题目关联
999
+ let relationLogicObj = utils.isString(item.relationLogic) ? JSON.parse(item.relationLogic) : item.relationLogic;
1000
+ this.handleRelationLogic(list, relationLogicObj);
1001
+
1002
+ // 跳题逻辑
1003
+ this.handLenextLogic(item);
1004
+
1005
+ // 自定义列表特殊处理
1006
+ if (item.type === 'CHECKBOX_BLOCK' && item.dbValue && !Array.isArray(item.dbValue) && this.type === 'customList') {
1007
+ item.dbValue = item.dbValue.split(',').filter(ii => !!ii);
1008
+ }
1009
+ return item;
1010
+ });
1011
+ },
1012
+ /**
1013
+ * "RADIO_BLOCK", "CHECKBOX_BLOCK" 将取值value改为key, relationLogic需要重新处理
1014
+ */
1015
+ handleRelationLogic(list, relationLogicObj) {
1016
+ let { condition } = relationLogicObj || {};
1017
+ if (!condition || !condition.length) return;
1018
+ condition.forEach(c => {
1019
+ let matchItem = list.find(f => f.seq == c.subject_seq);
1020
+ if (!matchItem) return;
1021
+ let isChoice = this.isRadioOrCheckBox(matchItem.options, matchItem.type);
1022
+ if (!isChoice) return;
1023
+ let value = c.value;
1024
+ if (Array.isArray(value)) {
1025
+ value = value.map(v => {
1026
+ return this.replaceConditionItem(matchItem.options, v);
1027
+ });
1028
+ c.value = value;
1029
+ } else {
1030
+ c.value = this.replaceConditionItem(matchItem.options, value);
1031
+ }
1032
+ });
1033
+ },
1034
+ /**
1035
+ * "RADIO_BLOCK", "CHECKBOX_BLOCK" 将取值value改为key, nextLogic需要重新处理
1036
+ */
1037
+ handLenextLogic(item) {
1038
+ let { nextLogic, options, type } = item || {};
1039
+ let isChoice = this.isRadioOrCheckBox(options, type);
1040
+ if (!nextLogic || !isChoice) return;
1041
+ let { condition } = nextLogic || {};
1042
+ if (!condition || !condition.length) return;
1043
+ condition.forEach(c => {
1044
+ let value = c.value;
1045
+ if (Array.isArray(value)) {
1046
+ value = value.map(v => {
1047
+ return this.replaceConditionItem(options, v);
1048
+ });
1049
+ c.value = value;
1050
+ } else {
1051
+ c.value = this.replaceConditionItem(options, value);
1052
+ }
1053
+ });
1054
+ },
1055
+ replaceConditionItem(options, value) {
1056
+ let matchOption = options.find(v => value === v.value);
1057
+ if (!matchOption) return value;
1058
+ return matchOption.key;
1059
+ },
1060
+ isRadioOrCheckBox(options, type) {
1061
+ let typeArr = ['RADIO_BLOCK', 'CHECKBOX_BLOCK'];
1062
+ if (!typeArr.includes(type)) return;
1063
+ if (!options) return;
1064
+ if (options && utils.isJSON(options)) {
1065
+ options = JSON.parse(options);
1066
+ }
1067
+ if (!options.length) return;
1068
+ return true;
1069
+ },
1070
+ handleFormatOptions(options, type) {
1071
+ let isChoice = this.isRadioOrCheckBox(options, type);
1072
+ if (!isChoice) return;
1073
+
1074
+ options.forEach((item, i) => {
1075
+ if (item.key !== 'other') {
1076
+ item.key = i + 1;
1077
+ }
1078
+ if (item.prefix || item.suffix) {
1079
+ item.value = item.prefix || item.suffix;
1080
+ }
1081
+ });
1082
+ },
1083
+ // 初始化rules
1084
+ formatRules(formArray) {
1085
+ const rules = {};
1086
+ formArray.forEach(item => {
1087
+ let newTitle = this.formKey(item);
1088
+ // 表单校验rule prop如果有 . 会报错, 替换成 ~-~
1089
+ if (newTitle.includes('.')) {
1090
+ newTitle = newTitle.replace(/\./g, '~-~');
1091
+ }
1092
+ rules[newTitle] = [{ required: item.required, message: '必填', trigger: 'change' }];
1093
+ if (item.type == 'MOBILE' && item.validation) {
1094
+ rules[newTitle].push({
1095
+ pattern: /^1[3456789]\d{9}$/,
1096
+ message: '格式错误',
1097
+ trigger: 'blur'
1098
+ });
1099
+ } else if (item.type == 'ID_CARD' && item.validation) {
1100
+ rules[newTitle].push({
1101
+ pattern: /^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9]|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}))$/,
1102
+ message: '格式错误',
1103
+ trigger: 'blur'
1104
+ });
1105
+ } else if (item.type == 'ADDRESS' && item.required) {
1106
+ if (this.handleAddressType(item)) {
1107
+ rules[newTitle].push({
1108
+ validator: this.checkAdress,
1109
+ trigger: 'change'
1110
+ });
1111
+ }
1112
+ } else if (item.type == 'LABEL' && item.required) {
1113
+ rules[newTitle].push({
1114
+ validator: this.checkLabel,
1115
+ trigger: 'change'
1116
+ });
1117
+ } else if (item.type == 'DATETIME' && this.type == 'customList') {
1118
+ // 自定义列表特殊处理日期时间 最大值
1119
+ // dateMaxType 1当前日期时间 2指定日期时间 3其他日期时间字段
1120
+ let dateMaxType = this.handleDateMaxType(item);
1121
+ if (!dateMaxType) return;
1122
+ let obj = {
1123
+ 1: 'checkDateMaxCur',
1124
+ 2: 'checkDateMaxSet',
1125
+ 3: 'checkDateMaxOther'
1126
+ };
1127
+ let methodName = obj[dateMaxType];
1128
+ rules[newTitle].push({
1129
+ validator: (rule, value, callback) => this[methodName](rule, value, callback, item),
1130
+ trigger: 'change'
1131
+ });
1132
+ } else if (item.type === 'RADIO_BLOCK') {
1133
+ this.choiceComObj[this.formKey(item)] = {};
1134
+ rules[newTitle].push({
1135
+ validator: (rule, value, callback) => this.checkRadio(rule, value, callback, item),
1136
+ trigger: 'change'
1137
+ });
1138
+ } else if (item.type === 'CHECKBOX_BLOCK') {
1139
+ this.choiceComObj[this.formKey(item)] = {};
1140
+ rules[newTitle].push({
1141
+ validator: (rule, value, callback) => this.checkCheckbox(rule, value, callback, item),
1142
+ trigger: 'change'
1143
+ });
1144
+ }
1145
+ });
1146
+ return rules;
1147
+ },
1148
+ handleAddressType(item) {
1149
+ let setObj = { addressType: 'province-city-district-address' };
1150
+ if (utils.isJSON(item.setting)) {
1151
+ setObj = JSON.parse(item.setting);
1152
+ } else {
1153
+ setObj = item.setting;
1154
+ }
1155
+ let isAdress = setObj.addressType.includes('address');
1156
+ return isAdress;
1157
+ },
1158
+ checkAdress(rule, value, callback) {
1159
+ let { address } = value || {};
1160
+ if (!address) {
1161
+ return callback(new Error('必填'));
1162
+ }
1163
+ callback();
1164
+ },
1165
+ checkLabel(rule, value, callback) {
1166
+ if (!value || !Object.keys(value).length) {
1167
+ return callback(new Error('必填'));
1168
+ }
1169
+ let { labelStr, labels = [] } = value;
1170
+ if (!labelStr || !labels.length) {
1171
+ return callback(new Error('必填'));
1172
+ }
1173
+ callback();
1174
+ },
1175
+ handleDateMaxType(item) {
1176
+ let setObj = item.setting;
1177
+ if (utils.isJSON(setObj)) {
1178
+ setObj = JSON.parse(setObj);
1179
+ }
1180
+ return setObj.dateMaxType;
1181
+ },
1182
+ // 自定义列表 日期时间 max 当前日期时间
1183
+ checkDateMaxCur(rule, value, callback, item) {
1184
+ if (!value) return callback();
1185
+ let { dateType } = item.setting;
1186
+ if (!dateType) return callback();
1187
+ let dateMaxValue = this.currentTime;
1188
+ if (dateType == 'time') {
1189
+ dateMaxValue = this.currentTime.format('HH:mm:ss');
1190
+ }
1191
+ let isMax = this.handleMax(dateType, value, dateMaxValue);
1192
+ if (!isMax) {
1193
+ return callback(new Error('最大不能超过当前日期时间'));
1194
+ }
1195
+ callback();
1196
+ },
1197
+ // 自定义列表 日期时间 max 指定日期时间
1198
+ checkDateMaxSet(rule, value, callback, item) {
1199
+ if (!value) return callback();
1200
+ let { dateMaxValue, dateType } = item.setting;
1201
+ if (!dateMaxValue || !dateType) return callback();
1202
+ let isMax = this.handleMax(dateType, value, dateMaxValue);
1203
+ if (!isMax) {
1204
+ return callback(new Error('最大不能超过指定日期时间'));
1205
+ }
1206
+ callback();
1207
+ },
1208
+ // 自定义列表 日期时间 max 其他日期时间字段
1209
+ checkDateMaxOther(rule, value, callback, item) {
1210
+ if (!value) return callback();
1211
+ let { outDateMaxValue, dateType } = item.setting;
1212
+ if (!outDateMaxValue || !dateType) return callback();
1213
+ let matchDateItem = this.formArray.find(v => v.seq === outDateMaxValue);
1214
+ if (!matchDateItem || matchDateItem.hide) return callback();
1215
+ let matchValue = this.form[this.formKey(matchDateItem)];
1216
+ if (!matchValue) return;
1217
+ let isMax = this.handleMax(dateType, value, matchValue);
1218
+ if (!isMax) {
1219
+ return callback(new Error(`最大不能超过【${matchDateItem.title}】日期时间`));
1220
+ }
1221
+ callback();
1222
+ },
1223
+ checkRadio(rule, value, callback, item) {
1224
+ if (!value) return callback();
1225
+ let { options } = item;
1226
+ if (!options.length || value === 'other') return callback();
1227
+ const key = this.formKey(item);
1228
+ let { optionsPreSuffixObj = {} } = this.choiceComObj[key] || {};
1229
+ let matchItem = options.find((o, i) => {
1230
+ if (i + 1 === value) {
1231
+ return true;
1232
+ }
1233
+ return false;
1234
+ });
1235
+ if (!matchItem || matchItem.importability) return callback();
1236
+ if (matchItem.prefix || matchItem.suffix) {
1237
+ let inputValue = optionsPreSuffixObj[value];
1238
+ if (!inputValue) {
1239
+ return callback(new Error(`请完善选项`));
1240
+ }
1241
+ }
1242
+ callback();
1243
+ },
1244
+ checkCheckbox(rule, value, callback, item) {
1245
+ if (!value || !value.length) return callback();
1246
+ let { options } = item;
1247
+ if (!options.length) return callback();
1248
+ let i = 0,
1249
+ len = value.length,
1250
+ v;
1251
+ const key = this.formKey(item);
1252
+ let { optionsPreSuffixObj = {} } = this.choiceComObj[key] || {};
1253
+ for (; i < len; i++) {
1254
+ v = value[i];
1255
+ if (v === 'other') continue;
1256
+ let matchItem = options.find((o, j) => {
1257
+ if (j + 1 === v) {
1258
+ return true;
1259
+ }
1260
+ return false;
1261
+ });
1262
+ if (!matchItem || matchItem.importability) continue;
1263
+
1264
+ if (matchItem.prefix || matchItem.suffix) {
1265
+ let inputValue = optionsPreSuffixObj[v];
1266
+ if (!inputValue) {
1267
+ return callback(new Error(`请完善选项`));
1268
+ }
1269
+ }
1270
+ }
1271
+ callback();
1272
+ },
1273
+ handleMax(dateType, value, dateMaxValue) {
1274
+ let curValue = '';
1275
+ let tempValue = '';
1276
+ if (dateType == 'time') {
1277
+ let curYMD = this.currentTime.format('YYYY MM DD ');
1278
+ curValue = moment(curYMD + dateMaxValue).valueOf();
1279
+ tempValue = moment(curYMD + value).valueOf();
1280
+ } else if (dateType == 'date') {
1281
+ curValue = moment(dateMaxValue).valueOf();
1282
+ tempValue = moment(value).valueOf();
1283
+ } else {
1284
+ curValue = moment(dateMaxValue).valueOf();
1285
+ tempValue = moment(value).valueOf();
1286
+ }
1287
+ if (tempValue > curValue) {
1288
+ return false;
1289
+ }
1290
+ return true;
1291
+ },
1292
+ handleGetAddress(val) {
1293
+ if (utils.isJSON(val)) {
1294
+ const valObj = JSON.parse(val);
1295
+ return valObj.address || valObj.name;
1296
+ }
1297
+ return '';
1298
+ },
1299
+ handleSelectLocation(e, item) {
1300
+ const { locationProp, isInit } = e;
1301
+ this.mapLocation = locationProp;
1302
+ const key = this.formKey(item);
1303
+ this.form[key] = locationProp;
1304
+ this.mapVisible = isInit || false;
1305
+ },
1306
+ isInput(type) {
1307
+ return type == 'INPUT' || type == 'ID_CARD' || type == 'MOBILE' || type == 'EVALUATE_INPUT';
1308
+ },
1309
+ isChoice(type) {
1310
+ return (
1311
+ type == 'SELECT' ||
1312
+ type == 'RADIO_BLOCK' ||
1313
+ type == 'CHECKBOX_BLOCK' ||
1314
+ type == 'SEARCH_CASCADE' ||
1315
+ type == 'EVALUATE_RADIO_BLOCK' ||
1316
+ type == 'EVALUATE_CHECKBOX_BLOCK' ||
1317
+ type == 'EVALUATE_SELECT'
1318
+ );
1319
+ },
1320
+ isTime(type) {
1321
+ return type == 'DATE' || type == 'TIME' || type == 'DATETIME';
1322
+ },
1323
+ isUpload(type) {
1324
+ return type == 'UPFILE' || type == 'UPPICTURE';
1325
+ },
1326
+ writeGuage(showCountdown) {
1327
+ this.showEvaluateSettingWrap = false;
1328
+ this.showEvaluateCountdown = showCountdown;
1329
+ },
1330
+ closeEvaluateCountdown() {
1331
+ // 倒计时结束自动提交 无需校验
1332
+ this.showEvaluateCountdown = false;
1333
+ if (this.isPreviewScale) return;
1334
+ this.banSubmit = true;
1335
+ this.submitMethod();
1336
+ this.$warning({
1337
+ title: '温馨提示',
1338
+ content: '测评时间到了,结束测评!',
1339
+ okText: '确定',
1340
+ onOk: () => {}
1341
+ });
1342
+ },
1343
+ async showEvaTipModal(item) {
1344
+ if (this.evatipMap[item.id]) {
1345
+ this.evatipConfirm(this.evatipMap[item.id]);
1346
+ return;
1347
+ }
1348
+ let key = 'getSubjectAnswer';
1349
+ const fn = this.scaleApiConfig?.[key] || null;
1350
+ if (!fn || typeof fn !== 'function') {
1351
+ this.$message.error(`${key} Is not a function`);
1352
+ return;
1353
+ }
1354
+ let obj = await fn(item.id);
1355
+ if (!obj) return;
1356
+ if (!this.evatipMap[item.id]) {
1357
+ this.evatipMap[item.id] = obj;
1358
+ this.evatipConfirm(obj);
1359
+ }
1360
+ },
1361
+ closeTip() {
1362
+ this.$destroyAll();
1363
+ },
1364
+ evatipConfirm(str) {
1365
+ let _this = this;
1366
+ let content = h => (
1367
+ <div class="evatip-container">
1368
+ <a-icon type="close" class="tip-content-close" on-click={_this.closeTip} />
1369
+ <span>答案解析:</span>
1370
+ <p>{str}</p>
1371
+ </div>
1372
+ );
1373
+ this.$confirm({
1374
+ title: '提示',
1375
+ icon: () => null,
1376
+ content,
1377
+ okText: '确定',
1378
+ cancelText: '关闭',
1379
+ onOk() {},
1380
+ onCancel() {},
1381
+ class: 'evatip-modal-wrap'
1382
+ });
1383
+ },
1384
+ // 选择组件
1385
+ handleChoice(choiceValue, formItem) {
1386
+ let { value = '', list = [] } = choiceValue;
1387
+ this.nextLogicEvent(value, formItem, this.formArray);
1388
+ this.handleDynamicDataRelation(list, formItem, this.formArray);
1389
+ },
1390
+ // 下拉框 动态数据源关联字段
1391
+ handleDynamicDataRelation(list, formItem, formArray) {
1392
+ let { targetSource } = formItem;
1393
+ if (!targetSource || !Object.keys(targetSource).length) return;
1394
+ if (!targetSource.target_id) return;
1395
+ let { relationParam = [] } = targetSource;
1396
+ if (!relationParam.length) return;
1397
+ relationParam.forEach(item => {
1398
+ let matchEle = formArray.find(v => v.seq === item.relationElement);
1399
+ const key = this.formKey(matchEle);
1400
+ if (matchEle) {
1401
+ if (!list.length) {
1402
+ this.form[key] = '';
1403
+ } else {
1404
+ let relationFieldList = list.map(v => v[item.relationField] || '/') || '';
1405
+ this.form[key] = relationFieldList.join(',');
1406
+ }
1407
+ }
1408
+ });
1409
+ },
1410
+ // 设置的logic condition 最大next_subject
1411
+ handleLogicMaxNext(condition = []) {
1412
+ const arr = condition.map(({ next_subject }) => (next_subject == 'end' ? 9999 : +(next_subject || 9999)));
1413
+ const max = Math.max.call(null, ...arr);
1414
+ return max;
1415
+ },
1416
+ // 当前formItem 下一个触发logicCodition item 的seq
1417
+ handleLogicList(formItem, formArray) {
1418
+ const { seq } = formItem;
1419
+ let list = formArray.map(item => {
1420
+ if (item.seq > seq && item.isShow && item.__isLogic__) return item;
1421
+ return false;
1422
+ });
1423
+ let nextItemMax = 0;
1424
+ let i = 0,
1425
+ len = list.length,
1426
+ item;
1427
+ for (; i < len; i++) {
1428
+ item = list[i];
1429
+ let curVal = this.form[this.formKey(item)];
1430
+ if (!curVal) continue;
1431
+ if (Array.isArray(curVal)) {
1432
+ if (!curVal.length) continue;
1433
+ }
1434
+ const { nextLogic, seq, __isLogic__, __lastSeq__ } = item;
1435
+ if (!nextLogic.next_logic_is || !nextLogic.condition.length) continue;
1436
+ if (__lastSeq__) {
1437
+ nextItemMax = __lastSeq__;
1438
+ break;
1439
+ }
1440
+ }
1441
+ return nextItemMax;
1442
+ },
1443
+ // 跳题逻辑
1444
+ nextLogicEvent(choiceValue, formItem, formArray = [], isInit) {
1445
+ const { nextLogic, seq } = formItem;
1446
+ if (!nextLogic) return;
1447
+ if (nextLogic.next_logic_is && nextLogic.condition.length) {
1448
+ let nextMax = 9999,
1449
+ nextItemMax = 0;
1450
+ if (!isInit) {
1451
+ nextMax = this.handleLogicMaxNext(nextLogic.condition);
1452
+ nextItemMax = this.handleLogicList(formItem, formArray);
1453
+ }
1454
+ nextLogic.condition.some(con => {
1455
+ const { value, next_subject } = con;
1456
+ const lastSeq = next_subject == 'end' ? 9999 : next_subject;
1457
+ if (nextItemMax && nextItemMax > seq && nextItemMax < nextMax) {
1458
+ nextMax = nextItemMax;
1459
+ }
1460
+ if (nextLogic.next_logic == 'condition') {
1461
+ let hasValue = false;
1462
+ if (Array.isArray(choiceValue)) {
1463
+ hasValue = choiceValue.includes(value);
1464
+ } else {
1465
+ hasValue = choiceValue === value;
1466
+ }
1467
+
1468
+ // 添加非响应式key __isLogic__ __lastSeq__
1469
+ Object.defineProperty(formItem, '__isLogic__', {
1470
+ value: hasValue,
1471
+ writable: true
1472
+ });
1473
+ Object.defineProperty(formItem, '__lastSeq__', {
1474
+ value: seq + 1,
1475
+ writable: true
1476
+ });
1477
+
1478
+ if (hasValue) {
1479
+ formArray.forEach(item => {
1480
+ if (item.seq > seq && item.seq < lastSeq) {
1481
+ item.isShow = false;
1482
+ // 跳过时 清空已填内容
1483
+ const key = this.formKey(item);
1484
+ this.form[key] && (this.form[key] = '');
1485
+ } else if (item.seq >= lastSeq && item.seq < nextMax) {
1486
+ this.$set(item, 'isShow', true);
1487
+ }
1488
+ });
1489
+ return true;
1490
+ } else {
1491
+ formArray.forEach(item => {
1492
+ if (item.seq > seq && item.seq < lastSeq) {
1493
+ item.isShow = true;
1494
+ }
1495
+ });
1496
+ }
1497
+ } else if (nextLogic.next_logic == 'uncondition') {
1498
+ let res = utils.isEmpty(choiceValue);
1499
+
1500
+ // 添加非响应式key __isLogic__ __lastSeq__
1501
+ Object.defineProperty(formItem, '__isLogic__', {
1502
+ value: !res,
1503
+ writable: true
1504
+ });
1505
+ Object.defineProperty(formItem, '__lastSeq__', {
1506
+ value: seq + 1,
1507
+ writable: true
1508
+ });
1509
+
1510
+ formArray.forEach(item => {
1511
+ const key = this.formKey(item);
1512
+ if (item.seq > seq && item.seq < lastSeq) {
1513
+ item.isShow = res;
1514
+ // 跳过时 清空已填内容
1515
+ if (!res) {
1516
+ this.form[key] && (this.form[key] = '');
1517
+ }
1518
+ }
1519
+ });
1520
+ }
1521
+ });
1522
+ }
1523
+ },
1524
+ // 关联逻辑
1525
+ showEvent(formItem, isSubmitCallback) {
1526
+ if (formItem.hide) return false;
1527
+ const { form } = this;
1528
+ let relationLogicObj = {};
1529
+ // 回调接口
1530
+ if (isSubmitCallback) {
1531
+ let setting = formItem.setting;
1532
+ if (formItem.setting && utils.isJSON(formItem.setting)) {
1533
+ setting = JSON.parse(formItem.setting);
1534
+ }
1535
+ relationLogicObj = utils.isString(setting.callbackCondition) ? JSON.parse(setting.callbackCondition) : setting.callbackCondition;
1536
+ if (!relationLogicObj || !relationLogicObj.condition || !relationLogicObj.condition.length) return true;
1537
+ } else {
1538
+ relationLogicObj = utils.isString(formItem.relationLogic) ? JSON.parse(formItem.relationLogic) : formItem.relationLogic;
1539
+ }
1540
+ if (!relationLogicObj || !Object.keys(relationLogicObj).length) return true;
1541
+ const { relation_logic_is, condition, relation_logic } = relationLogicObj;
1542
+ if (relation_logic_is) {
1543
+ const results = condition.map(c => {
1544
+ let key = this.formKey(this.formArray.filter(f => f.seq == c.subject_seq)[0]);
1545
+ if (utils.isArray(form[key])) {
1546
+ return form[key].some(v => c.value.includes(v));
1547
+ } else {
1548
+ return c.value.includes(form[key]);
1549
+ }
1550
+ });
1551
+ if (relation_logic == 'OR') {
1552
+ formItem.isShow = results.some(el => el);
1553
+ } else if (relation_logic == 'AND') {
1554
+ formItem.isShow = results.every(el => el);
1555
+ } else {
1556
+ formItem.isShow = results[0];
1557
+ }
1558
+ }
1559
+ return formItem.isShow;
1560
+ },
1561
+ // 单选组件回调
1562
+ radioChange(val, item, obj) {
1563
+ const key = this.formKey(item);
1564
+ this.form[key] = val;
1565
+ item.type === 'RADIO_BLOCK' && this.$set(this.choiceComObj, key, obj);
1566
+ this.nextLogicEvent(val, item, this.formArray);
1567
+ },
1568
+ // 多选组件回调
1569
+ checkboxChange(val, item, obj) {
1570
+ const key = this.formKey(item);
1571
+ this.form[key] = val;
1572
+ item.type === 'CHECKBOX_BLOCK' && this.$set(this.choiceComObj, key, obj);
1573
+ this.nextLogicEvent(val, item, this.formArray);
1574
+ },
1575
+ // 标签组件回调
1576
+ labelChange(labelList, item) {
1577
+ const key = this.formKey(item);
1578
+ this.form[key] = this.handleGetLabelSubmit(labelList);
1579
+ },
1580
+
1581
+ signChange(list, item) {
1582
+ const key = this.formKey(item);
1583
+ this.form[key] = list;
1584
+ },
1585
+ // 视频组件回调
1586
+ vodFileList(list, item) {
1587
+ const key = this.formKey(item);
1588
+ this.form[key] = list;
1589
+ },
1590
+ handleGetLabelSubmit(labelSelectedList) {
1591
+ if (!labelSelectedList || !labelSelectedList.length)
1592
+ return {
1593
+ labelStr: '',
1594
+ labels: []
1595
+ };
1596
+ const selectedList = labelSelectedList || [];
1597
+ const labelStrList = [];
1598
+ const labels = [];
1599
+ // "cacheKey":"label_标签","isSelect":true
1600
+ selectedList.forEach(v => {
1601
+ labels.push(v);
1602
+ labelStrList.push(v.labelName);
1603
+ });
1604
+ this.labelSelectedList = selectedList;
1605
+ return {
1606
+ labelStr: labelStrList.join(','),
1607
+ labels: labels
1608
+ };
1609
+ },
1610
+ // 地址回调
1611
+ changeAddress(allValue, item) {
1612
+ const key = this.formKey(item);
1613
+ this.form[key] = allValue;
1614
+ },
1615
+ // 上传回调
1616
+ changeUpload(value, item) {
1617
+ const key = this.formKey(item);
1618
+ this.form[key] = value;
1619
+ },
1620
+ // 时间回调
1621
+ changeTime(value, item) {
1622
+ const key = this.formKey(item);
1623
+ this.form[key] = value;
1624
+ this.submitForm[key] = value;
1625
+ },
1626
+ // 保存
1627
+ onSubmit() {
1628
+ // 不包含测评组件,点击提交,弹出二次确认对话框,确认要提交吗?
1629
+ let hasEvaluate = this.formArray.find(item => this.isEvaluation(item.type));
1630
+ if (!hasEvaluate) {
1631
+ this.confirmSubmit('确认要提交吗?');
1632
+ return;
1633
+ }
1634
+
1635
+ // 包含测评组件,不包含考试时长,点击提交,弹出二次确认对话框,确认要结束测评吗?
1636
+ // 判断有无测评配置 并且在测评时间内
1637
+ let { evaluateResultSetting } = this.config;
1638
+ if (!evaluateResultSetting || (!Object.keys(evaluateResultSetting).length && !this.showEvaluateEntry)) {
1639
+ this.confirmSubmit('确认要结束测评吗?');
1640
+ return;
1641
+ }
1642
+
1643
+ // 表单内嵌量表, 没有开始答题, 不需要调用保存接口
1644
+ if (this.openType == 'formIframe' && this.showEvaluateEntry) {
1645
+ this.$emit('submitNoRequest');
1646
+ return;
1647
+ }
1648
+
1649
+ // 无倒计时
1650
+ let countdownDom = this.$refs.evaluateCountdown;
1651
+ if (!countdownDom?.showEvaluateCountdown) {
1652
+ this.confirmSubmit('确认要结束测评吗?');
1653
+ return;
1654
+ }
1655
+
1656
+ // 在倒计时内
1657
+ let message = '确认要提前结束测评吗?';
1658
+ let setAnswered = this.$refs.evaluateCountdown?.setAnswered;
1659
+ let totalLen = this.$refs.evaluateCountdown?.totalLen;
1660
+ // 存在未解答题目
1661
+ if (setAnswered < totalLen) {
1662
+ message = '存在未解答的题目,确定要提前结束吗?';
1663
+ }
1664
+ this.confirmSubmit(message);
1665
+ },
1666
+ confirmSubmit(message) {
1667
+ let _this = this;
1668
+ this.$confirm({
1669
+ title: '温馨提示',
1670
+ content: message,
1671
+ okText: '确定',
1672
+ cancelText: '取消',
1673
+ onOk: () => {
1674
+ _this.onSubmitForm();
1675
+ },
1676
+ onCancel() {}
1677
+ });
1678
+ },
1679
+ onSubmitForm() {
1680
+ this.$refs['ruleForm'].validate((valid, keys) => {
1681
+ if (valid) {
1682
+ this.submitMethod();
1683
+ } else {
1684
+ if (Object.keys(keys).length > 0) {
1685
+ let key = Object.keys(keys)[0];
1686
+ let field = keys[key][0].field,
1687
+ message = keys[key][0].message;
1688
+ let matchItem = this.formArray.find(v => v.databaseTitle === field);
1689
+ if (matchItem) {
1690
+ field = matchItem.title;
1691
+ }
1692
+ this.$message.error(field + message);
1693
+ }
1694
+ return false;
1695
+ }
1696
+ });
1697
+ },
1698
+ submitMethod() {
1699
+ const hasSpreadParams = this.defaultFormArray.find(v => v.type === 'SPREAD_PARAMS');
1700
+ if (hasSpreadParams) {
1701
+ if (utils.isJSON(hasSpreadParams.setting)) {
1702
+ hasSpreadParams.setting = JSON.parse(hasSpreadParams.setting);
1703
+ }
1704
+ let spreadKey = this.formKey(hasSpreadParams);
1705
+ this.submitForm[spreadKey] = this.compileSpreadParams(hasSpreadParams.setting.spreadParams);
1706
+ }
1707
+ // 自定义列表新增时多选特殊处理
1708
+ let checkBoxKey = this.defaultFormArray.find(ii => ii.type == 'CHECKBOX_BLOCK');
1709
+ if (checkBoxKey && Array.isArray(this.form[checkBoxKey.title]) && this.type === 'customList') {
1710
+ this.form[checkBoxKey.title] = this.form[checkBoxKey.title].join(',');
1711
+ }
1712
+ const scoreJson = this.handleScoreJson();
1713
+ let params;
1714
+ if (this.type === 'customList') {
1715
+ params = {
1716
+ definedListId: this.ids.guage_id,
1717
+ dbId: this.ids.db_id,
1718
+ scoreJson: JSON.stringify(scoreJson)
1719
+ };
1720
+ } else {
1721
+ const { guageId, randomId } = this.config;
1722
+ params = Object.assign(this.params, {
1723
+ guageId,
1724
+ scoreJson: JSON.stringify(scoreJson),
1725
+ randomId
1726
+ });
1727
+ }
1728
+ if (this.shareId) {
1729
+ params.shareId = this.shareId;
1730
+ }
1731
+ const tipSetting = this.defaultFormArray.find(item => item.type === 'SUCCESS_TIP');
1732
+ if (tipSetting) {
1733
+ // 提交保存成功提示设置
1734
+ const tip = utils.isJSON(tipSetting.setting) ? JSON.parse(tipSetting.setting) : tipSetting.setting;
1735
+ params.tipSetting = JSON.stringify({
1736
+ tipMode: tip.tipMode,
1737
+ tipType: tip.tipType,
1738
+ tipText: tip.tipText,
1739
+ tipApi: tip.tipApi
1740
+ });
1741
+ }
1742
+ let hasCallbackItem = this.defaultFormArray.find(v => v.type === 'CALLBACK_INTERFACE');
1743
+ let isCallback = false;
1744
+ if (hasCallbackItem) {
1745
+ isCallback = this.showEvent(hasCallbackItem, true);
1746
+ }
1747
+ /**
1748
+ * NOTE:
1749
+ * 提交数据往外推
1750
+ */
1751
+ this.$emit('onSubmit', params, hasCallbackItem, isCallback);
1752
+ },
1753
+ handleScoreJson() {
1754
+ let tempObj = Object.assign({}, this.form, this.submitForm);
1755
+ let res = {};
1756
+ if (!Object.keys(tempObj).length) return {};
1757
+ for (let key in tempObj) {
1758
+ let itemTemp = this.formArray.find(item => this.formKey(item) == key);
1759
+ let curValue = tempObj[key];
1760
+ if (key && itemTemp) {
1761
+ let keyTemp;
1762
+ if (itemTemp && itemTemp.databaseTitle) keyTemp = itemTemp.databaseTitle;
1763
+ if (this.type == 'customList' && itemTemp && itemTemp.setting && itemTemp.setting.startToStop != 1 && curValue && itemTemp.type == 'DATETIME') {
1764
+ if (itemTemp.setting && itemTemp.setting.dateType == 'time' && curValue) curValue = moment().format('YYYY-MM-DD ') + curValue;
1765
+ if (itemTemp.setting && itemTemp.setting.dateType == 'date' && curValue) curValue = moment(curValue).format('YYYY-MM-DD ') + moment().format('HH:mm:ss');
1766
+ }
1767
+
1768
+ // 处理地址
1769
+ if (itemTemp.type === "ADDRESS") {
1770
+ curValue = this.handleSubmitAddress(tempObj[key], itemTemp);
1771
+ }
1772
+
1773
+ // 处理choice选项 将key替换为value
1774
+ let isChoice = ['RADIO_BLOCK', 'CHECKBOX_BLOCK'].includes(itemTemp.type);
1775
+ if (isChoice) {
1776
+ let { options } = itemTemp;
1777
+ let obj = this.choiceComObj[key];
1778
+ if (itemTemp.type === 'RADIO_BLOCK' && curValue) {
1779
+ curValue = this.handleChoiceItem(curValue, options, obj);
1780
+ }
1781
+ if (itemTemp.type === 'CHECKBOX_BLOCK' && curValue?.length) {
1782
+ let resArr = this.handleCheckboxParams(curValue, options, obj);
1783
+ curValue = resArr;
1784
+ }
1785
+ }
1786
+
1787
+ if (key.includes('~-~')) {
1788
+ let newKey = keyTemp ? keyTemp.replace(/~-~/g, '.') : key.replace(/~-~/g, '.');
1789
+ res[newKey] = curValue;
1790
+ } else {
1791
+ res[keyTemp || key] = !curValue ? null : curValue;
1792
+ }
1793
+ } else {
1794
+ res[key] = curValue;
1795
+ }
1796
+ }
1797
+ console.log('res', res);
1798
+ return res;
1799
+ },
1800
+ handleCheckboxParams(value, options, obj) {
1801
+ let res = [];
1802
+ let i = 0,
1803
+ len = value.length,
1804
+ v;
1805
+ for (; i < len; i++) {
1806
+ v = value[i];
1807
+ let matchItem = options.find((o, i) => {
1808
+ if (i + 1 === v) {
1809
+ return true;
1810
+ }
1811
+ return false;
1812
+ });
1813
+ if (matchItem && !matchItem.prefix && !matchItem.suffix) {
1814
+ res.push(matchItem.value);
1815
+ continue;
1816
+ }
1817
+ let tempValue = this.handleChoiceItem(v, options, obj);
1818
+ res.push(tempValue);
1819
+ }
1820
+ return res;
1821
+ },
1822
+ handleChoiceItem(value, options, obj) {
1823
+ let { othersText, optionsPreSuffixObj = {} } = obj || {};
1824
+ if (value === 'other') {
1825
+ return othersText || '其他';
1826
+ }
1827
+ let matchItem = options.find((o, i) => {
1828
+ if (i + 1 === value) {
1829
+ return true;
1830
+ }
1831
+ return false;
1832
+ });
1833
+ if (!matchItem) return;
1834
+ if (!matchItem.prefix && !matchItem.suffix) return matchItem.value;
1835
+ let resValue = optionsPreSuffixObj[value] || '';
1836
+ if (matchItem.prefix) {
1837
+ resValue = matchItem.prefix + resValue;
1838
+ } else {
1839
+ resValue += matchItem.suffix;
1840
+ }
1841
+ return resValue;
1842
+ },
1843
+ resetForm() {
1844
+ this.$refs.ruleForm.resetFields();
1845
+ },
1846
+ cancel() {
1847
+ this.$emit('onCloseSetting');
1848
+ },
1849
+ handleEvaluationScore(ele) {
1850
+ let { minScore = 0, maxScore = 0, scoreType } = ele.scoreConfigs || {};
1851
+ return `(${maxScore}分)`;
1852
+ },
1853
+ html2Escape(sHtml) {
1854
+ if(!sHtml || typeof sHtml != 'string') return sHtml;
1855
+ return sHtml.replace(/[<>&"]/g,function(c){
1856
+ return {'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];
1857
+ });
1858
+ }
1859
+ }
1860
+ });
1861
+ </script>
1862
+ <style lang="less" scoped>
1863
+ .r-scale {
1864
+ position: relative;
1865
+ width: 100%;
1866
+ height: 100%;
1867
+ overflow: hidden;
1868
+ padding-top: 4px;
1869
+ padding-bottom: 50px;
1870
+ .scale-container {
1871
+ width: 100%;
1872
+ height: 100%;
1873
+ padding-bottom: 10px;
1874
+ transform-origin: 0 0;
1875
+ overflow-y: auto;
1876
+ box-sizing: border-box;
1877
+ &.scale-container-nopadding {
1878
+ height: 100%;
1879
+ }
1880
+ &::-webkit-scrollbar {
1881
+ width: 10px;
1882
+ }
1883
+ }
1884
+ /deep/ .no-data-tip {
1885
+ width: 100%;
1886
+ height: 100%;
1887
+ }
1888
+ .totalScore-warp {
1889
+ padding: 16px;
1890
+ margin-bottom: 16px;
1891
+ font-weight: 400;
1892
+ color: #666666;
1893
+ background: #f2f2f4;
1894
+ font-size: 14px;
1895
+ border-radius: 6px;
1896
+ div + div {
1897
+ margin-top: 4px;
1898
+ }
1899
+ span {
1900
+ font-weight: 500;
1901
+ color: #090909;
1902
+ }
1903
+ .score-result {
1904
+ color: #2d7aff;
1905
+ }
1906
+ }
1907
+ /deep/ .ant-spin-spinning {
1908
+ height: 100%;
1909
+ width: 100%;
1910
+ padding-top: 88px;
1911
+ }
1912
+ /deep/ .ant-select ~ div {
1913
+ position: relative !important;
1914
+ }
1915
+ // /deep/.ant-select-dropdown {
1916
+ // top: 0px !important;
1917
+ // left: 1px !important;
1918
+ // }
1919
+ .lb-title {
1920
+ text-align: center;
1921
+ }
1922
+ .map-container {
1923
+ cursor: pointer;
1924
+ /deep/ .ant-input-disabled {
1925
+ color: rgba(0, 0, 0, 0.65);
1926
+ background-color: #fff;
1927
+ cursor: pointer;
1928
+ }
1929
+ }
1930
+ .linebar-div {
1931
+ text-align: center;
1932
+ margin-top: 24px;
1933
+ /deep/ .ant-divider {
1934
+ margin-top: -4px;
1935
+ }
1936
+ }
1937
+ .my-prompt {
1938
+ padding: 10px;
1939
+ box-shadow: 0 5px 13px rgba(0, 0, 0, 0.14);
1940
+ background-color: #fff;
1941
+ border-radius: 4px;
1942
+ }
1943
+ .img-card {
1944
+ width: 100%;
1945
+ }
1946
+ }
1947
+ .main {
1948
+ // overflow: auto;
1949
+ // overflow-x: hidden;
1950
+ padding: 0 16px;
1951
+ box-sizing: border-box;
1952
+ /deep/.ant-form-item-required::before {
1953
+ color: #e02828;
1954
+ }
1955
+ .scale-label-required {
1956
+ font-weight: 700;
1957
+ }
1958
+ .required-text {
1959
+ color: #e02828;
1960
+ }
1961
+ .evalute-label {
1962
+ display: inline-block;
1963
+ height: 20px;
1964
+ line-height: 20px;
1965
+ padding: 0 5px;
1966
+ margin-left: 4px;
1967
+ font-size: 12px;
1968
+ color: #2d7aff;
1969
+ border-radius: 4px;
1970
+ border: 1px solid rgba(45, 122, 255, 0.5);
1971
+ background: rgba(45, 122, 255, 0.1);
1972
+ }
1973
+ .evalute-tip {
1974
+ display: inline-block;
1975
+ padding: 0 5px;
1976
+ margin-left: 8px;
1977
+ color: #fe9626;
1978
+ border-radius: 2px;
1979
+ background: rgba(255, 194, 0, 0.15);
1980
+ cursor: pointer;
1981
+ .ant-icon {
1982
+ margin-right: 2px;
1983
+ }
1984
+ }
1985
+ /deep/ .ant-form-item-label {
1986
+ // white-space: break-spaces;
1987
+ white-space: unset;
1988
+ text-align: left;
1989
+ line-height: 20px;
1990
+ padding: 6px 0;
1991
+ width: 100%;
1992
+ .ant-form-item-no-colon {
1993
+ width: 100%;
1994
+ }
1995
+ }
1996
+ }
1997
+ .footer {
1998
+ position: absolute;
1999
+ bottom: 0;
2000
+ left: 0;
2001
+ width: 100%;
2002
+ border-top: 1px solid #e8e8e8;
2003
+ padding-top: 12px;
2004
+ height: 50px;
2005
+ box-sizing: border-box;
2006
+ background: #fff;
2007
+ }
2008
+ .rich-text-content {
2009
+ word-break: break-all;
2010
+ /deep/ p {
2011
+ margin-bottom: 0;
2012
+ }
2013
+ /deep/ img {
2014
+ max-width: 100%;
2015
+ }
2016
+ }
2017
+ </style>