cnhis-design-vue 2.1.56 → 2.1.58

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 (574) hide show
  1. package/.prettierrc.js +27 -27
  2. package/CHANGELOG.md +2653 -2551
  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 +308 -308
  15. package/es/breadcrumb/index.js +8 -8
  16. package/es/button/index.js +31 -31
  17. package/es/calendar/index.js +8 -8
  18. package/es/captcha/index.js +7 -7
  19. package/es/card/index.js +8 -8
  20. package/es/carousel/index.js +8 -8
  21. package/es/cascader/index.js +8 -8
  22. package/es/checkbox/index.js +17 -17
  23. package/es/col/index.js +8 -8
  24. package/es/collapse/index.js +8 -8
  25. package/es/color-picker/index.js +5 -5
  26. package/es/comment/index.js +8 -8
  27. package/es/config-provider/index.js +8 -8
  28. package/es/date-picker/index.js +30 -30
  29. package/es/descriptions/index.js +8 -8
  30. package/es/divider/index.js +8 -8
  31. package/es/drag-layout/index.js +5 -5
  32. package/es/drawer/index.js +8 -8
  33. package/es/dropdown/index.js +8 -8
  34. package/es/editor/index.js +1 -1
  35. package/es/ellipsis/index.js +3211 -0
  36. package/es/ellipsis/style.css +1 -0
  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 +1623 -422
  42. package/es/form-table/style.css +1 -1
  43. package/es/grid/index.js +4 -4
  44. package/es/index/index.js +2599 -1411
  45. package/es/index/style.css +1 -1
  46. package/es/input/index.js +11 -11
  47. package/es/input-number/index.js +8 -8
  48. package/es/keep-cache/index.js +9 -9
  49. package/es/layout/index.js +8 -8
  50. package/es/list/index.js +8 -8
  51. package/es/locale-provider/index.js +8 -8
  52. package/es/map/index.js +13 -13
  53. package/es/mentions/index.js +8 -8
  54. package/es/menu/index.js +8 -8
  55. package/es/message/index.js +8 -8
  56. package/es/multi-chat/index.js +116 -116
  57. package/es/multi-chat-client/index.js +110 -110
  58. package/es/multi-chat-history/index.js +6 -6
  59. package/es/multi-chat-record/index.js +27 -27
  60. package/es/multi-chat-setting/index.js +43 -43
  61. package/es/multi-chat-sip/index.js +1 -1
  62. package/es/notification/index.js +8 -8
  63. package/es/page-header/index.js +8 -8
  64. package/es/pagination/index.js +8 -8
  65. package/es/popconfirm/index.js +8 -8
  66. package/es/popover/index.js +8 -8
  67. package/es/progress/index.js +8 -8
  68. package/es/radio/index.js +17 -17
  69. package/es/rate/index.js +8 -8
  70. package/es/result/index.js +8 -8
  71. package/es/row/index.js +8 -8
  72. package/es/scale-container/index.js +3361 -0
  73. package/es/scale-container/style.css +1 -0
  74. package/es/scale-view/index.js +158 -158
  75. package/es/select/index.js +83 -70
  76. package/es/select/style.css +1 -1
  77. package/es/select-label/index.js +50 -50
  78. package/es/select-person/index.js +20 -20
  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 +251 -238
  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 +5011 -1618
  105. package/lib/cui.umd.js +5011 -1618
  106. package/lib/cui.umd.min.js +63 -57
  107. package/package.json +110 -108
  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 +3144 -3144
  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 +385 -385
  132. package/packages/big-table/src/assets/style/table-global.less +175 -175
  133. package/packages/big-table/src/components/AutoLayoutButton.vue +279 -279
  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 +189 -189
  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 +103 -103
  171. package/packages/big-table/src/utils/format.js +557 -557
  172. package/packages/big-table/src/utils/nestTable.js +109 -109
  173. package/packages/big-table/src/utils/tableParse.js +234 -234
  174. package/packages/breadcrumb/index.js +21 -21
  175. package/packages/breadcrumb/src/Breadcrumb.jsx +11 -11
  176. package/packages/breadcrumb/src/BreadcrumbItem.jsx +11 -11
  177. package/packages/breadcrumb/src/BreadcrumbSeparator.jsx +11 -11
  178. package/packages/button/index.js +21 -21
  179. package/packages/button/src/Button.jsx +11 -11
  180. package/packages/button/src/ButtonGroup.jsx +11 -11
  181. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  182. package/packages/button/src/ButtonPrint/index.vue +766 -766
  183. package/packages/button/src/ButtonPrint/mixin/his-print.js +95 -95
  184. package/packages/calendar/index.js +12 -12
  185. package/packages/calendar/src/Calendar.jsx +11 -11
  186. package/packages/captcha/index.js +9 -9
  187. package/packages/captcha/src/Captcha.vue +164 -164
  188. package/packages/captcha/src/Index.vue +47 -47
  189. package/packages/captcha/src/SlideVerify.vue +285 -285
  190. package/packages/card/index.js +21 -21
  191. package/packages/card/src/Card.jsx +12 -12
  192. package/packages/card/src/CardGrid.js +7 -7
  193. package/packages/card/src/CardMeta.js +7 -7
  194. package/packages/carousel/index.js +12 -12
  195. package/packages/carousel/src/Carousel.jsx +12 -12
  196. package/packages/cascader/index.js +12 -12
  197. package/packages/cascader/src/Cascader.jsx +11 -11
  198. package/packages/checkbox/index.js +30 -30
  199. package/packages/checkbox/src/Checkbox.jsx +11 -11
  200. package/packages/checkbox/src/CheckboxImg/index.vue +141 -141
  201. package/packages/checkbox/src/Group.jsx +11 -11
  202. package/packages/col/index.js +13 -13
  203. package/packages/col/src/Col.jsx +11 -11
  204. package/packages/collapse/index.js +18 -18
  205. package/packages/collapse/src/Collapse.jsx +11 -11
  206. package/packages/collapse/src/Panel.jsx +11 -11
  207. package/packages/color-picker/index.js +10 -10
  208. package/packages/color-picker/src/color-picker.vue +191 -191
  209. package/packages/color-picker/src/style.less +109 -109
  210. package/packages/comment/index.js +12 -12
  211. package/packages/comment/src/Comment.jsx +11 -11
  212. package/packages/config-provider/index.js +12 -12
  213. package/packages/config-provider/src/ConfigProvider.jsx +11 -11
  214. package/packages/date-picker/index.js +26 -26
  215. package/packages/date-picker/src/DatePicker.jsx +12 -12
  216. package/packages/date-picker/src/MonthPicker.jsx +11 -11
  217. package/packages/date-picker/src/RangePicker.jsx +11 -11
  218. package/packages/date-picker/src/WeekPicker.jsx +11 -11
  219. package/packages/date-picker/src/utils/index.js +374 -374
  220. package/packages/descriptions/index.js +18 -18
  221. package/packages/descriptions/src/Descriptions.jsx +11 -11
  222. package/packages/descriptions/src/Item.jsx +11 -11
  223. package/packages/divider/index.js +12 -12
  224. package/packages/divider/src/Divider.jsx +11 -11
  225. package/packages/drag-layout/DragFormLeftItem.vue +173 -173
  226. package/packages/drag-layout/DragFormRightItem.vue +284 -284
  227. package/packages/drag-layout/I18n-mixins.js +10 -10
  228. package/packages/drag-layout/drag-layout.vue +778 -778
  229. package/packages/drag-layout/index.js +12 -12
  230. package/packages/drawer/index.js +12 -12
  231. package/packages/drawer/src/Drawer.jsx +11 -11
  232. package/packages/dropdown/index.js +12 -12
  233. package/packages/dropdown/src/Dropdown.jsx +11 -11
  234. package/packages/editor/index.js +9 -9
  235. package/packages/ellipsis/index.js +9 -0
  236. package/packages/ellipsis/src/Ellipsis.vue +65 -0
  237. package/packages/empty/index.js +12 -12
  238. package/packages/empty/src/Empty.jsx +11 -11
  239. package/packages/fabric-chart/index.js +9 -9
  240. package/packages/fabric-chart/src/FabricGrid.vue +66 -66
  241. package/packages/fabric-chart/src/components/DropPopup.vue +90 -90
  242. package/packages/fabric-chart/src/components/MouseRightClick.vue +168 -168
  243. package/packages/fabric-chart/src/components/TimeScaleValue.vue +115 -115
  244. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  245. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +552 -552
  246. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1126 -1126
  247. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +134 -134
  248. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +566 -566
  249. package/packages/fabric-chart/src/mixins/fabricCommon.js +95 -95
  250. package/packages/fabric-chart/src/mixins/fabricObject.js +193 -193
  251. package/packages/fabric-chart/src/mixins/type.js +5 -5
  252. package/packages/form/index.js +16 -16
  253. package/packages/form/src/Form.jsx +11 -11
  254. package/packages/form/src/Item.jsx +11 -11
  255. package/packages/form-model/index.js +14 -14
  256. package/packages/form-model/src/FormModel.jsx +11 -11
  257. package/packages/form-model/src/Item.jsx +11 -11
  258. package/packages/form-table/index.js +16 -10
  259. package/packages/form-table/src/FormTable.vue +1110 -1110
  260. package/packages/form-table/src/components/table-component/config-data/index.js +80 -80
  261. package/packages/form-table/src/components/table-component/global-props.js +22 -22
  262. package/packages/form-table/src/components/table-component/index.js +8 -8
  263. package/packages/form-table/src/components/table-component/mixins/bound-date.js +455 -455
  264. package/packages/form-table/src/components/table-component/mixins/dateType.js +217 -217
  265. package/packages/form-table/src/components/table-component/mixins/item-default.js +257 -257
  266. package/packages/form-table/src/components/table-component/mixins/search.js +1242 -1228
  267. package/packages/form-table/src/components/table-component/register-com.js +30 -30
  268. package/packages/form-table/src/components/table-component/table-age/table-age.vue +175 -175
  269. package/packages/form-table/src/components/table-component/table-date-picker/table-date-picker.vue +87 -87
  270. package/packages/form-table/src/components/table-component/table-digital/table-digital.vue +93 -93
  271. package/packages/form-table/src/components/table-component/table-input/table-input.vue +81 -81
  272. package/packages/form-table/src/components/table-component/table-input-password/table-input-password.vue +126 -126
  273. package/packages/form-table/src/components/table-component/table-month-picker/table-month-picker.vue +55 -55
  274. package/packages/form-table/src/components/table-component/table-search/table-search.vue +174 -128
  275. package/packages/form-table/src/components/table-component/table-search-more/table-search-more.vue +191 -144
  276. package/packages/form-table/src/components/table-component/table-select/table-select.vue +64 -64
  277. package/packages/form-table/src/components/table-component/table-select-multiple/table-select-multiple.vue +81 -81
  278. package/packages/form-table/src/components/table-component/table-textarea/table-textarea.vue +76 -76
  279. package/packages/form-table/src/components/table-component/table-time-picker/table-time-picker.vue +55 -55
  280. package/packages/form-table/src/components/table-component/table-tree-select/table-tree-select.vue +135 -135
  281. package/packages/form-table/src/components/table-component/text-over-tooltip/TextOverTooltip.vue +97 -97
  282. package/packages/form-table/src/components/table-item/form-event.js +81 -81
  283. package/packages/form-table/src/components/table-item/global-props.js +27 -27
  284. package/packages/form-table/src/components/table-item/index.js +4 -4
  285. package/packages/form-table/src/components/table-item/render-methods.js +28 -28
  286. package/packages/form-table/src/components/table-item/validate-rules.js +520 -520
  287. package/packages/form-table/src/components/table-mixins/form-commom.js +98 -98
  288. package/packages/form-table/src/components/table-mixins/index.js +3 -3
  289. package/packages/form-table/src/components/table-utils/index.js +112 -112
  290. package/packages/form-table/src/disabledDetail.less +46 -46
  291. package/packages/grid/index.js +10 -10
  292. package/packages/grid/src/grid.js +28 -28
  293. package/packages/icon/index.js +10 -10
  294. package/packages/icon/src/icon.js +13 -13
  295. package/packages/index.js +313 -307
  296. package/packages/input/index.js +30 -30
  297. package/packages/input/src/Group.jsx +11 -11
  298. package/packages/input/src/Input.jsx +11 -11
  299. package/packages/input/src/Password.jsx +11 -11
  300. package/packages/input/src/Search.jsx +11 -11
  301. package/packages/input/src/TextArea.jsx +11 -11
  302. package/packages/input/src/input-quick/components/quick-item.vue +284 -284
  303. package/packages/input/src/input-quick/components/quick-popover.vue +596 -596
  304. package/packages/input/src/input-quick/index.vue +137 -137
  305. package/packages/input-number/index.js +12 -12
  306. package/packages/input-number/src/InputNumber.jsx +11 -11
  307. package/packages/keep-cache/KeepCache.js +236 -236
  308. package/packages/keep-cache/index.css +2 -2
  309. package/packages/keep-cache/index.js +8 -8
  310. package/packages/layout/index.js +27 -27
  311. package/packages/layout/src/Content.jsx +11 -11
  312. package/packages/layout/src/Footer.jsx +11 -11
  313. package/packages/layout/src/Header.jsx +11 -11
  314. package/packages/layout/src/Layout.jsx +11 -11
  315. package/packages/layout/src/Sider.jsx +11 -11
  316. package/packages/list/index.js +21 -21
  317. package/packages/list/src/Item.jsx +11 -11
  318. package/packages/list/src/ItemMeta.jsx +11 -11
  319. package/packages/list/src/List.jsx +11 -11
  320. package/packages/locale-provider/index.js +12 -12
  321. package/packages/locale-provider/src/LocaleProvider.jsx +11 -11
  322. package/packages/map/index.js +9 -9
  323. package/packages/map/src/Map.vue +484 -484
  324. package/packages/map/src/popup-map.vue +53 -53
  325. package/packages/mentions/index.js +18 -18
  326. package/packages/mentions/src/Mentions.jsx +11 -11
  327. package/packages/mentions/src/Option.jsx +11 -11
  328. package/packages/menu/index.js +27 -27
  329. package/packages/menu/src/Divider.jsx +11 -11
  330. package/packages/menu/src/Item.jsx +11 -11
  331. package/packages/menu/src/ItemGroup.jsx +11 -11
  332. package/packages/menu/src/Menu.jsx +11 -11
  333. package/packages/menu/src/SubMenu.jsx +11 -11
  334. package/packages/message/index.js +8 -8
  335. package/packages/modal/index.js +10 -10
  336. package/packages/modal/src/Modal.js +7 -7
  337. package/packages/multi-chat/chat/addConference.vue +200 -200
  338. package/packages/multi-chat/chat/addMembers.vue +411 -411
  339. package/packages/multi-chat/chat/advancedFilter.vue +372 -372
  340. package/packages/multi-chat/chat/calling.vue +246 -246
  341. package/packages/multi-chat/chat/chatFooter.vue +1596 -1596
  342. package/packages/multi-chat/chat/chatHistory.vue +605 -605
  343. package/packages/multi-chat/chat/chatMain.vue +1486 -1486
  344. package/packages/multi-chat/chat/client/index.vue +149 -149
  345. package/packages/multi-chat/chat/delay.vue +177 -177
  346. package/packages/multi-chat/chat/evaluate.vue +343 -343
  347. package/packages/multi-chat/chat/messageRecord.vue +324 -324
  348. package/packages/multi-chat/chat/mixins/NoData.js +20 -20
  349. package/packages/multi-chat/chat/mixins/base.js +97 -97
  350. package/packages/multi-chat/chat/mixins/uniRTCAPI.js +80 -80
  351. package/packages/multi-chat/chat/mixins/viewerOptions.js +67 -67
  352. package/packages/multi-chat/chat/quickReply.vue +439 -439
  353. package/packages/multi-chat/chat/robot/index.vue +312 -312
  354. package/packages/multi-chat/chat/scrollList.vue +1238 -1238
  355. package/packages/multi-chat/chat/videoVoiceList.vue +348 -348
  356. package/packages/multi-chat/chat/voice.vue +431 -431
  357. package/packages/multi-chat/components/avatar.vue +113 -113
  358. package/packages/multi-chat/components/chat-tabs-header.vue +251 -251
  359. package/packages/multi-chat/components/classify-tabs.vue +185 -185
  360. package/packages/multi-chat/components/empty.vue +24 -24
  361. package/packages/multi-chat/components/modal-refuse-reason.vue +112 -112
  362. package/packages/multi-chat/components/modal-sip.vue +160 -160
  363. package/packages/multi-chat/components/modal-user-transfer.vue +98 -98
  364. package/packages/multi-chat/components/msg-describe.vue +138 -138
  365. package/packages/multi-chat/components/msg-picture.vue +68 -68
  366. package/packages/multi-chat/components/msg-prescription.vue +205 -205
  367. package/packages/multi-chat/components/read-record.vue +133 -133
  368. package/packages/multi-chat/components/read-status.vue +34 -34
  369. package/packages/multi-chat/components/user-status.vue +198 -198
  370. package/packages/multi-chat/index.js +7 -7
  371. package/packages/multi-chat/setting/authority/index.vue +156 -156
  372. package/packages/multi-chat/setting/authority/roleSetting.vue +204 -204
  373. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1316
  374. package/packages/multi-chat/setting/customerService/batchSelect.vue +403 -403
  375. package/packages/multi-chat/setting/customerService/index.vue +273 -273
  376. package/packages/multi-chat/setting/event/edit/condition.vue +128 -128
  377. package/packages/multi-chat/setting/event/edit/index.vue +437 -437
  378. package/packages/multi-chat/setting/event/edit/notice.vue +129 -129
  379. package/packages/multi-chat/setting/event/edit/strategy.vue +98 -98
  380. package/packages/multi-chat/setting/event/index.vue +249 -249
  381. package/packages/multi-chat/setting/index.vue +269 -269
  382. package/packages/multi-chat/setting/page.vue +14 -14
  383. package/packages/multi-chat/setting/sessionList/index.vue +412 -412
  384. package/packages/multi-chat/setting/sessionList/messageRecord.vue +372 -372
  385. package/packages/multi-chat/setting/userConfig/index.vue +124 -124
  386. package/packages/multi-chat/setting/worktime/index.vue +274 -274
  387. package/packages/multi-chat/store/actions.js +452 -452
  388. package/packages/multi-chat/store/getters.js +371 -371
  389. package/packages/multi-chat/store/helper.js +66 -66
  390. package/packages/multi-chat/store/index.js +50 -50
  391. package/packages/multi-chat/store/mutation.js +296 -296
  392. package/packages/multi-chat/store/state.js +117 -117
  393. package/packages/multi-chat/style/emoji.css +315 -315
  394. package/packages/multi-chat/style/message.mixin.less +38 -38
  395. package/packages/multi-chat/utils/chatSock.js +93 -93
  396. package/packages/multi-chat/utils/compressImage.js +115 -115
  397. package/packages/multi-chat/utils/emoji.json +68 -68
  398. package/packages/multi-chat/utils/index.js +259 -259
  399. package/packages/multi-chat/utils/observer-scroll.js +49 -49
  400. package/packages/multi-chat/utils/panelsetting.js +48 -48
  401. package/packages/multi-chat-client/index.js +7 -7
  402. package/packages/multi-chat-history/index.js +7 -7
  403. package/packages/multi-chat-record/index.js +7 -7
  404. package/packages/multi-chat-setting/index.js +7 -7
  405. package/packages/multi-chat-sip/index.js +6 -6
  406. package/packages/notification/index.js +8 -8
  407. package/packages/page-header/index.js +12 -12
  408. package/packages/page-header/src/PageHeader.jsx +11 -11
  409. package/packages/pagination/index.js +12 -12
  410. package/packages/pagination/src/Pagination.jsx +11 -11
  411. package/packages/popconfirm/index.js +12 -12
  412. package/packages/popconfirm/src/Popconfirm.jsx +11 -11
  413. package/packages/popover/index.js +12 -12
  414. package/packages/popover/src/Popover.jsx +11 -11
  415. package/packages/progress/index.js +12 -12
  416. package/packages/progress/src/Progress.jsx +11 -11
  417. package/packages/radio/index.js +33 -33
  418. package/packages/radio/src/Group.jsx +11 -11
  419. package/packages/radio/src/Radio.jsx +11 -11
  420. package/packages/radio/src/RadioButton.jsx +11 -11
  421. package/packages/radio/src/RadioImg/index.vue +124 -124
  422. package/packages/rate/index.js +12 -12
  423. package/packages/rate/src/Rate.jsx +11 -11
  424. package/packages/result/index.js +12 -12
  425. package/packages/result/src/Result.jsx +11 -11
  426. package/packages/row/index.js +12 -12
  427. package/packages/row/src/Row.jsx +11 -11
  428. package/packages/scale-container/index.js +9 -0
  429. package/packages/scale-container/src/ScaleContainer.vue +197 -0
  430. package/packages/scale-container/src/scale.png +0 -0
  431. package/packages/scale-view/NoData.vue +81 -81
  432. package/packages/scale-view/answerParse.vue +133 -133
  433. package/packages/scale-view/customList.vue +801 -801
  434. package/packages/scale-view/data.js +80 -80
  435. package/packages/scale-view/evaluateCountdown.vue +155 -155
  436. package/packages/scale-view/evaluatePage.vue +202 -202
  437. package/packages/scale-view/formitem/data.js +3991 -3991
  438. package/packages/scale-view/formitem/index.js +6 -6
  439. package/packages/scale-view/formitem/r-address.vue +238 -238
  440. package/packages/scale-view/formitem/r-choice.vue +726 -726
  441. package/packages/scale-view/formitem/r-input.vue +92 -92
  442. package/packages/scale-view/formitem/r-prompt.vue +52 -52
  443. package/packages/scale-view/formitem/r-time.vue +285 -285
  444. package/packages/scale-view/formitem/r-upload-custom-list.vue +242 -242
  445. package/packages/scale-view/formitem/r-upload.vue +287 -287
  446. package/packages/scale-view/formitem/text-over-tooltip/TextOverTooltip.vue +98 -98
  447. package/packages/scale-view/index.js +17 -17
  448. package/packages/scale-view/mixin/NoData.js +38 -38
  449. package/packages/scale-view/mixin/evaluate.js +146 -146
  450. package/packages/scale-view/mixin/index.js +337 -337
  451. package/packages/scale-view/mixin/judgeTypes.js +267 -267
  452. package/packages/scale-view/scaleView.vue +2010 -2010
  453. package/packages/select/index.js +27 -27
  454. package/packages/select/src/CustomSelect/index.vue +130 -130
  455. package/packages/select/src/OptGroup.jsx +11 -11
  456. package/packages/select/src/Option.jsx +11 -11
  457. package/packages/select/src/Select/Select.vue +231 -231
  458. package/packages/select/src/Select/index.js +12 -12
  459. package/packages/select/src/TableSelect/index.vue +514 -514
  460. package/packages/select-label/index.js +14 -14
  461. package/packages/select-label/label-classify.vue +129 -129
  462. package/packages/select-label/labelFormContent.vue +787 -787
  463. package/packages/select-label/select-label.vue +581 -581
  464. package/packages/select-person/index.js +10 -10
  465. package/packages/select-person/search-tree.vue +373 -373
  466. package/packages/select-person/select-person.vue +1696 -1696
  467. package/packages/shortcut-setter/index.js +12 -12
  468. package/packages/shortcut-setter/src/ShortcutSetter.vue +55 -55
  469. package/packages/shortcut-setter/src/ShortcutSetterItem.vue +84 -84
  470. package/packages/shortcut-setter/src/utils/index.js +63 -63
  471. package/packages/skeleton/index.js +12 -12
  472. package/packages/skeleton/src/Skeleton.jsx +11 -11
  473. package/packages/slider/index.js +12 -12
  474. package/packages/slider/src/Slider.jsx +11 -11
  475. package/packages/space/index.js +12 -12
  476. package/packages/space/src/Space.jsx +11 -11
  477. package/packages/spin/index.js +12 -12
  478. package/packages/spin/src/Spin.jsx +11 -11
  479. package/packages/statistic/index.js +18 -18
  480. package/packages/statistic/src/Countdown.jsx +11 -11
  481. package/packages/statistic/src/Statistic.jsx +11 -11
  482. package/packages/steps/index.js +18 -18
  483. package/packages/steps/src/Step.jsx +11 -11
  484. package/packages/steps/src/Steps.jsx +11 -11
  485. package/packages/switch/index.js +12 -12
  486. package/packages/switch/src/Switch.jsx +11 -11
  487. package/packages/table-filter/index.js +27 -27
  488. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2572 -2572
  489. package/packages/table-filter/src/classification/Classification-com.vue +1756 -1756
  490. package/packages/table-filter/src/classification/search-class-name.vue +266 -266
  491. package/packages/table-filter/src/classification/search-professional-model.vue +680 -680
  492. package/packages/table-filter/src/components/TextOverTooltip.vue +107 -107
  493. package/packages/table-filter/src/components/age-com/index.vue +205 -205
  494. package/packages/table-filter/src/components/button-group/ButtonGroup.vue +162 -162
  495. package/packages/table-filter/src/components/button-icon/button-icon.js +33 -33
  496. package/packages/table-filter/src/components/button-icon/getBtnIcon.js +34 -34
  497. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  498. package/packages/table-filter/src/components/drop-button/drop-button.vue +224 -224
  499. package/packages/table-filter/src/components/drop-button/head-btn-icon.js +33 -33
  500. package/packages/table-filter/src/components/drop-view/drop-view.vue +89 -89
  501. package/packages/table-filter/src/components/multi-select/multi-select.vue +227 -227
  502. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  503. package/packages/table-filter/src/components/range-age/index.vue +172 -172
  504. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +1897 -1897
  505. package/packages/table-filter/src/components/search-condition/fieldTypeList.js +169 -169
  506. package/packages/table-filter/src/components/search-filter/SearchFilter.vue +278 -278
  507. package/packages/table-filter/src/components/search-modal/set-classification.vue +310 -310
  508. package/packages/table-filter/src/components/table-modal/TableModal.vue +463 -463
  509. package/packages/table-filter/src/const/dataOptions.js +43 -43
  510. package/packages/table-filter/src/const/index.js +1 -1
  511. package/packages/table-filter/src/index.vue +584 -584
  512. package/packages/table-filter/src/mixins/mixins.js +694 -694
  513. package/packages/table-filter/src/mixins/tableSearchCon.js +128 -128
  514. package/packages/table-filter/src/mixins/wordBookutils.js +102 -102
  515. package/packages/table-filter/src/quick-search/QuickSearch.vue +2125 -2125
  516. package/packages/tabs/index.js +18 -18
  517. package/packages/tabs/src/TabPane.jsx +11 -11
  518. package/packages/tabs/src/Tabs.jsx +11 -11
  519. package/packages/tag/index.js +21 -21
  520. package/packages/tag/src/CheckableTag.jsx +11 -11
  521. package/packages/tag/src/Tag.jsx +11 -11
  522. package/packages/tag/src/TagGroup.vue +621 -621
  523. package/packages/time-picker/index.js +12 -12
  524. package/packages/time-picker/src/TimePicker.jsx +11 -11
  525. package/packages/timeline/index.js +14 -14
  526. package/packages/timeline/src/Item.jsx +11 -11
  527. package/packages/timeline/src/Timeline.jsx +11 -11
  528. package/packages/tooltip/index.js +12 -12
  529. package/packages/tooltip/src/Tooltip.jsx +11 -11
  530. package/packages/transfer/index.js +12 -12
  531. package/packages/transfer/src/Transfer.jsx +11 -11
  532. package/packages/tree/index.js +18 -18
  533. package/packages/tree/src/Tree.jsx +11 -11
  534. package/packages/tree/src/TreeNode.jsx +11 -11
  535. package/packages/tree-select/index.js +18 -18
  536. package/packages/tree-select/src/TreeNode.jsx +11 -11
  537. package/packages/tree-select/src/TreeSelect.jsx +11 -11
  538. package/packages/upload/chunk-upload/chunk-upload-new.vue +1001 -1001
  539. package/packages/upload/chunk-upload/vod-chunk-upload.vue +749 -749
  540. package/packages/upload/chunk-upload/vod-upload-modal.vue +100 -100
  541. package/packages/upload/index.js +12 -12
  542. package/packages/upload/src/Upload.jsx +11 -11
  543. package/packages/verification-code/SlideVerify.vue +306 -306
  544. package/packages/verification-code/index.js +17 -17
  545. package/packages/verification-code/verification-code.vue +147 -147
  546. package/src/assets/img/nodata.png +0 -0
  547. package/src/component/player-vod/index.vue +57 -57
  548. package/src/component/player-vod/player.vue +188 -188
  549. package/src/component/player-vod/video-list.vue +262 -262
  550. package/src/component/player-vod/video-modal.vue +128 -128
  551. package/src/component/select-options/index.vue +430 -0
  552. package/src/component/select-pages/index.vue +95 -74
  553. package/src/component/svg/index.vue +59 -59
  554. package/src/core/create.js +6 -6
  555. package/src/core/event.js +23 -23
  556. package/src/core/table-methods.js +444 -444
  557. package/src/directive/flexibleResize.js +151 -151
  558. package/src/directive/preventReClick.js +12 -12
  559. package/src/directive/scroll.js +230 -230
  560. package/src/global/variable.js +2 -2
  561. package/src/style/normalize.css +424 -424
  562. package/src/style/style.less +49 -49
  563. package/src/utils/UniRTCv2.js +626 -626
  564. package/src/utils/chatFetch.js +61 -61
  565. package/src/utils/clickoutside.js +75 -75
  566. package/src/utils/crypto.js +25 -25
  567. package/src/utils/index.js +81 -81
  568. package/src/utils/kty-sdk.js +582 -582
  569. package/src/utils/kty.min-1.0.0.js +14378 -14378
  570. package/src/utils/sip-device.js +79 -79
  571. package/src/utils/time-domain.js +193 -193
  572. package/src/utils/trtc.js +1 -1
  573. package/src/utils/utils-map.js +484 -484
  574. package/src/utils/vexutils.js +836 -836
@@ -1,2572 +1,2572 @@
1
- <template>
2
- <div class="base-search">
3
- <div class="base-container">
4
- <div class="bease-left" ref="baseLeft" v-resize="onResize">
5
- <!-- 行内编辑对应生成的(保存、取消)按钮 -->
6
- <template v-if="visibleInlineOperateBtn">
7
- <div class="btn-custom-wrap">
8
- <a-button
9
- v-preventReClick="preventReTime"
10
- :style="{ display: isInlineOperating ? 'inline-block' : 'none' }"
11
- @click="inlineEditClick"
12
- class="btn-custom-class"
13
- style="margin: 8px 8px 8px 0"
14
- type="primary"
15
- >
16
- 保存
17
- </a-button>
18
- <a-button
19
- v-preventReClick="preventReTime"
20
- :style="{ display: isInlineOperating ? 'inline-block' : 'none' }"
21
- @click="inlineEditCancel"
22
- class="btn-custom-class"
23
- style="margin: 8px 8px 8px 0"
24
- >
25
- 取消
26
- </a-button>
27
- </div>
28
- </template>
29
- <ul v-if="!visibleInlineOperateBtn && !isRowEditing">
30
- <div ref="btnRow" class="btn-row" v-if="isShowSettingBtn">
31
- <a-button class="btn-setting" v-show="currentTempId != '0' && isShowSetting('hideSettingBtn')" icon="setting" @click="handlerSetting">
32
- 设置
33
- <!-- {{ $t("1.1.5.3") }} -->
34
- </a-button>
35
- <a-dropdown overlayClassName="viewList-dropdown" v-if="showViewList">
36
- <a-button class="viewList-button">
37
- <svg-icon :icon-class="'anniuqiehuanmoshi'" style="font-size: 22px"></svg-icon>
38
- </a-button>
39
- <a-menu slot="overlay">
40
- <a-menu-item v-for="(item, index) in viewList" :value="item.id" :key="index" @click="handlerSelectTemp(item.id)" :class="{ 'menu-active': currentTempId === item.id }">
41
- <span>{{ item.name }}</span>
42
- <!-- <a-icon v-if="currentTempId === item.id" type="check" /> -->
43
- </a-menu-item>
44
- </a-menu>
45
- </a-dropdown>
46
- </div>
47
- <slot name="classification"></slot>
48
- <li v-if="showQuickSearch" ref="quickSearchLi">
49
- <a-button class="search-default" type="default" @click="foldQuickSearch">
50
- <svg-icon icon-class="anniushaixuan" style="color: #2463F4; margin-right: 6px"></svg-icon>
51
- 筛选 {{ qqConObjCount ? `(${qqConObjCount})` : '' }}
52
- </a-button>
53
- </li>
54
- <!-- start--筛选外显--start -->
55
- <template v-for="item in outSearchFieldList">
56
- <outQuickSearch :key="item.id + item.random_key" :item="item" :ref="item.columnName + item.random_key" :filterApiConfig="filterApiConfigOutSearch" @outFilterChange="outFilterChange"></outQuickSearch>
57
- </template>
58
- <!-- end--筛选外显--end -->
59
-
60
- <!-- start--筛选外显 跨表--start -->
61
- <template v-for="relationItem in outRelationQuickSearch">
62
- <template v-for="item in relationItem.fieldList">
63
- <outQuickSearch :key="item.id" :item="item" :filterApiConfig="filterApiConfigOutSearch" @outFilterChange="outFilterChange"></outQuickSearch>
64
- </template>
65
- </template>
66
- <!-- end--筛选外显 跨表--end -->
67
-
68
- <li v-if="isShowSetting('hideSearch') && !showRelatedTreeBtn" ref="inputSearchLi" class="baseSearch-input-search">
69
- <template v-if="outSearchFieldList && outSearchFieldList.length">
70
- <slot name="searchInput" :width="(searchInputWidth || inputSearchW)" :searchPlaceHolder="searchPlaceHolder" :showPlaceholderPrefix="showPlaceholderPrefix" :type="'outSearch'">
71
- <a-input
72
- :style="{ width: (searchInputWidth || inputSearchW) + 'px', margin: '0 8px 8px 0' }"
73
- allowClear
74
- :placeholder="searchPlaceHolder"
75
- :value="currentValue"
76
- @input="$emit('input', $event.target.value)"
77
- @pressEnter="outFilterChange"
78
- class="input-search-com"
79
- >
80
- <template slot="prefix" v-if="showPlaceholderPrefix">
81
- <a-tooltip :title="searchPlaceHolder" overlayClassName="basesearch-placeholder-tooltip">
82
- <a-icon type="info-circle" class="search-placeholder-icon" />
83
- </a-tooltip>
84
- </template>
85
- </a-input>
86
- </slot>
87
- </template>
88
-
89
- <template v-else>
90
- <slot name="searchInput" :width="(searchInputWidth || inputSearchW)" :searchPlaceHolder="searchPlaceHolder" :showPlaceholderPrefix="showPlaceholderPrefix" :type="'default'">
91
- <a-input-search
92
- class="my-input-search input-search-com"
93
- :style="{ width: (searchInputWidth || inputSearchW) + 'px' }"
94
- @search="onSearch"
95
- allowClear
96
- :placeholder="searchPlaceHolder"
97
- :value="currentValue"
98
- @input="$emit('input', $event.target.value)"
99
- >
100
- <template slot="prefix" v-if="showPlaceholderPrefix">
101
- <a-tooltip :title="searchPlaceHolder" overlayClassName="basesearch-placeholder-tooltip">
102
- <a-icon type="info-circle" class="search-placeholder-icon" />
103
- </a-tooltip>
104
- </template>
105
- <a-button slot="enterButton" type="primary">
106
- <svg-icon icon-class="xitongtubiaosousuo"></svg-icon>
107
- </a-button>
108
- </a-input-search>
109
- </slot>
110
- </template>
111
-
112
- </li>
113
- <li v-if="outSearchFieldList && outSearchFieldList.length">
114
- <a-button type="primary" @click="outFilterChange" style="margin: 0 8px 8px 0">
115
- <a-icon type="search" style="margin-right: 6px" />
116
- 查询
117
- </a-button>
118
- </li>
119
- <li v-if="showResetFilterBtn">
120
- <a-button @click="handleReset" style="margin: 0 8px 8px 0">
121
- <svg-icon icon-class="xitongtubiaoliebiaocaozuoanniushanchu" style="margin-right: 6px"></svg-icon>
122
- 重置
123
- </a-button>
124
- </li>
125
-
126
- <!-- 批量选择 -->
127
- <li v-if="isCard">
128
- <a-button v-if="isCardNewBatch" type="primary" @click="() =>changeCardNewBatch(false)" style="margin: 0 8px 8px 0">
129
- 取消批量选择
130
- </a-button>
131
- <a-button v-else type="primary" @click="() =>changeCardNewBatch(true)" style="margin: 0 8px 8px 0">
132
- 批量选择
133
- </a-button>
134
- </li>
135
-
136
- <!-- 平铺列表 tree -->
137
- <template v-if="showRelatedTreeBtn">
138
- <li v-if="showRelatedSearch" :class="[isRelatedSearchFold ? 'related-search-input' : 'related-search-input-expand']">
139
- <slot name="searchInput" :searchPlaceHolder="searchPlaceHolder" :showPlaceholderPrefix="showPlaceholderPrefix" :type="'relatedTreeSearch'" :isRelatedSearchFold="isRelatedSearchFold" >
140
- <a-input-search
141
- ref="relatedSearchInput"
142
- class="my-input-search my-input-search-related"
143
- placeholder="请输入关键字搜索"
144
- @search="onRelatedSearch"
145
- allowClear
146
- :value="currentValue"
147
- @input="$emit('input', $event.target.value)"
148
- >
149
- <a-button slot="enterButton" type="primary">
150
- <a-icon type="search" />
151
- <!-- <svg-icon icon-class="xitongtubiaosousuo"></svg-icon> -->
152
- </a-button>
153
- </a-input-search>
154
- </slot>
155
- </li>
156
- <template v-if="rowTileBtnListTree && rowTileBtnListTree.length === 1">
157
- <a-button type="primary" style="margin-right: 8px; margin-bottom: 8px" @click="handleAddType(rowTileBtnListTree[0])">
158
- {{ rowTileBtnListTree[0].alias || rowTileBtnListTree[0].name }}
159
- </a-button>
160
- </template>
161
- <a-dropdown v-if="rowTileBtnListTree.length > 1 && !isInlineOperating">
162
- <a-menu slot="overlay">
163
- <template v-for="b in rowTileBtnListTree">
164
- <a-menu-item :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="handleAddType(b)">
165
- {{ b.alias || b.name }}
166
- <a-icon v-if="b.icon" :type="btnObj[b.icon]" />
167
- <template v-else>
168
- <svg-icon
169
- v-if="b.iconSetting"
170
- :iconClass="JSON.parse(b.iconSetting).icon"
171
- :style="{
172
- marginRight: '8px'
173
- }"
174
- />
175
- </template>
176
- </a-menu-item>
177
- </template>
178
- </a-menu>
179
- <a-button type="primary" ghost style="margin-left: 8px; margin-bottom: 8px">
180
- <!-- 1.1.8.1.6更多 -->
181
- {{ '更多' }} ...
182
- </a-button>
183
- </a-dropdown>
184
- </template>
185
- <template v-if="!nobutton && !showRelatedTreeBtn">
186
- <template v-if="isButtonFolding">
187
- <li class="allBtn" v-if="allBtn && allBtn.length" ref="allBtnLi">
188
- <a-dropdown v-show="!isInlineOperating">
189
- <a-menu slot="overlay">
190
- <template v-for="(b, j) in allBtn">
191
- <a-menu-item :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="showDrawer(b, j)">
192
- {{ b.alias || b.name }}
193
- <getBtnIcon :data="b" :btnObj="btnObj" />
194
- </a-menu-item>
195
- <a-menu-item
196
- :key="b.sid"
197
- v-else-if="showButtonTop == 1 && b.type != 'LINK' && currentTempId == '0'"
198
- class="dropdown-btn"
199
- @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)"
200
- >
201
- {{ b.showStyle === 'only_icon' ? '' : b.alias || b.name }}
202
- <getBtnIcon :data="b" :btnObj="btnObj" />
203
- </a-menu-item>
204
- </template>
205
- </a-menu>
206
- <a-button class="ml12 dropdown-button"
207
- >{{ '更多' }}
208
- <a-icon type="down" />
209
- </a-button>
210
- </a-dropdown>
211
- </li>
212
- </template>
213
- <template v-else>
214
- <!-- start--按钮分组--start -->
215
- <template v-if="isShowGroupBtn">
216
- <template v-for="(key, i) in groupBtnObj">
217
- <li :key="i" v-if="key.list && key.list.length > 1" ref="rowTileBtnItem" :data-key="i" data-source="groupBtn">
218
- <ButtonGroup v-show="!key.isHide" :title="i" :list="key.list" :currentTempId="currentTempId" @showDrawer="showDrawer" @clickGroupBtn="clickGroupBtn"></ButtonGroup>
219
- </li>
220
- </template>
221
- </template>
222
- <!-- end--按钮分组--end -->
223
-
224
- <!-- 平铺按钮列表 -->
225
- <template v-for="(item, j) in rowTileBtnList">
226
- <!-- v-if="item.type == 'ADD'" -->
227
- <li ref="rowTileBtnItem" class="rowTileBtn-item 123" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
228
- <template v-if="item.type == 'ADD' || item.type == 'BATCH'">
229
- <a-button
230
- v-preventReClick="preventReTime"
231
- v-show="visibleBtn(item) && !item.isHide"
232
- @click.prevent.stop="showDrawer(item, j)"
233
- class="btn-custom-class"
234
- style="margin: 0 8px 8px 0"
235
- :style="$utils.getBtnStyle(item)"
236
- :type="item.showStyle == 'none_bg' || item.showStyle === 'only_icon' ? 'link' : 'primary'"
237
- :ghost="item.showStyle == 'white_bg'"
238
- >
239
- <getBtnIcon :data="item" :btnObj="btnObj" />
240
- <template v-if="item.showStyle !== 'only_icon'">
241
- {{ item.alias || item.name }}
242
- </template>
243
- </a-button>
244
- <a-upload v-if="item.isImportGuage" method="post" :show-upload-list="false" :action="`${axios.defaults.baseURL}/guage/importGuage`" @change="handleUploadChange">
245
- <!-- 上传配置文件 -->
246
- <a-button
247
- class="btn-custom-class"
248
- style="margin: 0 8px 8px 0"
249
- :style="$utils.getBtnStyle(item)"
250
- :type="item.showStyle == 'none_bg' || item.showStyle === 'only_icon' ? 'link' : 'primary'"
251
- :ghost="item.showStyle == 'white_bg'"
252
- >
253
- <a-icon type="upload" />
254
- <template v-if="item.showStyle !== 'only_icon'">
255
- {{ item.alias || item.name }}
256
- </template>
257
- </a-button>
258
- </a-upload>
259
- </template>
260
- <template v-else-if="isShowRowTileBtnItem(item)">
261
- <a-button
262
- v-preventReClick="preventReTime"
263
- v-show="visibleBtn(item) && !item.isHide"
264
- @click.prevent.stop="clickBtn(clickRowData, item, clickRowData.my_index, undefined, j)"
265
- class="btn-custom-class"
266
- style="margin: 0 8px 8px 0"
267
- :style="$utils.getBtnStyle(item)"
268
- :type="item.showStyle == 'none_bg' ? 'link' : 'primary'"
269
- :ghost="item.showStyle == 'white_bg'"
270
- >
271
- <getBtnIcon :data="item" :btnObj="btnObj" />
272
- <template v-if="item.showStyle !== 'only_icon'">
273
- {{ item.alias || item.name }}
274
- </template>
275
- </a-button>
276
- </template>
277
- </li>
278
- </template>
279
- <!-- 打印列表-->
280
- <template v-for="(item, j) in rowPrintBtnList">
281
- <li ref="rowTileBtnItem" class="rowTileBtn-item rowPrintBtn-btn" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
282
- <template v-if="item.isVisible && !item.isHide">
283
- <PrintBtn
284
- v-bind="$attrs"
285
- :printConfig="printConfig"
286
- :baseUrl="printConfig.printBaseUrl"
287
- :strategy="item.strategy"
288
- :btnText="item.name"
289
- :versionType="item.__printConfig && item.__printConfig.versionType"
290
- :port="item.__printConfig && item.__printConfig.port"
291
- :authorizationKey="item.__printConfig && item.__printConfig.authorizationKey"
292
- :templateNumber="item.__printConfig && item.__printConfig.number"
293
- :hisParams="item.__printConfig && item.__printConfig.hisParams"
294
- :params="getPrintBtnParams(item)"
295
- :prevFn="() => printBtnPrevFn(clickRowData, item, 2, j)"
296
- @success="receivePrintSuccess"
297
- @error="receivePrintError"
298
- ></PrintBtn>
299
- </template>
300
- </li>
301
- </template>
302
- <!-- 折叠按钮列表 -->
303
- <li class="rowFoldBtn" v-if="showRowFoldBtnList(rowFoldBtnList, 'rowFoldBtnList')">
304
- <a-dropdown overlayClassName="baseSearch-fold-dropdown" v-show="!isInlineOperating">
305
- <a-menu slot="overlay">
306
- <template v-for="(b, j) in rowFoldBtnList">
307
- <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" v-if="showLiAdd(b)" @click="showDrawer(b, j)">
308
- {{ b.alias || b.name }}
309
- <getBtnIcon :data="b" :btnObj="btnObj" />
310
- </a-menu-item>
311
- <template v-else-if="showLiFold(b)">
312
- <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)">
313
- {{ b.alias || b.name }}
314
- <getBtnIcon :data="b" :btnObj="btnObj" />
315
- </a-menu-item>
316
- </template>
317
- </template>
318
- </a-menu>
319
- <a-button class="dropdown-button" style="margin: 0 8px 8px 0"
320
- >{{ '更多' }}
321
- <a-icon type="down" />
322
- </a-button>
323
- </a-dropdown>
324
- </li>
325
- <!-- 自适应折叠 -->
326
- <template v-if="showRowFoldBtnList(rowFoldHideBtnList)">
327
- <a-dropdown overlayClassName="rowFoldHideBtnList-dropdown" v-show="!isInlineOperating">
328
- <a-menu slot="overlay">
329
- <template v-for="(value, key) in rowFoldHideBtnListObj">
330
- <a-menu-item-group :key="key" v-if="showRowFoldBtnList(value.list)">
331
- <template slot="title"></template>
332
- <template v-for="(b, j) in value.list">
333
- <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="showDrawer(b, j)">
334
- {{ b.alias || b.name }}
335
- <getBtnIcon :data="b" :btnObj="btnObj" />
336
- </a-menu-item>
337
- <template v-else-if="b.type != 'LINK' && currentTempId == '0'">
338
- <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)">
339
- {{ b.alias || b.name }}
340
- <getBtnIcon :data="b" :btnObj="btnObj" />
341
- </a-menu-item>
342
- </template>
343
- </template>
344
- </a-menu-item-group>
345
- </template>
346
- </a-menu>
347
- <a-button class="dropdown-button" style="margin: 0 8px 8px 0"
348
- >{{ '更多' }}
349
- <a-icon type="down" />
350
- </a-button>
351
- </a-dropdown>
352
- </template>
353
- </template>
354
- </template>
355
- </ul>
356
- </div>
357
- </div>
358
- <div class="base-tabs" v-if="showBaseTabs">
359
- <div v-for="(item, index) in tabConditionList" :key="index" :class="tabIndex === index ? 'base-tabs-item base-tabs-item-active' : 'base-tabs-item'" @click="tabClick(index)"
360
- >{{ item.name }} {{ countTabCondition == 1 && (item.digital || item.digital === 0) ? '(' + (item.digital || 0) + ')' : '' }}</div
361
- >
362
- </div>
363
- <!-- palceholder 文字宽度计算 -->
364
- <span class="baseSearchPlaceholderSpan" ref="baseSearchPlaceholderSpan">
365
- {{ searchPlaceHolder }}
366
- </span>
367
- </div>
368
- </template>
369
-
370
- <script>
371
- /**
372
- * 完成搜索组合组件 BaseSearch
373
- * 使用方式:在需要的vue页中引入注册为子组件后直接使用
374
- * 提供函数:
375
- * 1、输入关键字搜索触发函数onSearch;
376
- * 2、左侧下拉选中搜索触发函数changeSearch;
377
- * 3、右侧快速弹框保存搜索函数onSave(obj);
378
- * 完整例子:<BaseSearch :onSearch='onSearch' @changeSearch='changeSearch' @onSave='onSave'/>
379
- */
380
-
381
- /**
382
- * slot:searchInput
383
- * width: {number}宽度
384
- * searchPlaceHolder:{string} 检索 input 的placeHolder
385
- * showPlaceholderPrefix: {boolean} input 是否展示前缀icon
386
- * isRelatedSearchFold: {boolean} 平铺列表树状表的检索框是否收起
387
- * type:{string} relatedTreeSearch(平铺列表树状表)/outSearch(检索外显)/default(默认)
388
- */
389
-
390
- import moment from 'moment';
391
- import 'moment/locale/zh-cn';
392
-
393
- import _ from 'lodash';
394
- import vexutils from '@/utils/vexutils';
395
- import { Button, Icon, Dropdown, Select, Upload, DatePicker, Input, Menu } from 'ant-design-vue';
396
- import resize from 'vue-resize-directive';
397
-
398
- import { GROUP_TITLE_KEY } from '../const';
399
-
400
- import PrintBtn from '~/button/src/ButtonPrint/index';
401
- // import stepRule from "@/components/table/mixins/stepRule";
402
-
403
- import outQuickSearch from '../components/out-quick-search/out-quick-search';
404
- import utils from '@/utils/utils-map';
405
- import { durationMixin, $utils, filterApiFn, outQuickSearchFn } from '../mixins/mixins';
406
- import tableSearchCon from '../mixins/tableSearchCon';
407
- import svgIcon from '@/component/svg/index.vue';
408
- import 'text-security/text-security.css';
409
- import create from '@/core/create';
410
- import preventReClick from '@/directive/preventReClick';
411
- /** 获取按钮 icon */
412
- import getBtnIcon from '../components/button-icon/getBtnIcon.js';
413
- import ButtonGroup from '../components/button-group/ButtonGroup.vue';
414
-
415
- const EVALUATEList = [
416
- {
417
- label: '一星',
418
- value: '1',
419
- isSelect: false
420
- },
421
- {
422
- label: '二星',
423
- value: '2',
424
- isSelect: false
425
- },
426
- {
427
- label: '三星',
428
- value: '3',
429
- isSelect: false
430
- },
431
- {
432
- label: '四星',
433
- value: '4',
434
- isSelect: false
435
- },
436
- {
437
- label: '五星',
438
- value: '5',
439
- isSelect: false
440
- }
441
- ];
442
-
443
- const BTNOBJ = {
444
- // 按钮icon 映射
445
- copy: 'copy',
446
- pencil: 'edit',
447
- delete: 'delete',
448
- add: 'plus-circle',
449
- download: 'download',
450
- label: 'tag',
451
- queding: 'check',
452
- del: 'close'
453
- };
454
-
455
- export default create({
456
- name: 'base-search',
457
- mixins: [durationMixin, $utils, filterApiFn, tableSearchCon, outQuickSearchFn],
458
- directives: { resize, preventReClick },
459
- props: {
460
- width: {
461
- default: '400px'
462
- },
463
- searchInputWidth: {
464
- // 设置检索框的宽度
465
- type: Number,
466
- default: 0
467
- },
468
- onSearch: Function,
469
- rowBtnList: {
470
- type: Array,
471
- default: () => []
472
- },
473
- paramsData: Object,
474
- // downLoad: Function,
475
- showButtonTop: [String, Number],
476
- showSettings: {
477
- type: Object,
478
- default: () => ({})
479
- },
480
- clickRowData: Object,
481
- value: String,
482
- searchFieldList: {
483
- // 搜索的数据
484
- type: Array,
485
- default: () => []
486
- },
487
- searchFieldLimit: {
488
- // 搜索的数据的限制条件
489
- type: Object,
490
- default: () => ({})
491
- },
492
- viewList: {
493
- type: Array,
494
- default: () => []
495
- },
496
- TypeOfDisplay: {
497
- type: String,
498
- default: ''
499
- },
500
- tableAllCheck: {
501
- type: Boolean
502
- },
503
- classificationIndex: Number,
504
- editTableSource: {
505
- default: ''
506
- },
507
- showRelatedTreeBtn: Boolean,
508
- relatedBaseInfo: Object,
509
- onRelatedSearch: Function,
510
- showResetFilterBtn: {
511
- type: Boolean,
512
- default: false
513
- },
514
- qqConObjCount: {
515
- type: Number,
516
- default: 0
517
- },
518
- conditionType: { type: String },
519
- countCondition: { type: [Number, String] },
520
- countTabCondition: { type: Number },
521
- tabConditionNumObj: {
522
- type: Object,
523
- default: () => {}
524
- },
525
- isRelatedSearchFold: {
526
- type: Boolean,
527
- default: true
528
- },
529
- tableId: { type: String },
530
- conditionMap: {
531
- type: Object,
532
- default: () => {}
533
- },
534
- getFilterData: Function,
535
- oldtableData: Array,
536
- isNestTableClick: Boolean,
537
-
538
- isAdmin: {
539
- type: Boolean,
540
- default: false
541
- },
542
-
543
- /**
544
- * 导入量表配置
545
- */
546
- importGuageConfig: {
547
- type: Object,
548
- default: () => ({
549
- action: ''
550
- })
551
- },
552
-
553
- /**
554
- * 打印配置
555
- */
556
- printConfig: {
557
- type: Object,
558
- default: () => ({
559
- printBaseUrl: '/print/assembly',
560
- postStepRule: () => Promise.resolve({})
561
- })
562
- },
563
-
564
- gettersConfig: {
565
- type: Object,
566
- default: () => ({
567
- getIsTile: '',
568
- selectRowObj: [],
569
- isInlineOperating: false,
570
- printNumberCache: {}
571
- })
572
- },
573
-
574
- /**
575
- * 是否展示行编辑的按钮
576
- */
577
- visibleInlineOperateBtn: {
578
- type: Boolean,
579
- default: false
580
- },
581
-
582
- tabConditionList: {
583
- type: Array,
584
- default: () => []
585
- },
586
-
587
- lastOutSearchFieldList: {
588
- type: Array,
589
- default: () => []
590
- },
591
- lastOutRelationQuickSearch: {
592
- type: Array,
593
- default: () => []
594
- },
595
- relationTableList: {
596
- type: Array,
597
- default: () => []
598
- },
599
- /**
600
- * 筛选外显
601
- */
602
- filterApiConfigOutSearch: {
603
- type: Object,
604
- default: () => ({})
605
- },
606
- useFieldList: Array,
607
- editTableUid: [String, Number],
608
-
609
- preventReTime: {
610
- type: Number,
611
- default: 1000
612
- },
613
- isCardNewBatch: {type: Boolean, deafult: false},
614
- isBatchSelect: {type: [Number, Boolean, String], default: ''}
615
- },
616
- components: {
617
- [Button.name]: Button,
618
- [Icon.name]: Icon,
619
- [Dropdown.name]: Dropdown,
620
- [Select.name]: Select,
621
- [Upload.name]: Upload,
622
- [DatePicker.name]: DatePicker,
623
- [DatePicker.RangePicker.name]: DatePicker.RangePicker,
624
- [Input.name]: Input,
625
- [Input.Search.name]: Input.Search,
626
- [Menu.name]: Menu,
627
- [Menu.Item.name]: Menu.Item,
628
- [Menu.ItemGroup.name]: Menu.ItemGroup,
629
- getBtnIcon,
630
- PrintBtn,
631
- outQuickSearch,
632
- ButtonGroup,
633
- svgIcon
634
- },
635
- inject: {
636
- editTableWrapper: {
637
- type: Object,
638
- default: () => {}
639
- }
640
- },
641
- computed: {
642
- isOrgAdmin() {
643
- return this.isAdmin;
644
- },
645
- currentValue() {
646
- return this.value;
647
- },
648
- allBtn() {
649
- const { rowTileBtnList, rowFoldBtnList } = this;
650
- let allBtn = [];
651
- allBtn.push(...rowTileBtnList, ...rowFoldBtnList);
652
- return allBtn;
653
- },
654
- isButtonFolding() {
655
- // 首页配置
656
- const { editTableWrapper } = this;
657
- return editTableWrapper?.options?.isButtonFolding || false;
658
- },
659
- isShowSettingBtn() {
660
- const { $attrs, viewList, noSetting } = this;
661
- if (this.showRelatedTreeBtn) return;
662
- return $attrs.isTree != 1 && viewList.length > 0 && !noSetting;
663
- },
664
- showDownCurSelectData() {
665
- return this.selectRowObj.filter(item => !(GROUP_TITLE_KEY in (item || {})))?.length;
666
- },
667
- showRowFoldBtnList() {
668
- return function(list, key) {
669
- if (key === 'rowFoldBtnList' && !this.isShowSetting('buttonAdaption')) return false;
670
- if (!list || !list.length) return false;
671
-
672
- let hasGroupBtnList = list.filter(item => item.buttonGroup);
673
- if (hasGroupBtnList.length) {
674
- let showGroup = hasGroupBtnList.some(item => item.isShowFoldGroupBtn);
675
- if (showGroup) return true;
676
- }
677
-
678
- // 只有一个按钮 分组按钮 非自适应
679
- if (list.length === 1 && list[0].buttonGroup && list[0].isButtonGroup && !list[0].isShowFoldGroupBtn) return false;
680
-
681
- let visibleList = list.filter(item => item.isVisible && !item.buttonGroup);
682
- if (!visibleList || !visibleList.length) return false;
683
- let hasAdd = visibleList.some(item => item.type === 'ADD');
684
- if (hasAdd) {
685
- return true;
686
- } else {
687
- if (this.currentTempId != 0) return false;
688
- let notLinkArr = visibleList.filter(item => item.type !== 'LINK');
689
- if (!notLinkArr || !notLinkArr.length) return false;
690
- }
691
- return true;
692
- };
693
- },
694
- initPageResize() {
695
- let { showSettings, TypeOfDisplay, classificationIndex } = this;
696
- return {
697
- showSettings,
698
- TypeOfDisplay,
699
- classificationIndex
700
- };
701
- },
702
- isShowRowTileBtnItem() {
703
- return function(item) {
704
- return this.showButtonTop == 1 && item.type != 'LINK' && this.currentTempId == '0';
705
- };
706
- },
707
- showRelatedSearchFold() {
708
- if (
709
- !this.isShowSettingBtn &&
710
- !this.isShowSetting('hideQuickSearch') &&
711
- this.outSearchFieldList.length == 0 &&
712
- this.outRelationQuickSearch.length == 0 &&
713
- !this.showResetFilterBtn &&
714
- !this.$slots.classification
715
- ) {
716
- return false;
717
- } else {
718
- return this.isRelatedSearchFold;
719
- }
720
- },
721
- handlePickerShowTime() {
722
- return function(item) {
723
- if (!item.showTime) return false;
724
- return {
725
- defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
726
- };
727
- };
728
- },
729
- isShowGroupBtn() {
730
- if (!this.groupBtnObj || !Object.keys(this.groupBtnObj).length) return false;
731
- return true;
732
- },
733
- showLi() {
734
- return function(item) {
735
- if (item.buttonGroup) {
736
- return item.isShow == '1' && item.buttonGroup && !item.isButtonGroup;
737
- }
738
- return item.isShow == '1';
739
- };
740
- },
741
- showLiAdd() {
742
- return function(b) {
743
- if (b.buttonGroup) {
744
- return b.type == 'ADD' && b.buttonGroup && !b.isButtonGroup;
745
- }
746
- return b.type == 'ADD';
747
- };
748
- },
749
- showLiFold() {
750
- return function(b) {
751
- if (b.buttonGroup) {
752
- return b.type != 'LINK' && this.currentTempId == '0' && b.buttonGroup && !b.isButtonGroup;
753
- }
754
- return b.type != 'LINK' && this.currentTempId == '0';
755
- };
756
- },
757
-
758
- getIsTile() {
759
- return this?.gettersConfig?.getIsTile || '';
760
- },
761
- selectRowObj() {
762
- return this?.gettersConfig?.selectRowObj || [];
763
- },
764
- isInlineOperating() {
765
- return this?.gettersConfig?.isInlineOperating || false;
766
- },
767
- printNumberCache() {
768
- return this?.gettersConfig?.printNumberCache || false;
769
- },
770
-
771
- // 全部行编辑
772
- isBatchEditing() {
773
- return this?.gettersConfig?.isBatchEditing || false;
774
- },
775
- curBatchBtnData() {
776
- return this?.gettersConfig?.curBatchBtnData || {};
777
- },
778
- isRowEditing() {
779
- return this?.gettersConfig?.isRowEditing || false;
780
- },
781
- // 是否有高级筛选外显
782
- showOutSearch() {
783
- return this.outSearchFieldList?.length || this.outRelationQuickSearch?.length;
784
- },
785
- showViewList() {
786
- if (this.editTableSource === 'relatedComponent') {
787
- return this.relatedBaseInfo.showType != 'TREE';
788
- }
789
- return !this.optionsValue('hideViewList');
790
- },
791
- optionsValue() {
792
- return function(key) {
793
- return this.$attrs.tableOptions?.[key];
794
- };
795
- },
796
- searchPlaceHolder() {
797
- if (!this.useFieldList?.length || this.showRelatedTreeBtn) return '请输入关键字搜索';
798
- let str = '';
799
- let strList = this.useFieldList
800
- ?.map(item => {
801
- if (item.isSearch != 1) return '';
802
- return item.formTitle || item.alias || item.title;
803
- })
804
- .filter(Boolean);
805
- if (!strList?.length) return '';
806
- str = '输入' + strList.join('/');
807
- return str || '请输入关键字搜索';
808
- },
809
- showRelatedSearch() {
810
- return this.showRelatedTreeBtn && this.isShowSetting('hideSearch');
811
- },
812
- showQuickSearch() {
813
- let showQuick = this.isShowSetting('hideQuickSearch');
814
- // 平铺列表, 左侧不为tree, 而是table
815
- if (this.editTableSource == 'relatedComponent' && this.relatedBaseInfo?.showType != 'TREE') return showQuick;
816
- return showQuick && this.isRelatedSearchFold;
817
- },
818
- showBaseTabs() {
819
- return this.conditionType === 'keyword' && this.tabConditionList?.length && !this.visibleInlineOperateBtn && !this.isRowEditing;
820
- },
821
- isCard() {
822
- return this.TypeOfDisplay === 'cardNew' && this.isBatchSelect == 1
823
- }
824
- },
825
- data() {
826
- return {
827
- modalVisible: false,
828
- currentTempId: '0',
829
- viewCongfigList: [],
830
- isTile: false,
831
- conditionList: [],
832
- displayCategoryList: [],
833
- settingId: '',
834
- searchDefName: '',
835
- rowTileBtnList: [],
836
- rowFoldBtnList: [],
837
- rowPrintBtnList: [],
838
- rowFoldHideBtnList: [], // 按钮自适应折叠list
839
- rowFoldHideBtnListObj: {}, // 按钮自适应折叠分类
840
- batchRelationBtnIds: [], // 批量操作按钮,关联的对应操作按钮id集
841
- relationBtnBatchBtnIds: [], // 有关联对应操作按钮的批量操作按钮id集
842
-
843
- nobutton: false, // 不展示按钮设置 false 展示,true 不展示
844
- noSetting: false, // 不展示按钮设置 false 展示,true 不展示
845
- isChangeWindow: false,
846
- modalWidth: '700px',
847
- modalHeight: '60vh',
848
- label_max_count: 8,
849
- baseLeftWidth: 0,
850
- btnRowWidth: 0,
851
- classificationWidth: 0,
852
- inputSearchWidth: 0,
853
- quickSearchWidth: 0,
854
- downloadDropdownWidth: 0,
855
- diffWidth: 0,
856
- resizeFlag: false,
857
- rowTileBtnListTree: [],
858
- outSearchFieldList: [],
859
- tabIndex: -1,
860
- // tabConditionList: [],
861
-
862
- /* 打印相关 */
863
- printBtnPrevFnWatch: {},
864
- printPrevFinish: false,
865
- printBtnPrevFnWatchTimeoutTimer: null,
866
- printBtn: {},
867
- groupBtnObj: {},
868
- btnObj: BTNOBJ,
869
- printBtnStrategys: [], // 打印按钮组策略list
870
- outRelationQuickSearch: [], // 关联表 筛选外显
871
- inputSearchW: 200,
872
- showPlaceholderPrefix: false
873
- };
874
- },
875
- created() {
876
- if (this.getIsTile !== undefined) {
877
- this.isTile = this.getIsTile;
878
- }
879
- },
880
- destroyed() {},
881
- methods: {
882
- tabClick(index) {
883
- if (this.tabIndex === index) return false;
884
- this.tabIndex = index;
885
- if (index !== -1) this.$emit('tabClick', this.tabConditionList[index]);
886
- },
887
- pageResize(obj) {
888
- if (this.resizeFlag || this.visibleInlineOperateBtn || this.isRowEditing) return;
889
- let baseLeft = this.$refs['baseLeft'];
890
- if (!baseLeft) return;
891
- this.resizeFlag = true;
892
- this.baseLeftWidth = baseLeft.clientWidth;
893
- this.classificationWidth = this.classificationIndex === 2 ? 160 : 0;
894
- this.btnRowWidth = this.$refs['btnRow']?.clientWidth || 0;
895
- this.inputSearchWidth = this.$refs['inputSearchLi']?.clientWidth || 0;
896
- this.quickSearchWidth = this.$refs['quickSearchLi']?.clientWidth || 0;
897
- // this.downloadDropdownWidth = this.$refs["downloadDropdownLi"]?.clientWidth || 0;
898
- let defaultTotal = this.btnRowWidth + this.classificationWidth + this.inputSearchWidth + this.quickSearchWidth;
899
-
900
- let diffWidth = this.baseLeftWidth - defaultTotal;
901
- // 平铺列表占2行
902
- if (this.editTableSource === 'relatedComponent') {
903
- diffWidth += this.baseLeftWidth;
904
- }
905
- this.diffWidth = diffWidth;
906
- if (!obj.type) return;
907
- if (obj.type === 'resize') {
908
- this.handleTileBtnWidth();
909
- }
910
- },
911
- onResize() {
912
- if (this.isButtonFolding || this.isShowSetting('buttonAdaption') || this.relatedIsTree == 1 || this.visibleInlineOperateBtn || this.isRowEditing) return;
913
- utils.debounce(this.pageResize({ type: 'resize' }), 300);
914
- },
915
- async saveListIsTile() {
916
- let url = `/tableList/saveListIsTile`;
917
- let params = {
918
- isTile: this.isTile ? '1' : '0'
919
- };
920
- let res = await this.handleGetConfigApi(params, 'requestSaveListIsTile');
921
- if (res) {
922
- this.$emit('setIsTile', this.isTile);
923
- this.$message.success(this.$t('1.9.23'));
924
- }
925
- },
926
- getTableCondiTionListRequest(first) {
927
- this.getTableCondiTionList(first).then(checked => {
928
- this.reloadList(checked);
929
- });
930
- },
931
- getTableCondiTionList(first, conditionMap = {}) {
932
- let tableId = this.tableId;
933
- if (!tableId) return new Promise(resolve => resolve(false));
934
- let conditionMapTemp = Object.keys(conditionMap).length > 0 ? conditionMap : this.conditionMap;
935
-
936
- return new Promise((resolve, reject) => {
937
- if (Object.keys(conditionMapTemp).length > 0) {
938
- this.conditionList = conditionMapTemp.conditionList || [];
939
- this.displayCategoryList = conditionMapTemp.displayCategoryList || [];
940
- let obj = {
941
- conditionList: this.conditionList,
942
- displayCategoryList: this.displayCategoryList
943
- };
944
- this.$emit('getQuickSearchListObj', obj);
945
- this.settingId = conditionMapTemp.settingId;
946
- const checked = this.conditionList.find(item => item.isDefault) || {
947
- name: '全部数据' || this.$t('1.1.5.1'),
948
- sid: 'all_data'
949
- };
950
- this.searchDefName = checked.name;
951
- // if (this.conditionType === "keyword") {
952
- this.tabConditionList = conditionMapTemp.tabConditionList || []; // 获取页签tab
953
- if (this.tabIndex === -1) {
954
- this.tabIndex = conditionMapTemp.tabConditionList && conditionMapTemp.tabConditionList.findIndex(item => item.isDefault); // 查询默认选中的标签
955
- }
956
- // }
957
- if (this.$attrs.tableOptions?.filterCondition?.displayCategory && first) {
958
- resolve({
959
- name: this.$attrs.tableOptions?.filterCondition?.name,
960
- sid: this.$attrs.tableOptions?.filterCondition?.displayCategory
961
- });
962
- }
963
- resolve(checked);
964
- } else {
965
- resolve({});
966
- }
967
- });
968
-
969
- // }
970
- // });
971
- },
972
- async getTableCondiTionListNew(tableId) {
973
- if (!tableId) return new Promise(resolve => resolve(false));
974
- let params = { tableId };
975
- let url = `/tableList/getTableCondiTionList`;
976
- return this.axios
977
- .get(url, { params })
978
- .then(({ data }) => {
979
- if (data && data.result == 'SUCCESS') {
980
- // 设置分类数据,用于优化组件内的多次请求分类
981
- this.$emit('setConditionMap', data.map);
982
- return data.map;
983
- }
984
- })
985
- .catch(err => {
986
- console.log(err);
987
- });
988
- },
989
- foldQuickSearch() {
990
- this.$emit('foldQuickSearch', true);
991
- },
992
- openModal() {
993
- this.modalVisible = true;
994
- },
995
- closeModal() {
996
- this.resetChangeWindow();
997
- this.modalVisible = false;
998
- },
999
- resetChangeWindow() {
1000
- this.modalWidth = '700px';
1001
- this.modalHeight = '60vh';
1002
- this.isChangeWindow = false;
1003
- },
1004
- changeModalWindow() {
1005
- this.isChangeWindow = !this.isChangeWindow;
1006
- let docHeight = document.body.clientHeight;
1007
- this.modalWidth = this.modalWidth === '700px' ? `100%` : '700px';
1008
- this.modalHeight = this.modalHeight === '60vh' ? `${docHeight - 108}px` : '60vh';
1009
-
1010
- if (this.modalWidth === '700px') {
1011
- this.label_max_count = 8;
1012
- } else {
1013
- this.$nextTick(() => {
1014
- let ele = document.querySelector('.quickSearch_label-container');
1015
- ele && (this.label_max_count = parseInt((ele.clientWidth - 20) / 112) * 2);
1016
- });
1017
- }
1018
- },
1019
- openSaveToCalss() {
1020
- this.$refs.quicksearch?.openSaveToCalss();
1021
- },
1022
- onSaveSearch() {
1023
- this.$refs.quicksearch?.onSave();
1024
- },
1025
- onSave(obj, isOutFilter = false, config = {}) {
1026
- if (!this.validConObj(obj, this.searchFieldList, this.searchFieldLimit)) return false;
1027
- let copy = [];
1028
- if (this.outSearchFieldList.length) {
1029
- copy = _.cloneDeep(this.outSearchFieldList, true);
1030
- }
1031
- let copyRelation = [];
1032
- if (this.outRelationQuickSearch.length) {
1033
- copyRelation = _.cloneDeep(this.outRelationQuickSearch, true);
1034
- }
1035
- this.$emit('onSave', obj, isOutFilter, copy, copyRelation, config);
1036
- this.modalVisible = false;
1037
- },
1038
- // 外部调用
1039
- editTableGetConObj() {
1040
- if (!this.showOutSearch) return;
1041
- let conObj = this.getConObjParams() || [];
1042
- if (!this.validConObj(conObj, this.searchFieldList, this.searchFieldLimit)) return false;
1043
- return conObj;
1044
- },
1045
- clearData() {
1046
- this.$refs.quicksearch?.clearData();
1047
- },
1048
- /**
1049
- * type 1-预览 2-打印
1050
- */
1051
- handlePrint(clickBtn, btn, type, j) {
1052
- btn.printType = type;
1053
- this.clickBtn(clickBtn, btn, clickBtn.my_index, true, j);
1054
- },
1055
- showDrawer(btn, j) {
1056
- let hasSelectRows = this.paramsData.form.selectRows && this.paramsData.form.selectRows.length > 0;
1057
- let isMultiSelect = hasSelectRows || this.tableAllCheck;
1058
-
1059
- if ((btn.name.includes('批量') && btn.type == 'ADD') || btn.type == 'BATCH') {
1060
- // const { settingObj = {} } = btn || {};
1061
- let settingObj = {};
1062
- let settingList = btn.setting || '{}';
1063
- if (utils.isJSON(settingList)) {
1064
- let btnSetting = JSON.parse(settingList);
1065
- if (Array.isArray(btnSetting)) {
1066
- settingObj = btnSetting[0] || {};
1067
- } else {
1068
- settingObj = btnSetting;
1069
- }
1070
- }
1071
- let trigger_type = settingObj?.trigger_type;
1072
-
1073
- // 全部行编辑
1074
- if (trigger_type == 'EDIT_ROW' || settingObj?.editAllRow == 1) {
1075
- this.handleBtnEvent(btn, j);
1076
- return;
1077
- }
1078
-
1079
- if (trigger_type == 'SCAN' && btn.type == 'ADD') {
1080
- this.handleBtnEvent(btn, j);
1081
- return;
1082
- }
1083
-
1084
- if (isMultiSelect) {
1085
- if (settingObj.isTips && settingObj.isTips == 0) {
1086
- this.handleBtnEvent(btn, j);
1087
- return;
1088
- }
1089
- // 批量操作增加确认
1090
- let params = { ...this.paramsData };
1091
- params.table = {};
1092
- if (settingObj.tipsMsg) {
1093
- if (settingObj.tipsMsg.includes('form.selectRows')) {
1094
- settingObj.tipsMsg = utils.handleMultiTips(settingObj.tipsMsg, [...params.form.selectRows]);
1095
- } else {
1096
- settingObj.tipsMsg = utils.handleSysParams(settingObj.tipsMsg, {
1097
- ...params
1098
- });
1099
- }
1100
- }
1101
- const h = this.$createElement;
1102
- this.$confirm({
1103
- title: h(
1104
- 'div',
1105
- {
1106
- directives: [
1107
- {
1108
- name: 'drag-move',
1109
- value: {
1110
- target: 'ant-modal-confirm-body'
1111
- }
1112
- }
1113
- ],
1114
- domProps: {
1115
- innerHTML: settingObj.tipsMsg || `是否确认${btn.name}`
1116
- }
1117
- }
1118
- // settingObj.tipsMsg || `是否确认${btn.name}`
1119
- ),
1120
- okText: '确定',
1121
- cancelText: '取消',
1122
- onOk: () => {
1123
- this.handleBtnEvent(btn, j);
1124
- },
1125
- onCancel() {
1126
- console.log('Cancel');
1127
- },
1128
- class: 'test'
1129
- });
1130
- } else {
1131
- if (!btn.canHandleUniline) {
1132
- // 1.9.295
1133
- this.$message.warning(`请勾选需要${btn.name}的数据`);
1134
- return;
1135
- }
1136
- this.clickBtn(
1137
- this.clickRowData,
1138
- // 找到对应的单行操作按钮
1139
- this.getUnilineBtn(btn),
1140
- this.clickRowData.my_index,
1141
- true,
1142
- j
1143
- );
1144
- }
1145
- } else {
1146
- if (btn.type == 'ADD' || btn.type == 'BATCH') {
1147
- this.handleBtnEvent(btn, j);
1148
- return;
1149
- }
1150
- this.clickBtn(this.clickRowData, btn, this.clickRowData.my_index, j);
1151
- }
1152
- },
1153
- getUnilineBtn(BatchBtn) {
1154
- let unilineBtnId = this.batchRelationBtnIds[this.relationBtnBatchBtnIds.indexOf(BatchBtn.id)];
1155
- let unilineBtnObj = null;
1156
- this.allBtn.forEach(i => {
1157
- if (i.id == unilineBtnId) {
1158
- unilineBtnObj = i;
1159
- }
1160
- });
1161
- return unilineBtnObj;
1162
- },
1163
- handleBtnEvent(btn, j) {
1164
- let indexList = [];
1165
- this.$emit('clearTeamTitleName');
1166
- if (this.paramsData.form.selectRows && this.paramsData.form.selectRows.length > 0) {
1167
- indexList = this.paramsData.form.selectRows.map(item => {
1168
- if (btn.type == 'BATCH') {
1169
- delete item.SHOW_BUTTON_IDS;
1170
- delete item.operatorColumn;
1171
- }
1172
- return item.my_index;
1173
- });
1174
- }
1175
- let setData = JSON.parse(btn.setting);
1176
- let settingList = JSON.parse(btn.setting);
1177
- /** 按钮对象需求:add类型的 setting 可能是 Array/Object*/
1178
- if (btn.type === 'ADD' || btn.type == 'BATCH') {
1179
- if (Array.isArray(settingList)) {
1180
- setData = settingList[0] || {};
1181
- } else {
1182
- setData = settingList;
1183
- }
1184
- this.paramsData.table = {};
1185
- }
1186
- if (setData.trigger_type == 'ABOUT_ITEM') {
1187
- this.$message.error('按钮事件配置有误');
1188
- return;
1189
- }
1190
- let params = setData.params || [];
1191
- if (setData.trigger_type == 'QR_CODE') {
1192
- params.forEach(item => {
1193
- item.p_value = item.p_value?.replace(/\$\{([^}]+)\}/g, (_v, $1) => {
1194
- return $1 || _v;
1195
- });
1196
- });
1197
- }
1198
- let paramsData = utils.setParamsValue(params, this.paramsData);
1199
- Object.assign(btn, {
1200
- _index_: j
1201
- });
1202
- let btnData = {
1203
- btnData: Object.assign(setData, {
1204
- paramsData: paramsData,
1205
- btnName: btn.name,
1206
- _params_data: this.paramsData,
1207
- _type_: btn.type
1208
- }),
1209
- indexList: indexList,
1210
- btnConfig: JSON.parse(JSON.stringify(btn)),
1211
- _params_data: this.paramsData,
1212
- _type_: btn.type
1213
- };
1214
- this.$emit('btnEvent', btnData);
1215
- },
1216
-
1217
- // 筛选分类相关的
1218
- async updateTableCondiTion() {
1219
- await this.getTableCondiTionListNew(this.tableId);
1220
- this.getTableCondiTionListRequest();
1221
- },
1222
- async CondiTionListInit() {
1223
- await this.getTableCondiTionListNew(this.tableId);
1224
- this.getTableCondiTionListRequest();
1225
- },
1226
- async saveGetTableCondiTionList(options) {
1227
- await this.getTableCondiTionListNew(this.tableId);
1228
- this.getTableCondiTionList();
1229
- this.$emit('getClassification', options);
1230
- },
1231
- changeSearch(key, item) {
1232
- if (key == 'all') {
1233
- this.searchDefName = '全部数据' || this.$t('1.1.5.1');
1234
- } else {
1235
- this.searchDefName = item.name;
1236
- }
1237
- this.$refs.quicksearch.clearData();
1238
- this.$emit('changeSearch', key, item);
1239
- },
1240
- changeSearchTile(val) {
1241
- this.isTile = val;
1242
- this.saveListIsTile();
1243
- },
1244
- openSetting() {
1245
- this.$refs.search.handleMenuClick('setting');
1246
- },
1247
- reloadList(item) {
1248
- this.$refs.quicksearch?.clearData();
1249
- this.$emit('reloadList', item);
1250
- },
1251
- clickBtn(data, item, index, skip, j) {
1252
- this.$emit('clearTeamTitleName');
1253
- if ((item.name.includes('批量') && item.type == 'ADD' && !skip) || (item.type == 'BATCH' && !skip)) {
1254
- this.showDrawer(item, j);
1255
- return;
1256
- }
1257
- if (Object.keys(data || {}).length === 0 && !this.isPrintBtn(item)) {
1258
- // 请点击要操作的数据1.9.140
1259
- this.$message.info('请点击要操作的数据' || this.$t('1.9.140'));
1260
- return;
1261
- }
1262
- Object.assign(item, {
1263
- _index_: j
1264
- });
1265
- this.$emit('clickBtn', data, item, index);
1266
- },
1267
- clickGroupBtn(btn, j) {
1268
- this.clickBtn(this.clickRowData, btn, this.clickRowData.my_index, undefined, j);
1269
- },
1270
- handlerSetting() {
1271
- this.$emit('handlerSetting');
1272
- },
1273
- // 请求视图列表
1274
- handlerReqAllConfigView() {
1275
- let params = {
1276
- type: 'PC',
1277
- typeTable: 'TABLE_LIST',
1278
- tableId: this.tableId,
1279
- page: 1,
1280
- rows: 20
1281
- };
1282
- this.axios
1283
- .get('/tableListConfigView/getTableListConfigViewAll', {
1284
- params: params
1285
- })
1286
- .then(({ data }) => {
1287
- if (data.rows) {
1288
- let viewCongfigList = data.rows || [];
1289
- if (viewCongfigList.length > 0) {
1290
- // 查找默认值
1291
- let curItem = viewCongfigList.find(v => v.mark == 1);
1292
- this.currentTempId = curItem ? curItem.id : '0';
1293
- this.$emit('handlerChangeView', this.currentTempId);
1294
- } else {
1295
- this.currentTempId = '0';
1296
- this.$emit('handlerChangeView', this.currentTempId);
1297
- }
1298
-
1299
- this.$set(this, 'viewCongfigList', viewCongfigList);
1300
- }
1301
- });
1302
- },
1303
- handlerSelectTemp(e) {
1304
- if (this.currentTempId === e) return;
1305
- this.currentTempId = e;
1306
- const tab = e == 0 ? 'bigTable' : null;
1307
- this.$emit('handlerChangeView', e, tab);
1308
- let f = this.viewList.findIndex(v => v.id == e);
1309
- this.resetCheckStatus();
1310
- this.$nextTick(() => {
1311
- this.formatRowBtnList();
1312
- });
1313
- },
1314
- isShowSetting(v) {
1315
- if (v == 'hideSettingBtn') {
1316
- return this.isOrgAdmin || this.showSettings[v] == 0;
1317
- } else {
1318
- if (this.showRelatedTreeBtn) {
1319
- return this.relatedBaseInfo[v] == 0;
1320
- }
1321
- return this.showSettings[v] == 0;
1322
- }
1323
- },
1324
- setBatchRelationBtnIds(list) {
1325
- let showButtonTop = !!this.showButtonTop;
1326
- if (!showButtonTop) return false;
1327
-
1328
- list.forEach(item => {
1329
- let relationBtnId = item.setting && JSON.parse(item.setting)?.relationBtnId;
1330
- if (item.type === 'BATCH' && relationBtnId) {
1331
- this.relationBtnBatchBtnIds.push(item.id);
1332
- this.batchRelationBtnIds.push(relationBtnId);
1333
- }
1334
- });
1335
- },
1336
- setBtnStatus(btn) {
1337
- const btnObj = utils.getRowOperatorIdSetting({}, btn);
1338
- const { settingObj = {} } = btnObj || {};
1339
- let isAllSelect = this.tableAllCheck;
1340
- let isMultiSelect = !!this.paramsData.form.selectIds;
1341
- let isBatchBtn = btn.type === 'BATCH';
1342
- let isAddBtn = btn.type === 'ADD';
1343
- let isSQLSAVEBtn = settingObj.trigger_type === 'SQLSAVE';
1344
- let isLineBtn = btn.type === 'EDIT' || btn.type === 'DELETE';
1345
- let isImportGuage = settingObj.trigger_type === 'GUAGE' && settingObj.guage_type == 'importGuage';
1346
-
1347
- let isEditRow = settingObj.trigger_type === 'EDIT_ROW';
1348
- let editAllRow = settingObj.editAllRow == 1;
1349
-
1350
- // 批量&&行编辑&&全部行编辑 直接展示
1351
- if (isBatchBtn && isEditRow && editAllRow) {
1352
- btn.isVisible = true;
1353
- return;
1354
- }
1355
-
1356
- // 默认情况下 只展示新增&下载
1357
- if (!this.showDownCurSelectData) {
1358
- btn.isVisible = isAddBtn ? true : false;
1359
- if (!isImportGuage) return;
1360
- }
1361
-
1362
- // btn.settingObj.guage_type == "importGuage";
1363
- // 全选状态下,只有入口类型的批量按钮展示(因当前版本仅支持入口类型的全选批量操作
1364
- if (isBatchBtn && isAllSelect) {
1365
- btn.isVisible = isSQLSAVEBtn;
1366
- return;
1367
- }
1368
-
1369
- // 批量操作按钮,如果有绑定对应单行操作按钮,则批量按钮开启单行操作
1370
- let relationBtnId = JSON.parse(btn.setting).relationBtnId;
1371
- if (isBatchBtn && relationBtnId) {
1372
- btn.canHandleUniline = true;
1373
- }
1374
-
1375
- // 批量按钮关联的对应按钮
1376
- if (this.showDownCurSelectData > 1 && isLineBtn) {
1377
- btn.isVisible = false;
1378
- } else {
1379
- if (isBatchBtn && btn.chooseTwoData == 1) {
1380
- btn.isVisible = !this.batchRelationBtnIds.includes(btn.id) && this.showDownCurSelectData > 1;
1381
- } else {
1382
- btn.isVisible = !this.batchRelationBtnIds.includes(btn.id);
1383
- }
1384
- }
1385
-
1386
- // 未绑定了行级按钮的批量按钮,默认隐藏, 勾选展示
1387
- if (isBatchBtn && !relationBtnId && this.showDownCurSelectData > 1) {
1388
- btn.isVisible = isMultiSelect;
1389
- }
1390
- // 量表导入按钮
1391
- if (isImportGuage) {
1392
- btn.isImportGuage = true;
1393
- btn.isVisible = false;
1394
- }
1395
- },
1396
- // 处理分组按钮
1397
- handleButtonGroup(buttonList) {
1398
- let useBttonList = buttonList
1399
- .map(v => {
1400
- v.isButtonGroup = false;
1401
- // 有分组名 非隐藏
1402
- if (!v.buttonGroup || !v.isVisible || v.isShow != 1) return null;
1403
- if (v.type === 'ADD' || v.type == 'BATCH') return v;
1404
- if (this.showButtonTop != 1) return null;
1405
- return v;
1406
- })
1407
- .filter(Boolean);
1408
- if (!useBttonList.length) return;
1409
- let groupRes = vexutils.groupBy(useBttonList, 'buttonGroup');
1410
- if (!groupRes || !Object.keys(groupRes).length) return;
1411
- let resObj = {};
1412
- Object.keys(groupRes).forEach(item => {
1413
- let list = groupRes[item];
1414
- // 超过一个才展示
1415
- if (item && list?.length > 1) {
1416
- resObj[item] = {
1417
- key: item,
1418
- isHide: false,
1419
- list: list,
1420
- clientWidth: 0,
1421
- isVisible: true
1422
- };
1423
- list.forEach(v => (v.isButtonGroup = true));
1424
- }
1425
- });
1426
- this.groupBtnObj = resObj;
1427
- },
1428
- async formatRowBtnList() {
1429
- let rowFoldBtnList = [];
1430
- let rowTileBtnList = [];
1431
- let rowPrintBtnList = [];
1432
- this.rowFoldBtnList = [];
1433
- this.rowTileBtnList = [];
1434
- this.rowPrintBtnList = [];
1435
- this.rowFoldHideBtnList = [];
1436
- this.batchRelationBtnIds = [];
1437
- this.relationBtnBatchBtnIds = [];
1438
- this.groupBtnObj = {};
1439
- let useButton = [];
1440
- // let tempBtnList = this.rowBtnList;
1441
- // // 按钮置顶时 过滤掉行级按钮中 仅图标
1442
- // if (this.showButtonTop == 1) {
1443
- // tempBtnList = tempBtnList.filter(v => {
1444
- // if (["EDIT", "DELETE"].includes(v.type)) {
1445
- // if (v.showStyle != "only_icon") return v;
1446
- // } else {
1447
- // return v;
1448
- // }
1449
- // });
1450
- // }
1451
- let rowBtnList = this.rowBtnList;
1452
- // 新卡片视图 有进入批量模式的按钮
1453
- if (this.isCard) {
1454
- if(this.isCardNewBatch) {
1455
- rowBtnList = rowBtnList.map(v => {
1456
- if(v.type == 'BATCH') return v
1457
- return null
1458
- }).filter(Boolean);
1459
- } else {
1460
- rowBtnList = rowBtnList.map(v => {
1461
- if(v.type != 'BATCH') return v;
1462
- return null;
1463
- }).filter(Boolean);
1464
- }
1465
- }
1466
- if (!rowBtnList?.length) return;
1467
- this.setBatchRelationBtnIds(rowBtnList);
1468
-
1469
-
1470
- // 子列表只留下行级按钮
1471
- // if (this.isNestTableClick) {
1472
- // rowBtnList = this.rowBtnList.filter(item => item.type != 'ADD' && item.type != 'BATCH');
1473
- // }
1474
-
1475
- rowBtnList.forEach(btn => {
1476
- if (!(btn.isShow == '1' && btn.type != 'LINK')) return;
1477
- btn.isHide = false;
1478
- btn.isButtonGroup = false;
1479
- let cloneBtn = _.cloneDeep(btn);
1480
- this.setBtnStatus(cloneBtn);
1481
- // 按钮自适应 即使折叠也平铺显示出来
1482
- if (this.isShowSetting('buttonAdaption')) {
1483
- if (btn.toggle == 'fold') {
1484
- if (btn.type != 'ADD' && btn.type != 'BATCH' && this.showButtonTop == 0) return;
1485
- if (!this.isPrintBtn(btn)) {
1486
- rowFoldBtnList.push(cloneBtn);
1487
- }
1488
- } else {
1489
- rowTileBtnList.push(cloneBtn);
1490
- }
1491
- } else {
1492
- rowTileBtnList.push(cloneBtn);
1493
- }
1494
- useButton.push(cloneBtn);
1495
- });
1496
- if (this.isShowSetting('buttonAdaption')) {
1497
- this.rowFoldBtnList = rowFoldBtnList;
1498
- }
1499
-
1500
- this.rowTileBtnList = rowTileBtnList.filter(i => {
1501
- if (this.isPrintBtn(i)) {
1502
- rowPrintBtnList.push(i);
1503
- } else {
1504
- return i;
1505
- }
1506
- });
1507
-
1508
- let printNumberList = (await this.getPrintNumber(rowPrintBtnList)) || [];
1509
- rowPrintBtnList = this.setPrintNumberToBtnList(printNumberList, rowPrintBtnList);
1510
- // this.rowPrintBtnList = rowPrintBtnList;
1511
- // 添加批量打印策略:strategy: MULTI(循环多条, 默认值, 为空时使用该策略) ONCE(聚合一条)
1512
- this.rowPrintBtnList = rowPrintBtnList.map(item => {
1513
- const obj = this.printBtnStrategys.find(v => v.id === item.settingObj[0].trigger_id);
1514
- item.strategy = obj?.setting ? JSON.parse(obj.setting).strategy : 'MULTI';
1515
- return item;
1516
- });
1517
-
1518
- this.hideInlineOperationBtn();
1519
-
1520
- // 分组按钮
1521
- this.handleButtonGroup(useButton);
1522
-
1523
- if (this.isShowSetting('buttonAdaption')) return;
1524
- this.$nextTick(() => {
1525
- this.handleTileBtnWidth();
1526
- this.dealOutFilterHideBtn();
1527
- });
1528
- },
1529
- hideInlineOperationBtn() {
1530
- if (this.TypeOfDisplay === 'table') return;
1531
-
1532
- this.rowFoldBtnList = this.rowFoldBtnList.filter(item => {
1533
- return item.settingObj[0].trigger_type !== 'EDIT_ROW';
1534
- });
1535
- this.rowTileBtnList = this.rowTileBtnList.filter(item => {
1536
- return item.settingObj[0].trigger_type !== 'EDIT_ROW';
1537
- });
1538
- },
1539
- isPrintBtn(btn) {
1540
- const copySettingObj = btn.settingObj;
1541
- let settingObj = {};
1542
- if (Array.isArray(copySettingObj)) {
1543
- settingObj = copySettingObj[0];
1544
- } else {
1545
- settingObj = copySettingObj;
1546
- }
1547
- if (!settingObj) return false;
1548
- return settingObj.trigger_type === 'PRINT';
1549
- },
1550
- handleTileBtnWidth() {
1551
- if (this.outSearchFieldList.length > 0) return; // 存在外显按钮的时候 不触发这个函数
1552
- let rowTileBtnRef = this.$refs.rowTileBtnItem;
1553
- if (!rowTileBtnRef || !rowTileBtnRef.length) return;
1554
- let rowTileBtnList = JSON.parse(JSON.stringify(this.rowTileBtnList));
1555
- let groupBtnObj = JSON.parse(JSON.stringify(this.groupBtnObj));
1556
- let btnTotalWidth = 90;
1557
- let hasHideBtn = false;
1558
- let rowFoldHideBtnWidth = 90;
1559
- let diffWidth = this.diffWidth;
1560
- rowTileBtnRef.forEach((e, index) => {
1561
- let dataKey = e.getAttribute('data-key');
1562
- let dateSource = e.getAttribute('data-source');
1563
- let clientWidth = e.clientWidth;
1564
- let item;
1565
- if (dateSource == 'groupBtn') {
1566
- item = groupBtnObj[dataKey];
1567
- } else {
1568
- item = rowTileBtnList.find(v => v.sid === dataKey);
1569
- }
1570
- if (!item) return;
1571
- if (clientWidth) {
1572
- item.clientWidth = clientWidth;
1573
- }
1574
- if (item.clientWidth) {
1575
- clientWidth = item.clientWidth;
1576
- }
1577
- if (diffWidth <= 0) {
1578
- this.$set(item, 'isHide', true);
1579
- } else if (diffWidth > 0 && item.isVisible) {
1580
- btnTotalWidth += clientWidth;
1581
- if (btnTotalWidth > diffWidth) {
1582
- this.$set(item, 'isHide', true);
1583
- if (!hasHideBtn) {
1584
- hasHideBtn = true;
1585
- diffWidth -= rowFoldHideBtnWidth;
1586
- btnTotalWidth -= rowFoldHideBtnWidth;
1587
- }
1588
- } else {
1589
- this.$set(item, 'isHide', false);
1590
- }
1591
- }
1592
- });
1593
- let hideBtn = rowTileBtnList.filter(item => item.isVisible && item.isHide);
1594
- this.groupBtnObj = groupBtnObj;
1595
- this.rowTileBtnList = rowTileBtnList;
1596
- let rowFoldHideBtnListObj = {
1597
- ADD: { name: '新增按钮', list: [] },
1598
- INLINE: { name: '行级按钮', list: [] },
1599
- BATCH: { name: '批量按钮', list: [] }
1600
- };
1601
-
1602
- hideBtn.forEach(item => {
1603
- item.isShowFoldGroupBtn = false;
1604
- if (item.type === 'ADD') {
1605
- rowFoldHideBtnListObj.ADD.list.push(item);
1606
- } else if (item.type == 'BATCH') {
1607
- rowFoldHideBtnListObj.BATCH.list.push(item);
1608
- } else {
1609
- rowFoldHideBtnListObj.INLINE.list.push(item);
1610
- }
1611
- });
1612
-
1613
- let hideGroupBtnObj = {};
1614
- // 按钮自适应 隐藏的分组 需要在折叠中平铺展示
1615
- for (let key in groupBtnObj) {
1616
- if (groupBtnObj[key].isHide) {
1617
- let list = groupBtnObj[key].list;
1618
- hideGroupBtnObj[key] = {
1619
- name: key,
1620
- list
1621
- };
1622
- list.forEach(item => {
1623
- let matchItem = hideBtn.find(v => v.sid === item.sid);
1624
- if (!matchItem) {
1625
- item.isShowFoldGroupBtn = true;
1626
- hideBtn.push(item);
1627
- } else {
1628
- matchItem.isShowFoldGroupBtn = true;
1629
- }
1630
- });
1631
- }
1632
- }
1633
- if (Object.keys(hideGroupBtnObj).length) {
1634
- Object.assign(rowFoldHideBtnListObj, hideGroupBtnObj);
1635
- }
1636
-
1637
- this.rowFoldHideBtnListObj = rowFoldHideBtnListObj;
1638
- this.rowFoldHideBtnList = hideBtn;
1639
- this.resizeFlag = false;
1640
- },
1641
- resetCheckStatus() {
1642
- this.$emit('pubResetCheckStatus');
1643
- },
1644
- handleReset() {
1645
- this.$emit('handleReset', { targetType: 'outQuickSearchReset' });
1646
- },
1647
- changeCardNewBatch(val) {
1648
- this.$emit('changeCardNewBatch', val)
1649
- },
1650
- handleUploadChange(info) {
1651
- const { file, fileList } = info;
1652
- if (file.status !== 'uploading') {
1653
- console.log(file, fileList);
1654
- }
1655
- if (file.status === 'done') {
1656
- if (file.response?.result == 'SUCCESS') {
1657
- this.$message.success(`${file.name} 导入成功`);
1658
- this.$emit('importUpdate');
1659
- } else {
1660
- this.$message.error(`${file.name} 导入失败`);
1661
- }
1662
- } else if (file.status === 'error') {
1663
- this.$message.error(`${file.name} 导入失败`);
1664
- }
1665
- },
1666
- handleOtherConfigInit() {
1667
- setTimeout(() => {
1668
- let tableOptions = this.$attrs?.tableOptions || this.tableOptions || {};
1669
- const { nobutton = false, TypeOfDisplay = '', noSetting = false } = tableOptions?.config || {};
1670
- this.nobutton = nobutton || false;
1671
- if (TypeOfDisplay === 'table') {
1672
- this.currentTempId = '0';
1673
- }
1674
- if (noSetting) {
1675
- // this.showSettings["hideSettingBtn"] = 1;
1676
- this.noSetting = true;
1677
- }
1678
- }, 16);
1679
- },
1680
-
1681
- handleTopBtnTracher(btn, j) {
1682
- try {
1683
- // 埋点
1684
- this.$_handleTracherLog('列表按钮', {
1685
- 列表ID: this.tableId || '',
1686
- 列表名称: this.tableName || this.$attrs?.tableName || '',
1687
- 按钮名称: btn.name,
1688
- 按钮ID: btn.id,
1689
- 按钮类型: btn.type,
1690
- 按钮顺序位置: j,
1691
- 显示位置: btn.toggle
1692
- });
1693
- } catch (error) {
1694
- console.log(error);
1695
- }
1696
- },
1697
- handleAddType(btn) {
1698
- const btnObj = utils.getRowOperatorIdSetting({}, btn);
1699
- let setData = JSON.parse(btnObj.setting);
1700
- const { editTableWrapper } = this;
1701
- const tableParams = JSON.parse(JSON.stringify(this.paramsData));
1702
-
1703
- if (editTableWrapper.options && utils.isPlainObject(editTableWrapper.options.extendParams)) {
1704
- // 有额外的参数
1705
- editTableWrapper.options?.extendParams && Object.assign(tableParams.form, editTableWrapper.options.extendParams);
1706
- }
1707
- const paramsData = Object.assign(tableParams, {
1708
- table: btn
1709
- });
1710
- const params = utils.setParamsValue(setData.params, paramsData);
1711
- Object.assign(setData, { params, _params_data: paramsData });
1712
- this.$emit('btnEventTree', setData);
1713
- },
1714
- getRowTileBtnList(btnList) {
1715
- this.rowTileBtnListTree = [];
1716
- this.rowTileBtnListTree = btnList.filter(btn => btn.isShow == '1' && btn.type == 'ADD');
1717
- },
1718
- relatedSearchInputBlur() {
1719
- let searchInput = this.$refs.relatedSearchInput;
1720
- if (!searchInput) return;
1721
- if (!searchInput.$el?.children) return;
1722
- if (!searchInput.$el.children[0]?.children) return;
1723
- if (!searchInput.$el.children[0].children[0]) return;
1724
- if (!searchInput.$el.children[0].children[0]?.children) return;
1725
- let inputDom = searchInput.$el.children[0].children[0].children[0];
1726
- if (!inputDom) return;
1727
- inputDom.blur();
1728
- },
1729
- handleRequestedLabel(v) {
1730
- let params = { type: v, pageSize: 10000 };
1731
- return this.axios.get('/label/list', { params: params });
1732
- },
1733
- initOutSearchFieldList(config = {}) {
1734
- this.outSearchFieldList = [];
1735
- this.outRelationQuickSearch = [];
1736
- let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => ((i.random_key = this.getFiledRandom_key(i)), i.isShowSearch == 1 && i.filterExplicit == 1));
1737
- this.outSearchFieldList = mySearchFieldList;
1738
- // 跨表
1739
- let outRelationQuickSearch = this.relationTableList.map(item => {
1740
- return {
1741
- fieldList: item.fieldList.fieldList.filter(item => item.isShowSearch == 1 && item.filterExplicit == 1) || [],
1742
- tableName: item.tableName,
1743
- primaryField: item.primaryField,
1744
- parameterConversionId: item.parameterConversionId,
1745
- tableId: item.tableId,
1746
- relationField: item.relationField,
1747
- converFun: item.converFun,
1748
- relationOrgId: item.relationOrgId,
1749
- preConObj: item.preConObj,
1750
- preSqlExpression: item.preSqlExpression
1751
- };
1752
- });
1753
- outRelationQuickSearch = outRelationQuickSearch.filter(item => item.fieldList.length);
1754
- this.$set(this, 'outRelationQuickSearch', outRelationQuickSearch);
1755
- this.dealOutFilterHideBtn();
1756
- this.handlerInitSearchItem(this.outSearchFieldList);
1757
- this.outRelationQuickSearch.forEach(item => {
1758
- this.handlerInitSearchItem(item.fieldList);
1759
- });
1760
- if (this.lastOutSearchFieldList.length > 0) {
1761
- this.outSearchFieldList = _.cloneDeep(this.lastOutSearchFieldList);
1762
- }
1763
- if (this.lastOutRelationQuickSearch.length) {
1764
- this.outRelationQuickSearch = this.$utils.clone(this.lastOutRelationQuickSearch, true);
1765
- }
1766
-
1767
- // 如有配置默认值
1768
- if (this.outSearchFieldList.some(v => !!v.explicitDefaultVal)) {
1769
- this.$emit('outSearchInit');
1770
- if ('reset' != config?.type) {
1771
- this.outFilterChange({ type: 'outSearchInit' });
1772
- }
1773
- }
1774
- },
1775
- dealOutFilterHideBtn() {
1776
- if (!this.isShowSetting('buttonAdaption') && this.outSearchFieldList.length > 0) {
1777
- // 如果设置了按钮自适应 全部按钮放入折叠按钮
1778
- // 需要考虑按钮是否有分组 过滤掉分组
1779
- let rowTileBtnList = JSON.parse(JSON.stringify(this.rowTileBtnList));
1780
- let hideBtn = rowTileBtnList.filter(item => {
1781
- if (!item.isVisible) return false;
1782
- if (!item.buttonGroup) return true;
1783
- if (this.groupBtnObj && this.groupBtnObj[item.buttonGroup]) return false;
1784
- return true;
1785
- });
1786
- this.rowTileBtnList = rowTileBtnList.map(i => {
1787
- i['isHide'] = true;
1788
- return i;
1789
- });
1790
- let rowFoldHideBtnListObj = {
1791
- ADD: { name: '新增按钮', list: [] },
1792
- INLINE: { name: '行级按钮', list: [] },
1793
- BATCH: { name: '批量按钮', list: [] }
1794
- };
1795
- hideBtn.forEach(item => {
1796
- this.$set(item, 'isHide', true);
1797
- if (item.type === 'ADD') {
1798
- rowFoldHideBtnListObj.ADD.list.push(item);
1799
- } else if (item.type == 'BATCH') {
1800
- rowFoldHideBtnListObj.BATCH.list.push(item);
1801
- } else {
1802
- rowFoldHideBtnListObj.INLINE.list.push(item);
1803
- }
1804
- });
1805
- this.rowFoldHideBtnListObj = rowFoldHideBtnListObj;
1806
- this.rowFoldHideBtnList = hideBtn;
1807
- }
1808
- },
1809
- outFilterChange(config = {}) {
1810
- let conObj = this.getConObjParams() || [];
1811
- this.onSave(conObj, true, config);
1812
- },
1813
- visibleBtn(btn) {
1814
- if (!btn.isVisible) return false;
1815
- if (this.isInlineOperating) return false;
1816
-
1817
- return true;
1818
- },
1819
- /* 打印相关 */
1820
- toSelectPrintObjs(value) {
1821
- let oldtableData = this.oldtableData;
1822
- let selectData = [];
1823
- if (value && value.length) {
1824
- value.forEach(v => {
1825
- let loopNode;
1826
- this.loop(oldtableData, v.my_index, item => {
1827
- loopNode = item;
1828
- });
1829
- selectData.push({
1830
- ...loopNode
1831
- });
1832
- });
1833
- }
1834
- selectData = selectData.map(item => {
1835
- return utils.paramsToPrintValue(item);
1836
- });
1837
-
1838
- return selectData;
1839
- },
1840
- loop(data, theUniqueKey, callback) {
1841
- data.forEach((item, index, arr) => {
1842
- if (item.theUniqueKey === theUniqueKey) {
1843
- return callback(item, index, arr);
1844
- }
1845
- if (item.children) {
1846
- return this.loop(item.children, theUniqueKey, callback);
1847
- }
1848
- });
1849
- },
1850
- getPrintBtnParams(btn) {
1851
- const paramsData = JSON.parse(JSON.stringify(this.paramsData));
1852
- // const selectRows = this.toSelectPrintObjs(paramsData.form.selectRows);
1853
- const setData = JSON.parse(btn.setting);
1854
- let paramsArray = [];
1855
- paramsData.form.selectRows.forEach(i => {
1856
- const obj = {
1857
- table: i
1858
- };
1859
- // paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj })));
1860
- paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj, table: i })));
1861
- });
1862
-
1863
- return paramsArray;
1864
- },
1865
- setPrintNumberToBtnList(printNumberList = [], btnList = []) {
1866
- let cloneList = _.cloneDeep(btnList);
1867
-
1868
- printNumberList.forEach((item, index) => {
1869
- const i = cloneList.findIndex(v => v.settingObj[0].trigger_id == item.id);
1870
- if (i > -1) {
1871
- cloneList[i].__printConfig = {
1872
- number: item.number,
1873
- authorizationKey: item.authorizationKey,
1874
- port: item.port,
1875
- versionType: item.versionType,
1876
- hisParams: { reportid: item.number }
1877
- };
1878
- }
1879
- // cloneList[index].__printConfig = {
1880
- // number: item.number,
1881
- // authorizationKey: item.authorizationKey,
1882
- // port: item.port,
1883
- // versionType: item.versionType,
1884
- // hisParams: { reportid: item.number }
1885
- // };
1886
- });
1887
-
1888
- return cloneList;
1889
- },
1890
- async getPrintNumber(list) {
1891
- if (!list?.length) return;
1892
-
1893
- let ids = list.map(item => item.settingObj[0].trigger_id).join(',');
1894
-
1895
- let printNumberCacheKeys = Object.keys(this.printNumberCache);
1896
- let haveCache = printNumberCacheKeys.includes(ids);
1897
- if (haveCache) {
1898
- let printNumberList = this.printNumberCache[ids];
1899
- this.printBtnStrategys = printNumberList;
1900
- return Promise.resolve(printNumberList);
1901
- }
1902
-
1903
- let res = await this.handleGetConfigApi({ ids }, 'requestGetByIds');
1904
-
1905
- const { status, data } = res;
1906
- if (status) {
1907
- let resList = data?.list || [];
1908
- this.printBtnStrategys = resList;
1909
- list = resList.map(item => {
1910
- return {
1911
- number: item.number,
1912
- authorizationKey: data.authorizationKey,
1913
- versionType: data.versionType,
1914
- port: data.port,
1915
- id: item.id,
1916
- ...item
1917
- };
1918
- });
1919
- let len = list?.length || 0;
1920
- if (len > 0) {
1921
- this.setPrintNumberCache({
1922
- ids,
1923
- list
1924
- });
1925
- }
1926
-
1927
- return list;
1928
- }
1929
- return list;
1930
- },
1931
- async receivePrintSuccessAboutPrint(res, info) {
1932
- const printBtn = this.printBtn;
1933
- const templateId = info.templateId;
1934
- const formatId = info.formatId;
1935
- const number = printBtn.__printConfig.number;
1936
-
1937
- try {
1938
- const print = { formatId, number };
1939
- // 执行打印后置条件
1940
- const result = await this.printConfig.postStepRule(printBtn.settingObj, {
1941
- result: res,
1942
- print: print
1943
- });
1944
-
1945
- if (result.method !== 'sync') return;
1946
- // 同步刷新列表
1947
- this.editTableWrapper?.$refs?.editTable?.getTableList('', false, true, true);
1948
- } catch (error) {
1949
- console.log('error', error);
1950
- }
1951
- },
1952
- async receivePrintSuccess(res, info) {
1953
- if (info.type === 'print') {
1954
- await this.receivePrintSuccessAboutPrint(res, info);
1955
- }
1956
- setTimeout(() => {
1957
- this.$message.success(res.message);
1958
- }, 3500);
1959
- },
1960
- receivePrintError(res) {
1961
- let errorMsg = res.message;
1962
- res.errinfo && (errorMsg += `:${res.errinfo}`);
1963
- this.$message.error(errorMsg);
1964
- },
1965
- resetAllPrintFnWatch() {
1966
- let keys = Object.keys(this.printBtnPrevFnWatch);
1967
- keys.forEach(key => {
1968
- if (!this.printBtnPrevFnWatch[key]) return false;
1969
- this.printBtnPrevFnWatch[key]();
1970
- this.printBtnPrevFnWatch[key] = null;
1971
- delete this.printBtnPrevFnWatch[key];
1972
- });
1973
- },
1974
- printBtnPrevFnWatchSetTimeout(reject) {
1975
- if (this.printBtnPrevFnWatchTimeoutTimer) {
1976
- clearTimeout(this.printBtnPrevFnWatchTimeoutTimer);
1977
- this.printBtnPrevFnWatchTimeoutTimer = null;
1978
- }
1979
-
1980
- this.printBtnPrevFnWatchTimeoutTimer = setTimeout(() => {
1981
- this.resetAllPrintFnWatch();
1982
- reject();
1983
- }, 10000);
1984
- },
1985
- printBtnPrevFn(clickBtn, btn, type, j) {
1986
- return new Promise((resolve, reject) => {
1987
- /*
1988
- 触发原按钮流程,在EditTable中触发原打印按钮节点时,修改[printPrevFinish]状态
1989
- 触发watch,再执行Promise.resolve()
1990
- */
1991
- this.clickBtn(clickBtn, btn, clickBtn.my_index, true, j);
1992
- const timestamp = Date.now();
1993
-
1994
- this.resetAllPrintFnWatch();
1995
- this.printPrevFinish = false;
1996
-
1997
- this.printBtnPrevFnWatch[timestamp] = this.$watch('printPrevFinish', val => {
1998
- if (!this.printBtnPrevFnWatch[timestamp]) return false;
1999
- this.resetAllPrintFnWatch();
2000
- resolve();
2001
- });
2002
-
2003
- this.printBtnPrevFnWatchSetTimeout(reject);
2004
- });
2005
- },
2006
- inlineEditClick() {
2007
- let { btnName, tipsMsg, isTips } = this.curBatchBtnData || {};
2008
- let _this = this;
2009
- // 保存是否需要提示
2010
- if (isTips != 1) {
2011
- this.setBatchSaveRowStatus(true);
2012
- return;
2013
- }
2014
- this.$confirm({
2015
- title: tipsMsg || `是否确认${btnName}`,
2016
- okText: '确定',
2017
- cancelText: '取消',
2018
- onOk: () => {
2019
- _this.setBatchSaveRowStatus(true);
2020
- },
2021
- onCancel() {}
2022
- });
2023
- },
2024
-
2025
- /**
2026
- * 获取外显检索的默认值设置
2027
- */
2028
- handleGetOutSearchInitValue() {
2029
- if (this.outSearchFieldList.some(v => !!v.explicitDefaultVal)) {
2030
- let conObj = this.getConObjParams() || [];
2031
- return conObj;
2032
- }
2033
-
2034
- return [];
2035
- },
2036
-
2037
- getFiledRandom_key(el) {
2038
- // 初始化
2039
- const showSetting = el?.settingObj?.showSetting || [];
2040
- let f = !this.$utils.isEmpty(el?.settingObj?.wordbook);
2041
- if (!showSetting?.length && f) {
2042
- return Math.random().toString();
2043
- }
2044
- return '11';
2045
- },
2046
-
2047
- inlineEditCancel() {
2048
- this.setBatchCancelRowStatus(true);
2049
- },
2050
-
2051
- setBatchSaveRowStatus(f) {
2052
- this.$emit('setBatchSaveRowStatus', f);
2053
- },
2054
-
2055
- setBatchCancelRowStatus(f) {
2056
- this.$emit('setBatchCancelRowStatus', f);
2057
- },
2058
-
2059
- setPrintNumberCache(obj) {
2060
- this.$emit('setPrintNumberCache', obj);
2061
- },
2062
-
2063
- getRef(key){
2064
- let ref = this.$refs[key];
2065
- if(Array.isArray(ref)){
2066
- return ref[0];
2067
- }
2068
- return ref;
2069
- },
2070
-
2071
- /**
2072
- * 赋值给检索外显
2073
- */
2074
- async setOutFilterValues(obj){
2075
- if(typeof obj === 'object'){
2076
-
2077
- const outObj = this.outSearchFieldList.reduce((pre,cur)=>{
2078
- cur.columnName && (pre[cur.columnName]=cur)
2079
- return pre;
2080
- },{});
2081
-
2082
- // 遍历对象赋值
2083
- Object.keys(obj).forEach(k=>{
2084
- let val = obj[k];
2085
- let item = outObj[k] || {}
2086
- if(vexutils.isObject(val)){
2087
- let ks = ['bigValue','lessValue'];
2088
- ks.forEach(kk=>{
2089
- this.$set(item,kk,val[kk]);
2090
- })
2091
- } else {
2092
- this.$set(item,'value',val);
2093
- }
2094
- // 检索组件,触发检索方法
2095
- if (item?.comType == "SelectMuiWordBook"){
2096
- this.setSelectMuiWordBookType(item,val)
2097
- }
2098
- })
2099
-
2100
- await this.$nextTick();
2101
- this.outFilterChange()
2102
- }
2103
- },
2104
-
2105
- setSelectMuiWordBookType(item,val){
2106
- if(Array.isArray(item.dataSource)){
2107
- let f = item.dataSource.find(v=>v.myName == val);
2108
- if(f) return
2109
- }
2110
- let rKey = item.columnName + item.random_key
2111
- let ref = this.getRef(rKey);
2112
- ref && ref.handleWordBookSearch(val,item)
2113
- }
2114
-
2115
- /* */
2116
- },
2117
- watch: {
2118
- // 平铺列表 watch 触发 导致请求发很多次
2119
- // 注释掉tableId 之后有问题请使用另外的方法解决, 不要再使用watch触发
2120
- // tableId: {
2121
- // immediate: true,
2122
- // deep: true,
2123
- // handler(val) {
2124
- // val && this.getTableCondiTionListRequest(true);
2125
- // }
2126
- // },
2127
- viewList: {
2128
- deep: true,
2129
- immediate: true,
2130
- handler() {
2131
- if (this.viewList.length > 0) {
2132
- let curItem;
2133
- let hasListType = true;
2134
- this.viewList.forEach(v => {
2135
- if (v.mark == 1) {
2136
- curItem = v.id;
2137
- }
2138
- if (v.id == '0') {
2139
- hasListType = false;
2140
- }
2141
- });
2142
- hasListType &&
2143
- this.viewList.push({
2144
- id: '0',
2145
- name: '列表模式' || this.$t('1.1.5.4')
2146
- });
2147
- // 查找默认值
2148
- // let curItem = this.viewList.find(v => v.mark == 1);
2149
- this.currentTempId = curItem || '0';
2150
-
2151
- // 按钮打卡视图列表
2152
- let tableViewId = this.optionsValue('tableViewId');
2153
- let onlyOpenView = this.optionsValue('hideViewList') && tableViewId;
2154
- if (onlyOpenView) {
2155
- this.currentTempId = tableViewId;
2156
- }
2157
- // this.handlerSelectTemp(this.currentTempId);
2158
- this.$emit('handlerChangeView', this.currentTempId);
2159
- } else {
2160
- this.currentTempId = '0';
2161
- // this.handlerSelectTemp(this.currentTempId);
2162
- this.editTableSource != 'relatedComponent' && this.$emit('handlerChangeView', this.currentTempId);
2163
- }
2164
- }
2165
- },
2166
- getIsTile: {
2167
- immediate: true,
2168
- handler(val) {
2169
- if (val === undefined) return;
2170
- this.isTile = val;
2171
- }
2172
- },
2173
- rowBtnList: {
2174
- immediate: true,
2175
- deep: true,
2176
- handler() {
2177
- this.formatRowBtnList();
2178
- this.handleOtherConfigInit();
2179
- }
2180
- },
2181
- initPageResize: {
2182
- immediate: true,
2183
- deep: true,
2184
- handler(val) {
2185
- if (!val || !Object.keys(val).length) return;
2186
- if (this.isButtonFolding || this.isShowSetting('buttonAdaption')) return;
2187
- let { classificationIndex } = val;
2188
- if (classificationIndex < 0) return;
2189
- this.pageResize({});
2190
- }
2191
- },
2192
- relatedBaseInfo: {
2193
- immediate: true,
2194
- deep: true,
2195
- handler(val) {
2196
- if (!val || !Object.keys(val).length) return;
2197
- let { buttonList } = val;
2198
- if (!buttonList || !buttonList.length) return;
2199
- this.getRowTileBtnList(buttonList);
2200
- }
2201
- },
2202
- searchFieldList: {
2203
- immediate: true,
2204
- deep: true,
2205
- handler(val) {
2206
- if (val && val.length > 0) {
2207
- this.initOutSearchFieldList();
2208
- }
2209
- }
2210
- },
2211
- tabConditionNumObj: {
2212
- immediate: true,
2213
- deep: true,
2214
- handler(val) {
2215
- if (this.conditionType === 'keyword' && val && Object.keys(val).length > 0) {
2216
- this.tabConditionList.length > 0 &&
2217
- this.tabConditionList.forEach(item => {
2218
- if (val[item.sid] !== undefined) this.$set(item, 'digital', val[item.sid]);
2219
- });
2220
- }
2221
- }
2222
- },
2223
- searchPlaceHolder: {
2224
- immediate: true,
2225
- handler(val) {
2226
- if (!val || this.showRelatedTreeBtn) return;
2227
- this.$nextTick(() => {
2228
- this.showPlaceholderPrefix = false;
2229
- let dom = this.$refs.baseSearchPlaceholderSpan;
2230
- if (!dom) return;
2231
- // input 框有padding 32px ...显示需要多预留一些宽度12px
2232
- let w = dom.offsetWidth + 45;
2233
- // 非筛选外显input 有enterButton 预留宽度
2234
- if (!this.showOutSearch) {
2235
- w += 45;
2236
- }
2237
- let maxW = 300;
2238
- this.inputSearchW = w > maxW ? maxW : w < 200 ? 200 : w;
2239
- if (w > maxW) {
2240
- this.showPlaceholderPrefix = true;
2241
- }
2242
- this.onResize();
2243
- });
2244
- }
2245
- }
2246
- }
2247
- });
2248
- </script>
2249
-
2250
- <style lang="less" scoped>
2251
- .base-search {
2252
- flex: 1;
2253
- .base-container {
2254
- display: flex;
2255
- justify-content: space-between;
2256
- text-align: left;
2257
- background: #fff;
2258
- }
2259
- .bease-left {
2260
- display: flex;
2261
- justify-content: flex-start;
2262
- align-items: flex-start;
2263
- flex: 1;
2264
- .btn-custom-wrap {
2265
- width: 100%;
2266
- display: flex;
2267
- justify-content: flex-end;
2268
- align-items: flex-start;
2269
- }
2270
- }
2271
- .base-tabs {
2272
- display: flex;
2273
- align-items: center;
2274
- border-bottom: 1px solid #d5d5d5;
2275
- margin-bottom: 8px;
2276
- .base-tabs-item {
2277
- padding: 7px 16px;
2278
- font-size: 14px;
2279
- color: #212121;
2280
- font-weight: 400;
2281
- cursor: pointer;
2282
- border-bottom: 1px solid transparent;
2283
- }
2284
- .base-tabs-item-active {
2285
- color: #2d7aff;
2286
- border-bottom: 1px solid #2d7aff;
2287
- }
2288
- }
2289
- ul {
2290
- display: flex;
2291
- align-items: center;
2292
- flex-wrap: wrap;
2293
- margin-top: 8px;
2294
- li {
2295
- display: inline-block;
2296
- /deep/ .search-default {
2297
- height: 32px;
2298
- line-height: 32px;
2299
- margin-bottom: 8px;
2300
- margin-right: 8px;
2301
- border-color: #d5d5d5;
2302
- color: #212121;
2303
- .ant-btn {
2304
- border-color: #d5d5d5;
2305
- color: #212121;
2306
- }
2307
- }
2308
- /deep/ .out-filter-input {
2309
- width: 200px;
2310
- margin: 0 8px 8px 0;
2311
- .ant-input-wrapper {
2312
- .ant-input-group-addon {
2313
- border: 1px solid #d9d9d9 !important;
2314
- border-left: 0 !important;
2315
- }
2316
- }
2317
- }
2318
- .my-input-search {
2319
- vertical-align: middle;
2320
- position: relative;
2321
- top: -1px;
2322
- margin-bottom: 8px;
2323
- margin-right: 8px;
2324
- height: 32px;
2325
- /deep/ .ant-input {
2326
- margin-top: 1px;
2327
- border-right: 0 !important;
2328
- &:hover {
2329
- & + .ant-input-suffix {
2330
- .ant-input-search-icon {
2331
- color: #579aff;
2332
- }
2333
- }
2334
- }
2335
- }
2336
- /deep/ .ant-input-group-addon {
2337
- padding: 0;
2338
- border: 0 !important;
2339
- vertical-align: bottom;
2340
- .ant-btn {
2341
- border-top-left-radius: 0;
2342
- border-bottom-left-radius: 0;
2343
- }
2344
- }
2345
- .svg-icon {
2346
- margin-right: 0;
2347
- font-size: 16px;
2348
- }
2349
- }
2350
- .mr8 {
2351
- margin-right: 8px;
2352
- margin-bottom: 8px;
2353
- }
2354
- .mr12 {
2355
- margin-right: 12px;
2356
- margin-bottom: 8px;
2357
- }
2358
- .ml12 {
2359
- margin-left: 12px;
2360
- margin-bottom: 8px;
2361
- }
2362
- &.related-search-input {
2363
- /deep/ .my-input-search {
2364
- width: 40px;
2365
- .ant-input-affix-wrapper {
2366
- width: 0px;
2367
- .ant-input {
2368
- width: 0;
2369
- outline: none;
2370
- box-shadow: none;
2371
- &:focus {
2372
- outline: none;
2373
- }
2374
- }
2375
- .ant-input:not(:last-child) {
2376
- padding: 0px;
2377
- border: 0px !important;
2378
- }
2379
- .ant-input-suffix {
2380
- i {
2381
- display: none;
2382
- }
2383
- }
2384
- }
2385
- .ant-input-group-addon {
2386
- .ant-btn {
2387
- border-top-left-radius: 4px;
2388
- border-bottom-left-radius: 4px;
2389
- }
2390
- }
2391
- }
2392
- }
2393
- &.related-search-input-expand {
2394
- transition: width 0.2s;
2395
- /deep/ .my-input-search {
2396
- width: 215px;
2397
- .ant-input-affix-wrapper {
2398
- .ant-input-suffix {
2399
- i {
2400
- display: inline-block;
2401
- }
2402
- }
2403
- }
2404
- }
2405
- }
2406
- }
2407
- .dropdown-button {
2408
- color: #212121;
2409
- border-color: #d5d5d5 !important;
2410
- margin-left: 8px;
2411
- margin-bottom: 8px;
2412
- /deep/ .svg-icon {
2413
- margin-right: 4px;
2414
- }
2415
- &.ant-dropdown-trigger {
2416
- i.anticon.anticon-down {
2417
- color: #969696;
2418
- font-size: 14px;
2419
- }
2420
- }
2421
- }
2422
- .baseSearch-input-search {
2423
- .input-search-com {
2424
- input {
2425
- padding: 4px 8px;
2426
- }
2427
- .search-placeholder-icon {
2428
- color: #b4b4b4;
2429
- }
2430
- }
2431
- }
2432
- }
2433
- /deep/ .num-picker {
2434
- position: relative;
2435
- display: flex;
2436
- &.num-picker-unit {
2437
- padding-right: 20px;
2438
- }
2439
- input {
2440
- text-align: left !important;
2441
- }
2442
- &:hover {
2443
- .clear-number-icon {
2444
- display: block;
2445
- }
2446
- }
2447
- /deep/ .ant-calendar-range-picker-input {
2448
- text-align: left;
2449
- }
2450
- .clear-number-icon {
2451
- position: absolute;
2452
- right: 5px;
2453
- top: 6px;
2454
- display: none;
2455
- cursor: pointer;
2456
- z-index: 1000;
2457
- }
2458
- }
2459
- .btn-row {
2460
- display: inline-flex;
2461
- line-height: 32px;
2462
- height: 32px;
2463
- // padding: 0 10px;
2464
- padding-right: 8px;
2465
- margin-bottom: 8px;
2466
- transform: translateZ(0);
2467
- .mgl-10 {
2468
- margin-left: 10px;
2469
- }
2470
- &.min-width {
2471
- min-width: 212px;
2472
- }
2473
- /deep/ .ant-select-selection__rendered {
2474
- color: #212121;
2475
- font-size: 14px;
2476
- }
2477
- /deep/ .ant-select-arrow {
2478
- i {
2479
- color: #969696;
2480
- font-size: 12px;
2481
- }
2482
- }
2483
- .btn-setting {
2484
- margin-right: 4px;
2485
- }
2486
- .viewList-button {
2487
- display: flex;
2488
- align-items: center;
2489
- justify-content: center;
2490
- padding: 0 12px;
2491
- }
2492
- }
2493
- .search-tile {
2494
- max-width: 100%;
2495
- max-height: 74px;
2496
- overflow-x: auto;
2497
- /deep/ .ant-btn {
2498
- margin-right: 10px;
2499
- margin-bottom: 5px;
2500
- }
2501
- }
2502
-
2503
- .psw-icon {
2504
- cursor: pointer;
2505
- &:active {
2506
- color: #5585f5;
2507
- // #2474ff
2508
- }
2509
- color: #969696;
2510
- }
2511
-
2512
- ::-webkit-input-placeholder {
2513
- /* WebKit browsers */
2514
- font-family: 'Avenir', Helvetica, Arial, sans-serif;
2515
- }
2516
-
2517
- ::-moz-placeholder {
2518
- /* Mozilla Firefox 19+ */
2519
- font-family: 'Avenir', Helvetica, Arial, sans-serif;
2520
- }
2521
-
2522
- :-ms-input-placeholder {
2523
- /* Internet Explorer 10+ */
2524
- font-family: 'Avenir', Helvetica, Arial, sans-serif;
2525
- }
2526
- .baseSearchPlaceholderSpan {
2527
- visibility: hidden;
2528
- position: absolute;
2529
- z-index: -1;
2530
- }
2531
- }
2532
- </style>
2533
- <style lang="less">
2534
- .rowFoldHideBtnList-dropdown {
2535
- .ant-dropdown-menu {
2536
- overflow-y: auto;
2537
- max-height: 99vh;
2538
- }
2539
- .ant-dropdown-menu-item-group {
2540
- .ant-dropdown-menu-item-group-title {
2541
- display: none;
2542
- }
2543
- border-bottom: 1px solid #d5d5d5;
2544
- &:last-child {
2545
- border-color: transparent;
2546
- }
2547
- }
2548
- }
2549
- .viewList-dropdown {
2550
- min-width: 120px;
2551
- .ant-dropdown-menu-item {
2552
- display: flex;
2553
- justify-content: space-between;
2554
- align-items: center;
2555
- color: #2e2e2e;
2556
- margin: 1px 0;
2557
- &:hover {
2558
- background: #f2f2f2;
2559
- }
2560
- > span {
2561
- display: inline;
2562
- width: 85%;
2563
- text-overflow: ellipsis;
2564
- white-space: nowrap;
2565
- overflow: hidden;
2566
- }
2567
- }
2568
- .ant-dropdown-menu-item.menu-active {
2569
- color: #2d7aff;
2570
- }
2571
- }
2572
- </style>
1
+ <template>
2
+ <div class="base-search">
3
+ <div class="base-container">
4
+ <div class="bease-left" ref="baseLeft" v-resize="onResize">
5
+ <!-- 行内编辑对应生成的(保存、取消)按钮 -->
6
+ <template v-if="visibleInlineOperateBtn">
7
+ <div class="btn-custom-wrap">
8
+ <a-button
9
+ v-preventReClick="preventReTime"
10
+ :style="{ display: isInlineOperating ? 'inline-block' : 'none' }"
11
+ @click="inlineEditClick"
12
+ class="btn-custom-class"
13
+ style="margin: 8px 8px 8px 0"
14
+ type="primary"
15
+ >
16
+ 保存
17
+ </a-button>
18
+ <a-button
19
+ v-preventReClick="preventReTime"
20
+ :style="{ display: isInlineOperating ? 'inline-block' : 'none' }"
21
+ @click="inlineEditCancel"
22
+ class="btn-custom-class"
23
+ style="margin: 8px 8px 8px 0"
24
+ >
25
+ 取消
26
+ </a-button>
27
+ </div>
28
+ </template>
29
+ <ul v-if="!visibleInlineOperateBtn && !isRowEditing">
30
+ <div ref="btnRow" class="btn-row" v-if="isShowSettingBtn">
31
+ <a-button class="btn-setting" v-show="currentTempId != '0' && isShowSetting('hideSettingBtn')" icon="setting" @click="handlerSetting">
32
+ 设置
33
+ <!-- {{ $t("1.1.5.3") }} -->
34
+ </a-button>
35
+ <a-dropdown overlayClassName="viewList-dropdown" v-if="showViewList">
36
+ <a-button class="viewList-button">
37
+ <svg-icon :icon-class="'anniuqiehuanmoshi'" style="font-size: 22px"></svg-icon>
38
+ </a-button>
39
+ <a-menu slot="overlay">
40
+ <a-menu-item v-for="(item, index) in viewList" :value="item.id" :key="index" @click="handlerSelectTemp(item.id)" :class="{ 'menu-active': currentTempId === item.id }">
41
+ <span>{{ item.name }}</span>
42
+ <!-- <a-icon v-if="currentTempId === item.id" type="check" /> -->
43
+ </a-menu-item>
44
+ </a-menu>
45
+ </a-dropdown>
46
+ </div>
47
+ <slot name="classification"></slot>
48
+ <li v-if="showQuickSearch" ref="quickSearchLi">
49
+ <a-button class="search-default" type="default" @click="foldQuickSearch">
50
+ <svg-icon icon-class="anniushaixuan" style="color: #2463F4; margin-right: 6px"></svg-icon>
51
+ 筛选 {{ qqConObjCount ? `(${qqConObjCount})` : '' }}
52
+ </a-button>
53
+ </li>
54
+ <!-- start--筛选外显--start -->
55
+ <template v-for="item in outSearchFieldList">
56
+ <outQuickSearch :key="item.id + item.random_key" :item="item" :ref="item.columnName + item.random_key" :filterApiConfig="filterApiConfigOutSearch" @outFilterChange="outFilterChange"></outQuickSearch>
57
+ </template>
58
+ <!-- end--筛选外显--end -->
59
+
60
+ <!-- start--筛选外显 跨表--start -->
61
+ <template v-for="relationItem in outRelationQuickSearch">
62
+ <template v-for="item in relationItem.fieldList">
63
+ <outQuickSearch :key="item.id" :item="item" :filterApiConfig="filterApiConfigOutSearch" @outFilterChange="outFilterChange"></outQuickSearch>
64
+ </template>
65
+ </template>
66
+ <!-- end--筛选外显 跨表--end -->
67
+
68
+ <li v-if="isShowSetting('hideSearch') && !showRelatedTreeBtn" ref="inputSearchLi" class="baseSearch-input-search">
69
+ <template v-if="outSearchFieldList && outSearchFieldList.length">
70
+ <slot name="searchInput" :width="(searchInputWidth || inputSearchW)" :searchPlaceHolder="searchPlaceHolder" :showPlaceholderPrefix="showPlaceholderPrefix" :type="'outSearch'">
71
+ <a-input
72
+ :style="{ width: (searchInputWidth || inputSearchW) + 'px', margin: '0 8px 8px 0' }"
73
+ allowClear
74
+ :placeholder="searchPlaceHolder"
75
+ :value="currentValue"
76
+ @input="$emit('input', $event.target.value)"
77
+ @pressEnter="outFilterChange"
78
+ class="input-search-com"
79
+ >
80
+ <template slot="prefix" v-if="showPlaceholderPrefix">
81
+ <a-tooltip :title="searchPlaceHolder" overlayClassName="basesearch-placeholder-tooltip">
82
+ <a-icon type="info-circle" class="search-placeholder-icon" />
83
+ </a-tooltip>
84
+ </template>
85
+ </a-input>
86
+ </slot>
87
+ </template>
88
+
89
+ <template v-else>
90
+ <slot name="searchInput" :width="(searchInputWidth || inputSearchW)" :searchPlaceHolder="searchPlaceHolder" :showPlaceholderPrefix="showPlaceholderPrefix" :type="'default'">
91
+ <a-input-search
92
+ class="my-input-search input-search-com"
93
+ :style="{ width: (searchInputWidth || inputSearchW) + 'px' }"
94
+ @search="onSearch"
95
+ allowClear
96
+ :placeholder="searchPlaceHolder"
97
+ :value="currentValue"
98
+ @input="$emit('input', $event.target.value)"
99
+ >
100
+ <template slot="prefix" v-if="showPlaceholderPrefix">
101
+ <a-tooltip :title="searchPlaceHolder" overlayClassName="basesearch-placeholder-tooltip">
102
+ <a-icon type="info-circle" class="search-placeholder-icon" />
103
+ </a-tooltip>
104
+ </template>
105
+ <a-button slot="enterButton" type="primary">
106
+ <svg-icon icon-class="xitongtubiaosousuo"></svg-icon>
107
+ </a-button>
108
+ </a-input-search>
109
+ </slot>
110
+ </template>
111
+
112
+ </li>
113
+ <li v-if="outSearchFieldList && outSearchFieldList.length">
114
+ <a-button type="primary" @click="outFilterChange" style="margin: 0 8px 8px 0">
115
+ <a-icon type="search" style="margin-right: 6px" />
116
+ 查询
117
+ </a-button>
118
+ </li>
119
+ <li v-if="showResetFilterBtn">
120
+ <a-button @click="handleReset" style="margin: 0 8px 8px 0">
121
+ <svg-icon icon-class="xitongtubiaoliebiaocaozuoanniushanchu" style="margin-right: 6px"></svg-icon>
122
+ 重置
123
+ </a-button>
124
+ </li>
125
+
126
+ <!-- 批量选择 -->
127
+ <li v-if="isCard">
128
+ <a-button v-if="isCardNewBatch" type="primary" @click="() =>changeCardNewBatch(false)" style="margin: 0 8px 8px 0">
129
+ 取消批量选择
130
+ </a-button>
131
+ <a-button v-else type="primary" @click="() =>changeCardNewBatch(true)" style="margin: 0 8px 8px 0">
132
+ 批量选择
133
+ </a-button>
134
+ </li>
135
+
136
+ <!-- 平铺列表 tree -->
137
+ <template v-if="showRelatedTreeBtn">
138
+ <li v-if="showRelatedSearch" :class="[isRelatedSearchFold ? 'related-search-input' : 'related-search-input-expand']">
139
+ <slot name="searchInput" :searchPlaceHolder="searchPlaceHolder" :showPlaceholderPrefix="showPlaceholderPrefix" :type="'relatedTreeSearch'" :isRelatedSearchFold="isRelatedSearchFold" >
140
+ <a-input-search
141
+ ref="relatedSearchInput"
142
+ class="my-input-search my-input-search-related"
143
+ placeholder="请输入关键字搜索"
144
+ @search="onRelatedSearch"
145
+ allowClear
146
+ :value="currentValue"
147
+ @input="$emit('input', $event.target.value)"
148
+ >
149
+ <a-button slot="enterButton" type="primary">
150
+ <a-icon type="search" />
151
+ <!-- <svg-icon icon-class="xitongtubiaosousuo"></svg-icon> -->
152
+ </a-button>
153
+ </a-input-search>
154
+ </slot>
155
+ </li>
156
+ <template v-if="rowTileBtnListTree && rowTileBtnListTree.length === 1">
157
+ <a-button type="primary" style="margin-right: 8px; margin-bottom: 8px" @click="handleAddType(rowTileBtnListTree[0])">
158
+ {{ rowTileBtnListTree[0].alias || rowTileBtnListTree[0].name }}
159
+ </a-button>
160
+ </template>
161
+ <a-dropdown v-if="rowTileBtnListTree.length > 1 && !isInlineOperating">
162
+ <a-menu slot="overlay">
163
+ <template v-for="b in rowTileBtnListTree">
164
+ <a-menu-item :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="handleAddType(b)">
165
+ {{ b.alias || b.name }}
166
+ <a-icon v-if="b.icon" :type="btnObj[b.icon]" />
167
+ <template v-else>
168
+ <svg-icon
169
+ v-if="b.iconSetting"
170
+ :iconClass="JSON.parse(b.iconSetting).icon"
171
+ :style="{
172
+ marginRight: '8px'
173
+ }"
174
+ />
175
+ </template>
176
+ </a-menu-item>
177
+ </template>
178
+ </a-menu>
179
+ <a-button type="primary" ghost style="margin-left: 8px; margin-bottom: 8px">
180
+ <!-- 1.1.8.1.6更多 -->
181
+ {{ '更多' }} ...
182
+ </a-button>
183
+ </a-dropdown>
184
+ </template>
185
+ <template v-if="!nobutton && !showRelatedTreeBtn">
186
+ <template v-if="isButtonFolding">
187
+ <li class="allBtn" v-if="allBtn && allBtn.length" ref="allBtnLi">
188
+ <a-dropdown v-show="!isInlineOperating">
189
+ <a-menu slot="overlay">
190
+ <template v-for="(b, j) in allBtn">
191
+ <a-menu-item :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="showDrawer(b, j)">
192
+ {{ b.alias || b.name }}
193
+ <getBtnIcon :data="b" :btnObj="btnObj" />
194
+ </a-menu-item>
195
+ <a-menu-item
196
+ :key="b.sid"
197
+ v-else-if="showButtonTop == 1 && b.type != 'LINK' && currentTempId == '0'"
198
+ class="dropdown-btn"
199
+ @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)"
200
+ >
201
+ {{ b.showStyle === 'only_icon' ? '' : b.alias || b.name }}
202
+ <getBtnIcon :data="b" :btnObj="btnObj" />
203
+ </a-menu-item>
204
+ </template>
205
+ </a-menu>
206
+ <a-button class="ml12 dropdown-button"
207
+ >{{ '更多' }}
208
+ <a-icon type="down" />
209
+ </a-button>
210
+ </a-dropdown>
211
+ </li>
212
+ </template>
213
+ <template v-else>
214
+ <!-- start--按钮分组--start -->
215
+ <template v-if="isShowGroupBtn">
216
+ <template v-for="(key, i) in groupBtnObj">
217
+ <li :key="i" v-if="key.list && key.list.length > 1" ref="rowTileBtnItem" :data-key="i" data-source="groupBtn">
218
+ <ButtonGroup v-show="!key.isHide" :title="i" :list="key.list" :currentTempId="currentTempId" @showDrawer="showDrawer" @clickGroupBtn="clickGroupBtn"></ButtonGroup>
219
+ </li>
220
+ </template>
221
+ </template>
222
+ <!-- end--按钮分组--end -->
223
+
224
+ <!-- 平铺按钮列表 -->
225
+ <template v-for="(item, j) in rowTileBtnList">
226
+ <!-- v-if="item.type == 'ADD'" -->
227
+ <li ref="rowTileBtnItem" class="rowTileBtn-item 123" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
228
+ <template v-if="item.type == 'ADD' || item.type == 'BATCH'">
229
+ <a-button
230
+ v-preventReClick="preventReTime"
231
+ v-show="visibleBtn(item) && !item.isHide"
232
+ @click.prevent.stop="showDrawer(item, j)"
233
+ class="btn-custom-class"
234
+ style="margin: 0 8px 8px 0"
235
+ :style="$utils.getBtnStyle(item)"
236
+ :type="item.showStyle == 'none_bg' || item.showStyle === 'only_icon' ? 'link' : 'primary'"
237
+ :ghost="item.showStyle == 'white_bg'"
238
+ >
239
+ <getBtnIcon :data="item" :btnObj="btnObj" />
240
+ <template v-if="item.showStyle !== 'only_icon'">
241
+ {{ item.alias || item.name }}
242
+ </template>
243
+ </a-button>
244
+ <a-upload v-if="item.isImportGuage" method="post" :show-upload-list="false" :action="`${axios.defaults.baseURL}/guage/importGuage`" @change="handleUploadChange">
245
+ <!-- 上传配置文件 -->
246
+ <a-button
247
+ class="btn-custom-class"
248
+ style="margin: 0 8px 8px 0"
249
+ :style="$utils.getBtnStyle(item)"
250
+ :type="item.showStyle == 'none_bg' || item.showStyle === 'only_icon' ? 'link' : 'primary'"
251
+ :ghost="item.showStyle == 'white_bg'"
252
+ >
253
+ <a-icon type="upload" />
254
+ <template v-if="item.showStyle !== 'only_icon'">
255
+ {{ item.alias || item.name }}
256
+ </template>
257
+ </a-button>
258
+ </a-upload>
259
+ </template>
260
+ <template v-else-if="isShowRowTileBtnItem(item)">
261
+ <a-button
262
+ v-preventReClick="preventReTime"
263
+ v-show="visibleBtn(item) && !item.isHide"
264
+ @click.prevent.stop="clickBtn(clickRowData, item, clickRowData.my_index, undefined, j)"
265
+ class="btn-custom-class"
266
+ style="margin: 0 8px 8px 0"
267
+ :style="$utils.getBtnStyle(item)"
268
+ :type="item.showStyle == 'none_bg' ? 'link' : 'primary'"
269
+ :ghost="item.showStyle == 'white_bg'"
270
+ >
271
+ <getBtnIcon :data="item" :btnObj="btnObj" />
272
+ <template v-if="item.showStyle !== 'only_icon'">
273
+ {{ item.alias || item.name }}
274
+ </template>
275
+ </a-button>
276
+ </template>
277
+ </li>
278
+ </template>
279
+ <!-- 打印列表-->
280
+ <template v-for="(item, j) in rowPrintBtnList">
281
+ <li ref="rowTileBtnItem" class="rowTileBtn-item rowPrintBtn-btn" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
282
+ <template v-if="item.isVisible && !item.isHide">
283
+ <PrintBtn
284
+ v-bind="$attrs"
285
+ :printConfig="printConfig"
286
+ :baseUrl="printConfig.printBaseUrl"
287
+ :strategy="item.strategy"
288
+ :btnText="item.name"
289
+ :versionType="item.__printConfig && item.__printConfig.versionType"
290
+ :port="item.__printConfig && item.__printConfig.port"
291
+ :authorizationKey="item.__printConfig && item.__printConfig.authorizationKey"
292
+ :templateNumber="item.__printConfig && item.__printConfig.number"
293
+ :hisParams="item.__printConfig && item.__printConfig.hisParams"
294
+ :params="getPrintBtnParams(item)"
295
+ :prevFn="() => printBtnPrevFn(clickRowData, item, 2, j)"
296
+ @success="receivePrintSuccess"
297
+ @error="receivePrintError"
298
+ ></PrintBtn>
299
+ </template>
300
+ </li>
301
+ </template>
302
+ <!-- 折叠按钮列表 -->
303
+ <li class="rowFoldBtn" v-if="showRowFoldBtnList(rowFoldBtnList, 'rowFoldBtnList')">
304
+ <a-dropdown overlayClassName="baseSearch-fold-dropdown" v-show="!isInlineOperating">
305
+ <a-menu slot="overlay">
306
+ <template v-for="(b, j) in rowFoldBtnList">
307
+ <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" v-if="showLiAdd(b)" @click="showDrawer(b, j)">
308
+ {{ b.alias || b.name }}
309
+ <getBtnIcon :data="b" :btnObj="btnObj" />
310
+ </a-menu-item>
311
+ <template v-else-if="showLiFold(b)">
312
+ <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)">
313
+ {{ b.alias || b.name }}
314
+ <getBtnIcon :data="b" :btnObj="btnObj" />
315
+ </a-menu-item>
316
+ </template>
317
+ </template>
318
+ </a-menu>
319
+ <a-button class="dropdown-button" style="margin: 0 8px 8px 0"
320
+ >{{ '更多' }}
321
+ <a-icon type="down" />
322
+ </a-button>
323
+ </a-dropdown>
324
+ </li>
325
+ <!-- 自适应折叠 -->
326
+ <template v-if="showRowFoldBtnList(rowFoldHideBtnList)">
327
+ <a-dropdown overlayClassName="rowFoldHideBtnList-dropdown" v-show="!isInlineOperating">
328
+ <a-menu slot="overlay">
329
+ <template v-for="(value, key) in rowFoldHideBtnListObj">
330
+ <a-menu-item-group :key="key" v-if="showRowFoldBtnList(value.list)">
331
+ <template slot="title"></template>
332
+ <template v-for="(b, j) in value.list">
333
+ <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="showDrawer(b, j)">
334
+ {{ b.alias || b.name }}
335
+ <getBtnIcon :data="b" :btnObj="btnObj" />
336
+ </a-menu-item>
337
+ <template v-else-if="b.type != 'LINK' && currentTempId == '0'">
338
+ <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)">
339
+ {{ b.alias || b.name }}
340
+ <getBtnIcon :data="b" :btnObj="btnObj" />
341
+ </a-menu-item>
342
+ </template>
343
+ </template>
344
+ </a-menu-item-group>
345
+ </template>
346
+ </a-menu>
347
+ <a-button class="dropdown-button" style="margin: 0 8px 8px 0"
348
+ >{{ '更多' }}
349
+ <a-icon type="down" />
350
+ </a-button>
351
+ </a-dropdown>
352
+ </template>
353
+ </template>
354
+ </template>
355
+ </ul>
356
+ </div>
357
+ </div>
358
+ <div class="base-tabs" v-if="showBaseTabs">
359
+ <div v-for="(item, index) in tabConditionList" :key="index" :class="tabIndex === index ? 'base-tabs-item base-tabs-item-active' : 'base-tabs-item'" @click="tabClick(index)"
360
+ >{{ item.name }} {{ countTabCondition == 1 && (item.digital || item.digital === 0) ? '(' + (item.digital || 0) + ')' : '' }}</div
361
+ >
362
+ </div>
363
+ <!-- palceholder 文字宽度计算 -->
364
+ <span class="baseSearchPlaceholderSpan" ref="baseSearchPlaceholderSpan">
365
+ {{ searchPlaceHolder }}
366
+ </span>
367
+ </div>
368
+ </template>
369
+
370
+ <script>
371
+ /**
372
+ * 完成搜索组合组件 BaseSearch
373
+ * 使用方式:在需要的vue页中引入注册为子组件后直接使用
374
+ * 提供函数:
375
+ * 1、输入关键字搜索触发函数onSearch;
376
+ * 2、左侧下拉选中搜索触发函数changeSearch;
377
+ * 3、右侧快速弹框保存搜索函数onSave(obj);
378
+ * 完整例子:<BaseSearch :onSearch='onSearch' @changeSearch='changeSearch' @onSave='onSave'/>
379
+ */
380
+
381
+ /**
382
+ * slot:searchInput
383
+ * width: {number}宽度
384
+ * searchPlaceHolder:{string} 检索 input 的placeHolder
385
+ * showPlaceholderPrefix: {boolean} input 是否展示前缀icon
386
+ * isRelatedSearchFold: {boolean} 平铺列表树状表的检索框是否收起
387
+ * type:{string} relatedTreeSearch(平铺列表树状表)/outSearch(检索外显)/default(默认)
388
+ */
389
+
390
+ import moment from 'moment';
391
+ import 'moment/locale/zh-cn';
392
+
393
+ import _ from 'lodash';
394
+ import vexutils from '@/utils/vexutils';
395
+ import { Button, Icon, Dropdown, Select, Upload, DatePicker, Input, Menu } from 'ant-design-vue';
396
+ import resize from 'vue-resize-directive';
397
+
398
+ import { GROUP_TITLE_KEY } from '../const';
399
+
400
+ import PrintBtn from '~/button/src/ButtonPrint/index';
401
+ // import stepRule from "@/components/table/mixins/stepRule";
402
+
403
+ import outQuickSearch from '../components/out-quick-search/out-quick-search';
404
+ import utils from '@/utils/utils-map';
405
+ import { durationMixin, $utils, filterApiFn, outQuickSearchFn } from '../mixins/mixins';
406
+ import tableSearchCon from '../mixins/tableSearchCon';
407
+ import svgIcon from '@/component/svg/index.vue';
408
+ import 'text-security/text-security.css';
409
+ import create from '@/core/create';
410
+ import preventReClick from '@/directive/preventReClick';
411
+ /** 获取按钮 icon */
412
+ import getBtnIcon from '../components/button-icon/getBtnIcon.js';
413
+ import ButtonGroup from '../components/button-group/ButtonGroup.vue';
414
+
415
+ const EVALUATEList = [
416
+ {
417
+ label: '一星',
418
+ value: '1',
419
+ isSelect: false
420
+ },
421
+ {
422
+ label: '二星',
423
+ value: '2',
424
+ isSelect: false
425
+ },
426
+ {
427
+ label: '三星',
428
+ value: '3',
429
+ isSelect: false
430
+ },
431
+ {
432
+ label: '四星',
433
+ value: '4',
434
+ isSelect: false
435
+ },
436
+ {
437
+ label: '五星',
438
+ value: '5',
439
+ isSelect: false
440
+ }
441
+ ];
442
+
443
+ const BTNOBJ = {
444
+ // 按钮icon 映射
445
+ copy: 'copy',
446
+ pencil: 'edit',
447
+ delete: 'delete',
448
+ add: 'plus-circle',
449
+ download: 'download',
450
+ label: 'tag',
451
+ queding: 'check',
452
+ del: 'close'
453
+ };
454
+
455
+ export default create({
456
+ name: 'base-search',
457
+ mixins: [durationMixin, $utils, filterApiFn, tableSearchCon, outQuickSearchFn],
458
+ directives: { resize, preventReClick },
459
+ props: {
460
+ width: {
461
+ default: '400px'
462
+ },
463
+ searchInputWidth: {
464
+ // 设置检索框的宽度
465
+ type: Number,
466
+ default: 0
467
+ },
468
+ onSearch: Function,
469
+ rowBtnList: {
470
+ type: Array,
471
+ default: () => []
472
+ },
473
+ paramsData: Object,
474
+ // downLoad: Function,
475
+ showButtonTop: [String, Number],
476
+ showSettings: {
477
+ type: Object,
478
+ default: () => ({})
479
+ },
480
+ clickRowData: Object,
481
+ value: String,
482
+ searchFieldList: {
483
+ // 搜索的数据
484
+ type: Array,
485
+ default: () => []
486
+ },
487
+ searchFieldLimit: {
488
+ // 搜索的数据的限制条件
489
+ type: Object,
490
+ default: () => ({})
491
+ },
492
+ viewList: {
493
+ type: Array,
494
+ default: () => []
495
+ },
496
+ TypeOfDisplay: {
497
+ type: String,
498
+ default: ''
499
+ },
500
+ tableAllCheck: {
501
+ type: Boolean
502
+ },
503
+ classificationIndex: Number,
504
+ editTableSource: {
505
+ default: ''
506
+ },
507
+ showRelatedTreeBtn: Boolean,
508
+ relatedBaseInfo: Object,
509
+ onRelatedSearch: Function,
510
+ showResetFilterBtn: {
511
+ type: Boolean,
512
+ default: false
513
+ },
514
+ qqConObjCount: {
515
+ type: Number,
516
+ default: 0
517
+ },
518
+ conditionType: { type: String },
519
+ countCondition: { type: [Number, String] },
520
+ countTabCondition: { type: Number },
521
+ tabConditionNumObj: {
522
+ type: Object,
523
+ default: () => {}
524
+ },
525
+ isRelatedSearchFold: {
526
+ type: Boolean,
527
+ default: true
528
+ },
529
+ tableId: { type: String },
530
+ conditionMap: {
531
+ type: Object,
532
+ default: () => {}
533
+ },
534
+ getFilterData: Function,
535
+ oldtableData: Array,
536
+ isNestTableClick: Boolean,
537
+
538
+ isAdmin: {
539
+ type: Boolean,
540
+ default: false
541
+ },
542
+
543
+ /**
544
+ * 导入量表配置
545
+ */
546
+ importGuageConfig: {
547
+ type: Object,
548
+ default: () => ({
549
+ action: ''
550
+ })
551
+ },
552
+
553
+ /**
554
+ * 打印配置
555
+ */
556
+ printConfig: {
557
+ type: Object,
558
+ default: () => ({
559
+ printBaseUrl: '/print/assembly',
560
+ postStepRule: () => Promise.resolve({})
561
+ })
562
+ },
563
+
564
+ gettersConfig: {
565
+ type: Object,
566
+ default: () => ({
567
+ getIsTile: '',
568
+ selectRowObj: [],
569
+ isInlineOperating: false,
570
+ printNumberCache: {}
571
+ })
572
+ },
573
+
574
+ /**
575
+ * 是否展示行编辑的按钮
576
+ */
577
+ visibleInlineOperateBtn: {
578
+ type: Boolean,
579
+ default: false
580
+ },
581
+
582
+ tabConditionList: {
583
+ type: Array,
584
+ default: () => []
585
+ },
586
+
587
+ lastOutSearchFieldList: {
588
+ type: Array,
589
+ default: () => []
590
+ },
591
+ lastOutRelationQuickSearch: {
592
+ type: Array,
593
+ default: () => []
594
+ },
595
+ relationTableList: {
596
+ type: Array,
597
+ default: () => []
598
+ },
599
+ /**
600
+ * 筛选外显
601
+ */
602
+ filterApiConfigOutSearch: {
603
+ type: Object,
604
+ default: () => ({})
605
+ },
606
+ useFieldList: Array,
607
+ editTableUid: [String, Number],
608
+
609
+ preventReTime: {
610
+ type: Number,
611
+ default: 1000
612
+ },
613
+ isCardNewBatch: {type: Boolean, deafult: false},
614
+ isBatchSelect: {type: [Number, Boolean, String], default: ''}
615
+ },
616
+ components: {
617
+ [Button.name]: Button,
618
+ [Icon.name]: Icon,
619
+ [Dropdown.name]: Dropdown,
620
+ [Select.name]: Select,
621
+ [Upload.name]: Upload,
622
+ [DatePicker.name]: DatePicker,
623
+ [DatePicker.RangePicker.name]: DatePicker.RangePicker,
624
+ [Input.name]: Input,
625
+ [Input.Search.name]: Input.Search,
626
+ [Menu.name]: Menu,
627
+ [Menu.Item.name]: Menu.Item,
628
+ [Menu.ItemGroup.name]: Menu.ItemGroup,
629
+ getBtnIcon,
630
+ PrintBtn,
631
+ outQuickSearch,
632
+ ButtonGroup,
633
+ svgIcon
634
+ },
635
+ inject: {
636
+ editTableWrapper: {
637
+ type: Object,
638
+ default: () => {}
639
+ }
640
+ },
641
+ computed: {
642
+ isOrgAdmin() {
643
+ return this.isAdmin;
644
+ },
645
+ currentValue() {
646
+ return this.value;
647
+ },
648
+ allBtn() {
649
+ const { rowTileBtnList, rowFoldBtnList } = this;
650
+ let allBtn = [];
651
+ allBtn.push(...rowTileBtnList, ...rowFoldBtnList);
652
+ return allBtn;
653
+ },
654
+ isButtonFolding() {
655
+ // 首页配置
656
+ const { editTableWrapper } = this;
657
+ return editTableWrapper?.options?.isButtonFolding || false;
658
+ },
659
+ isShowSettingBtn() {
660
+ const { $attrs, viewList, noSetting } = this;
661
+ if (this.showRelatedTreeBtn) return;
662
+ return $attrs.isTree != 1 && viewList.length > 0 && !noSetting;
663
+ },
664
+ showDownCurSelectData() {
665
+ return this.selectRowObj.filter(item => !(GROUP_TITLE_KEY in (item || {})))?.length;
666
+ },
667
+ showRowFoldBtnList() {
668
+ return function(list, key) {
669
+ if (key === 'rowFoldBtnList' && !this.isShowSetting('buttonAdaption')) return false;
670
+ if (!list || !list.length) return false;
671
+
672
+ let hasGroupBtnList = list.filter(item => item.buttonGroup);
673
+ if (hasGroupBtnList.length) {
674
+ let showGroup = hasGroupBtnList.some(item => item.isShowFoldGroupBtn);
675
+ if (showGroup) return true;
676
+ }
677
+
678
+ // 只有一个按钮 分组按钮 非自适应
679
+ if (list.length === 1 && list[0].buttonGroup && list[0].isButtonGroup && !list[0].isShowFoldGroupBtn) return false;
680
+
681
+ let visibleList = list.filter(item => item.isVisible && !item.buttonGroup);
682
+ if (!visibleList || !visibleList.length) return false;
683
+ let hasAdd = visibleList.some(item => item.type === 'ADD');
684
+ if (hasAdd) {
685
+ return true;
686
+ } else {
687
+ if (this.currentTempId != 0) return false;
688
+ let notLinkArr = visibleList.filter(item => item.type !== 'LINK');
689
+ if (!notLinkArr || !notLinkArr.length) return false;
690
+ }
691
+ return true;
692
+ };
693
+ },
694
+ initPageResize() {
695
+ let { showSettings, TypeOfDisplay, classificationIndex } = this;
696
+ return {
697
+ showSettings,
698
+ TypeOfDisplay,
699
+ classificationIndex
700
+ };
701
+ },
702
+ isShowRowTileBtnItem() {
703
+ return function(item) {
704
+ return this.showButtonTop == 1 && item.type != 'LINK' && this.currentTempId == '0';
705
+ };
706
+ },
707
+ showRelatedSearchFold() {
708
+ if (
709
+ !this.isShowSettingBtn &&
710
+ !this.isShowSetting('hideQuickSearch') &&
711
+ this.outSearchFieldList.length == 0 &&
712
+ this.outRelationQuickSearch.length == 0 &&
713
+ !this.showResetFilterBtn &&
714
+ !this.$slots.classification
715
+ ) {
716
+ return false;
717
+ } else {
718
+ return this.isRelatedSearchFold;
719
+ }
720
+ },
721
+ handlePickerShowTime() {
722
+ return function(item) {
723
+ if (!item.showTime) return false;
724
+ return {
725
+ defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
726
+ };
727
+ };
728
+ },
729
+ isShowGroupBtn() {
730
+ if (!this.groupBtnObj || !Object.keys(this.groupBtnObj).length) return false;
731
+ return true;
732
+ },
733
+ showLi() {
734
+ return function(item) {
735
+ if (item.buttonGroup) {
736
+ return item.isShow == '1' && item.buttonGroup && !item.isButtonGroup;
737
+ }
738
+ return item.isShow == '1';
739
+ };
740
+ },
741
+ showLiAdd() {
742
+ return function(b) {
743
+ if (b.buttonGroup) {
744
+ return b.type == 'ADD' && b.buttonGroup && !b.isButtonGroup;
745
+ }
746
+ return b.type == 'ADD';
747
+ };
748
+ },
749
+ showLiFold() {
750
+ return function(b) {
751
+ if (b.buttonGroup) {
752
+ return b.type != 'LINK' && this.currentTempId == '0' && b.buttonGroup && !b.isButtonGroup;
753
+ }
754
+ return b.type != 'LINK' && this.currentTempId == '0';
755
+ };
756
+ },
757
+
758
+ getIsTile() {
759
+ return this?.gettersConfig?.getIsTile || '';
760
+ },
761
+ selectRowObj() {
762
+ return this?.gettersConfig?.selectRowObj || [];
763
+ },
764
+ isInlineOperating() {
765
+ return this?.gettersConfig?.isInlineOperating || false;
766
+ },
767
+ printNumberCache() {
768
+ return this?.gettersConfig?.printNumberCache || false;
769
+ },
770
+
771
+ // 全部行编辑
772
+ isBatchEditing() {
773
+ return this?.gettersConfig?.isBatchEditing || false;
774
+ },
775
+ curBatchBtnData() {
776
+ return this?.gettersConfig?.curBatchBtnData || {};
777
+ },
778
+ isRowEditing() {
779
+ return this?.gettersConfig?.isRowEditing || false;
780
+ },
781
+ // 是否有高级筛选外显
782
+ showOutSearch() {
783
+ return this.outSearchFieldList?.length || this.outRelationQuickSearch?.length;
784
+ },
785
+ showViewList() {
786
+ if (this.editTableSource === 'relatedComponent') {
787
+ return this.relatedBaseInfo.showType != 'TREE';
788
+ }
789
+ return !this.optionsValue('hideViewList');
790
+ },
791
+ optionsValue() {
792
+ return function(key) {
793
+ return this.$attrs.tableOptions?.[key];
794
+ };
795
+ },
796
+ searchPlaceHolder() {
797
+ if (!this.useFieldList?.length || this.showRelatedTreeBtn) return '请输入关键字搜索';
798
+ let str = '';
799
+ let strList = this.useFieldList
800
+ ?.map(item => {
801
+ if (item.isSearch != 1) return '';
802
+ return item.formTitle || item.alias || item.title;
803
+ })
804
+ .filter(Boolean);
805
+ if (!strList?.length) return '';
806
+ str = '输入' + strList.join('/');
807
+ return str || '请输入关键字搜索';
808
+ },
809
+ showRelatedSearch() {
810
+ return this.showRelatedTreeBtn && this.isShowSetting('hideSearch');
811
+ },
812
+ showQuickSearch() {
813
+ let showQuick = this.isShowSetting('hideQuickSearch');
814
+ // 平铺列表, 左侧不为tree, 而是table
815
+ if (this.editTableSource == 'relatedComponent' && this.relatedBaseInfo?.showType != 'TREE') return showQuick;
816
+ return showQuick && this.isRelatedSearchFold;
817
+ },
818
+ showBaseTabs() {
819
+ return this.conditionType === 'keyword' && this.tabConditionList?.length && !this.visibleInlineOperateBtn && !this.isRowEditing;
820
+ },
821
+ isCard() {
822
+ return this.TypeOfDisplay === 'cardNew' && this.isBatchSelect == 1
823
+ }
824
+ },
825
+ data() {
826
+ return {
827
+ modalVisible: false,
828
+ currentTempId: '0',
829
+ viewCongfigList: [],
830
+ isTile: false,
831
+ conditionList: [],
832
+ displayCategoryList: [],
833
+ settingId: '',
834
+ searchDefName: '',
835
+ rowTileBtnList: [],
836
+ rowFoldBtnList: [],
837
+ rowPrintBtnList: [],
838
+ rowFoldHideBtnList: [], // 按钮自适应折叠list
839
+ rowFoldHideBtnListObj: {}, // 按钮自适应折叠分类
840
+ batchRelationBtnIds: [], // 批量操作按钮,关联的对应操作按钮id集
841
+ relationBtnBatchBtnIds: [], // 有关联对应操作按钮的批量操作按钮id集
842
+
843
+ nobutton: false, // 不展示按钮设置 false 展示,true 不展示
844
+ noSetting: false, // 不展示按钮设置 false 展示,true 不展示
845
+ isChangeWindow: false,
846
+ modalWidth: '700px',
847
+ modalHeight: '60vh',
848
+ label_max_count: 8,
849
+ baseLeftWidth: 0,
850
+ btnRowWidth: 0,
851
+ classificationWidth: 0,
852
+ inputSearchWidth: 0,
853
+ quickSearchWidth: 0,
854
+ downloadDropdownWidth: 0,
855
+ diffWidth: 0,
856
+ resizeFlag: false,
857
+ rowTileBtnListTree: [],
858
+ outSearchFieldList: [],
859
+ tabIndex: -1,
860
+ // tabConditionList: [],
861
+
862
+ /* 打印相关 */
863
+ printBtnPrevFnWatch: {},
864
+ printPrevFinish: false,
865
+ printBtnPrevFnWatchTimeoutTimer: null,
866
+ printBtn: {},
867
+ groupBtnObj: {},
868
+ btnObj: BTNOBJ,
869
+ printBtnStrategys: [], // 打印按钮组策略list
870
+ outRelationQuickSearch: [], // 关联表 筛选外显
871
+ inputSearchW: 200,
872
+ showPlaceholderPrefix: false
873
+ };
874
+ },
875
+ created() {
876
+ if (this.getIsTile !== undefined) {
877
+ this.isTile = this.getIsTile;
878
+ }
879
+ },
880
+ destroyed() {},
881
+ methods: {
882
+ tabClick(index) {
883
+ if (this.tabIndex === index) return false;
884
+ this.tabIndex = index;
885
+ if (index !== -1) this.$emit('tabClick', this.tabConditionList[index]);
886
+ },
887
+ pageResize(obj) {
888
+ if (this.resizeFlag || this.visibleInlineOperateBtn || this.isRowEditing) return;
889
+ let baseLeft = this.$refs['baseLeft'];
890
+ if (!baseLeft) return;
891
+ this.resizeFlag = true;
892
+ this.baseLeftWidth = baseLeft.clientWidth;
893
+ this.classificationWidth = this.classificationIndex === 2 ? 160 : 0;
894
+ this.btnRowWidth = this.$refs['btnRow']?.clientWidth || 0;
895
+ this.inputSearchWidth = this.$refs['inputSearchLi']?.clientWidth || 0;
896
+ this.quickSearchWidth = this.$refs['quickSearchLi']?.clientWidth || 0;
897
+ // this.downloadDropdownWidth = this.$refs["downloadDropdownLi"]?.clientWidth || 0;
898
+ let defaultTotal = this.btnRowWidth + this.classificationWidth + this.inputSearchWidth + this.quickSearchWidth;
899
+
900
+ let diffWidth = this.baseLeftWidth - defaultTotal;
901
+ // 平铺列表占2行
902
+ if (this.editTableSource === 'relatedComponent') {
903
+ diffWidth += this.baseLeftWidth;
904
+ }
905
+ this.diffWidth = diffWidth;
906
+ if (!obj.type) return;
907
+ if (obj.type === 'resize') {
908
+ this.handleTileBtnWidth();
909
+ }
910
+ },
911
+ onResize() {
912
+ if (this.isButtonFolding || this.isShowSetting('buttonAdaption') || this.relatedIsTree == 1 || this.visibleInlineOperateBtn || this.isRowEditing) return;
913
+ utils.debounce(this.pageResize({ type: 'resize' }), 300);
914
+ },
915
+ async saveListIsTile() {
916
+ let url = `/tableList/saveListIsTile`;
917
+ let params = {
918
+ isTile: this.isTile ? '1' : '0'
919
+ };
920
+ let res = await this.handleGetConfigApi(params, 'requestSaveListIsTile');
921
+ if (res) {
922
+ this.$emit('setIsTile', this.isTile);
923
+ this.$message.success(this.$t('1.9.23'));
924
+ }
925
+ },
926
+ getTableCondiTionListRequest(first) {
927
+ this.getTableCondiTionList(first).then(checked => {
928
+ this.reloadList(checked);
929
+ });
930
+ },
931
+ getTableCondiTionList(first, conditionMap = {}) {
932
+ let tableId = this.tableId;
933
+ if (!tableId) return new Promise(resolve => resolve(false));
934
+ let conditionMapTemp = Object.keys(conditionMap).length > 0 ? conditionMap : this.conditionMap;
935
+
936
+ return new Promise((resolve, reject) => {
937
+ if (Object.keys(conditionMapTemp).length > 0) {
938
+ this.conditionList = conditionMapTemp.conditionList || [];
939
+ this.displayCategoryList = conditionMapTemp.displayCategoryList || [];
940
+ let obj = {
941
+ conditionList: this.conditionList,
942
+ displayCategoryList: this.displayCategoryList
943
+ };
944
+ this.$emit('getQuickSearchListObj', obj);
945
+ this.settingId = conditionMapTemp.settingId;
946
+ const checked = this.conditionList.find(item => item.isDefault) || {
947
+ name: '全部数据' || this.$t('1.1.5.1'),
948
+ sid: 'all_data'
949
+ };
950
+ this.searchDefName = checked.name;
951
+ // if (this.conditionType === "keyword") {
952
+ this.tabConditionList = conditionMapTemp.tabConditionList || []; // 获取页签tab
953
+ if (this.tabIndex === -1) {
954
+ this.tabIndex = conditionMapTemp.tabConditionList && conditionMapTemp.tabConditionList.findIndex(item => item.isDefault); // 查询默认选中的标签
955
+ }
956
+ // }
957
+ if (this.$attrs.tableOptions?.filterCondition?.displayCategory && first) {
958
+ resolve({
959
+ name: this.$attrs.tableOptions?.filterCondition?.name,
960
+ sid: this.$attrs.tableOptions?.filterCondition?.displayCategory
961
+ });
962
+ }
963
+ resolve(checked);
964
+ } else {
965
+ resolve({});
966
+ }
967
+ });
968
+
969
+ // }
970
+ // });
971
+ },
972
+ async getTableCondiTionListNew(tableId) {
973
+ if (!tableId) return new Promise(resolve => resolve(false));
974
+ let params = { tableId };
975
+ let url = `/tableList/getTableCondiTionList`;
976
+ return this.axios
977
+ .get(url, { params })
978
+ .then(({ data }) => {
979
+ if (data && data.result == 'SUCCESS') {
980
+ // 设置分类数据,用于优化组件内的多次请求分类
981
+ this.$emit('setConditionMap', data.map);
982
+ return data.map;
983
+ }
984
+ })
985
+ .catch(err => {
986
+ console.log(err);
987
+ });
988
+ },
989
+ foldQuickSearch() {
990
+ this.$emit('foldQuickSearch', true);
991
+ },
992
+ openModal() {
993
+ this.modalVisible = true;
994
+ },
995
+ closeModal() {
996
+ this.resetChangeWindow();
997
+ this.modalVisible = false;
998
+ },
999
+ resetChangeWindow() {
1000
+ this.modalWidth = '700px';
1001
+ this.modalHeight = '60vh';
1002
+ this.isChangeWindow = false;
1003
+ },
1004
+ changeModalWindow() {
1005
+ this.isChangeWindow = !this.isChangeWindow;
1006
+ let docHeight = document.body.clientHeight;
1007
+ this.modalWidth = this.modalWidth === '700px' ? `100%` : '700px';
1008
+ this.modalHeight = this.modalHeight === '60vh' ? `${docHeight - 108}px` : '60vh';
1009
+
1010
+ if (this.modalWidth === '700px') {
1011
+ this.label_max_count = 8;
1012
+ } else {
1013
+ this.$nextTick(() => {
1014
+ let ele = document.querySelector('.quickSearch_label-container');
1015
+ ele && (this.label_max_count = parseInt((ele.clientWidth - 20) / 112) * 2);
1016
+ });
1017
+ }
1018
+ },
1019
+ openSaveToCalss() {
1020
+ this.$refs.quicksearch?.openSaveToCalss();
1021
+ },
1022
+ onSaveSearch() {
1023
+ this.$refs.quicksearch?.onSave();
1024
+ },
1025
+ onSave(obj, isOutFilter = false, config = {}) {
1026
+ if (!this.validConObj(obj, this.searchFieldList, this.searchFieldLimit)) return false;
1027
+ let copy = [];
1028
+ if (this.outSearchFieldList.length) {
1029
+ copy = _.cloneDeep(this.outSearchFieldList, true);
1030
+ }
1031
+ let copyRelation = [];
1032
+ if (this.outRelationQuickSearch.length) {
1033
+ copyRelation = _.cloneDeep(this.outRelationQuickSearch, true);
1034
+ }
1035
+ this.$emit('onSave', obj, isOutFilter, copy, copyRelation, config);
1036
+ this.modalVisible = false;
1037
+ },
1038
+ // 外部调用
1039
+ editTableGetConObj() {
1040
+ if (!this.showOutSearch) return;
1041
+ let conObj = this.getConObjParams() || [];
1042
+ if (!this.validConObj(conObj, this.searchFieldList, this.searchFieldLimit)) return false;
1043
+ return conObj;
1044
+ },
1045
+ clearData() {
1046
+ this.$refs.quicksearch?.clearData();
1047
+ },
1048
+ /**
1049
+ * type 1-预览 2-打印
1050
+ */
1051
+ handlePrint(clickBtn, btn, type, j) {
1052
+ btn.printType = type;
1053
+ this.clickBtn(clickBtn, btn, clickBtn.my_index, true, j);
1054
+ },
1055
+ showDrawer(btn, j) {
1056
+ let hasSelectRows = this.paramsData.form.selectRows && this.paramsData.form.selectRows.length > 0;
1057
+ let isMultiSelect = hasSelectRows || this.tableAllCheck;
1058
+
1059
+ if ((btn.name.includes('批量') && btn.type == 'ADD') || btn.type == 'BATCH') {
1060
+ // const { settingObj = {} } = btn || {};
1061
+ let settingObj = {};
1062
+ let settingList = btn.setting || '{}';
1063
+ if (utils.isJSON(settingList)) {
1064
+ let btnSetting = JSON.parse(settingList);
1065
+ if (Array.isArray(btnSetting)) {
1066
+ settingObj = btnSetting[0] || {};
1067
+ } else {
1068
+ settingObj = btnSetting;
1069
+ }
1070
+ }
1071
+ let trigger_type = settingObj?.trigger_type;
1072
+
1073
+ // 全部行编辑
1074
+ if (trigger_type == 'EDIT_ROW' || settingObj?.editAllRow == 1) {
1075
+ this.handleBtnEvent(btn, j);
1076
+ return;
1077
+ }
1078
+
1079
+ if (trigger_type == 'SCAN' && btn.type == 'ADD') {
1080
+ this.handleBtnEvent(btn, j);
1081
+ return;
1082
+ }
1083
+
1084
+ if (isMultiSelect) {
1085
+ if (settingObj.isTips && settingObj.isTips == 0) {
1086
+ this.handleBtnEvent(btn, j);
1087
+ return;
1088
+ }
1089
+ // 批量操作增加确认
1090
+ let params = { ...this.paramsData };
1091
+ params.table = {};
1092
+ if (settingObj.tipsMsg) {
1093
+ if (settingObj.tipsMsg.includes('form.selectRows')) {
1094
+ settingObj.tipsMsg = utils.handleMultiTips(settingObj.tipsMsg, [...params.form.selectRows]);
1095
+ } else {
1096
+ settingObj.tipsMsg = utils.handleSysParams(settingObj.tipsMsg, {
1097
+ ...params
1098
+ });
1099
+ }
1100
+ }
1101
+ const h = this.$createElement;
1102
+ this.$confirm({
1103
+ title: h(
1104
+ 'div',
1105
+ {
1106
+ directives: [
1107
+ {
1108
+ name: 'drag-move',
1109
+ value: {
1110
+ target: 'ant-modal-confirm-body'
1111
+ }
1112
+ }
1113
+ ],
1114
+ domProps: {
1115
+ innerHTML: settingObj.tipsMsg || `是否确认${btn.name}`
1116
+ }
1117
+ }
1118
+ // settingObj.tipsMsg || `是否确认${btn.name}`
1119
+ ),
1120
+ okText: '确定',
1121
+ cancelText: '取消',
1122
+ onOk: () => {
1123
+ this.handleBtnEvent(btn, j);
1124
+ },
1125
+ onCancel() {
1126
+ console.log('Cancel');
1127
+ },
1128
+ class: 'test'
1129
+ });
1130
+ } else {
1131
+ if (!btn.canHandleUniline) {
1132
+ // 1.9.295
1133
+ this.$message.warning(`请勾选需要${btn.name}的数据`);
1134
+ return;
1135
+ }
1136
+ this.clickBtn(
1137
+ this.clickRowData,
1138
+ // 找到对应的单行操作按钮
1139
+ this.getUnilineBtn(btn),
1140
+ this.clickRowData.my_index,
1141
+ true,
1142
+ j
1143
+ );
1144
+ }
1145
+ } else {
1146
+ if (btn.type == 'ADD' || btn.type == 'BATCH') {
1147
+ this.handleBtnEvent(btn, j);
1148
+ return;
1149
+ }
1150
+ this.clickBtn(this.clickRowData, btn, this.clickRowData.my_index, j);
1151
+ }
1152
+ },
1153
+ getUnilineBtn(BatchBtn) {
1154
+ let unilineBtnId = this.batchRelationBtnIds[this.relationBtnBatchBtnIds.indexOf(BatchBtn.id)];
1155
+ let unilineBtnObj = null;
1156
+ this.allBtn.forEach(i => {
1157
+ if (i.id == unilineBtnId) {
1158
+ unilineBtnObj = i;
1159
+ }
1160
+ });
1161
+ return unilineBtnObj;
1162
+ },
1163
+ handleBtnEvent(btn, j) {
1164
+ let indexList = [];
1165
+ this.$emit('clearTeamTitleName');
1166
+ if (this.paramsData.form.selectRows && this.paramsData.form.selectRows.length > 0) {
1167
+ indexList = this.paramsData.form.selectRows.map(item => {
1168
+ if (btn.type == 'BATCH') {
1169
+ delete item.SHOW_BUTTON_IDS;
1170
+ delete item.operatorColumn;
1171
+ }
1172
+ return item.my_index;
1173
+ });
1174
+ }
1175
+ let setData = JSON.parse(btn.setting);
1176
+ let settingList = JSON.parse(btn.setting);
1177
+ /** 按钮对象需求:add类型的 setting 可能是 Array/Object*/
1178
+ if (btn.type === 'ADD' || btn.type == 'BATCH') {
1179
+ if (Array.isArray(settingList)) {
1180
+ setData = settingList[0] || {};
1181
+ } else {
1182
+ setData = settingList;
1183
+ }
1184
+ this.paramsData.table = {};
1185
+ }
1186
+ if (setData.trigger_type == 'ABOUT_ITEM') {
1187
+ this.$message.error('按钮事件配置有误');
1188
+ return;
1189
+ }
1190
+ let params = setData.params || [];
1191
+ if (setData.trigger_type == 'QR_CODE') {
1192
+ params.forEach(item => {
1193
+ item.p_value = item.p_value?.replace(/\$\{([^}]+)\}/g, (_v, $1) => {
1194
+ return $1 || _v;
1195
+ });
1196
+ });
1197
+ }
1198
+ let paramsData = utils.setParamsValue(params, this.paramsData);
1199
+ Object.assign(btn, {
1200
+ _index_: j
1201
+ });
1202
+ let btnData = {
1203
+ btnData: Object.assign(setData, {
1204
+ paramsData: paramsData,
1205
+ btnName: btn.name,
1206
+ _params_data: this.paramsData,
1207
+ _type_: btn.type
1208
+ }),
1209
+ indexList: indexList,
1210
+ btnConfig: JSON.parse(JSON.stringify(btn)),
1211
+ _params_data: this.paramsData,
1212
+ _type_: btn.type
1213
+ };
1214
+ this.$emit('btnEvent', btnData);
1215
+ },
1216
+
1217
+ // 筛选分类相关的
1218
+ async updateTableCondiTion() {
1219
+ await this.getTableCondiTionListNew(this.tableId);
1220
+ this.getTableCondiTionListRequest();
1221
+ },
1222
+ async CondiTionListInit() {
1223
+ await this.getTableCondiTionListNew(this.tableId);
1224
+ this.getTableCondiTionListRequest();
1225
+ },
1226
+ async saveGetTableCondiTionList(options) {
1227
+ await this.getTableCondiTionListNew(this.tableId);
1228
+ this.getTableCondiTionList();
1229
+ this.$emit('getClassification', options);
1230
+ },
1231
+ changeSearch(key, item) {
1232
+ if (key == 'all') {
1233
+ this.searchDefName = '全部数据' || this.$t('1.1.5.1');
1234
+ } else {
1235
+ this.searchDefName = item.name;
1236
+ }
1237
+ this.$refs.quicksearch.clearData();
1238
+ this.$emit('changeSearch', key, item);
1239
+ },
1240
+ changeSearchTile(val) {
1241
+ this.isTile = val;
1242
+ this.saveListIsTile();
1243
+ },
1244
+ openSetting() {
1245
+ this.$refs.search.handleMenuClick('setting');
1246
+ },
1247
+ reloadList(item) {
1248
+ this.$refs.quicksearch?.clearData();
1249
+ this.$emit('reloadList', item);
1250
+ },
1251
+ clickBtn(data, item, index, skip, j) {
1252
+ this.$emit('clearTeamTitleName');
1253
+ if ((item.name.includes('批量') && item.type == 'ADD' && !skip) || (item.type == 'BATCH' && !skip)) {
1254
+ this.showDrawer(item, j);
1255
+ return;
1256
+ }
1257
+ if (Object.keys(data || {}).length === 0 && !this.isPrintBtn(item)) {
1258
+ // 请点击要操作的数据1.9.140
1259
+ this.$message.info('请点击要操作的数据' || this.$t('1.9.140'));
1260
+ return;
1261
+ }
1262
+ Object.assign(item, {
1263
+ _index_: j
1264
+ });
1265
+ this.$emit('clickBtn', data, item, index);
1266
+ },
1267
+ clickGroupBtn(btn, j) {
1268
+ this.clickBtn(this.clickRowData, btn, this.clickRowData.my_index, undefined, j);
1269
+ },
1270
+ handlerSetting() {
1271
+ this.$emit('handlerSetting');
1272
+ },
1273
+ // 请求视图列表
1274
+ handlerReqAllConfigView() {
1275
+ let params = {
1276
+ type: 'PC',
1277
+ typeTable: 'TABLE_LIST',
1278
+ tableId: this.tableId,
1279
+ page: 1,
1280
+ rows: 20
1281
+ };
1282
+ this.axios
1283
+ .get('/tableListConfigView/getTableListConfigViewAll', {
1284
+ params: params
1285
+ })
1286
+ .then(({ data }) => {
1287
+ if (data.rows) {
1288
+ let viewCongfigList = data.rows || [];
1289
+ if (viewCongfigList.length > 0) {
1290
+ // 查找默认值
1291
+ let curItem = viewCongfigList.find(v => v.mark == 1);
1292
+ this.currentTempId = curItem ? curItem.id : '0';
1293
+ this.$emit('handlerChangeView', this.currentTempId);
1294
+ } else {
1295
+ this.currentTempId = '0';
1296
+ this.$emit('handlerChangeView', this.currentTempId);
1297
+ }
1298
+
1299
+ this.$set(this, 'viewCongfigList', viewCongfigList);
1300
+ }
1301
+ });
1302
+ },
1303
+ handlerSelectTemp(e) {
1304
+ if (this.currentTempId === e) return;
1305
+ this.currentTempId = e;
1306
+ const tab = e == 0 ? 'bigTable' : null;
1307
+ this.$emit('handlerChangeView', e, tab);
1308
+ let f = this.viewList.findIndex(v => v.id == e);
1309
+ this.resetCheckStatus();
1310
+ this.$nextTick(() => {
1311
+ this.formatRowBtnList();
1312
+ });
1313
+ },
1314
+ isShowSetting(v) {
1315
+ if (v == 'hideSettingBtn') {
1316
+ return this.isOrgAdmin || this.showSettings[v] == 0;
1317
+ } else {
1318
+ if (this.showRelatedTreeBtn) {
1319
+ return this.relatedBaseInfo[v] == 0;
1320
+ }
1321
+ return this.showSettings[v] == 0;
1322
+ }
1323
+ },
1324
+ setBatchRelationBtnIds(list) {
1325
+ let showButtonTop = !!this.showButtonTop;
1326
+ if (!showButtonTop) return false;
1327
+
1328
+ list.forEach(item => {
1329
+ let relationBtnId = item.setting && JSON.parse(item.setting)?.relationBtnId;
1330
+ if (item.type === 'BATCH' && relationBtnId) {
1331
+ this.relationBtnBatchBtnIds.push(item.id);
1332
+ this.batchRelationBtnIds.push(relationBtnId);
1333
+ }
1334
+ });
1335
+ },
1336
+ setBtnStatus(btn) {
1337
+ const btnObj = utils.getRowOperatorIdSetting({}, btn);
1338
+ const { settingObj = {} } = btnObj || {};
1339
+ let isAllSelect = this.tableAllCheck;
1340
+ let isMultiSelect = !!this.paramsData.form.selectIds;
1341
+ let isBatchBtn = btn.type === 'BATCH';
1342
+ let isAddBtn = btn.type === 'ADD';
1343
+ let isSQLSAVEBtn = settingObj.trigger_type === 'SQLSAVE';
1344
+ let isLineBtn = btn.type === 'EDIT' || btn.type === 'DELETE';
1345
+ let isImportGuage = settingObj.trigger_type === 'GUAGE' && settingObj.guage_type == 'importGuage';
1346
+
1347
+ let isEditRow = settingObj.trigger_type === 'EDIT_ROW';
1348
+ let editAllRow = settingObj.editAllRow == 1;
1349
+
1350
+ // 批量&&行编辑&&全部行编辑 直接展示
1351
+ if (isBatchBtn && isEditRow && editAllRow) {
1352
+ btn.isVisible = true;
1353
+ return;
1354
+ }
1355
+
1356
+ // 默认情况下 只展示新增&下载
1357
+ if (!this.showDownCurSelectData) {
1358
+ btn.isVisible = isAddBtn ? true : false;
1359
+ if (!isImportGuage) return;
1360
+ }
1361
+
1362
+ // btn.settingObj.guage_type == "importGuage";
1363
+ // 全选状态下,只有入口类型的批量按钮展示(因当前版本仅支持入口类型的全选批量操作
1364
+ if (isBatchBtn && isAllSelect) {
1365
+ btn.isVisible = isSQLSAVEBtn;
1366
+ return;
1367
+ }
1368
+
1369
+ // 批量操作按钮,如果有绑定对应单行操作按钮,则批量按钮开启单行操作
1370
+ let relationBtnId = JSON.parse(btn.setting).relationBtnId;
1371
+ if (isBatchBtn && relationBtnId) {
1372
+ btn.canHandleUniline = true;
1373
+ }
1374
+
1375
+ // 批量按钮关联的对应按钮
1376
+ if (this.showDownCurSelectData > 1 && isLineBtn) {
1377
+ btn.isVisible = false;
1378
+ } else {
1379
+ if (isBatchBtn && btn.chooseTwoData == 1) {
1380
+ btn.isVisible = !this.batchRelationBtnIds.includes(btn.id) && this.showDownCurSelectData > 1;
1381
+ } else {
1382
+ btn.isVisible = !this.batchRelationBtnIds.includes(btn.id);
1383
+ }
1384
+ }
1385
+
1386
+ // 未绑定了行级按钮的批量按钮,默认隐藏, 勾选展示
1387
+ if (isBatchBtn && !relationBtnId && this.showDownCurSelectData > 1) {
1388
+ btn.isVisible = isMultiSelect;
1389
+ }
1390
+ // 量表导入按钮
1391
+ if (isImportGuage) {
1392
+ btn.isImportGuage = true;
1393
+ btn.isVisible = false;
1394
+ }
1395
+ },
1396
+ // 处理分组按钮
1397
+ handleButtonGroup(buttonList) {
1398
+ let useBttonList = buttonList
1399
+ .map(v => {
1400
+ v.isButtonGroup = false;
1401
+ // 有分组名 非隐藏
1402
+ if (!v.buttonGroup || !v.isVisible || v.isShow != 1) return null;
1403
+ if (v.type === 'ADD' || v.type == 'BATCH') return v;
1404
+ if (this.showButtonTop != 1) return null;
1405
+ return v;
1406
+ })
1407
+ .filter(Boolean);
1408
+ if (!useBttonList.length) return;
1409
+ let groupRes = vexutils.groupBy(useBttonList, 'buttonGroup');
1410
+ if (!groupRes || !Object.keys(groupRes).length) return;
1411
+ let resObj = {};
1412
+ Object.keys(groupRes).forEach(item => {
1413
+ let list = groupRes[item];
1414
+ // 超过一个才展示
1415
+ if (item && list?.length > 1) {
1416
+ resObj[item] = {
1417
+ key: item,
1418
+ isHide: false,
1419
+ list: list,
1420
+ clientWidth: 0,
1421
+ isVisible: true
1422
+ };
1423
+ list.forEach(v => (v.isButtonGroup = true));
1424
+ }
1425
+ });
1426
+ this.groupBtnObj = resObj;
1427
+ },
1428
+ async formatRowBtnList() {
1429
+ let rowFoldBtnList = [];
1430
+ let rowTileBtnList = [];
1431
+ let rowPrintBtnList = [];
1432
+ this.rowFoldBtnList = [];
1433
+ this.rowTileBtnList = [];
1434
+ this.rowPrintBtnList = [];
1435
+ this.rowFoldHideBtnList = [];
1436
+ this.batchRelationBtnIds = [];
1437
+ this.relationBtnBatchBtnIds = [];
1438
+ this.groupBtnObj = {};
1439
+ let useButton = [];
1440
+ // let tempBtnList = this.rowBtnList;
1441
+ // // 按钮置顶时 过滤掉行级按钮中 仅图标
1442
+ // if (this.showButtonTop == 1) {
1443
+ // tempBtnList = tempBtnList.filter(v => {
1444
+ // if (["EDIT", "DELETE"].includes(v.type)) {
1445
+ // if (v.showStyle != "only_icon") return v;
1446
+ // } else {
1447
+ // return v;
1448
+ // }
1449
+ // });
1450
+ // }
1451
+ let rowBtnList = this.rowBtnList;
1452
+ // 新卡片视图 有进入批量模式的按钮
1453
+ if (this.isCard) {
1454
+ if(this.isCardNewBatch) {
1455
+ rowBtnList = rowBtnList.map(v => {
1456
+ if(v.type == 'BATCH') return v
1457
+ return null
1458
+ }).filter(Boolean);
1459
+ } else {
1460
+ rowBtnList = rowBtnList.map(v => {
1461
+ if(v.type != 'BATCH') return v;
1462
+ return null;
1463
+ }).filter(Boolean);
1464
+ }
1465
+ }
1466
+ if (!rowBtnList?.length) return;
1467
+ this.setBatchRelationBtnIds(rowBtnList);
1468
+
1469
+
1470
+ // 子列表只留下行级按钮
1471
+ // if (this.isNestTableClick) {
1472
+ // rowBtnList = this.rowBtnList.filter(item => item.type != 'ADD' && item.type != 'BATCH');
1473
+ // }
1474
+
1475
+ rowBtnList.forEach(btn => {
1476
+ if (!(btn.isShow == '1' && btn.type != 'LINK')) return;
1477
+ btn.isHide = false;
1478
+ btn.isButtonGroup = false;
1479
+ let cloneBtn = _.cloneDeep(btn);
1480
+ this.setBtnStatus(cloneBtn);
1481
+ // 按钮自适应 即使折叠也平铺显示出来
1482
+ if (this.isShowSetting('buttonAdaption')) {
1483
+ if (btn.toggle == 'fold') {
1484
+ if (btn.type != 'ADD' && btn.type != 'BATCH' && this.showButtonTop == 0) return;
1485
+ if (!this.isPrintBtn(btn)) {
1486
+ rowFoldBtnList.push(cloneBtn);
1487
+ }
1488
+ } else {
1489
+ rowTileBtnList.push(cloneBtn);
1490
+ }
1491
+ } else {
1492
+ rowTileBtnList.push(cloneBtn);
1493
+ }
1494
+ useButton.push(cloneBtn);
1495
+ });
1496
+ if (this.isShowSetting('buttonAdaption')) {
1497
+ this.rowFoldBtnList = rowFoldBtnList;
1498
+ }
1499
+
1500
+ this.rowTileBtnList = rowTileBtnList.filter(i => {
1501
+ if (this.isPrintBtn(i)) {
1502
+ rowPrintBtnList.push(i);
1503
+ } else {
1504
+ return i;
1505
+ }
1506
+ });
1507
+
1508
+ let printNumberList = (await this.getPrintNumber(rowPrintBtnList)) || [];
1509
+ rowPrintBtnList = this.setPrintNumberToBtnList(printNumberList, rowPrintBtnList);
1510
+ // this.rowPrintBtnList = rowPrintBtnList;
1511
+ // 添加批量打印策略:strategy: MULTI(循环多条, 默认值, 为空时使用该策略) ONCE(聚合一条)
1512
+ this.rowPrintBtnList = rowPrintBtnList.map(item => {
1513
+ const obj = this.printBtnStrategys.find(v => v.id === item.settingObj[0].trigger_id);
1514
+ item.strategy = obj?.setting ? JSON.parse(obj.setting).strategy : 'MULTI';
1515
+ return item;
1516
+ });
1517
+
1518
+ this.hideInlineOperationBtn();
1519
+
1520
+ // 分组按钮
1521
+ this.handleButtonGroup(useButton);
1522
+
1523
+ if (this.isShowSetting('buttonAdaption')) return;
1524
+ this.$nextTick(() => {
1525
+ this.handleTileBtnWidth();
1526
+ this.dealOutFilterHideBtn();
1527
+ });
1528
+ },
1529
+ hideInlineOperationBtn() {
1530
+ if (this.TypeOfDisplay === 'table') return;
1531
+
1532
+ this.rowFoldBtnList = this.rowFoldBtnList.filter(item => {
1533
+ return item.settingObj[0].trigger_type !== 'EDIT_ROW';
1534
+ });
1535
+ this.rowTileBtnList = this.rowTileBtnList.filter(item => {
1536
+ return item.settingObj[0].trigger_type !== 'EDIT_ROW';
1537
+ });
1538
+ },
1539
+ isPrintBtn(btn) {
1540
+ const copySettingObj = btn.settingObj;
1541
+ let settingObj = {};
1542
+ if (Array.isArray(copySettingObj)) {
1543
+ settingObj = copySettingObj[0];
1544
+ } else {
1545
+ settingObj = copySettingObj;
1546
+ }
1547
+ if (!settingObj) return false;
1548
+ return settingObj.trigger_type === 'PRINT';
1549
+ },
1550
+ handleTileBtnWidth() {
1551
+ if (this.outSearchFieldList.length > 0) return; // 存在外显按钮的时候 不触发这个函数
1552
+ let rowTileBtnRef = this.$refs.rowTileBtnItem;
1553
+ if (!rowTileBtnRef || !rowTileBtnRef.length) return;
1554
+ let rowTileBtnList = JSON.parse(JSON.stringify(this.rowTileBtnList));
1555
+ let groupBtnObj = JSON.parse(JSON.stringify(this.groupBtnObj));
1556
+ let btnTotalWidth = 90;
1557
+ let hasHideBtn = false;
1558
+ let rowFoldHideBtnWidth = 90;
1559
+ let diffWidth = this.diffWidth;
1560
+ rowTileBtnRef.forEach((e, index) => {
1561
+ let dataKey = e.getAttribute('data-key');
1562
+ let dateSource = e.getAttribute('data-source');
1563
+ let clientWidth = e.clientWidth;
1564
+ let item;
1565
+ if (dateSource == 'groupBtn') {
1566
+ item = groupBtnObj[dataKey];
1567
+ } else {
1568
+ item = rowTileBtnList.find(v => v.sid === dataKey);
1569
+ }
1570
+ if (!item) return;
1571
+ if (clientWidth) {
1572
+ item.clientWidth = clientWidth;
1573
+ }
1574
+ if (item.clientWidth) {
1575
+ clientWidth = item.clientWidth;
1576
+ }
1577
+ if (diffWidth <= 0) {
1578
+ this.$set(item, 'isHide', true);
1579
+ } else if (diffWidth > 0 && item.isVisible) {
1580
+ btnTotalWidth += clientWidth;
1581
+ if (btnTotalWidth > diffWidth) {
1582
+ this.$set(item, 'isHide', true);
1583
+ if (!hasHideBtn) {
1584
+ hasHideBtn = true;
1585
+ diffWidth -= rowFoldHideBtnWidth;
1586
+ btnTotalWidth -= rowFoldHideBtnWidth;
1587
+ }
1588
+ } else {
1589
+ this.$set(item, 'isHide', false);
1590
+ }
1591
+ }
1592
+ });
1593
+ let hideBtn = rowTileBtnList.filter(item => item.isVisible && item.isHide);
1594
+ this.groupBtnObj = groupBtnObj;
1595
+ this.rowTileBtnList = rowTileBtnList;
1596
+ let rowFoldHideBtnListObj = {
1597
+ ADD: { name: '新增按钮', list: [] },
1598
+ INLINE: { name: '行级按钮', list: [] },
1599
+ BATCH: { name: '批量按钮', list: [] }
1600
+ };
1601
+
1602
+ hideBtn.forEach(item => {
1603
+ item.isShowFoldGroupBtn = false;
1604
+ if (item.type === 'ADD') {
1605
+ rowFoldHideBtnListObj.ADD.list.push(item);
1606
+ } else if (item.type == 'BATCH') {
1607
+ rowFoldHideBtnListObj.BATCH.list.push(item);
1608
+ } else {
1609
+ rowFoldHideBtnListObj.INLINE.list.push(item);
1610
+ }
1611
+ });
1612
+
1613
+ let hideGroupBtnObj = {};
1614
+ // 按钮自适应 隐藏的分组 需要在折叠中平铺展示
1615
+ for (let key in groupBtnObj) {
1616
+ if (groupBtnObj[key].isHide) {
1617
+ let list = groupBtnObj[key].list;
1618
+ hideGroupBtnObj[key] = {
1619
+ name: key,
1620
+ list
1621
+ };
1622
+ list.forEach(item => {
1623
+ let matchItem = hideBtn.find(v => v.sid === item.sid);
1624
+ if (!matchItem) {
1625
+ item.isShowFoldGroupBtn = true;
1626
+ hideBtn.push(item);
1627
+ } else {
1628
+ matchItem.isShowFoldGroupBtn = true;
1629
+ }
1630
+ });
1631
+ }
1632
+ }
1633
+ if (Object.keys(hideGroupBtnObj).length) {
1634
+ Object.assign(rowFoldHideBtnListObj, hideGroupBtnObj);
1635
+ }
1636
+
1637
+ this.rowFoldHideBtnListObj = rowFoldHideBtnListObj;
1638
+ this.rowFoldHideBtnList = hideBtn;
1639
+ this.resizeFlag = false;
1640
+ },
1641
+ resetCheckStatus() {
1642
+ this.$emit('pubResetCheckStatus');
1643
+ },
1644
+ handleReset() {
1645
+ this.$emit('handleReset', { targetType: 'outQuickSearchReset' });
1646
+ },
1647
+ changeCardNewBatch(val) {
1648
+ this.$emit('changeCardNewBatch', val)
1649
+ },
1650
+ handleUploadChange(info) {
1651
+ const { file, fileList } = info;
1652
+ if (file.status !== 'uploading') {
1653
+ console.log(file, fileList);
1654
+ }
1655
+ if (file.status === 'done') {
1656
+ if (file.response?.result == 'SUCCESS') {
1657
+ this.$message.success(`${file.name} 导入成功`);
1658
+ this.$emit('importUpdate');
1659
+ } else {
1660
+ this.$message.error(`${file.name} 导入失败`);
1661
+ }
1662
+ } else if (file.status === 'error') {
1663
+ this.$message.error(`${file.name} 导入失败`);
1664
+ }
1665
+ },
1666
+ handleOtherConfigInit() {
1667
+ setTimeout(() => {
1668
+ let tableOptions = this.$attrs?.tableOptions || this.tableOptions || {};
1669
+ const { nobutton = false, TypeOfDisplay = '', noSetting = false } = tableOptions?.config || {};
1670
+ this.nobutton = nobutton || false;
1671
+ if (TypeOfDisplay === 'table') {
1672
+ this.currentTempId = '0';
1673
+ }
1674
+ if (noSetting) {
1675
+ // this.showSettings["hideSettingBtn"] = 1;
1676
+ this.noSetting = true;
1677
+ }
1678
+ }, 16);
1679
+ },
1680
+
1681
+ handleTopBtnTracher(btn, j) {
1682
+ try {
1683
+ // 埋点
1684
+ this.$_handleTracherLog('列表按钮', {
1685
+ 列表ID: this.tableId || '',
1686
+ 列表名称: this.tableName || this.$attrs?.tableName || '',
1687
+ 按钮名称: btn.name,
1688
+ 按钮ID: btn.id,
1689
+ 按钮类型: btn.type,
1690
+ 按钮顺序位置: j,
1691
+ 显示位置: btn.toggle
1692
+ });
1693
+ } catch (error) {
1694
+ console.log(error);
1695
+ }
1696
+ },
1697
+ handleAddType(btn) {
1698
+ const btnObj = utils.getRowOperatorIdSetting({}, btn);
1699
+ let setData = JSON.parse(btnObj.setting);
1700
+ const { editTableWrapper } = this;
1701
+ const tableParams = JSON.parse(JSON.stringify(this.paramsData));
1702
+
1703
+ if (editTableWrapper.options && utils.isPlainObject(editTableWrapper.options.extendParams)) {
1704
+ // 有额外的参数
1705
+ editTableWrapper.options?.extendParams && Object.assign(tableParams.form, editTableWrapper.options.extendParams);
1706
+ }
1707
+ const paramsData = Object.assign(tableParams, {
1708
+ table: btn
1709
+ });
1710
+ const params = utils.setParamsValue(setData.params, paramsData);
1711
+ Object.assign(setData, { params, _params_data: paramsData });
1712
+ this.$emit('btnEventTree', setData);
1713
+ },
1714
+ getRowTileBtnList(btnList) {
1715
+ this.rowTileBtnListTree = [];
1716
+ this.rowTileBtnListTree = btnList.filter(btn => btn.isShow == '1' && btn.type == 'ADD');
1717
+ },
1718
+ relatedSearchInputBlur() {
1719
+ let searchInput = this.$refs.relatedSearchInput;
1720
+ if (!searchInput) return;
1721
+ if (!searchInput.$el?.children) return;
1722
+ if (!searchInput.$el.children[0]?.children) return;
1723
+ if (!searchInput.$el.children[0].children[0]) return;
1724
+ if (!searchInput.$el.children[0].children[0]?.children) return;
1725
+ let inputDom = searchInput.$el.children[0].children[0].children[0];
1726
+ if (!inputDom) return;
1727
+ inputDom.blur();
1728
+ },
1729
+ handleRequestedLabel(v) {
1730
+ let params = { type: v, pageSize: 10000 };
1731
+ return this.axios.get('/label/list', { params: params });
1732
+ },
1733
+ initOutSearchFieldList(config = {}) {
1734
+ this.outSearchFieldList = [];
1735
+ this.outRelationQuickSearch = [];
1736
+ let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => ((i.random_key = this.getFiledRandom_key(i)), i.isShowSearch == 1 && i.filterExplicit == 1));
1737
+ this.outSearchFieldList = mySearchFieldList;
1738
+ // 跨表
1739
+ let outRelationQuickSearch = this.relationTableList.map(item => {
1740
+ return {
1741
+ fieldList: item.fieldList.fieldList.filter(item => item.isShowSearch == 1 && item.filterExplicit == 1) || [],
1742
+ tableName: item.tableName,
1743
+ primaryField: item.primaryField,
1744
+ parameterConversionId: item.parameterConversionId,
1745
+ tableId: item.tableId,
1746
+ relationField: item.relationField,
1747
+ converFun: item.converFun,
1748
+ relationOrgId: item.relationOrgId,
1749
+ preConObj: item.preConObj,
1750
+ preSqlExpression: item.preSqlExpression
1751
+ };
1752
+ });
1753
+ outRelationQuickSearch = outRelationQuickSearch.filter(item => item.fieldList.length);
1754
+ this.$set(this, 'outRelationQuickSearch', outRelationQuickSearch);
1755
+ this.dealOutFilterHideBtn();
1756
+ this.handlerInitSearchItem(this.outSearchFieldList);
1757
+ this.outRelationQuickSearch.forEach(item => {
1758
+ this.handlerInitSearchItem(item.fieldList);
1759
+ });
1760
+ if (this.lastOutSearchFieldList.length > 0) {
1761
+ this.outSearchFieldList = _.cloneDeep(this.lastOutSearchFieldList);
1762
+ }
1763
+ if (this.lastOutRelationQuickSearch.length) {
1764
+ this.outRelationQuickSearch = this.$utils.clone(this.lastOutRelationQuickSearch, true);
1765
+ }
1766
+
1767
+ // 如有配置默认值
1768
+ if (this.outSearchFieldList.some(v => !!v.explicitDefaultVal)) {
1769
+ this.$emit('outSearchInit');
1770
+ if ('reset' != config?.type) {
1771
+ this.outFilterChange({ type: 'outSearchInit' });
1772
+ }
1773
+ }
1774
+ },
1775
+ dealOutFilterHideBtn() {
1776
+ if (!this.isShowSetting('buttonAdaption') && this.outSearchFieldList.length > 0) {
1777
+ // 如果设置了按钮自适应 全部按钮放入折叠按钮
1778
+ // 需要考虑按钮是否有分组 过滤掉分组
1779
+ let rowTileBtnList = JSON.parse(JSON.stringify(this.rowTileBtnList));
1780
+ let hideBtn = rowTileBtnList.filter(item => {
1781
+ if (!item.isVisible) return false;
1782
+ if (!item.buttonGroup) return true;
1783
+ if (this.groupBtnObj && this.groupBtnObj[item.buttonGroup]) return false;
1784
+ return true;
1785
+ });
1786
+ this.rowTileBtnList = rowTileBtnList.map(i => {
1787
+ i['isHide'] = true;
1788
+ return i;
1789
+ });
1790
+ let rowFoldHideBtnListObj = {
1791
+ ADD: { name: '新增按钮', list: [] },
1792
+ INLINE: { name: '行级按钮', list: [] },
1793
+ BATCH: { name: '批量按钮', list: [] }
1794
+ };
1795
+ hideBtn.forEach(item => {
1796
+ this.$set(item, 'isHide', true);
1797
+ if (item.type === 'ADD') {
1798
+ rowFoldHideBtnListObj.ADD.list.push(item);
1799
+ } else if (item.type == 'BATCH') {
1800
+ rowFoldHideBtnListObj.BATCH.list.push(item);
1801
+ } else {
1802
+ rowFoldHideBtnListObj.INLINE.list.push(item);
1803
+ }
1804
+ });
1805
+ this.rowFoldHideBtnListObj = rowFoldHideBtnListObj;
1806
+ this.rowFoldHideBtnList = hideBtn;
1807
+ }
1808
+ },
1809
+ outFilterChange(config = {}) {
1810
+ let conObj = this.getConObjParams() || [];
1811
+ this.onSave(conObj, true, config);
1812
+ },
1813
+ visibleBtn(btn) {
1814
+ if (!btn.isVisible) return false;
1815
+ if (this.isInlineOperating) return false;
1816
+
1817
+ return true;
1818
+ },
1819
+ /* 打印相关 */
1820
+ toSelectPrintObjs(value) {
1821
+ let oldtableData = this.oldtableData;
1822
+ let selectData = [];
1823
+ if (value && value.length) {
1824
+ value.forEach(v => {
1825
+ let loopNode;
1826
+ this.loop(oldtableData, v.my_index, item => {
1827
+ loopNode = item;
1828
+ });
1829
+ selectData.push({
1830
+ ...loopNode
1831
+ });
1832
+ });
1833
+ }
1834
+ selectData = selectData.map(item => {
1835
+ return utils.paramsToPrintValue(item);
1836
+ });
1837
+
1838
+ return selectData;
1839
+ },
1840
+ loop(data, theUniqueKey, callback) {
1841
+ data.forEach((item, index, arr) => {
1842
+ if (item.theUniqueKey === theUniqueKey) {
1843
+ return callback(item, index, arr);
1844
+ }
1845
+ if (item.children) {
1846
+ return this.loop(item.children, theUniqueKey, callback);
1847
+ }
1848
+ });
1849
+ },
1850
+ getPrintBtnParams(btn) {
1851
+ const paramsData = JSON.parse(JSON.stringify(this.paramsData));
1852
+ // const selectRows = this.toSelectPrintObjs(paramsData.form.selectRows);
1853
+ const setData = JSON.parse(btn.setting);
1854
+ let paramsArray = [];
1855
+ paramsData.form.selectRows.forEach(i => {
1856
+ const obj = {
1857
+ table: i
1858
+ };
1859
+ // paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj })));
1860
+ paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj, table: i })));
1861
+ });
1862
+
1863
+ return paramsArray;
1864
+ },
1865
+ setPrintNumberToBtnList(printNumberList = [], btnList = []) {
1866
+ let cloneList = _.cloneDeep(btnList);
1867
+
1868
+ printNumberList.forEach((item, index) => {
1869
+ const i = cloneList.findIndex(v => v.settingObj[0].trigger_id == item.id);
1870
+ if (i > -1) {
1871
+ cloneList[i].__printConfig = {
1872
+ number: item.number,
1873
+ authorizationKey: item.authorizationKey,
1874
+ port: item.port,
1875
+ versionType: item.versionType,
1876
+ hisParams: { reportid: item.number }
1877
+ };
1878
+ }
1879
+ // cloneList[index].__printConfig = {
1880
+ // number: item.number,
1881
+ // authorizationKey: item.authorizationKey,
1882
+ // port: item.port,
1883
+ // versionType: item.versionType,
1884
+ // hisParams: { reportid: item.number }
1885
+ // };
1886
+ });
1887
+
1888
+ return cloneList;
1889
+ },
1890
+ async getPrintNumber(list) {
1891
+ if (!list?.length) return;
1892
+
1893
+ let ids = list.map(item => item.settingObj[0].trigger_id).join(',');
1894
+
1895
+ let printNumberCacheKeys = Object.keys(this.printNumberCache);
1896
+ let haveCache = printNumberCacheKeys.includes(ids);
1897
+ if (haveCache) {
1898
+ let printNumberList = this.printNumberCache[ids];
1899
+ this.printBtnStrategys = printNumberList;
1900
+ return Promise.resolve(printNumberList);
1901
+ }
1902
+
1903
+ let res = await this.handleGetConfigApi({ ids }, 'requestGetByIds');
1904
+
1905
+ const { status, data } = res;
1906
+ if (status) {
1907
+ let resList = data?.list || [];
1908
+ this.printBtnStrategys = resList;
1909
+ list = resList.map(item => {
1910
+ return {
1911
+ number: item.number,
1912
+ authorizationKey: data.authorizationKey,
1913
+ versionType: data.versionType,
1914
+ port: data.port,
1915
+ id: item.id,
1916
+ ...item
1917
+ };
1918
+ });
1919
+ let len = list?.length || 0;
1920
+ if (len > 0) {
1921
+ this.setPrintNumberCache({
1922
+ ids,
1923
+ list
1924
+ });
1925
+ }
1926
+
1927
+ return list;
1928
+ }
1929
+ return list;
1930
+ },
1931
+ async receivePrintSuccessAboutPrint(res, info) {
1932
+ const printBtn = this.printBtn;
1933
+ const templateId = info.templateId;
1934
+ const formatId = info.formatId;
1935
+ const number = printBtn.__printConfig.number;
1936
+
1937
+ try {
1938
+ const print = { formatId, number };
1939
+ // 执行打印后置条件
1940
+ const result = await this.printConfig.postStepRule(printBtn.settingObj, {
1941
+ result: res,
1942
+ print: print
1943
+ });
1944
+
1945
+ if (result.method !== 'sync') return;
1946
+ // 同步刷新列表
1947
+ this.editTableWrapper?.$refs?.editTable?.getTableList('', false, true, true);
1948
+ } catch (error) {
1949
+ console.log('error', error);
1950
+ }
1951
+ },
1952
+ async receivePrintSuccess(res, info) {
1953
+ if (info.type === 'print') {
1954
+ await this.receivePrintSuccessAboutPrint(res, info);
1955
+ }
1956
+ setTimeout(() => {
1957
+ this.$message.success(res.message);
1958
+ }, 3500);
1959
+ },
1960
+ receivePrintError(res) {
1961
+ let errorMsg = res.message;
1962
+ res.errinfo && (errorMsg += `:${res.errinfo}`);
1963
+ this.$message.error(errorMsg);
1964
+ },
1965
+ resetAllPrintFnWatch() {
1966
+ let keys = Object.keys(this.printBtnPrevFnWatch);
1967
+ keys.forEach(key => {
1968
+ if (!this.printBtnPrevFnWatch[key]) return false;
1969
+ this.printBtnPrevFnWatch[key]();
1970
+ this.printBtnPrevFnWatch[key] = null;
1971
+ delete this.printBtnPrevFnWatch[key];
1972
+ });
1973
+ },
1974
+ printBtnPrevFnWatchSetTimeout(reject) {
1975
+ if (this.printBtnPrevFnWatchTimeoutTimer) {
1976
+ clearTimeout(this.printBtnPrevFnWatchTimeoutTimer);
1977
+ this.printBtnPrevFnWatchTimeoutTimer = null;
1978
+ }
1979
+
1980
+ this.printBtnPrevFnWatchTimeoutTimer = setTimeout(() => {
1981
+ this.resetAllPrintFnWatch();
1982
+ reject();
1983
+ }, 10000);
1984
+ },
1985
+ printBtnPrevFn(clickBtn, btn, type, j) {
1986
+ return new Promise((resolve, reject) => {
1987
+ /*
1988
+ 触发原按钮流程,在EditTable中触发原打印按钮节点时,修改[printPrevFinish]状态
1989
+ 触发watch,再执行Promise.resolve()
1990
+ */
1991
+ this.clickBtn(clickBtn, btn, clickBtn.my_index, true, j);
1992
+ const timestamp = Date.now();
1993
+
1994
+ this.resetAllPrintFnWatch();
1995
+ this.printPrevFinish = false;
1996
+
1997
+ this.printBtnPrevFnWatch[timestamp] = this.$watch('printPrevFinish', val => {
1998
+ if (!this.printBtnPrevFnWatch[timestamp]) return false;
1999
+ this.resetAllPrintFnWatch();
2000
+ resolve();
2001
+ });
2002
+
2003
+ this.printBtnPrevFnWatchSetTimeout(reject);
2004
+ });
2005
+ },
2006
+ inlineEditClick() {
2007
+ let { btnName, tipsMsg, isTips } = this.curBatchBtnData || {};
2008
+ let _this = this;
2009
+ // 保存是否需要提示
2010
+ if (isTips != 1) {
2011
+ this.setBatchSaveRowStatus(true);
2012
+ return;
2013
+ }
2014
+ this.$confirm({
2015
+ title: tipsMsg || `是否确认${btnName}`,
2016
+ okText: '确定',
2017
+ cancelText: '取消',
2018
+ onOk: () => {
2019
+ _this.setBatchSaveRowStatus(true);
2020
+ },
2021
+ onCancel() {}
2022
+ });
2023
+ },
2024
+
2025
+ /**
2026
+ * 获取外显检索的默认值设置
2027
+ */
2028
+ handleGetOutSearchInitValue() {
2029
+ if (this.outSearchFieldList.some(v => !!v.explicitDefaultVal)) {
2030
+ let conObj = this.getConObjParams() || [];
2031
+ return conObj;
2032
+ }
2033
+
2034
+ return [];
2035
+ },
2036
+
2037
+ getFiledRandom_key(el) {
2038
+ // 初始化
2039
+ const showSetting = el?.settingObj?.showSetting || [];
2040
+ let f = !this.$utils.isEmpty(el?.settingObj?.wordbook);
2041
+ if (!showSetting?.length && f) {
2042
+ return Math.random().toString();
2043
+ }
2044
+ return '11';
2045
+ },
2046
+
2047
+ inlineEditCancel() {
2048
+ this.setBatchCancelRowStatus(true);
2049
+ },
2050
+
2051
+ setBatchSaveRowStatus(f) {
2052
+ this.$emit('setBatchSaveRowStatus', f);
2053
+ },
2054
+
2055
+ setBatchCancelRowStatus(f) {
2056
+ this.$emit('setBatchCancelRowStatus', f);
2057
+ },
2058
+
2059
+ setPrintNumberCache(obj) {
2060
+ this.$emit('setPrintNumberCache', obj);
2061
+ },
2062
+
2063
+ getRef(key){
2064
+ let ref = this.$refs[key];
2065
+ if(Array.isArray(ref)){
2066
+ return ref[0];
2067
+ }
2068
+ return ref;
2069
+ },
2070
+
2071
+ /**
2072
+ * 赋值给检索外显
2073
+ */
2074
+ async setOutFilterValues(obj){
2075
+ if(typeof obj === 'object'){
2076
+
2077
+ const outObj = this.outSearchFieldList.reduce((pre,cur)=>{
2078
+ cur.columnName && (pre[cur.columnName]=cur)
2079
+ return pre;
2080
+ },{});
2081
+
2082
+ // 遍历对象赋值
2083
+ Object.keys(obj).forEach(k=>{
2084
+ let val = obj[k];
2085
+ let item = outObj[k] || {}
2086
+ if(vexutils.isObject(val)){
2087
+ let ks = ['bigValue','lessValue'];
2088
+ ks.forEach(kk=>{
2089
+ this.$set(item,kk,val[kk]);
2090
+ })
2091
+ } else {
2092
+ this.$set(item,'value',val);
2093
+ }
2094
+ // 检索组件,触发检索方法
2095
+ if (item?.comType == "SelectMuiWordBook"){
2096
+ this.setSelectMuiWordBookType(item,val)
2097
+ }
2098
+ })
2099
+
2100
+ await this.$nextTick();
2101
+ this.outFilterChange()
2102
+ }
2103
+ },
2104
+
2105
+ setSelectMuiWordBookType(item,val){
2106
+ if(Array.isArray(item.dataSource)){
2107
+ let f = item.dataSource.find(v=>v.myName == val);
2108
+ if(f) return
2109
+ }
2110
+ let rKey = item.columnName + item.random_key
2111
+ let ref = this.getRef(rKey);
2112
+ ref && ref.handleWordBookSearch(val,item)
2113
+ }
2114
+
2115
+ /* */
2116
+ },
2117
+ watch: {
2118
+ // 平铺列表 watch 触发 导致请求发很多次
2119
+ // 注释掉tableId 之后有问题请使用另外的方法解决, 不要再使用watch触发
2120
+ // tableId: {
2121
+ // immediate: true,
2122
+ // deep: true,
2123
+ // handler(val) {
2124
+ // val && this.getTableCondiTionListRequest(true);
2125
+ // }
2126
+ // },
2127
+ viewList: {
2128
+ deep: true,
2129
+ immediate: true,
2130
+ handler() {
2131
+ if (this.viewList.length > 0) {
2132
+ let curItem;
2133
+ let hasListType = true;
2134
+ this.viewList.forEach(v => {
2135
+ if (v.mark == 1) {
2136
+ curItem = v.id;
2137
+ }
2138
+ if (v.id == '0') {
2139
+ hasListType = false;
2140
+ }
2141
+ });
2142
+ hasListType &&
2143
+ this.viewList.push({
2144
+ id: '0',
2145
+ name: '列表模式' || this.$t('1.1.5.4')
2146
+ });
2147
+ // 查找默认值
2148
+ // let curItem = this.viewList.find(v => v.mark == 1);
2149
+ this.currentTempId = curItem || '0';
2150
+
2151
+ // 按钮打卡视图列表
2152
+ let tableViewId = this.optionsValue('tableViewId');
2153
+ let onlyOpenView = this.optionsValue('hideViewList') && tableViewId;
2154
+ if (onlyOpenView) {
2155
+ this.currentTempId = tableViewId;
2156
+ }
2157
+ // this.handlerSelectTemp(this.currentTempId);
2158
+ this.$emit('handlerChangeView', this.currentTempId);
2159
+ } else {
2160
+ this.currentTempId = '0';
2161
+ // this.handlerSelectTemp(this.currentTempId);
2162
+ this.editTableSource != 'relatedComponent' && this.$emit('handlerChangeView', this.currentTempId);
2163
+ }
2164
+ }
2165
+ },
2166
+ getIsTile: {
2167
+ immediate: true,
2168
+ handler(val) {
2169
+ if (val === undefined) return;
2170
+ this.isTile = val;
2171
+ }
2172
+ },
2173
+ rowBtnList: {
2174
+ immediate: true,
2175
+ deep: true,
2176
+ handler() {
2177
+ this.formatRowBtnList();
2178
+ this.handleOtherConfigInit();
2179
+ }
2180
+ },
2181
+ initPageResize: {
2182
+ immediate: true,
2183
+ deep: true,
2184
+ handler(val) {
2185
+ if (!val || !Object.keys(val).length) return;
2186
+ if (this.isButtonFolding || this.isShowSetting('buttonAdaption')) return;
2187
+ let { classificationIndex } = val;
2188
+ if (classificationIndex < 0) return;
2189
+ this.pageResize({});
2190
+ }
2191
+ },
2192
+ relatedBaseInfo: {
2193
+ immediate: true,
2194
+ deep: true,
2195
+ handler(val) {
2196
+ if (!val || !Object.keys(val).length) return;
2197
+ let { buttonList } = val;
2198
+ if (!buttonList || !buttonList.length) return;
2199
+ this.getRowTileBtnList(buttonList);
2200
+ }
2201
+ },
2202
+ searchFieldList: {
2203
+ immediate: true,
2204
+ deep: true,
2205
+ handler(val) {
2206
+ if (val && val.length > 0) {
2207
+ this.initOutSearchFieldList();
2208
+ }
2209
+ }
2210
+ },
2211
+ tabConditionNumObj: {
2212
+ immediate: true,
2213
+ deep: true,
2214
+ handler(val) {
2215
+ if (this.conditionType === 'keyword' && val && Object.keys(val).length > 0) {
2216
+ this.tabConditionList.length > 0 &&
2217
+ this.tabConditionList.forEach(item => {
2218
+ if (val[item.sid] !== undefined) this.$set(item, 'digital', val[item.sid]);
2219
+ });
2220
+ }
2221
+ }
2222
+ },
2223
+ searchPlaceHolder: {
2224
+ immediate: true,
2225
+ handler(val) {
2226
+ if (!val || this.showRelatedTreeBtn) return;
2227
+ this.$nextTick(() => {
2228
+ this.showPlaceholderPrefix = false;
2229
+ let dom = this.$refs.baseSearchPlaceholderSpan;
2230
+ if (!dom) return;
2231
+ // input 框有padding 32px ...显示需要多预留一些宽度12px
2232
+ let w = dom.offsetWidth + 45;
2233
+ // 非筛选外显input 有enterButton 预留宽度
2234
+ if (!this.showOutSearch) {
2235
+ w += 45;
2236
+ }
2237
+ let maxW = 300;
2238
+ this.inputSearchW = w > maxW ? maxW : w < 200 ? 200 : w;
2239
+ if (w > maxW) {
2240
+ this.showPlaceholderPrefix = true;
2241
+ }
2242
+ this.onResize();
2243
+ });
2244
+ }
2245
+ }
2246
+ }
2247
+ });
2248
+ </script>
2249
+
2250
+ <style lang="less" scoped>
2251
+ .base-search {
2252
+ flex: 1;
2253
+ .base-container {
2254
+ display: flex;
2255
+ justify-content: space-between;
2256
+ text-align: left;
2257
+ background: #fff;
2258
+ }
2259
+ .bease-left {
2260
+ display: flex;
2261
+ justify-content: flex-start;
2262
+ align-items: flex-start;
2263
+ flex: 1;
2264
+ .btn-custom-wrap {
2265
+ width: 100%;
2266
+ display: flex;
2267
+ justify-content: flex-end;
2268
+ align-items: flex-start;
2269
+ }
2270
+ }
2271
+ .base-tabs {
2272
+ display: flex;
2273
+ align-items: center;
2274
+ border-bottom: 1px solid #d5d5d5;
2275
+ margin-bottom: 8px;
2276
+ .base-tabs-item {
2277
+ padding: 7px 16px;
2278
+ font-size: 14px;
2279
+ color: #212121;
2280
+ font-weight: 400;
2281
+ cursor: pointer;
2282
+ border-bottom: 1px solid transparent;
2283
+ }
2284
+ .base-tabs-item-active {
2285
+ color: #2d7aff;
2286
+ border-bottom: 1px solid #2d7aff;
2287
+ }
2288
+ }
2289
+ ul {
2290
+ display: flex;
2291
+ align-items: center;
2292
+ flex-wrap: wrap;
2293
+ margin-top: 8px;
2294
+ li {
2295
+ display: inline-block;
2296
+ /deep/ .search-default {
2297
+ height: 32px;
2298
+ line-height: 32px;
2299
+ margin-bottom: 8px;
2300
+ margin-right: 8px;
2301
+ border-color: #d5d5d5;
2302
+ color: #212121;
2303
+ .ant-btn {
2304
+ border-color: #d5d5d5;
2305
+ color: #212121;
2306
+ }
2307
+ }
2308
+ /deep/ .out-filter-input {
2309
+ width: 200px;
2310
+ margin: 0 8px 8px 0;
2311
+ .ant-input-wrapper {
2312
+ .ant-input-group-addon {
2313
+ border: 1px solid #d9d9d9 !important;
2314
+ border-left: 0 !important;
2315
+ }
2316
+ }
2317
+ }
2318
+ .my-input-search {
2319
+ vertical-align: middle;
2320
+ position: relative;
2321
+ top: -1px;
2322
+ margin-bottom: 8px;
2323
+ margin-right: 8px;
2324
+ height: 32px;
2325
+ /deep/ .ant-input {
2326
+ margin-top: 1px;
2327
+ border-right: 0 !important;
2328
+ &:hover {
2329
+ & + .ant-input-suffix {
2330
+ .ant-input-search-icon {
2331
+ color: #579aff;
2332
+ }
2333
+ }
2334
+ }
2335
+ }
2336
+ /deep/ .ant-input-group-addon {
2337
+ padding: 0;
2338
+ border: 0 !important;
2339
+ vertical-align: bottom;
2340
+ .ant-btn {
2341
+ border-top-left-radius: 0;
2342
+ border-bottom-left-radius: 0;
2343
+ }
2344
+ }
2345
+ .svg-icon {
2346
+ margin-right: 0;
2347
+ font-size: 16px;
2348
+ }
2349
+ }
2350
+ .mr8 {
2351
+ margin-right: 8px;
2352
+ margin-bottom: 8px;
2353
+ }
2354
+ .mr12 {
2355
+ margin-right: 12px;
2356
+ margin-bottom: 8px;
2357
+ }
2358
+ .ml12 {
2359
+ margin-left: 12px;
2360
+ margin-bottom: 8px;
2361
+ }
2362
+ &.related-search-input {
2363
+ /deep/ .my-input-search {
2364
+ width: 40px;
2365
+ .ant-input-affix-wrapper {
2366
+ width: 0px;
2367
+ .ant-input {
2368
+ width: 0;
2369
+ outline: none;
2370
+ box-shadow: none;
2371
+ &:focus {
2372
+ outline: none;
2373
+ }
2374
+ }
2375
+ .ant-input:not(:last-child) {
2376
+ padding: 0px;
2377
+ border: 0px !important;
2378
+ }
2379
+ .ant-input-suffix {
2380
+ i {
2381
+ display: none;
2382
+ }
2383
+ }
2384
+ }
2385
+ .ant-input-group-addon {
2386
+ .ant-btn {
2387
+ border-top-left-radius: 4px;
2388
+ border-bottom-left-radius: 4px;
2389
+ }
2390
+ }
2391
+ }
2392
+ }
2393
+ &.related-search-input-expand {
2394
+ transition: width 0.2s;
2395
+ /deep/ .my-input-search {
2396
+ width: 215px;
2397
+ .ant-input-affix-wrapper {
2398
+ .ant-input-suffix {
2399
+ i {
2400
+ display: inline-block;
2401
+ }
2402
+ }
2403
+ }
2404
+ }
2405
+ }
2406
+ }
2407
+ .dropdown-button {
2408
+ color: #212121;
2409
+ border-color: #d5d5d5 !important;
2410
+ margin-left: 8px;
2411
+ margin-bottom: 8px;
2412
+ /deep/ .svg-icon {
2413
+ margin-right: 4px;
2414
+ }
2415
+ &.ant-dropdown-trigger {
2416
+ i.anticon.anticon-down {
2417
+ color: #969696;
2418
+ font-size: 14px;
2419
+ }
2420
+ }
2421
+ }
2422
+ .baseSearch-input-search {
2423
+ .input-search-com {
2424
+ input {
2425
+ padding: 4px 8px;
2426
+ }
2427
+ .search-placeholder-icon {
2428
+ color: #b4b4b4;
2429
+ }
2430
+ }
2431
+ }
2432
+ }
2433
+ /deep/ .num-picker {
2434
+ position: relative;
2435
+ display: flex;
2436
+ &.num-picker-unit {
2437
+ padding-right: 20px;
2438
+ }
2439
+ input {
2440
+ text-align: left !important;
2441
+ }
2442
+ &:hover {
2443
+ .clear-number-icon {
2444
+ display: block;
2445
+ }
2446
+ }
2447
+ /deep/ .ant-calendar-range-picker-input {
2448
+ text-align: left;
2449
+ }
2450
+ .clear-number-icon {
2451
+ position: absolute;
2452
+ right: 5px;
2453
+ top: 6px;
2454
+ display: none;
2455
+ cursor: pointer;
2456
+ z-index: 1000;
2457
+ }
2458
+ }
2459
+ .btn-row {
2460
+ display: inline-flex;
2461
+ line-height: 32px;
2462
+ height: 32px;
2463
+ // padding: 0 10px;
2464
+ padding-right: 8px;
2465
+ margin-bottom: 8px;
2466
+ transform: translateZ(0);
2467
+ .mgl-10 {
2468
+ margin-left: 10px;
2469
+ }
2470
+ &.min-width {
2471
+ min-width: 212px;
2472
+ }
2473
+ /deep/ .ant-select-selection__rendered {
2474
+ color: #212121;
2475
+ font-size: 14px;
2476
+ }
2477
+ /deep/ .ant-select-arrow {
2478
+ i {
2479
+ color: #969696;
2480
+ font-size: 12px;
2481
+ }
2482
+ }
2483
+ .btn-setting {
2484
+ margin-right: 4px;
2485
+ }
2486
+ .viewList-button {
2487
+ display: flex;
2488
+ align-items: center;
2489
+ justify-content: center;
2490
+ padding: 0 12px;
2491
+ }
2492
+ }
2493
+ .search-tile {
2494
+ max-width: 100%;
2495
+ max-height: 74px;
2496
+ overflow-x: auto;
2497
+ /deep/ .ant-btn {
2498
+ margin-right: 10px;
2499
+ margin-bottom: 5px;
2500
+ }
2501
+ }
2502
+
2503
+ .psw-icon {
2504
+ cursor: pointer;
2505
+ &:active {
2506
+ color: #5585f5;
2507
+ // #2474ff
2508
+ }
2509
+ color: #969696;
2510
+ }
2511
+
2512
+ ::-webkit-input-placeholder {
2513
+ /* WebKit browsers */
2514
+ font-family: 'Avenir', Helvetica, Arial, sans-serif;
2515
+ }
2516
+
2517
+ ::-moz-placeholder {
2518
+ /* Mozilla Firefox 19+ */
2519
+ font-family: 'Avenir', Helvetica, Arial, sans-serif;
2520
+ }
2521
+
2522
+ :-ms-input-placeholder {
2523
+ /* Internet Explorer 10+ */
2524
+ font-family: 'Avenir', Helvetica, Arial, sans-serif;
2525
+ }
2526
+ .baseSearchPlaceholderSpan {
2527
+ visibility: hidden;
2528
+ position: absolute;
2529
+ z-index: -1;
2530
+ }
2531
+ }
2532
+ </style>
2533
+ <style lang="less">
2534
+ .rowFoldHideBtnList-dropdown {
2535
+ .ant-dropdown-menu {
2536
+ overflow-y: auto;
2537
+ max-height: 99vh;
2538
+ }
2539
+ .ant-dropdown-menu-item-group {
2540
+ .ant-dropdown-menu-item-group-title {
2541
+ display: none;
2542
+ }
2543
+ border-bottom: 1px solid #d5d5d5;
2544
+ &:last-child {
2545
+ border-color: transparent;
2546
+ }
2547
+ }
2548
+ }
2549
+ .viewList-dropdown {
2550
+ min-width: 120px;
2551
+ .ant-dropdown-menu-item {
2552
+ display: flex;
2553
+ justify-content: space-between;
2554
+ align-items: center;
2555
+ color: #2e2e2e;
2556
+ margin: 1px 0;
2557
+ &:hover {
2558
+ background: #f2f2f2;
2559
+ }
2560
+ > span {
2561
+ display: inline;
2562
+ width: 85%;
2563
+ text-overflow: ellipsis;
2564
+ white-space: nowrap;
2565
+ overflow: hidden;
2566
+ }
2567
+ }
2568
+ .ant-dropdown-menu-item.menu-active {
2569
+ color: #2d7aff;
2570
+ }
2571
+ }
2572
+ </style>