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,1897 +1,1897 @@
1
- <template>
2
- <div :class="['SearchCondition-page', is_search_professional ? '_c_com-search-professional' : '']">
3
- <div class="inner-content">
4
- <div class="item-name" v-if="showItemName">
5
- <span class="label">筛选分类名称:</span>
6
- <!-- 1.1.6.6请输入分类名称 -->
7
- <a-input v-model="className" :placeholder="'请输入分类名称'" style="width: 250px" :maxLength="10" />
8
- </div>
9
- <div class="parent-names" v-if="showItemName">
10
- <!-- 1.9.362父类名称 -->
11
- <span class="label">{{ '父类名称' }}:</span>
12
- <div
13
- class="edit-tag"
14
- v-for="(item, index) in parentNames"
15
- :key="index"
16
- @dblclick="e => editParentName(e, item)"
17
- @click="handleParentNameSelect(item, index)"
18
- :class="{ 'edit-tag-select': item.selected && item.disabled }"
19
- >
20
- <a-input style="width: 100px" :value="item" :disabled="item.disabled" @blur="() => (item.disabled = true)" v-model="item.value" :maxLength="10" />
21
- <a-icon slot="suffix" type="close" @click="handleParentNamesRemove(index, item)" />
22
- </div>
23
- <template v-if="!parentNamesHasAdd">
24
- <a-button v-show="!showAdd" icon="plus" type="dashed" @click="handleParentNamesAdd">
25
- <!-- 1.9.363添加父类 -->
26
- {{ '添加父类' }}
27
- </a-button>
28
- <a-input class="edit-tag" v-model.trim="addVal" v-show="showAdd" style="width: 100px" @blur="hanldeBlur" :maxLength="10" />
29
- </template>
30
- </div>
31
- <div class="item-name" v-if="classify === 'custom' && !homeManage && !hideAddBtn">
32
- <span class="label" v-if="!isOnlyCondition"> 过滤条件: </span>
33
- <span @click="addAction" style="cursor: pointer">
34
- <a-icon type="plus-circle" class="blue" theme="filled" />
35
- <span>{{ isOnlyCondition ? '添加操作' : '添加' }}</span>
36
- </span>
37
- </div>
38
- <!-- 首页管理过滤条件支持选择分类 -->
39
- <div class="item-name" v-if="homeManage">
40
- <span class="label">选择筛选分类:</span>
41
- <a-select v-model="classify" style="width: 250px">
42
- <a-select-option :value="item.sid" v-for="item in classifyList" :key="item.sid">
43
- {{ item.name }}
44
- </a-select-option>
45
- <a-select-option value="custom"> 自定义 </a-select-option>
46
- </a-select>
47
- </div>
48
- <div class="item-name" v-if="classify === 'custom' && homeManage">
49
- <span class="label"> 过滤条件: </span>
50
- <span @click="addAction" style="cursor: pointer">
51
- <a-icon type="plus-circle" class="blue" theme="filled" />
52
- <span>添加</span>
53
- </span>
54
- </div>
55
- <ul class="item-list" v-if="classify === 'custom'" :class="{ 'list-onlyCondition': isOnlyCondition }">
56
- <li v-for="(item, index) in actionList" :key="index">
57
- <span class="index-span">{{ index + 1 }}&nbsp;&nbsp;&nbsp;</span>
58
- <!-- 选择 field_key -->
59
- <a-select
60
- class="form-item select-front-item"
61
- placeholder="请选择"
62
- allowClear
63
- v-model="item.field_key"
64
- :disabled="item.isIllegalField"
65
- showSearch
66
- :filterOption="filterOption"
67
- @select="changeColumnName($event, item)"
68
- @change="(...arg) => fieldselectONchange(item, 'changeColumnName', ...arg)"
69
- :dropdownMatchSelectWidth="false"
70
- >
71
- <a-select-option v-for="sea in item.searchList" :key="isBI ? sea.fieldId : sea.sid" :value="isBI ? sea.fieldId : sea.columnName" :title="sea.title || sea.columnName">{{
72
- handleName(sea)
73
- }}</a-select-option>
74
- </a-select>
75
- <!-- 选择 关系 -->
76
- <!-- 1.1.6.7请选择 -->
77
- <!-- 1.1.6.11暂无数据 -->
78
- <a-select
79
- v-model="item.con"
80
- showSearch
81
- :dropdownMatchSelectWidth="false"
82
- :filterOption="filterOption"
83
- :placeholder="'请选择'"
84
- class="form-item select-front-item"
85
- allowClear
86
- @select="selectChild($event, item)"
87
- @change="(...arg) => fieldselectONchange(item, 'selectChild', ...arg)"
88
- :disabled="item.isIllegalField"
89
- :notFoundContent="fetching ? undefined : '暂无数据'"
90
- >
91
- <a-select-option v-for="child in item.searchChildList" :key="child.name" :value="child.name" :title="child.desc">{{ child.desc }}</a-select-option>
92
- </a-select>
93
-
94
- <!-- 下拉框展示本列表相同数据类型 -->
95
- <!-- item.is_compatibility 兼容模式,不可修改,兼容模式数据格式类型不对的,仅展示 -->
96
- <a-select
97
- class="form-item"
98
- @select="compare_fieldOnChange($event, item)"
99
- v-show="visibleCompareField(item)"
100
- v-model="item.compare_field"
101
- showSearch
102
- :filterOption="filterOption"
103
- style="width: 120px"
104
- :disabled="item.is_compatibility"
105
- >
106
- <a-select-option v-for="date in item.selectList" :key="date.value" :value="date.value" :title="date.name">{{ date.name }}</a-select-option>
107
- </a-select>
108
-
109
- <div class="in-block def_item_input" :class="[item.showSelect ? 'show-small-select' : '']" v-show="visibleDefaultField(item)">
110
- <!-- 展示 -->
111
- <span v-show="item.showInput" class="val-input-wrap">
112
- <!-- 增加 showInput 插槽 支持自定义showInput 内容 -->
113
- <slot name="showInput" :item="item">
114
- <a-input-number :disabled="item.isIllegalField" v-if="showPercent(item)" class="CL-input" style="width: 200px" v-model="item.value" :min="0" :max="100" />
115
- <!-- item.is_compatibility 兼容模式,不可修改,兼容模式数据格式类型不对的,仅展示 -->
116
- <a-input v-else v-model="item.value" :disabled="item.isIllegalField || item.is_compatibility" class="form-item" />
117
- </slot>
118
- </span>
119
- <a-select
120
- class="val-select-wrap"
121
- v-if="item.showSearch"
122
- v-model="item.wordValue"
123
- :disabled="item.isIllegalField"
124
- mode="multiple"
125
- :tokenSeparators="['|#|']"
126
- style="width: 160px"
127
- :filter-option="false"
128
- @dropdownVisibleChange="dropdownVisibleChange($event, item)"
129
- @search="e => handleSearch(e, item)"
130
- @select="handleSelect($event, item)"
131
- @deselect="handleDeSelect($event, item)"
132
- >
133
- <a-select-option v-for="sea in item.wordbookData" :key="item.sid + sea.myName" :value="sea.myName">
134
- {{ sea.showKeys || sea.myName }}
135
- </a-select-option>
136
- </a-select>
137
-
138
- <a-select v-show="item.showSelect" class="val-small-select-wrap" v-model="item.unit" showSearch :filterOption="filterOption" :disabled="item.isIllegalField" style="width: 66px">
139
- <a-select-option v-for="date in item.dateList" :key="date.value" :value="date.value" :title="date.name">{{ date.name }}</a-select-option>
140
- </a-select>
141
-
142
- <div class="date-item val-date-wrap" v-if="item.showDate">
143
- <a-date-picker
144
- :disabledDate="current => disabledDatePicker(current, item, 'start')"
145
- format="YYYY-MM-DD HH:mm:ss"
146
- v-model="item.start_val"
147
- :show-time="{
148
- defaultValue: $moment('00:00:00', 'HH:mm:ss')
149
- }"
150
- :placeholder="'请选择'"
151
- @openChange="handleStartOpenChange($event, item)"
152
- style="width: 120px; minWidth: 170px"
153
- />
154
- <a-date-picker
155
- :disabledDate="current => disabledDatePicker(current, item, 'end')"
156
- format="YYYY-MM-DD HH:mm:ss"
157
- :placeholder="'请选择'"
158
- v-model="item.end_val"
159
- :open="item.endOpen"
160
- :show-time="{
161
- defaultValue: $moment('23:59:59', 'HH:mm:ss')
162
- }"
163
- @openChange="handleEndOpenChange($event, item)"
164
- style="width: 120px; minWidth: 170px"
165
- />
166
- </div>
167
- <!-- 生日 -->
168
- <div class="date-item birthday-item val-birthday-wrap" v-if="item.showBirthdayDate">
169
- <div>
170
- <a-range-picker v-model="item.limit_date" :disabledDate="disabledDate || item.isIllegalField" @change="changeRange($event, item)" format="MM-DD" style="width: 180px" />
171
- <div class="age-wrap">
172
- <!-- 1.2.5.34年龄 -->
173
- <p>{{ '年龄' }}</p>
174
- <a-input :disabled="item.isIllegalField" style="width: 60px; margin-right: 10px" v-model="item.start_val" />
175
- <a-input :disabled="item.isIllegalField" style="width: 60px; margin-right: 10px" v-model="item.end_val" />
176
- <a-select :disabled="item.isIllegalField" v-model="item.unit" showSearch :filterOption="filterOption" defaultValue="YEAR" style="width: 60px">
177
- <a-select-option v-for="v in item.units" :key="v.con" :value="v.con">{{ v.title }}</a-select-option>
178
- </a-select>
179
- </div>
180
- </div>
181
- </div>
182
- <!-- 跨表 -->
183
-
184
- <div class="relation-item" v-show="item.showRelation">
185
- <a-select :disabled="item.isIllegalField" v-model="item.wordValue" showSearch :filterOption="filterOption" @select="handlerSelectRelation($event, item)" class="relation-width">
186
- <a-select-option v-for="word in item.relationData" :key="word.id" :value="word.tableId">{{ word.tableName }}</a-select-option>
187
- </a-select>
188
- <!-- 关联值 -->
189
- <a-input class="relation-width" disabled v-model="item.relationField" />
190
- <span class="relation-width blue relation-btn" @click="openRelationFilter(item, index)">
191
- <!-- 1.1.1.1.6点击设置过滤条件 -->
192
- {{ '点击设置过滤条件' }}</span
193
- >
194
- </div>
195
-
196
- <!-- 年龄 -->
197
- <!-- TODO:样式 -->
198
- <div v-if="item.showRangeAge" class="range-container val-range-wrap">
199
- <rangeAge
200
- :disabled="item.isIllegalField"
201
- :format="item.format"
202
- :defaultValue="{
203
- start_val: item.start_val,
204
- end_val: item.end_val
205
- }"
206
- @change="ageRangeOnChange($event, item)"
207
- ></rangeAge>
208
- </div>
209
- <div v-if="item.showAgeCom" class="range-container val-age-wrap">
210
- <age-com :disabled="item.isIllegalField" :format="item.format" @change="agecomOnChange($event, item)" :value="item.ageValue"></age-com>
211
- </div>
212
- </div>
213
- <!-- -->
214
- <span class="item-error" v-if="item.field_key && !searchListKey.includes(item.field_key)">检测到该筛选字段是非法无效的,请移除!</span>
215
- <!-- 1.1.1.3.3删除 -->
216
- <a-tooltip :title="'删除'" destroyTooltipOnHide>
217
- <svg-icon v-if="!isSee" v-show="noShowListDelIcon" @click="softDel(index)" class-name="svg-icon-btn is-danger form-action" icon-class="xitongtubiaoliebiaocaozuoanniushanchushixin" />
218
- </a-tooltip>
219
- </li>
220
- </ul>
221
- <div v-if="classify === 'custom' && !isOnlyCondition">
222
- <div style="margin-bottom: 6px" v-show="!is_search_professional">
223
- <!-- 筛选器逻辑编辑,不设置默认为AND1.2.4.9 -->
224
- {{ '筛选器逻辑编辑,不设置默认为AND' }} <br />
225
- 例子 (1 AND 2) OR 3
226
- </div>
227
- <div>
228
- <!-- 没啥用撑布局而已 -->
229
- <span v-if="is_search_professional" style="visibility: hidden;" class="index-span">{{ 1 }}&nbsp;&nbsp;&nbsp;</span>
230
-
231
- <a-input
232
- class="teavalue-wrap"
233
- v-model="teaValue"
234
- type="textarea"
235
- :placeholder="is_search_professional ? '筛选条件表达式,不设置默认为AND,例子(1 AND 2) OR 3' : ''"
236
- :rows="is_search_professional ? 1 : 3"
237
- />
238
- </div>
239
- </div>
240
- </div>
241
- <SearchFilter
242
- v-bind="$attrs"
243
- :visible="relationVisible"
244
- openType="relationTable"
245
- @saveAdd="relationSave"
246
- @cancelSaveAdd="relationCancel"
247
- :actionList_prop="relationAction"
248
- :searchFieldList="relationSearchFieldList"
249
- />
250
- </div>
251
- </template>
252
-
253
- <script>
254
- import moment from 'moment';
255
- import 'moment/locale/zh-cn';
256
- moment.locale('zh-cn');
257
- import rangeAge from '~/table-filter/src/components/range-age/index';
258
- import ageCom from '~/table-filter/src/components/age-com/index';
259
- import { Icon, Input, Button, InputNumber, Tooltip, Select, DatePicker, message } from 'ant-design-vue';
260
- import utils from '@/utils/utils-map';
261
- import FIELDTYPELIST from './fieldTypeList';
262
- import svgIcon from '@/component/svg/index.vue';
263
- import create from '@/core/create';
264
- import { filterApiFn } from '~/table-filter/src/mixins/mixins';
265
- export default create({
266
- name: 'search-condition',
267
- mixins: [filterApiFn],
268
- props: {
269
- isSee: Boolean,
270
- visible: Boolean,
271
- actionList_prop: Object,
272
- searchFieldList: {
273
- type: Array,
274
- default: () => []
275
- },
276
- showItemName: {
277
- default: true
278
- },
279
- saveEmpty: {
280
- default: false
281
- },
282
- // 首页管理
283
- homeManage: {
284
- default: false
285
- },
286
- tableId: {
287
- default: ''
288
- },
289
- isPersonalizedHome: {
290
- default: false
291
- },
292
- conditionList: {
293
- type: Array
294
- },
295
- source: {
296
- type: String
297
- },
298
- isBI: {
299
- default: false
300
- },
301
- // 自定义格式化 actionList 里的数据 (可搭配 slot插槽:showInput使用 )
302
- formatActionData: {
303
- type: Function,
304
- default: v => v
305
- },
306
- isOnlyCondition: Boolean,
307
- isCnHis: {
308
- // 2021/5/25 257针对云his做修改 只过滤搜索为禁用的条件 fjj需求
309
- type: Boolean,
310
- default: false
311
- },
312
- isAdmin: {
313
- type: Boolean,
314
- default: false
315
- },
316
-
317
- // 是否展示 CompareField
318
- showCompareField: {
319
- type: Boolean,
320
- default: false
321
- },
322
-
323
- hideAddBtn: {
324
- type: Boolean,
325
- default: false
326
- },
327
- openType: {
328
- type: String,
329
- default: ''
330
- }
331
- },
332
- data() {
333
- return {
334
- checkedItem: null,
335
- actionList: [],
336
- searchList: [],
337
- searchChildList: [],
338
- relationTableList: [], // 跨表
339
- isRelationList: [], // 跨表字段
340
- fieldTypeList: FIELDTYPELIST,
341
- dateList: [
342
- { name: '天', value: 'DAY' },
343
- { name: '周', value: 'WEEK' },
344
- { name: '月', value: 'MONTH' },
345
- { name: '季度', value: 'QUARTER' },
346
- { name: '年', value: 'YEAR' }
347
- ],
348
- dateTimeList: { name: '小时', value: 'HOUR' },
349
- relationSelect: [
350
- { desc: '存在跨表', name: 'QUOTE_IN' },
351
- { desc: '不存在跨表', name: 'QUOTE_NOTIN' }
352
- ],
353
- rangeAgeOptions: [
354
- { desc: '等于', name: 'IN' },
355
- { desc: '大于', name: 'BIG' },
356
- { desc: '大于等于', name: 'BIGEQ' },
357
- { desc: '小于', name: 'LESS' },
358
- { desc: '小于等于', name: 'LESSEQ' }
359
- ],
360
- start_val: null,
361
- end_val: null,
362
- className: '',
363
- teaValue: '',
364
- classifyId: '',
365
- // 跨表过滤
366
- relationVisible: false,
367
- relationAction: {},
368
- relationSearchFieldList: [],
369
- clcikRelationIndex: undefined,
370
- fetching: false,
371
- birthdayUnits: [
372
- { title: '天', units: 1, con: 'DAY' },
373
- { title: '周', units: 2, con: 'WEEK' },
374
- { title: '月', units: 1, con: 'MONTH' },
375
- { title: '岁', units: 1, con: 'YEAR' }
376
- ],
377
- limit_date: '',
378
- parentNames: [],
379
- // searchSelect
380
- searchItem: {},
381
- curWordbookData: undefined,
382
- curAutograph: '',
383
- classify: 'custom',
384
- classifyList: [],
385
- addVal: '',
386
- showAdd: false,
387
- birthdayFilter: ["BIG", "LESS", "BIGEQ", "LESSEQ", "IN_THE_PAST_DI", "IN_THE_FUTURE_DI"]
388
- };
389
- },
390
- computed: {
391
- parentNamesHasAdd() {
392
- return this.parentNames.some(v => v.isAdd);
393
- },
394
- showPercent() {
395
- return function(item) {
396
- return item.settingObj?.attr === 'PERCENTAGE' || false;
397
- };
398
- },
399
-
400
- searchListKey() {
401
- let res = [];
402
- this.searchList.forEach(v => {
403
- v.fieldId && res.push(v.fieldId);
404
- v.columnName && res.push(v.columnName);
405
- });
406
- return res;
407
- },
408
- // TODO:
409
- isOrgAdmin() {
410
- return this.isAdmin;
411
- },
412
- handleName() {
413
- return function(item, key = 'title') {
414
- let useKey = key;
415
- if (this.isBI) {
416
- useKey = 'remark';
417
- }
418
- return item.alias || item[useKey];
419
- };
420
- },
421
- $moment() {
422
- return moment;
423
- },
424
-
425
- is_search_professional() {
426
- return this.source == 'search-professional';
427
- },
428
-
429
- // 筛选分类“专业模式” 只有一条筛选数据,不可以删除。
430
- noShowListDelIcon() {
431
- let len = this?.actionList?.length || 0;
432
- return !(len === 1 && this.source == 'search-professional');
433
- }
434
- },
435
- // created() {
436
- // this.init();
437
- // },
438
- beforeCreate() {
439
- this.$options.components.SearchFilter = require('../search-filter/SearchFilter.vue').default;
440
- },
441
- components: {
442
- rangeAge,
443
- ageCom,
444
- [Icon.name]: Icon,
445
- [Input.name]: Input,
446
- [InputNumber.name]: InputNumber,
447
- [Button.name]: Button,
448
- [Select.name]: Select,
449
- [Select.Option.name]: Select.Option,
450
- [Tooltip.name]: Tooltip,
451
- [DatePicker.name]: DatePicker,
452
- [DatePicker.RangePicker.name]: DatePicker.RangePicker,
453
- svgIcon
454
- },
455
- watch: {
456
- searchFieldList: {
457
- immediate: true,
458
- deep: true,
459
- handler(val) {
460
- if (val && val.length > 0) {
461
- // 专业模式,刷新字段,不刷新设置的条件
462
- if (this.is_search_professional && this.initConditionsed) {
463
- return;
464
- }
465
- this.handleInitConditions();
466
- }
467
- }
468
- }
469
- },
470
- methods: {
471
- handleInitConditions() {
472
- if (this.homeManage) {
473
- this.getClassifyList();
474
- this.classify = this.actionList_prop.displayCategory || 'custom';
475
- if (this.actionList_prop.displayCategory) {
476
- this.actionList_prop.conObj = [];
477
- this.actionList_prop.preSqlExpression = '';
478
- }
479
- }
480
- let { relationTableList = [] } = this.$attrs;
481
- this.relationTableList = this.openType === 'relationTable' ? [] : relationTableList;
482
- this.init();
483
- this.backShow(this.actionList_prop);
484
- this.showItemName && this.getParentNames();
485
- this.initConditionsed = true;
486
- },
487
- async getClassifyList() {
488
- let params = { tableId: this.tableId };
489
- let res = await this.handleGetConfigApi(params, 'requestGetTableCondiTionList');
490
- if (res.status) {
491
- this.$emit('setConditionMap', res.data);
492
- this.classifyList = res?.data?.conditionList || [];
493
- }
494
- },
495
- getParentNames() {
496
- let parentNames = [];
497
- let displayCategoryList = this?.$attrs?.displayCategoryList || [];
498
- displayCategoryList.forEach(item => {
499
- if (item !== '未分类') {
500
- parentNames.push({
501
- disabled: true,
502
- selected: item === this.actionList_prop.displayCategory,
503
- value: item
504
- });
505
- }
506
- });
507
- this.parentNames = parentNames;
508
- },
509
- init(config = {}) {
510
- let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => i.columnName !== 'operatorColumn' && i.isMerge != 1);
511
- if (mySearchFieldList && mySearchFieldList.length > 0) {
512
- if (this.isPersonalizedHome) {
513
- this.searchList = mySearchFieldList;
514
- } else {
515
- let searchList = mySearchFieldList
516
- .map(item => {
517
- let { settingObj = {} } = item;
518
- let notParticipatingSearch = false;
519
- if ('notParticipatingSearch' in settingObj) {
520
- notParticipatingSearch = settingObj.notParticipatingSearch != 1;
521
- } else {
522
- notParticipatingSearch = true;
523
- }
524
- const flag = this.isCnHis ? true : item.isSearch == 1 || item.isShowSearch == 1;
525
- if (flag && notParticipatingSearch) {
526
- return item;
527
- }
528
- return null;
529
- })
530
- .filter(Boolean);
531
- this.searchList = searchList;
532
- }
533
-
534
- if (this.searchList.length === 0) {
535
- return;
536
- }
537
-
538
- this.fieldTypeList.some(item => {
539
- if (this.searchList[0].fieldType == item.name) {
540
- this.$set(this, 'searchChildList', item.conList);
541
- return true;
542
- }
543
- });
544
- this.isRelationList = this.relationTableList.map(item => item.primaryField);
545
- this.actionList = [];
546
- this.className = '';
547
- this.teaValue = '';
548
-
549
- let isInitNoAdd = 'initNoAdd' == config?.type || '';
550
-
551
- if (isInitNoAdd) return;
552
-
553
- this.addAction();
554
- }
555
- },
556
- // 回显
557
- backShow(val) {
558
- if (!val || !Object.keys(val || {}).length) return;
559
- let obj = val;
560
- // 自定义菜单中 过滤 条件回显
561
- if (this.source === 'customMenuForm' && val.setting && utils.isJSON(val.setting)) {
562
- obj = JSON.parse(val.setting) || {};
563
- }
564
- if (!Object.keys(obj || {}).length) return;
565
- let relationFieldList = [];
566
- // this.className = obj.from == "edit" ? obj.name : "";
567
- this.className = obj.name;
568
- this.classifyId = obj.from == 'edit' ? obj.sid : '';
569
- // 标识操作类型
570
- this.fromType = obj.from;
571
- this.teaValue = obj.sqlExpression;
572
- if (obj.conObj && !utils.isArray(obj.conObj)) {
573
- obj.conObj = JSON.parse(obj.conObj);
574
- }
575
- if (!obj.conObj || !obj.conObj.length) return;
576
- this.actionList = obj.conObj.map(item => {
577
- let curSet = this.searchList.find(v => (this.isBI ? v.fieldId : v.columnName) == item.field_key);
578
- if (curSet) {
579
- item.settingObj = curSet.settingObj;
580
- }
581
- if (item.con == 'CONVERT') {
582
- item.wordValue = item.value;
583
- } else if (item.con == 'QUOTE' || item.con == 'QUOTE_NOT') {
584
- item.wordValue = item.value.split('|#|');
585
- } else if (this.isRelationList.includes(item.field_key)) {
586
- item.wordValue = item.tableId;
587
- let curItem = this.relationTableList.find(v => v.tableId === item.tableId);
588
- if (curItem) {
589
- item.relationField = curItem.relationField;
590
- relationFieldList = JSON.parse(JSON.stringify(curItem.fieldList.fieldList) || []);
591
- }
592
- }
593
- let start_val = '';
594
- let end_val = '';
595
- let limit_date = [];
596
- let ageValue = {};
597
- if (item?.settingObj?.attr === 'PERCENTAGE') {
598
- if (item.value) {
599
- item.value = Number(item.value) * 100;
600
- }
601
- } else if (item && item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
602
- start_val = item.start_val ? item.start_val : '';
603
- end_val = item.end_val ? item.end_val : '';
604
- if (item.limit_date) {
605
- let limitString = item.limit_date;
606
- if (Array.isArray(item.limit_date)) {
607
- let res = [];
608
- if (item.limit_date.length > 0) {
609
- item.limit_date.forEach(v => {
610
- v._d && res.push(utils.formatTime('MOUTH', v._d));
611
- });
612
- }
613
- if (res.length > 0) {
614
- item.curlimit_date = res.join('~');
615
- }
616
- } else if (utils.isString(limitString)) {
617
- let temp = [];
618
- item.curlimit_date = limitString;
619
- if (utils.isString(limitString)) {
620
- let res = limitString.split('~');
621
- if (res.length > 0) {
622
- for (let i = 0; i < res.length; i++) {
623
- temp.push(moment(res[i], 'MM-DD'));
624
- }
625
- limit_date = temp;
626
- }
627
- }
628
- }
629
- }
630
- } else if (item && item.settingObj && item.settingObj.attr == 'AGE') {
631
- this.$set(item, 'AGEAttr', true);
632
- start_val = item.start_val;
633
- end_val = item.end_val;
634
- ageValue = this.diffTime(item.value);
635
- // searchChildList
636
- // 大于(BIG),小于 LESS,大于等于BIGEQ,小于等于LESSEQ,等于(IN)
637
- } else {
638
- let curEnd = item.end_val;
639
- // 只有YYYY-MM-DD 手动添加HH:mm:ss
640
- if (curEnd && typeof curEnd === "string" && curEnd.length < 11 && !curEnd.includes(":")) {
641
- curEnd += " 23:59:59";
642
- }
643
- start_val = item.start_val ? moment(item.start_val, 'YYYY-MM-DD HH:mm:ss') : '';
644
- end_val = item.end_val ? moment(curEnd, 'YYYY-MM-DD HH:mm:ss') : '';
645
- item.curlimit_date = '';
646
- }
647
-
648
- item.fieldType = item.fieldType || curSet?.fieldType;
649
-
650
- // 是否是自定义输入
651
- if (item.is_compare_field && this.showCompareField) {
652
- this.handleSetSelectList(item);
653
- }
654
- return {
655
- field_key: item.field_key,
656
- fieldId: item.field_key,
657
- fieldType: item.fieldType, // 字段类型
658
- con: item.con,
659
- unit: item.unit,
660
- start_val: start_val,
661
- end_val: end_val,
662
- limit_date: limit_date,
663
- curlimit_date: item.curlimit_date ? item.curlimit_date : '',
664
- searchList: this.searchList,
665
- searchChildList: this.searchChildList,
666
- dateList: this.dateList,
667
- wordValue: item.wordValue,
668
- word: item.wordValue,
669
- value: utils.isString(item.value) ? item.value : JSON.stringify(item.value),
670
- relationData: this.isRelationList.includes(item.field_key) ? [...this.relationTableList] : [],
671
- relationField: item.valueField || '',
672
- relationFieldList: relationFieldList || [],
673
- quote_con: item.quote_con || {},
674
- ageValue: ageValue || {},
675
-
676
- converFun: item.converFun || undefined,
677
- parameterConversionId: item.parameterConversionId || undefined,
678
- relationOrgId: item.relationOrgId || undefined,
679
- preConObj: item.preConObj || undefined,
680
- preSqlExpression: item.preSqlExpression || undefined,
681
- isIllegalField: this.isSee || (item.field_key && !this.searchListKey.includes(item.field_key)), // 非法字段
682
- wordbookValueList: item.wordbookValueList || [],
683
- wordbookData: [],
684
-
685
- is_compare_field: item.is_compare_field || false,
686
- selectList: item.selectList || [],
687
- customInput: false, // 自定义输入
688
- compare_field: item.compare_field // 选择的值
689
- };
690
- });
691
- this.actionList.forEach(item => {
692
- this.formatData(item.field_key, item);
693
- this.selectChild(item.con, item, true, { is_compare_field: item.is_compare_field });
694
- this.checkItem(item);
695
- });
696
- },
697
- // 保存列表搜索分类
698
- saveAdd() {
699
- // 首页配置支持筛选分类
700
- if (this.homeManage && this.classify !== 'custom') {
701
- let classify = this.classifyList.find(item => item.sid === this.classify);
702
- let setting = {
703
- displayCategory: classify.sid,
704
- name: classify.name,
705
- sqlExpression: classify.sqlExpression,
706
- conObj: classify.conObj
707
- };
708
- let params = {
709
- id: classify.sid,
710
- tableId: this.tableId,
711
- setting: JSON.stringify(setting)
712
- };
713
- this.$emit('saveAdd', params);
714
- return;
715
- }
716
- if (this.homeManage && this.classify == 'custom') {
717
- this.actionList_prop.displayCategory = '';
718
- this.actionList_prop.name = '';
719
- }
720
- if (!this.className && this.showItemName) {
721
- // 1.1.7.3请输入搜索分类名称
722
- this.$message.warn(`请输入搜索分类名称!`, 2);
723
- return;
724
- }
725
- if (this.actionList && this.actionList.length > 0) {
726
- let conObj = this.getConditions();
727
-
728
- if (!conObj) {
729
- return;
730
- }
731
-
732
- if (this.isOnlyCondition) {
733
- this.$emit('saveAdd', conObj);
734
- return;
735
- }
736
- let displayCategory = this.parentNames.filter(item => item.selected)[0]?.value;
737
- let setting = {
738
- displayCategory,
739
- name: this.className, // 自定义名称
740
- sqlExpression: this.teaValue, // 文本域
741
- conObj
742
- };
743
- let params = {
744
- id: this.classifyId,
745
- tableId: this.tableId,
746
- setting: JSON.stringify(setting)
747
- };
748
- if (conObj.some(v => !v.con)) {
749
- return this.$message.warn('请完善筛选条件');
750
- }
751
- this.$emit('saveAdd', params);
752
- const { isInSearch } = this?.$attrs || {};
753
- // isInSearch = true,等待接口 /tableList/saveTableCondiTion 请求完成 再关闭弹窗。
754
- if (!isInSearch) {
755
- this.cancelSaveAdd(false);
756
- }
757
- } else {
758
- if (!this.saveEmpty) {
759
- // 1.1.6.18请设置搜索条件
760
- return this.$message.warn(`请设置搜索条件`, 2);
761
- }
762
- this.$emit('saveAdd', {
763
- setting: '{}'
764
- });
765
- this.cancelSaveAdd();
766
- }
767
- },
768
- getSqlExpression() {
769
- return this.teaValue;
770
- },
771
- getConditions() {
772
- let condition = [];
773
- for (let i = 0; i < this.actionList.length; i++) {
774
- let item = this.actionList[i];
775
- if (item.field_key && !this.searchListKey.includes(item.field_key)) {
776
- this.$message.error('检测到该筛选字段含有非法无效的,请移除!');
777
- return;
778
- }
779
- let attrType = item?.settingObj?.attr || '';
780
- let value = '';
781
- if (item.con == 'CONVERT') {
782
- value = item.wordValue.map(word => {
783
- return JSON.parse(word);
784
- });
785
- } else if (item.con == 'QUOTE' || item.con == 'QUOTE_NOT') {
786
- value = item.wordValue.join('|#|');
787
- } else {
788
- value = item.value;
789
- }
790
- let start_val = '';
791
- let end_val = '';
792
- let limit_date = [];
793
- if (item.settingObj && item.settingObj.attr == 'PERCENTAGE') {
794
- value = Number(value) / 100;
795
- } else if (item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
796
- if (item.start_val) {
797
- let res = utils.validateBirthday(item.start_val, item.title, item.unit);
798
- if (!res) return;
799
- }
800
- if (item.end_val) {
801
- let res = utils.validateBirthday(item.end_val, item.title, item.unit);
802
- if (!res) return;
803
- }
804
- if (+item.start_val > +item.end_val) {
805
- // 1.9.47请输入有效范围
806
- this.$message.warning(`${item.title}请输入有效范围`, 2);
807
- return;
808
- }
809
- start_val = item.start_val ? item.start_val : '';
810
- end_val = item.end_val ? item.end_val : '';
811
-
812
- limit_date = item.curlimit_date ? item.curlimit_date : '';
813
- } else if (attrType == 'AGE') {
814
- start_val = item.start_val;
815
- end_val = item.end_val;
816
- value = item.value;
817
- } else {
818
- start_val = item.start_val ? item.start_val.format('YYYY-MM-DD HH:mm:ss') : '';
819
- end_val = item.end_val ? item.end_val.format('YYYY-MM-DD HH:mm:ss') : '';
820
- }
821
-
822
- let is_custom = this.showCompareField ? item.compare_field == '_custom__input_' : false;
823
-
824
- let temp = {
825
- field_key: item.field_key, // 一级value
826
- fieldId: item.field_key, // BI需要拿fieldId
827
- fieldType: item.fieldType, // 字段类型
828
- con: item.compatibility_con || item.con, // 二级选择项value
829
- value: value, // input输入值
830
- start_val: start_val, // 开始时间
831
- end_val: end_val, // 结束时间
832
- unit: item.unit, // 选择时间单位
833
- limit_date: limit_date,
834
- tableId: (item.showRelation && item.wordValue) || undefined, // 关联表格ID
835
- valueField: item.relationField || undefined, // 关联字段
836
- quote_con: Object.keys(item.quote_con || {}).length ? item.quote_con : null, // 关联表格过滤项
837
- converFun: item.converFun || undefined,
838
- parameterConversionId: item.parameterConversionId || undefined,
839
- relationOrgId: item.relationOrgId || undefined,
840
- preConObj: item.preConObj || undefined,
841
- preSqlExpression: item.preSqlExpression || undefined,
842
- wordbookValueList: item.wordbookValueList,
843
- is_compare_field: is_custom ? false : item.is_compare_field, // 自定义输入的设为false
844
- compare_field: is_custom ? undefined : item.compare_field
845
- };
846
- condition.push(temp);
847
- }
848
- return [...condition];
849
- },
850
- // 第二层弹框添加分类按钮
851
- addAction(config = {}) {
852
- if (this.searchList.length === 0) {
853
- return message.warning('暂无字段可设置!');
854
- }
855
-
856
- // noDefault 不需要设置默认选中第一条数据
857
- // is_search_professional 专业模式 不需要默认选中第一条
858
- let noDefault = config?.noDefault || this.is_search_professional || false;
859
-
860
- let searchListDefaultItem = this.searchList[0];
861
- let searchListDefault = '',
862
- setting = {},
863
- settingObj = {};
864
-
865
- if (searchListDefaultItem) {
866
- searchListDefault = this.isBI ? searchListDefaultItem.fieldId : searchListDefaultItem.columnName;
867
- setting = searchListDefaultItem.setting;
868
- settingObj = searchListDefaultItem.settingObj;
869
- }
870
-
871
- if (noDefault) {
872
- searchListDefaultItem = {};
873
- searchListDefault = undefined;
874
- }
875
-
876
- this.actionList.push({
877
- field_key: searchListDefault,
878
- fieldId: searchListDefaultItem.fieldId,
879
- fieldType: searchListDefaultItem.fieldType, // 字段类型
880
- con: undefined,
881
- searchList: this.searchList,
882
- searchChildList: this.searchChildList,
883
- dateList: this.dateList,
884
- wordbookData: [],
885
- relationData: [...this.relationTableList],
886
- relationField: '',
887
- relationFieldList: [],
888
- quote_con: {},
889
- title: '',
890
- unit: 'YEAR',
891
- setting: setting,
892
- settingObj: settingObj,
893
- wordbookValueList: [],
894
- isIllegalField: this.isSee,
895
-
896
- is_compare_field: false,
897
- selectList: [],
898
- customInput: false, // 自定义输入
899
- compare_field: '' // 选择的值
900
- });
901
-
902
- if (noDefault) {
903
- return;
904
- }
905
-
906
- let actionInex = this.actionList.length - 1;
907
- this.changeColumnName(this.actionList[actionInex].field_key, this.actionList[actionInex]);
908
- },
909
- // 软删除
910
- softDel(index) {
911
- if (this.isSee) return;
912
- this.actionList.splice(index, 1);
913
- },
914
- cancelSaveAdd() {
915
- this.$emit('cancelSaveAdd');
916
- this.actionList = [];
917
- this.addVisible = false;
918
- this.showAdd = false;
919
- this.addVal = '';
920
- this.className = '';
921
- this.classifyId = '';
922
- this.teaValue = '';
923
- },
924
- // 第一个下拉框(1)根据不同类型,分别展示input select date
925
- changeColumnName(value, action) {
926
- action.con = undefined;
927
- let f = action.searchList.find(v => v.columnName == value);
928
- action.fieldType = f?.fieldType || undefined;
929
- this.$set(action, 'wordValue', []);
930
- this.$set(action, 'wordbookData', []);
931
- this.formatData(value, action);
932
- this.handleHideItem(action);
933
- this.handleHideCompareField(action);
934
- this.$set(action, 'isIllegalField', value && !this.searchListKey.includes(value));
935
- },
936
- // 数据处理
937
- formatData(value, action) {
938
- action.searchList.some(sea => {
939
- if ((this.isBI ? sea.fieldId : sea.columnName) == value) {
940
- action.fieldType = sea.fieldType;
941
-
942
- action.settingObj = sea.settingObj;
943
- let attrType = sea?.settingObj?.attr || '';
944
- let format = sea?.settingObj?.format || '';
945
- action.title = sea.title || '';
946
- if (sea.setting) {
947
- utils.isPlainObject(sea.setting) ? '' : (sea.setting = JSON.parse(sea.setting));
948
- if (!utils.isEmpty(sea.setting.wordbook)) {
949
- // 1.1.4.26引用
950
- // 1.2.5.52不引用
951
- action.searchChildList = [
952
- { desc: '引用', name: 'QUOTE' },
953
- { desc: '不引用', name: 'QUOTE_NOT' }
954
- ];
955
- let obj = {};
956
- if (sea.setting.wordbook.params) {
957
- sea.setting.wordbook.params.forEach(item => {
958
- obj[item.p_name] = item.p_value;
959
- });
960
- }
961
- this.$set(action, 'settingWordbook', {
962
- params: obj,
963
- id: sea.setting.wordbook.id
964
- });
965
- // this.getWordbookData(sea.setting.wordbook.id, obj).then(list => {
966
- // this.$set(action, "wordbookData", list);
967
- // });
968
- return true;
969
- } else if (sea.setting.showSetting && sea.setting.showSetting.length > 0) {
970
- // 1.1.4.27下拉选项
971
- action.searchChildList = [{ desc: '下拉选项', name: 'CONVERT' }];
972
- this.$set(action, 'wordValue', []);
973
- let showSetting = sea.setting.showSetting;
974
-
975
- // 字典推荐值
976
- let dictionItem = this.handleDictionDef(sea);
977
- if (dictionItem) {
978
- let { defaultValueTitle } = sea?.dictionarieObj || {};
979
- let hasDef = showSetting.find(item => item.change_text === defaultValueTitle);
980
- !hasDef && showSetting.unshift(dictionItem);
981
- }
982
- let wordbookData = showSetting.map((set, index) => {
983
- // 回显逻辑
984
- if (action.word) {
985
- utils.isString(action.word) ? (action.word = JSON.parse(action.word)) : '';
986
- let words = action.word.map(w => JSON.stringify(w));
987
- let filter = JSON.stringify(set.filter);
988
- if (words.includes(filter)) {
989
- action.wordValue.push(filter);
990
- }
991
- }
992
- return {
993
- name: set.change_text,
994
- showKeys: set.change_text,
995
- value: JSON.stringify(set.filter),
996
- myName: JSON.stringify(set.filter),
997
- id: (index + 9).toString(36) + index,
998
- sid: (index + 9).toString(36) + index
999
- };
1000
- });
1001
- action.wordbookData = wordbookData;
1002
- return true;
1003
- } else {
1004
- let matchItem = this.fieldTypeList.find(item => sea.fieldType.toUpperCase() == item.name);
1005
- let conList = this.searchChildList;
1006
- if (matchItem) {
1007
- // 关系 选项
1008
- conList = matchItem.conList;
1009
- }
1010
- if (action?.settingObj?.attr === "BIRTHDAY") {
1011
- conList = conList.filter(v => !this.birthdayFilter.includes(v.name)) || [];
1012
- }
1013
-
1014
- action.searchChildList = conList;
1015
- }
1016
- // 通过 attr 判断类型,searchChildList
1017
- if (attrType == 'AGE') {
1018
- action.searchChildList = this.rangeAgeOptions;
1019
- action.format = format.toUpperCase();
1020
- // action.ageValue = this.diffTime(action.value);
1021
- }
1022
- } else {
1023
- this.fieldTypeList.some(item => {
1024
- if (sea.fieldType == item.name) {
1025
- action.searchChildList = item.conList.filter(con => con.name != 'QUOTE' && con.name != 'CONVERT' && con.name != 'QUOTE_NOT');
1026
- return true;
1027
- }
1028
- });
1029
- }
1030
- // 跨表字段
1031
- if (this.isRelationList.includes(value) && !action.searchChildList.some(v => v.name == 'QUOTE_IN')) {
1032
- action.searchChildList.push(...this.relationSelect);
1033
- }
1034
- return true;
1035
- }
1036
- });
1037
- this.formatActionData(action);
1038
- },
1039
- // 字典推荐值 item处理
1040
- handleDictionDef(el) {
1041
- let { defaultValue, defaultValueTitle } = el?.dictionarieObj || {};
1042
- let dictionItem = null;
1043
- if (defaultValue && defaultValueTitle) {
1044
- dictionItem = {
1045
- change_text: defaultValueTitle,
1046
- filter: [
1047
- {
1048
- con: 'EQ',
1049
- field_key: el.columnName,
1050
- value: defaultValue
1051
- }
1052
- ]
1053
- };
1054
- }
1055
- return dictionItem;
1056
- },
1057
- getWordbookData(o, obj) {
1058
- let { id, filterKeys, wordbookType } = o;
1059
- let resFieldKeys = filterKeys && Array.isArray(filterKeys) ? JSON.stringify(filterKeys) : filterKeys;
1060
- let url = `/tableReader/getWordbookData`;
1061
- let params = {
1062
- wordbookId: id,
1063
- fieldKeys: resFieldKeys,
1064
- wordbookType: wordbookType || 'WORDBOOK',
1065
- ...obj
1066
- };
1067
- return this.handleGetConfigApi(params, 'requestGetWordbookData', { fields: o }).then(res => {
1068
- return res;
1069
- });
1070
- },
1071
- handleWordbookData(item, data) {
1072
- let { settingObj = {} } = item;
1073
- let { showKeys = [], defaultValue, defaultValueTitle } = settingObj.wordbook || {};
1074
- let defaultItem = null;
1075
- if (defaultValue && defaultValueTitle) {
1076
- defaultItem = {
1077
- myName: defaultValue,
1078
- showKeys: defaultValueTitle
1079
- };
1080
- }
1081
- if (data && data.result) {
1082
- // 数组赋值并添加唯一name
1083
- let wordbookData = data.map.rows.map(row => {
1084
- let showKeysStr = [];
1085
- showKeys.forEach(ren => {
1086
- showKeysStr.push(row[ren]);
1087
- });
1088
- return Object.assign(row, {
1089
- myName: String(row[item.settingObj.wordbook.field_key]),
1090
- showKeys: showKeysStr.join('')
1091
- });
1092
- });
1093
- // 数组对象去重
1094
- let obj = {};
1095
- wordbookData = wordbookData.reduce((cur, next) => {
1096
- obj[next.myName] ? '' : (obj[next.myName] = true && cur.push(next));
1097
- return cur;
1098
- }, []);
1099
- if (defaultItem) {
1100
- wordbookData.unshift(defaultItem);
1101
- }
1102
- this.$set(item, 'wordbookData', wordbookData);
1103
- }
1104
- },
1105
- dropdownVisibleChange(open, item) {
1106
- if (open) {
1107
- let obj = {};
1108
- if (item.settingObj?.wordbook?.params) {
1109
- item.settingObj.wordbook.params.forEach(item => {
1110
- obj[item.p_name] = item.p_value;
1111
- });
1112
- }
1113
- if (item.settingObj?.wordbook) {
1114
- obj.autograph = item.settingObj.wordbook.autograph;
1115
- }
1116
- this.curWordbookData = item.settingObj.wordbook;
1117
- this.curAutograph = item.settingObj.wordbook && item.settingObj.wordbook.autograph;
1118
- this.searchItem = item;
1119
- if (item.settingObj.showSetting && item.settingObj.showSetting.length) {
1120
- return;
1121
- }
1122
- this.getWordbookData(item.settingObj.wordbook, obj).then(({ data }) => {
1123
- this.handleWordbookData(item, data);
1124
- });
1125
- }
1126
- },
1127
- /**
1128
- * 输入自动联想
1129
- */
1130
- handleSearch(value, item) {
1131
- let params = {
1132
- keyword: value,
1133
- autograph: this.curAutograph
1134
- };
1135
- let obj = {};
1136
- if (item.settingObj?.wordbook?.params) {
1137
- item.settingObj.wordbook.params.forEach(item => {
1138
- obj[item.p_name] = item.p_value;
1139
- });
1140
- }
1141
- Object.assign(params, obj);
1142
-
1143
- this.getWordbookData(this.curWordbookData, params).then(({ data }) => {
1144
- this.handleWordbookData(this.searchItem, data);
1145
- });
1146
- },
1147
- handleSelect(value, item) {
1148
- let { wordbookData = [], wordbookValueList = [] } = item;
1149
- if (!wordbookData.length) return;
1150
- let matchItem = wordbookData.find(v => v.myName === value);
1151
- let hasItem = wordbookValueList.some(v => v.myName === value);
1152
- if (hasItem) return;
1153
- wordbookValueList.push(matchItem);
1154
- },
1155
- handleDeSelect(value, item) {
1156
- let { wordbookValueList = [] } = item;
1157
- let matchIndex = wordbookValueList.findIndex(v => v.myName === value);
1158
- if (matchIndex < 0) return;
1159
- wordbookValueList.splice(matchIndex, 1);
1160
- },
1161
-
1162
- selectChild(value, item, isInitSet, config = {}) {
1163
- let attr = item?.settingObj?.attr || '';
1164
- let arr = [
1165
- 'TODAY',
1166
- 'THIS_WEEK',
1167
- 'THIS_MONTH',
1168
- 'THIS_SEASON',
1169
- 'THIS_YEAR',
1170
- 'NULL',
1171
- 'NOT_NULL',
1172
- 'TOMORROW',
1173
- 'YESTERDAY',
1174
- 'NEXT_WEEK',
1175
- 'UP_WEEK',
1176
- 'NEXT_MONTH',
1177
- 'UP_MONTH',
1178
- 'NEXT_SEASON',
1179
- 'UP_SEASON',
1180
- 'NEXT_YEAR',
1181
- 'UP_YEAR'
1182
- ];
1183
- let ageList = ['BIG', 'BIGEQ', 'LESS', 'LESSEQ'];
1184
- // 自定义输入关系的“key”
1185
- const customTypes = ['EQ', 'IN', 'NEQ'];
1186
- const numbercustoms = ['EQ', 'NEQ', 'BIG', 'LESS', 'BIGEQ', 'LESSEQ'];
1187
-
1188
- item.showRangeAge = false; // 年龄范围
1189
- item.showAgeCom = false; // 年龄范围
1190
- let inRelation = ['QUOTE_IN', 'QUOTE_NOTIN'];
1191
- if (arr.includes(value)) {
1192
- item.showInput = false;
1193
- item.showSelect = false;
1194
- item.showDate = false;
1195
- item.showSearch = false;
1196
- item.showRelation = false;
1197
- this.initBirthdayParams(item);
1198
- } else if (['IN_THE_PAST', 'IN_THE_FUTURE', 'N_', 'L_', 'IN_THE_PAST_DI', 'IN_THE_FUTURE_DI'].includes(value)) {
1199
- // 以前、以后、过去内、未来内
1200
- // L_ N_ IN_THE_PAST IN_THE_FUTURE 添加小时
1201
- // 过去第 未来第
1202
- // IN_THE_PAST_DI IN_THE_FUTURE_DI
1203
- item.showSelect = true;
1204
- item.showInput = true;
1205
- item.showDate = false;
1206
- item.showSearch = false;
1207
- item.showRelation = false;
1208
- if (value == 'IN_THE_PAST_DI' || value == 'IN_THE_FUTURE_DI') {
1209
- this.$set(item, 'dateList', this.dateList);
1210
- } else {
1211
- let dateList = this.dateList.concat(this.dateTimeList);
1212
- this.$set(item, 'dateList', dateList);
1213
- }
1214
- if (!isInitSet) {
1215
- this.$set(item, 'unit', 'DAY');
1216
- }
1217
- this.initBirthdayParams(item);
1218
- } else if (value == 'IN') {
1219
- // field_key: "birthday"
1220
- if (attr == 'BIRTHDAY') {
1221
- item.showBirthdayDate = true;
1222
- item.showDate = false;
1223
- item.units = this.birthdayUnits.filter(i => i.units === 1);
1224
- } else if (attr == 'AGE') {
1225
- item.showRangeAge = true;
1226
- } else {
1227
- item.showDate = true;
1228
- this.initBirthdayParams(item);
1229
- }
1230
- item.showSelect = false;
1231
- item.showInput = false;
1232
- item.showSearch = false;
1233
- item.showRelation = false;
1234
- } else if (value == 'CONVERT' || value == 'QUOTE' || value == 'QUOTE_NOT') {
1235
- item.showDate = false;
1236
- item.showSelect = false;
1237
- item.showInput = false;
1238
- item.showSearch = true;
1239
- item.showRelation = false;
1240
- this.initBirthdayParams(item);
1241
- let showSetting = false;
1242
- if (item.settingObj?.showSetting?.length) {
1243
- showSetting = true;
1244
- }
1245
- // 这里wordbookValueList替换wordbookData 还是有点问题 需要根据具体场景再修改
1246
- if (!showSetting && item.wordbookValueList?.length) {
1247
- this.$set(item, 'wordbookData', item.wordbookValueList);
1248
- }
1249
- } else if (inRelation.includes(value)) {
1250
- // 跨表查询
1251
- item.showRelation = true;
1252
- item.showInput = false;
1253
- item.showSelect = false;
1254
- item.showDate = false;
1255
- item.showSearch = false;
1256
- this.initBirthdayParams(item);
1257
- } else if (attr == 'AGE') {
1258
- if (ageList.includes(value)) {
1259
- item.showAgeCom = true;
1260
- }
1261
- } else {
1262
- item.showSelect = false;
1263
- item.showDate = false;
1264
- if (item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
1265
- item.showInput = false;
1266
- } else {
1267
- item.showInput = true;
1268
- }
1269
- item.showSearch = false;
1270
- item.showRelation = false;
1271
- this.initBirthdayParams(item);
1272
- }
1273
-
1274
- if (!this.showCompareField) return;
1275
-
1276
- let s_type = config?.type;
1277
- if (s_type === '_custom__input_') return;
1278
-
1279
- if (customTypes.includes(value) || (['NUMBER', 'DATE', 'DATETIME', 'TIME'].includes(item.fieldType) && numbercustoms.includes(value))) {
1280
- this.$set(item, 'is_compare_field', true);
1281
- this.$set(item, 'customInput', false);
1282
- this.handleSetSelectList(item);
1283
- if (Array.isArray(item.selectList)) {
1284
- // 默认选中第一
1285
- if (item.selectList.length > 1) {
1286
- let [a] = item.selectList;
1287
- let compare_val = isInitSet? item.compare_field || a.value : a.value;
1288
- this.$set(item, 'compare_field', compare_val);
1289
- setTimeout(() => {
1290
- // 里面递归调用 selectChild ,异步等待,第一个方法执行完成
1291
- this.compare_fieldOnChange(compare_val, item);
1292
- }, 100);
1293
- } else {
1294
- let selectList = item?.selectList || [];
1295
- let len = selectList?.length || 0;
1296
- let onlyCustomInput = len === 1 ? selectList[0].value === '_custom__input_' : false;
1297
- // selectList 只有一个选项并且 是 _custom__input_ ,隐藏 select ,展示 customInput
1298
- if (onlyCustomInput) {
1299
- this.$set(item, 'customInput', true);
1300
- item.compare_field = '_custom__input_';
1301
- return;
1302
- }
1303
- }
1304
- }
1305
-
1306
- if (isInitSet) {
1307
- // 如果是 is_compare_field 字段 并有值compare_field
1308
- if (config.is_compare_field && item.compare_field) {
1309
- this.$set(item, 'is_compare_field', true);
1310
- } else if (item.start_val || item.end_val || item.value || item.wordValue || item.showSelect) {
1311
- // 自定义输入回填
1312
- this.$set(item, 'customInput', true);
1313
- item.compare_field = '_custom__input_';
1314
- return;
1315
- }
1316
- }
1317
- this.handleHideItem(item, false);
1318
- } else {
1319
- item.customInput = true;
1320
- item.is_compare_field = false;
1321
- item['compare_field'] && (item['compare_field'] = undefined);
1322
- }
1323
- },
1324
- handleHideItem(item, reset = true) {
1325
- item.showRangeAge = false; // 年龄范围
1326
- item.showAgeCom = false; // 年龄范围
1327
- item.showInput = false;
1328
- item.showSelect = false;
1329
- item.showDate = false;
1330
- item.showSearch = false;
1331
- item.showRelation = false;
1332
-
1333
- // item.value = "";
1334
- // this.$set(item, 'value', '');
1335
- reset && this.$set(item, 'value', '');
1336
- },
1337
- disabledDatePicker(current, item, t){
1338
- if(item.isIllegalField) return true
1339
- let f = false;
1340
- if(t=== 'start'){
1341
- const end_val = item?.end_val;
1342
- f = end_val && current.valueOf() > end_val.valueOf();
1343
- } else if(t=== 'end') {
1344
- const start_val = item?.start_val;
1345
- f = start_val && current.valueOf() <= start_val.valueOf();
1346
- }
1347
- /**
1348
- * 2 过去时间
1349
- * 3 未来时间
1350
- */
1351
- let type = String(item?.advanceOptionSetting);
1352
- if(!['2','3'].includes(type)) return f;
1353
- if(type === '2'){
1354
- return current >= moment().endOf('day') || f;
1355
- } else if(type==='3'){
1356
- return current && current < moment().startOf('day') || f;
1357
- }
1358
- return f
1359
- },
1360
- disabledStartDate(start_val) {
1361
- const end_val = this.end_val;
1362
- if (!start_val || !end_val) {
1363
- return false;
1364
- }
1365
- return start_val.valueOf() > end_val.valueOf();
1366
- },
1367
- disabledEndDate(end_val) {
1368
- const start_val = this.start_val;
1369
- if (!end_val || !start_val) {
1370
- return false;
1371
- }
1372
- return start_val.valueOf() >= end_val.valueOf();
1373
- },
1374
- handleStartOpenChange(open, item) {
1375
- if (!open) {
1376
- this.$set(item, 'endOpen', true);
1377
- }
1378
- },
1379
- handleEndOpenChange(open, item) {
1380
- this.$set(item, 'endOpen', open);
1381
- },
1382
- // 日期选择范围
1383
- disabledDate(current) {
1384
- return (current && current < moment().startOf('year')) || current > moment().endOf('year');
1385
- },
1386
- changeRange(value, item) {
1387
- let res = [];
1388
- if (value.length > 0) {
1389
- value.forEach(item => {
1390
- item._d && res.push(utils.formatTime('MOUTH', item._d));
1391
- });
1392
- }
1393
- if (res.length > 0) {
1394
- item.curlimit_date = res.join('~');
1395
- }
1396
- },
1397
- // 选择关联表
1398
- handlerSelectRelation(e, item) {
1399
- let curItem = this.relationTableList.find(v => v.tableId === e);
1400
- curItem && (item.relationField = curItem.relationField);
1401
- item.relationFieldList = JSON.parse(JSON.stringify(curItem?.fieldList?.fieldList || []));
1402
- item.converFun = curItem.converFun || undefined;
1403
- item.parameterConversionId = curItem.parameterConversionId || undefined;
1404
- item.relationOrgId = curItem.relationOrgId || undefined;
1405
- item.preConObj = curItem.preConObj || undefined;
1406
- item.preSqlExpression = curItem.preSqlExpression || undefined;
1407
- },
1408
- openRelationFilter(data, i) {
1409
- this.clcikRelationIndex = i;
1410
- this.relationAction = data.quote_con;
1411
- this.relationSearchFieldList = data.relationFieldList;
1412
- this.relationVisible = true;
1413
- // sqlExpression
1414
- },
1415
- relationCancel() {
1416
- this.relationVisible = false;
1417
- this.relationAction = {};
1418
- this.relationSearchFieldList = [];
1419
- },
1420
- relationSave(data) {
1421
- let { setting = '' } = data;
1422
- let settingObj = JSON.parse(setting);
1423
- this.actionList[this.clcikRelationIndex].quote_con = {
1424
- conObj: settingObj.conObj,
1425
- sqlExpression: settingObj.sqlExpression
1426
- };
1427
- this.relationCancel();
1428
- },
1429
- initBirthdayParams(item) {
1430
- item.showBirthdayDate = false;
1431
- item.unit = item.unit || 'YEAR';
1432
- item.units = this.birthdayUnits.filter(i => i.units === 1);
1433
- },
1434
- handleParentNamesAdd(e) {
1435
- const nextInput = e?.target?.nextElementSibling;
1436
- setTimeout(() => {
1437
- nextInput && nextInput.focus();
1438
- });
1439
- this.showAdd = true;
1440
- },
1441
- hanldeBlur() {
1442
- this.showAdd = false;
1443
- if (!this.addVal) return;
1444
- this.parentNames.forEach(v => (v.selected = false));
1445
- this.parentNames.push({
1446
- disabled: true,
1447
- value: this.addVal,
1448
- selected: true,
1449
- isAdd: true
1450
- });
1451
- this.addVal = '';
1452
- },
1453
- editParentName(e, item) {
1454
- item.disabled = false;
1455
- setTimeout(() => {
1456
- e.target.focus();
1457
- }, 0);
1458
- },
1459
- handleParentNameSelect(item, index) {
1460
- if (!item.disabled) return;
1461
- this.parentNames.forEach((pItem, pIndex) => {
1462
- if (pIndex !== index) {
1463
- pItem.selected = false;
1464
- }
1465
- });
1466
- item.selected = !item.selected;
1467
- },
1468
- handleParentNamesRemove(index, item) {
1469
- // this.parentNames.splice(index, 1);
1470
- this.handleParent(index, item);
1471
- },
1472
- handleParent(index, item) {
1473
- let { conditionList } = this;
1474
- if (!conditionList || !conditionList.length) {
1475
- this.parentNames.splice(index, 1);
1476
- return;
1477
- }
1478
- let hasItem = conditionList.filter(v => v.displayCategory === item.value);
1479
- if (!hasItem || !hasItem.length) {
1480
- this.parentNames.splice(index, 1);
1481
- return;
1482
- }
1483
- this.$message.error('该分类下有已有数据,请删除该分类下的筛选集后重试!');
1484
- },
1485
- getParentSelectedStyle(item) {
1486
- if (item.selected && item.disabled) {
1487
- return {
1488
- backgroundColor: '#2D7AFF',
1489
- color: '#fff'
1490
- };
1491
- }
1492
- return null;
1493
- },
1494
-
1495
- // 年龄组件变化
1496
- ageRangeOnChange(obj, item) {
1497
- let s = obj.star_val;
1498
- let e = obj.end_val;
1499
- this.$set(item, 'start_val', isNaN(s) ? undefined : s);
1500
- this.$set(item, 'end_val', isNaN(e) ? undefined : e);
1501
- },
1502
-
1503
- agecomOnChange(obj, item) {
1504
- this.$set(item, 'value', isNaN(obj.days) ? undefined : obj.days);
1505
- },
1506
-
1507
- diffTime(days) {
1508
- let d = +days;
1509
- if (isNaN(d)) return {};
1510
- if (typeof d == 'number') {
1511
- let next = 0;
1512
- let year = Math.floor(d / 365);
1513
- next = d % 365;
1514
- let month = Math.floor(next / 30);
1515
- next = next % 30;
1516
- let day = next;
1517
-
1518
- return { year, month, day, d };
1519
- }
1520
- return {};
1521
- },
1522
-
1523
- filterOption(...arg) {
1524
- return utils.filterOption(...arg);
1525
- },
1526
-
1527
- /**
1528
- * 选中字段
1529
- */
1530
- handleSetSelectList(item) {
1531
- let list = this.searchList
1532
- .filter(v => v.fieldType == item.fieldType && (this.isBI ? v.fieldId : v.columnName) != item.field_key)
1533
- .map(v => {
1534
- return {
1535
- value: this.isBI ? v.fieldId : v.columnName,
1536
- name: v.alias || v.title
1537
- };
1538
- });
1539
-
1540
- list.unshift({
1541
- value: '_custom__input_',
1542
- name: '自定义输入'
1543
- });
1544
-
1545
- this.$set(item, 'selectList', list);
1546
- },
1547
-
1548
- /**
1549
- * 切换字段选项
1550
- */
1551
- compare_fieldOnChange(e, item) {
1552
- if (e === '_custom__input_') {
1553
- item.customInput = true;
1554
- this.selectChild(item.con, item, false, { type: '_custom__input_' });
1555
- } else {
1556
- item.customInput = false;
1557
- this.$set(item, 'value', '');
1558
- }
1559
- },
1560
-
1561
- checkCustomInput(item) {
1562
- /**
1563
- * 判断可选的 是否 只有 “_custom__input_”
1564
- */
1565
- let selectList = item?.selectList || [];
1566
- let len = selectList?.length || 0;
1567
- let onlyCustomInput = len === 1 ? selectList[0].value === '_custom__input_' : false;
1568
- return onlyCustomInput;
1569
- },
1570
-
1571
- visibleCompareField(item) {
1572
- if (!this.showCompareField) return false;
1573
- let onlyCustomInput = this.checkCustomInput(item);
1574
- /**
1575
- * 展示 compare_field 条件
1576
- * 1. 是is_compare_field 字段 并且有字段可选
1577
- */
1578
- return item.is_compare_field && !onlyCustomInput;
1579
- },
1580
-
1581
- visibleDefaultField(item) {
1582
- /**
1583
- * 展示默认字段的条件
1584
- * 1. 非 is_compare_field 字段
1585
- * 2. 是 is_compare_field 字段,选中 自定义输入 is_compare_field
1586
- * 3. 是 is_compare_field 字段 ,没有可选的 onlyCustomInput
1587
- */
1588
- if (!this.showCompareField) return true;
1589
- let onlyCustomInput = this.checkCustomInput(item);
1590
- return item.customInput || !item.is_compare_field || onlyCustomInput;
1591
- },
1592
-
1593
- handleHideCompareField(item) {
1594
- if (!this.showCompareField) return;
1595
- item.customInput = false;
1596
- item.is_compare_field = false;
1597
- item.compare_field = undefined;
1598
- },
1599
-
1600
- checkActionList() {
1601
- let f = this.actionList.every(v => !v.field_key);
1602
- return f;
1603
- },
1604
-
1605
- /**
1606
- * select 变化
1607
- */
1608
- fieldselectONchange(item, eventName, value, vnode) {
1609
- // 清空操作
1610
- if (value === undefined) {
1611
- eventName === 'changeColumnName' && this.handleResetColumnName(item);
1612
- eventName === 'selectChild' && this.handleResetSelectChild(item);
1613
- }
1614
-
1615
- // 有改变去掉“兼容”的值
1616
- item.is_compatibility = undefined;
1617
- item.compatibility_con = undefined;
1618
- },
1619
-
1620
- handleResetColumnName(item) {
1621
- item.con = undefined;
1622
- this.$set(item, 'wordValue', []);
1623
- this.$set(item, 'wordbookData', []);
1624
- this.handleHideItem(item);
1625
- },
1626
-
1627
- handleResetSelectChild(item) {
1628
- this.$set(item, 'wordValue', []);
1629
- // this.$set(item, 'wordbookData', []);
1630
- this.$set(item, 'value', undefined);
1631
- this.$set(item, 'showSelect', undefined);
1632
- this.$set(item, 'start_val', null);
1633
- this.$set(item, 'end_val', null);
1634
- this.handleHideItem(item);
1635
- },
1636
-
1637
- checkItem(item){
1638
- /**
1639
- * 这是兼容处理
1640
- * 场景:admin 配置的映射数据,配置了“自定义输入”,期望能正常展示。
1641
- */
1642
- if(['copy','edit'].includes(this.fromType)){
1643
- let f = item.is_compare_field && this.showCompareField && item.compare_field === '_custom__input_';
1644
- // 复制模式,回填是“自定义输入”,但不支持“自定义输入”的类型
1645
- let isArr = Array.isArray(item.searchChildList);
1646
- if(f && isArr){
1647
- let con = item.searchChildList.find(v=> v.name == item.con);
1648
- // 该字段关系没有该类型
1649
- if(!con){
1650
- // 缓存 con 值
1651
- item.compatibility_con = item.con;
1652
- // 从默认关系中查找“关系”
1653
- let defCon = this.searchChildList.find(v=> v.name === item.con);
1654
- item.con = defCon?.desc || item.compatibility_con;
1655
- // 兼容模式标识
1656
- this.$set(item, 'is_compatibility', true)
1657
- }
1658
- }
1659
- }
1660
- }
1661
- }
1662
- });
1663
- </script>
1664
-
1665
- <style lang="less" scoped>
1666
- .inner-content {
1667
- color: #000;
1668
- & > p > span {
1669
- cursor: pointer;
1670
- }
1671
- .item-name {
1672
- display: flex;
1673
- height: 32px;
1674
- line-height: 32px;
1675
- margin-bottom: 10px;
1676
- .label {
1677
- width: 120px;
1678
- text-align: right;
1679
- }
1680
- }
1681
- .parent-names {
1682
- display: flex;
1683
- align-items: center;
1684
- flex-wrap: wrap;
1685
- line-height: 32px;
1686
- .label {
1687
- display: inline-block;
1688
- height: 32px;
1689
- line-height: 32px;
1690
- margin-bottom: 10px;
1691
- width: 120px;
1692
- text-align: right;
1693
- }
1694
- /deep/ .ant-btn-dashed {
1695
- border-color: #a6a6a6;
1696
- color: #a6a6a6;
1697
- }
1698
-
1699
- .edit-tag {
1700
- position: relative;
1701
- margin-right: 10px;
1702
- margin-bottom: 10px;
1703
- /deep/ .anticon-close {
1704
- position: absolute;
1705
- right: 5px;
1706
- line-height: 36px;
1707
- color: #2d7aff;
1708
- }
1709
- /deep/ .ant-input-disabled {
1710
- color: #2d7aff;
1711
- background-color: rgba(45, 122, 255, 0.1);
1712
- opacity: 1;
1713
- border-color: #2d7aff;
1714
- cursor: pointer;
1715
- }
1716
- /deep/.ant-input-group-addon,
1717
- /deep/.ant-input:not(:hover),
1718
- /deep/.ant-input-number:not(:hover) {
1719
- border-color: #2d7aff !important;
1720
- }
1721
- &.edit-tag-select {
1722
- /deep/ .ant-input-disabled {
1723
- color: #fff;
1724
- background-color: #2d7aff;
1725
- }
1726
- /deep/ .anticon-close {
1727
- color: #fff;
1728
- }
1729
- }
1730
- }
1731
- /deep/ .ant-btn {
1732
- margin-bottom: 10px;
1733
- }
1734
- }
1735
- .item-list {
1736
- padding-top: 12px;
1737
- margin-top: 16px;
1738
- margin-bottom: 6px;
1739
- border-top: 1px solid #e6e6e6;
1740
- &.list-onlyCondition {
1741
- padding-top: 0;
1742
- border-top: 0px;
1743
- }
1744
- li {
1745
- margin-bottom: 10px;
1746
- }
1747
- .form-item {
1748
- width: 120px;
1749
- margin-right: 10px;
1750
- }
1751
- .form-action {
1752
- font-size: 16px;
1753
- float: right;
1754
- margin-top: 6px;
1755
- cursor: pointer;
1756
- }
1757
- .date-item {
1758
- display: inline-block;
1759
- }
1760
- .birthday-item {
1761
- > div {
1762
- display: inline-block;
1763
- margin-top: 5px;
1764
- p {
1765
- display: inline-block;
1766
- margin: 0 10px 0 15px;
1767
- }
1768
- > span {
1769
- margin-top: 5px;
1770
- }
1771
- }
1772
- .age-wrap {
1773
- display: inline-block;
1774
- }
1775
- }
1776
- .relation-item {
1777
- display: inline-block;
1778
- .relation-width {
1779
- width: 150px;
1780
- margin-right: 10px;
1781
- }
1782
- .relation-btn {
1783
- cursor: pointer;
1784
- }
1785
- }
1786
- .range-container {
1787
- display: inline-block;
1788
- width: 442px;
1789
- /* line-height: 1.5; */
1790
- vertical-align: bottom;
1791
- }
1792
- .item-error {
1793
- color: red;
1794
- display: inline-block;
1795
- }
1796
- }
1797
- .index-span {
1798
- width: 30px;
1799
- display: inline-block;
1800
- }
1801
- }
1802
- .blue {
1803
- color: #2d7aff;
1804
- margin-right: 8px;
1805
- }
1806
- .red {
1807
- color: #e02020;
1808
- }
1809
-
1810
- .in-block {
1811
- display: inline-block;
1812
- }
1813
- </style>
1814
-
1815
- <style lang="less">
1816
- // 专业模式下的样式修改
1817
- ._c_com-search-professional {
1818
- .inner-content {
1819
- .item-list {
1820
- > li {
1821
- position: relative;
1822
- .def_item_input {
1823
- position: absolute;
1824
- width: 100%;
1825
- }
1826
- .show-small-select {
1827
- .val-small-select-wrap {
1828
- width: 66px !important;
1829
- }
1830
- .val-input-wrap {
1831
- width: 34% !important;
1832
- }
1833
- }
1834
- }
1835
- }
1836
-
1837
- .item-error {
1838
- display: block;
1839
- padding-left: 29px;
1840
- }
1841
- .form-action {
1842
- position: absolute;
1843
- right: 0px;
1844
- top: 0;
1845
- }
1846
- }
1847
-
1848
- .select-front-item {
1849
- width: 23% !important;
1850
- }
1851
- .val-input-wrap {
1852
- width: 42%;
1853
- display: inline-block;
1854
- .ant-input {
1855
- width: 100% !important;
1856
- }
1857
- }
1858
- .val-select-wrap,
1859
- .val-age-wrap,
1860
- .val-date-wrap {
1861
- width: 42% !important;
1862
-
1863
- .ant-calendar-picker {
1864
- width: 50% !important;
1865
- }
1866
- }
1867
-
1868
- .val-range-wrap {
1869
- width: 42% !important;
1870
- .ant-input-group {
1871
- .age-com {
1872
- // 年龄组件 单位
1873
- .age-com-suffix {
1874
- padding: 0 1px;
1875
- }
1876
- .ant-input-number {
1877
- // 修改宽度
1878
- width: 100%;
1879
- // 隐藏数字操作项
1880
- .ant-input-number-handler-wrap {
1881
- display: none;
1882
- }
1883
- // 修改inputpadding
1884
- .ant-input-number-input-wrap {
1885
- input {
1886
- padding: 0 2px;
1887
- }
1888
- }
1889
- }
1890
- }
1891
- }
1892
- }
1893
- .teavalue-wrap {
1894
- width: calc(88% + 20px);
1895
- }
1896
- }
1897
- </style>
1
+ <template>
2
+ <div :class="['SearchCondition-page', is_search_professional ? '_c_com-search-professional' : '']">
3
+ <div class="inner-content">
4
+ <div class="item-name" v-if="showItemName">
5
+ <span class="label">筛选分类名称:</span>
6
+ <!-- 1.1.6.6请输入分类名称 -->
7
+ <a-input v-model="className" :placeholder="'请输入分类名称'" style="width: 250px" :maxLength="10" />
8
+ </div>
9
+ <div class="parent-names" v-if="showItemName">
10
+ <!-- 1.9.362父类名称 -->
11
+ <span class="label">{{ '父类名称' }}:</span>
12
+ <div
13
+ class="edit-tag"
14
+ v-for="(item, index) in parentNames"
15
+ :key="index"
16
+ @dblclick="e => editParentName(e, item)"
17
+ @click="handleParentNameSelect(item, index)"
18
+ :class="{ 'edit-tag-select': item.selected && item.disabled }"
19
+ >
20
+ <a-input style="width: 100px" :value="item" :disabled="item.disabled" @blur="() => (item.disabled = true)" v-model="item.value" :maxLength="10" />
21
+ <a-icon slot="suffix" type="close" @click="handleParentNamesRemove(index, item)" />
22
+ </div>
23
+ <template v-if="!parentNamesHasAdd">
24
+ <a-button v-show="!showAdd" icon="plus" type="dashed" @click="handleParentNamesAdd">
25
+ <!-- 1.9.363添加父类 -->
26
+ {{ '添加父类' }}
27
+ </a-button>
28
+ <a-input class="edit-tag" v-model.trim="addVal" v-show="showAdd" style="width: 100px" @blur="hanldeBlur" :maxLength="10" />
29
+ </template>
30
+ </div>
31
+ <div class="item-name" v-if="classify === 'custom' && !homeManage && !hideAddBtn">
32
+ <span class="label" v-if="!isOnlyCondition"> 过滤条件: </span>
33
+ <span @click="addAction" style="cursor: pointer">
34
+ <a-icon type="plus-circle" class="blue" theme="filled" />
35
+ <span>{{ isOnlyCondition ? '添加操作' : '添加' }}</span>
36
+ </span>
37
+ </div>
38
+ <!-- 首页管理过滤条件支持选择分类 -->
39
+ <div class="item-name" v-if="homeManage">
40
+ <span class="label">选择筛选分类:</span>
41
+ <a-select v-model="classify" style="width: 250px">
42
+ <a-select-option :value="item.sid" v-for="item in classifyList" :key="item.sid">
43
+ {{ item.name }}
44
+ </a-select-option>
45
+ <a-select-option value="custom"> 自定义 </a-select-option>
46
+ </a-select>
47
+ </div>
48
+ <div class="item-name" v-if="classify === 'custom' && homeManage">
49
+ <span class="label"> 过滤条件: </span>
50
+ <span @click="addAction" style="cursor: pointer">
51
+ <a-icon type="plus-circle" class="blue" theme="filled" />
52
+ <span>添加</span>
53
+ </span>
54
+ </div>
55
+ <ul class="item-list" v-if="classify === 'custom'" :class="{ 'list-onlyCondition': isOnlyCondition }">
56
+ <li v-for="(item, index) in actionList" :key="index">
57
+ <span class="index-span">{{ index + 1 }}&nbsp;&nbsp;&nbsp;</span>
58
+ <!-- 选择 field_key -->
59
+ <a-select
60
+ class="form-item select-front-item"
61
+ placeholder="请选择"
62
+ allowClear
63
+ v-model="item.field_key"
64
+ :disabled="item.isIllegalField"
65
+ showSearch
66
+ :filterOption="filterOption"
67
+ @select="changeColumnName($event, item)"
68
+ @change="(...arg) => fieldselectONchange(item, 'changeColumnName', ...arg)"
69
+ :dropdownMatchSelectWidth="false"
70
+ >
71
+ <a-select-option v-for="sea in item.searchList" :key="isBI ? sea.fieldId : sea.sid" :value="isBI ? sea.fieldId : sea.columnName" :title="sea.title || sea.columnName">{{
72
+ handleName(sea)
73
+ }}</a-select-option>
74
+ </a-select>
75
+ <!-- 选择 关系 -->
76
+ <!-- 1.1.6.7请选择 -->
77
+ <!-- 1.1.6.11暂无数据 -->
78
+ <a-select
79
+ v-model="item.con"
80
+ showSearch
81
+ :dropdownMatchSelectWidth="false"
82
+ :filterOption="filterOption"
83
+ :placeholder="'请选择'"
84
+ class="form-item select-front-item"
85
+ allowClear
86
+ @select="selectChild($event, item)"
87
+ @change="(...arg) => fieldselectONchange(item, 'selectChild', ...arg)"
88
+ :disabled="item.isIllegalField"
89
+ :notFoundContent="fetching ? undefined : '暂无数据'"
90
+ >
91
+ <a-select-option v-for="child in item.searchChildList" :key="child.name" :value="child.name" :title="child.desc">{{ child.desc }}</a-select-option>
92
+ </a-select>
93
+
94
+ <!-- 下拉框展示本列表相同数据类型 -->
95
+ <!-- item.is_compatibility 兼容模式,不可修改,兼容模式数据格式类型不对的,仅展示 -->
96
+ <a-select
97
+ class="form-item"
98
+ @select="compare_fieldOnChange($event, item)"
99
+ v-show="visibleCompareField(item)"
100
+ v-model="item.compare_field"
101
+ showSearch
102
+ :filterOption="filterOption"
103
+ style="width: 120px"
104
+ :disabled="item.is_compatibility"
105
+ >
106
+ <a-select-option v-for="date in item.selectList" :key="date.value" :value="date.value" :title="date.name">{{ date.name }}</a-select-option>
107
+ </a-select>
108
+
109
+ <div class="in-block def_item_input" :class="[item.showSelect ? 'show-small-select' : '']" v-show="visibleDefaultField(item)">
110
+ <!-- 展示 -->
111
+ <span v-show="item.showInput" class="val-input-wrap">
112
+ <!-- 增加 showInput 插槽 支持自定义showInput 内容 -->
113
+ <slot name="showInput" :item="item">
114
+ <a-input-number :disabled="item.isIllegalField" v-if="showPercent(item)" class="CL-input" style="width: 200px" v-model="item.value" :min="0" :max="100" />
115
+ <!-- item.is_compatibility 兼容模式,不可修改,兼容模式数据格式类型不对的,仅展示 -->
116
+ <a-input v-else v-model="item.value" :disabled="item.isIllegalField || item.is_compatibility" class="form-item" />
117
+ </slot>
118
+ </span>
119
+ <a-select
120
+ class="val-select-wrap"
121
+ v-if="item.showSearch"
122
+ v-model="item.wordValue"
123
+ :disabled="item.isIllegalField"
124
+ mode="multiple"
125
+ :tokenSeparators="['|#|']"
126
+ style="width: 160px"
127
+ :filter-option="false"
128
+ @dropdownVisibleChange="dropdownVisibleChange($event, item)"
129
+ @search="e => handleSearch(e, item)"
130
+ @select="handleSelect($event, item)"
131
+ @deselect="handleDeSelect($event, item)"
132
+ >
133
+ <a-select-option v-for="sea in item.wordbookData" :key="item.sid + sea.myName" :value="sea.myName">
134
+ {{ sea.showKeys || sea.myName }}
135
+ </a-select-option>
136
+ </a-select>
137
+
138
+ <a-select v-show="item.showSelect" class="val-small-select-wrap" v-model="item.unit" showSearch :filterOption="filterOption" :disabled="item.isIllegalField" style="width: 66px">
139
+ <a-select-option v-for="date in item.dateList" :key="date.value" :value="date.value" :title="date.name">{{ date.name }}</a-select-option>
140
+ </a-select>
141
+
142
+ <div class="date-item val-date-wrap" v-if="item.showDate">
143
+ <a-date-picker
144
+ :disabledDate="current => disabledDatePicker(current, item, 'start')"
145
+ format="YYYY-MM-DD HH:mm:ss"
146
+ v-model="item.start_val"
147
+ :show-time="{
148
+ defaultValue: $moment('00:00:00', 'HH:mm:ss')
149
+ }"
150
+ :placeholder="'请选择'"
151
+ @openChange="handleStartOpenChange($event, item)"
152
+ style="width: 120px; minWidth: 170px"
153
+ />
154
+ <a-date-picker
155
+ :disabledDate="current => disabledDatePicker(current, item, 'end')"
156
+ format="YYYY-MM-DD HH:mm:ss"
157
+ :placeholder="'请选择'"
158
+ v-model="item.end_val"
159
+ :open="item.endOpen"
160
+ :show-time="{
161
+ defaultValue: $moment('23:59:59', 'HH:mm:ss')
162
+ }"
163
+ @openChange="handleEndOpenChange($event, item)"
164
+ style="width: 120px; minWidth: 170px"
165
+ />
166
+ </div>
167
+ <!-- 生日 -->
168
+ <div class="date-item birthday-item val-birthday-wrap" v-if="item.showBirthdayDate">
169
+ <div>
170
+ <a-range-picker v-model="item.limit_date" :disabledDate="disabledDate || item.isIllegalField" @change="changeRange($event, item)" format="MM-DD" style="width: 180px" />
171
+ <div class="age-wrap">
172
+ <!-- 1.2.5.34年龄 -->
173
+ <p>{{ '年龄' }}</p>
174
+ <a-input :disabled="item.isIllegalField" style="width: 60px; margin-right: 10px" v-model="item.start_val" />
175
+ <a-input :disabled="item.isIllegalField" style="width: 60px; margin-right: 10px" v-model="item.end_val" />
176
+ <a-select :disabled="item.isIllegalField" v-model="item.unit" showSearch :filterOption="filterOption" defaultValue="YEAR" style="width: 60px">
177
+ <a-select-option v-for="v in item.units" :key="v.con" :value="v.con">{{ v.title }}</a-select-option>
178
+ </a-select>
179
+ </div>
180
+ </div>
181
+ </div>
182
+ <!-- 跨表 -->
183
+
184
+ <div class="relation-item" v-show="item.showRelation">
185
+ <a-select :disabled="item.isIllegalField" v-model="item.wordValue" showSearch :filterOption="filterOption" @select="handlerSelectRelation($event, item)" class="relation-width">
186
+ <a-select-option v-for="word in item.relationData" :key="word.id" :value="word.tableId">{{ word.tableName }}</a-select-option>
187
+ </a-select>
188
+ <!-- 关联值 -->
189
+ <a-input class="relation-width" disabled v-model="item.relationField" />
190
+ <span class="relation-width blue relation-btn" @click="openRelationFilter(item, index)">
191
+ <!-- 1.1.1.1.6点击设置过滤条件 -->
192
+ {{ '点击设置过滤条件' }}</span
193
+ >
194
+ </div>
195
+
196
+ <!-- 年龄 -->
197
+ <!-- TODO:样式 -->
198
+ <div v-if="item.showRangeAge" class="range-container val-range-wrap">
199
+ <rangeAge
200
+ :disabled="item.isIllegalField"
201
+ :format="item.format"
202
+ :defaultValue="{
203
+ start_val: item.start_val,
204
+ end_val: item.end_val
205
+ }"
206
+ @change="ageRangeOnChange($event, item)"
207
+ ></rangeAge>
208
+ </div>
209
+ <div v-if="item.showAgeCom" class="range-container val-age-wrap">
210
+ <age-com :disabled="item.isIllegalField" :format="item.format" @change="agecomOnChange($event, item)" :value="item.ageValue"></age-com>
211
+ </div>
212
+ </div>
213
+ <!-- -->
214
+ <span class="item-error" v-if="item.field_key && !searchListKey.includes(item.field_key)">检测到该筛选字段是非法无效的,请移除!</span>
215
+ <!-- 1.1.1.3.3删除 -->
216
+ <a-tooltip :title="'删除'" destroyTooltipOnHide>
217
+ <svg-icon v-if="!isSee" v-show="noShowListDelIcon" @click="softDel(index)" class-name="svg-icon-btn is-danger form-action" icon-class="xitongtubiaoliebiaocaozuoanniushanchushixin" />
218
+ </a-tooltip>
219
+ </li>
220
+ </ul>
221
+ <div v-if="classify === 'custom' && !isOnlyCondition">
222
+ <div style="margin-bottom: 6px" v-show="!is_search_professional">
223
+ <!-- 筛选器逻辑编辑,不设置默认为AND1.2.4.9 -->
224
+ {{ '筛选器逻辑编辑,不设置默认为AND' }} <br />
225
+ 例子 (1 AND 2) OR 3
226
+ </div>
227
+ <div>
228
+ <!-- 没啥用撑布局而已 -->
229
+ <span v-if="is_search_professional" style="visibility: hidden;" class="index-span">{{ 1 }}&nbsp;&nbsp;&nbsp;</span>
230
+
231
+ <a-input
232
+ class="teavalue-wrap"
233
+ v-model="teaValue"
234
+ type="textarea"
235
+ :placeholder="is_search_professional ? '筛选条件表达式,不设置默认为AND,例子(1 AND 2) OR 3' : ''"
236
+ :rows="is_search_professional ? 1 : 3"
237
+ />
238
+ </div>
239
+ </div>
240
+ </div>
241
+ <SearchFilter
242
+ v-bind="$attrs"
243
+ :visible="relationVisible"
244
+ openType="relationTable"
245
+ @saveAdd="relationSave"
246
+ @cancelSaveAdd="relationCancel"
247
+ :actionList_prop="relationAction"
248
+ :searchFieldList="relationSearchFieldList"
249
+ />
250
+ </div>
251
+ </template>
252
+
253
+ <script>
254
+ import moment from 'moment';
255
+ import 'moment/locale/zh-cn';
256
+ moment.locale('zh-cn');
257
+ import rangeAge from '~/table-filter/src/components/range-age/index';
258
+ import ageCom from '~/table-filter/src/components/age-com/index';
259
+ import { Icon, Input, Button, InputNumber, Tooltip, Select, DatePicker, message } from 'ant-design-vue';
260
+ import utils from '@/utils/utils-map';
261
+ import FIELDTYPELIST from './fieldTypeList';
262
+ import svgIcon from '@/component/svg/index.vue';
263
+ import create from '@/core/create';
264
+ import { filterApiFn } from '~/table-filter/src/mixins/mixins';
265
+ export default create({
266
+ name: 'search-condition',
267
+ mixins: [filterApiFn],
268
+ props: {
269
+ isSee: Boolean,
270
+ visible: Boolean,
271
+ actionList_prop: Object,
272
+ searchFieldList: {
273
+ type: Array,
274
+ default: () => []
275
+ },
276
+ showItemName: {
277
+ default: true
278
+ },
279
+ saveEmpty: {
280
+ default: false
281
+ },
282
+ // 首页管理
283
+ homeManage: {
284
+ default: false
285
+ },
286
+ tableId: {
287
+ default: ''
288
+ },
289
+ isPersonalizedHome: {
290
+ default: false
291
+ },
292
+ conditionList: {
293
+ type: Array
294
+ },
295
+ source: {
296
+ type: String
297
+ },
298
+ isBI: {
299
+ default: false
300
+ },
301
+ // 自定义格式化 actionList 里的数据 (可搭配 slot插槽:showInput使用 )
302
+ formatActionData: {
303
+ type: Function,
304
+ default: v => v
305
+ },
306
+ isOnlyCondition: Boolean,
307
+ isCnHis: {
308
+ // 2021/5/25 257针对云his做修改 只过滤搜索为禁用的条件 fjj需求
309
+ type: Boolean,
310
+ default: false
311
+ },
312
+ isAdmin: {
313
+ type: Boolean,
314
+ default: false
315
+ },
316
+
317
+ // 是否展示 CompareField
318
+ showCompareField: {
319
+ type: Boolean,
320
+ default: false
321
+ },
322
+
323
+ hideAddBtn: {
324
+ type: Boolean,
325
+ default: false
326
+ },
327
+ openType: {
328
+ type: String,
329
+ default: ''
330
+ }
331
+ },
332
+ data() {
333
+ return {
334
+ checkedItem: null,
335
+ actionList: [],
336
+ searchList: [],
337
+ searchChildList: [],
338
+ relationTableList: [], // 跨表
339
+ isRelationList: [], // 跨表字段
340
+ fieldTypeList: FIELDTYPELIST,
341
+ dateList: [
342
+ { name: '天', value: 'DAY' },
343
+ { name: '周', value: 'WEEK' },
344
+ { name: '月', value: 'MONTH' },
345
+ { name: '季度', value: 'QUARTER' },
346
+ { name: '年', value: 'YEAR' }
347
+ ],
348
+ dateTimeList: { name: '小时', value: 'HOUR' },
349
+ relationSelect: [
350
+ { desc: '存在跨表', name: 'QUOTE_IN' },
351
+ { desc: '不存在跨表', name: 'QUOTE_NOTIN' }
352
+ ],
353
+ rangeAgeOptions: [
354
+ { desc: '等于', name: 'IN' },
355
+ { desc: '大于', name: 'BIG' },
356
+ { desc: '大于等于', name: 'BIGEQ' },
357
+ { desc: '小于', name: 'LESS' },
358
+ { desc: '小于等于', name: 'LESSEQ' }
359
+ ],
360
+ start_val: null,
361
+ end_val: null,
362
+ className: '',
363
+ teaValue: '',
364
+ classifyId: '',
365
+ // 跨表过滤
366
+ relationVisible: false,
367
+ relationAction: {},
368
+ relationSearchFieldList: [],
369
+ clcikRelationIndex: undefined,
370
+ fetching: false,
371
+ birthdayUnits: [
372
+ { title: '天', units: 1, con: 'DAY' },
373
+ { title: '周', units: 2, con: 'WEEK' },
374
+ { title: '月', units: 1, con: 'MONTH' },
375
+ { title: '岁', units: 1, con: 'YEAR' }
376
+ ],
377
+ limit_date: '',
378
+ parentNames: [],
379
+ // searchSelect
380
+ searchItem: {},
381
+ curWordbookData: undefined,
382
+ curAutograph: '',
383
+ classify: 'custom',
384
+ classifyList: [],
385
+ addVal: '',
386
+ showAdd: false,
387
+ birthdayFilter: ["BIG", "LESS", "BIGEQ", "LESSEQ", "IN_THE_PAST_DI", "IN_THE_FUTURE_DI"]
388
+ };
389
+ },
390
+ computed: {
391
+ parentNamesHasAdd() {
392
+ return this.parentNames.some(v => v.isAdd);
393
+ },
394
+ showPercent() {
395
+ return function(item) {
396
+ return item.settingObj?.attr === 'PERCENTAGE' || false;
397
+ };
398
+ },
399
+
400
+ searchListKey() {
401
+ let res = [];
402
+ this.searchList.forEach(v => {
403
+ v.fieldId && res.push(v.fieldId);
404
+ v.columnName && res.push(v.columnName);
405
+ });
406
+ return res;
407
+ },
408
+ // TODO:
409
+ isOrgAdmin() {
410
+ return this.isAdmin;
411
+ },
412
+ handleName() {
413
+ return function(item, key = 'title') {
414
+ let useKey = key;
415
+ if (this.isBI) {
416
+ useKey = 'remark';
417
+ }
418
+ return item.alias || item[useKey];
419
+ };
420
+ },
421
+ $moment() {
422
+ return moment;
423
+ },
424
+
425
+ is_search_professional() {
426
+ return this.source == 'search-professional';
427
+ },
428
+
429
+ // 筛选分类“专业模式” 只有一条筛选数据,不可以删除。
430
+ noShowListDelIcon() {
431
+ let len = this?.actionList?.length || 0;
432
+ return !(len === 1 && this.source == 'search-professional');
433
+ }
434
+ },
435
+ // created() {
436
+ // this.init();
437
+ // },
438
+ beforeCreate() {
439
+ this.$options.components.SearchFilter = require('../search-filter/SearchFilter.vue').default;
440
+ },
441
+ components: {
442
+ rangeAge,
443
+ ageCom,
444
+ [Icon.name]: Icon,
445
+ [Input.name]: Input,
446
+ [InputNumber.name]: InputNumber,
447
+ [Button.name]: Button,
448
+ [Select.name]: Select,
449
+ [Select.Option.name]: Select.Option,
450
+ [Tooltip.name]: Tooltip,
451
+ [DatePicker.name]: DatePicker,
452
+ [DatePicker.RangePicker.name]: DatePicker.RangePicker,
453
+ svgIcon
454
+ },
455
+ watch: {
456
+ searchFieldList: {
457
+ immediate: true,
458
+ deep: true,
459
+ handler(val) {
460
+ if (val && val.length > 0) {
461
+ // 专业模式,刷新字段,不刷新设置的条件
462
+ if (this.is_search_professional && this.initConditionsed) {
463
+ return;
464
+ }
465
+ this.handleInitConditions();
466
+ }
467
+ }
468
+ }
469
+ },
470
+ methods: {
471
+ handleInitConditions() {
472
+ if (this.homeManage) {
473
+ this.getClassifyList();
474
+ this.classify = this.actionList_prop.displayCategory || 'custom';
475
+ if (this.actionList_prop.displayCategory) {
476
+ this.actionList_prop.conObj = [];
477
+ this.actionList_prop.preSqlExpression = '';
478
+ }
479
+ }
480
+ let { relationTableList = [] } = this.$attrs;
481
+ this.relationTableList = this.openType === 'relationTable' ? [] : relationTableList;
482
+ this.init();
483
+ this.backShow(this.actionList_prop);
484
+ this.showItemName && this.getParentNames();
485
+ this.initConditionsed = true;
486
+ },
487
+ async getClassifyList() {
488
+ let params = { tableId: this.tableId };
489
+ let res = await this.handleGetConfigApi(params, 'requestGetTableCondiTionList');
490
+ if (res.status) {
491
+ this.$emit('setConditionMap', res.data);
492
+ this.classifyList = res?.data?.conditionList || [];
493
+ }
494
+ },
495
+ getParentNames() {
496
+ let parentNames = [];
497
+ let displayCategoryList = this?.$attrs?.displayCategoryList || [];
498
+ displayCategoryList.forEach(item => {
499
+ if (item !== '未分类') {
500
+ parentNames.push({
501
+ disabled: true,
502
+ selected: item === this.actionList_prop.displayCategory,
503
+ value: item
504
+ });
505
+ }
506
+ });
507
+ this.parentNames = parentNames;
508
+ },
509
+ init(config = {}) {
510
+ let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => i.columnName !== 'operatorColumn' && i.isMerge != 1);
511
+ if (mySearchFieldList && mySearchFieldList.length > 0) {
512
+ if (this.isPersonalizedHome) {
513
+ this.searchList = mySearchFieldList;
514
+ } else {
515
+ let searchList = mySearchFieldList
516
+ .map(item => {
517
+ let { settingObj = {} } = item;
518
+ let notParticipatingSearch = false;
519
+ if ('notParticipatingSearch' in settingObj) {
520
+ notParticipatingSearch = settingObj.notParticipatingSearch != 1;
521
+ } else {
522
+ notParticipatingSearch = true;
523
+ }
524
+ const flag = this.isCnHis ? true : item.isSearch == 1 || item.isShowSearch == 1;
525
+ if (flag && notParticipatingSearch) {
526
+ return item;
527
+ }
528
+ return null;
529
+ })
530
+ .filter(Boolean);
531
+ this.searchList = searchList;
532
+ }
533
+
534
+ if (this.searchList.length === 0) {
535
+ return;
536
+ }
537
+
538
+ this.fieldTypeList.some(item => {
539
+ if (this.searchList[0].fieldType == item.name) {
540
+ this.$set(this, 'searchChildList', item.conList);
541
+ return true;
542
+ }
543
+ });
544
+ this.isRelationList = this.relationTableList.map(item => item.primaryField);
545
+ this.actionList = [];
546
+ this.className = '';
547
+ this.teaValue = '';
548
+
549
+ let isInitNoAdd = 'initNoAdd' == config?.type || '';
550
+
551
+ if (isInitNoAdd) return;
552
+
553
+ this.addAction();
554
+ }
555
+ },
556
+ // 回显
557
+ backShow(val) {
558
+ if (!val || !Object.keys(val || {}).length) return;
559
+ let obj = val;
560
+ // 自定义菜单中 过滤 条件回显
561
+ if (this.source === 'customMenuForm' && val.setting && utils.isJSON(val.setting)) {
562
+ obj = JSON.parse(val.setting) || {};
563
+ }
564
+ if (!Object.keys(obj || {}).length) return;
565
+ let relationFieldList = [];
566
+ // this.className = obj.from == "edit" ? obj.name : "";
567
+ this.className = obj.name;
568
+ this.classifyId = obj.from == 'edit' ? obj.sid : '';
569
+ // 标识操作类型
570
+ this.fromType = obj.from;
571
+ this.teaValue = obj.sqlExpression;
572
+ if (obj.conObj && !utils.isArray(obj.conObj)) {
573
+ obj.conObj = JSON.parse(obj.conObj);
574
+ }
575
+ if (!obj.conObj || !obj.conObj.length) return;
576
+ this.actionList = obj.conObj.map(item => {
577
+ let curSet = this.searchList.find(v => (this.isBI ? v.fieldId : v.columnName) == item.field_key);
578
+ if (curSet) {
579
+ item.settingObj = curSet.settingObj;
580
+ }
581
+ if (item.con == 'CONVERT') {
582
+ item.wordValue = item.value;
583
+ } else if (item.con == 'QUOTE' || item.con == 'QUOTE_NOT') {
584
+ item.wordValue = item.value.split('|#|');
585
+ } else if (this.isRelationList.includes(item.field_key)) {
586
+ item.wordValue = item.tableId;
587
+ let curItem = this.relationTableList.find(v => v.tableId === item.tableId);
588
+ if (curItem) {
589
+ item.relationField = curItem.relationField;
590
+ relationFieldList = JSON.parse(JSON.stringify(curItem.fieldList.fieldList) || []);
591
+ }
592
+ }
593
+ let start_val = '';
594
+ let end_val = '';
595
+ let limit_date = [];
596
+ let ageValue = {};
597
+ if (item?.settingObj?.attr === 'PERCENTAGE') {
598
+ if (item.value) {
599
+ item.value = Number(item.value) * 100;
600
+ }
601
+ } else if (item && item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
602
+ start_val = item.start_val ? item.start_val : '';
603
+ end_val = item.end_val ? item.end_val : '';
604
+ if (item.limit_date) {
605
+ let limitString = item.limit_date;
606
+ if (Array.isArray(item.limit_date)) {
607
+ let res = [];
608
+ if (item.limit_date.length > 0) {
609
+ item.limit_date.forEach(v => {
610
+ v._d && res.push(utils.formatTime('MOUTH', v._d));
611
+ });
612
+ }
613
+ if (res.length > 0) {
614
+ item.curlimit_date = res.join('~');
615
+ }
616
+ } else if (utils.isString(limitString)) {
617
+ let temp = [];
618
+ item.curlimit_date = limitString;
619
+ if (utils.isString(limitString)) {
620
+ let res = limitString.split('~');
621
+ if (res.length > 0) {
622
+ for (let i = 0; i < res.length; i++) {
623
+ temp.push(moment(res[i], 'MM-DD'));
624
+ }
625
+ limit_date = temp;
626
+ }
627
+ }
628
+ }
629
+ }
630
+ } else if (item && item.settingObj && item.settingObj.attr == 'AGE') {
631
+ this.$set(item, 'AGEAttr', true);
632
+ start_val = item.start_val;
633
+ end_val = item.end_val;
634
+ ageValue = this.diffTime(item.value);
635
+ // searchChildList
636
+ // 大于(BIG),小于 LESS,大于等于BIGEQ,小于等于LESSEQ,等于(IN)
637
+ } else {
638
+ let curEnd = item.end_val;
639
+ // 只有YYYY-MM-DD 手动添加HH:mm:ss
640
+ if (curEnd && typeof curEnd === "string" && curEnd.length < 11 && !curEnd.includes(":")) {
641
+ curEnd += " 23:59:59";
642
+ }
643
+ start_val = item.start_val ? moment(item.start_val, 'YYYY-MM-DD HH:mm:ss') : '';
644
+ end_val = item.end_val ? moment(curEnd, 'YYYY-MM-DD HH:mm:ss') : '';
645
+ item.curlimit_date = '';
646
+ }
647
+
648
+ item.fieldType = item.fieldType || curSet?.fieldType;
649
+
650
+ // 是否是自定义输入
651
+ if (item.is_compare_field && this.showCompareField) {
652
+ this.handleSetSelectList(item);
653
+ }
654
+ return {
655
+ field_key: item.field_key,
656
+ fieldId: item.field_key,
657
+ fieldType: item.fieldType, // 字段类型
658
+ con: item.con,
659
+ unit: item.unit,
660
+ start_val: start_val,
661
+ end_val: end_val,
662
+ limit_date: limit_date,
663
+ curlimit_date: item.curlimit_date ? item.curlimit_date : '',
664
+ searchList: this.searchList,
665
+ searchChildList: this.searchChildList,
666
+ dateList: this.dateList,
667
+ wordValue: item.wordValue,
668
+ word: item.wordValue,
669
+ value: utils.isString(item.value) ? item.value : JSON.stringify(item.value),
670
+ relationData: this.isRelationList.includes(item.field_key) ? [...this.relationTableList] : [],
671
+ relationField: item.valueField || '',
672
+ relationFieldList: relationFieldList || [],
673
+ quote_con: item.quote_con || {},
674
+ ageValue: ageValue || {},
675
+
676
+ converFun: item.converFun || undefined,
677
+ parameterConversionId: item.parameterConversionId || undefined,
678
+ relationOrgId: item.relationOrgId || undefined,
679
+ preConObj: item.preConObj || undefined,
680
+ preSqlExpression: item.preSqlExpression || undefined,
681
+ isIllegalField: this.isSee || (item.field_key && !this.searchListKey.includes(item.field_key)), // 非法字段
682
+ wordbookValueList: item.wordbookValueList || [],
683
+ wordbookData: [],
684
+
685
+ is_compare_field: item.is_compare_field || false,
686
+ selectList: item.selectList || [],
687
+ customInput: false, // 自定义输入
688
+ compare_field: item.compare_field // 选择的值
689
+ };
690
+ });
691
+ this.actionList.forEach(item => {
692
+ this.formatData(item.field_key, item);
693
+ this.selectChild(item.con, item, true, { is_compare_field: item.is_compare_field });
694
+ this.checkItem(item);
695
+ });
696
+ },
697
+ // 保存列表搜索分类
698
+ saveAdd() {
699
+ // 首页配置支持筛选分类
700
+ if (this.homeManage && this.classify !== 'custom') {
701
+ let classify = this.classifyList.find(item => item.sid === this.classify);
702
+ let setting = {
703
+ displayCategory: classify.sid,
704
+ name: classify.name,
705
+ sqlExpression: classify.sqlExpression,
706
+ conObj: classify.conObj
707
+ };
708
+ let params = {
709
+ id: classify.sid,
710
+ tableId: this.tableId,
711
+ setting: JSON.stringify(setting)
712
+ };
713
+ this.$emit('saveAdd', params);
714
+ return;
715
+ }
716
+ if (this.homeManage && this.classify == 'custom') {
717
+ this.actionList_prop.displayCategory = '';
718
+ this.actionList_prop.name = '';
719
+ }
720
+ if (!this.className && this.showItemName) {
721
+ // 1.1.7.3请输入搜索分类名称
722
+ this.$message.warn(`请输入搜索分类名称!`, 2);
723
+ return;
724
+ }
725
+ if (this.actionList && this.actionList.length > 0) {
726
+ let conObj = this.getConditions();
727
+
728
+ if (!conObj) {
729
+ return;
730
+ }
731
+
732
+ if (this.isOnlyCondition) {
733
+ this.$emit('saveAdd', conObj);
734
+ return;
735
+ }
736
+ let displayCategory = this.parentNames.filter(item => item.selected)[0]?.value;
737
+ let setting = {
738
+ displayCategory,
739
+ name: this.className, // 自定义名称
740
+ sqlExpression: this.teaValue, // 文本域
741
+ conObj
742
+ };
743
+ let params = {
744
+ id: this.classifyId,
745
+ tableId: this.tableId,
746
+ setting: JSON.stringify(setting)
747
+ };
748
+ if (conObj.some(v => !v.con)) {
749
+ return this.$message.warn('请完善筛选条件');
750
+ }
751
+ this.$emit('saveAdd', params);
752
+ const { isInSearch } = this?.$attrs || {};
753
+ // isInSearch = true,等待接口 /tableList/saveTableCondiTion 请求完成 再关闭弹窗。
754
+ if (!isInSearch) {
755
+ this.cancelSaveAdd(false);
756
+ }
757
+ } else {
758
+ if (!this.saveEmpty) {
759
+ // 1.1.6.18请设置搜索条件
760
+ return this.$message.warn(`请设置搜索条件`, 2);
761
+ }
762
+ this.$emit('saveAdd', {
763
+ setting: '{}'
764
+ });
765
+ this.cancelSaveAdd();
766
+ }
767
+ },
768
+ getSqlExpression() {
769
+ return this.teaValue;
770
+ },
771
+ getConditions() {
772
+ let condition = [];
773
+ for (let i = 0; i < this.actionList.length; i++) {
774
+ let item = this.actionList[i];
775
+ if (item.field_key && !this.searchListKey.includes(item.field_key)) {
776
+ this.$message.error('检测到该筛选字段含有非法无效的,请移除!');
777
+ return;
778
+ }
779
+ let attrType = item?.settingObj?.attr || '';
780
+ let value = '';
781
+ if (item.con == 'CONVERT') {
782
+ value = item.wordValue.map(word => {
783
+ return JSON.parse(word);
784
+ });
785
+ } else if (item.con == 'QUOTE' || item.con == 'QUOTE_NOT') {
786
+ value = item.wordValue.join('|#|');
787
+ } else {
788
+ value = item.value;
789
+ }
790
+ let start_val = '';
791
+ let end_val = '';
792
+ let limit_date = [];
793
+ if (item.settingObj && item.settingObj.attr == 'PERCENTAGE') {
794
+ value = Number(value) / 100;
795
+ } else if (item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
796
+ if (item.start_val) {
797
+ let res = utils.validateBirthday(item.start_val, item.title, item.unit);
798
+ if (!res) return;
799
+ }
800
+ if (item.end_val) {
801
+ let res = utils.validateBirthday(item.end_val, item.title, item.unit);
802
+ if (!res) return;
803
+ }
804
+ if (+item.start_val > +item.end_val) {
805
+ // 1.9.47请输入有效范围
806
+ this.$message.warning(`${item.title}请输入有效范围`, 2);
807
+ return;
808
+ }
809
+ start_val = item.start_val ? item.start_val : '';
810
+ end_val = item.end_val ? item.end_val : '';
811
+
812
+ limit_date = item.curlimit_date ? item.curlimit_date : '';
813
+ } else if (attrType == 'AGE') {
814
+ start_val = item.start_val;
815
+ end_val = item.end_val;
816
+ value = item.value;
817
+ } else {
818
+ start_val = item.start_val ? item.start_val.format('YYYY-MM-DD HH:mm:ss') : '';
819
+ end_val = item.end_val ? item.end_val.format('YYYY-MM-DD HH:mm:ss') : '';
820
+ }
821
+
822
+ let is_custom = this.showCompareField ? item.compare_field == '_custom__input_' : false;
823
+
824
+ let temp = {
825
+ field_key: item.field_key, // 一级value
826
+ fieldId: item.field_key, // BI需要拿fieldId
827
+ fieldType: item.fieldType, // 字段类型
828
+ con: item.compatibility_con || item.con, // 二级选择项value
829
+ value: value, // input输入值
830
+ start_val: start_val, // 开始时间
831
+ end_val: end_val, // 结束时间
832
+ unit: item.unit, // 选择时间单位
833
+ limit_date: limit_date,
834
+ tableId: (item.showRelation && item.wordValue) || undefined, // 关联表格ID
835
+ valueField: item.relationField || undefined, // 关联字段
836
+ quote_con: Object.keys(item.quote_con || {}).length ? item.quote_con : null, // 关联表格过滤项
837
+ converFun: item.converFun || undefined,
838
+ parameterConversionId: item.parameterConversionId || undefined,
839
+ relationOrgId: item.relationOrgId || undefined,
840
+ preConObj: item.preConObj || undefined,
841
+ preSqlExpression: item.preSqlExpression || undefined,
842
+ wordbookValueList: item.wordbookValueList,
843
+ is_compare_field: is_custom ? false : item.is_compare_field, // 自定义输入的设为false
844
+ compare_field: is_custom ? undefined : item.compare_field
845
+ };
846
+ condition.push(temp);
847
+ }
848
+ return [...condition];
849
+ },
850
+ // 第二层弹框添加分类按钮
851
+ addAction(config = {}) {
852
+ if (this.searchList.length === 0) {
853
+ return message.warning('暂无字段可设置!');
854
+ }
855
+
856
+ // noDefault 不需要设置默认选中第一条数据
857
+ // is_search_professional 专业模式 不需要默认选中第一条
858
+ let noDefault = config?.noDefault || this.is_search_professional || false;
859
+
860
+ let searchListDefaultItem = this.searchList[0];
861
+ let searchListDefault = '',
862
+ setting = {},
863
+ settingObj = {};
864
+
865
+ if (searchListDefaultItem) {
866
+ searchListDefault = this.isBI ? searchListDefaultItem.fieldId : searchListDefaultItem.columnName;
867
+ setting = searchListDefaultItem.setting;
868
+ settingObj = searchListDefaultItem.settingObj;
869
+ }
870
+
871
+ if (noDefault) {
872
+ searchListDefaultItem = {};
873
+ searchListDefault = undefined;
874
+ }
875
+
876
+ this.actionList.push({
877
+ field_key: searchListDefault,
878
+ fieldId: searchListDefaultItem.fieldId,
879
+ fieldType: searchListDefaultItem.fieldType, // 字段类型
880
+ con: undefined,
881
+ searchList: this.searchList,
882
+ searchChildList: this.searchChildList,
883
+ dateList: this.dateList,
884
+ wordbookData: [],
885
+ relationData: [...this.relationTableList],
886
+ relationField: '',
887
+ relationFieldList: [],
888
+ quote_con: {},
889
+ title: '',
890
+ unit: 'YEAR',
891
+ setting: setting,
892
+ settingObj: settingObj,
893
+ wordbookValueList: [],
894
+ isIllegalField: this.isSee,
895
+
896
+ is_compare_field: false,
897
+ selectList: [],
898
+ customInput: false, // 自定义输入
899
+ compare_field: '' // 选择的值
900
+ });
901
+
902
+ if (noDefault) {
903
+ return;
904
+ }
905
+
906
+ let actionInex = this.actionList.length - 1;
907
+ this.changeColumnName(this.actionList[actionInex].field_key, this.actionList[actionInex]);
908
+ },
909
+ // 软删除
910
+ softDel(index) {
911
+ if (this.isSee) return;
912
+ this.actionList.splice(index, 1);
913
+ },
914
+ cancelSaveAdd() {
915
+ this.$emit('cancelSaveAdd');
916
+ this.actionList = [];
917
+ this.addVisible = false;
918
+ this.showAdd = false;
919
+ this.addVal = '';
920
+ this.className = '';
921
+ this.classifyId = '';
922
+ this.teaValue = '';
923
+ },
924
+ // 第一个下拉框(1)根据不同类型,分别展示input select date
925
+ changeColumnName(value, action) {
926
+ action.con = undefined;
927
+ let f = action.searchList.find(v => v.columnName == value);
928
+ action.fieldType = f?.fieldType || undefined;
929
+ this.$set(action, 'wordValue', []);
930
+ this.$set(action, 'wordbookData', []);
931
+ this.formatData(value, action);
932
+ this.handleHideItem(action);
933
+ this.handleHideCompareField(action);
934
+ this.$set(action, 'isIllegalField', value && !this.searchListKey.includes(value));
935
+ },
936
+ // 数据处理
937
+ formatData(value, action) {
938
+ action.searchList.some(sea => {
939
+ if ((this.isBI ? sea.fieldId : sea.columnName) == value) {
940
+ action.fieldType = sea.fieldType;
941
+
942
+ action.settingObj = sea.settingObj;
943
+ let attrType = sea?.settingObj?.attr || '';
944
+ let format = sea?.settingObj?.format || '';
945
+ action.title = sea.title || '';
946
+ if (sea.setting) {
947
+ utils.isPlainObject(sea.setting) ? '' : (sea.setting = JSON.parse(sea.setting));
948
+ if (!utils.isEmpty(sea.setting.wordbook)) {
949
+ // 1.1.4.26引用
950
+ // 1.2.5.52不引用
951
+ action.searchChildList = [
952
+ { desc: '引用', name: 'QUOTE' },
953
+ { desc: '不引用', name: 'QUOTE_NOT' }
954
+ ];
955
+ let obj = {};
956
+ if (sea.setting.wordbook.params) {
957
+ sea.setting.wordbook.params.forEach(item => {
958
+ obj[item.p_name] = item.p_value;
959
+ });
960
+ }
961
+ this.$set(action, 'settingWordbook', {
962
+ params: obj,
963
+ id: sea.setting.wordbook.id
964
+ });
965
+ // this.getWordbookData(sea.setting.wordbook.id, obj).then(list => {
966
+ // this.$set(action, "wordbookData", list);
967
+ // });
968
+ return true;
969
+ } else if (sea.setting.showSetting && sea.setting.showSetting.length > 0) {
970
+ // 1.1.4.27下拉选项
971
+ action.searchChildList = [{ desc: '下拉选项', name: 'CONVERT' }];
972
+ this.$set(action, 'wordValue', []);
973
+ let showSetting = sea.setting.showSetting;
974
+
975
+ // 字典推荐值
976
+ let dictionItem = this.handleDictionDef(sea);
977
+ if (dictionItem) {
978
+ let { defaultValueTitle } = sea?.dictionarieObj || {};
979
+ let hasDef = showSetting.find(item => item.change_text === defaultValueTitle);
980
+ !hasDef && showSetting.unshift(dictionItem);
981
+ }
982
+ let wordbookData = showSetting.map((set, index) => {
983
+ // 回显逻辑
984
+ if (action.word) {
985
+ utils.isString(action.word) ? (action.word = JSON.parse(action.word)) : '';
986
+ let words = action.word.map(w => JSON.stringify(w));
987
+ let filter = JSON.stringify(set.filter);
988
+ if (words.includes(filter)) {
989
+ action.wordValue.push(filter);
990
+ }
991
+ }
992
+ return {
993
+ name: set.change_text,
994
+ showKeys: set.change_text,
995
+ value: JSON.stringify(set.filter),
996
+ myName: JSON.stringify(set.filter),
997
+ id: (index + 9).toString(36) + index,
998
+ sid: (index + 9).toString(36) + index
999
+ };
1000
+ });
1001
+ action.wordbookData = wordbookData;
1002
+ return true;
1003
+ } else {
1004
+ let matchItem = this.fieldTypeList.find(item => sea.fieldType.toUpperCase() == item.name);
1005
+ let conList = this.searchChildList;
1006
+ if (matchItem) {
1007
+ // 关系 选项
1008
+ conList = matchItem.conList;
1009
+ }
1010
+ if (action?.settingObj?.attr === "BIRTHDAY") {
1011
+ conList = conList.filter(v => !this.birthdayFilter.includes(v.name)) || [];
1012
+ }
1013
+
1014
+ action.searchChildList = conList;
1015
+ }
1016
+ // 通过 attr 判断类型,searchChildList
1017
+ if (attrType == 'AGE') {
1018
+ action.searchChildList = this.rangeAgeOptions;
1019
+ action.format = format.toUpperCase();
1020
+ // action.ageValue = this.diffTime(action.value);
1021
+ }
1022
+ } else {
1023
+ this.fieldTypeList.some(item => {
1024
+ if (sea.fieldType == item.name) {
1025
+ action.searchChildList = item.conList.filter(con => con.name != 'QUOTE' && con.name != 'CONVERT' && con.name != 'QUOTE_NOT');
1026
+ return true;
1027
+ }
1028
+ });
1029
+ }
1030
+ // 跨表字段
1031
+ if (this.isRelationList.includes(value) && !action.searchChildList.some(v => v.name == 'QUOTE_IN')) {
1032
+ action.searchChildList.push(...this.relationSelect);
1033
+ }
1034
+ return true;
1035
+ }
1036
+ });
1037
+ this.formatActionData(action);
1038
+ },
1039
+ // 字典推荐值 item处理
1040
+ handleDictionDef(el) {
1041
+ let { defaultValue, defaultValueTitle } = el?.dictionarieObj || {};
1042
+ let dictionItem = null;
1043
+ if (defaultValue && defaultValueTitle) {
1044
+ dictionItem = {
1045
+ change_text: defaultValueTitle,
1046
+ filter: [
1047
+ {
1048
+ con: 'EQ',
1049
+ field_key: el.columnName,
1050
+ value: defaultValue
1051
+ }
1052
+ ]
1053
+ };
1054
+ }
1055
+ return dictionItem;
1056
+ },
1057
+ getWordbookData(o, obj) {
1058
+ let { id, filterKeys, wordbookType } = o;
1059
+ let resFieldKeys = filterKeys && Array.isArray(filterKeys) ? JSON.stringify(filterKeys) : filterKeys;
1060
+ let url = `/tableReader/getWordbookData`;
1061
+ let params = {
1062
+ wordbookId: id,
1063
+ fieldKeys: resFieldKeys,
1064
+ wordbookType: wordbookType || 'WORDBOOK',
1065
+ ...obj
1066
+ };
1067
+ return this.handleGetConfigApi(params, 'requestGetWordbookData', { fields: o }).then(res => {
1068
+ return res;
1069
+ });
1070
+ },
1071
+ handleWordbookData(item, data) {
1072
+ let { settingObj = {} } = item;
1073
+ let { showKeys = [], defaultValue, defaultValueTitle } = settingObj.wordbook || {};
1074
+ let defaultItem = null;
1075
+ if (defaultValue && defaultValueTitle) {
1076
+ defaultItem = {
1077
+ myName: defaultValue,
1078
+ showKeys: defaultValueTitle
1079
+ };
1080
+ }
1081
+ if (data && data.result) {
1082
+ // 数组赋值并添加唯一name
1083
+ let wordbookData = data.map.rows.map(row => {
1084
+ let showKeysStr = [];
1085
+ showKeys.forEach(ren => {
1086
+ showKeysStr.push(row[ren]);
1087
+ });
1088
+ return Object.assign(row, {
1089
+ myName: String(row[item.settingObj.wordbook.field_key]),
1090
+ showKeys: showKeysStr.join('')
1091
+ });
1092
+ });
1093
+ // 数组对象去重
1094
+ let obj = {};
1095
+ wordbookData = wordbookData.reduce((cur, next) => {
1096
+ obj[next.myName] ? '' : (obj[next.myName] = true && cur.push(next));
1097
+ return cur;
1098
+ }, []);
1099
+ if (defaultItem) {
1100
+ wordbookData.unshift(defaultItem);
1101
+ }
1102
+ this.$set(item, 'wordbookData', wordbookData);
1103
+ }
1104
+ },
1105
+ dropdownVisibleChange(open, item) {
1106
+ if (open) {
1107
+ let obj = {};
1108
+ if (item.settingObj?.wordbook?.params) {
1109
+ item.settingObj.wordbook.params.forEach(item => {
1110
+ obj[item.p_name] = item.p_value;
1111
+ });
1112
+ }
1113
+ if (item.settingObj?.wordbook) {
1114
+ obj.autograph = item.settingObj.wordbook.autograph;
1115
+ }
1116
+ this.curWordbookData = item.settingObj.wordbook;
1117
+ this.curAutograph = item.settingObj.wordbook && item.settingObj.wordbook.autograph;
1118
+ this.searchItem = item;
1119
+ if (item.settingObj.showSetting && item.settingObj.showSetting.length) {
1120
+ return;
1121
+ }
1122
+ this.getWordbookData(item.settingObj.wordbook, obj).then(({ data }) => {
1123
+ this.handleWordbookData(item, data);
1124
+ });
1125
+ }
1126
+ },
1127
+ /**
1128
+ * 输入自动联想
1129
+ */
1130
+ handleSearch(value, item) {
1131
+ let params = {
1132
+ keyword: value,
1133
+ autograph: this.curAutograph
1134
+ };
1135
+ let obj = {};
1136
+ if (item.settingObj?.wordbook?.params) {
1137
+ item.settingObj.wordbook.params.forEach(item => {
1138
+ obj[item.p_name] = item.p_value;
1139
+ });
1140
+ }
1141
+ Object.assign(params, obj);
1142
+
1143
+ this.getWordbookData(this.curWordbookData, params).then(({ data }) => {
1144
+ this.handleWordbookData(this.searchItem, data);
1145
+ });
1146
+ },
1147
+ handleSelect(value, item) {
1148
+ let { wordbookData = [], wordbookValueList = [] } = item;
1149
+ if (!wordbookData.length) return;
1150
+ let matchItem = wordbookData.find(v => v.myName === value);
1151
+ let hasItem = wordbookValueList.some(v => v.myName === value);
1152
+ if (hasItem) return;
1153
+ wordbookValueList.push(matchItem);
1154
+ },
1155
+ handleDeSelect(value, item) {
1156
+ let { wordbookValueList = [] } = item;
1157
+ let matchIndex = wordbookValueList.findIndex(v => v.myName === value);
1158
+ if (matchIndex < 0) return;
1159
+ wordbookValueList.splice(matchIndex, 1);
1160
+ },
1161
+
1162
+ selectChild(value, item, isInitSet, config = {}) {
1163
+ let attr = item?.settingObj?.attr || '';
1164
+ let arr = [
1165
+ 'TODAY',
1166
+ 'THIS_WEEK',
1167
+ 'THIS_MONTH',
1168
+ 'THIS_SEASON',
1169
+ 'THIS_YEAR',
1170
+ 'NULL',
1171
+ 'NOT_NULL',
1172
+ 'TOMORROW',
1173
+ 'YESTERDAY',
1174
+ 'NEXT_WEEK',
1175
+ 'UP_WEEK',
1176
+ 'NEXT_MONTH',
1177
+ 'UP_MONTH',
1178
+ 'NEXT_SEASON',
1179
+ 'UP_SEASON',
1180
+ 'NEXT_YEAR',
1181
+ 'UP_YEAR'
1182
+ ];
1183
+ let ageList = ['BIG', 'BIGEQ', 'LESS', 'LESSEQ'];
1184
+ // 自定义输入关系的“key”
1185
+ const customTypes = ['EQ', 'IN', 'NEQ'];
1186
+ const numbercustoms = ['EQ', 'NEQ', 'BIG', 'LESS', 'BIGEQ', 'LESSEQ'];
1187
+
1188
+ item.showRangeAge = false; // 年龄范围
1189
+ item.showAgeCom = false; // 年龄范围
1190
+ let inRelation = ['QUOTE_IN', 'QUOTE_NOTIN'];
1191
+ if (arr.includes(value)) {
1192
+ item.showInput = false;
1193
+ item.showSelect = false;
1194
+ item.showDate = false;
1195
+ item.showSearch = false;
1196
+ item.showRelation = false;
1197
+ this.initBirthdayParams(item);
1198
+ } else if (['IN_THE_PAST', 'IN_THE_FUTURE', 'N_', 'L_', 'IN_THE_PAST_DI', 'IN_THE_FUTURE_DI'].includes(value)) {
1199
+ // 以前、以后、过去内、未来内
1200
+ // L_ N_ IN_THE_PAST IN_THE_FUTURE 添加小时
1201
+ // 过去第 未来第
1202
+ // IN_THE_PAST_DI IN_THE_FUTURE_DI
1203
+ item.showSelect = true;
1204
+ item.showInput = true;
1205
+ item.showDate = false;
1206
+ item.showSearch = false;
1207
+ item.showRelation = false;
1208
+ if (value == 'IN_THE_PAST_DI' || value == 'IN_THE_FUTURE_DI') {
1209
+ this.$set(item, 'dateList', this.dateList);
1210
+ } else {
1211
+ let dateList = this.dateList.concat(this.dateTimeList);
1212
+ this.$set(item, 'dateList', dateList);
1213
+ }
1214
+ if (!isInitSet) {
1215
+ this.$set(item, 'unit', 'DAY');
1216
+ }
1217
+ this.initBirthdayParams(item);
1218
+ } else if (value == 'IN') {
1219
+ // field_key: "birthday"
1220
+ if (attr == 'BIRTHDAY') {
1221
+ item.showBirthdayDate = true;
1222
+ item.showDate = false;
1223
+ item.units = this.birthdayUnits.filter(i => i.units === 1);
1224
+ } else if (attr == 'AGE') {
1225
+ item.showRangeAge = true;
1226
+ } else {
1227
+ item.showDate = true;
1228
+ this.initBirthdayParams(item);
1229
+ }
1230
+ item.showSelect = false;
1231
+ item.showInput = false;
1232
+ item.showSearch = false;
1233
+ item.showRelation = false;
1234
+ } else if (value == 'CONVERT' || value == 'QUOTE' || value == 'QUOTE_NOT') {
1235
+ item.showDate = false;
1236
+ item.showSelect = false;
1237
+ item.showInput = false;
1238
+ item.showSearch = true;
1239
+ item.showRelation = false;
1240
+ this.initBirthdayParams(item);
1241
+ let showSetting = false;
1242
+ if (item.settingObj?.showSetting?.length) {
1243
+ showSetting = true;
1244
+ }
1245
+ // 这里wordbookValueList替换wordbookData 还是有点问题 需要根据具体场景再修改
1246
+ if (!showSetting && item.wordbookValueList?.length) {
1247
+ this.$set(item, 'wordbookData', item.wordbookValueList);
1248
+ }
1249
+ } else if (inRelation.includes(value)) {
1250
+ // 跨表查询
1251
+ item.showRelation = true;
1252
+ item.showInput = false;
1253
+ item.showSelect = false;
1254
+ item.showDate = false;
1255
+ item.showSearch = false;
1256
+ this.initBirthdayParams(item);
1257
+ } else if (attr == 'AGE') {
1258
+ if (ageList.includes(value)) {
1259
+ item.showAgeCom = true;
1260
+ }
1261
+ } else {
1262
+ item.showSelect = false;
1263
+ item.showDate = false;
1264
+ if (item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
1265
+ item.showInput = false;
1266
+ } else {
1267
+ item.showInput = true;
1268
+ }
1269
+ item.showSearch = false;
1270
+ item.showRelation = false;
1271
+ this.initBirthdayParams(item);
1272
+ }
1273
+
1274
+ if (!this.showCompareField) return;
1275
+
1276
+ let s_type = config?.type;
1277
+ if (s_type === '_custom__input_') return;
1278
+
1279
+ if (customTypes.includes(value) || (['NUMBER', 'DATE', 'DATETIME', 'TIME'].includes(item.fieldType) && numbercustoms.includes(value))) {
1280
+ this.$set(item, 'is_compare_field', true);
1281
+ this.$set(item, 'customInput', false);
1282
+ this.handleSetSelectList(item);
1283
+ if (Array.isArray(item.selectList)) {
1284
+ // 默认选中第一
1285
+ if (item.selectList.length > 1) {
1286
+ let [a] = item.selectList;
1287
+ let compare_val = isInitSet? item.compare_field || a.value : a.value;
1288
+ this.$set(item, 'compare_field', compare_val);
1289
+ setTimeout(() => {
1290
+ // 里面递归调用 selectChild ,异步等待,第一个方法执行完成
1291
+ this.compare_fieldOnChange(compare_val, item);
1292
+ }, 100);
1293
+ } else {
1294
+ let selectList = item?.selectList || [];
1295
+ let len = selectList?.length || 0;
1296
+ let onlyCustomInput = len === 1 ? selectList[0].value === '_custom__input_' : false;
1297
+ // selectList 只有一个选项并且 是 _custom__input_ ,隐藏 select ,展示 customInput
1298
+ if (onlyCustomInput) {
1299
+ this.$set(item, 'customInput', true);
1300
+ item.compare_field = '_custom__input_';
1301
+ return;
1302
+ }
1303
+ }
1304
+ }
1305
+
1306
+ if (isInitSet) {
1307
+ // 如果是 is_compare_field 字段 并有值compare_field
1308
+ if (config.is_compare_field && item.compare_field) {
1309
+ this.$set(item, 'is_compare_field', true);
1310
+ } else if (item.start_val || item.end_val || item.value || item.wordValue || item.showSelect) {
1311
+ // 自定义输入回填
1312
+ this.$set(item, 'customInput', true);
1313
+ item.compare_field = '_custom__input_';
1314
+ return;
1315
+ }
1316
+ }
1317
+ this.handleHideItem(item, false);
1318
+ } else {
1319
+ item.customInput = true;
1320
+ item.is_compare_field = false;
1321
+ item['compare_field'] && (item['compare_field'] = undefined);
1322
+ }
1323
+ },
1324
+ handleHideItem(item, reset = true) {
1325
+ item.showRangeAge = false; // 年龄范围
1326
+ item.showAgeCom = false; // 年龄范围
1327
+ item.showInput = false;
1328
+ item.showSelect = false;
1329
+ item.showDate = false;
1330
+ item.showSearch = false;
1331
+ item.showRelation = false;
1332
+
1333
+ // item.value = "";
1334
+ // this.$set(item, 'value', '');
1335
+ reset && this.$set(item, 'value', '');
1336
+ },
1337
+ disabledDatePicker(current, item, t){
1338
+ if(item.isIllegalField) return true
1339
+ let f = false;
1340
+ if(t=== 'start'){
1341
+ const end_val = item?.end_val;
1342
+ f = end_val && current.valueOf() > end_val.valueOf();
1343
+ } else if(t=== 'end') {
1344
+ const start_val = item?.start_val;
1345
+ f = start_val && current.valueOf() <= start_val.valueOf();
1346
+ }
1347
+ /**
1348
+ * 2 过去时间
1349
+ * 3 未来时间
1350
+ */
1351
+ let type = String(item?.advanceOptionSetting);
1352
+ if(!['2','3'].includes(type)) return f;
1353
+ if(type === '2'){
1354
+ return current >= moment().endOf('day') || f;
1355
+ } else if(type==='3'){
1356
+ return current && current < moment().startOf('day') || f;
1357
+ }
1358
+ return f
1359
+ },
1360
+ disabledStartDate(start_val) {
1361
+ const end_val = this.end_val;
1362
+ if (!start_val || !end_val) {
1363
+ return false;
1364
+ }
1365
+ return start_val.valueOf() > end_val.valueOf();
1366
+ },
1367
+ disabledEndDate(end_val) {
1368
+ const start_val = this.start_val;
1369
+ if (!end_val || !start_val) {
1370
+ return false;
1371
+ }
1372
+ return start_val.valueOf() >= end_val.valueOf();
1373
+ },
1374
+ handleStartOpenChange(open, item) {
1375
+ if (!open) {
1376
+ this.$set(item, 'endOpen', true);
1377
+ }
1378
+ },
1379
+ handleEndOpenChange(open, item) {
1380
+ this.$set(item, 'endOpen', open);
1381
+ },
1382
+ // 日期选择范围
1383
+ disabledDate(current) {
1384
+ return (current && current < moment().startOf('year')) || current > moment().endOf('year');
1385
+ },
1386
+ changeRange(value, item) {
1387
+ let res = [];
1388
+ if (value.length > 0) {
1389
+ value.forEach(item => {
1390
+ item._d && res.push(utils.formatTime('MOUTH', item._d));
1391
+ });
1392
+ }
1393
+ if (res.length > 0) {
1394
+ item.curlimit_date = res.join('~');
1395
+ }
1396
+ },
1397
+ // 选择关联表
1398
+ handlerSelectRelation(e, item) {
1399
+ let curItem = this.relationTableList.find(v => v.tableId === e);
1400
+ curItem && (item.relationField = curItem.relationField);
1401
+ item.relationFieldList = JSON.parse(JSON.stringify(curItem?.fieldList?.fieldList || []));
1402
+ item.converFun = curItem.converFun || undefined;
1403
+ item.parameterConversionId = curItem.parameterConversionId || undefined;
1404
+ item.relationOrgId = curItem.relationOrgId || undefined;
1405
+ item.preConObj = curItem.preConObj || undefined;
1406
+ item.preSqlExpression = curItem.preSqlExpression || undefined;
1407
+ },
1408
+ openRelationFilter(data, i) {
1409
+ this.clcikRelationIndex = i;
1410
+ this.relationAction = data.quote_con;
1411
+ this.relationSearchFieldList = data.relationFieldList;
1412
+ this.relationVisible = true;
1413
+ // sqlExpression
1414
+ },
1415
+ relationCancel() {
1416
+ this.relationVisible = false;
1417
+ this.relationAction = {};
1418
+ this.relationSearchFieldList = [];
1419
+ },
1420
+ relationSave(data) {
1421
+ let { setting = '' } = data;
1422
+ let settingObj = JSON.parse(setting);
1423
+ this.actionList[this.clcikRelationIndex].quote_con = {
1424
+ conObj: settingObj.conObj,
1425
+ sqlExpression: settingObj.sqlExpression
1426
+ };
1427
+ this.relationCancel();
1428
+ },
1429
+ initBirthdayParams(item) {
1430
+ item.showBirthdayDate = false;
1431
+ item.unit = item.unit || 'YEAR';
1432
+ item.units = this.birthdayUnits.filter(i => i.units === 1);
1433
+ },
1434
+ handleParentNamesAdd(e) {
1435
+ const nextInput = e?.target?.nextElementSibling;
1436
+ setTimeout(() => {
1437
+ nextInput && nextInput.focus();
1438
+ });
1439
+ this.showAdd = true;
1440
+ },
1441
+ hanldeBlur() {
1442
+ this.showAdd = false;
1443
+ if (!this.addVal) return;
1444
+ this.parentNames.forEach(v => (v.selected = false));
1445
+ this.parentNames.push({
1446
+ disabled: true,
1447
+ value: this.addVal,
1448
+ selected: true,
1449
+ isAdd: true
1450
+ });
1451
+ this.addVal = '';
1452
+ },
1453
+ editParentName(e, item) {
1454
+ item.disabled = false;
1455
+ setTimeout(() => {
1456
+ e.target.focus();
1457
+ }, 0);
1458
+ },
1459
+ handleParentNameSelect(item, index) {
1460
+ if (!item.disabled) return;
1461
+ this.parentNames.forEach((pItem, pIndex) => {
1462
+ if (pIndex !== index) {
1463
+ pItem.selected = false;
1464
+ }
1465
+ });
1466
+ item.selected = !item.selected;
1467
+ },
1468
+ handleParentNamesRemove(index, item) {
1469
+ // this.parentNames.splice(index, 1);
1470
+ this.handleParent(index, item);
1471
+ },
1472
+ handleParent(index, item) {
1473
+ let { conditionList } = this;
1474
+ if (!conditionList || !conditionList.length) {
1475
+ this.parentNames.splice(index, 1);
1476
+ return;
1477
+ }
1478
+ let hasItem = conditionList.filter(v => v.displayCategory === item.value);
1479
+ if (!hasItem || !hasItem.length) {
1480
+ this.parentNames.splice(index, 1);
1481
+ return;
1482
+ }
1483
+ this.$message.error('该分类下有已有数据,请删除该分类下的筛选集后重试!');
1484
+ },
1485
+ getParentSelectedStyle(item) {
1486
+ if (item.selected && item.disabled) {
1487
+ return {
1488
+ backgroundColor: '#2D7AFF',
1489
+ color: '#fff'
1490
+ };
1491
+ }
1492
+ return null;
1493
+ },
1494
+
1495
+ // 年龄组件变化
1496
+ ageRangeOnChange(obj, item) {
1497
+ let s = obj.star_val;
1498
+ let e = obj.end_val;
1499
+ this.$set(item, 'start_val', isNaN(s) ? undefined : s);
1500
+ this.$set(item, 'end_val', isNaN(e) ? undefined : e);
1501
+ },
1502
+
1503
+ agecomOnChange(obj, item) {
1504
+ this.$set(item, 'value', isNaN(obj.days) ? undefined : obj.days);
1505
+ },
1506
+
1507
+ diffTime(days) {
1508
+ let d = +days;
1509
+ if (isNaN(d)) return {};
1510
+ if (typeof d == 'number') {
1511
+ let next = 0;
1512
+ let year = Math.floor(d / 365);
1513
+ next = d % 365;
1514
+ let month = Math.floor(next / 30);
1515
+ next = next % 30;
1516
+ let day = next;
1517
+
1518
+ return { year, month, day, d };
1519
+ }
1520
+ return {};
1521
+ },
1522
+
1523
+ filterOption(...arg) {
1524
+ return utils.filterOption(...arg);
1525
+ },
1526
+
1527
+ /**
1528
+ * 选中字段
1529
+ */
1530
+ handleSetSelectList(item) {
1531
+ let list = this.searchList
1532
+ .filter(v => v.fieldType == item.fieldType && (this.isBI ? v.fieldId : v.columnName) != item.field_key)
1533
+ .map(v => {
1534
+ return {
1535
+ value: this.isBI ? v.fieldId : v.columnName,
1536
+ name: v.alias || v.title
1537
+ };
1538
+ });
1539
+
1540
+ list.unshift({
1541
+ value: '_custom__input_',
1542
+ name: '自定义输入'
1543
+ });
1544
+
1545
+ this.$set(item, 'selectList', list);
1546
+ },
1547
+
1548
+ /**
1549
+ * 切换字段选项
1550
+ */
1551
+ compare_fieldOnChange(e, item) {
1552
+ if (e === '_custom__input_') {
1553
+ item.customInput = true;
1554
+ this.selectChild(item.con, item, false, { type: '_custom__input_' });
1555
+ } else {
1556
+ item.customInput = false;
1557
+ this.$set(item, 'value', '');
1558
+ }
1559
+ },
1560
+
1561
+ checkCustomInput(item) {
1562
+ /**
1563
+ * 判断可选的 是否 只有 “_custom__input_”
1564
+ */
1565
+ let selectList = item?.selectList || [];
1566
+ let len = selectList?.length || 0;
1567
+ let onlyCustomInput = len === 1 ? selectList[0].value === '_custom__input_' : false;
1568
+ return onlyCustomInput;
1569
+ },
1570
+
1571
+ visibleCompareField(item) {
1572
+ if (!this.showCompareField) return false;
1573
+ let onlyCustomInput = this.checkCustomInput(item);
1574
+ /**
1575
+ * 展示 compare_field 条件
1576
+ * 1. 是is_compare_field 字段 并且有字段可选
1577
+ */
1578
+ return item.is_compare_field && !onlyCustomInput;
1579
+ },
1580
+
1581
+ visibleDefaultField(item) {
1582
+ /**
1583
+ * 展示默认字段的条件
1584
+ * 1. 非 is_compare_field 字段
1585
+ * 2. 是 is_compare_field 字段,选中 自定义输入 is_compare_field
1586
+ * 3. 是 is_compare_field 字段 ,没有可选的 onlyCustomInput
1587
+ */
1588
+ if (!this.showCompareField) return true;
1589
+ let onlyCustomInput = this.checkCustomInput(item);
1590
+ return item.customInput || !item.is_compare_field || onlyCustomInput;
1591
+ },
1592
+
1593
+ handleHideCompareField(item) {
1594
+ if (!this.showCompareField) return;
1595
+ item.customInput = false;
1596
+ item.is_compare_field = false;
1597
+ item.compare_field = undefined;
1598
+ },
1599
+
1600
+ checkActionList() {
1601
+ let f = this.actionList.every(v => !v.field_key);
1602
+ return f;
1603
+ },
1604
+
1605
+ /**
1606
+ * select 变化
1607
+ */
1608
+ fieldselectONchange(item, eventName, value, vnode) {
1609
+ // 清空操作
1610
+ if (value === undefined) {
1611
+ eventName === 'changeColumnName' && this.handleResetColumnName(item);
1612
+ eventName === 'selectChild' && this.handleResetSelectChild(item);
1613
+ }
1614
+
1615
+ // 有改变去掉“兼容”的值
1616
+ item.is_compatibility = undefined;
1617
+ item.compatibility_con = undefined;
1618
+ },
1619
+
1620
+ handleResetColumnName(item) {
1621
+ item.con = undefined;
1622
+ this.$set(item, 'wordValue', []);
1623
+ this.$set(item, 'wordbookData', []);
1624
+ this.handleHideItem(item);
1625
+ },
1626
+
1627
+ handleResetSelectChild(item) {
1628
+ this.$set(item, 'wordValue', []);
1629
+ // this.$set(item, 'wordbookData', []);
1630
+ this.$set(item, 'value', undefined);
1631
+ this.$set(item, 'showSelect', undefined);
1632
+ this.$set(item, 'start_val', null);
1633
+ this.$set(item, 'end_val', null);
1634
+ this.handleHideItem(item);
1635
+ },
1636
+
1637
+ checkItem(item){
1638
+ /**
1639
+ * 这是兼容处理
1640
+ * 场景:admin 配置的映射数据,配置了“自定义输入”,期望能正常展示。
1641
+ */
1642
+ if(['copy','edit'].includes(this.fromType)){
1643
+ let f = item.is_compare_field && this.showCompareField && item.compare_field === '_custom__input_';
1644
+ // 复制模式,回填是“自定义输入”,但不支持“自定义输入”的类型
1645
+ let isArr = Array.isArray(item.searchChildList);
1646
+ if(f && isArr){
1647
+ let con = item.searchChildList.find(v=> v.name == item.con);
1648
+ // 该字段关系没有该类型
1649
+ if(!con){
1650
+ // 缓存 con 值
1651
+ item.compatibility_con = item.con;
1652
+ // 从默认关系中查找“关系”
1653
+ let defCon = this.searchChildList.find(v=> v.name === item.con);
1654
+ item.con = defCon?.desc || item.compatibility_con;
1655
+ // 兼容模式标识
1656
+ this.$set(item, 'is_compatibility', true)
1657
+ }
1658
+ }
1659
+ }
1660
+ }
1661
+ }
1662
+ });
1663
+ </script>
1664
+
1665
+ <style lang="less" scoped>
1666
+ .inner-content {
1667
+ color: #000;
1668
+ & > p > span {
1669
+ cursor: pointer;
1670
+ }
1671
+ .item-name {
1672
+ display: flex;
1673
+ height: 32px;
1674
+ line-height: 32px;
1675
+ margin-bottom: 10px;
1676
+ .label {
1677
+ width: 120px;
1678
+ text-align: right;
1679
+ }
1680
+ }
1681
+ .parent-names {
1682
+ display: flex;
1683
+ align-items: center;
1684
+ flex-wrap: wrap;
1685
+ line-height: 32px;
1686
+ .label {
1687
+ display: inline-block;
1688
+ height: 32px;
1689
+ line-height: 32px;
1690
+ margin-bottom: 10px;
1691
+ width: 120px;
1692
+ text-align: right;
1693
+ }
1694
+ /deep/ .ant-btn-dashed {
1695
+ border-color: #a6a6a6;
1696
+ color: #a6a6a6;
1697
+ }
1698
+
1699
+ .edit-tag {
1700
+ position: relative;
1701
+ margin-right: 10px;
1702
+ margin-bottom: 10px;
1703
+ /deep/ .anticon-close {
1704
+ position: absolute;
1705
+ right: 5px;
1706
+ line-height: 36px;
1707
+ color: #2d7aff;
1708
+ }
1709
+ /deep/ .ant-input-disabled {
1710
+ color: #2d7aff;
1711
+ background-color: rgba(45, 122, 255, 0.1);
1712
+ opacity: 1;
1713
+ border-color: #2d7aff;
1714
+ cursor: pointer;
1715
+ }
1716
+ /deep/.ant-input-group-addon,
1717
+ /deep/.ant-input:not(:hover),
1718
+ /deep/.ant-input-number:not(:hover) {
1719
+ border-color: #2d7aff !important;
1720
+ }
1721
+ &.edit-tag-select {
1722
+ /deep/ .ant-input-disabled {
1723
+ color: #fff;
1724
+ background-color: #2d7aff;
1725
+ }
1726
+ /deep/ .anticon-close {
1727
+ color: #fff;
1728
+ }
1729
+ }
1730
+ }
1731
+ /deep/ .ant-btn {
1732
+ margin-bottom: 10px;
1733
+ }
1734
+ }
1735
+ .item-list {
1736
+ padding-top: 12px;
1737
+ margin-top: 16px;
1738
+ margin-bottom: 6px;
1739
+ border-top: 1px solid #e6e6e6;
1740
+ &.list-onlyCondition {
1741
+ padding-top: 0;
1742
+ border-top: 0px;
1743
+ }
1744
+ li {
1745
+ margin-bottom: 10px;
1746
+ }
1747
+ .form-item {
1748
+ width: 120px;
1749
+ margin-right: 10px;
1750
+ }
1751
+ .form-action {
1752
+ font-size: 16px;
1753
+ float: right;
1754
+ margin-top: 6px;
1755
+ cursor: pointer;
1756
+ }
1757
+ .date-item {
1758
+ display: inline-block;
1759
+ }
1760
+ .birthday-item {
1761
+ > div {
1762
+ display: inline-block;
1763
+ margin-top: 5px;
1764
+ p {
1765
+ display: inline-block;
1766
+ margin: 0 10px 0 15px;
1767
+ }
1768
+ > span {
1769
+ margin-top: 5px;
1770
+ }
1771
+ }
1772
+ .age-wrap {
1773
+ display: inline-block;
1774
+ }
1775
+ }
1776
+ .relation-item {
1777
+ display: inline-block;
1778
+ .relation-width {
1779
+ width: 150px;
1780
+ margin-right: 10px;
1781
+ }
1782
+ .relation-btn {
1783
+ cursor: pointer;
1784
+ }
1785
+ }
1786
+ .range-container {
1787
+ display: inline-block;
1788
+ width: 442px;
1789
+ /* line-height: 1.5; */
1790
+ vertical-align: bottom;
1791
+ }
1792
+ .item-error {
1793
+ color: red;
1794
+ display: inline-block;
1795
+ }
1796
+ }
1797
+ .index-span {
1798
+ width: 30px;
1799
+ display: inline-block;
1800
+ }
1801
+ }
1802
+ .blue {
1803
+ color: #2d7aff;
1804
+ margin-right: 8px;
1805
+ }
1806
+ .red {
1807
+ color: #e02020;
1808
+ }
1809
+
1810
+ .in-block {
1811
+ display: inline-block;
1812
+ }
1813
+ </style>
1814
+
1815
+ <style lang="less">
1816
+ // 专业模式下的样式修改
1817
+ ._c_com-search-professional {
1818
+ .inner-content {
1819
+ .item-list {
1820
+ > li {
1821
+ position: relative;
1822
+ .def_item_input {
1823
+ position: absolute;
1824
+ width: 100%;
1825
+ }
1826
+ .show-small-select {
1827
+ .val-small-select-wrap {
1828
+ width: 66px !important;
1829
+ }
1830
+ .val-input-wrap {
1831
+ width: 34% !important;
1832
+ }
1833
+ }
1834
+ }
1835
+ }
1836
+
1837
+ .item-error {
1838
+ display: block;
1839
+ padding-left: 29px;
1840
+ }
1841
+ .form-action {
1842
+ position: absolute;
1843
+ right: 0px;
1844
+ top: 0;
1845
+ }
1846
+ }
1847
+
1848
+ .select-front-item {
1849
+ width: 23% !important;
1850
+ }
1851
+ .val-input-wrap {
1852
+ width: 42%;
1853
+ display: inline-block;
1854
+ .ant-input {
1855
+ width: 100% !important;
1856
+ }
1857
+ }
1858
+ .val-select-wrap,
1859
+ .val-age-wrap,
1860
+ .val-date-wrap {
1861
+ width: 42% !important;
1862
+
1863
+ .ant-calendar-picker {
1864
+ width: 50% !important;
1865
+ }
1866
+ }
1867
+
1868
+ .val-range-wrap {
1869
+ width: 42% !important;
1870
+ .ant-input-group {
1871
+ .age-com {
1872
+ // 年龄组件 单位
1873
+ .age-com-suffix {
1874
+ padding: 0 1px;
1875
+ }
1876
+ .ant-input-number {
1877
+ // 修改宽度
1878
+ width: 100%;
1879
+ // 隐藏数字操作项
1880
+ .ant-input-number-handler-wrap {
1881
+ display: none;
1882
+ }
1883
+ // 修改inputpadding
1884
+ .ant-input-number-input-wrap {
1885
+ input {
1886
+ padding: 0 2px;
1887
+ }
1888
+ }
1889
+ }
1890
+ }
1891
+ }
1892
+ }
1893
+ .teavalue-wrap {
1894
+ width: calc(88% + 20px);
1895
+ }
1896
+ }
1897
+ </style>