cnhis-design-vue 2.1.78 → 2.1.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (598) hide show
  1. package/.prettierrc.js +27 -27
  2. package/CHANGELOG.md +2953 -2911
  3. package/README.md +90 -90
  4. package/commitlint.config.js +1 -1
  5. package/es/affix/index.js +8 -8
  6. package/es/age/index.js +18 -18
  7. package/es/alert/index.js +8 -8
  8. package/es/anchor/index.js +8 -8
  9. package/es/auto-complete/index.js +8 -8
  10. package/es/avatar/index.js +8 -8
  11. package/es/back-top/index.js +8 -8
  12. package/es/badge/index.js +8 -8
  13. package/es/base/index.js +8 -8
  14. package/es/big-table/index.js +358 -338
  15. package/es/big-table/style.css +1 -1
  16. package/es/breadcrumb/index.js +8 -8
  17. package/es/button/index.js +31 -31
  18. package/es/calendar/index.js +8 -8
  19. package/es/captcha/index.js +7 -7
  20. package/es/card/index.js +8 -8
  21. package/es/carousel/index.js +8 -8
  22. package/es/cascader/index.js +8 -8
  23. package/es/checkbox/index.js +17 -17
  24. package/es/col/index.js +8 -8
  25. package/es/collapse/index.js +8 -8
  26. package/es/color-picker/index.js +5 -5
  27. package/es/comment/index.js +8 -8
  28. package/es/config-provider/index.js +8 -8
  29. package/es/date-picker/index.js +30 -30
  30. package/es/descriptions/index.js +8 -8
  31. package/es/divider/index.js +8 -8
  32. package/es/drag-layout/index.js +5 -5
  33. package/es/drawer/index.js +8 -8
  34. package/es/dropdown/index.js +8 -8
  35. package/es/editor/index.js +1 -1
  36. package/es/ellipsis/index.js +1 -1
  37. package/es/empty/index.js +8 -8
  38. package/es/fabric-chart/index.js +45 -45
  39. package/es/form/index.js +8 -8
  40. package/es/form-model/index.js +8 -8
  41. package/es/form-table/index.js +144 -144
  42. package/es/grid/index.js +4 -4
  43. package/es/index/index.js +3657 -2281
  44. package/es/index/style.css +1 -1
  45. package/es/input/index.js +11 -11
  46. package/es/input-number/index.js +8 -8
  47. package/es/keep-cache/index.js +9 -9
  48. package/es/layout/index.js +8 -8
  49. package/es/list/index.js +8 -8
  50. package/es/locale-provider/index.js +8 -8
  51. package/es/map/index.js +13 -13
  52. package/es/mentions/index.js +8 -8
  53. package/es/menu/index.js +8 -8
  54. package/es/message/index.js +8 -8
  55. package/es/multi-chat/index.js +117 -117
  56. package/es/multi-chat-client/index.js +111 -111
  57. package/es/multi-chat-history/index.js +6 -6
  58. package/es/multi-chat-record/index.js +27 -27
  59. package/es/multi-chat-setting/index.js +43 -43
  60. package/es/multi-chat-sip/index.js +1 -1
  61. package/es/notification/index.js +8 -8
  62. package/es/page-header/index.js +8 -8
  63. package/es/pagination/index.js +8 -8
  64. package/es/popconfirm/index.js +8 -8
  65. package/es/popover/index.js +8 -8
  66. package/es/progress/index.js +8 -8
  67. package/es/radio/index.js +17 -17
  68. package/es/rate/index.js +8 -8
  69. package/es/result/index.js +8 -8
  70. package/es/row/index.js +8 -8
  71. package/es/scale-container/index.js +1 -1
  72. package/es/scale-view/index.js +200 -198
  73. package/es/scale-view/style.css +1 -1
  74. package/es/select/index.js +44 -44
  75. package/es/select-label/index.js +75 -73
  76. package/es/select-label/style.css +1 -1
  77. package/es/select-person/index.js +45 -41
  78. package/es/select-person/style.css +1 -1
  79. package/es/shortcut-setter/index.js +10 -10
  80. package/es/skeleton/index.js +8 -8
  81. package/es/slider/index.js +8 -8
  82. package/es/space/index.js +8 -8
  83. package/es/spin/index.js +8 -8
  84. package/es/statistic/index.js +8 -8
  85. package/es/steps/index.js +8 -8
  86. package/es/switch/index.js +8 -8
  87. package/es/table-filter/index.js +2697 -1347
  88. package/es/table-filter/style.css +1 -1
  89. package/es/tabs/index.js +8 -8
  90. package/es/tag/index.js +9 -9
  91. package/es/time-picker/index.js +8 -8
  92. package/es/timeline/index.js +8 -8
  93. package/es/tooltip/index.js +8 -8
  94. package/es/transfer/index.js +8 -8
  95. package/es/tree/index.js +8 -8
  96. package/es/tree-select/index.js +8 -8
  97. package/es/upload/index.js +8 -8
  98. package/es/utils/clickoutside.js +7 -7
  99. package/es/utils/kty.min-1.0.0.js +5 -5
  100. package/es/utils/time-domain.js +16 -16
  101. package/es/utils/utils-map.js +32 -32
  102. package/es/utils/vexutils.js +27 -27
  103. package/es/verification-code/index.js +2 -2
  104. package/lib/cui.common.js +11438 -9918
  105. package/lib/cui.umd.js +11438 -9918
  106. package/lib/cui.umd.min.js +69 -69
  107. package/package.json +110 -110
  108. package/packages/affix/index.js +12 -12
  109. package/packages/affix/src/Affix.jsx +12 -12
  110. package/packages/age/index.js +27 -27
  111. package/packages/age/src/age/index.vue +139 -139
  112. package/packages/age/src/age-com/index.vue +209 -209
  113. package/packages/alert/index.js +12 -12
  114. package/packages/alert/src/Alert.jsx +11 -11
  115. package/packages/anchor/index.js +18 -18
  116. package/packages/anchor/src/Anchor.jsx +11 -11
  117. package/packages/anchor/src/Link.jsx +11 -11
  118. package/packages/auto-complete/index.js +12 -12
  119. package/packages/auto-complete/src/AutoComplete.jsx +12 -12
  120. package/packages/avatar/index.js +12 -12
  121. package/packages/avatar/src/Avatar.jsx +11 -11
  122. package/packages/back-top/index.js +12 -12
  123. package/packages/back-top/src/BackTop.jsx +11 -11
  124. package/packages/badge/index.js +12 -12
  125. package/packages/badge/src/Badge.jsx +11 -11
  126. package/packages/base/index.js +3 -3
  127. package/packages/big-table/index.js +16 -16
  128. package/packages/big-table/src/BigTable.vue +3205 -3193
  129. package/packages/big-table/src/Fieldset.vue +2067 -2067
  130. package/packages/big-table/src/assets/iconfont/iconfont.css +21 -21
  131. package/packages/big-table/src/assets/style/table-base.less +390 -387
  132. package/packages/big-table/src/assets/style/table-global.less +175 -175
  133. package/packages/big-table/src/components/AutoLayoutButton.vue +307 -307
  134. package/packages/big-table/src/components/NoData.vue +81 -81
  135. package/packages/big-table/src/components/TextOverTooltip.vue +120 -120
  136. package/packages/big-table/src/components/edit-form/EditForm.vue +509 -509
  137. package/packages/big-table/src/components/edit-form/edit-component/config-data/index.js +68 -68
  138. package/packages/big-table/src/components/edit-form/edit-component/edit-date-picker/edit-date-picker.vue +60 -60
  139. package/packages/big-table/src/components/edit-form/edit-component/edit-digital/edit-digital.vue +54 -54
  140. package/packages/big-table/src/components/edit-form/edit-component/edit-input/edit-input.vue +39 -39
  141. package/packages/big-table/src/components/edit-form/edit-component/edit-input-password/edit-input-password.vue +79 -79
  142. package/packages/big-table/src/components/edit-form/edit-component/edit-month-picker/edit-month-picker.vue +37 -37
  143. package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue +82 -82
  144. package/packages/big-table/src/components/edit-form/edit-component/edit-search-more/edit-search-more.vue +95 -95
  145. package/packages/big-table/src/components/edit-form/edit-component/edit-select/edit-select.vue +40 -40
  146. package/packages/big-table/src/components/edit-form/edit-component/edit-select-multiple/edit-select-multiple.vue +55 -55
  147. package/packages/big-table/src/components/edit-form/edit-component/edit-switch/edit-switch.vue +43 -43
  148. package/packages/big-table/src/components/edit-form/edit-component/edit-textarea/edit-textarea.vue +41 -41
  149. package/packages/big-table/src/components/edit-form/edit-component/edit-time-picker/edit-time-picker.vue +40 -40
  150. package/packages/big-table/src/components/edit-form/edit-component/mixins/bound-date.js +3 -3
  151. package/packages/big-table/src/components/edit-form/edit-component/mixins/dateType.js +217 -217
  152. package/packages/big-table/src/components/edit-form/edit-component/mixins/item-default.js +639 -639
  153. package/packages/big-table/src/components/edit-form/edit-component/mixins/search.js +1247 -1247
  154. package/packages/big-table/src/components/edit-form/edit-component/register-com.js +26 -26
  155. package/packages/big-table/src/components/edit-form/edit-item/form-event.js +80 -80
  156. package/packages/big-table/src/components/edit-form/edit-item/global-props.js +33 -33
  157. package/packages/big-table/src/components/edit-form/edit-item/index.js +4 -4
  158. package/packages/big-table/src/components/edit-form/edit-item/render-methods.js +28 -28
  159. package/packages/big-table/src/components/edit-form/edit-item/validate-rules.js +463 -463
  160. package/packages/big-table/src/components/edit-form/edit-mixins/form-commom.js +673 -673
  161. package/packages/big-table/src/components/edit-form/edit-mixins/index.js +3 -3
  162. package/packages/big-table/src/components/edit-form/edit-utils/index.js +112 -112
  163. package/packages/big-table/src/components/password-com.vue +58 -58
  164. package/packages/big-table/src/components/player-vod/index.vue +57 -57
  165. package/packages/big-table/src/components/player-vod/player.vue +193 -193
  166. package/packages/big-table/src/components/player-vod/video-list.vue +265 -265
  167. package/packages/big-table/src/components/player-vod/video-modal.vue +126 -126
  168. package/packages/big-table/src/utils/CustomPagination.vue +86 -86
  169. package/packages/big-table/src/utils/batchEditing.js +610 -610
  170. package/packages/big-table/src/utils/bigTableProps.js +108 -108
  171. package/packages/big-table/src/utils/eventBroadcast.js +24 -24
  172. package/packages/big-table/src/utils/format.js +557 -557
  173. package/packages/big-table/src/utils/nestTable.js +109 -109
  174. package/packages/big-table/src/utils/tableParse.js +234 -234
  175. package/packages/breadcrumb/index.js +21 -21
  176. package/packages/breadcrumb/src/Breadcrumb.jsx +11 -11
  177. package/packages/breadcrumb/src/BreadcrumbItem.jsx +11 -11
  178. package/packages/breadcrumb/src/BreadcrumbSeparator.jsx +11 -11
  179. package/packages/button/index.js +21 -21
  180. package/packages/button/src/Button.jsx +11 -11
  181. package/packages/button/src/ButtonGroup.jsx +11 -11
  182. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  183. package/packages/button/src/ButtonPrint/index.vue +766 -766
  184. package/packages/button/src/ButtonPrint/mixin/his-print.js +95 -95
  185. package/packages/calendar/index.js +12 -12
  186. package/packages/calendar/src/Calendar.jsx +11 -11
  187. package/packages/captcha/index.js +9 -9
  188. package/packages/captcha/src/Captcha.vue +164 -164
  189. package/packages/captcha/src/Index.vue +47 -47
  190. package/packages/captcha/src/SlideVerify.vue +285 -285
  191. package/packages/card/index.js +21 -21
  192. package/packages/card/src/Card.jsx +12 -12
  193. package/packages/card/src/CardGrid.js +7 -7
  194. package/packages/card/src/CardMeta.js +7 -7
  195. package/packages/carousel/index.js +12 -12
  196. package/packages/carousel/src/Carousel.jsx +12 -12
  197. package/packages/cascader/index.js +12 -12
  198. package/packages/cascader/src/Cascader.jsx +11 -11
  199. package/packages/checkbox/index.js +30 -30
  200. package/packages/checkbox/src/Checkbox.jsx +11 -11
  201. package/packages/checkbox/src/CheckboxImg/index.vue +141 -141
  202. package/packages/checkbox/src/Group.jsx +11 -11
  203. package/packages/col/index.js +13 -13
  204. package/packages/col/src/Col.jsx +11 -11
  205. package/packages/collapse/index.js +18 -18
  206. package/packages/collapse/src/Collapse.jsx +11 -11
  207. package/packages/collapse/src/Panel.jsx +11 -11
  208. package/packages/color-picker/index.js +10 -10
  209. package/packages/color-picker/src/color-picker.vue +191 -191
  210. package/packages/color-picker/src/style.less +109 -109
  211. package/packages/comment/index.js +12 -12
  212. package/packages/comment/src/Comment.jsx +11 -11
  213. package/packages/config-provider/index.js +12 -12
  214. package/packages/config-provider/src/ConfigProvider.jsx +11 -11
  215. package/packages/date-picker/index.js +26 -26
  216. package/packages/date-picker/src/DatePicker.jsx +12 -12
  217. package/packages/date-picker/src/MonthPicker.jsx +11 -11
  218. package/packages/date-picker/src/RangePicker.jsx +11 -11
  219. package/packages/date-picker/src/WeekPicker.jsx +11 -11
  220. package/packages/date-picker/src/utils/index.js +374 -374
  221. package/packages/descriptions/index.js +18 -18
  222. package/packages/descriptions/src/Descriptions.jsx +11 -11
  223. package/packages/descriptions/src/Item.jsx +11 -11
  224. package/packages/divider/index.js +12 -12
  225. package/packages/divider/src/Divider.jsx +11 -11
  226. package/packages/drag-layout/DragFormLeftItem.vue +173 -173
  227. package/packages/drag-layout/DragFormRightItem.vue +284 -284
  228. package/packages/drag-layout/I18n-mixins.js +10 -10
  229. package/packages/drag-layout/drag-layout.vue +778 -778
  230. package/packages/drag-layout/index.js +12 -12
  231. package/packages/drawer/index.js +12 -12
  232. package/packages/drawer/src/Drawer.jsx +11 -11
  233. package/packages/dropdown/index.js +12 -12
  234. package/packages/dropdown/src/Dropdown.jsx +11 -11
  235. package/packages/editor/index.js +9 -9
  236. package/packages/ellipsis/index.js +8 -8
  237. package/packages/ellipsis/src/Ellipsis.vue +65 -65
  238. package/packages/empty/index.js +12 -12
  239. package/packages/empty/src/Empty.jsx +11 -11
  240. package/packages/fabric-chart/index.js +9 -9
  241. package/packages/fabric-chart/src/FabricGrid.vue +67 -67
  242. package/packages/fabric-chart/src/components/DropPopup.vue +90 -90
  243. package/packages/fabric-chart/src/components/MouseRightClick.vue +168 -168
  244. package/packages/fabric-chart/src/components/TimeScaleValue.vue +125 -125
  245. package/packages/fabric-chart/src/const/defaultVaule.js +60 -60
  246. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +617 -617
  247. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1191 -1191
  248. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +139 -139
  249. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +651 -651
  250. package/packages/fabric-chart/src/mixins/fabricCommon.js +81 -81
  251. package/packages/fabric-chart/src/mixins/fabricObject.js +193 -193
  252. package/packages/fabric-chart/src/mixins/type.js +5 -5
  253. package/packages/fabric-chart/src/utils/bus.js +2 -2
  254. package/packages/form/index.js +16 -16
  255. package/packages/form/src/Form.jsx +11 -11
  256. package/packages/form/src/Item.jsx +11 -11
  257. package/packages/form-model/index.js +14 -14
  258. package/packages/form-model/src/FormModel.jsx +11 -11
  259. package/packages/form-model/src/Item.jsx +11 -11
  260. package/packages/form-table/index.js +16 -16
  261. package/packages/form-table/src/FormTable.vue +1110 -1110
  262. package/packages/form-table/src/components/table-component/config-data/index.js +80 -80
  263. package/packages/form-table/src/components/table-component/global-props.js +22 -22
  264. package/packages/form-table/src/components/table-component/index.js +8 -8
  265. package/packages/form-table/src/components/table-component/mixins/bound-date.js +455 -455
  266. package/packages/form-table/src/components/table-component/mixins/dateType.js +217 -217
  267. package/packages/form-table/src/components/table-component/mixins/item-default.js +257 -257
  268. package/packages/form-table/src/components/table-component/mixins/search.js +1242 -1242
  269. package/packages/form-table/src/components/table-component/register-com.js +30 -30
  270. package/packages/form-table/src/components/table-component/table-age/table-age.vue +175 -175
  271. package/packages/form-table/src/components/table-component/table-date-picker/table-date-picker.vue +87 -87
  272. package/packages/form-table/src/components/table-component/table-digital/table-digital.vue +93 -93
  273. package/packages/form-table/src/components/table-component/table-input/table-input.vue +81 -81
  274. package/packages/form-table/src/components/table-component/table-input-password/table-input-password.vue +126 -126
  275. package/packages/form-table/src/components/table-component/table-month-picker/table-month-picker.vue +55 -55
  276. package/packages/form-table/src/components/table-component/table-search/table-search.vue +174 -174
  277. package/packages/form-table/src/components/table-component/table-search-more/table-search-more.vue +191 -191
  278. package/packages/form-table/src/components/table-component/table-select/table-select.vue +64 -64
  279. package/packages/form-table/src/components/table-component/table-select-multiple/table-select-multiple.vue +81 -81
  280. package/packages/form-table/src/components/table-component/table-textarea/table-textarea.vue +76 -76
  281. package/packages/form-table/src/components/table-component/table-time-picker/table-time-picker.vue +55 -55
  282. package/packages/form-table/src/components/table-component/table-tree-select/table-tree-select.vue +135 -135
  283. package/packages/form-table/src/components/table-component/text-over-tooltip/TextOverTooltip.vue +97 -97
  284. package/packages/form-table/src/components/table-item/form-event.js +81 -81
  285. package/packages/form-table/src/components/table-item/global-props.js +27 -27
  286. package/packages/form-table/src/components/table-item/index.js +4 -4
  287. package/packages/form-table/src/components/table-item/render-methods.js +28 -28
  288. package/packages/form-table/src/components/table-item/validate-rules.js +520 -520
  289. package/packages/form-table/src/components/table-mixins/form-commom.js +98 -98
  290. package/packages/form-table/src/components/table-mixins/index.js +3 -3
  291. package/packages/form-table/src/components/table-utils/index.js +112 -112
  292. package/packages/form-table/src/disabledDetail.less +46 -46
  293. package/packages/grid/index.js +10 -10
  294. package/packages/grid/src/grid.js +28 -28
  295. package/packages/icon/index.js +10 -10
  296. package/packages/icon/src/icon.js +13 -13
  297. package/packages/index.js +313 -313
  298. package/packages/input/index.js +30 -30
  299. package/packages/input/src/Group.jsx +11 -11
  300. package/packages/input/src/Input.jsx +11 -11
  301. package/packages/input/src/Password.jsx +11 -11
  302. package/packages/input/src/Search.jsx +11 -11
  303. package/packages/input/src/TextArea.jsx +11 -11
  304. package/packages/input/src/input-quick/components/quick-item.vue +284 -284
  305. package/packages/input/src/input-quick/components/quick-popover.vue +596 -596
  306. package/packages/input/src/input-quick/index.vue +137 -137
  307. package/packages/input-number/index.js +12 -12
  308. package/packages/input-number/src/InputNumber.jsx +11 -11
  309. package/packages/keep-cache/KeepCache.js +236 -236
  310. package/packages/keep-cache/index.css +2 -2
  311. package/packages/keep-cache/index.js +8 -8
  312. package/packages/layout/index.js +27 -27
  313. package/packages/layout/src/Content.jsx +11 -11
  314. package/packages/layout/src/Footer.jsx +11 -11
  315. package/packages/layout/src/Header.jsx +11 -11
  316. package/packages/layout/src/Layout.jsx +11 -11
  317. package/packages/layout/src/Sider.jsx +11 -11
  318. package/packages/list/index.js +21 -21
  319. package/packages/list/src/Item.jsx +11 -11
  320. package/packages/list/src/ItemMeta.jsx +11 -11
  321. package/packages/list/src/List.jsx +11 -11
  322. package/packages/locale-provider/index.js +12 -12
  323. package/packages/locale-provider/src/LocaleProvider.jsx +11 -11
  324. package/packages/map/index.js +9 -9
  325. package/packages/map/src/Map.vue +484 -484
  326. package/packages/map/src/popup-map.vue +53 -53
  327. package/packages/mentions/index.js +18 -18
  328. package/packages/mentions/src/Mentions.jsx +11 -11
  329. package/packages/mentions/src/Option.jsx +11 -11
  330. package/packages/menu/index.js +27 -27
  331. package/packages/menu/src/Divider.jsx +11 -11
  332. package/packages/menu/src/Item.jsx +11 -11
  333. package/packages/menu/src/ItemGroup.jsx +11 -11
  334. package/packages/menu/src/Menu.jsx +11 -11
  335. package/packages/menu/src/SubMenu.jsx +11 -11
  336. package/packages/message/index.js +8 -8
  337. package/packages/modal/index.js +10 -10
  338. package/packages/modal/src/Modal.js +7 -7
  339. package/packages/multi-chat/chat/addConference.vue +200 -200
  340. package/packages/multi-chat/chat/addMembers.vue +411 -411
  341. package/packages/multi-chat/chat/advancedFilter.vue +372 -372
  342. package/packages/multi-chat/chat/calling.vue +246 -246
  343. package/packages/multi-chat/chat/chatFooter.vue +1647 -1647
  344. package/packages/multi-chat/chat/chatHistory.vue +605 -605
  345. package/packages/multi-chat/chat/chatMain.vue +1490 -1490
  346. package/packages/multi-chat/chat/client/index.vue +149 -149
  347. package/packages/multi-chat/chat/delay.vue +177 -177
  348. package/packages/multi-chat/chat/evaluate.vue +343 -343
  349. package/packages/multi-chat/chat/messageRecord.vue +324 -324
  350. package/packages/multi-chat/chat/mixins/NoData.js +20 -20
  351. package/packages/multi-chat/chat/mixins/base.js +97 -97
  352. package/packages/multi-chat/chat/mixins/uniRTCAPI.js +80 -80
  353. package/packages/multi-chat/chat/mixins/viewerOptions.js +67 -67
  354. package/packages/multi-chat/chat/quickReply.vue +439 -439
  355. package/packages/multi-chat/chat/robot/index.vue +312 -312
  356. package/packages/multi-chat/chat/scrollList.vue +1259 -1259
  357. package/packages/multi-chat/chat/videoVoiceList.vue +348 -348
  358. package/packages/multi-chat/chat/voice.vue +431 -431
  359. package/packages/multi-chat/components/avatar.vue +113 -113
  360. package/packages/multi-chat/components/chat-tabs-header.vue +251 -251
  361. package/packages/multi-chat/components/classify-tabs.vue +185 -185
  362. package/packages/multi-chat/components/empty.vue +24 -24
  363. package/packages/multi-chat/components/modal-refuse-reason.vue +112 -112
  364. package/packages/multi-chat/components/modal-sip.vue +160 -160
  365. package/packages/multi-chat/components/modal-user-transfer.vue +98 -98
  366. package/packages/multi-chat/components/msg-describe.vue +138 -138
  367. package/packages/multi-chat/components/msg-picture.vue +68 -68
  368. package/packages/multi-chat/components/msg-prescription.vue +205 -205
  369. package/packages/multi-chat/components/read-record.vue +133 -133
  370. package/packages/multi-chat/components/read-status.vue +34 -34
  371. package/packages/multi-chat/components/user-status.vue +198 -198
  372. package/packages/multi-chat/components/vuecmf-dialog.vue +322 -322
  373. package/packages/multi-chat/index.js +7 -7
  374. package/packages/multi-chat/setting/authority/index.vue +156 -156
  375. package/packages/multi-chat/setting/authority/roleSetting.vue +204 -204
  376. package/packages/multi-chat/setting/baseInfo/index.vue +1343 -1343
  377. package/packages/multi-chat/setting/customerService/batchSelect.vue +403 -403
  378. package/packages/multi-chat/setting/customerService/index.vue +273 -273
  379. package/packages/multi-chat/setting/event/edit/condition.vue +128 -128
  380. package/packages/multi-chat/setting/event/edit/index.vue +437 -437
  381. package/packages/multi-chat/setting/event/edit/notice.vue +129 -129
  382. package/packages/multi-chat/setting/event/edit/strategy.vue +98 -98
  383. package/packages/multi-chat/setting/event/index.vue +249 -249
  384. package/packages/multi-chat/setting/index.vue +269 -269
  385. package/packages/multi-chat/setting/page.vue +14 -14
  386. package/packages/multi-chat/setting/sessionList/index.vue +412 -412
  387. package/packages/multi-chat/setting/sessionList/messageRecord.vue +372 -372
  388. package/packages/multi-chat/setting/userConfig/index.vue +124 -124
  389. package/packages/multi-chat/setting/worktime/index.vue +274 -274
  390. package/packages/multi-chat/store/actions.js +452 -452
  391. package/packages/multi-chat/store/getters.js +380 -380
  392. package/packages/multi-chat/store/helper.js +66 -66
  393. package/packages/multi-chat/store/index.js +50 -50
  394. package/packages/multi-chat/store/mutation.js +305 -305
  395. package/packages/multi-chat/store/state.js +120 -120
  396. package/packages/multi-chat/style/emoji.css +315 -315
  397. package/packages/multi-chat/style/message.mixin.less +38 -38
  398. package/packages/multi-chat/utils/chatSock.js +93 -93
  399. package/packages/multi-chat/utils/compressImage.js +115 -115
  400. package/packages/multi-chat/utils/emoji.json +68 -68
  401. package/packages/multi-chat/utils/index.js +259 -259
  402. package/packages/multi-chat/utils/observer-scroll.js +49 -49
  403. package/packages/multi-chat/utils/panelsetting.js +48 -48
  404. package/packages/multi-chat-client/index.js +7 -7
  405. package/packages/multi-chat-history/index.js +7 -7
  406. package/packages/multi-chat-record/index.js +7 -7
  407. package/packages/multi-chat-setting/index.js +7 -7
  408. package/packages/multi-chat-sip/index.js +6 -6
  409. package/packages/notification/index.js +8 -8
  410. package/packages/page-header/index.js +12 -12
  411. package/packages/page-header/src/PageHeader.jsx +11 -11
  412. package/packages/pagination/index.js +12 -12
  413. package/packages/pagination/src/Pagination.jsx +11 -11
  414. package/packages/popconfirm/index.js +12 -12
  415. package/packages/popconfirm/src/Popconfirm.jsx +11 -11
  416. package/packages/popover/index.js +12 -12
  417. package/packages/popover/src/Popover.jsx +11 -11
  418. package/packages/progress/index.js +12 -12
  419. package/packages/progress/src/Progress.jsx +11 -11
  420. package/packages/radio/index.js +33 -33
  421. package/packages/radio/src/Group.jsx +11 -11
  422. package/packages/radio/src/Radio.jsx +11 -11
  423. package/packages/radio/src/RadioButton.jsx +11 -11
  424. package/packages/radio/src/RadioImg/index.vue +124 -124
  425. package/packages/rate/index.js +12 -12
  426. package/packages/rate/src/Rate.jsx +11 -11
  427. package/packages/result/index.js +12 -12
  428. package/packages/result/src/Result.jsx +11 -11
  429. package/packages/row/index.js +12 -12
  430. package/packages/row/src/Row.jsx +11 -11
  431. package/packages/scale-container/index.js +8 -8
  432. package/packages/scale-container/src/ScaleContainer.vue +197 -197
  433. package/packages/scale-view/NoData.vue +81 -81
  434. package/packages/scale-view/answerParse.vue +133 -133
  435. package/packages/scale-view/customList.vue +801 -801
  436. package/packages/scale-view/data.js +80 -80
  437. package/packages/scale-view/evaluateCountdown.vue +155 -155
  438. package/packages/scale-view/evaluatePage.vue +202 -202
  439. package/packages/scale-view/formitem/data.js +3991 -3991
  440. package/packages/scale-view/formitem/index.js +7 -7
  441. package/packages/scale-view/formitem/r-address.vue +245 -245
  442. package/packages/scale-view/formitem/r-choice.vue +746 -746
  443. package/packages/scale-view/formitem/r-input.vue +93 -93
  444. package/packages/scale-view/formitem/r-prompt.vue +52 -52
  445. package/packages/scale-view/formitem/r-sign.vue +218 -218
  446. package/packages/scale-view/formitem/r-time.vue +285 -285
  447. package/packages/scale-view/formitem/r-upload-custom-list.vue +242 -242
  448. package/packages/scale-view/formitem/r-upload.vue +287 -287
  449. package/packages/scale-view/formitem/sign-com.vue +316 -316
  450. package/packages/scale-view/formitem/text-over-tooltip/TextOverTooltip.vue +98 -98
  451. package/packages/scale-view/index.js +17 -17
  452. package/packages/scale-view/mixin/NoData.js +38 -38
  453. package/packages/scale-view/mixin/addressVal.js +156 -156
  454. package/packages/scale-view/mixin/evaluate.js +146 -146
  455. package/packages/scale-view/mixin/index.js +337 -337
  456. package/packages/scale-view/mixin/judgeTypes.js +267 -267
  457. package/packages/scale-view/scaleView.vue +2017 -2017
  458. package/packages/select/index.js +27 -27
  459. package/packages/select/src/CustomSelect/index.vue +130 -130
  460. package/packages/select/src/OptGroup.jsx +11 -11
  461. package/packages/select/src/Option.jsx +11 -11
  462. package/packages/select/src/Select/Select.vue +231 -231
  463. package/packages/select/src/Select/index.js +12 -12
  464. package/packages/select/src/TableSelect/index.vue +514 -514
  465. package/packages/select-label/index.js +14 -14
  466. package/packages/select-label/label-classify.vue +129 -129
  467. package/packages/select-label/labelFormContent.vue +787 -787
  468. package/packages/select-label/select-label.vue +597 -581
  469. package/packages/select-person/index.js +10 -10
  470. package/packages/select-person/search-tree.vue +373 -373
  471. package/packages/select-person/select-person.vue +1703 -1696
  472. package/packages/shortcut-setter/index.js +12 -12
  473. package/packages/shortcut-setter/src/ShortcutSetter.vue +55 -55
  474. package/packages/shortcut-setter/src/ShortcutSetterItem.vue +85 -85
  475. package/packages/shortcut-setter/src/utils/index.js +63 -63
  476. package/packages/skeleton/index.js +12 -12
  477. package/packages/skeleton/src/Skeleton.jsx +11 -11
  478. package/packages/slider/index.js +12 -12
  479. package/packages/slider/src/Slider.jsx +11 -11
  480. package/packages/space/index.js +12 -12
  481. package/packages/space/src/Space.jsx +11 -11
  482. package/packages/spin/index.js +12 -12
  483. package/packages/spin/src/Spin.jsx +11 -11
  484. package/packages/statistic/index.js +18 -18
  485. package/packages/statistic/src/Countdown.jsx +11 -11
  486. package/packages/statistic/src/Statistic.jsx +11 -11
  487. package/packages/steps/index.js +18 -18
  488. package/packages/steps/src/Step.jsx +11 -11
  489. package/packages/steps/src/Steps.jsx +11 -11
  490. package/packages/switch/index.js +12 -12
  491. package/packages/switch/src/Switch.jsx +11 -11
  492. package/packages/table-filter/index.js +27 -27
  493. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2622 -2630
  494. package/packages/table-filter/src/classification/Classification-com.vue +1760 -1760
  495. package/packages/table-filter/src/classification/search-class-name.vue +266 -266
  496. package/packages/table-filter/src/classification/search-professional-model.vue +680 -680
  497. package/packages/table-filter/src/components/TextOverTooltip.vue +120 -107
  498. package/packages/table-filter/src/components/age-com/index.vue +205 -205
  499. package/packages/table-filter/src/components/button-group/ButtonGroup.vue +162 -162
  500. package/packages/table-filter/src/components/button-icon/button-icon.js +33 -33
  501. package/packages/table-filter/src/components/button-icon/getBtnIcon.js +34 -34
  502. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  503. package/packages/table-filter/src/components/checkbox-group/CheckboxGroup.vue +53 -0
  504. package/packages/table-filter/src/components/drop-button/drop-button.vue +224 -224
  505. package/packages/table-filter/src/components/drop-button/head-btn-icon.js +33 -33
  506. package/packages/table-filter/src/components/drop-view/drop-view.vue +89 -89
  507. package/packages/table-filter/src/components/multi-select/multi-select.vue +242 -236
  508. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +232 -346
  509. package/packages/table-filter/src/components/range-age/index.vue +171 -172
  510. package/packages/table-filter/src/components/render-widget/components/CheckboxGroup.vue +51 -51
  511. package/packages/table-filter/src/components/render-widget/components/DateRangeQuick.vue +212 -0
  512. package/packages/table-filter/src/components/render-widget/components/NumberRange.vue +145 -0
  513. package/packages/table-filter/src/components/render-widget/components/Select.vue +50 -50
  514. package/packages/table-filter/src/components/render-widget/components/SelectDynamic.vue +304 -0
  515. package/packages/table-filter/src/components/render-widget/components/index.js +7 -7
  516. package/packages/table-filter/src/components/render-widget/enums.js +34 -29
  517. package/packages/table-filter/src/components/render-widget/index.vue +124 -91
  518. package/packages/table-filter/src/components/render-widget/mixins/dynamic-method.js +158 -0
  519. package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +245 -140
  520. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +1907 -1907
  521. package/packages/table-filter/src/components/search-condition/fieldTypeList.js +169 -169
  522. package/packages/table-filter/src/components/search-filter/SearchFilter.vue +280 -278
  523. package/packages/table-filter/src/components/search-modal/set-classification.vue +336 -336
  524. package/packages/table-filter/src/components/table-modal/TableModal.vue +477 -477
  525. package/packages/table-filter/src/const/dataOptions.js +43 -43
  526. package/packages/table-filter/src/const/index.js +1 -1
  527. package/packages/table-filter/src/index.vue +584 -584
  528. package/packages/table-filter/src/mixins/mixins.js +773 -714
  529. package/packages/table-filter/src/mixins/out-quick-method.js +123 -0
  530. package/packages/table-filter/src/mixins/renderWidget.js +97 -89
  531. package/packages/table-filter/src/mixins/tableSearchCon.js +128 -128
  532. package/packages/table-filter/src/mixins/wordBookutils.js +113 -113
  533. package/packages/table-filter/src/quick-search/QuickSearch.vue +2190 -2167
  534. package/packages/tabs/index.js +18 -18
  535. package/packages/tabs/src/TabPane.jsx +11 -11
  536. package/packages/tabs/src/Tabs.jsx +11 -11
  537. package/packages/tag/index.js +21 -21
  538. package/packages/tag/src/CheckableTag.jsx +11 -11
  539. package/packages/tag/src/Tag.jsx +11 -11
  540. package/packages/tag/src/TagGroup.vue +621 -621
  541. package/packages/time-picker/index.js +12 -12
  542. package/packages/time-picker/src/TimePicker.jsx +11 -11
  543. package/packages/timeline/index.js +14 -14
  544. package/packages/timeline/src/Item.jsx +11 -11
  545. package/packages/timeline/src/Timeline.jsx +11 -11
  546. package/packages/tooltip/index.js +12 -12
  547. package/packages/tooltip/src/Tooltip.jsx +11 -11
  548. package/packages/transfer/index.js +12 -12
  549. package/packages/transfer/src/Transfer.jsx +11 -11
  550. package/packages/tree/index.js +18 -18
  551. package/packages/tree/src/Tree.jsx +11 -11
  552. package/packages/tree/src/TreeNode.jsx +11 -11
  553. package/packages/tree-select/index.js +18 -18
  554. package/packages/tree-select/src/TreeNode.jsx +11 -11
  555. package/packages/tree-select/src/TreeSelect.jsx +11 -11
  556. package/packages/upload/chunk-upload/chunk-upload-new.vue +1001 -1001
  557. package/packages/upload/chunk-upload/vod-chunk-upload.vue +749 -749
  558. package/packages/upload/chunk-upload/vod-upload-modal.vue +100 -100
  559. package/packages/upload/index.js +12 -12
  560. package/packages/upload/src/Upload.jsx +11 -11
  561. package/packages/verification-code/SlideVerify.vue +306 -306
  562. package/packages/verification-code/index.js +17 -17
  563. package/packages/verification-code/verification-code.vue +147 -147
  564. package/src/component/player-vod/index.vue +57 -57
  565. package/src/component/player-vod/player.vue +192 -192
  566. package/src/component/player-vod/video-list.vue +262 -262
  567. package/src/component/player-vod/video-modal.vue +128 -128
  568. package/src/component/select-options/index.vue +430 -430
  569. package/src/component/select-pages/index.vue +95 -95
  570. package/src/component/svg/index.vue +59 -59
  571. package/src/core/create.js +6 -6
  572. package/src/core/event.js +23 -23
  573. package/src/core/table-methods.js +444 -444
  574. package/src/directive/flexibleResize.js +151 -151
  575. package/src/directive/preventReClick.js +12 -12
  576. package/src/directive/scroll.js +230 -230
  577. package/src/global/variable.js +2 -2
  578. package/src/style/normalize.css +424 -424
  579. package/src/style/style.less +49 -49
  580. package/src/utils/UniRTCv2.js +626 -626
  581. package/src/utils/chatFetch.js +61 -61
  582. package/src/utils/clickoutside.js +75 -75
  583. package/src/utils/crypto.js +25 -25
  584. package/src/utils/index.js +81 -81
  585. package/src/utils/kty-sdk.js +582 -582
  586. package/src/utils/kty.min-1.0.0.js +14378 -14378
  587. package/src/utils/sip-device.js +79 -79
  588. package/src/utils/time-domain.js +249 -249
  589. package/src/utils/trtc.js +1 -1
  590. package/src/utils/utils-map.js +485 -485
  591. package/src/utils/vexutils.js +836 -836
  592. package/.idea/cnhis-design-vue.iml +0 -12
  593. package/.idea/codeStyles/Project.xml +0 -57
  594. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  595. package/.idea/git_toolbox_prj.xml +0 -15
  596. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  597. package/.idea/modules.xml +0 -8
  598. package/.idea/vcs.xml +0 -6
@@ -1,1907 +1,1907 @@
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="(inputValue, option) => filterOptionMethod(inputValue, option, item)"
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
- extraValue: set.extraValue,
998
- id: (index + 9).toString(36) + index,
999
- sid: (index + 9).toString(36) + index
1000
- };
1001
- });
1002
- action.wordbookData = wordbookData;
1003
- return true;
1004
- } else {
1005
- let matchItem = this.fieldTypeList.find(item => sea.fieldType.toUpperCase() == item.name);
1006
- let conList = this.searchChildList;
1007
- if (matchItem) {
1008
- // 关系 选项
1009
- conList = matchItem.conList;
1010
- }
1011
- if (action?.settingObj?.attr === "BIRTHDAY") {
1012
- conList = conList.filter(v => !this.birthdayFilter.includes(v.name)) || [];
1013
- }
1014
-
1015
- action.searchChildList = conList;
1016
- }
1017
- // 通过 attr 判断类型,searchChildList
1018
- if (attrType == 'AGE') {
1019
- action.searchChildList = this.rangeAgeOptions;
1020
- action.format = format.toUpperCase();
1021
- // action.ageValue = this.diffTime(action.value);
1022
- }
1023
- } else {
1024
- this.fieldTypeList.some(item => {
1025
- if (sea.fieldType == item.name) {
1026
- action.searchChildList = item.conList.filter(con => con.name != 'QUOTE' && con.name != 'CONVERT' && con.name != 'QUOTE_NOT');
1027
- return true;
1028
- }
1029
- });
1030
- }
1031
- // 跨表字段
1032
- if (this.isRelationList.includes(value) && !action.searchChildList.some(v => v.name == 'QUOTE_IN')) {
1033
- action.searchChildList.push(...this.relationSelect);
1034
- }
1035
- return true;
1036
- }
1037
- });
1038
- this.formatActionData(action);
1039
- },
1040
- // 字典推荐值 item处理
1041
- handleDictionDef(el) {
1042
- let { defaultValue, defaultValueTitle } = el?.dictionarieObj || {};
1043
- let dictionItem = null;
1044
- if (defaultValue && defaultValueTitle) {
1045
- dictionItem = {
1046
- change_text: defaultValueTitle,
1047
- filter: [
1048
- {
1049
- con: 'EQ',
1050
- field_key: el.columnName,
1051
- value: defaultValue
1052
- }
1053
- ]
1054
- };
1055
- }
1056
- return dictionItem;
1057
- },
1058
- getWordbookData(o, obj) {
1059
- let { id, filterKeys, wordbookType } = o;
1060
- let resFieldKeys = filterKeys && Array.isArray(filterKeys) ? JSON.stringify(filterKeys) : filterKeys;
1061
- let url = `/tableReader/getWordbookData`;
1062
- let params = {
1063
- wordbookId: id,
1064
- fieldKeys: resFieldKeys,
1065
- wordbookType: wordbookType || 'WORDBOOK',
1066
- ...obj
1067
- };
1068
- return this.handleGetConfigApi(params, 'requestGetWordbookData', { fields: o }).then(res => {
1069
- return res;
1070
- });
1071
- },
1072
- handleWordbookData(item, data) {
1073
- let { settingObj = {} } = item;
1074
- let { showKeys = [], defaultValue, defaultValueTitle } = settingObj.wordbook || {};
1075
- let defaultItem = null;
1076
- if (defaultValue && defaultValueTitle) {
1077
- defaultItem = {
1078
- myName: defaultValue,
1079
- showKeys: defaultValueTitle
1080
- };
1081
- }
1082
- if (data && data.result) {
1083
- // 数组赋值并添加唯一name
1084
- let wordbookData = data.map.rows.map(row => {
1085
- let showKeysStr = [];
1086
- showKeys.forEach(ren => {
1087
- showKeysStr.push(row[ren]);
1088
- });
1089
- return Object.assign(row, {
1090
- myName: String(row[item.settingObj.wordbook.field_key]),
1091
- showKeys: showKeysStr.join('')
1092
- });
1093
- });
1094
- // 数组对象去重
1095
- let obj = {};
1096
- wordbookData = wordbookData.reduce((cur, next) => {
1097
- obj[next.myName] ? '' : (obj[next.myName] = true && cur.push(next));
1098
- return cur;
1099
- }, []);
1100
- if (defaultItem) {
1101
- wordbookData.unshift(defaultItem);
1102
- }
1103
- this.$set(item, 'wordbookData', wordbookData);
1104
- }
1105
- },
1106
- filterOptionMethod(inputValue, option, item){
1107
- let len = item?.wordbookData?.length;
1108
- if (!len) return true;
1109
- let curKey = option?.componentOptions?.propsData?.value || option.key
1110
- let findItem = item.wordbookData.find(v => v.myName == curKey);
1111
- let extraValue = findItem?.extraValue || "";
1112
- return utils.filterOption(inputValue, option, extraValue);
1113
- },
1114
- dropdownVisibleChange(open, item) {
1115
- if (open) {
1116
- let obj = {};
1117
- if (item.settingObj?.wordbook?.params) {
1118
- item.settingObj.wordbook.params.forEach(item => {
1119
- obj[item.p_name] = item.p_value;
1120
- });
1121
- }
1122
- if (item.settingObj?.wordbook) {
1123
- obj.autograph = item.settingObj.wordbook.autograph;
1124
- }
1125
- this.curWordbookData = item.settingObj.wordbook;
1126
- this.curAutograph = item.settingObj.wordbook && item.settingObj.wordbook.autograph;
1127
- this.searchItem = item;
1128
- if (item.settingObj.showSetting && item.settingObj.showSetting.length) {
1129
- return;
1130
- }
1131
- this.getWordbookData(item.settingObj.wordbook, obj).then(({ data }) => {
1132
- this.handleWordbookData(item, data);
1133
- });
1134
- }
1135
- },
1136
- /**
1137
- * 输入自动联想
1138
- */
1139
- handleSearch(value, item) {
1140
- if (item.settingObj?.showSetting?.length) return;
1141
- let params = {
1142
- keyword: value,
1143
- autograph: this.curAutograph
1144
- };
1145
- let obj = {};
1146
- if (item.settingObj?.wordbook?.params) {
1147
- item.settingObj.wordbook.params.forEach(item => {
1148
- obj[item.p_name] = item.p_value;
1149
- });
1150
- }
1151
- Object.assign(params, obj);
1152
-
1153
- this.getWordbookData(this.curWordbookData, params).then(({ data }) => {
1154
- this.handleWordbookData(this.searchItem, data);
1155
- });
1156
- },
1157
- handleSelect(value, item) {
1158
- let { wordbookData = [], wordbookValueList = [] } = item;
1159
- if (!wordbookData.length) return;
1160
- let matchItem = wordbookData.find(v => v.myName === value);
1161
- let hasItem = wordbookValueList.some(v => v.myName === value);
1162
- if (hasItem) return;
1163
- wordbookValueList.push(matchItem);
1164
- },
1165
- handleDeSelect(value, item) {
1166
- let { wordbookValueList = [] } = item;
1167
- let matchIndex = wordbookValueList.findIndex(v => v.myName === value);
1168
- if (matchIndex < 0) return;
1169
- wordbookValueList.splice(matchIndex, 1);
1170
- },
1171
-
1172
- selectChild(value, item, isInitSet, config = {}) {
1173
- let attr = item?.settingObj?.attr || '';
1174
- let arr = [
1175
- 'TODAY',
1176
- 'THIS_WEEK',
1177
- 'THIS_MONTH',
1178
- 'THIS_SEASON',
1179
- 'THIS_YEAR',
1180
- 'NULL',
1181
- 'NOT_NULL',
1182
- 'TOMORROW',
1183
- 'YESTERDAY',
1184
- 'NEXT_WEEK',
1185
- 'UP_WEEK',
1186
- 'NEXT_MONTH',
1187
- 'UP_MONTH',
1188
- 'NEXT_SEASON',
1189
- 'UP_SEASON',
1190
- 'NEXT_YEAR',
1191
- 'UP_YEAR'
1192
- ];
1193
- let ageList = ['BIG', 'BIGEQ', 'LESS', 'LESSEQ'];
1194
- // 自定义输入关系的“key”
1195
- const customTypes = ['EQ', 'IN', 'NEQ'];
1196
- const numbercustoms = ['EQ', 'NEQ', 'BIG', 'LESS', 'BIGEQ', 'LESSEQ'];
1197
-
1198
- item.showRangeAge = false; // 年龄范围
1199
- item.showAgeCom = false; // 年龄范围
1200
- let inRelation = ['QUOTE_IN', 'QUOTE_NOTIN'];
1201
- if (arr.includes(value)) {
1202
- item.showInput = false;
1203
- item.showSelect = false;
1204
- item.showDate = false;
1205
- item.showSearch = false;
1206
- item.showRelation = false;
1207
- this.initBirthdayParams(item);
1208
- } else if (['IN_THE_PAST', 'IN_THE_FUTURE', 'N_', 'L_', 'IN_THE_PAST_DI', 'IN_THE_FUTURE_DI'].includes(value)) {
1209
- // 以前、以后、过去内、未来内
1210
- // L_ N_ IN_THE_PAST IN_THE_FUTURE 添加小时
1211
- // 过去第 未来第
1212
- // IN_THE_PAST_DI IN_THE_FUTURE_DI
1213
- item.showSelect = true;
1214
- item.showInput = true;
1215
- item.showDate = false;
1216
- item.showSearch = false;
1217
- item.showRelation = false;
1218
- if (value == 'IN_THE_PAST_DI' || value == 'IN_THE_FUTURE_DI') {
1219
- this.$set(item, 'dateList', this.dateList);
1220
- } else {
1221
- let dateList = this.dateList.concat(this.dateTimeList);
1222
- this.$set(item, 'dateList', dateList);
1223
- }
1224
- if (!isInitSet) {
1225
- this.$set(item, 'unit', 'DAY');
1226
- }
1227
- this.initBirthdayParams(item);
1228
- } else if (value == 'IN') {
1229
- // field_key: "birthday"
1230
- if (attr == 'BIRTHDAY') {
1231
- item.showBirthdayDate = true;
1232
- item.showDate = false;
1233
- item.units = this.birthdayUnits.filter(i => i.units === 1);
1234
- } else if (attr == 'AGE') {
1235
- item.showRangeAge = true;
1236
- } else {
1237
- item.showDate = true;
1238
- this.initBirthdayParams(item);
1239
- }
1240
- item.showSelect = false;
1241
- item.showInput = false;
1242
- item.showSearch = false;
1243
- item.showRelation = false;
1244
- } else if (value == 'CONVERT' || value == 'QUOTE' || value == 'QUOTE_NOT') {
1245
- item.showDate = false;
1246
- item.showSelect = false;
1247
- item.showInput = false;
1248
- item.showSearch = true;
1249
- item.showRelation = false;
1250
- this.initBirthdayParams(item);
1251
- let showSetting = false;
1252
- if (item.settingObj?.showSetting?.length) {
1253
- showSetting = true;
1254
- }
1255
- // 这里wordbookValueList替换wordbookData 还是有点问题 需要根据具体场景再修改
1256
- if (!showSetting && item.wordbookValueList?.length) {
1257
- this.$set(item, 'wordbookData', item.wordbookValueList);
1258
- }
1259
- } else if (inRelation.includes(value)) {
1260
- // 跨表查询
1261
- item.showRelation = true;
1262
- item.showInput = false;
1263
- item.showSelect = false;
1264
- item.showDate = false;
1265
- item.showSearch = false;
1266
- this.initBirthdayParams(item);
1267
- } else if (attr == 'AGE') {
1268
- if (ageList.includes(value)) {
1269
- item.showAgeCom = true;
1270
- }
1271
- } else {
1272
- item.showSelect = false;
1273
- item.showDate = false;
1274
- if (item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
1275
- item.showInput = false;
1276
- } else {
1277
- item.showInput = true;
1278
- }
1279
- item.showSearch = false;
1280
- item.showRelation = false;
1281
- this.initBirthdayParams(item);
1282
- }
1283
-
1284
- if (!this.showCompareField) return;
1285
-
1286
- let s_type = config?.type;
1287
- if (s_type === '_custom__input_') return;
1288
-
1289
- if (customTypes.includes(value) || (['NUMBER', 'DATE', 'DATETIME', 'TIME'].includes(item.fieldType) && numbercustoms.includes(value))) {
1290
- this.$set(item, 'is_compare_field', true);
1291
- this.$set(item, 'customInput', false);
1292
- this.handleSetSelectList(item);
1293
- if (Array.isArray(item.selectList)) {
1294
- // 默认选中第一
1295
- if (item.selectList.length > 1) {
1296
- let [a] = item.selectList;
1297
- let compare_val = isInitSet? item.compare_field || a.value : a.value;
1298
- this.$set(item, 'compare_field', compare_val);
1299
- setTimeout(() => {
1300
- // 里面递归调用 selectChild ,异步等待,第一个方法执行完成
1301
- this.compare_fieldOnChange(compare_val, item);
1302
- }, 100);
1303
- } else {
1304
- let selectList = item?.selectList || [];
1305
- let len = selectList?.length || 0;
1306
- let onlyCustomInput = len === 1 ? selectList[0].value === '_custom__input_' : false;
1307
- // selectList 只有一个选项并且 是 _custom__input_ ,隐藏 select ,展示 customInput
1308
- if (onlyCustomInput) {
1309
- this.$set(item, 'customInput', true);
1310
- item.compare_field = '_custom__input_';
1311
- return;
1312
- }
1313
- }
1314
- }
1315
-
1316
- if (isInitSet) {
1317
- // 如果是 is_compare_field 字段 并有值compare_field
1318
- if (config.is_compare_field && item.compare_field) {
1319
- this.$set(item, 'is_compare_field', true);
1320
- } else if (item.start_val || item.end_val || item.value || item.wordValue || item.showSelect) {
1321
- // 自定义输入回填
1322
- this.$set(item, 'customInput', true);
1323
- item.compare_field = '_custom__input_';
1324
- return;
1325
- }
1326
- }
1327
- this.handleHideItem(item, false);
1328
- } else {
1329
- item.customInput = true;
1330
- item.is_compare_field = false;
1331
- item['compare_field'] && (item['compare_field'] = undefined);
1332
- }
1333
- },
1334
- handleHideItem(item, reset = true) {
1335
- item.showRangeAge = false; // 年龄范围
1336
- item.showAgeCom = false; // 年龄范围
1337
- item.showInput = false;
1338
- item.showSelect = false;
1339
- item.showDate = false;
1340
- item.showSearch = false;
1341
- item.showRelation = false;
1342
-
1343
- // item.value = "";
1344
- // this.$set(item, 'value', '');
1345
- reset && this.$set(item, 'value', '');
1346
- },
1347
- disabledDatePicker(current, item, t){
1348
- if(item.isIllegalField) return true
1349
- let f = false;
1350
- if(t=== 'start'){
1351
- const end_val = item?.end_val;
1352
- f = end_val && current.valueOf() > end_val.valueOf();
1353
- } else if(t=== 'end') {
1354
- const start_val = item?.start_val;
1355
- f = start_val && current.valueOf() <= start_val.valueOf();
1356
- }
1357
- /**
1358
- * 2 过去时间
1359
- * 3 未来时间
1360
- */
1361
- let type = String(item?.advanceOptionSetting);
1362
- if(!['2','3'].includes(type)) return f;
1363
- if(type === '2'){
1364
- return current >= moment().endOf('day') || f;
1365
- } else if(type==='3'){
1366
- return current && current < moment().startOf('day') || f;
1367
- }
1368
- return f
1369
- },
1370
- disabledStartDate(start_val) {
1371
- const end_val = this.end_val;
1372
- if (!start_val || !end_val) {
1373
- return false;
1374
- }
1375
- return start_val.valueOf() > end_val.valueOf();
1376
- },
1377
- disabledEndDate(end_val) {
1378
- const start_val = this.start_val;
1379
- if (!end_val || !start_val) {
1380
- return false;
1381
- }
1382
- return start_val.valueOf() >= end_val.valueOf();
1383
- },
1384
- handleStartOpenChange(open, item) {
1385
- if (!open) {
1386
- this.$set(item, 'endOpen', true);
1387
- }
1388
- },
1389
- handleEndOpenChange(open, item) {
1390
- this.$set(item, 'endOpen', open);
1391
- },
1392
- // 日期选择范围
1393
- disabledDate(current) {
1394
- return (current && current < moment().startOf('year')) || current > moment().endOf('year');
1395
- },
1396
- changeRange(value, item) {
1397
- let res = [];
1398
- if (value.length > 0) {
1399
- value.forEach(item => {
1400
- item._d && res.push(utils.formatTime('MOUTH', item._d));
1401
- });
1402
- }
1403
- if (res.length > 0) {
1404
- item.curlimit_date = res.join('~');
1405
- }
1406
- },
1407
- // 选择关联表
1408
- handlerSelectRelation(e, item) {
1409
- let curItem = this.relationTableList.find(v => v.tableId === e);
1410
- curItem && (item.relationField = curItem.relationField);
1411
- item.relationFieldList = JSON.parse(JSON.stringify(curItem?.fieldList?.fieldList || []));
1412
- item.converFun = curItem.converFun || undefined;
1413
- item.parameterConversionId = curItem.parameterConversionId || undefined;
1414
- item.relationOrgId = curItem.relationOrgId || undefined;
1415
- item.preConObj = curItem.preConObj || undefined;
1416
- item.preSqlExpression = curItem.preSqlExpression || undefined;
1417
- },
1418
- openRelationFilter(data, i) {
1419
- this.clcikRelationIndex = i;
1420
- this.relationAction = data.quote_con;
1421
- this.relationSearchFieldList = data.relationFieldList;
1422
- this.relationVisible = true;
1423
- // sqlExpression
1424
- },
1425
- relationCancel() {
1426
- this.relationVisible = false;
1427
- this.relationAction = {};
1428
- this.relationSearchFieldList = [];
1429
- },
1430
- relationSave(data) {
1431
- let { setting = '' } = data;
1432
- let settingObj = JSON.parse(setting);
1433
- this.actionList[this.clcikRelationIndex].quote_con = {
1434
- conObj: settingObj.conObj,
1435
- sqlExpression: settingObj.sqlExpression
1436
- };
1437
- this.relationCancel();
1438
- },
1439
- initBirthdayParams(item) {
1440
- item.showBirthdayDate = false;
1441
- item.unit = item.unit || 'YEAR';
1442
- item.units = this.birthdayUnits.filter(i => i.units === 1);
1443
- },
1444
- handleParentNamesAdd(e) {
1445
- const nextInput = e?.target?.nextElementSibling;
1446
- setTimeout(() => {
1447
- nextInput && nextInput.focus();
1448
- });
1449
- this.showAdd = true;
1450
- },
1451
- hanldeBlur() {
1452
- this.showAdd = false;
1453
- if (!this.addVal) return;
1454
- this.parentNames.forEach(v => (v.selected = false));
1455
- this.parentNames.push({
1456
- disabled: true,
1457
- value: this.addVal,
1458
- selected: true,
1459
- isAdd: true
1460
- });
1461
- this.addVal = '';
1462
- },
1463
- editParentName(e, item) {
1464
- item.disabled = false;
1465
- setTimeout(() => {
1466
- e.target.focus();
1467
- }, 0);
1468
- },
1469
- handleParentNameSelect(item, index) {
1470
- if (!item.disabled) return;
1471
- this.parentNames.forEach((pItem, pIndex) => {
1472
- if (pIndex !== index) {
1473
- pItem.selected = false;
1474
- }
1475
- });
1476
- item.selected = !item.selected;
1477
- },
1478
- handleParentNamesRemove(index, item) {
1479
- // this.parentNames.splice(index, 1);
1480
- this.handleParent(index, item);
1481
- },
1482
- handleParent(index, item) {
1483
- let { conditionList } = this;
1484
- if (!conditionList || !conditionList.length) {
1485
- this.parentNames.splice(index, 1);
1486
- return;
1487
- }
1488
- let hasItem = conditionList.filter(v => v.displayCategory === item.value);
1489
- if (!hasItem || !hasItem.length) {
1490
- this.parentNames.splice(index, 1);
1491
- return;
1492
- }
1493
- this.$message.error('该分类下有已有数据,请删除该分类下的筛选集后重试!');
1494
- },
1495
- getParentSelectedStyle(item) {
1496
- if (item.selected && item.disabled) {
1497
- return {
1498
- backgroundColor: '#2D7AFF',
1499
- color: '#fff'
1500
- };
1501
- }
1502
- return null;
1503
- },
1504
-
1505
- // 年龄组件变化
1506
- ageRangeOnChange(obj, item) {
1507
- let s = obj.star_val;
1508
- let e = obj.end_val;
1509
- this.$set(item, 'start_val', isNaN(s) ? undefined : s);
1510
- this.$set(item, 'end_val', isNaN(e) ? undefined : e);
1511
- },
1512
-
1513
- agecomOnChange(obj, item) {
1514
- this.$set(item, 'value', isNaN(obj.days) ? undefined : obj.days);
1515
- },
1516
-
1517
- diffTime(days) {
1518
- let d = +days;
1519
- if (isNaN(d)) return {};
1520
- if (typeof d == 'number') {
1521
- let next = 0;
1522
- let year = Math.floor(d / 365);
1523
- next = d % 365;
1524
- let month = Math.floor(next / 30);
1525
- next = next % 30;
1526
- let day = next;
1527
-
1528
- return { year, month, day, d };
1529
- }
1530
- return {};
1531
- },
1532
-
1533
- filterOption(...arg) {
1534
- return utils.filterOption(...arg);
1535
- },
1536
-
1537
- /**
1538
- * 选中字段
1539
- */
1540
- handleSetSelectList(item) {
1541
- let list = this.searchList
1542
- .filter(v => v.fieldType == item.fieldType && (this.isBI ? v.fieldId : v.columnName) != item.field_key)
1543
- .map(v => {
1544
- return {
1545
- value: this.isBI ? v.fieldId : v.columnName,
1546
- name: v.alias || v.title
1547
- };
1548
- });
1549
-
1550
- list.unshift({
1551
- value: '_custom__input_',
1552
- name: '自定义输入'
1553
- });
1554
-
1555
- this.$set(item, 'selectList', list);
1556
- },
1557
-
1558
- /**
1559
- * 切换字段选项
1560
- */
1561
- compare_fieldOnChange(e, item) {
1562
- if (e === '_custom__input_') {
1563
- item.customInput = true;
1564
- this.selectChild(item.con, item, false, { type: '_custom__input_' });
1565
- } else {
1566
- item.customInput = false;
1567
- this.$set(item, 'value', '');
1568
- }
1569
- },
1570
-
1571
- checkCustomInput(item) {
1572
- /**
1573
- * 判断可选的 是否 只有 “_custom__input_”
1574
- */
1575
- let selectList = item?.selectList || [];
1576
- let len = selectList?.length || 0;
1577
- let onlyCustomInput = len === 1 ? selectList[0].value === '_custom__input_' : false;
1578
- return onlyCustomInput;
1579
- },
1580
-
1581
- visibleCompareField(item) {
1582
- if (!this.showCompareField) return false;
1583
- let onlyCustomInput = this.checkCustomInput(item);
1584
- /**
1585
- * 展示 compare_field 条件
1586
- * 1. 是is_compare_field 字段 并且有字段可选
1587
- */
1588
- return item.is_compare_field && !onlyCustomInput;
1589
- },
1590
-
1591
- visibleDefaultField(item) {
1592
- /**
1593
- * 展示默认字段的条件
1594
- * 1. 非 is_compare_field 字段
1595
- * 2. 是 is_compare_field 字段,选中 自定义输入 is_compare_field
1596
- * 3. 是 is_compare_field 字段 ,没有可选的 onlyCustomInput
1597
- */
1598
- if (!this.showCompareField) return true;
1599
- let onlyCustomInput = this.checkCustomInput(item);
1600
- return item.customInput || !item.is_compare_field || onlyCustomInput;
1601
- },
1602
-
1603
- handleHideCompareField(item) {
1604
- if (!this.showCompareField) return;
1605
- item.customInput = false;
1606
- item.is_compare_field = false;
1607
- item.compare_field = undefined;
1608
- },
1609
-
1610
- checkActionList() {
1611
- let f = this.actionList.every(v => !v.field_key);
1612
- return f;
1613
- },
1614
-
1615
- /**
1616
- * select 变化
1617
- */
1618
- fieldselectONchange(item, eventName, value, vnode) {
1619
- // 清空操作
1620
- if (value === undefined) {
1621
- eventName === 'changeColumnName' && this.handleResetColumnName(item);
1622
- eventName === 'selectChild' && this.handleResetSelectChild(item);
1623
- }
1624
-
1625
- // 有改变去掉“兼容”的值
1626
- item.is_compatibility = undefined;
1627
- item.compatibility_con = undefined;
1628
- },
1629
-
1630
- handleResetColumnName(item) {
1631
- item.con = undefined;
1632
- this.$set(item, 'wordValue', []);
1633
- this.$set(item, 'wordbookData', []);
1634
- this.handleHideItem(item);
1635
- },
1636
-
1637
- handleResetSelectChild(item) {
1638
- this.$set(item, 'wordValue', []);
1639
- // this.$set(item, 'wordbookData', []);
1640
- this.$set(item, 'value', undefined);
1641
- this.$set(item, 'showSelect', undefined);
1642
- this.$set(item, 'start_val', null);
1643
- this.$set(item, 'end_val', null);
1644
- this.handleHideItem(item);
1645
- },
1646
-
1647
- checkItem(item){
1648
- /**
1649
- * 这是兼容处理
1650
- * 场景:admin 配置的映射数据,配置了“自定义输入”,期望能正常展示。
1651
- */
1652
- if(['copy','edit'].includes(this.fromType)){
1653
- let f = item.is_compare_field && this.showCompareField && item.compare_field === '_custom__input_';
1654
- // 复制模式,回填是“自定义输入”,但不支持“自定义输入”的类型
1655
- let isArr = Array.isArray(item.searchChildList);
1656
- if(f && isArr){
1657
- let con = item.searchChildList.find(v=> v.name == item.con);
1658
- // 该字段关系没有该类型
1659
- if(!con){
1660
- // 缓存 con 值
1661
- item.compatibility_con = item.con;
1662
- // 从默认关系中查找“关系”
1663
- let defCon = this.searchChildList.find(v=> v.name === item.con);
1664
- item.con = defCon?.desc || item.compatibility_con;
1665
- // 兼容模式标识
1666
- this.$set(item, 'is_compatibility', true)
1667
- }
1668
- }
1669
- }
1670
- }
1671
- }
1672
- });
1673
- </script>
1674
-
1675
- <style lang="less" scoped>
1676
- .inner-content {
1677
- color: #000;
1678
- & > p > span {
1679
- cursor: pointer;
1680
- }
1681
- .item-name {
1682
- display: flex;
1683
- height: 32px;
1684
- line-height: 32px;
1685
- margin-bottom: 10px;
1686
- .label {
1687
- width: 120px;
1688
- text-align: right;
1689
- }
1690
- }
1691
- .parent-names {
1692
- display: flex;
1693
- align-items: center;
1694
- flex-wrap: wrap;
1695
- line-height: 32px;
1696
- .label {
1697
- display: inline-block;
1698
- height: 32px;
1699
- line-height: 32px;
1700
- margin-bottom: 10px;
1701
- width: 120px;
1702
- text-align: right;
1703
- }
1704
- /deep/ .ant-btn-dashed {
1705
- border-color: #a6a6a6;
1706
- color: #a6a6a6;
1707
- }
1708
-
1709
- .edit-tag {
1710
- position: relative;
1711
- margin-right: 10px;
1712
- margin-bottom: 10px;
1713
- /deep/ .anticon-close {
1714
- position: absolute;
1715
- right: 5px;
1716
- line-height: 36px;
1717
- color: #2d7aff;
1718
- }
1719
- /deep/ .ant-input-disabled {
1720
- color: #2d7aff;
1721
- background-color: rgba(45, 122, 255, 0.1);
1722
- opacity: 1;
1723
- border-color: #2d7aff;
1724
- cursor: pointer;
1725
- }
1726
- /deep/.ant-input-group-addon,
1727
- /deep/.ant-input:not(:hover),
1728
- /deep/.ant-input-number:not(:hover) {
1729
- border-color: #2d7aff !important;
1730
- }
1731
- &.edit-tag-select {
1732
- /deep/ .ant-input-disabled {
1733
- color: #fff;
1734
- background-color: #2d7aff;
1735
- }
1736
- /deep/ .anticon-close {
1737
- color: #fff;
1738
- }
1739
- }
1740
- }
1741
- /deep/ .ant-btn {
1742
- margin-bottom: 10px;
1743
- }
1744
- }
1745
- .item-list {
1746
- padding-top: 12px;
1747
- margin-top: 16px;
1748
- margin-bottom: 6px;
1749
- border-top: 1px solid #e6e6e6;
1750
- &.list-onlyCondition {
1751
- padding-top: 0;
1752
- border-top: 0px;
1753
- }
1754
- li {
1755
- margin-bottom: 10px;
1756
- }
1757
- .form-item {
1758
- width: 120px;
1759
- margin-right: 10px;
1760
- }
1761
- .form-action {
1762
- font-size: 16px;
1763
- float: right;
1764
- margin-top: 6px;
1765
- cursor: pointer;
1766
- }
1767
- .date-item {
1768
- display: inline-block;
1769
- }
1770
- .birthday-item {
1771
- > div {
1772
- display: inline-block;
1773
- margin-top: 5px;
1774
- p {
1775
- display: inline-block;
1776
- margin: 0 10px 0 15px;
1777
- }
1778
- > span {
1779
- margin-top: 5px;
1780
- }
1781
- }
1782
- .age-wrap {
1783
- display: inline-block;
1784
- }
1785
- }
1786
- .relation-item {
1787
- display: inline-block;
1788
- .relation-width {
1789
- width: 150px;
1790
- margin-right: 10px;
1791
- }
1792
- .relation-btn {
1793
- cursor: pointer;
1794
- }
1795
- }
1796
- .range-container {
1797
- display: inline-block;
1798
- width: 442px;
1799
- /* line-height: 1.5; */
1800
- vertical-align: bottom;
1801
- }
1802
- .item-error {
1803
- color: red;
1804
- display: inline-block;
1805
- }
1806
- }
1807
- .index-span {
1808
- width: 30px;
1809
- display: inline-block;
1810
- }
1811
- }
1812
- .blue {
1813
- color: #2d7aff;
1814
- margin-right: 8px;
1815
- }
1816
- .red {
1817
- color: #e02020;
1818
- }
1819
-
1820
- .in-block {
1821
- display: inline-block;
1822
- }
1823
- </style>
1824
-
1825
- <style lang="less">
1826
- // 专业模式下的样式修改
1827
- ._c_com-search-professional {
1828
- .inner-content {
1829
- .item-list {
1830
- > li {
1831
- position: relative;
1832
- .def_item_input {
1833
- position: absolute;
1834
- width: 100%;
1835
- }
1836
- .show-small-select {
1837
- .val-small-select-wrap {
1838
- width: 66px !important;
1839
- }
1840
- .val-input-wrap {
1841
- width: 34% !important;
1842
- }
1843
- }
1844
- }
1845
- }
1846
-
1847
- .item-error {
1848
- display: block;
1849
- padding-left: 29px;
1850
- }
1851
- .form-action {
1852
- position: absolute;
1853
- right: 0px;
1854
- top: 0;
1855
- }
1856
- }
1857
-
1858
- .select-front-item {
1859
- width: 23% !important;
1860
- }
1861
- .val-input-wrap {
1862
- width: 42%;
1863
- display: inline-block;
1864
- .ant-input {
1865
- width: 100% !important;
1866
- }
1867
- }
1868
- .val-select-wrap,
1869
- .val-age-wrap,
1870
- .val-date-wrap {
1871
- width: 42% !important;
1872
-
1873
- .ant-calendar-picker {
1874
- width: 50% !important;
1875
- }
1876
- }
1877
-
1878
- .val-range-wrap {
1879
- width: 42% !important;
1880
- .ant-input-group {
1881
- .age-com {
1882
- // 年龄组件 单位
1883
- .age-com-suffix {
1884
- padding: 0 1px;
1885
- }
1886
- .ant-input-number {
1887
- // 修改宽度
1888
- width: 100%;
1889
- // 隐藏数字操作项
1890
- .ant-input-number-handler-wrap {
1891
- display: none;
1892
- }
1893
- // 修改inputpadding
1894
- .ant-input-number-input-wrap {
1895
- input {
1896
- padding: 0 2px;
1897
- }
1898
- }
1899
- }
1900
- }
1901
- }
1902
- }
1903
- .teavalue-wrap {
1904
- width: calc(88% + 20px);
1905
- }
1906
- }
1907
- </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="(inputValue, option) => filterOptionMethod(inputValue, option, item)"
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
+ extraValue: set.extraValue,
998
+ id: (index + 9).toString(36) + index,
999
+ sid: (index + 9).toString(36) + index
1000
+ };
1001
+ });
1002
+ action.wordbookData = wordbookData;
1003
+ return true;
1004
+ } else {
1005
+ let matchItem = this.fieldTypeList.find(item => sea.fieldType.toUpperCase() == item.name);
1006
+ let conList = this.searchChildList;
1007
+ if (matchItem) {
1008
+ // 关系 选项
1009
+ conList = matchItem.conList;
1010
+ }
1011
+ if (action?.settingObj?.attr === "BIRTHDAY") {
1012
+ conList = conList.filter(v => !this.birthdayFilter.includes(v.name)) || [];
1013
+ }
1014
+
1015
+ action.searchChildList = conList;
1016
+ }
1017
+ // 通过 attr 判断类型,searchChildList
1018
+ if (attrType == 'AGE') {
1019
+ action.searchChildList = this.rangeAgeOptions;
1020
+ action.format = format.toUpperCase();
1021
+ // action.ageValue = this.diffTime(action.value);
1022
+ }
1023
+ } else {
1024
+ this.fieldTypeList.some(item => {
1025
+ if (sea.fieldType == item.name) {
1026
+ action.searchChildList = item.conList.filter(con => con.name != 'QUOTE' && con.name != 'CONVERT' && con.name != 'QUOTE_NOT');
1027
+ return true;
1028
+ }
1029
+ });
1030
+ }
1031
+ // 跨表字段
1032
+ if (this.isRelationList.includes(value) && !action.searchChildList.some(v => v.name == 'QUOTE_IN')) {
1033
+ action.searchChildList.push(...this.relationSelect);
1034
+ }
1035
+ return true;
1036
+ }
1037
+ });
1038
+ this.formatActionData(action);
1039
+ },
1040
+ // 字典推荐值 item处理
1041
+ handleDictionDef(el) {
1042
+ let { defaultValue, defaultValueTitle } = el?.dictionarieObj || {};
1043
+ let dictionItem = null;
1044
+ if (defaultValue && defaultValueTitle) {
1045
+ dictionItem = {
1046
+ change_text: defaultValueTitle,
1047
+ filter: [
1048
+ {
1049
+ con: 'EQ',
1050
+ field_key: el.columnName,
1051
+ value: defaultValue
1052
+ }
1053
+ ]
1054
+ };
1055
+ }
1056
+ return dictionItem;
1057
+ },
1058
+ getWordbookData(o, obj) {
1059
+ let { id, filterKeys, wordbookType } = o;
1060
+ let resFieldKeys = filterKeys && Array.isArray(filterKeys) ? JSON.stringify(filterKeys) : filterKeys;
1061
+ let url = `/tableReader/getWordbookData`;
1062
+ let params = {
1063
+ wordbookId: id,
1064
+ fieldKeys: resFieldKeys,
1065
+ wordbookType: wordbookType || 'WORDBOOK',
1066
+ ...obj
1067
+ };
1068
+ return this.handleGetConfigApi(params, 'requestGetWordbookData', { fields: o }).then(res => {
1069
+ return res;
1070
+ });
1071
+ },
1072
+ handleWordbookData(item, data) {
1073
+ let { settingObj = {} } = item;
1074
+ let { showKeys = [], defaultValue, defaultValueTitle } = settingObj.wordbook || {};
1075
+ let defaultItem = null;
1076
+ if (defaultValue && defaultValueTitle) {
1077
+ defaultItem = {
1078
+ myName: defaultValue,
1079
+ showKeys: defaultValueTitle
1080
+ };
1081
+ }
1082
+ if (data && data.result) {
1083
+ // 数组赋值并添加唯一name
1084
+ let wordbookData = data.map.rows.map(row => {
1085
+ let showKeysStr = [];
1086
+ showKeys.forEach(ren => {
1087
+ showKeysStr.push(row[ren]);
1088
+ });
1089
+ return Object.assign(row, {
1090
+ myName: String(row[item.settingObj.wordbook.field_key]),
1091
+ showKeys: showKeysStr.join('')
1092
+ });
1093
+ });
1094
+ // 数组对象去重
1095
+ let obj = {};
1096
+ wordbookData = wordbookData.reduce((cur, next) => {
1097
+ obj[next.myName] ? '' : (obj[next.myName] = true && cur.push(next));
1098
+ return cur;
1099
+ }, []);
1100
+ if (defaultItem) {
1101
+ wordbookData.unshift(defaultItem);
1102
+ }
1103
+ this.$set(item, 'wordbookData', wordbookData);
1104
+ }
1105
+ },
1106
+ filterOptionMethod(inputValue, option, item){
1107
+ let len = item?.wordbookData?.length;
1108
+ if (!len) return true;
1109
+ let curKey = option?.componentOptions?.propsData?.value || option.key
1110
+ let findItem = item.wordbookData.find(v => v.myName == curKey);
1111
+ let extraValue = findItem?.extraValue || "";
1112
+ return utils.filterOption(inputValue, option, extraValue);
1113
+ },
1114
+ dropdownVisibleChange(open, item) {
1115
+ if (open) {
1116
+ let obj = {};
1117
+ if (item.settingObj?.wordbook?.params) {
1118
+ item.settingObj.wordbook.params.forEach(item => {
1119
+ obj[item.p_name] = item.p_value;
1120
+ });
1121
+ }
1122
+ if (item.settingObj?.wordbook) {
1123
+ obj.autograph = item.settingObj.wordbook.autograph;
1124
+ }
1125
+ this.curWordbookData = item.settingObj.wordbook;
1126
+ this.curAutograph = item.settingObj.wordbook && item.settingObj.wordbook.autograph;
1127
+ this.searchItem = item;
1128
+ if (item.settingObj.showSetting && item.settingObj.showSetting.length) {
1129
+ return;
1130
+ }
1131
+ this.getWordbookData(item.settingObj.wordbook, obj).then(({ data }) => {
1132
+ this.handleWordbookData(item, data);
1133
+ });
1134
+ }
1135
+ },
1136
+ /**
1137
+ * 输入自动联想
1138
+ */
1139
+ handleSearch(value, item) {
1140
+ if (item.settingObj?.showSetting?.length) return;
1141
+ let params = {
1142
+ keyword: value,
1143
+ autograph: this.curAutograph
1144
+ };
1145
+ let obj = {};
1146
+ if (item.settingObj?.wordbook?.params) {
1147
+ item.settingObj.wordbook.params.forEach(item => {
1148
+ obj[item.p_name] = item.p_value;
1149
+ });
1150
+ }
1151
+ Object.assign(params, obj);
1152
+
1153
+ this.getWordbookData(this.curWordbookData, params).then(({ data }) => {
1154
+ this.handleWordbookData(this.searchItem, data);
1155
+ });
1156
+ },
1157
+ handleSelect(value, item) {
1158
+ let { wordbookData = [], wordbookValueList = [] } = item;
1159
+ if (!wordbookData.length) return;
1160
+ let matchItem = wordbookData.find(v => v.myName === value);
1161
+ let hasItem = wordbookValueList.some(v => v.myName === value);
1162
+ if (hasItem) return;
1163
+ wordbookValueList.push(matchItem);
1164
+ },
1165
+ handleDeSelect(value, item) {
1166
+ let { wordbookValueList = [] } = item;
1167
+ let matchIndex = wordbookValueList.findIndex(v => v.myName === value);
1168
+ if (matchIndex < 0) return;
1169
+ wordbookValueList.splice(matchIndex, 1);
1170
+ },
1171
+
1172
+ selectChild(value, item, isInitSet, config = {}) {
1173
+ let attr = item?.settingObj?.attr || '';
1174
+ let arr = [
1175
+ 'TODAY',
1176
+ 'THIS_WEEK',
1177
+ 'THIS_MONTH',
1178
+ 'THIS_SEASON',
1179
+ 'THIS_YEAR',
1180
+ 'NULL',
1181
+ 'NOT_NULL',
1182
+ 'TOMORROW',
1183
+ 'YESTERDAY',
1184
+ 'NEXT_WEEK',
1185
+ 'UP_WEEK',
1186
+ 'NEXT_MONTH',
1187
+ 'UP_MONTH',
1188
+ 'NEXT_SEASON',
1189
+ 'UP_SEASON',
1190
+ 'NEXT_YEAR',
1191
+ 'UP_YEAR'
1192
+ ];
1193
+ let ageList = ['BIG', 'BIGEQ', 'LESS', 'LESSEQ'];
1194
+ // 自定义输入关系的“key”
1195
+ const customTypes = ['EQ', 'IN', 'NEQ'];
1196
+ const numbercustoms = ['EQ', 'NEQ', 'BIG', 'LESS', 'BIGEQ', 'LESSEQ'];
1197
+
1198
+ item.showRangeAge = false; // 年龄范围
1199
+ item.showAgeCom = false; // 年龄范围
1200
+ let inRelation = ['QUOTE_IN', 'QUOTE_NOTIN'];
1201
+ if (arr.includes(value)) {
1202
+ item.showInput = false;
1203
+ item.showSelect = false;
1204
+ item.showDate = false;
1205
+ item.showSearch = false;
1206
+ item.showRelation = false;
1207
+ this.initBirthdayParams(item);
1208
+ } else if (['IN_THE_PAST', 'IN_THE_FUTURE', 'N_', 'L_', 'IN_THE_PAST_DI', 'IN_THE_FUTURE_DI'].includes(value)) {
1209
+ // 以前、以后、过去内、未来内
1210
+ // L_ N_ IN_THE_PAST IN_THE_FUTURE 添加小时
1211
+ // 过去第 未来第
1212
+ // IN_THE_PAST_DI IN_THE_FUTURE_DI
1213
+ item.showSelect = true;
1214
+ item.showInput = true;
1215
+ item.showDate = false;
1216
+ item.showSearch = false;
1217
+ item.showRelation = false;
1218
+ if (value == 'IN_THE_PAST_DI' || value == 'IN_THE_FUTURE_DI') {
1219
+ this.$set(item, 'dateList', this.dateList);
1220
+ } else {
1221
+ let dateList = this.dateList.concat(this.dateTimeList);
1222
+ this.$set(item, 'dateList', dateList);
1223
+ }
1224
+ if (!isInitSet) {
1225
+ this.$set(item, 'unit', 'DAY');
1226
+ }
1227
+ this.initBirthdayParams(item);
1228
+ } else if (value == 'IN') {
1229
+ // field_key: "birthday"
1230
+ if (attr == 'BIRTHDAY') {
1231
+ item.showBirthdayDate = true;
1232
+ item.showDate = false;
1233
+ item.units = this.birthdayUnits.filter(i => i.units === 1);
1234
+ } else if (attr == 'AGE') {
1235
+ item.showRangeAge = true;
1236
+ } else {
1237
+ item.showDate = true;
1238
+ this.initBirthdayParams(item);
1239
+ }
1240
+ item.showSelect = false;
1241
+ item.showInput = false;
1242
+ item.showSearch = false;
1243
+ item.showRelation = false;
1244
+ } else if (value == 'CONVERT' || value == 'QUOTE' || value == 'QUOTE_NOT') {
1245
+ item.showDate = false;
1246
+ item.showSelect = false;
1247
+ item.showInput = false;
1248
+ item.showSearch = true;
1249
+ item.showRelation = false;
1250
+ this.initBirthdayParams(item);
1251
+ let showSetting = false;
1252
+ if (item.settingObj?.showSetting?.length) {
1253
+ showSetting = true;
1254
+ }
1255
+ // 这里wordbookValueList替换wordbookData 还是有点问题 需要根据具体场景再修改
1256
+ if (!showSetting && item.wordbookValueList?.length) {
1257
+ this.$set(item, 'wordbookData', item.wordbookValueList);
1258
+ }
1259
+ } else if (inRelation.includes(value)) {
1260
+ // 跨表查询
1261
+ item.showRelation = true;
1262
+ item.showInput = false;
1263
+ item.showSelect = false;
1264
+ item.showDate = false;
1265
+ item.showSearch = false;
1266
+ this.initBirthdayParams(item);
1267
+ } else if (attr == 'AGE') {
1268
+ if (ageList.includes(value)) {
1269
+ item.showAgeCom = true;
1270
+ }
1271
+ } else {
1272
+ item.showSelect = false;
1273
+ item.showDate = false;
1274
+ if (item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
1275
+ item.showInput = false;
1276
+ } else {
1277
+ item.showInput = true;
1278
+ }
1279
+ item.showSearch = false;
1280
+ item.showRelation = false;
1281
+ this.initBirthdayParams(item);
1282
+ }
1283
+
1284
+ if (!this.showCompareField) return;
1285
+
1286
+ let s_type = config?.type;
1287
+ if (s_type === '_custom__input_') return;
1288
+
1289
+ if (customTypes.includes(value) || (['NUMBER', 'DATE', 'DATETIME', 'TIME'].includes(item.fieldType) && numbercustoms.includes(value))) {
1290
+ this.$set(item, 'is_compare_field', true);
1291
+ this.$set(item, 'customInput', false);
1292
+ this.handleSetSelectList(item);
1293
+ if (Array.isArray(item.selectList)) {
1294
+ // 默认选中第一
1295
+ if (item.selectList.length > 1) {
1296
+ let [a] = item.selectList;
1297
+ let compare_val = isInitSet? item.compare_field || a.value : a.value;
1298
+ this.$set(item, 'compare_field', compare_val);
1299
+ setTimeout(() => {
1300
+ // 里面递归调用 selectChild ,异步等待,第一个方法执行完成
1301
+ this.compare_fieldOnChange(compare_val, item);
1302
+ }, 100);
1303
+ } else {
1304
+ let selectList = item?.selectList || [];
1305
+ let len = selectList?.length || 0;
1306
+ let onlyCustomInput = len === 1 ? selectList[0].value === '_custom__input_' : false;
1307
+ // selectList 只有一个选项并且 是 _custom__input_ ,隐藏 select ,展示 customInput
1308
+ if (onlyCustomInput) {
1309
+ this.$set(item, 'customInput', true);
1310
+ item.compare_field = '_custom__input_';
1311
+ return;
1312
+ }
1313
+ }
1314
+ }
1315
+
1316
+ if (isInitSet) {
1317
+ // 如果是 is_compare_field 字段 并有值compare_field
1318
+ if (config.is_compare_field && item.compare_field) {
1319
+ this.$set(item, 'is_compare_field', true);
1320
+ } else if (item.start_val || item.end_val || item.value || item.wordValue || item.showSelect) {
1321
+ // 自定义输入回填
1322
+ this.$set(item, 'customInput', true);
1323
+ item.compare_field = '_custom__input_';
1324
+ return;
1325
+ }
1326
+ }
1327
+ this.handleHideItem(item, false);
1328
+ } else {
1329
+ item.customInput = true;
1330
+ item.is_compare_field = false;
1331
+ item['compare_field'] && (item['compare_field'] = undefined);
1332
+ }
1333
+ },
1334
+ handleHideItem(item, reset = true) {
1335
+ item.showRangeAge = false; // 年龄范围
1336
+ item.showAgeCom = false; // 年龄范围
1337
+ item.showInput = false;
1338
+ item.showSelect = false;
1339
+ item.showDate = false;
1340
+ item.showSearch = false;
1341
+ item.showRelation = false;
1342
+
1343
+ // item.value = "";
1344
+ // this.$set(item, 'value', '');
1345
+ reset && this.$set(item, 'value', '');
1346
+ },
1347
+ disabledDatePicker(current, item, t){
1348
+ if(item.isIllegalField) return true
1349
+ let f = false;
1350
+ if(t=== 'start'){
1351
+ const end_val = item?.end_val;
1352
+ f = end_val && current.valueOf() > end_val.valueOf();
1353
+ } else if(t=== 'end') {
1354
+ const start_val = item?.start_val;
1355
+ f = start_val && current.valueOf() <= start_val.valueOf();
1356
+ }
1357
+ /**
1358
+ * 2 过去时间
1359
+ * 3 未来时间
1360
+ */
1361
+ let type = String(item?.advanceOptionSetting);
1362
+ if(!['2','3'].includes(type)) return f;
1363
+ if(type === '2'){
1364
+ return current >= moment().endOf('day') || f;
1365
+ } else if(type==='3'){
1366
+ return current && current < moment().startOf('day') || f;
1367
+ }
1368
+ return f
1369
+ },
1370
+ disabledStartDate(start_val) {
1371
+ const end_val = this.end_val;
1372
+ if (!start_val || !end_val) {
1373
+ return false;
1374
+ }
1375
+ return start_val.valueOf() > end_val.valueOf();
1376
+ },
1377
+ disabledEndDate(end_val) {
1378
+ const start_val = this.start_val;
1379
+ if (!end_val || !start_val) {
1380
+ return false;
1381
+ }
1382
+ return start_val.valueOf() >= end_val.valueOf();
1383
+ },
1384
+ handleStartOpenChange(open, item) {
1385
+ if (!open) {
1386
+ this.$set(item, 'endOpen', true);
1387
+ }
1388
+ },
1389
+ handleEndOpenChange(open, item) {
1390
+ this.$set(item, 'endOpen', open);
1391
+ },
1392
+ // 日期选择范围
1393
+ disabledDate(current) {
1394
+ return (current && current < moment().startOf('year')) || current > moment().endOf('year');
1395
+ },
1396
+ changeRange(value, item) {
1397
+ let res = [];
1398
+ if (value.length > 0) {
1399
+ value.forEach(item => {
1400
+ item._d && res.push(utils.formatTime('MOUTH', item._d));
1401
+ });
1402
+ }
1403
+ if (res.length > 0) {
1404
+ item.curlimit_date = res.join('~');
1405
+ }
1406
+ },
1407
+ // 选择关联表
1408
+ handlerSelectRelation(e, item) {
1409
+ let curItem = this.relationTableList.find(v => v.tableId === e);
1410
+ curItem && (item.relationField = curItem.relationField);
1411
+ item.relationFieldList = JSON.parse(JSON.stringify(curItem?.fieldList?.fieldList || []));
1412
+ item.converFun = curItem.converFun || undefined;
1413
+ item.parameterConversionId = curItem.parameterConversionId || undefined;
1414
+ item.relationOrgId = curItem.relationOrgId || undefined;
1415
+ item.preConObj = curItem.preConObj || undefined;
1416
+ item.preSqlExpression = curItem.preSqlExpression || undefined;
1417
+ },
1418
+ openRelationFilter(data, i) {
1419
+ this.clcikRelationIndex = i;
1420
+ this.relationAction = data.quote_con;
1421
+ this.relationSearchFieldList = data.relationFieldList;
1422
+ this.relationVisible = true;
1423
+ // sqlExpression
1424
+ },
1425
+ relationCancel() {
1426
+ this.relationVisible = false;
1427
+ this.relationAction = {};
1428
+ this.relationSearchFieldList = [];
1429
+ },
1430
+ relationSave(data) {
1431
+ let { setting = '' } = data;
1432
+ let settingObj = JSON.parse(setting);
1433
+ this.actionList[this.clcikRelationIndex].quote_con = {
1434
+ conObj: settingObj.conObj,
1435
+ sqlExpression: settingObj.sqlExpression
1436
+ };
1437
+ this.relationCancel();
1438
+ },
1439
+ initBirthdayParams(item) {
1440
+ item.showBirthdayDate = false;
1441
+ item.unit = item.unit || 'YEAR';
1442
+ item.units = this.birthdayUnits.filter(i => i.units === 1);
1443
+ },
1444
+ handleParentNamesAdd(e) {
1445
+ const nextInput = e?.target?.nextElementSibling;
1446
+ setTimeout(() => {
1447
+ nextInput && nextInput.focus();
1448
+ });
1449
+ this.showAdd = true;
1450
+ },
1451
+ hanldeBlur() {
1452
+ this.showAdd = false;
1453
+ if (!this.addVal) return;
1454
+ this.parentNames.forEach(v => (v.selected = false));
1455
+ this.parentNames.push({
1456
+ disabled: true,
1457
+ value: this.addVal,
1458
+ selected: true,
1459
+ isAdd: true
1460
+ });
1461
+ this.addVal = '';
1462
+ },
1463
+ editParentName(e, item) {
1464
+ item.disabled = false;
1465
+ setTimeout(() => {
1466
+ e.target.focus();
1467
+ }, 0);
1468
+ },
1469
+ handleParentNameSelect(item, index) {
1470
+ if (!item.disabled) return;
1471
+ this.parentNames.forEach((pItem, pIndex) => {
1472
+ if (pIndex !== index) {
1473
+ pItem.selected = false;
1474
+ }
1475
+ });
1476
+ item.selected = !item.selected;
1477
+ },
1478
+ handleParentNamesRemove(index, item) {
1479
+ // this.parentNames.splice(index, 1);
1480
+ this.handleParent(index, item);
1481
+ },
1482
+ handleParent(index, item) {
1483
+ let { conditionList } = this;
1484
+ if (!conditionList || !conditionList.length) {
1485
+ this.parentNames.splice(index, 1);
1486
+ return;
1487
+ }
1488
+ let hasItem = conditionList.filter(v => v.displayCategory === item.value);
1489
+ if (!hasItem || !hasItem.length) {
1490
+ this.parentNames.splice(index, 1);
1491
+ return;
1492
+ }
1493
+ this.$message.error('该分类下有已有数据,请删除该分类下的筛选集后重试!');
1494
+ },
1495
+ getParentSelectedStyle(item) {
1496
+ if (item.selected && item.disabled) {
1497
+ return {
1498
+ backgroundColor: '#2D7AFF',
1499
+ color: '#fff'
1500
+ };
1501
+ }
1502
+ return null;
1503
+ },
1504
+
1505
+ // 年龄组件变化
1506
+ ageRangeOnChange(obj, item) {
1507
+ let s = obj.star_val;
1508
+ let e = obj.end_val;
1509
+ this.$set(item, 'start_val', isNaN(s) ? undefined : s);
1510
+ this.$set(item, 'end_val', isNaN(e) ? undefined : e);
1511
+ },
1512
+
1513
+ agecomOnChange(obj, item) {
1514
+ this.$set(item, 'value', isNaN(obj.days) ? undefined : obj.days);
1515
+ },
1516
+
1517
+ diffTime(days) {
1518
+ let d = +days;
1519
+ if (isNaN(d)) return {};
1520
+ if (typeof d == 'number') {
1521
+ let next = 0;
1522
+ let year = Math.floor(d / 365);
1523
+ next = d % 365;
1524
+ let month = Math.floor(next / 30);
1525
+ next = next % 30;
1526
+ let day = next;
1527
+
1528
+ return { year, month, day, d };
1529
+ }
1530
+ return {};
1531
+ },
1532
+
1533
+ filterOption(...arg) {
1534
+ return utils.filterOption(...arg);
1535
+ },
1536
+
1537
+ /**
1538
+ * 选中字段
1539
+ */
1540
+ handleSetSelectList(item) {
1541
+ let list = this.searchList
1542
+ .filter(v => v.fieldType == item.fieldType && (this.isBI ? v.fieldId : v.columnName) != item.field_key)
1543
+ .map(v => {
1544
+ return {
1545
+ value: this.isBI ? v.fieldId : v.columnName,
1546
+ name: v.alias || v.title
1547
+ };
1548
+ });
1549
+
1550
+ list.unshift({
1551
+ value: '_custom__input_',
1552
+ name: '自定义输入'
1553
+ });
1554
+
1555
+ this.$set(item, 'selectList', list);
1556
+ },
1557
+
1558
+ /**
1559
+ * 切换字段选项
1560
+ */
1561
+ compare_fieldOnChange(e, item) {
1562
+ if (e === '_custom__input_') {
1563
+ item.customInput = true;
1564
+ this.selectChild(item.con, item, false, { type: '_custom__input_' });
1565
+ } else {
1566
+ item.customInput = false;
1567
+ this.$set(item, 'value', '');
1568
+ }
1569
+ },
1570
+
1571
+ checkCustomInput(item) {
1572
+ /**
1573
+ * 判断可选的 是否 只有 “_custom__input_”
1574
+ */
1575
+ let selectList = item?.selectList || [];
1576
+ let len = selectList?.length || 0;
1577
+ let onlyCustomInput = len === 1 ? selectList[0].value === '_custom__input_' : false;
1578
+ return onlyCustomInput;
1579
+ },
1580
+
1581
+ visibleCompareField(item) {
1582
+ if (!this.showCompareField) return false;
1583
+ let onlyCustomInput = this.checkCustomInput(item);
1584
+ /**
1585
+ * 展示 compare_field 条件
1586
+ * 1. 是is_compare_field 字段 并且有字段可选
1587
+ */
1588
+ return item.is_compare_field && !onlyCustomInput;
1589
+ },
1590
+
1591
+ visibleDefaultField(item) {
1592
+ /**
1593
+ * 展示默认字段的条件
1594
+ * 1. 非 is_compare_field 字段
1595
+ * 2. 是 is_compare_field 字段,选中 自定义输入 is_compare_field
1596
+ * 3. 是 is_compare_field 字段 ,没有可选的 onlyCustomInput
1597
+ */
1598
+ if (!this.showCompareField) return true;
1599
+ let onlyCustomInput = this.checkCustomInput(item);
1600
+ return item.customInput || !item.is_compare_field || onlyCustomInput;
1601
+ },
1602
+
1603
+ handleHideCompareField(item) {
1604
+ if (!this.showCompareField) return;
1605
+ item.customInput = false;
1606
+ item.is_compare_field = false;
1607
+ item.compare_field = undefined;
1608
+ },
1609
+
1610
+ checkActionList() {
1611
+ let f = this.actionList.every(v => !v.field_key);
1612
+ return f;
1613
+ },
1614
+
1615
+ /**
1616
+ * select 变化
1617
+ */
1618
+ fieldselectONchange(item, eventName, value, vnode) {
1619
+ // 清空操作
1620
+ if (value === undefined) {
1621
+ eventName === 'changeColumnName' && this.handleResetColumnName(item);
1622
+ eventName === 'selectChild' && this.handleResetSelectChild(item);
1623
+ }
1624
+
1625
+ // 有改变去掉“兼容”的值
1626
+ item.is_compatibility = undefined;
1627
+ item.compatibility_con = undefined;
1628
+ },
1629
+
1630
+ handleResetColumnName(item) {
1631
+ item.con = undefined;
1632
+ this.$set(item, 'wordValue', []);
1633
+ this.$set(item, 'wordbookData', []);
1634
+ this.handleHideItem(item);
1635
+ },
1636
+
1637
+ handleResetSelectChild(item) {
1638
+ this.$set(item, 'wordValue', []);
1639
+ // this.$set(item, 'wordbookData', []);
1640
+ this.$set(item, 'value', undefined);
1641
+ this.$set(item, 'showSelect', undefined);
1642
+ this.$set(item, 'start_val', null);
1643
+ this.$set(item, 'end_val', null);
1644
+ this.handleHideItem(item);
1645
+ },
1646
+
1647
+ checkItem(item){
1648
+ /**
1649
+ * 这是兼容处理
1650
+ * 场景:admin 配置的映射数据,配置了“自定义输入”,期望能正常展示。
1651
+ */
1652
+ if(['copy','edit'].includes(this.fromType)){
1653
+ let f = item.is_compare_field && this.showCompareField && item.compare_field === '_custom__input_';
1654
+ // 复制模式,回填是“自定义输入”,但不支持“自定义输入”的类型
1655
+ let isArr = Array.isArray(item.searchChildList);
1656
+ if(f && isArr){
1657
+ let con = item.searchChildList.find(v=> v.name == item.con);
1658
+ // 该字段关系没有该类型
1659
+ if(!con){
1660
+ // 缓存 con 值
1661
+ item.compatibility_con = item.con;
1662
+ // 从默认关系中查找“关系”
1663
+ let defCon = this.searchChildList.find(v=> v.name === item.con);
1664
+ item.con = defCon?.desc || item.compatibility_con;
1665
+ // 兼容模式标识
1666
+ this.$set(item, 'is_compatibility', true)
1667
+ }
1668
+ }
1669
+ }
1670
+ }
1671
+ }
1672
+ });
1673
+ </script>
1674
+
1675
+ <style lang="less" scoped>
1676
+ .inner-content {
1677
+ color: #000;
1678
+ & > p > span {
1679
+ cursor: pointer;
1680
+ }
1681
+ .item-name {
1682
+ display: flex;
1683
+ height: 32px;
1684
+ line-height: 32px;
1685
+ margin-bottom: 10px;
1686
+ .label {
1687
+ width: 120px;
1688
+ text-align: right;
1689
+ }
1690
+ }
1691
+ .parent-names {
1692
+ display: flex;
1693
+ align-items: center;
1694
+ flex-wrap: wrap;
1695
+ line-height: 32px;
1696
+ .label {
1697
+ display: inline-block;
1698
+ height: 32px;
1699
+ line-height: 32px;
1700
+ margin-bottom: 10px;
1701
+ width: 120px;
1702
+ text-align: right;
1703
+ }
1704
+ /deep/ .ant-btn-dashed {
1705
+ border-color: #a6a6a6;
1706
+ color: #a6a6a6;
1707
+ }
1708
+
1709
+ .edit-tag {
1710
+ position: relative;
1711
+ margin-right: 10px;
1712
+ margin-bottom: 10px;
1713
+ /deep/ .anticon-close {
1714
+ position: absolute;
1715
+ right: 5px;
1716
+ line-height: 36px;
1717
+ color: #2d7aff;
1718
+ }
1719
+ /deep/ .ant-input-disabled {
1720
+ color: #2d7aff;
1721
+ background-color: rgba(45, 122, 255, 0.1);
1722
+ opacity: 1;
1723
+ border-color: #2d7aff;
1724
+ cursor: pointer;
1725
+ }
1726
+ /deep/.ant-input-group-addon,
1727
+ /deep/.ant-input:not(:hover),
1728
+ /deep/.ant-input-number:not(:hover) {
1729
+ border-color: #2d7aff !important;
1730
+ }
1731
+ &.edit-tag-select {
1732
+ /deep/ .ant-input-disabled {
1733
+ color: #fff;
1734
+ background-color: #2d7aff;
1735
+ }
1736
+ /deep/ .anticon-close {
1737
+ color: #fff;
1738
+ }
1739
+ }
1740
+ }
1741
+ /deep/ .ant-btn {
1742
+ margin-bottom: 10px;
1743
+ }
1744
+ }
1745
+ .item-list {
1746
+ padding-top: 12px;
1747
+ margin-top: 16px;
1748
+ margin-bottom: 6px;
1749
+ border-top: 1px solid #e6e6e6;
1750
+ &.list-onlyCondition {
1751
+ padding-top: 0;
1752
+ border-top: 0px;
1753
+ }
1754
+ li {
1755
+ margin-bottom: 10px;
1756
+ }
1757
+ .form-item {
1758
+ width: 120px;
1759
+ margin-right: 10px;
1760
+ }
1761
+ .form-action {
1762
+ font-size: 16px;
1763
+ float: right;
1764
+ margin-top: 6px;
1765
+ cursor: pointer;
1766
+ }
1767
+ .date-item {
1768
+ display: inline-block;
1769
+ }
1770
+ .birthday-item {
1771
+ > div {
1772
+ display: inline-block;
1773
+ margin-top: 5px;
1774
+ p {
1775
+ display: inline-block;
1776
+ margin: 0 10px 0 15px;
1777
+ }
1778
+ > span {
1779
+ margin-top: 5px;
1780
+ }
1781
+ }
1782
+ .age-wrap {
1783
+ display: inline-block;
1784
+ }
1785
+ }
1786
+ .relation-item {
1787
+ display: inline-block;
1788
+ .relation-width {
1789
+ width: 150px;
1790
+ margin-right: 10px;
1791
+ }
1792
+ .relation-btn {
1793
+ cursor: pointer;
1794
+ }
1795
+ }
1796
+ .range-container {
1797
+ display: inline-block;
1798
+ width: 442px;
1799
+ /* line-height: 1.5; */
1800
+ vertical-align: bottom;
1801
+ }
1802
+ .item-error {
1803
+ color: red;
1804
+ display: inline-block;
1805
+ }
1806
+ }
1807
+ .index-span {
1808
+ width: 30px;
1809
+ display: inline-block;
1810
+ }
1811
+ }
1812
+ .blue {
1813
+ color: #2d7aff;
1814
+ margin-right: 8px;
1815
+ }
1816
+ .red {
1817
+ color: #e02020;
1818
+ }
1819
+
1820
+ .in-block {
1821
+ display: inline-block;
1822
+ }
1823
+ </style>
1824
+
1825
+ <style lang="less">
1826
+ // 专业模式下的样式修改
1827
+ ._c_com-search-professional {
1828
+ .inner-content {
1829
+ .item-list {
1830
+ > li {
1831
+ position: relative;
1832
+ .def_item_input {
1833
+ position: absolute;
1834
+ width: 100%;
1835
+ }
1836
+ .show-small-select {
1837
+ .val-small-select-wrap {
1838
+ width: 66px !important;
1839
+ }
1840
+ .val-input-wrap {
1841
+ width: 34% !important;
1842
+ }
1843
+ }
1844
+ }
1845
+ }
1846
+
1847
+ .item-error {
1848
+ display: block;
1849
+ padding-left: 29px;
1850
+ }
1851
+ .form-action {
1852
+ position: absolute;
1853
+ right: 0px;
1854
+ top: 0;
1855
+ }
1856
+ }
1857
+
1858
+ .select-front-item {
1859
+ width: 23% !important;
1860
+ }
1861
+ .val-input-wrap {
1862
+ width: 42%;
1863
+ display: inline-block;
1864
+ .ant-input {
1865
+ width: 100% !important;
1866
+ }
1867
+ }
1868
+ .val-select-wrap,
1869
+ .val-age-wrap,
1870
+ .val-date-wrap {
1871
+ width: 42% !important;
1872
+
1873
+ .ant-calendar-picker {
1874
+ width: 50% !important;
1875
+ }
1876
+ }
1877
+
1878
+ .val-range-wrap {
1879
+ width: 42% !important;
1880
+ .ant-input-group {
1881
+ .age-com {
1882
+ // 年龄组件 单位
1883
+ .age-com-suffix {
1884
+ padding: 0 1px;
1885
+ }
1886
+ .ant-input-number {
1887
+ // 修改宽度
1888
+ width: 100%;
1889
+ // 隐藏数字操作项
1890
+ .ant-input-number-handler-wrap {
1891
+ display: none;
1892
+ }
1893
+ // 修改inputpadding
1894
+ .ant-input-number-input-wrap {
1895
+ input {
1896
+ padding: 0 2px;
1897
+ }
1898
+ }
1899
+ }
1900
+ }
1901
+ }
1902
+ }
1903
+ .teavalue-wrap {
1904
+ width: calc(88% + 20px);
1905
+ }
1906
+ }
1907
+ </style>