vue2-client 1.15.84 → 1.15.86

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 (377) hide show
  1. package/.claude/settings.local.json +12 -0
  2. package/.editorconfig +9 -9
  3. package/.env +20 -20
  4. package/.env.development +1 -1
  5. package/.env.iot +19 -19
  6. package/.env.message +19 -19
  7. package/.env.revenue +19 -19
  8. package/.env.runtime +19 -19
  9. package/.eslintrc.json +5 -5
  10. package/CLAUDE.md +89 -89
  11. package/README.md +65 -65
  12. package/babel.config.js +21 -21
  13. package/docs/Logic/345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +46 -46
  14. package/docs/notice.md +22 -22
  15. package/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +179 -179
  16. package/jest.config.js +22 -22
  17. package/package.json +111 -111
  18. package/src/App.vue +196 -196
  19. package/src/ReportView.js +13 -13
  20. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +532 -532
  21. package/src/base-client/components/common/AddressSearchCombobox/index.js +3 -3
  22. package/src/base-client/components/common/AmapMarker/index.js +3 -3
  23. package/src/base-client/components/common/CitySelect/CitySelect.vue +376 -376
  24. package/src/base-client/components/common/CitySelect/demo.vue +43 -43
  25. package/src/base-client/components/common/ColorPickerCombobox/ColorPickerCombobox.vue +99 -99
  26. package/src/base-client/components/common/ColorPickerCombobox/demo.vue +34 -34
  27. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +146 -146
  28. package/src/base-client/components/common/JSONToTree/index.js +3 -3
  29. package/src/base-client/components/common/Upload/Upload.vue +323 -323
  30. package/src/base-client/components/common/XAddForm/index.js +3 -3
  31. package/src/base-client/components/common/XAddForm/index.md +61 -61
  32. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +1169 -1169
  33. package/src/base-client/components/common/XAddNativeForm/demo.vue +54 -40
  34. package/src/base-client/components/common/XAddNativeForm/index.js +3 -3
  35. package/src/base-client/components/common/XAddReport/XAddReport.vue +212 -212
  36. package/src/base-client/components/common/XBadge/index.js +3 -3
  37. package/src/base-client/components/common/XBadge/index.md +39 -39
  38. package/src/base-client/components/common/XButtons/XButtons.vue +284 -284
  39. package/src/base-client/components/common/XCalendar/XCalendar.vue +369 -369
  40. package/src/base-client/components/common/XCalendar/index.md +284 -284
  41. package/src/base-client/components/common/XCard/index.js +3 -3
  42. package/src/base-client/components/common/XCard/index.md +43 -43
  43. package/src/base-client/components/common/XCardSet/XCardSet.vue +300 -300
  44. package/src/base-client/components/common/XCollapse/XCollapse.vue +354 -354
  45. package/src/base-client/components/common/XConversation/XConversation.vue +576 -576
  46. package/src/base-client/components/common/XConversation/XConversationDemo.vue +28 -28
  47. package/src/base-client/components/common/XDataCard/XDataCard.vue +629 -629
  48. package/src/base-client/components/common/XDatePicker/index.vue +276 -276
  49. package/src/base-client/components/common/XDescriptions/XDescriptions.vue +174 -174
  50. package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +314 -314
  51. package/src/base-client/components/common/XDescriptions/demo.vue +51 -51
  52. package/src/base-client/components/common/XForm/XForm.vue +420 -420
  53. package/src/base-client/components/common/XForm/XFormItem.vue +1474 -1390
  54. package/src/base-client/components/common/XForm/XTreeSelect.vue +276 -276
  55. package/src/base-client/components/common/XForm/demo.vue +105 -105
  56. package/src/base-client/components/common/XForm/index.js +3 -3
  57. package/src/base-client/components/common/XFormCol/XFormCol.vue +157 -157
  58. package/src/base-client/components/common/XFormCol/index.js +3 -3
  59. package/src/base-client/components/common/XFormCol/index.md +35 -35
  60. package/src/base-client/components/common/XFormGroup/XFormGroup.vue +301 -301
  61. package/src/base-client/components/common/XFormGroup/demo.vue +41 -41
  62. package/src/base-client/components/common/XFormTable/XFormTable.vue +938 -938
  63. package/src/base-client/components/common/XFormTable/demo.vue +87 -87
  64. package/src/base-client/components/common/XFormTable/index.js +3 -3
  65. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +174 -174
  66. package/src/base-client/components/common/XImportExcel/index.js +3 -3
  67. package/src/base-client/components/common/XImportExcel/index.md +38 -38
  68. package/src/base-client/components/common/XInput/XInput.vue +128 -128
  69. package/src/base-client/components/common/XInput/index.js +3 -3
  70. package/src/base-client/components/common/XInput/index.md +97 -97
  71. package/src/base-client/components/common/XIntervalPicker/XIntervalPicker.vue +121 -121
  72. package/src/base-client/components/common/XLicensePlate/index.js +3 -3
  73. package/src/base-client/components/common/XLicensePlate/index.md +38 -38
  74. package/src/base-client/components/common/XPrint/Demo.vue +41 -41
  75. package/src/base-client/components/common/XPrint/PrintBill.vue +308 -308
  76. package/src/base-client/components/common/XRate/demo.vue +102 -102
  77. package/src/base-client/components/common/XRate/index.vue +149 -149
  78. package/src/base-client/components/common/XReport/XReport.vue +963 -963
  79. package/src/base-client/components/common/XReport/XReportDemo.vue +70 -70
  80. package/src/base-client/components/common/XReport/XReportTrGroup.vue +1005 -1005
  81. package/src/base-client/components/common/XReport/index.md +103 -103
  82. package/src/base-client/components/common/XReportDrawer/XReportDrawer.vue +201 -201
  83. package/src/base-client/components/common/XReportGrid/XReport.vue +1075 -1075
  84. package/src/base-client/components/common/XReportGrid/XReportDemo.vue +44 -44
  85. package/src/base-client/components/common/XReportGrid/XReportDesign.vue +620 -620
  86. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +723 -723
  87. package/src/base-client/components/common/XReportGrid/print.js +184 -184
  88. package/src/base-client/components/common/XTab/XTab.vue +299 -299
  89. package/src/base-client/components/common/XTable/ExportExcel.vue +283 -283
  90. package/src/base-client/components/common/XTable/XTable.vue +1599 -1599
  91. package/src/base-client/components/common/XTable/XTableWrapper.vue +597 -597
  92. package/src/base-client/components/common/XTable/index.js +3 -3
  93. package/src/base-client/components/common/XTimeline/XTimeline.vue +358 -358
  94. package/src/base-client/components/common/XTimeline/index.md +191 -191
  95. package/src/base-client/components/common/XTree/XTreePro.vue +452 -452
  96. package/src/base-client/components/common/XTreeOne/index.js +3 -3
  97. package/src/base-client/components/common/XUploadFilesView/index.vue +485 -485
  98. package/src/base-client/components/his/XCharge/XCharge.vue +238 -238
  99. package/src/base-client/components/his/XCheckbox/XCheckbox.vue +105 -105
  100. package/src/base-client/components/his/XCheckbox/index.md +253 -253
  101. package/src/base-client/components/his/XHDescriptions/XHDescriptions.vue +430 -430
  102. package/src/base-client/components/his/XHDescriptions/index.md +217 -217
  103. package/src/base-client/components/his/XHisEditor/XHisEditor.vue +629 -629
  104. package/src/base-client/components/his/XHisEditor/diagnosisAutocomplete.js +263 -263
  105. package/src/base-client/components/his/XList/XList.vue +495 -495
  106. package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.json +3 -3
  107. package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.vue +106 -106
  108. package/src/base-client/components/his/XQuestionnaire/XQuestionnaireDemo.vue +51 -51
  109. package/src/base-client/components/his/XQuestionnaire/XQuestionnaireItem.vue +269 -269
  110. package/src/base-client/components/his/XRadio/XRadio.vue +125 -125
  111. package/src/base-client/components/his/XRadio/index.md +234 -234
  112. package/src/base-client/components/his/XSelect/XSelect.vue +72 -72
  113. package/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +234 -234
  114. package/src/base-client/components/his/XShiftSchedule/dome.vue +29 -29
  115. package/src/base-client/components/his/XSidebar/XSidebar.vue +240 -240
  116. package/src/base-client/components/his/XTextCard/XTextCard.vue +207 -207
  117. package/src/base-client/components/his/XTimeSelect/XTimeSelect.vue +162 -162
  118. package/src/base-client/components/his/XTimeSelect/XTimeSelectDemo.vue +23 -23
  119. package/src/base-client/components/his/XTitle/README.md +113 -113
  120. package/src/base-client/components/his/XTitle/XTitle.vue +123 -123
  121. package/src/base-client/components/his/XTreeRows/TreeNode.vue +107 -107
  122. package/src/base-client/components/his/XTreeRows/XTreeRows.vue +307 -307
  123. package/src/base-client/components/his/threeTestOrders/dome.vue +68 -68
  124. package/src/base-client/components/his/threeTestOrders/editor.vue +111 -111
  125. package/src/base-client/components/his/threeTestOrders/textBox.vue +457 -457
  126. package/src/base-client/components/his/threeTestOrders/threeTestOrders.vue +475 -475
  127. package/src/base-client/components/layout/XPageView/RenderRow.vue +88 -88
  128. package/src/base-client/components/layout/XPageView/XErrorView.vue +22 -22
  129. package/src/base-client/components/layout/XPageView/XPageRowTemplate.vue +37 -37
  130. package/src/base-client/components/layout/XPageView/XPageView.vue +223 -223
  131. package/src/base-client/components/layout/XPageView/XTab/XTab.vue +96 -96
  132. package/src/base-client/components/layout/XPageView/XTab/index.js +3 -3
  133. package/src/base-client/components/layout/XPageView/componentTypes.js +22 -22
  134. package/src/base-client/components/layout/XPageView/index.js +2 -2
  135. package/src/base-client/components/layout/XPageView/index.md +96 -96
  136. package/src/base-client/components/system/DictionaryDetailsView/index.js +3 -3
  137. package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -41
  138. package/src/base-client/components/system/LogDetailsView/LogDetailsView.vue +376 -376
  139. package/src/base-client/components/system/LogDetailsView/index.js +3 -3
  140. package/src/base-client/components/system/LogDetailsView/index.md +41 -41
  141. package/src/base-client/components/system/QueryParamsDetailsView/index.js +3 -3
  142. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  143. package/src/base-client/components/ticket/TicketDetailsView/index.js +3 -3
  144. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  145. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  146. package/src/base-client/components/ticket/TicketDetailsView/part/index.js +3 -3
  147. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  148. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.js +3 -3
  149. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  150. package/src/base-client/plugins/AppData.js +126 -126
  151. package/src/base-client/plugins/PagedList.js +177 -177
  152. package/src/base-client/plugins/__tests__/selectValueTypeHelper.test.js +154 -0
  153. package/src/base-client/plugins/authority-plugin.js +167 -167
  154. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  155. package/src/base-client/plugins/i18n-extend.js +32 -32
  156. package/src/base-client/plugins/moment.js +8 -8
  157. package/src/base-client/plugins/selectValueTypeHelper.js +281 -0
  158. package/src/bootstrap.js +51 -51
  159. package/src/components/Ellipsis/Ellipsis.vue +65 -65
  160. package/src/components/Ellipsis/index.js +3 -3
  161. package/src/components/Ellipsis/index.md +38 -38
  162. package/src/components/FileImageItem/FileItem.vue +320 -320
  163. package/src/components/FileImageItem/FileItemGroup.vue +197 -197
  164. package/src/components/FileImageItem/ImageItem.vue +107 -107
  165. package/src/components/FileImageItem/index.js +4 -4
  166. package/src/components/FilePreview/FilePreview.vue +181 -181
  167. package/src/components/FilePreview/FilePreviewDemo.vue +30 -30
  168. package/src/components/FilePreview/index.js +3 -3
  169. package/src/components/HeightScanner/index.vue +615 -615
  170. package/src/components/STable/README.md +341 -341
  171. package/src/components/STable/index.js +558 -558
  172. package/src/components/TableSetting/TableSetting.vue +143 -143
  173. package/src/components/TableSetting/index.js +3 -3
  174. package/src/components/Trend/Trend.vue +41 -41
  175. package/src/components/Trend/index.js +3 -3
  176. package/src/components/Trend/index.less +41 -41
  177. package/src/components/Trend/index.md +45 -45
  178. package/src/components/_util/util.js +46 -46
  179. package/src/components/cache/AKeepAlive.js +179 -179
  180. package/src/components/exception/typeConfig.js +19 -19
  181. package/src/components/form/FormRow.vue +52 -52
  182. package/src/components/index.less +5 -5
  183. package/src/components/menu/Contextmenu.vue +84 -84
  184. package/src/components/menu/index.less +38 -38
  185. package/src/components/page/header/PageHeader.vue +64 -64
  186. package/src/components/page/header/index.less +40 -40
  187. package/src/components/result/Result.vue +77 -77
  188. package/src/components/setting/SettingItem.vue +26 -26
  189. package/src/components/setting/i18n.js +117 -117
  190. package/src/components/table/StandardTable.vue +141 -141
  191. package/src/components/table/advance/ActionColumns.vue +158 -158
  192. package/src/components/table/advance/ActionSize.vue +45 -45
  193. package/src/components/table/advance/AdvanceTable.vue +275 -275
  194. package/src/components/table/advance/SearchArea.vue +355 -355
  195. package/src/components/table/advance/index.js +2 -2
  196. package/src/components/table/api/ApiTable.vue +50 -50
  197. package/src/components/task/TaskGroup.vue +80 -80
  198. package/src/components/task/TaskItem.vue +26 -26
  199. package/src/components/tool/AvatarList.vue +68 -68
  200. package/src/components/tool/DetailList.vue +157 -157
  201. package/src/components/tool/Drawer.vue +142 -142
  202. package/src/components/tool/FooterToolBar.vue +30 -30
  203. package/src/components/tool/HeadInfo.vue +35 -35
  204. package/src/components/tool/TagSelect.vue +83 -83
  205. package/src/components/tool/TagSelectOption.vue +33 -33
  206. package/src/components/transition/PageToggleTransition.vue +97 -97
  207. package/src/config/default/admin.config.js +18 -18
  208. package/src/config/default/animate.config.js +21 -21
  209. package/src/config/default/index.js +6 -6
  210. package/src/config/index.js +3 -3
  211. package/src/config/replacer/index.js +10 -10
  212. package/src/config/replacer/resolve.config.js +67 -67
  213. package/src/expression/ExpressionRunner.js +26 -26
  214. package/src/expression/TestExpression.js +509 -509
  215. package/src/expression/core/Delegate.js +115 -115
  216. package/src/expression/core/Expression.js +1358 -1358
  217. package/src/expression/core/Program.js +932 -932
  218. package/src/expression/core/Token.js +27 -27
  219. package/src/expression/enums/ExpressionType.js +81 -81
  220. package/src/expression/enums/TokenType.js +11 -11
  221. package/src/expression/exception/BreakWayException.js +2 -2
  222. package/src/expression/exception/ContinueWayException.js +2 -2
  223. package/src/expression/exception/ExpressionException.js +28 -28
  224. package/src/expression/exception/ReturnWayException.js +14 -14
  225. package/src/expression/exception/ServiceException.js +22 -22
  226. package/src/expression/instances/LogicConsole.js +44 -44
  227. package/src/expression/ts/ExpressionRunner.ts +28 -28
  228. package/src/expression/ts/TestExpression.ts +509 -509
  229. package/src/expression/ts/core/Delegate.ts +114 -114
  230. package/src/expression/ts/core/Expression.ts +1309 -1309
  231. package/src/expression/ts/core/Program.ts +950 -950
  232. package/src/expression/ts/core/Token.ts +29 -29
  233. package/src/expression/ts/enums/ExpressionType.ts +81 -81
  234. package/src/expression/ts/enums/TokenType.ts +13 -13
  235. package/src/expression/ts/exception/BreakWayException.ts +2 -2
  236. package/src/expression/ts/exception/ContinueWayException.ts +2 -2
  237. package/src/expression/ts/exception/ExpressionException.ts +28 -28
  238. package/src/expression/ts/exception/ReturnWayException.ts +14 -14
  239. package/src/expression/ts/exception/ServiceException.ts +22 -22
  240. package/src/expression/ts/instances/JSONArray.ts +48 -48
  241. package/src/expression/ts/instances/JSONObject.ts +109 -109
  242. package/src/expression/ts/instances/LogicConsole.ts +32 -32
  243. package/src/layouts/AdminLayout.vue +176 -176
  244. package/src/layouts/BlankView.vue +79 -79
  245. package/src/layouts/ComponentLayoutOne.vue +47 -47
  246. package/src/layouts/GridView.vue +43 -43
  247. package/src/layouts/PageView.vue +55 -55
  248. package/src/layouts/footer/PageFooter.vue +49 -49
  249. package/src/layouts/header/HeaderAvatar.vue +64 -64
  250. package/src/layouts/header/HeaderSearch.vue +67 -67
  251. package/src/layouts/header/index.less +92 -92
  252. package/src/layouts/tabs/TabsView.vue +383 -383
  253. package/src/layouts/tabs/i18n.js +25 -25
  254. package/src/layouts/tabs/index.js +2 -2
  255. package/src/logic/LogicRunner.js +62 -62
  256. package/src/logic/TestLogic.js +13 -13
  257. package/src/logic/plugins/common/DateTools.js +35 -35
  258. package/src/logic/plugins/common/VueTools.js +30 -30
  259. package/src/logic/plugins/index.js +7 -7
  260. package/src/logic/ts/LogicRunner.ts +67 -67
  261. package/src/logic/ts/TestLogic.ts +13 -13
  262. package/src/main.js +33 -33
  263. package/src/mixins/formValidationMixin.js +46 -46
  264. package/src/mock/common/activityData.js +32 -32
  265. package/src/mock/common/index.js +89 -89
  266. package/src/mock/common/reportData.js +20 -20
  267. package/src/mock/common/tableData.js +118 -118
  268. package/src/mock/index.js +12 -12
  269. package/src/mock/project/index.js +17 -17
  270. package/src/mock/user/current.js +13 -13
  271. package/src/mock/user/login.js +39 -39
  272. package/src/mock/user/routes.js +61 -61
  273. package/src/mock/workplace/index.js +15 -15
  274. package/src/pages/LogicCallExample/index.vue +46 -46
  275. package/src/pages/ReportGrid/index.vue +76 -76
  276. package/src/pages/ReportView.vue +50 -50
  277. package/src/pages/WorkflowDetail/WorkFlowDemo.vue +47 -47
  278. package/src/pages/WorkflowDetail/WorkFlowDemo2.vue +204 -204
  279. package/src/pages/WorkflowDetail/WorkFlowDemo3.vue +203 -203
  280. package/src/pages/WorkflowDetail/WorkflowDetail.vue +391 -391
  281. package/src/pages/WorkflowDetail/WorkflowPageDetail/LeaveMessage.vue +388 -388
  282. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformation.vue +415 -415
  283. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +1766 -1765
  284. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandleReso.vue +975 -975
  285. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowPreview.vue +109 -109
  286. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +929 -929
  287. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkOrderParentDetails.vue +222 -222
  288. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowDetailResso.vue +243 -243
  289. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowLog.vue +188 -188
  290. package/src/pages/WorkflowDetail/WorkflowPageDetail/components/WorkflowPersonSelector.vue +109 -109
  291. package/src/pages/WorkflowDetail/WorkflowPageDetail/worklog.vue +97 -97
  292. package/src/pages/XPageViewExample/index.vue +149 -149
  293. package/src/pages/addressSelect/addressDemo.vue +24 -24
  294. package/src/pages/addressSelect/index.vue +270 -270
  295. package/src/pages/dashboard/workplace/i18n.js +40 -40
  296. package/src/pages/dashboard/workplace/index.js +2 -2
  297. package/src/pages/dashboard/workplace/index.less +59 -59
  298. package/src/pages/exception/403.vue +21 -21
  299. package/src/pages/exception/404.vue +24 -24
  300. package/src/pages/exception/500.vue +21 -21
  301. package/src/pages/login/index.js +2 -2
  302. package/src/pages/report/ReportTableHome.vue +28 -28
  303. package/src/pages/resourceManage/depListManage.vue +23 -23
  304. package/src/pages/resourceManage/funListManage.vue +23 -23
  305. package/src/pages/resourceManage/index.js +15 -15
  306. package/src/pages/resourceManage/resourceManageMain.vue +57 -57
  307. package/src/pages/resourceManage/roleListManage.vue +23 -23
  308. package/src/pages/resourceManage/staffListManage.vue +23 -23
  309. package/src/pages/system/file/Info.vue +56 -56
  310. package/src/pages/system/file/index.vue +317 -317
  311. package/src/pages/system/settings/index.vue +126 -126
  312. package/src/pages/userInfoDetailManage/FillCardRecordQuery/index.vue +77 -77
  313. package/src/pages/userInfoDetailManage/FillGasRecordQuery/index.vue +75 -75
  314. package/src/pages/userInfoDetailManage/InsuranceDetailQuery/index.vue +64 -64
  315. package/src/pages/userInfoDetailManage/MachineRecordQuery/index.vue +75 -75
  316. package/src/pages/userInfoDetailManage/OtherChargeRecordQuery/index.vue +75 -75
  317. package/src/pages/userInfoDetailManage/PriceAdjustments/index.vue +64 -64
  318. package/src/pages/userInfoDetailManage/UserChargeRecordQuery/index.vue +94 -94
  319. package/src/pages/userInfoDetailManage/UserException/index.vue +64 -64
  320. package/src/pages/userInfoDetailManage/UserHandRecordQuery/index.vue +87 -87
  321. package/src/pages/userInfoDetailManage/UserRecordQuery/index.vue +74 -74
  322. package/src/pages/userInfoDetailManage/index.vue +290 -290
  323. package/src/pages/userInfoDetailManage/uploadFilesHistory/ImagePreview.vue +101 -101
  324. package/src/pages/userInfoDetailManage/uploadFilesHistory/index.vue +129 -129
  325. package/src/pages/userInfoDetailManage/userInfoDetailQueryTabs.vue +144 -144
  326. package/src/plugins/HiPrintPlugin.js +164 -164
  327. package/src/router/async/router.map.js +126 -126
  328. package/src/router/guards.js +262 -262
  329. package/src/router/i18n.js +57 -57
  330. package/src/router.js +17 -17
  331. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  332. package/src/services/api/LogDetailsViewApi.js +10 -10
  333. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  334. package/src/services/api/logininfor/index.js +6 -6
  335. package/src/services/api/manage.js +8 -8
  336. package/src/services/api/restTools.js +215 -215
  337. package/src/services/api/workFlow.js +57 -57
  338. package/src/services/apiService.js +16 -16
  339. package/src/services/dataSource.js +12 -12
  340. package/src/services/index.js +7 -7
  341. package/src/services/user.js +92 -92
  342. package/src/services/v3Api.js +116 -116
  343. package/src/store/index.js +5 -5
  344. package/src/store/mutation-types.js +4 -4
  345. package/src/theme/antd/ant-menu.less +2 -2
  346. package/src/theme/antd/ant-message.less +3 -3
  347. package/src/theme/antd/ant-table.less +22 -22
  348. package/src/theme/antd/ant-time-picker.less +3 -3
  349. package/src/theme/antd/index.less +3 -3
  350. package/src/theme/default/color.less +43 -43
  351. package/src/theme/default/index.less +3 -3
  352. package/src/theme/default/nprogress.less +76 -76
  353. package/src/theme/global.less +279 -279
  354. package/src/theme/index.less +5 -5
  355. package/src/theme/reportTable.less +58 -58
  356. package/src/theme/theme.less +1 -1
  357. package/src/utils/EncryptUtil.js +162 -162
  358. package/src/utils/Objects.js +25 -25
  359. package/src/utils/axios-interceptors.js +100 -100
  360. package/src/utils/colors.js +107 -107
  361. package/src/utils/common.js +10 -10
  362. package/src/utils/excel/Blob.js +180 -180
  363. package/src/utils/excel/Export2Excel.js +141 -141
  364. package/src/utils/filter.js +21 -21
  365. package/src/utils/i18n.js +80 -80
  366. package/src/utils/indexedDB.js +549 -549
  367. package/src/utils/microAppUtils.js +49 -49
  368. package/src/utils/request.js +395 -395
  369. package/src/utils/routerUtil.js +553 -553
  370. package/src/utils/themeUtil.js +100 -100
  371. package/test/Tree.spec.js +168 -168
  372. package/test/myDialog.spec.js +47 -47
  373. package/test/request.test.js +17 -17
  374. package/test/util.test.js +53 -53
  375. package/test/v3Api.test.js +1984 -1984
  376. package/tests/unit/ReportTable.spec.js +16 -16
  377. package/vue.config.js +222 -222
@@ -1,532 +1,532 @@
1
- <template>
2
- <div id="addressSearchCombobox" style="padding: 4px 0;">
3
- <div style="display: flex; width: 100%;">
4
- <a-input-group style="flex: 1; display: flex;padding-top: 1px;" compact>
5
- <a-input
6
- v-model="addressInput"
7
- :read-only="readOnly || !this.addressObj.address"
8
- @change="change"
9
- style="flex: 1; min-width: 0;"
10
- placeholder="请选择地址信息"/>
11
- <a-button
12
- v-if="attr?.inputOnAfterName && attr?.inputOnAfterFunc"
13
- style="min-width: 4rem; max-width: 6rem;"
14
- type="primary"
15
- @click="emitFunc(attr?.inputOnAfterFunc, addressInput)">
16
- {{ attr?.inputOnAfterName }}
17
- </a-button>
18
- </a-input-group>
19
- <a-button
20
- style="flex-shrink: 0; margin-left: 0.2rem;"
21
- :type="attr?.inputOnAfterName ? 'primary' : ''"
22
- @click="visible = true">
23
- <IcMapIcon/>
24
- 定位
25
- </a-button>
26
- </div>
27
- <a-modal
28
- v-model="visible"
29
- title="地址选择"
30
- @ok="selected"
31
- :zIndex="m_index"
32
- :destroyOnClose="true"
33
- width="70%"
34
- >
35
- <div class="certain-category-search-wrapper">
36
- <a-auto-complete
37
- style="right: 0px;width: 90%;z-index:2;margin-top:2%;"
38
- :disabled="!mapAutocomplete"
39
- class="certain-category-search"
40
- dropdown-class-name="certain-category-search-dropdown"
41
- option-label-prop="value"
42
- placeholder="输入地址关键字搜索"
43
- @search="fetchFunction"
44
- @select="onSelect"
45
- >
46
- <a-spin v-if="searching" slot="notFoundContent" size="small"/>
47
- <template slot="dataSource">
48
- <a-select-opt-group v-for="group in option" :key="group.title">
49
- <span
50
- slot="label">
51
- <a-icon type="bank"/> {{ group.title }}
52
- </span>
53
- <a-select-option
54
- v-for="address in group.children"
55
- :key="address.address+'['+address.label+']'+' <' + address.value + '>'"
56
- >
57
- <p class="addressName">
58
- <a-icon type="environment"/>
59
- <span v-html="highLight(address.label, address.word)"></span></p>
60
- <p v-if="address.address !== '[]'" class="addressRemark">
61
- {{ address.address }}
62
- </p>
63
- </a-select-option>
64
- </a-select-opt-group>
65
- </template>
66
- <a-input>
67
- <a-icon slot="suffix" class="certain-category-icon" type="search"/>
68
- </a-input>
69
- </a-auto-complete>
70
- </div>
71
- <div id="addressSearchCombobox_map"/>
72
- <a-descriptions
73
- bordered
74
- class="asc_descriptions"
75
- :column="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 1, xs: 1 }"
76
- >
77
- <a-descriptions-item label="坐标" span="2"><span>{{ addressObj.lng_lat }}</span></a-descriptions-item>
78
- <a-descriptions-item label="地址" span="2" v-if="attr.type != 'coordinateSearch'"><span>{{ addressObj.address }}</span></a-descriptions-item>
79
- </a-descriptions>
80
- </a-modal>
81
- </div>
82
- </template>
83
- <script>
84
-
85
- import { GetGDMap } from '@vue2-client/utils/map-utils'
86
- import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
87
- import { mapState } from 'vuex'
88
- import { runLogic } from '@vue2-client/services/api/common'
89
- import IcMapIcon from '@vue2-client/base-client/components/common/AddressSearchCombobox/IcMapIcon.vue'
90
-
91
- export default {
92
- name: 'AddressSearchCombobox',
93
- components: { IcMapIcon },
94
- data () {
95
- // 检索去抖
96
- this.fetchFunction = debounce(this.fetchFunction, 300)
97
- return {
98
- // 地址搜索联想
99
- mapAutocomplete: undefined,
100
- // 检索结果
101
- option: [],
102
- // 最后检索版本
103
- lastFetchId: 0,
104
- // 检索中
105
- searching: false,
106
- addressObj: {
107
- lng_lat: '',
108
- address: '',
109
- },
110
- visible: false,
111
- map: null,
112
- m_index: 1002,
113
- positionPicker: null,
114
- addressInput: this.searchResult,
115
- // 选择地址返回的行政区域
116
- divisions: {},
117
- // 生成地址串中省市区街道信息禁止修改
118
- readOnlyDivisions: false,
119
- // cur 位置
120
- curPosition: [108.878703, 34.223701],
121
- searchFlag: false,
122
- }
123
- },
124
- computed: {
125
- ...mapState('setting', ['isMobile', 'gaode_key', 'gaode_secret_key'])
126
- },
127
- props: {
128
- attr: {
129
- type: Object,
130
- default: () => {
131
- }
132
- },
133
- emitFunc: {
134
- type: Function,
135
- default: () => {
136
- }
137
- },
138
- searchResult: {
139
- type: String,
140
- default: undefined
141
- },
142
- // 返回数据格式
143
- searchResultType: {
144
- type: String,
145
- default: 'Default'
146
- // default: 'Array'
147
- // default: 'Object'
148
- },
149
- // Object 返回格式时 可以自定义key
150
- resultKeys: {
151
- type: Object,
152
- default: () => {
153
- return { address: 'address', coords: 'coords' }
154
- }
155
- },
156
- readOnly: {
157
- type: Boolean,
158
- default: false
159
- },
160
- // 省市区是否可以修改
161
- divisionsChange: {
162
- type: Boolean,
163
- default: false
164
- },
165
- },
166
- created () {
167
- },
168
- mounted () {
169
- },
170
- methods: {
171
- change (value) {
172
- if (this.readOnlyDivisions && !this.divisionsChange) {
173
- // 如果省市区街道信息禁止修改
174
- if (this.addressInput.includes('省') && this.addressInput.includes('市') && this.divisions.str && !this.addressInput.startsWith(this.divisions.str)) {
175
- this.addressInput = this.addressObj.address
176
- this.$message.info('省市区街道信息请从选择新地址以变更')
177
- return
178
- }
179
- }
180
- debounce(() => {
181
- this.selected(null, this.addressInput)
182
- }, 200)()
183
- },
184
- initMap (aMap) {
185
- this.map = new (aMap).Map('addressSearchCombobox_map', { // 设置地图容器id
186
- resizeEnable: true, // 是否监控地图容器尺寸变化
187
- zoom: 10, // 初始化地图层级
188
- })
189
- this.geocoder = new (aMap).Geocoder({
190
- radius: 500 // 范围,默认:500
191
- })
192
- this.map.addControl(new (aMap).ToolBar()) // 初始化工具插件
193
-
194
- // 等待地图加载完成
195
- this.map.on('complete', () => {
196
- // 获取地图中心点
197
- const center = this.map.getCenter()
198
-
199
- // 创建标记对象 - 使用默认样式
200
- this.marker = new (aMap).Marker({
201
- position: [center.lng, center.lat], // 使用地图中心点作为初始位置
202
- map: this.map // 直接在地图创建时添加标记
203
- })
204
-
205
- // 获取中心点地址信息
206
- this.geocoder.getAddress(center, (status, result) => {
207
- if (status === 'complete' && result.info === 'OK') {
208
- const addressComponent = result.regeocode.addressComponent
209
- this.divisions.province = addressComponent.province
210
- this.divisions.city = addressComponent.city
211
- this.divisions.district = addressComponent.district
212
- this.divisions.township = addressComponent.township
213
- this.divisions.towncode = addressComponent.towncode
214
- this.divisions.street = addressComponent.street
215
-
216
- // 获取小区信息
217
- if (result.regeocode.aois && result.regeocode.aois.length) {
218
- this.divisions.area = result.regeocode.aois[0].name
219
- } else if (result.regeocode.pois && result.regeocode.pois.length) {
220
- this.divisions.area = result.regeocode.pois[0].name
221
- }
222
-
223
- this.divisions.str = `${addressComponent.province}${addressComponent.city}${addressComponent.district}${addressComponent.township}`
224
-
225
- if (this.divisions.str && result.regeocode.formattedAddress.startsWith(this.divisions.str)) {
226
- this.readOnlyDivisions = true
227
- }
228
-
229
- this.addressObj.address = result.regeocode.formattedAddress
230
- this.addressObj.lng_lat = `${center.lng},${center.lat}`
231
- }
232
- })
233
- })
234
-
235
- // 添加地图点击事件
236
- this.map.on('click', (e) => {
237
- const lnglat = e.lnglat
238
- this.curPosition = lnglat
239
-
240
- // 更新标记位置
241
- this.marker.setPosition([lnglat.lng, lnglat.lat])
242
-
243
- // 将地图中心移动到点击位置
244
- this.map.setCenter([lnglat.lng, lnglat.lat])
245
-
246
- // 获取点击位置的地址信息
247
- this.geocoder.getAddress(lnglat, (status, result) => {
248
- if (status === 'complete' && result.info === 'OK') {
249
- const addressComponent = result.regeocode.addressComponent
250
- this.divisions.province = addressComponent.province
251
- this.divisions.city = addressComponent.city
252
- this.divisions.district = addressComponent.district
253
- this.divisions.township = addressComponent.township
254
- this.divisions.towncode = addressComponent.towncode
255
- this.divisions.street = addressComponent.street
256
-
257
- // 获取小区信息
258
- if (result.regeocode.aois && result.regeocode.aois.length) {
259
- this.divisions.area = result.regeocode.aois[0].name
260
- } else if (result.regeocode.pois && result.regeocode.pois.length) {
261
- this.divisions.area = result.regeocode.pois[0].name
262
- }
263
-
264
- this.divisions.str = `${addressComponent.province}${addressComponent.city}${addressComponent.district}${addressComponent.township}`
265
-
266
- if (this.divisions.str && result.regeocode.formattedAddress.startsWith(this.divisions.str)) {
267
- this.readOnlyDivisions = true
268
- }
269
-
270
- if (!this.searchFlag) {
271
- this.addressObj.address = result.regeocode.formattedAddress
272
- this.addressObj.lng_lat = `${lnglat.lng},${lnglat.lat}`
273
- } else {
274
- this.searchFlag = false
275
- }
276
- }
277
- })
278
- })
279
- },
280
- onSelect (value) {
281
- // 选中地址后不触发更新坐标
282
- this.searchFlag = true
283
- const addressRegex = /^(.+?)\[/ // 匹配地址部分
284
- const labelRegex = /\[(.+?)\]/ // 匹配标签部分
285
- const coordinatesRegex = /<(.+?)>/ // 匹配坐标部分
286
-
287
- const addressMatch = value.match(addressRegex)
288
- const labelMatch = value.match(labelRegex)
289
- const coordinatesMatch = value.match(coordinatesRegex)
290
-
291
- this.addressObj.address = addressMatch ? addressMatch[1].trim() : null
292
- const label = labelMatch ? labelMatch[1].trim() : null
293
- this.addressObj.address = this.addressObj.address != null ? this.mergeAddressAndLabel(this.addressObj.address, label) : labelMatch[1].trim()
294
- this.addressObj.lng_lat = coordinatesMatch ? coordinatesMatch[1] : ''
295
-
296
- // 更新地图中心和标记位置
297
- const [lng, lat] = this.addressObj.lng_lat.split(',')
298
- this.map.setCenter([lng, lat])
299
- this.marker.setPosition([lng, lat])
300
- },
301
- mergeAddressAndLabel (address, label = '') {
302
- // 从地址的末尾开始匹配标签的开头部分
303
- for (let i = 0; i < label.length; i++) {
304
- const substring = label.substring(0, i + 1)
305
- if (address.endsWith(substring)) {
306
- // 找到最大匹配部分,拼接不重复的部分
307
- return address + label.substring(i + 1)
308
- }
309
- }
310
- // 如果没有重复部分,直接拼接
311
- return address + label
312
- },
313
- selected (_value, _addstr) {
314
- let result
315
- if (this.searchResultType !== 'Default') {
316
- if (this.searchResultType === 'Array') {
317
- result = [_addstr || this.addressObj.address, this.addressObj.lng_lat]
318
- } else {
319
- result = {}
320
- // 如果是坐标搜索,只返回坐标
321
- // 不知道为什么这么加 命名之前的组件已经返回了 lng_lat ,算了 还是相信后人的智慧吧
322
- if (this.attr.type === 'coordinateSearch') {
323
- result[this.resultKeys.address] = this.addressObj.lng_lat
324
- } else {
325
- result[this.resultKeys.address] = _addstr || this.addressObj.address
326
- result[this.resultKeys.coords] = this.addressObj.lng_lat
327
- }
328
- }
329
- }
330
- this.visible = false
331
- this.$emit('onSelect', JSON.stringify(result))
332
- // 如果传递了地址 是为了更新上级 不做省市区检验处理
333
- if (!_addstr) {
334
- // 如果是坐标搜索,输入框显示坐标
335
- if (this.attr.type === 'coordinateSearch') {
336
- this.addressInput = this.addressObj.lng_lat
337
- } else {
338
- this.addressInput = this.addressObj.address
339
- }
340
- this.$emit('onDivisionsChange', Object.assign({}, result, { divisions: this.divisions, vm: this }))
341
- }
342
- },
343
- // 懒加载检索方法
344
- fetchFunction (value) {
345
- if (value && this.mapAutocomplete) {
346
- this.searching = true
347
- this.lastFetchId += 1
348
- const fetchId = this.lastFetchId
349
- this.mapAutocomplete.search(value, (status, result) => {
350
- if (fetchId !== this.lastFetchId) {
351
- return
352
- }
353
- if (status === 'complete') {
354
- this.option = []
355
- const addressMap = {}
356
- const addressDisMap = {}
357
- result.tips.forEach((res) => {
358
- if (res.location) {
359
- if (!Object.prototype.hasOwnProperty.call(addressMap, res.district)) {
360
- addressMap[res.district] = []
361
- }
362
- const msgData = {
363
- label: res.name,
364
- value: res.location.lng + ',' + res.location.lat,
365
- address: res.address + '',
366
- word: value
367
- }
368
- const p1 = [this.curPosition.lng, this.curPosition.lat]
369
- const p2 = [res.location.lng, res.location.lat]
370
- // 判断与当前位置的距离
371
- let dis = 0
372
- try {
373
- // eslint-disable-next-line
374
- dis = AMap.GeometryUtil.distance(p1, p2)
375
- } catch (e) {
376
- console.log(e)
377
- }
378
- addressDisMap[res.district] = {}
379
- addressDisMap[res.district].dis = dis
380
- addressMap[res.district].push(msgData)
381
- }
382
- })
383
- for (const key of Object.keys(addressMap)) {
384
- this.option.push({
385
- title: key,
386
- dis: addressDisMap[key].dis,
387
- children: addressMap[key]
388
- })
389
- }
390
- // 根据 dis 排序
391
- this.option.sort((a, b) => {
392
- return a.dis - b.dis
393
- })
394
- }
395
- this.searching = false
396
- })
397
- }
398
- },
399
- // 获取数据
400
- getData (value, callback) {
401
- if (value !== '') {
402
- const logicName = this.attr.keyName
403
- const logic = logicName.substring(6)
404
- runLogic(logic, value, 'af-system').then(res => {
405
- callback(res)
406
- })
407
- }
408
- },
409
- // 关键字高亮
410
- highLight (value, word) {
411
- // 如果标题中包含,关键字就替换一下
412
- if (value.includes(word)) {
413
- value = value.replace(word,
414
- // 这里是替换成html格式的数据,最好再加一个样式权重,保险一点
415
- '<span style="color:red!important;">' + word + '</span>'
416
- )
417
- return value
418
- // eslint-disable-next-line brace-style
419
- }
420
- // 不包含的话还用这个
421
- else {
422
- return value
423
- }
424
- }
425
- },
426
- watch: {
427
- 'visible' (val) {
428
- if (val) {
429
- this.$nextTick(() => {
430
- GetGDMap(this.gaode_secret_key, this.gaode_key).then(aMap => {
431
- this.initMap(aMap)
432
- this.mapAutocomplete = new (aMap).AutoComplete({
433
- city: '全国',
434
- dragEnable: true,
435
- animateEnable: false
436
- })
437
- })
438
- })
439
- }
440
- },
441
- attr: {
442
- handler (newValue) {
443
- console.log('监听事件触发:', { new: newValue })
444
- if (newValue.type === 'coordinateSearch') {
445
- this.addressInput = newValue.formDefault_lng_lat
446
- } else if (newValue.type === 'addressSearch') {
447
- this.addressInput = newValue.formDefault
448
- }
449
- },
450
- deep: true, // 深度监听对象内部变化
451
- immediate: true
452
- }
453
- }
454
- }
455
- </script>
456
-
457
- <style lang="less" scoped>
458
- #addressSearchCombobox_map {
459
- margin: 1% 0;
460
- width: 100%;
461
- height: 50vh;
462
- text-align: center
463
- }
464
-
465
- .address_btn_logo {
466
- width: 1rem;
467
- margin-right: 0.5rem
468
- }
469
-
470
- .asc_descriptions .ant-descriptions-item-content {
471
- width: 80%;
472
- }
473
-
474
- .certain-category-search-wrapper {
475
- margin-bottom: -4rem;
476
- text-align: center;
477
- }
478
-
479
- #addressSearchCombobox {
480
-
481
- .certain-category-search-dropdown .ant-select-dropdown-menu-item-group-title {
482
- color: #666;
483
- font-weight: bold;
484
- font-size: 14px;
485
- }
486
-
487
- .certain-category-search-dropdown .ant-select-dropdown-menu-item-group {
488
- border-bottom: 1px solid #f6f6f6;
489
- }
490
-
491
- .certain-category-search-dropdown .ant-select-dropdown-menu-item {
492
- padding-left: 16px;
493
- }
494
-
495
- .certain-category-search-dropdown .ant-select-dropdown-menu-item.show-all {
496
- text-align: center;
497
- cursor: default;
498
- }
499
-
500
- .certain-category-search-dropdown .ant-select-dropdown-menu {
501
- max-height: 300px;
502
- }
503
-
504
- .certain-category-search-wrapper .certain-search-item-count {
505
- position: absolute;
506
- color: #999;
507
- right: 16px;
508
- }
509
-
510
- .certain-category-search-wrapper .certain-category-search.ant-select-focused,
511
- .certain-category-icon {
512
- color: #108ee9;
513
- }
514
-
515
- .certain-category-search-wrapper .certain-category-icon {
516
- color: #6e6e6e;
517
- transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
518
- font-size: 16px;
519
- }
520
-
521
- .addressName {
522
- margin-bottom: 0;
523
- font-size: 14px;
524
- font-weight: bold;
525
- }
526
-
527
- .addressRemark {
528
- margin-bottom: 0;
529
- font-size: 12px;
530
- }
531
- }
532
- </style>
1
+ <template>
2
+ <div id="addressSearchCombobox" style="padding: 4px 0;">
3
+ <div style="display: flex; width: 100%;">
4
+ <a-input-group style="flex: 1; display: flex;padding-top: 1px;" compact>
5
+ <a-input
6
+ v-model="addressInput"
7
+ :read-only="readOnly || !this.addressObj.address"
8
+ @change="change"
9
+ style="flex: 1; min-width: 0;"
10
+ placeholder="请选择地址信息"/>
11
+ <a-button
12
+ v-if="attr?.inputOnAfterName && attr?.inputOnAfterFunc"
13
+ style="min-width: 4rem; max-width: 6rem;"
14
+ type="primary"
15
+ @click="emitFunc(attr?.inputOnAfterFunc, addressInput)">
16
+ {{ attr?.inputOnAfterName }}
17
+ </a-button>
18
+ </a-input-group>
19
+ <a-button
20
+ style="flex-shrink: 0; margin-left: 0.2rem;"
21
+ :type="attr?.inputOnAfterName ? 'primary' : ''"
22
+ @click="visible = true">
23
+ <IcMapIcon/>
24
+ 定位
25
+ </a-button>
26
+ </div>
27
+ <a-modal
28
+ v-model="visible"
29
+ title="地址选择"
30
+ @ok="selected"
31
+ :zIndex="m_index"
32
+ :destroyOnClose="true"
33
+ width="70%"
34
+ >
35
+ <div class="certain-category-search-wrapper">
36
+ <a-auto-complete
37
+ style="right: 0px;width: 90%;z-index:2;margin-top:2%;"
38
+ :disabled="!mapAutocomplete"
39
+ class="certain-category-search"
40
+ dropdown-class-name="certain-category-search-dropdown"
41
+ option-label-prop="value"
42
+ placeholder="输入地址关键字搜索"
43
+ @search="fetchFunction"
44
+ @select="onSelect"
45
+ >
46
+ <a-spin v-if="searching" slot="notFoundContent" size="small"/>
47
+ <template slot="dataSource">
48
+ <a-select-opt-group v-for="group in option" :key="group.title">
49
+ <span
50
+ slot="label">
51
+ <a-icon type="bank"/> {{ group.title }}
52
+ </span>
53
+ <a-select-option
54
+ v-for="address in group.children"
55
+ :key="address.address+'['+address.label+']'+' <' + address.value + '>'"
56
+ >
57
+ <p class="addressName">
58
+ <a-icon type="environment"/>
59
+ <span v-html="highLight(address.label, address.word)"></span></p>
60
+ <p v-if="address.address !== '[]'" class="addressRemark">
61
+ {{ address.address }}
62
+ </p>
63
+ </a-select-option>
64
+ </a-select-opt-group>
65
+ </template>
66
+ <a-input>
67
+ <a-icon slot="suffix" class="certain-category-icon" type="search"/>
68
+ </a-input>
69
+ </a-auto-complete>
70
+ </div>
71
+ <div id="addressSearchCombobox_map"/>
72
+ <a-descriptions
73
+ bordered
74
+ class="asc_descriptions"
75
+ :column="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 1, xs: 1 }"
76
+ >
77
+ <a-descriptions-item label="坐标" span="2"><span>{{ addressObj.lng_lat }}</span></a-descriptions-item>
78
+ <a-descriptions-item label="地址" span="2" v-if="attr.type != 'coordinateSearch'"><span>{{ addressObj.address }}</span></a-descriptions-item>
79
+ </a-descriptions>
80
+ </a-modal>
81
+ </div>
82
+ </template>
83
+ <script>
84
+
85
+ import { GetGDMap } from '@vue2-client/utils/map-utils'
86
+ import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
87
+ import { mapState } from 'vuex'
88
+ import { runLogic } from '@vue2-client/services/api/common'
89
+ import IcMapIcon from '@vue2-client/base-client/components/common/AddressSearchCombobox/IcMapIcon.vue'
90
+
91
+ export default {
92
+ name: 'AddressSearchCombobox',
93
+ components: { IcMapIcon },
94
+ data () {
95
+ // 检索去抖
96
+ this.fetchFunction = debounce(this.fetchFunction, 300)
97
+ return {
98
+ // 地址搜索联想
99
+ mapAutocomplete: undefined,
100
+ // 检索结果
101
+ option: [],
102
+ // 最后检索版本
103
+ lastFetchId: 0,
104
+ // 检索中
105
+ searching: false,
106
+ addressObj: {
107
+ lng_lat: '',
108
+ address: '',
109
+ },
110
+ visible: false,
111
+ map: null,
112
+ m_index: 1002,
113
+ positionPicker: null,
114
+ addressInput: this.searchResult,
115
+ // 选择地址返回的行政区域
116
+ divisions: {},
117
+ // 生成地址串中省市区街道信息禁止修改
118
+ readOnlyDivisions: false,
119
+ // cur 位置
120
+ curPosition: [108.878703, 34.223701],
121
+ searchFlag: false,
122
+ }
123
+ },
124
+ computed: {
125
+ ...mapState('setting', ['isMobile', 'gaode_key', 'gaode_secret_key'])
126
+ },
127
+ props: {
128
+ attr: {
129
+ type: Object,
130
+ default: () => {
131
+ }
132
+ },
133
+ emitFunc: {
134
+ type: Function,
135
+ default: () => {
136
+ }
137
+ },
138
+ searchResult: {
139
+ type: String,
140
+ default: undefined
141
+ },
142
+ // 返回数据格式
143
+ searchResultType: {
144
+ type: String,
145
+ default: 'Default'
146
+ // default: 'Array'
147
+ // default: 'Object'
148
+ },
149
+ // Object 返回格式时 可以自定义key
150
+ resultKeys: {
151
+ type: Object,
152
+ default: () => {
153
+ return { address: 'address', coords: 'coords' }
154
+ }
155
+ },
156
+ readOnly: {
157
+ type: Boolean,
158
+ default: false
159
+ },
160
+ // 省市区是否可以修改
161
+ divisionsChange: {
162
+ type: Boolean,
163
+ default: false
164
+ },
165
+ },
166
+ created () {
167
+ },
168
+ mounted () {
169
+ },
170
+ methods: {
171
+ change (value) {
172
+ if (this.readOnlyDivisions && !this.divisionsChange) {
173
+ // 如果省市区街道信息禁止修改
174
+ if (this.addressInput.includes('省') && this.addressInput.includes('市') && this.divisions.str && !this.addressInput.startsWith(this.divisions.str)) {
175
+ this.addressInput = this.addressObj.address
176
+ this.$message.info('省市区街道信息请从选择新地址以变更')
177
+ return
178
+ }
179
+ }
180
+ debounce(() => {
181
+ this.selected(null, this.addressInput)
182
+ }, 200)()
183
+ },
184
+ initMap (aMap) {
185
+ this.map = new (aMap).Map('addressSearchCombobox_map', { // 设置地图容器id
186
+ resizeEnable: true, // 是否监控地图容器尺寸变化
187
+ zoom: 10, // 初始化地图层级
188
+ })
189
+ this.geocoder = new (aMap).Geocoder({
190
+ radius: 500 // 范围,默认:500
191
+ })
192
+ this.map.addControl(new (aMap).ToolBar()) // 初始化工具插件
193
+
194
+ // 等待地图加载完成
195
+ this.map.on('complete', () => {
196
+ // 获取地图中心点
197
+ const center = this.map.getCenter()
198
+
199
+ // 创建标记对象 - 使用默认样式
200
+ this.marker = new (aMap).Marker({
201
+ position: [center.lng, center.lat], // 使用地图中心点作为初始位置
202
+ map: this.map // 直接在地图创建时添加标记
203
+ })
204
+
205
+ // 获取中心点地址信息
206
+ this.geocoder.getAddress(center, (status, result) => {
207
+ if (status === 'complete' && result.info === 'OK') {
208
+ const addressComponent = result.regeocode.addressComponent
209
+ this.divisions.province = addressComponent.province
210
+ this.divisions.city = addressComponent.city
211
+ this.divisions.district = addressComponent.district
212
+ this.divisions.township = addressComponent.township
213
+ this.divisions.towncode = addressComponent.towncode
214
+ this.divisions.street = addressComponent.street
215
+
216
+ // 获取小区信息
217
+ if (result.regeocode.aois && result.regeocode.aois.length) {
218
+ this.divisions.area = result.regeocode.aois[0].name
219
+ } else if (result.regeocode.pois && result.regeocode.pois.length) {
220
+ this.divisions.area = result.regeocode.pois[0].name
221
+ }
222
+
223
+ this.divisions.str = `${addressComponent.province}${addressComponent.city}${addressComponent.district}${addressComponent.township}`
224
+
225
+ if (this.divisions.str && result.regeocode.formattedAddress.startsWith(this.divisions.str)) {
226
+ this.readOnlyDivisions = true
227
+ }
228
+
229
+ this.addressObj.address = result.regeocode.formattedAddress
230
+ this.addressObj.lng_lat = `${center.lng},${center.lat}`
231
+ }
232
+ })
233
+ })
234
+
235
+ // 添加地图点击事件
236
+ this.map.on('click', (e) => {
237
+ const lnglat = e.lnglat
238
+ this.curPosition = lnglat
239
+
240
+ // 更新标记位置
241
+ this.marker.setPosition([lnglat.lng, lnglat.lat])
242
+
243
+ // 将地图中心移动到点击位置
244
+ this.map.setCenter([lnglat.lng, lnglat.lat])
245
+
246
+ // 获取点击位置的地址信息
247
+ this.geocoder.getAddress(lnglat, (status, result) => {
248
+ if (status === 'complete' && result.info === 'OK') {
249
+ const addressComponent = result.regeocode.addressComponent
250
+ this.divisions.province = addressComponent.province
251
+ this.divisions.city = addressComponent.city
252
+ this.divisions.district = addressComponent.district
253
+ this.divisions.township = addressComponent.township
254
+ this.divisions.towncode = addressComponent.towncode
255
+ this.divisions.street = addressComponent.street
256
+
257
+ // 获取小区信息
258
+ if (result.regeocode.aois && result.regeocode.aois.length) {
259
+ this.divisions.area = result.regeocode.aois[0].name
260
+ } else if (result.regeocode.pois && result.regeocode.pois.length) {
261
+ this.divisions.area = result.regeocode.pois[0].name
262
+ }
263
+
264
+ this.divisions.str = `${addressComponent.province}${addressComponent.city}${addressComponent.district}${addressComponent.township}`
265
+
266
+ if (this.divisions.str && result.regeocode.formattedAddress.startsWith(this.divisions.str)) {
267
+ this.readOnlyDivisions = true
268
+ }
269
+
270
+ if (!this.searchFlag) {
271
+ this.addressObj.address = result.regeocode.formattedAddress
272
+ this.addressObj.lng_lat = `${lnglat.lng},${lnglat.lat}`
273
+ } else {
274
+ this.searchFlag = false
275
+ }
276
+ }
277
+ })
278
+ })
279
+ },
280
+ onSelect (value) {
281
+ // 选中地址后不触发更新坐标
282
+ this.searchFlag = true
283
+ const addressRegex = /^(.+?)\[/ // 匹配地址部分
284
+ const labelRegex = /\[(.+?)\]/ // 匹配标签部分
285
+ const coordinatesRegex = /<(.+?)>/ // 匹配坐标部分
286
+
287
+ const addressMatch = value.match(addressRegex)
288
+ const labelMatch = value.match(labelRegex)
289
+ const coordinatesMatch = value.match(coordinatesRegex)
290
+
291
+ this.addressObj.address = addressMatch ? addressMatch[1].trim() : null
292
+ const label = labelMatch ? labelMatch[1].trim() : null
293
+ this.addressObj.address = this.addressObj.address != null ? this.mergeAddressAndLabel(this.addressObj.address, label) : labelMatch[1].trim()
294
+ this.addressObj.lng_lat = coordinatesMatch ? coordinatesMatch[1] : ''
295
+
296
+ // 更新地图中心和标记位置
297
+ const [lng, lat] = this.addressObj.lng_lat.split(',')
298
+ this.map.setCenter([lng, lat])
299
+ this.marker.setPosition([lng, lat])
300
+ },
301
+ mergeAddressAndLabel (address, label = '') {
302
+ // 从地址的末尾开始匹配标签的开头部分
303
+ for (let i = 0; i < label.length; i++) {
304
+ const substring = label.substring(0, i + 1)
305
+ if (address.endsWith(substring)) {
306
+ // 找到最大匹配部分,拼接不重复的部分
307
+ return address + label.substring(i + 1)
308
+ }
309
+ }
310
+ // 如果没有重复部分,直接拼接
311
+ return address + label
312
+ },
313
+ selected (_value, _addstr) {
314
+ let result
315
+ if (this.searchResultType !== 'Default') {
316
+ if (this.searchResultType === 'Array') {
317
+ result = [_addstr || this.addressObj.address, this.addressObj.lng_lat]
318
+ } else {
319
+ result = {}
320
+ // 如果是坐标搜索,只返回坐标
321
+ // 不知道为什么这么加 命名之前的组件已经返回了 lng_lat ,算了 还是相信后人的智慧吧
322
+ if (this.attr.type === 'coordinateSearch') {
323
+ result[this.resultKeys.address] = this.addressObj.lng_lat
324
+ } else {
325
+ result[this.resultKeys.address] = _addstr || this.addressObj.address
326
+ result[this.resultKeys.coords] = this.addressObj.lng_lat
327
+ }
328
+ }
329
+ }
330
+ this.visible = false
331
+ this.$emit('onSelect', JSON.stringify(result))
332
+ // 如果传递了地址 是为了更新上级 不做省市区检验处理
333
+ if (!_addstr) {
334
+ // 如果是坐标搜索,输入框显示坐标
335
+ if (this.attr.type === 'coordinateSearch') {
336
+ this.addressInput = this.addressObj.lng_lat
337
+ } else {
338
+ this.addressInput = this.addressObj.address
339
+ }
340
+ this.$emit('onDivisionsChange', Object.assign({}, result, { divisions: this.divisions, vm: this }))
341
+ }
342
+ },
343
+ // 懒加载检索方法
344
+ fetchFunction (value) {
345
+ if (value && this.mapAutocomplete) {
346
+ this.searching = true
347
+ this.lastFetchId += 1
348
+ const fetchId = this.lastFetchId
349
+ this.mapAutocomplete.search(value, (status, result) => {
350
+ if (fetchId !== this.lastFetchId) {
351
+ return
352
+ }
353
+ if (status === 'complete') {
354
+ this.option = []
355
+ const addressMap = {}
356
+ const addressDisMap = {}
357
+ result.tips.forEach((res) => {
358
+ if (res.location) {
359
+ if (!Object.prototype.hasOwnProperty.call(addressMap, res.district)) {
360
+ addressMap[res.district] = []
361
+ }
362
+ const msgData = {
363
+ label: res.name,
364
+ value: res.location.lng + ',' + res.location.lat,
365
+ address: res.address + '',
366
+ word: value
367
+ }
368
+ const p1 = [this.curPosition.lng, this.curPosition.lat]
369
+ const p2 = [res.location.lng, res.location.lat]
370
+ // 判断与当前位置的距离
371
+ let dis = 0
372
+ try {
373
+ // eslint-disable-next-line
374
+ dis = AMap.GeometryUtil.distance(p1, p2)
375
+ } catch (e) {
376
+ console.log(e)
377
+ }
378
+ addressDisMap[res.district] = {}
379
+ addressDisMap[res.district].dis = dis
380
+ addressMap[res.district].push(msgData)
381
+ }
382
+ })
383
+ for (const key of Object.keys(addressMap)) {
384
+ this.option.push({
385
+ title: key,
386
+ dis: addressDisMap[key].dis,
387
+ children: addressMap[key]
388
+ })
389
+ }
390
+ // 根据 dis 排序
391
+ this.option.sort((a, b) => {
392
+ return a.dis - b.dis
393
+ })
394
+ }
395
+ this.searching = false
396
+ })
397
+ }
398
+ },
399
+ // 获取数据
400
+ getData (value, callback) {
401
+ if (value !== '') {
402
+ const logicName = this.attr.keyName
403
+ const logic = logicName.substring(6)
404
+ runLogic(logic, value, 'af-system').then(res => {
405
+ callback(res)
406
+ })
407
+ }
408
+ },
409
+ // 关键字高亮
410
+ highLight (value, word) {
411
+ // 如果标题中包含,关键字就替换一下
412
+ if (value.includes(word)) {
413
+ value = value.replace(word,
414
+ // 这里是替换成html格式的数据,最好再加一个样式权重,保险一点
415
+ '<span style="color:red!important;">' + word + '</span>'
416
+ )
417
+ return value
418
+ // eslint-disable-next-line brace-style
419
+ }
420
+ // 不包含的话还用这个
421
+ else {
422
+ return value
423
+ }
424
+ }
425
+ },
426
+ watch: {
427
+ 'visible' (val) {
428
+ if (val) {
429
+ this.$nextTick(() => {
430
+ GetGDMap(this.gaode_secret_key, this.gaode_key).then(aMap => {
431
+ this.initMap(aMap)
432
+ this.mapAutocomplete = new (aMap).AutoComplete({
433
+ city: '全国',
434
+ dragEnable: true,
435
+ animateEnable: false
436
+ })
437
+ })
438
+ })
439
+ }
440
+ },
441
+ attr: {
442
+ handler (newValue) {
443
+ console.log('监听事件触发:', { new: newValue })
444
+ if (newValue.type === 'coordinateSearch') {
445
+ this.addressInput = newValue.formDefault_lng_lat
446
+ } else if (newValue.type === 'addressSearch') {
447
+ this.addressInput = newValue.formDefault
448
+ }
449
+ },
450
+ deep: true, // 深度监听对象内部变化
451
+ immediate: true
452
+ }
453
+ }
454
+ }
455
+ </script>
456
+
457
+ <style lang="less" scoped>
458
+ #addressSearchCombobox_map {
459
+ margin: 1% 0;
460
+ width: 100%;
461
+ height: 50vh;
462
+ text-align: center
463
+ }
464
+
465
+ .address_btn_logo {
466
+ width: 1rem;
467
+ margin-right: 0.5rem
468
+ }
469
+
470
+ .asc_descriptions .ant-descriptions-item-content {
471
+ width: 80%;
472
+ }
473
+
474
+ .certain-category-search-wrapper {
475
+ margin-bottom: -4rem;
476
+ text-align: center;
477
+ }
478
+
479
+ #addressSearchCombobox {
480
+
481
+ .certain-category-search-dropdown .ant-select-dropdown-menu-item-group-title {
482
+ color: #666;
483
+ font-weight: bold;
484
+ font-size: 14px;
485
+ }
486
+
487
+ .certain-category-search-dropdown .ant-select-dropdown-menu-item-group {
488
+ border-bottom: 1px solid #f6f6f6;
489
+ }
490
+
491
+ .certain-category-search-dropdown .ant-select-dropdown-menu-item {
492
+ padding-left: 16px;
493
+ }
494
+
495
+ .certain-category-search-dropdown .ant-select-dropdown-menu-item.show-all {
496
+ text-align: center;
497
+ cursor: default;
498
+ }
499
+
500
+ .certain-category-search-dropdown .ant-select-dropdown-menu {
501
+ max-height: 300px;
502
+ }
503
+
504
+ .certain-category-search-wrapper .certain-search-item-count {
505
+ position: absolute;
506
+ color: #999;
507
+ right: 16px;
508
+ }
509
+
510
+ .certain-category-search-wrapper .certain-category-search.ant-select-focused,
511
+ .certain-category-icon {
512
+ color: #108ee9;
513
+ }
514
+
515
+ .certain-category-search-wrapper .certain-category-icon {
516
+ color: #6e6e6e;
517
+ transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
518
+ font-size: 16px;
519
+ }
520
+
521
+ .addressName {
522
+ margin-bottom: 0;
523
+ font-size: 14px;
524
+ font-weight: bold;
525
+ }
526
+
527
+ .addressRemark {
528
+ margin-bottom: 0;
529
+ font-size: 12px;
530
+ }
531
+ }
532
+ </style>