cnhis-design-vue 2.1.58 → 2.1.59

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 (572) hide show
  1. package/.prettierrc.js +27 -27
  2. package/CHANGELOG.md +2610 -2641
  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 +345 -333
  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 +724 -436
  39. package/es/fabric-chart/style.css +1 -1
  40. package/es/form/index.js +8 -8
  41. package/es/form-model/index.js +8 -8
  42. package/es/form-table/index.js +144 -144
  43. package/es/grid/index.js +4 -4
  44. package/es/index/index.js +1965 -1650
  45. package/es/index/style.css +1 -1
  46. package/es/input/index.js +11 -11
  47. package/es/input-number/index.js +8 -8
  48. package/es/keep-cache/index.js +9 -9
  49. package/es/layout/index.js +8 -8
  50. package/es/list/index.js +8 -8
  51. package/es/locale-provider/index.js +8 -8
  52. package/es/map/index.js +13 -13
  53. package/es/mentions/index.js +8 -8
  54. package/es/menu/index.js +8 -8
  55. package/es/message/index.js +8 -8
  56. package/es/multi-chat/index.js +116 -116
  57. package/es/multi-chat-client/index.js +110 -110
  58. package/es/multi-chat-history/index.js +6 -6
  59. package/es/multi-chat-record/index.js +27 -27
  60. package/es/multi-chat-setting/index.js +43 -43
  61. package/es/multi-chat-sip/index.js +1 -1
  62. package/es/notification/index.js +8 -8
  63. package/es/page-header/index.js +8 -8
  64. package/es/pagination/index.js +8 -8
  65. package/es/popconfirm/index.js +8 -8
  66. package/es/popover/index.js +8 -8
  67. package/es/progress/index.js +8 -8
  68. package/es/radio/index.js +17 -17
  69. package/es/rate/index.js +8 -8
  70. package/es/result/index.js +8 -8
  71. package/es/row/index.js +8 -8
  72. package/es/scale-container/index.js +1 -1
  73. package/es/scale-view/index.js +158 -158
  74. package/es/select/index.js +44 -44
  75. package/es/select-label/index.js +50 -50
  76. package/es/select-person/index.js +20 -20
  77. package/es/shortcut-setter/index.js +10 -10
  78. package/es/skeleton/index.js +8 -8
  79. package/es/slider/index.js +8 -8
  80. package/es/space/index.js +8 -8
  81. package/es/spin/index.js +8 -8
  82. package/es/statistic/index.js +8 -8
  83. package/es/steps/index.js +8 -8
  84. package/es/switch/index.js +8 -8
  85. package/es/table-filter/index.js +253 -238
  86. package/es/table-filter/style.css +1 -1
  87. package/es/tabs/index.js +8 -8
  88. package/es/tag/index.js +9 -9
  89. package/es/time-picker/index.js +8 -8
  90. package/es/timeline/index.js +8 -8
  91. package/es/tooltip/index.js +8 -8
  92. package/es/transfer/index.js +8 -8
  93. package/es/tree/index.js +8 -8
  94. package/es/tree-select/index.js +8 -8
  95. package/es/upload/index.js +8 -8
  96. package/es/utils/clickoutside.js +7 -7
  97. package/es/utils/kty.min-1.0.0.js +5 -5
  98. package/es/utils/time-domain.js +16 -16
  99. package/es/utils/utils-map.js +32 -32
  100. package/es/utils/vexutils.js +27 -27
  101. package/es/verification-code/index.js +2 -2
  102. package/lib/cui.common.js +2045 -1730
  103. package/lib/cui.umd.js +2045 -1730
  104. package/lib/cui.umd.min.js +20 -20
  105. package/package.json +110 -110
  106. package/packages/affix/index.js +12 -12
  107. package/packages/affix/src/Affix.jsx +12 -12
  108. package/packages/age/index.js +27 -27
  109. package/packages/age/src/age/index.vue +139 -139
  110. package/packages/age/src/age-com/index.vue +209 -209
  111. package/packages/alert/index.js +12 -12
  112. package/packages/alert/src/Alert.jsx +11 -11
  113. package/packages/anchor/index.js +18 -18
  114. package/packages/anchor/src/Anchor.jsx +11 -11
  115. package/packages/anchor/src/Link.jsx +11 -11
  116. package/packages/auto-complete/index.js +12 -12
  117. package/packages/auto-complete/src/AutoComplete.jsx +12 -12
  118. package/packages/avatar/index.js +12 -12
  119. package/packages/avatar/src/Avatar.jsx +11 -11
  120. package/packages/back-top/index.js +12 -12
  121. package/packages/back-top/src/BackTop.jsx +11 -11
  122. package/packages/badge/index.js +12 -12
  123. package/packages/badge/src/Badge.jsx +11 -11
  124. package/packages/base/index.js +3 -3
  125. package/packages/big-table/index.js +16 -16
  126. package/packages/big-table/src/BigTable.vue +3150 -3144
  127. package/packages/big-table/src/Fieldset.vue +2067 -2067
  128. package/packages/big-table/src/assets/iconfont/iconfont.css +21 -21
  129. package/packages/big-table/src/assets/style/table-base.less +385 -385
  130. package/packages/big-table/src/assets/style/table-global.less +175 -175
  131. package/packages/big-table/src/components/AutoLayoutButton.vue +279 -279
  132. package/packages/big-table/src/components/NoData.vue +81 -81
  133. package/packages/big-table/src/components/TextOverTooltip.vue +120 -120
  134. package/packages/big-table/src/components/edit-form/EditForm.vue +509 -509
  135. package/packages/big-table/src/components/edit-form/edit-component/config-data/index.js +68 -68
  136. package/packages/big-table/src/components/edit-form/edit-component/edit-date-picker/edit-date-picker.vue +60 -60
  137. package/packages/big-table/src/components/edit-form/edit-component/edit-digital/edit-digital.vue +54 -54
  138. package/packages/big-table/src/components/edit-form/edit-component/edit-input/edit-input.vue +39 -39
  139. package/packages/big-table/src/components/edit-form/edit-component/edit-input-password/edit-input-password.vue +79 -79
  140. package/packages/big-table/src/components/edit-form/edit-component/edit-month-picker/edit-month-picker.vue +37 -37
  141. package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue +82 -82
  142. package/packages/big-table/src/components/edit-form/edit-component/edit-search-more/edit-search-more.vue +95 -95
  143. package/packages/big-table/src/components/edit-form/edit-component/edit-select/edit-select.vue +40 -40
  144. package/packages/big-table/src/components/edit-form/edit-component/edit-select-multiple/edit-select-multiple.vue +55 -55
  145. package/packages/big-table/src/components/edit-form/edit-component/edit-switch/edit-switch.vue +43 -43
  146. package/packages/big-table/src/components/edit-form/edit-component/edit-textarea/edit-textarea.vue +41 -41
  147. package/packages/big-table/src/components/edit-form/edit-component/edit-time-picker/edit-time-picker.vue +40 -40
  148. package/packages/big-table/src/components/edit-form/edit-component/mixins/bound-date.js +3 -3
  149. package/packages/big-table/src/components/edit-form/edit-component/mixins/dateType.js +217 -217
  150. package/packages/big-table/src/components/edit-form/edit-component/mixins/item-default.js +639 -639
  151. package/packages/big-table/src/components/edit-form/edit-component/mixins/search.js +1247 -1247
  152. package/packages/big-table/src/components/edit-form/edit-component/register-com.js +26 -26
  153. package/packages/big-table/src/components/edit-form/edit-item/form-event.js +80 -80
  154. package/packages/big-table/src/components/edit-form/edit-item/global-props.js +33 -33
  155. package/packages/big-table/src/components/edit-form/edit-item/index.js +4 -4
  156. package/packages/big-table/src/components/edit-form/edit-item/render-methods.js +28 -28
  157. package/packages/big-table/src/components/edit-form/edit-item/validate-rules.js +463 -463
  158. package/packages/big-table/src/components/edit-form/edit-mixins/form-commom.js +673 -673
  159. package/packages/big-table/src/components/edit-form/edit-mixins/index.js +3 -3
  160. package/packages/big-table/src/components/edit-form/edit-utils/index.js +112 -112
  161. package/packages/big-table/src/components/password-com.vue +58 -58
  162. package/packages/big-table/src/components/player-vod/index.vue +57 -57
  163. package/packages/big-table/src/components/player-vod/player.vue +189 -189
  164. package/packages/big-table/src/components/player-vod/video-list.vue +265 -265
  165. package/packages/big-table/src/components/player-vod/video-modal.vue +126 -126
  166. package/packages/big-table/src/utils/CustomPagination.vue +86 -86
  167. package/packages/big-table/src/utils/batchEditing.js +610 -610
  168. package/packages/big-table/src/utils/bigTableProps.js +103 -103
  169. package/packages/big-table/src/utils/format.js +557 -557
  170. package/packages/big-table/src/utils/nestTable.js +109 -109
  171. package/packages/big-table/src/utils/tableParse.js +234 -234
  172. package/packages/breadcrumb/index.js +21 -21
  173. package/packages/breadcrumb/src/Breadcrumb.jsx +11 -11
  174. package/packages/breadcrumb/src/BreadcrumbItem.jsx +11 -11
  175. package/packages/breadcrumb/src/BreadcrumbSeparator.jsx +11 -11
  176. package/packages/button/index.js +21 -21
  177. package/packages/button/src/Button.jsx +11 -11
  178. package/packages/button/src/ButtonGroup.jsx +11 -11
  179. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  180. package/packages/button/src/ButtonPrint/index.vue +766 -766
  181. package/packages/button/src/ButtonPrint/mixin/his-print.js +95 -95
  182. package/packages/calendar/index.js +12 -12
  183. package/packages/calendar/src/Calendar.jsx +11 -11
  184. package/packages/captcha/index.js +9 -9
  185. package/packages/captcha/src/Captcha.vue +164 -164
  186. package/packages/captcha/src/Index.vue +47 -47
  187. package/packages/captcha/src/SlideVerify.vue +285 -285
  188. package/packages/card/index.js +21 -21
  189. package/packages/card/src/Card.jsx +12 -12
  190. package/packages/card/src/CardGrid.js +7 -7
  191. package/packages/card/src/CardMeta.js +7 -7
  192. package/packages/carousel/index.js +12 -12
  193. package/packages/carousel/src/Carousel.jsx +12 -12
  194. package/packages/cascader/index.js +12 -12
  195. package/packages/cascader/src/Cascader.jsx +11 -11
  196. package/packages/checkbox/index.js +30 -30
  197. package/packages/checkbox/src/Checkbox.jsx +11 -11
  198. package/packages/checkbox/src/CheckboxImg/index.vue +141 -141
  199. package/packages/checkbox/src/Group.jsx +11 -11
  200. package/packages/col/index.js +13 -13
  201. package/packages/col/src/Col.jsx +11 -11
  202. package/packages/collapse/index.js +18 -18
  203. package/packages/collapse/src/Collapse.jsx +11 -11
  204. package/packages/collapse/src/Panel.jsx +11 -11
  205. package/packages/color-picker/index.js +10 -10
  206. package/packages/color-picker/src/color-picker.vue +191 -191
  207. package/packages/color-picker/src/style.less +109 -109
  208. package/packages/comment/index.js +12 -12
  209. package/packages/comment/src/Comment.jsx +11 -11
  210. package/packages/config-provider/index.js +12 -12
  211. package/packages/config-provider/src/ConfigProvider.jsx +11 -11
  212. package/packages/date-picker/index.js +26 -26
  213. package/packages/date-picker/src/DatePicker.jsx +12 -12
  214. package/packages/date-picker/src/MonthPicker.jsx +11 -11
  215. package/packages/date-picker/src/RangePicker.jsx +11 -11
  216. package/packages/date-picker/src/WeekPicker.jsx +11 -11
  217. package/packages/date-picker/src/utils/index.js +374 -374
  218. package/packages/descriptions/index.js +18 -18
  219. package/packages/descriptions/src/Descriptions.jsx +11 -11
  220. package/packages/descriptions/src/Item.jsx +11 -11
  221. package/packages/divider/index.js +12 -12
  222. package/packages/divider/src/Divider.jsx +11 -11
  223. package/packages/drag-layout/DragFormLeftItem.vue +173 -173
  224. package/packages/drag-layout/DragFormRightItem.vue +284 -284
  225. package/packages/drag-layout/I18n-mixins.js +10 -10
  226. package/packages/drag-layout/drag-layout.vue +778 -778
  227. package/packages/drag-layout/index.js +12 -12
  228. package/packages/drawer/index.js +12 -12
  229. package/packages/drawer/src/Drawer.jsx +11 -11
  230. package/packages/dropdown/index.js +12 -12
  231. package/packages/dropdown/src/Dropdown.jsx +11 -11
  232. package/packages/editor/index.js +9 -9
  233. package/packages/ellipsis/index.js +8 -8
  234. package/packages/ellipsis/src/Ellipsis.vue +65 -65
  235. package/packages/empty/index.js +12 -12
  236. package/packages/empty/src/Empty.jsx +11 -11
  237. package/packages/fabric-chart/index.js +9 -9
  238. package/packages/fabric-chart/src/FabricGrid.vue +67 -66
  239. package/packages/fabric-chart/src/components/DropPopup.vue +90 -90
  240. package/packages/fabric-chart/src/components/MouseRightClick.vue +168 -168
  241. package/packages/fabric-chart/src/components/TimeScaleValue.vue +114 -115
  242. package/packages/fabric-chart/src/const/defaultVaule.js +60 -59
  243. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +43 -9
  244. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +579 -552
  245. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1142 -1126
  246. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +134 -134
  247. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +574 -566
  248. package/packages/fabric-chart/src/mixins/eventCommon.js +34 -1
  249. package/packages/fabric-chart/src/mixins/fabricCommon.js +95 -95
  250. package/packages/fabric-chart/src/mixins/fabricObject.js +193 -193
  251. package/packages/fabric-chart/src/mixins/type.js +5 -5
  252. package/packages/form/index.js +16 -16
  253. package/packages/form/src/Form.jsx +11 -11
  254. package/packages/form/src/Item.jsx +11 -11
  255. package/packages/form-model/index.js +14 -14
  256. package/packages/form-model/src/FormModel.jsx +11 -11
  257. package/packages/form-model/src/Item.jsx +11 -11
  258. package/packages/form-table/index.js +16 -16
  259. package/packages/form-table/src/FormTable.vue +1110 -1110
  260. package/packages/form-table/src/components/table-component/config-data/index.js +80 -80
  261. package/packages/form-table/src/components/table-component/global-props.js +22 -22
  262. package/packages/form-table/src/components/table-component/index.js +8 -8
  263. package/packages/form-table/src/components/table-component/mixins/bound-date.js +455 -455
  264. package/packages/form-table/src/components/table-component/mixins/dateType.js +217 -217
  265. package/packages/form-table/src/components/table-component/mixins/item-default.js +257 -257
  266. package/packages/form-table/src/components/table-component/mixins/search.js +1242 -1242
  267. package/packages/form-table/src/components/table-component/register-com.js +30 -30
  268. package/packages/form-table/src/components/table-component/table-age/table-age.vue +175 -175
  269. package/packages/form-table/src/components/table-component/table-date-picker/table-date-picker.vue +87 -87
  270. package/packages/form-table/src/components/table-component/table-digital/table-digital.vue +93 -93
  271. package/packages/form-table/src/components/table-component/table-input/table-input.vue +81 -81
  272. package/packages/form-table/src/components/table-component/table-input-password/table-input-password.vue +126 -126
  273. package/packages/form-table/src/components/table-component/table-month-picker/table-month-picker.vue +55 -55
  274. package/packages/form-table/src/components/table-component/table-search/table-search.vue +174 -174
  275. package/packages/form-table/src/components/table-component/table-search-more/table-search-more.vue +191 -191
  276. package/packages/form-table/src/components/table-component/table-select/table-select.vue +64 -64
  277. package/packages/form-table/src/components/table-component/table-select-multiple/table-select-multiple.vue +81 -81
  278. package/packages/form-table/src/components/table-component/table-textarea/table-textarea.vue +76 -76
  279. package/packages/form-table/src/components/table-component/table-time-picker/table-time-picker.vue +55 -55
  280. package/packages/form-table/src/components/table-component/table-tree-select/table-tree-select.vue +135 -135
  281. package/packages/form-table/src/components/table-component/text-over-tooltip/TextOverTooltip.vue +97 -97
  282. package/packages/form-table/src/components/table-item/form-event.js +81 -81
  283. package/packages/form-table/src/components/table-item/global-props.js +27 -27
  284. package/packages/form-table/src/components/table-item/index.js +4 -4
  285. package/packages/form-table/src/components/table-item/render-methods.js +28 -28
  286. package/packages/form-table/src/components/table-item/validate-rules.js +520 -520
  287. package/packages/form-table/src/components/table-mixins/form-commom.js +98 -98
  288. package/packages/form-table/src/components/table-mixins/index.js +3 -3
  289. package/packages/form-table/src/components/table-utils/index.js +112 -112
  290. package/packages/form-table/src/disabledDetail.less +46 -46
  291. package/packages/grid/index.js +10 -10
  292. package/packages/grid/src/grid.js +28 -28
  293. package/packages/icon/index.js +10 -10
  294. package/packages/icon/src/icon.js +13 -13
  295. package/packages/index.js +313 -313
  296. package/packages/input/index.js +30 -30
  297. package/packages/input/src/Group.jsx +11 -11
  298. package/packages/input/src/Input.jsx +11 -11
  299. package/packages/input/src/Password.jsx +11 -11
  300. package/packages/input/src/Search.jsx +11 -11
  301. package/packages/input/src/TextArea.jsx +11 -11
  302. package/packages/input/src/input-quick/components/quick-item.vue +284 -284
  303. package/packages/input/src/input-quick/components/quick-popover.vue +596 -596
  304. package/packages/input/src/input-quick/index.vue +137 -137
  305. package/packages/input-number/index.js +12 -12
  306. package/packages/input-number/src/InputNumber.jsx +11 -11
  307. package/packages/keep-cache/KeepCache.js +236 -236
  308. package/packages/keep-cache/index.css +2 -2
  309. package/packages/keep-cache/index.js +8 -8
  310. package/packages/layout/index.js +27 -27
  311. package/packages/layout/src/Content.jsx +11 -11
  312. package/packages/layout/src/Footer.jsx +11 -11
  313. package/packages/layout/src/Header.jsx +11 -11
  314. package/packages/layout/src/Layout.jsx +11 -11
  315. package/packages/layout/src/Sider.jsx +11 -11
  316. package/packages/list/index.js +21 -21
  317. package/packages/list/src/Item.jsx +11 -11
  318. package/packages/list/src/ItemMeta.jsx +11 -11
  319. package/packages/list/src/List.jsx +11 -11
  320. package/packages/locale-provider/index.js +12 -12
  321. package/packages/locale-provider/src/LocaleProvider.jsx +11 -11
  322. package/packages/map/index.js +9 -9
  323. package/packages/map/src/Map.vue +484 -484
  324. package/packages/map/src/popup-map.vue +53 -53
  325. package/packages/mentions/index.js +18 -18
  326. package/packages/mentions/src/Mentions.jsx +11 -11
  327. package/packages/mentions/src/Option.jsx +11 -11
  328. package/packages/menu/index.js +27 -27
  329. package/packages/menu/src/Divider.jsx +11 -11
  330. package/packages/menu/src/Item.jsx +11 -11
  331. package/packages/menu/src/ItemGroup.jsx +11 -11
  332. package/packages/menu/src/Menu.jsx +11 -11
  333. package/packages/menu/src/SubMenu.jsx +11 -11
  334. package/packages/message/index.js +8 -8
  335. package/packages/modal/index.js +10 -10
  336. package/packages/modal/src/Modal.js +7 -7
  337. package/packages/multi-chat/chat/addConference.vue +200 -200
  338. package/packages/multi-chat/chat/addMembers.vue +411 -411
  339. package/packages/multi-chat/chat/advancedFilter.vue +372 -372
  340. package/packages/multi-chat/chat/calling.vue +246 -246
  341. package/packages/multi-chat/chat/chatFooter.vue +1596 -1596
  342. package/packages/multi-chat/chat/chatHistory.vue +605 -605
  343. package/packages/multi-chat/chat/chatMain.vue +1486 -1486
  344. package/packages/multi-chat/chat/client/index.vue +149 -149
  345. package/packages/multi-chat/chat/delay.vue +177 -177
  346. package/packages/multi-chat/chat/evaluate.vue +343 -343
  347. package/packages/multi-chat/chat/messageRecord.vue +324 -324
  348. package/packages/multi-chat/chat/mixins/NoData.js +20 -20
  349. package/packages/multi-chat/chat/mixins/base.js +97 -97
  350. package/packages/multi-chat/chat/mixins/uniRTCAPI.js +80 -80
  351. package/packages/multi-chat/chat/mixins/viewerOptions.js +67 -67
  352. package/packages/multi-chat/chat/quickReply.vue +439 -439
  353. package/packages/multi-chat/chat/robot/index.vue +312 -312
  354. package/packages/multi-chat/chat/scrollList.vue +1238 -1238
  355. package/packages/multi-chat/chat/videoVoiceList.vue +348 -348
  356. package/packages/multi-chat/chat/voice.vue +431 -431
  357. package/packages/multi-chat/components/avatar.vue +113 -113
  358. package/packages/multi-chat/components/chat-tabs-header.vue +251 -251
  359. package/packages/multi-chat/components/classify-tabs.vue +185 -185
  360. package/packages/multi-chat/components/empty.vue +24 -24
  361. package/packages/multi-chat/components/modal-refuse-reason.vue +112 -112
  362. package/packages/multi-chat/components/modal-sip.vue +160 -160
  363. package/packages/multi-chat/components/modal-user-transfer.vue +98 -98
  364. package/packages/multi-chat/components/msg-describe.vue +138 -138
  365. package/packages/multi-chat/components/msg-picture.vue +68 -68
  366. package/packages/multi-chat/components/msg-prescription.vue +205 -205
  367. package/packages/multi-chat/components/read-record.vue +133 -133
  368. package/packages/multi-chat/components/read-status.vue +34 -34
  369. package/packages/multi-chat/components/user-status.vue +198 -198
  370. package/packages/multi-chat/index.js +7 -7
  371. package/packages/multi-chat/setting/authority/index.vue +156 -156
  372. package/packages/multi-chat/setting/authority/roleSetting.vue +204 -204
  373. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1316
  374. package/packages/multi-chat/setting/customerService/batchSelect.vue +403 -403
  375. package/packages/multi-chat/setting/customerService/index.vue +273 -273
  376. package/packages/multi-chat/setting/event/edit/condition.vue +128 -128
  377. package/packages/multi-chat/setting/event/edit/index.vue +437 -437
  378. package/packages/multi-chat/setting/event/edit/notice.vue +129 -129
  379. package/packages/multi-chat/setting/event/edit/strategy.vue +98 -98
  380. package/packages/multi-chat/setting/event/index.vue +249 -249
  381. package/packages/multi-chat/setting/index.vue +269 -269
  382. package/packages/multi-chat/setting/page.vue +14 -14
  383. package/packages/multi-chat/setting/sessionList/index.vue +412 -412
  384. package/packages/multi-chat/setting/sessionList/messageRecord.vue +372 -372
  385. package/packages/multi-chat/setting/userConfig/index.vue +124 -124
  386. package/packages/multi-chat/setting/worktime/index.vue +274 -274
  387. package/packages/multi-chat/store/actions.js +452 -452
  388. package/packages/multi-chat/store/getters.js +371 -371
  389. package/packages/multi-chat/store/helper.js +66 -66
  390. package/packages/multi-chat/store/index.js +50 -50
  391. package/packages/multi-chat/store/mutation.js +296 -296
  392. package/packages/multi-chat/store/state.js +117 -117
  393. package/packages/multi-chat/style/emoji.css +315 -315
  394. package/packages/multi-chat/style/message.mixin.less +38 -38
  395. package/packages/multi-chat/utils/chatSock.js +93 -93
  396. package/packages/multi-chat/utils/compressImage.js +115 -115
  397. package/packages/multi-chat/utils/emoji.json +68 -68
  398. package/packages/multi-chat/utils/index.js +259 -259
  399. package/packages/multi-chat/utils/observer-scroll.js +49 -49
  400. package/packages/multi-chat/utils/panelsetting.js +48 -48
  401. package/packages/multi-chat-client/index.js +7 -7
  402. package/packages/multi-chat-history/index.js +7 -7
  403. package/packages/multi-chat-record/index.js +7 -7
  404. package/packages/multi-chat-setting/index.js +7 -7
  405. package/packages/multi-chat-sip/index.js +6 -6
  406. package/packages/notification/index.js +8 -8
  407. package/packages/page-header/index.js +12 -12
  408. package/packages/page-header/src/PageHeader.jsx +11 -11
  409. package/packages/pagination/index.js +12 -12
  410. package/packages/pagination/src/Pagination.jsx +11 -11
  411. package/packages/popconfirm/index.js +12 -12
  412. package/packages/popconfirm/src/Popconfirm.jsx +11 -11
  413. package/packages/popover/index.js +12 -12
  414. package/packages/popover/src/Popover.jsx +11 -11
  415. package/packages/progress/index.js +12 -12
  416. package/packages/progress/src/Progress.jsx +11 -11
  417. package/packages/radio/index.js +33 -33
  418. package/packages/radio/src/Group.jsx +11 -11
  419. package/packages/radio/src/Radio.jsx +11 -11
  420. package/packages/radio/src/RadioButton.jsx +11 -11
  421. package/packages/radio/src/RadioImg/index.vue +124 -124
  422. package/packages/rate/index.js +12 -12
  423. package/packages/rate/src/Rate.jsx +11 -11
  424. package/packages/result/index.js +12 -12
  425. package/packages/result/src/Result.jsx +11 -11
  426. package/packages/row/index.js +12 -12
  427. package/packages/row/src/Row.jsx +11 -11
  428. package/packages/scale-container/index.js +8 -8
  429. package/packages/scale-container/src/ScaleContainer.vue +197 -197
  430. package/packages/scale-view/NoData.vue +81 -81
  431. package/packages/scale-view/answerParse.vue +133 -133
  432. package/packages/scale-view/customList.vue +801 -801
  433. package/packages/scale-view/data.js +80 -80
  434. package/packages/scale-view/evaluateCountdown.vue +155 -155
  435. package/packages/scale-view/evaluatePage.vue +202 -202
  436. package/packages/scale-view/formitem/data.js +3991 -3991
  437. package/packages/scale-view/formitem/index.js +6 -6
  438. package/packages/scale-view/formitem/r-address.vue +238 -238
  439. package/packages/scale-view/formitem/r-choice.vue +726 -726
  440. package/packages/scale-view/formitem/r-input.vue +92 -92
  441. package/packages/scale-view/formitem/r-prompt.vue +52 -52
  442. package/packages/scale-view/formitem/r-time.vue +285 -285
  443. package/packages/scale-view/formitem/r-upload-custom-list.vue +242 -242
  444. package/packages/scale-view/formitem/r-upload.vue +287 -287
  445. package/packages/scale-view/formitem/text-over-tooltip/TextOverTooltip.vue +98 -98
  446. package/packages/scale-view/index.js +17 -17
  447. package/packages/scale-view/mixin/NoData.js +38 -38
  448. package/packages/scale-view/mixin/evaluate.js +146 -146
  449. package/packages/scale-view/mixin/index.js +337 -337
  450. package/packages/scale-view/mixin/judgeTypes.js +267 -267
  451. package/packages/scale-view/scaleView.vue +2010 -2010
  452. package/packages/select/index.js +27 -27
  453. package/packages/select/src/CustomSelect/index.vue +130 -130
  454. package/packages/select/src/OptGroup.jsx +11 -11
  455. package/packages/select/src/Option.jsx +11 -11
  456. package/packages/select/src/Select/Select.vue +231 -231
  457. package/packages/select/src/Select/index.js +12 -12
  458. package/packages/select/src/TableSelect/index.vue +514 -514
  459. package/packages/select-label/index.js +14 -14
  460. package/packages/select-label/label-classify.vue +129 -129
  461. package/packages/select-label/labelFormContent.vue +787 -787
  462. package/packages/select-label/select-label.vue +581 -581
  463. package/packages/select-person/index.js +10 -10
  464. package/packages/select-person/search-tree.vue +373 -373
  465. package/packages/select-person/select-person.vue +1696 -1696
  466. package/packages/shortcut-setter/index.js +12 -12
  467. package/packages/shortcut-setter/src/ShortcutSetter.vue +55 -55
  468. package/packages/shortcut-setter/src/ShortcutSetterItem.vue +84 -84
  469. package/packages/shortcut-setter/src/utils/index.js +63 -63
  470. package/packages/skeleton/index.js +12 -12
  471. package/packages/skeleton/src/Skeleton.jsx +11 -11
  472. package/packages/slider/index.js +12 -12
  473. package/packages/slider/src/Slider.jsx +11 -11
  474. package/packages/space/index.js +12 -12
  475. package/packages/space/src/Space.jsx +11 -11
  476. package/packages/spin/index.js +12 -12
  477. package/packages/spin/src/Spin.jsx +11 -11
  478. package/packages/statistic/index.js +18 -18
  479. package/packages/statistic/src/Countdown.jsx +11 -11
  480. package/packages/statistic/src/Statistic.jsx +11 -11
  481. package/packages/steps/index.js +18 -18
  482. package/packages/steps/src/Step.jsx +11 -11
  483. package/packages/steps/src/Steps.jsx +11 -11
  484. package/packages/switch/index.js +12 -12
  485. package/packages/switch/src/Switch.jsx +11 -11
  486. package/packages/table-filter/index.js +27 -27
  487. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2572 -2572
  488. package/packages/table-filter/src/classification/Classification-com.vue +1756 -1756
  489. package/packages/table-filter/src/classification/search-class-name.vue +266 -266
  490. package/packages/table-filter/src/classification/search-professional-model.vue +680 -680
  491. package/packages/table-filter/src/components/TextOverTooltip.vue +107 -107
  492. package/packages/table-filter/src/components/age-com/index.vue +205 -205
  493. package/packages/table-filter/src/components/button-group/ButtonGroup.vue +162 -162
  494. package/packages/table-filter/src/components/button-icon/button-icon.js +33 -33
  495. package/packages/table-filter/src/components/button-icon/getBtnIcon.js +34 -34
  496. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  497. package/packages/table-filter/src/components/drop-button/drop-button.vue +224 -224
  498. package/packages/table-filter/src/components/drop-button/head-btn-icon.js +33 -33
  499. package/packages/table-filter/src/components/drop-view/drop-view.vue +89 -89
  500. package/packages/table-filter/src/components/multi-select/multi-select.vue +227 -227
  501. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  502. package/packages/table-filter/src/components/range-age/index.vue +172 -172
  503. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +1897 -1897
  504. package/packages/table-filter/src/components/search-condition/fieldTypeList.js +169 -169
  505. package/packages/table-filter/src/components/search-filter/SearchFilter.vue +278 -278
  506. package/packages/table-filter/src/components/search-modal/set-classification.vue +310 -310
  507. package/packages/table-filter/src/components/table-modal/TableModal.vue +473 -463
  508. package/packages/table-filter/src/const/dataOptions.js +43 -43
  509. package/packages/table-filter/src/const/index.js +1 -1
  510. package/packages/table-filter/src/index.vue +584 -584
  511. package/packages/table-filter/src/mixins/mixins.js +694 -694
  512. package/packages/table-filter/src/mixins/tableSearchCon.js +128 -128
  513. package/packages/table-filter/src/mixins/wordBookutils.js +102 -102
  514. package/packages/table-filter/src/quick-search/QuickSearch.vue +2125 -2125
  515. package/packages/tabs/index.js +18 -18
  516. package/packages/tabs/src/TabPane.jsx +11 -11
  517. package/packages/tabs/src/Tabs.jsx +11 -11
  518. package/packages/tag/index.js +21 -21
  519. package/packages/tag/src/CheckableTag.jsx +11 -11
  520. package/packages/tag/src/Tag.jsx +11 -11
  521. package/packages/tag/src/TagGroup.vue +621 -621
  522. package/packages/time-picker/index.js +12 -12
  523. package/packages/time-picker/src/TimePicker.jsx +11 -11
  524. package/packages/timeline/index.js +14 -14
  525. package/packages/timeline/src/Item.jsx +11 -11
  526. package/packages/timeline/src/Timeline.jsx +11 -11
  527. package/packages/tooltip/index.js +12 -12
  528. package/packages/tooltip/src/Tooltip.jsx +11 -11
  529. package/packages/transfer/index.js +12 -12
  530. package/packages/transfer/src/Transfer.jsx +11 -11
  531. package/packages/tree/index.js +18 -18
  532. package/packages/tree/src/Tree.jsx +11 -11
  533. package/packages/tree/src/TreeNode.jsx +11 -11
  534. package/packages/tree-select/index.js +18 -18
  535. package/packages/tree-select/src/TreeNode.jsx +11 -11
  536. package/packages/tree-select/src/TreeSelect.jsx +11 -11
  537. package/packages/upload/chunk-upload/chunk-upload-new.vue +1001 -1001
  538. package/packages/upload/chunk-upload/vod-chunk-upload.vue +749 -749
  539. package/packages/upload/chunk-upload/vod-upload-modal.vue +100 -100
  540. package/packages/upload/index.js +12 -12
  541. package/packages/upload/src/Upload.jsx +11 -11
  542. package/packages/verification-code/SlideVerify.vue +306 -306
  543. package/packages/verification-code/index.js +17 -17
  544. package/packages/verification-code/verification-code.vue +147 -147
  545. package/src/component/player-vod/index.vue +57 -57
  546. package/src/component/player-vod/player.vue +188 -188
  547. package/src/component/player-vod/video-list.vue +262 -262
  548. package/src/component/player-vod/video-modal.vue +128 -128
  549. package/src/component/select-options/index.vue +430 -430
  550. package/src/component/select-pages/index.vue +95 -95
  551. package/src/component/svg/index.vue +59 -59
  552. package/src/core/create.js +6 -6
  553. package/src/core/event.js +23 -23
  554. package/src/core/table-methods.js +444 -444
  555. package/src/directive/flexibleResize.js +151 -151
  556. package/src/directive/preventReClick.js +12 -12
  557. package/src/directive/scroll.js +230 -230
  558. package/src/global/variable.js +2 -2
  559. package/src/style/normalize.css +424 -424
  560. package/src/style/style.less +49 -49
  561. package/src/utils/UniRTCv2.js +626 -626
  562. package/src/utils/chatFetch.js +61 -61
  563. package/src/utils/clickoutside.js +75 -75
  564. package/src/utils/crypto.js +25 -25
  565. package/src/utils/index.js +81 -81
  566. package/src/utils/kty-sdk.js +582 -582
  567. package/src/utils/kty.min-1.0.0.js +14378 -14378
  568. package/src/utils/sip-device.js +79 -79
  569. package/src/utils/time-domain.js +193 -193
  570. package/src/utils/trtc.js +1 -1
  571. package/src/utils/utils-map.js +484 -484
  572. package/src/utils/vexutils.js +836 -836
@@ -1,726 +1,726 @@
1
- <template>
2
- <div class="r-choice">
3
- <a-radio-group
4
- v-model="curvalue"
5
- v-if="item.type == 'RADIO_BLOCK' || item.type === 'EVALUATE_RADIO_BLOCK'"
6
- @change="radioChange"
7
- class="choice-wrap"
8
- :class="['choice-wrap-' + (item.setting.chooseStyleSetting || 1)]"
9
- >
10
- <a-radio
11
- v-for="(o, i) in curOptions"
12
- class="choice-radio"
13
- :value="o[choiceUseKey]"
14
- :key="o.key + i + o.label"
15
- :class="{ 'block-radio': !item.setting.isHorizontal }"
16
- :disabled="isLock"
17
- :style="{ color: choiceColor(o) }"
18
- >
19
- <template v-if="showImgWrap(o)">
20
- <span class="scale-choice-img-wrap">
21
- <img class="show-picture" :src="o.imageUrl" />
22
- <div class="scale-preview-wrap">
23
- <a-icon type="zoom-in" @click.stop.prevent="handlePreview(o.imageUrl, i)" />
24
- </div>
25
- </span>
26
- </template>
27
- <template>
28
- <template v-if="isRadioItem && showPreSuffix(o)">
29
- <span
30
- v-if="o.prefix"
31
- class="prefix-span"
32
- :style="{ color: choiceColor(o) }"
33
- >{{ o.prefix }}</span>
34
- <a-input
35
- v-model="optionsPreSuffixObj[o.key]"
36
- :disabled="isLock || inputLock"
37
- @change="inputPreSuffixChange(o, i)"
38
- :style="{ color: choiceColor(o) }"
39
- placeholder="请输入"
40
- />
41
- <span
42
- v-if="o.suffix"
43
- class="suffix-span"
44
- :style="{ color: choiceColor(o) }"
45
- >{{ o.suffix }}</span>
46
- </template>
47
- <span v-else :style="{ color: choiceColor(o) }">{{ o.label }}</span>
48
- <a-input
49
- v-if="o.importability"
50
- v-model="othersText"
51
- :disabled="isLock || inputLock"
52
- :style="{ color: choiceColor(o) }"
53
- placeholder="请输入"
54
- @change="inputChange"
55
- />
56
- </template>
57
- </a-radio>
58
- </a-radio-group>
59
- <a-checkbox-group
60
- v-else-if="item.type == 'CHECKBOX_BLOCK' || item.type === 'EVALUATE_CHECKBOX_BLOCK'"
61
- @change="checkboxChange"
62
- v-model="curCheckboxValue"
63
- class="choice-wrap"
64
- :class="['choice-wrap-' + (item.setting.chooseStyleSetting || 1)]"
65
- >
66
- <a-checkbox
67
- class="choice-checkbox"
68
- v-for="(o, i) in curOptions"
69
- :key="o.key + i + o.label"
70
- :value="o[choiceUseKey]"
71
- :class="{ 'block-checkbox': !item.setting.isHorizontal }"
72
- :disabled="isLock"
73
- :style="{ color: choiceColor(o) }"
74
- >
75
- <template v-if="showImgWrap(o)">
76
- <span class="scale-choice-img-wrap">
77
- <img class="show-picture" :src="o.imageUrl" />
78
- <div class="scale-preview-wrap">
79
- <a-icon type="zoom-in" @click.stop.prevent="handlePreview(o.imageUrl, i)" />
80
- </div>
81
- </span>
82
- </template>
83
- <template>
84
- <template v-if="isCheckboxItem && showPreSuffix(o)">
85
- <span
86
- v-if="o.prefix"
87
- class="prefix-span"
88
- :style="{ color: choiceColor(o) }"
89
- >{{ o.prefix }}</span>
90
- <a-input
91
- v-model="optionsPreSuffixObj[o.key]"
92
- :disabled="isLock || inputLock"
93
- @change="inputPreSuffixCheckboxChange(o, i)"
94
- :style="{ color: choiceColor(o) }"
95
- placeholder="请输入"
96
- />
97
- <span
98
- v-if="o.suffix"
99
- class="suffix-span"
100
- :style="{ color: choiceColor(o) }"
101
- >{{ o.suffix }}</span>
102
- </template>
103
- <span
104
- v-else
105
- style="white-space: initial;"
106
- :style="{ color: choiceColor(o) }"
107
- >{{ o.label }}</span>
108
- <a-input
109
- v-if="o.importability"
110
- v-model="othersText"
111
- :disabled="isLock || inputLock"
112
- :style="{ color: choiceColor(o) }"
113
- @change="inputCheckboxChange"
114
- placeholder="请输入"
115
- />
116
- </template>
117
- </a-checkbox>
118
- </a-checkbox-group>
119
- <a-select
120
- v-else-if="cloneItem.type == 'SELECT' || item.type === 'EVALUATE_SELECT'"
121
- v-model="choiceValue"
122
- placeholder="请选择"
123
- show-search
124
- :mode="showMulti"
125
- :disabled="isLock"
126
- @search="handleSearch"
127
- @change="handleSelectChange"
128
- :getPopupContainer="getPopupContainer"
129
- :filterOption="filterOption"
130
- :notFoundContent="fetching ? undefined : '暂无数据'"
131
- >
132
- <a-spin v-if="fetching" slot="notFoundContent" size="small" />
133
- <a-select-option v-for="(v, i) in curOptions" :key="i" :value="v[columnKey]">{{ v[labelKey] }}</a-select-option>
134
- </a-select>
135
- <a-cascader
136
- v-else-if="cloneItem.type == 'SEARCH_CASCADE'"
137
- v-model="choiceValue"
138
- class="m-cascader"
139
- placeholder="请选择"
140
- :options="curOptions"
141
- :disabled="isLock"
142
- change-on-select
143
- />
144
-
145
- <!-- 图片预览 -->
146
- <viewer
147
- class="viewer"
148
- ref="viewer"
149
- :images="previewImages"
150
- @inited="inited"
151
- style="display: none"
152
- >
153
- <template slot-scope="scope">
154
- <img v-for="src in scope.images" :src="src" :key="src" />
155
- </template>
156
- </viewer>
157
- </div>
158
- </template>
159
-
160
- <script>
161
- /**
162
- * getSelectOptions 获取下拉框数据的 function
163
- * getSearchOptions 关键字检索的 function
164
- * getCascadeOptions 获取级联数据的 furnction
165
- */
166
- import { Select, Input, Radio, Checkbox, Cascader } from 'ant-design-vue';
167
- import { judgeTypes } from '../mixin/judgeTypes';
168
- // import format from "@/components/table/mixins/format";
169
- // import TextOverTooltip from "./text-over-tooltip/TextOverTooltip.vue";
170
- import utils from '@/utils/utils-map';
171
- import axios from 'axios';
172
- import 'viewerjs/dist/viewer.css';
173
- import { component as Viewer } from 'v-viewer';
174
- export default {
175
- mixins: [judgeTypes],
176
- props: {
177
- value: { default: undefined, type: [String, Array, Number] },
178
- item: { type: Object, default: () => {} },
179
- isLock: { type: Boolean, default: false },
180
- inputLock: { type: Boolean, default: false },
181
- curIndex: Number,
182
- getSelectOptions: {
183
- type: Function,
184
- default: () => Promise.resolve([])
185
- },
186
- getSearchOptions: {
187
- type: Function,
188
- default: () => Promise.resolve([])
189
- },
190
- getCascadeOptions: {
191
- type: Function,
192
- default: () => Promise.resolve([])
193
- },
194
- openType: { type: String, default: '' }
195
- },
196
- components: {
197
- Viewer,
198
- [Input.name]: Input,
199
- [Cascader.name]: Cascader,
200
- [Checkbox.name]: Checkbox,
201
- [Checkbox.Group.name]: Checkbox.Group,
202
- [Radio.name]: Radio,
203
- [Radio.Group.name]: Radio.Group,
204
- [Select.name]: Select,
205
- [Select.Option.name]: Select.Option
206
- },
207
- computed: {
208
- choiceValue: {
209
- get() {
210
- return this.value ? this.value : undefined;
211
- },
212
- set(val) {
213
- this.$emit('input', val);
214
- }
215
- },
216
- choiceUseKey() {
217
- if (this.item.type === 'RADIO_BLOCK' || this.item.type === 'CHECKBOX_BLOCK') return 'key';
218
- return 'value';
219
- },
220
- choiceColor() {
221
- return function (p) {
222
- let color = p.color || 'rgba(0, 0, 0, 0.65)';
223
- return `${color} !important`;
224
- };
225
- },
226
- showImgWrap() {
227
- return function (o) {
228
- return !o.prefix && !o.suffix && o.imageUrl;
229
- };
230
- },
231
- isRadioItem() {
232
- return this.item.type === 'RADIO_BLOCK';
233
- },
234
- isCheckboxItem() {
235
- return this.item.type === 'CHECKBOX_BLOCK';
236
- },
237
- showPreSuffix() {
238
- return function (o) {
239
- return o.prefix || o.suffix;
240
- };
241
- },
242
- isDynamic2Static() {
243
- // 分享链接的量表用 optionType 1:静态,2:动态,3:动态转静态
244
- let { targetSource = {}, options = [], optionType } = this.item || {};
245
- if (targetSource.target_id && (options.length || optionType == 3)) return true;
246
- return false;
247
- },
248
- isMultiple() {
249
- return this.item?.setting?.isMultiple;
250
- },
251
- showMulti() {
252
- return this.isMultiple ? 'multiple' : 'default';
253
- },
254
- // 取值字段
255
- columnKey() {
256
- let { target_id, values } = this.item?.targetSource || {};
257
- if (!target_id || !values) return 'value';
258
- if (this.isDynamic2Static) return values || 'value';
259
- return values;
260
- },
261
- // 显示字段
262
- labelKey() {
263
- let { target_id, showField } = this.item?.targetSource || {};
264
- if (!target_id || !showField) return 'label';
265
- if (this.isDynamic2Static) return showField || 'label';
266
- return showField;
267
- }
268
- },
269
- watch: {
270
- item: {
271
- immediate: true,
272
- deep: true,
273
- handler(value) {
274
- if (!value || !Object.keys(value).length) return;
275
- this.init(JSON.parse(JSON.stringify(value)));
276
- }
277
- }
278
- },
279
- data() {
280
- return {
281
- selectParams: { tableType: 'TABLE_LIST', pageSize: 20, page: 1 },
282
- cascaderParams: { tableType: 'TABLE_LIST' },
283
- cloneItem: {},
284
- curvalue: '',
285
- curCheckboxValue: [],
286
- othersText: '',
287
- curOptions: [],
288
- fieldList: [],
289
- buttonList: [],
290
- source: 'guageChoice',
291
- fetching: false,
292
- previewImages: [],
293
- optionsPreSuffixObj: {}
294
- };
295
- },
296
- methods: {
297
- init(value) {
298
- let options = value.options || [];
299
- if (this.isEvaluation(value.type)) {
300
- options = value.scoreConfigs?.scoreRules || [];
301
- }
302
- if (value.type === 'RADIO_BLOCK' || value.type === 'EVALUATE_RADIO_BLOCK') {
303
- const defVal = value.dbValue || value.setting.defaultValue || this.value;
304
- this.handleRadioDef(value, defVal, options);
305
- return;
306
- }
307
- if (value.type === 'CHECKBOX_BLOCK' || value.type === 'EVALUATE_CHECKBOX_BLOCK') {
308
- let defVal = [];
309
- if (utils.isJSON(value.setting.defaultValue)) {
310
- defVal = JSON.parse(value.setting.defaultValue);
311
- } else {
312
- defVal = this.value;
313
- }
314
- this.handleCheckboxDef(value, value.dbValue || defVal, options);
315
- return;
316
- }
317
- if (value.type == 'SELECT' || value.type == 'SEARCH_CASCADE' || value.type === 'EVALUATE_SELECT') {
318
- this.cloneItem = JSON.parse(JSON.stringify(value));
319
- let options = this.cloneItem.options || [];
320
- if (this.isEvaluation(value.type)) {
321
- options = this.cloneItem.scoreConfigs?.scoreRules || [];
322
- }
323
- this.curOptions = options;
324
- this.initSelectOptions();
325
- }
326
- },
327
- handleRadioDef(item, curValue, options) {
328
- this.curOptions = this.handleOptions(options, item.type);
329
- if (!options.length || !curValue) return;
330
- // 测评单选回显
331
- if (item.type === 'EVALUATE_RADIO_BLOCK') {
332
- this.curvalue = curValue;
333
- this.radioChange();
334
- return;
335
- }
336
- // 普通单选回显 普通选项/其它/前后缀 所以用key标识
337
- let hasOther = options.find(v => v.value === curValue);
338
- if (hasOther) {
339
- this.curvalue = hasOther.key;
340
- this.radioChange();
341
- return;
342
- }
343
- let preSuffixItem = options.find((v, i) => {
344
- let res = this.handleDefPreSuffix(v, i, curValue);
345
- if (res) {
346
- this.curvalue = res;
347
- }
348
- return !!res || false;
349
- });
350
- if (!preSuffixItem) {
351
- this.othersText = curValue;
352
- this.curvalue = 'other';
353
- }
354
- this.radioChange();
355
- },
356
- handleDefPreSuffix(v, i, curValue, isCheckbox, hasOther) {
357
- if (v.prefix || v.suffix) {
358
- let value = v.value;
359
- // 有前后缀的option input为必填, 如果直接相等则为other
360
- if (value === curValue) return false;
361
- if (v.prefix) {
362
- if (curValue.indexOf(v.prefix) === 0) {
363
- let inputValue = curValue.substring(v.prefix.length);
364
- this.$set(this.optionsPreSuffixObj, v.key, inputValue);
365
- return v.key;
366
- }
367
- }
368
- if (v.suffix) {
369
- let lastIndexOf = curValue.lastIndexOf(v.suffix);
370
- lastIndexOf + v.suffix.length;
371
- if (curValue.length === lastIndexOf + v.suffix.length) {
372
- let index = curValue.lastIndexOf(v.suffix);
373
- let inputValue = curValue.substring(0, index);
374
- this.$set(this.optionsPreSuffixObj, v.key, inputValue);
375
- return v.key;
376
- }
377
- }
378
- }
379
- if (curValue === v.value) return v.key;
380
- if (isCheckbox && hasOther) {
381
- this.othersText = curValue;
382
- return 'other';
383
- }
384
- },
385
- async handleCheckboxDef(item, curValue, options) {
386
- this.curOptions = this.handleOptions(options, item.type);
387
- if (!options.length || !curValue || !curValue.length) return;
388
- // 测评多选回显
389
- if (item.type === 'EVALUATE_CHECKBOX_BLOCK') {
390
- this.curCheckboxValue = curValue;
391
- this.handleCheckboxOther();
392
- return;
393
- }
394
- // 普通多选回显 普通选项/其它/前后缀 所以用key标识
395
- let resArr = [],
396
- i = 0,
397
- x,
398
- len = curValue.length;
399
- let hasOther = options.some(v => v.importability || v.key === 'other');
400
- for (; i < len; i++) {
401
- x = curValue[i];
402
- if (x === '其他') {
403
- this.othersText = x;
404
- this.curvalue = 'other';
405
- !resArr.includes('other') && resArr.push('other');
406
- continue;
407
- }
408
- let matchIndex = options.findIndex(v => v.value === x);
409
- if (matchIndex > 0) {
410
- let res = options[matchIndex]?.key;
411
- !resArr.includes(res) && resArr.push(res);
412
- continue;
413
- }
414
- options.map(v => {
415
- let res = this.handleDefPreSuffix(v, i, x, true, hasOther);
416
- res && !resArr.includes(res) && resArr.push(res);
417
- });
418
- }
419
- this.curCheckboxValue = resArr;
420
- this.handleCheckboxOther();
421
- },
422
- handleOptions(options, type) {
423
- return (
424
- options
425
- .map((v, i) => {
426
- if (v.prefix || v.suffix) {
427
- this.$set(this.optionsPreSuffixObj, v.key, undefined);
428
- return v;
429
- }
430
- if (v.label) return v;
431
- return null;
432
- })
433
- .filter(Boolean) || []
434
- );
435
- },
436
- radioChange() {
437
- let choiceObj = {
438
- othersText: this.othersText,
439
- optionsPreSuffixObj: this.optionsPreSuffixObj
440
- };
441
- this.$emit('radioChange', this.curvalue, this.item, choiceObj);
442
- },
443
- checkboxChange() {
444
- this.handleCheckboxOther();
445
- },
446
- inputChange() {
447
- let choiceObj = {
448
- othersText: this.othersText,
449
- optionsPreSuffixObj: this.optionsPreSuffixObj
450
- };
451
- this.curvalue = 'other';
452
- this.$emit('radioChange', 'other', this.item, choiceObj);
453
- },
454
- inputPreSuffixChange(o, i) {
455
- this.curvalue = o.key;
456
- let choiceObj = {
457
- othersText: this.othersText,
458
- optionsPreSuffixObj: this.optionsPreSuffixObj
459
- };
460
- this.$emit('radioChange', this.curvalue, this.item, choiceObj);
461
- },
462
- inputPreSuffixCheckboxChange(o, i) {
463
- let choiceObj = {
464
- othersText: this.othersText,
465
- optionsPreSuffixObj: this.optionsPreSuffixObj
466
- };
467
- if (!this.curCheckboxValue.includes(o.key)) {
468
- this.curCheckboxValue.push(o.key);
469
- }
470
- let curCheckboxValue = JSON.parse(JSON.stringify(this.curCheckboxValue));
471
- this.$emit('checkboxChange', curCheckboxValue, this.item, choiceObj);
472
- },
473
- inputCheckboxChange() {
474
- this.handleCheckboxOther(true);
475
- },
476
- handleCheckboxOther(isOtherInput) {
477
- let choiceObj = {
478
- othersText: this.othersText,
479
- optionsPreSuffixObj: this.optionsPreSuffixObj
480
- };
481
- if (isOtherInput && !this.curCheckboxValue.includes('other')) {
482
- this.curCheckboxValue.push('other');
483
- }
484
- let curCheckboxValue = JSON.parse(JSON.stringify(this.curCheckboxValue));
485
- this.$emit('checkboxChange', curCheckboxValue, this.item, choiceObj);
486
- },
487
- async initSelectOptions() {
488
- // 分享链接的量表用 optionType 1:静态,2:动态,3:动态转静态
489
- const { targetSource, type, options = [], optionType = 1 } = this.cloneItem;
490
- if (!targetSource?.target_id) return;
491
- // 动态数据源转静态数据
492
- if (type == 'SELECT' && this.isDynamic2Static) {
493
- this.curOptions = this.handleDynamic2StaticOptions(options);
494
- return;
495
- }
496
- if (type === 'SELECT') {
497
- this.fetching = true;
498
- this.curOptions = await this.getSelectOptions(this.cloneItem);
499
- this.fetching = false;
500
- } else {
501
- this.curOptions = await this.getCascadeOptions(this.cloneItem);
502
- }
503
- },
504
- handleDynamic2StaticOptions(options) {
505
- if (!options || !options.length) return [];
506
- let arr = options.map(item => {
507
- if ('cascadeData' in item) {
508
- Object.assign(item, {
509
- ...item.cascadeData
510
- });
511
- }
512
- // 容错 没有配置的key 添加一个
513
- if (!(this.columnKey in item)) {
514
- item[this.columnKey] = item.value || item.label;
515
- }
516
- if (!(this.labelKey in item)) {
517
- item[this.labelKey] = item.label;
518
- }
519
- return item;
520
- });
521
-
522
- return this.uniqArrObj(arr, this.columnKey);
523
- },
524
- // 数组对象去重
525
- uniqArrObj(arr, name = "value") {
526
- let obj = {};
527
- return arr.reduce((cur, next) => {
528
- obj[next[name]] ? "" : (obj[next[name]] = true && cur.push(next));
529
- return cur;
530
- }, []);
531
- },
532
- // 下拉组件搜索
533
- async handleSearch(value) {
534
- try {
535
- // 动态数据源转静态数据
536
- if (this.cloneItem?.type == 'SELECT' && this.isDynamic2Static) return
537
- this.curOptions = await this.getSearchOptions(
538
- {
539
- values: this.columnKey,
540
- showField: this.labelKey,
541
- keyword: value
542
- },
543
- this.cloneItem
544
- );
545
- console.log(this.curOptions, 'curOptions');
546
- } catch (error) {
547
- console.log(error);
548
- }
549
- },
550
- // 下拉组件选值
551
- handleSelectChange(value) {
552
- let res = {
553
- value: '',
554
- list: []
555
- };
556
- let matchItem;
557
- if (Array.isArray(value)) {
558
- res.value = value;
559
- if (!value.length) {
560
- res.list = [];
561
- } else {
562
- value.forEach(item => {
563
- matchItem = this.curOptions.find(v => v.value === item);
564
- if (matchItem) {
565
- res.list.push(matchItem);
566
- }
567
- });
568
- }
569
- } else {
570
- res.value = value;
571
- matchItem = this.curOptions.find(v => v.value === value);
572
- if (matchItem) {
573
- res.list.push(matchItem);
574
- }
575
- }
576
- this.$emit('change', res);
577
- },
578
- filterOption(input, option) {
579
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
580
- },
581
- getPopupContainer(triggerNode) {
582
- if (this.openType == 'formIframe') {
583
- return document.body;
584
- }
585
- return triggerNode.parentNode;
586
- },
587
- inited(viewer) {
588
- this.$viewer = viewer;
589
- },
590
- handlePreview(url, i) {
591
- let imgs = this.curOptions.map(v => v.imageUrl);
592
- if (!imgs.length) return;
593
- this.previewImages = imgs;
594
- this.$viewer.index = i;
595
- this.$viewer.show();
596
- }
597
- }
598
- };
599
- </script>
600
-
601
- <style lang="less" scoped>
602
- .r-choice {
603
- /deep/ .ant-radio-group {
604
- width: 100%;
605
- }
606
- /deep/ .choice-radio,
607
- /deep/ .choice-checkbox {
608
- display: inline-flex;
609
- align-items: center;
610
- margin-bottom: 5px;
611
- margin-right: 8px;
612
- margin-left: 0px;
613
- > span:last-child {
614
- flex: 1;
615
- display: inline-flex;
616
- align-items: center;
617
- word-break: break-all;
618
- }
619
- input {
620
- height: 100%;
621
- flex: 1;
622
- background: transparent;
623
- border-radius: 0;
624
- border-color: transparent !important;
625
- border-bottom: 1px solid #d9d9d9 !important;
626
- }
627
- .prefix-span {
628
- padding-right: 8px;
629
- }
630
- .suffix-span {
631
- padding-left: 8px;
632
- }
633
- }
634
-
635
- /deep/ .block-radio,
636
- /deep/ .block-checkbox {
637
- display: flex;
638
- margin-left: 8px;
639
- }
640
- /deep/ .ant-select {
641
- min-width: 160px;
642
- }
643
- /deep/ .ant-select ~ div {
644
- position: relative !important;
645
- }
646
- /deep/.ant-select-dropdown {
647
- top: 0px !important;
648
- left: 1px !important;
649
- }
650
- .choice-wrap {
651
- display: flex;
652
- flex-wrap: wrap;
653
- .scale-choice-img-wrap {
654
- position: relative;
655
- width: 74px;
656
- min-width: 74px;
657
- height: 62px;
658
- background: #ffffff;
659
- border-radius: 4px;
660
- border: 1px solid #d5d5d5;
661
- margin-right: 16px;
662
- &:hover {
663
- .scale-preview-wrap {
664
- display: flex;
665
- }
666
- }
667
- > img {
668
- width: 100%;
669
- height: 100%;
670
- object-fit: cover;
671
- }
672
- .scale-preview-wrap {
673
- position: absolute;
674
- top: 0;
675
- left: 0;
676
- right: 0;
677
- bottom: 0;
678
- display: none;
679
- justify-content: center;
680
- align-items: center;
681
- background: rgba(0, 0, 0, 0.75);
682
- border-radius: 8px;
683
- font-size: 20px;
684
- i.anticon {
685
- color: #fff;
686
- margin: 0px;
687
- }
688
- }
689
- }
690
- /deep/ .choose-value .el-tooltip.ellipsis {
691
- color: rgba(0, 0, 0, 0.65);
692
- font-size: 14px;
693
- }
694
- label {
695
- margin: 4px 0;
696
- }
697
- /deep/.ant-radio-wrapper span.ant-radio + * {
698
- display: inline-flex;
699
- align-items: center;
700
- white-space: initial;
701
- }
702
- &.choice-wrap-1 label {
703
- width: 100%;
704
- /deep/ input {
705
- max-width: 300px;
706
- }
707
- }
708
- &.choice-wrap-2 label {
709
- width: 50%;
710
- }
711
- &.choice-wrap-3 label {
712
- width: 33%;
713
- }
714
- &.choice-wrap-4 label {
715
- width: 25%;
716
- }
717
- /deep/ .ant-checkbox {
718
- // margin-top: -0.2em;
719
- margin-top: 5px;
720
- }
721
- /deep/ .ant-checkbox-inner {
722
- vertical-align: top;
723
- }
724
- }
725
- }
726
- </style>
1
+ <template>
2
+ <div class="r-choice">
3
+ <a-radio-group
4
+ v-model="curvalue"
5
+ v-if="item.type == 'RADIO_BLOCK' || item.type === 'EVALUATE_RADIO_BLOCK'"
6
+ @change="radioChange"
7
+ class="choice-wrap"
8
+ :class="['choice-wrap-' + (item.setting.chooseStyleSetting || 1)]"
9
+ >
10
+ <a-radio
11
+ v-for="(o, i) in curOptions"
12
+ class="choice-radio"
13
+ :value="o[choiceUseKey]"
14
+ :key="o.key + i + o.label"
15
+ :class="{ 'block-radio': !item.setting.isHorizontal }"
16
+ :disabled="isLock"
17
+ :style="{ color: choiceColor(o) }"
18
+ >
19
+ <template v-if="showImgWrap(o)">
20
+ <span class="scale-choice-img-wrap">
21
+ <img class="show-picture" :src="o.imageUrl" />
22
+ <div class="scale-preview-wrap">
23
+ <a-icon type="zoom-in" @click.stop.prevent="handlePreview(o.imageUrl, i)" />
24
+ </div>
25
+ </span>
26
+ </template>
27
+ <template>
28
+ <template v-if="isRadioItem && showPreSuffix(o)">
29
+ <span
30
+ v-if="o.prefix"
31
+ class="prefix-span"
32
+ :style="{ color: choiceColor(o) }"
33
+ >{{ o.prefix }}</span>
34
+ <a-input
35
+ v-model="optionsPreSuffixObj[o.key]"
36
+ :disabled="isLock || inputLock"
37
+ @change="inputPreSuffixChange(o, i)"
38
+ :style="{ color: choiceColor(o) }"
39
+ placeholder="请输入"
40
+ />
41
+ <span
42
+ v-if="o.suffix"
43
+ class="suffix-span"
44
+ :style="{ color: choiceColor(o) }"
45
+ >{{ o.suffix }}</span>
46
+ </template>
47
+ <span v-else :style="{ color: choiceColor(o) }">{{ o.label }}</span>
48
+ <a-input
49
+ v-if="o.importability"
50
+ v-model="othersText"
51
+ :disabled="isLock || inputLock"
52
+ :style="{ color: choiceColor(o) }"
53
+ placeholder="请输入"
54
+ @change="inputChange"
55
+ />
56
+ </template>
57
+ </a-radio>
58
+ </a-radio-group>
59
+ <a-checkbox-group
60
+ v-else-if="item.type == 'CHECKBOX_BLOCK' || item.type === 'EVALUATE_CHECKBOX_BLOCK'"
61
+ @change="checkboxChange"
62
+ v-model="curCheckboxValue"
63
+ class="choice-wrap"
64
+ :class="['choice-wrap-' + (item.setting.chooseStyleSetting || 1)]"
65
+ >
66
+ <a-checkbox
67
+ class="choice-checkbox"
68
+ v-for="(o, i) in curOptions"
69
+ :key="o.key + i + o.label"
70
+ :value="o[choiceUseKey]"
71
+ :class="{ 'block-checkbox': !item.setting.isHorizontal }"
72
+ :disabled="isLock"
73
+ :style="{ color: choiceColor(o) }"
74
+ >
75
+ <template v-if="showImgWrap(o)">
76
+ <span class="scale-choice-img-wrap">
77
+ <img class="show-picture" :src="o.imageUrl" />
78
+ <div class="scale-preview-wrap">
79
+ <a-icon type="zoom-in" @click.stop.prevent="handlePreview(o.imageUrl, i)" />
80
+ </div>
81
+ </span>
82
+ </template>
83
+ <template>
84
+ <template v-if="isCheckboxItem && showPreSuffix(o)">
85
+ <span
86
+ v-if="o.prefix"
87
+ class="prefix-span"
88
+ :style="{ color: choiceColor(o) }"
89
+ >{{ o.prefix }}</span>
90
+ <a-input
91
+ v-model="optionsPreSuffixObj[o.key]"
92
+ :disabled="isLock || inputLock"
93
+ @change="inputPreSuffixCheckboxChange(o, i)"
94
+ :style="{ color: choiceColor(o) }"
95
+ placeholder="请输入"
96
+ />
97
+ <span
98
+ v-if="o.suffix"
99
+ class="suffix-span"
100
+ :style="{ color: choiceColor(o) }"
101
+ >{{ o.suffix }}</span>
102
+ </template>
103
+ <span
104
+ v-else
105
+ style="white-space: initial;"
106
+ :style="{ color: choiceColor(o) }"
107
+ >{{ o.label }}</span>
108
+ <a-input
109
+ v-if="o.importability"
110
+ v-model="othersText"
111
+ :disabled="isLock || inputLock"
112
+ :style="{ color: choiceColor(o) }"
113
+ @change="inputCheckboxChange"
114
+ placeholder="请输入"
115
+ />
116
+ </template>
117
+ </a-checkbox>
118
+ </a-checkbox-group>
119
+ <a-select
120
+ v-else-if="cloneItem.type == 'SELECT' || item.type === 'EVALUATE_SELECT'"
121
+ v-model="choiceValue"
122
+ placeholder="请选择"
123
+ show-search
124
+ :mode="showMulti"
125
+ :disabled="isLock"
126
+ @search="handleSearch"
127
+ @change="handleSelectChange"
128
+ :getPopupContainer="getPopupContainer"
129
+ :filterOption="filterOption"
130
+ :notFoundContent="fetching ? undefined : '暂无数据'"
131
+ >
132
+ <a-spin v-if="fetching" slot="notFoundContent" size="small" />
133
+ <a-select-option v-for="(v, i) in curOptions" :key="i" :value="v[columnKey]">{{ v[labelKey] }}</a-select-option>
134
+ </a-select>
135
+ <a-cascader
136
+ v-else-if="cloneItem.type == 'SEARCH_CASCADE'"
137
+ v-model="choiceValue"
138
+ class="m-cascader"
139
+ placeholder="请选择"
140
+ :options="curOptions"
141
+ :disabled="isLock"
142
+ change-on-select
143
+ />
144
+
145
+ <!-- 图片预览 -->
146
+ <viewer
147
+ class="viewer"
148
+ ref="viewer"
149
+ :images="previewImages"
150
+ @inited="inited"
151
+ style="display: none"
152
+ >
153
+ <template slot-scope="scope">
154
+ <img v-for="src in scope.images" :src="src" :key="src" />
155
+ </template>
156
+ </viewer>
157
+ </div>
158
+ </template>
159
+
160
+ <script>
161
+ /**
162
+ * getSelectOptions 获取下拉框数据的 function
163
+ * getSearchOptions 关键字检索的 function
164
+ * getCascadeOptions 获取级联数据的 furnction
165
+ */
166
+ import { Select, Input, Radio, Checkbox, Cascader } from 'ant-design-vue';
167
+ import { judgeTypes } from '../mixin/judgeTypes';
168
+ // import format from "@/components/table/mixins/format";
169
+ // import TextOverTooltip from "./text-over-tooltip/TextOverTooltip.vue";
170
+ import utils from '@/utils/utils-map';
171
+ import axios from 'axios';
172
+ import 'viewerjs/dist/viewer.css';
173
+ import { component as Viewer } from 'v-viewer';
174
+ export default {
175
+ mixins: [judgeTypes],
176
+ props: {
177
+ value: { default: undefined, type: [String, Array, Number] },
178
+ item: { type: Object, default: () => {} },
179
+ isLock: { type: Boolean, default: false },
180
+ inputLock: { type: Boolean, default: false },
181
+ curIndex: Number,
182
+ getSelectOptions: {
183
+ type: Function,
184
+ default: () => Promise.resolve([])
185
+ },
186
+ getSearchOptions: {
187
+ type: Function,
188
+ default: () => Promise.resolve([])
189
+ },
190
+ getCascadeOptions: {
191
+ type: Function,
192
+ default: () => Promise.resolve([])
193
+ },
194
+ openType: { type: String, default: '' }
195
+ },
196
+ components: {
197
+ Viewer,
198
+ [Input.name]: Input,
199
+ [Cascader.name]: Cascader,
200
+ [Checkbox.name]: Checkbox,
201
+ [Checkbox.Group.name]: Checkbox.Group,
202
+ [Radio.name]: Radio,
203
+ [Radio.Group.name]: Radio.Group,
204
+ [Select.name]: Select,
205
+ [Select.Option.name]: Select.Option
206
+ },
207
+ computed: {
208
+ choiceValue: {
209
+ get() {
210
+ return this.value ? this.value : undefined;
211
+ },
212
+ set(val) {
213
+ this.$emit('input', val);
214
+ }
215
+ },
216
+ choiceUseKey() {
217
+ if (this.item.type === 'RADIO_BLOCK' || this.item.type === 'CHECKBOX_BLOCK') return 'key';
218
+ return 'value';
219
+ },
220
+ choiceColor() {
221
+ return function (p) {
222
+ let color = p.color || 'rgba(0, 0, 0, 0.65)';
223
+ return `${color} !important`;
224
+ };
225
+ },
226
+ showImgWrap() {
227
+ return function (o) {
228
+ return !o.prefix && !o.suffix && o.imageUrl;
229
+ };
230
+ },
231
+ isRadioItem() {
232
+ return this.item.type === 'RADIO_BLOCK';
233
+ },
234
+ isCheckboxItem() {
235
+ return this.item.type === 'CHECKBOX_BLOCK';
236
+ },
237
+ showPreSuffix() {
238
+ return function (o) {
239
+ return o.prefix || o.suffix;
240
+ };
241
+ },
242
+ isDynamic2Static() {
243
+ // 分享链接的量表用 optionType 1:静态,2:动态,3:动态转静态
244
+ let { targetSource = {}, options = [], optionType } = this.item || {};
245
+ if (targetSource.target_id && (options.length || optionType == 3)) return true;
246
+ return false;
247
+ },
248
+ isMultiple() {
249
+ return this.item?.setting?.isMultiple;
250
+ },
251
+ showMulti() {
252
+ return this.isMultiple ? 'multiple' : 'default';
253
+ },
254
+ // 取值字段
255
+ columnKey() {
256
+ let { target_id, values } = this.item?.targetSource || {};
257
+ if (!target_id || !values) return 'value';
258
+ if (this.isDynamic2Static) return values || 'value';
259
+ return values;
260
+ },
261
+ // 显示字段
262
+ labelKey() {
263
+ let { target_id, showField } = this.item?.targetSource || {};
264
+ if (!target_id || !showField) return 'label';
265
+ if (this.isDynamic2Static) return showField || 'label';
266
+ return showField;
267
+ }
268
+ },
269
+ watch: {
270
+ item: {
271
+ immediate: true,
272
+ deep: true,
273
+ handler(value) {
274
+ if (!value || !Object.keys(value).length) return;
275
+ this.init(JSON.parse(JSON.stringify(value)));
276
+ }
277
+ }
278
+ },
279
+ data() {
280
+ return {
281
+ selectParams: { tableType: 'TABLE_LIST', pageSize: 20, page: 1 },
282
+ cascaderParams: { tableType: 'TABLE_LIST' },
283
+ cloneItem: {},
284
+ curvalue: '',
285
+ curCheckboxValue: [],
286
+ othersText: '',
287
+ curOptions: [],
288
+ fieldList: [],
289
+ buttonList: [],
290
+ source: 'guageChoice',
291
+ fetching: false,
292
+ previewImages: [],
293
+ optionsPreSuffixObj: {}
294
+ };
295
+ },
296
+ methods: {
297
+ init(value) {
298
+ let options = value.options || [];
299
+ if (this.isEvaluation(value.type)) {
300
+ options = value.scoreConfigs?.scoreRules || [];
301
+ }
302
+ if (value.type === 'RADIO_BLOCK' || value.type === 'EVALUATE_RADIO_BLOCK') {
303
+ const defVal = value.dbValue || value.setting.defaultValue || this.value;
304
+ this.handleRadioDef(value, defVal, options);
305
+ return;
306
+ }
307
+ if (value.type === 'CHECKBOX_BLOCK' || value.type === 'EVALUATE_CHECKBOX_BLOCK') {
308
+ let defVal = [];
309
+ if (utils.isJSON(value.setting.defaultValue)) {
310
+ defVal = JSON.parse(value.setting.defaultValue);
311
+ } else {
312
+ defVal = this.value;
313
+ }
314
+ this.handleCheckboxDef(value, value.dbValue || defVal, options);
315
+ return;
316
+ }
317
+ if (value.type == 'SELECT' || value.type == 'SEARCH_CASCADE' || value.type === 'EVALUATE_SELECT') {
318
+ this.cloneItem = JSON.parse(JSON.stringify(value));
319
+ let options = this.cloneItem.options || [];
320
+ if (this.isEvaluation(value.type)) {
321
+ options = this.cloneItem.scoreConfigs?.scoreRules || [];
322
+ }
323
+ this.curOptions = options;
324
+ this.initSelectOptions();
325
+ }
326
+ },
327
+ handleRadioDef(item, curValue, options) {
328
+ this.curOptions = this.handleOptions(options, item.type);
329
+ if (!options.length || !curValue) return;
330
+ // 测评单选回显
331
+ if (item.type === 'EVALUATE_RADIO_BLOCK') {
332
+ this.curvalue = curValue;
333
+ this.radioChange();
334
+ return;
335
+ }
336
+ // 普通单选回显 普通选项/其它/前后缀 所以用key标识
337
+ let hasOther = options.find(v => v.value === curValue);
338
+ if (hasOther) {
339
+ this.curvalue = hasOther.key;
340
+ this.radioChange();
341
+ return;
342
+ }
343
+ let preSuffixItem = options.find((v, i) => {
344
+ let res = this.handleDefPreSuffix(v, i, curValue);
345
+ if (res) {
346
+ this.curvalue = res;
347
+ }
348
+ return !!res || false;
349
+ });
350
+ if (!preSuffixItem) {
351
+ this.othersText = curValue;
352
+ this.curvalue = 'other';
353
+ }
354
+ this.radioChange();
355
+ },
356
+ handleDefPreSuffix(v, i, curValue, isCheckbox, hasOther) {
357
+ if (v.prefix || v.suffix) {
358
+ let value = v.value;
359
+ // 有前后缀的option input为必填, 如果直接相等则为other
360
+ if (value === curValue) return false;
361
+ if (v.prefix) {
362
+ if (curValue.indexOf(v.prefix) === 0) {
363
+ let inputValue = curValue.substring(v.prefix.length);
364
+ this.$set(this.optionsPreSuffixObj, v.key, inputValue);
365
+ return v.key;
366
+ }
367
+ }
368
+ if (v.suffix) {
369
+ let lastIndexOf = curValue.lastIndexOf(v.suffix);
370
+ lastIndexOf + v.suffix.length;
371
+ if (curValue.length === lastIndexOf + v.suffix.length) {
372
+ let index = curValue.lastIndexOf(v.suffix);
373
+ let inputValue = curValue.substring(0, index);
374
+ this.$set(this.optionsPreSuffixObj, v.key, inputValue);
375
+ return v.key;
376
+ }
377
+ }
378
+ }
379
+ if (curValue === v.value) return v.key;
380
+ if (isCheckbox && hasOther) {
381
+ this.othersText = curValue;
382
+ return 'other';
383
+ }
384
+ },
385
+ async handleCheckboxDef(item, curValue, options) {
386
+ this.curOptions = this.handleOptions(options, item.type);
387
+ if (!options.length || !curValue || !curValue.length) return;
388
+ // 测评多选回显
389
+ if (item.type === 'EVALUATE_CHECKBOX_BLOCK') {
390
+ this.curCheckboxValue = curValue;
391
+ this.handleCheckboxOther();
392
+ return;
393
+ }
394
+ // 普通多选回显 普通选项/其它/前后缀 所以用key标识
395
+ let resArr = [],
396
+ i = 0,
397
+ x,
398
+ len = curValue.length;
399
+ let hasOther = options.some(v => v.importability || v.key === 'other');
400
+ for (; i < len; i++) {
401
+ x = curValue[i];
402
+ if (x === '其他') {
403
+ this.othersText = x;
404
+ this.curvalue = 'other';
405
+ !resArr.includes('other') && resArr.push('other');
406
+ continue;
407
+ }
408
+ let matchIndex = options.findIndex(v => v.value === x);
409
+ if (matchIndex > 0) {
410
+ let res = options[matchIndex]?.key;
411
+ !resArr.includes(res) && resArr.push(res);
412
+ continue;
413
+ }
414
+ options.map(v => {
415
+ let res = this.handleDefPreSuffix(v, i, x, true, hasOther);
416
+ res && !resArr.includes(res) && resArr.push(res);
417
+ });
418
+ }
419
+ this.curCheckboxValue = resArr;
420
+ this.handleCheckboxOther();
421
+ },
422
+ handleOptions(options, type) {
423
+ return (
424
+ options
425
+ .map((v, i) => {
426
+ if (v.prefix || v.suffix) {
427
+ this.$set(this.optionsPreSuffixObj, v.key, undefined);
428
+ return v;
429
+ }
430
+ if (v.label) return v;
431
+ return null;
432
+ })
433
+ .filter(Boolean) || []
434
+ );
435
+ },
436
+ radioChange() {
437
+ let choiceObj = {
438
+ othersText: this.othersText,
439
+ optionsPreSuffixObj: this.optionsPreSuffixObj
440
+ };
441
+ this.$emit('radioChange', this.curvalue, this.item, choiceObj);
442
+ },
443
+ checkboxChange() {
444
+ this.handleCheckboxOther();
445
+ },
446
+ inputChange() {
447
+ let choiceObj = {
448
+ othersText: this.othersText,
449
+ optionsPreSuffixObj: this.optionsPreSuffixObj
450
+ };
451
+ this.curvalue = 'other';
452
+ this.$emit('radioChange', 'other', this.item, choiceObj);
453
+ },
454
+ inputPreSuffixChange(o, i) {
455
+ this.curvalue = o.key;
456
+ let choiceObj = {
457
+ othersText: this.othersText,
458
+ optionsPreSuffixObj: this.optionsPreSuffixObj
459
+ };
460
+ this.$emit('radioChange', this.curvalue, this.item, choiceObj);
461
+ },
462
+ inputPreSuffixCheckboxChange(o, i) {
463
+ let choiceObj = {
464
+ othersText: this.othersText,
465
+ optionsPreSuffixObj: this.optionsPreSuffixObj
466
+ };
467
+ if (!this.curCheckboxValue.includes(o.key)) {
468
+ this.curCheckboxValue.push(o.key);
469
+ }
470
+ let curCheckboxValue = JSON.parse(JSON.stringify(this.curCheckboxValue));
471
+ this.$emit('checkboxChange', curCheckboxValue, this.item, choiceObj);
472
+ },
473
+ inputCheckboxChange() {
474
+ this.handleCheckboxOther(true);
475
+ },
476
+ handleCheckboxOther(isOtherInput) {
477
+ let choiceObj = {
478
+ othersText: this.othersText,
479
+ optionsPreSuffixObj: this.optionsPreSuffixObj
480
+ };
481
+ if (isOtherInput && !this.curCheckboxValue.includes('other')) {
482
+ this.curCheckboxValue.push('other');
483
+ }
484
+ let curCheckboxValue = JSON.parse(JSON.stringify(this.curCheckboxValue));
485
+ this.$emit('checkboxChange', curCheckboxValue, this.item, choiceObj);
486
+ },
487
+ async initSelectOptions() {
488
+ // 分享链接的量表用 optionType 1:静态,2:动态,3:动态转静态
489
+ const { targetSource, type, options = [], optionType = 1 } = this.cloneItem;
490
+ if (!targetSource?.target_id) return;
491
+ // 动态数据源转静态数据
492
+ if (type == 'SELECT' && this.isDynamic2Static) {
493
+ this.curOptions = this.handleDynamic2StaticOptions(options);
494
+ return;
495
+ }
496
+ if (type === 'SELECT') {
497
+ this.fetching = true;
498
+ this.curOptions = await this.getSelectOptions(this.cloneItem);
499
+ this.fetching = false;
500
+ } else {
501
+ this.curOptions = await this.getCascadeOptions(this.cloneItem);
502
+ }
503
+ },
504
+ handleDynamic2StaticOptions(options) {
505
+ if (!options || !options.length) return [];
506
+ let arr = options.map(item => {
507
+ if ('cascadeData' in item) {
508
+ Object.assign(item, {
509
+ ...item.cascadeData
510
+ });
511
+ }
512
+ // 容错 没有配置的key 添加一个
513
+ if (!(this.columnKey in item)) {
514
+ item[this.columnKey] = item.value || item.label;
515
+ }
516
+ if (!(this.labelKey in item)) {
517
+ item[this.labelKey] = item.label;
518
+ }
519
+ return item;
520
+ });
521
+
522
+ return this.uniqArrObj(arr, this.columnKey);
523
+ },
524
+ // 数组对象去重
525
+ uniqArrObj(arr, name = "value") {
526
+ let obj = {};
527
+ return arr.reduce((cur, next) => {
528
+ obj[next[name]] ? "" : (obj[next[name]] = true && cur.push(next));
529
+ return cur;
530
+ }, []);
531
+ },
532
+ // 下拉组件搜索
533
+ async handleSearch(value) {
534
+ try {
535
+ // 动态数据源转静态数据
536
+ if (this.cloneItem?.type == 'SELECT' && this.isDynamic2Static) return
537
+ this.curOptions = await this.getSearchOptions(
538
+ {
539
+ values: this.columnKey,
540
+ showField: this.labelKey,
541
+ keyword: value
542
+ },
543
+ this.cloneItem
544
+ );
545
+ console.log(this.curOptions, 'curOptions');
546
+ } catch (error) {
547
+ console.log(error);
548
+ }
549
+ },
550
+ // 下拉组件选值
551
+ handleSelectChange(value) {
552
+ let res = {
553
+ value: '',
554
+ list: []
555
+ };
556
+ let matchItem;
557
+ if (Array.isArray(value)) {
558
+ res.value = value;
559
+ if (!value.length) {
560
+ res.list = [];
561
+ } else {
562
+ value.forEach(item => {
563
+ matchItem = this.curOptions.find(v => v.value === item);
564
+ if (matchItem) {
565
+ res.list.push(matchItem);
566
+ }
567
+ });
568
+ }
569
+ } else {
570
+ res.value = value;
571
+ matchItem = this.curOptions.find(v => v.value === value);
572
+ if (matchItem) {
573
+ res.list.push(matchItem);
574
+ }
575
+ }
576
+ this.$emit('change', res);
577
+ },
578
+ filterOption(input, option) {
579
+ return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
580
+ },
581
+ getPopupContainer(triggerNode) {
582
+ if (this.openType == 'formIframe') {
583
+ return document.body;
584
+ }
585
+ return triggerNode.parentNode;
586
+ },
587
+ inited(viewer) {
588
+ this.$viewer = viewer;
589
+ },
590
+ handlePreview(url, i) {
591
+ let imgs = this.curOptions.map(v => v.imageUrl);
592
+ if (!imgs.length) return;
593
+ this.previewImages = imgs;
594
+ this.$viewer.index = i;
595
+ this.$viewer.show();
596
+ }
597
+ }
598
+ };
599
+ </script>
600
+
601
+ <style lang="less" scoped>
602
+ .r-choice {
603
+ /deep/ .ant-radio-group {
604
+ width: 100%;
605
+ }
606
+ /deep/ .choice-radio,
607
+ /deep/ .choice-checkbox {
608
+ display: inline-flex;
609
+ align-items: center;
610
+ margin-bottom: 5px;
611
+ margin-right: 8px;
612
+ margin-left: 0px;
613
+ > span:last-child {
614
+ flex: 1;
615
+ display: inline-flex;
616
+ align-items: center;
617
+ word-break: break-all;
618
+ }
619
+ input {
620
+ height: 100%;
621
+ flex: 1;
622
+ background: transparent;
623
+ border-radius: 0;
624
+ border-color: transparent !important;
625
+ border-bottom: 1px solid #d9d9d9 !important;
626
+ }
627
+ .prefix-span {
628
+ padding-right: 8px;
629
+ }
630
+ .suffix-span {
631
+ padding-left: 8px;
632
+ }
633
+ }
634
+
635
+ /deep/ .block-radio,
636
+ /deep/ .block-checkbox {
637
+ display: flex;
638
+ margin-left: 8px;
639
+ }
640
+ /deep/ .ant-select {
641
+ min-width: 160px;
642
+ }
643
+ /deep/ .ant-select ~ div {
644
+ position: relative !important;
645
+ }
646
+ /deep/.ant-select-dropdown {
647
+ top: 0px !important;
648
+ left: 1px !important;
649
+ }
650
+ .choice-wrap {
651
+ display: flex;
652
+ flex-wrap: wrap;
653
+ .scale-choice-img-wrap {
654
+ position: relative;
655
+ width: 74px;
656
+ min-width: 74px;
657
+ height: 62px;
658
+ background: #ffffff;
659
+ border-radius: 4px;
660
+ border: 1px solid #d5d5d5;
661
+ margin-right: 16px;
662
+ &:hover {
663
+ .scale-preview-wrap {
664
+ display: flex;
665
+ }
666
+ }
667
+ > img {
668
+ width: 100%;
669
+ height: 100%;
670
+ object-fit: cover;
671
+ }
672
+ .scale-preview-wrap {
673
+ position: absolute;
674
+ top: 0;
675
+ left: 0;
676
+ right: 0;
677
+ bottom: 0;
678
+ display: none;
679
+ justify-content: center;
680
+ align-items: center;
681
+ background: rgba(0, 0, 0, 0.75);
682
+ border-radius: 8px;
683
+ font-size: 20px;
684
+ i.anticon {
685
+ color: #fff;
686
+ margin: 0px;
687
+ }
688
+ }
689
+ }
690
+ /deep/ .choose-value .el-tooltip.ellipsis {
691
+ color: rgba(0, 0, 0, 0.65);
692
+ font-size: 14px;
693
+ }
694
+ label {
695
+ margin: 4px 0;
696
+ }
697
+ /deep/.ant-radio-wrapper span.ant-radio + * {
698
+ display: inline-flex;
699
+ align-items: center;
700
+ white-space: initial;
701
+ }
702
+ &.choice-wrap-1 label {
703
+ width: 100%;
704
+ /deep/ input {
705
+ max-width: 300px;
706
+ }
707
+ }
708
+ &.choice-wrap-2 label {
709
+ width: 50%;
710
+ }
711
+ &.choice-wrap-3 label {
712
+ width: 33%;
713
+ }
714
+ &.choice-wrap-4 label {
715
+ width: 25%;
716
+ }
717
+ /deep/ .ant-checkbox {
718
+ // margin-top: -0.2em;
719
+ margin-top: 5px;
720
+ }
721
+ /deep/ .ant-checkbox-inner {
722
+ vertical-align: top;
723
+ }
724
+ }
725
+ }
726
+ </style>