zhui-plus 1.0.0 → 1.0.10

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.

Potentially problematic release.


This version of zhui-plus might be problematic. Click here for more details.

Files changed (820) hide show
  1. package/dist/Heatmap.js +689 -0
  2. package/dist/WSPlayer/PlaySDKInterface.js +1 -0
  3. package/dist/WSPlayer/WSPlayer.js +1 -0
  4. package/dist/WSPlayer/audioTalkWorker.js +1 -0
  5. package/dist/WSPlayer/commonThread/libH264Enc.js +21 -0
  6. package/dist/WSPlayer/commonThread/libH264Enc.wasm +0 -0
  7. package/dist/WSPlayer/commonThread/libIVSDrawer.js +21 -0
  8. package/dist/WSPlayer/commonThread/libIVSDrawer.wasm +0 -0
  9. package/dist/WSPlayer/commonThread/libRenderEngine.js +21 -0
  10. package/dist/WSPlayer/commonThread/libRenderEngine.wasm +0 -0
  11. package/dist/WSPlayer/commonThread/libmavasp_litepacket.data +50 -0
  12. package/dist/WSPlayer/commonThread/libmavasp_litepacket.js +21 -0
  13. package/dist/WSPlayer/commonThread/libmavasp_litepacket.wasm +0 -0
  14. package/dist/WSPlayer/icon/IotComboBackGround-alarm.png +0 -0
  15. package/dist/WSPlayer/icon/IotComboBackGround.png +0 -0
  16. package/dist/WSPlayer/icon/RecordHover.svg +13 -0
  17. package/dist/WSPlayer/icon/RecordNormal.svg +13 -0
  18. package/dist/WSPlayer/icon/Recording.svg +15 -0
  19. package/dist/WSPlayer/icon/arrow-b.svg +9 -0
  20. package/dist/WSPlayer/icon/arrow-l.svg +9 -0
  21. package/dist/WSPlayer/icon/arrow-lb.svg +10 -0
  22. package/dist/WSPlayer/icon/arrow-lt.svg +10 -0
  23. package/dist/WSPlayer/icon/arrow-r.svg +9 -0
  24. package/dist/WSPlayer/icon/arrow-rb.svg +10 -0
  25. package/dist/WSPlayer/icon/arrow-rt.svg +10 -0
  26. package/dist/WSPlayer/icon/arrow-t.svg +9 -0
  27. package/dist/WSPlayer/icon/close-all-hover.svg +18 -0
  28. package/dist/WSPlayer/icon/close-all.svg +18 -0
  29. package/dist/WSPlayer/icon/close.svg +16 -0
  30. package/dist/WSPlayer/icon/close_hover.svg +16 -0
  31. package/dist/WSPlayer/icon/default.png +0 -0
  32. package/dist/WSPlayer/icon/draw-triangle_off.svg +14 -0
  33. package/dist/WSPlayer/icon/draw-triangle_off_hover.svg +14 -0
  34. package/dist/WSPlayer/icon/draw-triangle_on.svg +15 -0
  35. package/dist/WSPlayer/icon/draw-triangle_on_hover.svg +15 -0
  36. package/dist/WSPlayer/icon/drops.png +0 -0
  37. package/dist/WSPlayer/icon/fullscreen-hover.svg +13 -0
  38. package/dist/WSPlayer/icon/fullscreen.svg +13 -0
  39. package/dist/WSPlayer/icon/hide-pantilt-on.svg +13 -0
  40. package/dist/WSPlayer/icon/hide-pantilt.svg +13 -0
  41. package/dist/WSPlayer/icon/mobile-speed-control-icon.svg +13 -0
  42. package/dist/WSPlayer/icon/more.svg +13 -0
  43. package/dist/WSPlayer/icon/play-h.png +0 -0
  44. package/dist/WSPlayer/icon/play-n.png +0 -0
  45. package/dist/WSPlayer/icon/play-p.png +0 -0
  46. package/dist/WSPlayer/icon/ptz-icon1.svg +4 -0
  47. package/dist/WSPlayer/icon/ptz-icon2.svg +13 -0
  48. package/dist/WSPlayer/icon/ptz-icon3.svg +10 -0
  49. package/dist/WSPlayer/icon/ptz-icon4.svg +10 -0
  50. package/dist/WSPlayer/icon/ptz-icon5.svg +12 -0
  51. package/dist/WSPlayer/icon/ptz-icon6.svg +14 -0
  52. package/dist/WSPlayer/icon/ptz-select-hover.svg +3 -0
  53. package/dist/WSPlayer/icon/ptz-select.svg +3 -0
  54. package/dist/WSPlayer/icon/record_pause.svg +5 -0
  55. package/dist/WSPlayer/icon/record_play.svg +5 -0
  56. package/dist/WSPlayer/icon/refresh-replay.svg +11 -0
  57. package/dist/WSPlayer/icon/refresh-replay_hover.svg +11 -0
  58. package/dist/WSPlayer/icon/screen-more-icon.svg +15 -0
  59. package/dist/WSPlayer/icon/screen_1.svg +11 -0
  60. package/dist/WSPlayer/icon/screen_16.svg +18 -0
  61. package/dist/WSPlayer/icon/screen_16_hover.svg +18 -0
  62. package/dist/WSPlayer/icon/screen_1_hover.svg +11 -0
  63. package/dist/WSPlayer/icon/screen_2.svg +18 -0
  64. package/dist/WSPlayer/icon/screen_25.svg +19 -0
  65. package/dist/WSPlayer/icon/screen_25_hover.svg +19 -0
  66. package/dist/WSPlayer/icon/screen_2_hover.svg +18 -0
  67. package/dist/WSPlayer/icon/screen_3.svg +13 -0
  68. package/dist/WSPlayer/icon/screen_3_hover.svg +13 -0
  69. package/dist/WSPlayer/icon/screen_4.svg +12 -0
  70. package/dist/WSPlayer/icon/screen_4_hover.svg +12 -0
  71. package/dist/WSPlayer/icon/screen_6.svg +16 -0
  72. package/dist/WSPlayer/icon/screen_6_hover.svg +16 -0
  73. package/dist/WSPlayer/icon/screen_8.svg +18 -0
  74. package/dist/WSPlayer/icon/screen_8_hover.svg +18 -0
  75. package/dist/WSPlayer/icon/screen_9.svg +17 -0
  76. package/dist/WSPlayer/icon/screen_9_hover.svg +17 -0
  77. package/dist/WSPlayer/icon/screen_custom_division.svg +9 -0
  78. package/dist/WSPlayer/icon/screen_custom_division_hover.svg +9 -0
  79. package/dist/WSPlayer/icon/screen_custom_division_merge.svg +3 -0
  80. package/dist/WSPlayer/icon/screen_custom_division_split.svg +6 -0
  81. package/dist/WSPlayer/icon/snapshot.svg +38 -0
  82. package/dist/WSPlayer/icon/snapshot_hover.svg +38 -0
  83. package/dist/WSPlayer/icon/speed_left.svg +15 -0
  84. package/dist/WSPlayer/icon/speed_right.svg +15 -0
  85. package/dist/WSPlayer/icon/spread.png +0 -0
  86. package/dist/WSPlayer/icon/tag-left-alarm.png +0 -0
  87. package/dist/WSPlayer/icon/tag-left-normal.png +0 -0
  88. package/dist/WSPlayer/icon/tag-middle-alarm.png +0 -0
  89. package/dist/WSPlayer/icon/tag-middle-normal.png +0 -0
  90. package/dist/WSPlayer/icon/tag-right-alarm.png +0 -0
  91. package/dist/WSPlayer/icon/tag-right-normal.png +0 -0
  92. package/dist/WSPlayer/icon/talk-off-hover.svg +11 -0
  93. package/dist/WSPlayer/icon/talk-off.svg +11 -0
  94. package/dist/WSPlayer/icon/talk-on.svg +9 -0
  95. package/dist/WSPlayer/icon/voice-have.svg +43 -0
  96. package/dist/WSPlayer/icon/voice-have_hover.svg +43 -0
  97. package/dist/WSPlayer/icon/voice-null.svg +38 -0
  98. package/dist/WSPlayer/icon/voice-null_hover.svg +38 -0
  99. package/dist/WSPlayer/icon/ws-ctrl-ellipsis-hover.svg +14 -0
  100. package/dist/WSPlayer/icon/ws-ctrl-ellipsis.svg +14 -0
  101. package/dist/WSPlayer/icon/wsplayer-mobile-pantilt-b-bg.png +0 -0
  102. package/dist/WSPlayer/icon/wsplayer-mobile-pantilt-bg.png +0 -0
  103. package/dist/WSPlayer/icon/wsplayer-mobile-pantilt-l-bg.png +0 -0
  104. package/dist/WSPlayer/icon/wsplayer-mobile-pantilt-lb-bg.png +0 -0
  105. package/dist/WSPlayer/icon/wsplayer-mobile-pantilt-lt-bg.png +0 -0
  106. package/dist/WSPlayer/icon/wsplayer-mobile-pantilt-r-bg.png +0 -0
  107. package/dist/WSPlayer/icon/wsplayer-mobile-pantilt-rb-bg.png +0 -0
  108. package/dist/WSPlayer/icon/wsplayer-mobile-pantilt-rt-bg.png +0 -0
  109. package/dist/WSPlayer/icon/wsplayer-mobile-pantilt-t-bg.png +0 -0
  110. package/dist/WSPlayer/jquery-3.6.0.min.js +2 -0
  111. package/dist/WSPlayer/multiThread/libStreamClient.js +21 -0
  112. package/dist/WSPlayer/multiThread/libStreamClient.wasm +0 -0
  113. package/dist/WSPlayer/multiThread/libStreamClient.worker.js +1 -0
  114. package/dist/WSPlayer/multiThread/libplay.data +0 -0
  115. package/dist/WSPlayer/multiThread/libplay.js +1 -0
  116. package/dist/WSPlayer/multiThread/libplay.wasm +0 -0
  117. package/dist/WSPlayer/multiThread/libplay.worker.js +1 -0
  118. package/dist/WSPlayer/player.css +1490 -0
  119. package/dist/WSPlayer/singleThread/VideoDecodeWorker.js +1439 -0
  120. package/dist/WSPlayer/singleThread/libStreamClient.js +21 -0
  121. package/dist/WSPlayer/singleThread/libStreamClient.wasm +0 -0
  122. package/dist/WSPlayer/singleThread/libplay.data +0 -0
  123. package/dist/WSPlayer/singleThread/libplay.js +1 -0
  124. package/dist/WSPlayer/singleThread/libplay.wasm +0 -0
  125. package/dist/WSPlayer/window.division.css +80 -0
  126. package/dist/index.js +467 -0
  127. package/dist/locale/af.js +193 -0
  128. package/dist/locale/af.min.js +3 -0
  129. package/dist/locale/af.min.js.map +1 -0
  130. package/dist/locale/af.min.mjs +3 -0
  131. package/dist/locale/af.min.mjs.map +1 -0
  132. package/dist/locale/af.mjs +186 -0
  133. package/dist/locale/ar-eg.js +193 -0
  134. package/dist/locale/ar-eg.min.js +3 -0
  135. package/dist/locale/ar-eg.min.js.map +1 -0
  136. package/dist/locale/ar-eg.min.mjs +3 -0
  137. package/dist/locale/ar-eg.min.mjs.map +1 -0
  138. package/dist/locale/ar-eg.mjs +186 -0
  139. package/dist/locale/ar.js +193 -0
  140. package/dist/locale/ar.min.js +3 -0
  141. package/dist/locale/ar.min.js.map +1 -0
  142. package/dist/locale/ar.min.mjs +3 -0
  143. package/dist/locale/ar.min.mjs.map +1 -0
  144. package/dist/locale/ar.mjs +186 -0
  145. package/dist/locale/az.js +194 -0
  146. package/dist/locale/az.min.js +3 -0
  147. package/dist/locale/az.min.js.map +1 -0
  148. package/dist/locale/az.min.mjs +3 -0
  149. package/dist/locale/az.min.mjs.map +1 -0
  150. package/dist/locale/az.mjs +187 -0
  151. package/dist/locale/bg.js +193 -0
  152. package/dist/locale/bg.min.js +3 -0
  153. package/dist/locale/bg.min.js.map +1 -0
  154. package/dist/locale/bg.min.mjs +3 -0
  155. package/dist/locale/bg.min.mjs.map +1 -0
  156. package/dist/locale/bg.mjs +186 -0
  157. package/dist/locale/bn.js +193 -0
  158. package/dist/locale/bn.min.js +3 -0
  159. package/dist/locale/bn.min.js.map +1 -0
  160. package/dist/locale/bn.min.mjs +3 -0
  161. package/dist/locale/bn.min.mjs.map +1 -0
  162. package/dist/locale/bn.mjs +186 -0
  163. package/dist/locale/ca.js +193 -0
  164. package/dist/locale/ca.min.js +3 -0
  165. package/dist/locale/ca.min.js.map +1 -0
  166. package/dist/locale/ca.min.mjs +3 -0
  167. package/dist/locale/ca.min.mjs.map +1 -0
  168. package/dist/locale/ca.mjs +186 -0
  169. package/dist/locale/ckb.js +193 -0
  170. package/dist/locale/ckb.min.js +3 -0
  171. package/dist/locale/ckb.min.js.map +1 -0
  172. package/dist/locale/ckb.min.mjs +3 -0
  173. package/dist/locale/ckb.min.mjs.map +1 -0
  174. package/dist/locale/ckb.mjs +186 -0
  175. package/dist/locale/cs.js +195 -0
  176. package/dist/locale/cs.min.js +3 -0
  177. package/dist/locale/cs.min.js.map +1 -0
  178. package/dist/locale/cs.min.mjs +3 -0
  179. package/dist/locale/cs.min.mjs.map +1 -0
  180. package/dist/locale/cs.mjs +188 -0
  181. package/dist/locale/da.js +193 -0
  182. package/dist/locale/da.min.js +3 -0
  183. package/dist/locale/da.min.js.map +1 -0
  184. package/dist/locale/da.min.mjs +3 -0
  185. package/dist/locale/da.min.mjs.map +1 -0
  186. package/dist/locale/da.mjs +186 -0
  187. package/dist/locale/de.js +195 -0
  188. package/dist/locale/de.min.js +3 -0
  189. package/dist/locale/de.min.js.map +1 -0
  190. package/dist/locale/de.min.mjs +3 -0
  191. package/dist/locale/de.min.mjs.map +1 -0
  192. package/dist/locale/de.mjs +188 -0
  193. package/dist/locale/el.js +193 -0
  194. package/dist/locale/el.min.js +3 -0
  195. package/dist/locale/el.min.js.map +1 -0
  196. package/dist/locale/el.min.mjs +3 -0
  197. package/dist/locale/el.min.mjs.map +1 -0
  198. package/dist/locale/el.mjs +186 -0
  199. package/dist/locale/en.js +193 -0
  200. package/dist/locale/en.min.js +3 -0
  201. package/dist/locale/en.min.js.map +1 -0
  202. package/dist/locale/en.min.mjs +3 -0
  203. package/dist/locale/en.min.mjs.map +1 -0
  204. package/dist/locale/en.mjs +186 -0
  205. package/dist/locale/eo.js +193 -0
  206. package/dist/locale/eo.min.js +3 -0
  207. package/dist/locale/eo.min.js.map +1 -0
  208. package/dist/locale/eo.min.mjs +3 -0
  209. package/dist/locale/eo.min.mjs.map +1 -0
  210. package/dist/locale/eo.mjs +186 -0
  211. package/dist/locale/es.js +193 -0
  212. package/dist/locale/es.min.js +3 -0
  213. package/dist/locale/es.min.js.map +1 -0
  214. package/dist/locale/es.min.mjs +3 -0
  215. package/dist/locale/es.min.mjs.map +1 -0
  216. package/dist/locale/es.mjs +186 -0
  217. package/dist/locale/et.js +193 -0
  218. package/dist/locale/et.min.js +3 -0
  219. package/dist/locale/et.min.js.map +1 -0
  220. package/dist/locale/et.min.mjs +3 -0
  221. package/dist/locale/et.min.mjs.map +1 -0
  222. package/dist/locale/et.mjs +186 -0
  223. package/dist/locale/eu.js +193 -0
  224. package/dist/locale/eu.min.js +3 -0
  225. package/dist/locale/eu.min.js.map +1 -0
  226. package/dist/locale/eu.min.mjs +3 -0
  227. package/dist/locale/eu.min.mjs.map +1 -0
  228. package/dist/locale/eu.mjs +186 -0
  229. package/dist/locale/fa.js +193 -0
  230. package/dist/locale/fa.min.js +3 -0
  231. package/dist/locale/fa.min.js.map +1 -0
  232. package/dist/locale/fa.min.mjs +3 -0
  233. package/dist/locale/fa.min.mjs.map +1 -0
  234. package/dist/locale/fa.mjs +186 -0
  235. package/dist/locale/fi.js +193 -0
  236. package/dist/locale/fi.min.js +3 -0
  237. package/dist/locale/fi.min.js.map +1 -0
  238. package/dist/locale/fi.min.mjs +3 -0
  239. package/dist/locale/fi.min.mjs.map +1 -0
  240. package/dist/locale/fi.mjs +186 -0
  241. package/dist/locale/fr.js +193 -0
  242. package/dist/locale/fr.min.js +3 -0
  243. package/dist/locale/fr.min.js.map +1 -0
  244. package/dist/locale/fr.min.mjs +3 -0
  245. package/dist/locale/fr.min.mjs.map +1 -0
  246. package/dist/locale/fr.mjs +186 -0
  247. package/dist/locale/he.js +193 -0
  248. package/dist/locale/he.min.js +3 -0
  249. package/dist/locale/he.min.js.map +1 -0
  250. package/dist/locale/he.min.mjs +3 -0
  251. package/dist/locale/he.min.mjs.map +1 -0
  252. package/dist/locale/he.mjs +186 -0
  253. package/dist/locale/hi.js +193 -0
  254. package/dist/locale/hi.min.js +3 -0
  255. package/dist/locale/hi.min.js.map +1 -0
  256. package/dist/locale/hi.min.mjs +3 -0
  257. package/dist/locale/hi.min.mjs.map +1 -0
  258. package/dist/locale/hi.mjs +186 -0
  259. package/dist/locale/hr.js +193 -0
  260. package/dist/locale/hr.min.js +3 -0
  261. package/dist/locale/hr.min.js.map +1 -0
  262. package/dist/locale/hr.min.mjs +3 -0
  263. package/dist/locale/hr.min.mjs.map +1 -0
  264. package/dist/locale/hr.mjs +186 -0
  265. package/dist/locale/hu.js +193 -0
  266. package/dist/locale/hu.min.js +3 -0
  267. package/dist/locale/hu.min.js.map +1 -0
  268. package/dist/locale/hu.min.mjs +3 -0
  269. package/dist/locale/hu.min.mjs.map +1 -0
  270. package/dist/locale/hu.mjs +186 -0
  271. package/dist/locale/hy-am.js +193 -0
  272. package/dist/locale/hy-am.min.js +3 -0
  273. package/dist/locale/hy-am.min.js.map +1 -0
  274. package/dist/locale/hy-am.min.mjs +3 -0
  275. package/dist/locale/hy-am.min.mjs.map +1 -0
  276. package/dist/locale/hy-am.mjs +186 -0
  277. package/dist/locale/id.js +193 -0
  278. package/dist/locale/id.min.js +3 -0
  279. package/dist/locale/id.min.js.map +1 -0
  280. package/dist/locale/id.min.mjs +3 -0
  281. package/dist/locale/id.min.mjs.map +1 -0
  282. package/dist/locale/id.mjs +186 -0
  283. package/dist/locale/it.js +193 -0
  284. package/dist/locale/it.min.js +3 -0
  285. package/dist/locale/it.min.js.map +1 -0
  286. package/dist/locale/it.min.mjs +3 -0
  287. package/dist/locale/it.min.mjs.map +1 -0
  288. package/dist/locale/it.mjs +186 -0
  289. package/dist/locale/ja.js +193 -0
  290. package/dist/locale/ja.min.js +3 -0
  291. package/dist/locale/ja.min.js.map +1 -0
  292. package/dist/locale/ja.min.mjs +3 -0
  293. package/dist/locale/ja.min.mjs.map +1 -0
  294. package/dist/locale/ja.mjs +186 -0
  295. package/dist/locale/kk.js +193 -0
  296. package/dist/locale/kk.min.js +3 -0
  297. package/dist/locale/kk.min.js.map +1 -0
  298. package/dist/locale/kk.min.mjs +3 -0
  299. package/dist/locale/kk.min.mjs.map +1 -0
  300. package/dist/locale/kk.mjs +186 -0
  301. package/dist/locale/km.js +193 -0
  302. package/dist/locale/km.min.js +3 -0
  303. package/dist/locale/km.min.js.map +1 -0
  304. package/dist/locale/km.min.mjs +3 -0
  305. package/dist/locale/km.min.mjs.map +1 -0
  306. package/dist/locale/km.mjs +186 -0
  307. package/dist/locale/ko.js +193 -0
  308. package/dist/locale/ko.min.js +3 -0
  309. package/dist/locale/ko.min.js.map +1 -0
  310. package/dist/locale/ko.min.mjs +3 -0
  311. package/dist/locale/ko.min.mjs.map +1 -0
  312. package/dist/locale/ko.mjs +186 -0
  313. package/dist/locale/ku.js +193 -0
  314. package/dist/locale/ku.min.js +3 -0
  315. package/dist/locale/ku.min.js.map +1 -0
  316. package/dist/locale/ku.min.mjs +3 -0
  317. package/dist/locale/ku.min.mjs.map +1 -0
  318. package/dist/locale/ku.mjs +186 -0
  319. package/dist/locale/ky.js +193 -0
  320. package/dist/locale/ky.min.js +3 -0
  321. package/dist/locale/ky.min.js.map +1 -0
  322. package/dist/locale/ky.min.mjs +3 -0
  323. package/dist/locale/ky.min.mjs.map +1 -0
  324. package/dist/locale/ky.mjs +186 -0
  325. package/dist/locale/lo.js +193 -0
  326. package/dist/locale/lo.min.js +3 -0
  327. package/dist/locale/lo.min.js.map +1 -0
  328. package/dist/locale/lo.min.mjs +3 -0
  329. package/dist/locale/lo.min.mjs.map +1 -0
  330. package/dist/locale/lo.mjs +186 -0
  331. package/dist/locale/lt.js +193 -0
  332. package/dist/locale/lt.min.js +3 -0
  333. package/dist/locale/lt.min.js.map +1 -0
  334. package/dist/locale/lt.min.mjs +3 -0
  335. package/dist/locale/lt.min.mjs.map +1 -0
  336. package/dist/locale/lt.mjs +186 -0
  337. package/dist/locale/lv.js +193 -0
  338. package/dist/locale/lv.min.js +3 -0
  339. package/dist/locale/lv.min.js.map +1 -0
  340. package/dist/locale/lv.min.mjs +3 -0
  341. package/dist/locale/lv.min.mjs.map +1 -0
  342. package/dist/locale/lv.mjs +186 -0
  343. package/dist/locale/mg.js +193 -0
  344. package/dist/locale/mg.min.js +3 -0
  345. package/dist/locale/mg.min.js.map +1 -0
  346. package/dist/locale/mg.min.mjs +3 -0
  347. package/dist/locale/mg.min.mjs.map +1 -0
  348. package/dist/locale/mg.mjs +186 -0
  349. package/dist/locale/mn.js +193 -0
  350. package/dist/locale/mn.min.js +3 -0
  351. package/dist/locale/mn.min.js.map +1 -0
  352. package/dist/locale/mn.min.mjs +3 -0
  353. package/dist/locale/mn.min.mjs.map +1 -0
  354. package/dist/locale/mn.mjs +186 -0
  355. package/dist/locale/ms.js +195 -0
  356. package/dist/locale/ms.min.js +3 -0
  357. package/dist/locale/ms.min.js.map +1 -0
  358. package/dist/locale/ms.min.mjs +3 -0
  359. package/dist/locale/ms.min.mjs.map +1 -0
  360. package/dist/locale/ms.mjs +188 -0
  361. package/dist/locale/my.js +193 -0
  362. package/dist/locale/my.min.js +3 -0
  363. package/dist/locale/my.min.js.map +1 -0
  364. package/dist/locale/my.min.mjs +3 -0
  365. package/dist/locale/my.min.mjs.map +1 -0
  366. package/dist/locale/my.mjs +186 -0
  367. package/dist/locale/nb-no.js +193 -0
  368. package/dist/locale/nb-no.min.js +3 -0
  369. package/dist/locale/nb-no.min.js.map +1 -0
  370. package/dist/locale/nb-no.min.mjs +3 -0
  371. package/dist/locale/nb-no.min.mjs.map +1 -0
  372. package/dist/locale/nb-no.mjs +186 -0
  373. package/dist/locale/nl.js +193 -0
  374. package/dist/locale/nl.min.js +3 -0
  375. package/dist/locale/nl.min.js.map +1 -0
  376. package/dist/locale/nl.min.mjs +3 -0
  377. package/dist/locale/nl.min.mjs.map +1 -0
  378. package/dist/locale/nl.mjs +186 -0
  379. package/dist/locale/no.js +193 -0
  380. package/dist/locale/no.min.js +3 -0
  381. package/dist/locale/no.min.js.map +1 -0
  382. package/dist/locale/no.min.mjs +3 -0
  383. package/dist/locale/no.min.mjs.map +1 -0
  384. package/dist/locale/no.mjs +186 -0
  385. package/dist/locale/pa.js +193 -0
  386. package/dist/locale/pa.min.js +3 -0
  387. package/dist/locale/pa.min.js.map +1 -0
  388. package/dist/locale/pa.min.mjs +3 -0
  389. package/dist/locale/pa.min.mjs.map +1 -0
  390. package/dist/locale/pa.mjs +186 -0
  391. package/dist/locale/pl.js +193 -0
  392. package/dist/locale/pl.min.js +3 -0
  393. package/dist/locale/pl.min.js.map +1 -0
  394. package/dist/locale/pl.min.mjs +3 -0
  395. package/dist/locale/pl.min.mjs.map +1 -0
  396. package/dist/locale/pl.mjs +186 -0
  397. package/dist/locale/pt-br.js +193 -0
  398. package/dist/locale/pt-br.min.js +3 -0
  399. package/dist/locale/pt-br.min.js.map +1 -0
  400. package/dist/locale/pt-br.min.mjs +3 -0
  401. package/dist/locale/pt-br.min.mjs.map +1 -0
  402. package/dist/locale/pt-br.mjs +186 -0
  403. package/dist/locale/pt.js +193 -0
  404. package/dist/locale/pt.min.js +3 -0
  405. package/dist/locale/pt.min.js.map +1 -0
  406. package/dist/locale/pt.min.mjs +3 -0
  407. package/dist/locale/pt.min.mjs.map +1 -0
  408. package/dist/locale/pt.mjs +186 -0
  409. package/dist/locale/ro.js +193 -0
  410. package/dist/locale/ro.min.js +3 -0
  411. package/dist/locale/ro.min.js.map +1 -0
  412. package/dist/locale/ro.min.mjs +3 -0
  413. package/dist/locale/ro.min.mjs.map +1 -0
  414. package/dist/locale/ro.mjs +186 -0
  415. package/dist/locale/ru.js +193 -0
  416. package/dist/locale/ru.min.js +3 -0
  417. package/dist/locale/ru.min.js.map +1 -0
  418. package/dist/locale/ru.min.mjs +3 -0
  419. package/dist/locale/ru.min.mjs.map +1 -0
  420. package/dist/locale/ru.mjs +186 -0
  421. package/dist/locale/sk.js +195 -0
  422. package/dist/locale/sk.min.js +3 -0
  423. package/dist/locale/sk.min.js.map +1 -0
  424. package/dist/locale/sk.min.mjs +3 -0
  425. package/dist/locale/sk.min.mjs.map +1 -0
  426. package/dist/locale/sk.mjs +188 -0
  427. package/dist/locale/sl.js +193 -0
  428. package/dist/locale/sl.min.js +3 -0
  429. package/dist/locale/sl.min.js.map +1 -0
  430. package/dist/locale/sl.min.mjs +3 -0
  431. package/dist/locale/sl.min.mjs.map +1 -0
  432. package/dist/locale/sl.mjs +186 -0
  433. package/dist/locale/sr.js +193 -0
  434. package/dist/locale/sr.min.js +3 -0
  435. package/dist/locale/sr.min.js.map +1 -0
  436. package/dist/locale/sr.min.mjs +3 -0
  437. package/dist/locale/sr.min.mjs.map +1 -0
  438. package/dist/locale/sr.mjs +186 -0
  439. package/dist/locale/sv.js +193 -0
  440. package/dist/locale/sv.min.js +3 -0
  441. package/dist/locale/sv.min.js.map +1 -0
  442. package/dist/locale/sv.min.mjs +3 -0
  443. package/dist/locale/sv.min.mjs.map +1 -0
  444. package/dist/locale/sv.mjs +186 -0
  445. package/dist/locale/sw.js +193 -0
  446. package/dist/locale/sw.min.js +3 -0
  447. package/dist/locale/sw.min.js.map +1 -0
  448. package/dist/locale/sw.min.mjs +3 -0
  449. package/dist/locale/sw.min.mjs.map +1 -0
  450. package/dist/locale/sw.mjs +186 -0
  451. package/dist/locale/ta.js +193 -0
  452. package/dist/locale/ta.min.js +3 -0
  453. package/dist/locale/ta.min.js.map +1 -0
  454. package/dist/locale/ta.min.mjs +3 -0
  455. package/dist/locale/ta.min.mjs.map +1 -0
  456. package/dist/locale/ta.mjs +186 -0
  457. package/dist/locale/te.js +193 -0
  458. package/dist/locale/te.min.js +3 -0
  459. package/dist/locale/te.min.js.map +1 -0
  460. package/dist/locale/te.min.mjs +3 -0
  461. package/dist/locale/te.min.mjs.map +1 -0
  462. package/dist/locale/te.mjs +186 -0
  463. package/dist/locale/th.js +193 -0
  464. package/dist/locale/th.min.js +3 -0
  465. package/dist/locale/th.min.js.map +1 -0
  466. package/dist/locale/th.min.mjs +3 -0
  467. package/dist/locale/th.min.mjs.map +1 -0
  468. package/dist/locale/th.mjs +186 -0
  469. package/dist/locale/tk.js +193 -0
  470. package/dist/locale/tk.min.js +3 -0
  471. package/dist/locale/tk.min.js.map +1 -0
  472. package/dist/locale/tk.min.mjs +3 -0
  473. package/dist/locale/tk.min.mjs.map +1 -0
  474. package/dist/locale/tk.mjs +186 -0
  475. package/dist/locale/tr.js +193 -0
  476. package/dist/locale/tr.min.js +3 -0
  477. package/dist/locale/tr.min.js.map +1 -0
  478. package/dist/locale/tr.min.mjs +3 -0
  479. package/dist/locale/tr.min.mjs.map +1 -0
  480. package/dist/locale/tr.mjs +186 -0
  481. package/dist/locale/ug-cn.js +193 -0
  482. package/dist/locale/ug-cn.min.js +3 -0
  483. package/dist/locale/ug-cn.min.js.map +1 -0
  484. package/dist/locale/ug-cn.min.mjs +3 -0
  485. package/dist/locale/ug-cn.min.mjs.map +1 -0
  486. package/dist/locale/ug-cn.mjs +186 -0
  487. package/dist/locale/uk.js +193 -0
  488. package/dist/locale/uk.min.js +3 -0
  489. package/dist/locale/uk.min.js.map +1 -0
  490. package/dist/locale/uk.min.mjs +3 -0
  491. package/dist/locale/uk.min.mjs.map +1 -0
  492. package/dist/locale/uk.mjs +186 -0
  493. package/dist/locale/uz-uz.js +193 -0
  494. package/dist/locale/uz-uz.min.js +3 -0
  495. package/dist/locale/uz-uz.min.js.map +1 -0
  496. package/dist/locale/uz-uz.min.mjs +3 -0
  497. package/dist/locale/uz-uz.min.mjs.map +1 -0
  498. package/dist/locale/uz-uz.mjs +186 -0
  499. package/dist/locale/vi.js +193 -0
  500. package/dist/locale/vi.min.js +3 -0
  501. package/dist/locale/vi.min.js.map +1 -0
  502. package/dist/locale/vi.min.mjs +3 -0
  503. package/dist/locale/vi.min.mjs.map +1 -0
  504. package/dist/locale/vi.mjs +186 -0
  505. package/dist/locale/zh-cn.js +193 -0
  506. package/dist/locale/zh-cn.min.js +3 -0
  507. package/dist/locale/zh-cn.min.js.map +1 -0
  508. package/dist/locale/zh-cn.min.mjs +3 -0
  509. package/dist/locale/zh-cn.min.mjs.map +1 -0
  510. package/dist/locale/zh-cn.mjs +186 -0
  511. package/dist/locale/zh-hk.js +193 -0
  512. package/dist/locale/zh-hk.min.js +3 -0
  513. package/dist/locale/zh-hk.min.js.map +1 -0
  514. package/dist/locale/zh-hk.min.mjs +3 -0
  515. package/dist/locale/zh-hk.min.mjs.map +1 -0
  516. package/dist/locale/zh-hk.mjs +186 -0
  517. package/dist/locale/zh-mo.js +193 -0
  518. package/dist/locale/zh-mo.min.js +3 -0
  519. package/dist/locale/zh-mo.min.js.map +1 -0
  520. package/dist/locale/zh-mo.min.mjs +3 -0
  521. package/dist/locale/zh-mo.min.mjs.map +1 -0
  522. package/dist/locale/zh-mo.mjs +186 -0
  523. package/dist/locale/zh-tw.js +193 -0
  524. package/dist/locale/zh-tw.min.js +3 -0
  525. package/dist/locale/zh-tw.min.js.map +1 -0
  526. package/dist/locale/zh-tw.min.mjs +3 -0
  527. package/dist/locale/zh-tw.min.mjs.map +1 -0
  528. package/dist/locale/zh-tw.mjs +186 -0
  529. package/dist/style.css +1 -1
  530. package/dist/test/demo.docx +0 -0
  531. package/dist/test/demo.et +0 -0
  532. package/dist/test/demo.ofd +0 -0
  533. package/dist/test/demo.pdf +0 -0
  534. package/dist/test/test.ofd +0 -0
  535. package/dist/test/unzip.ofd +0 -0
  536. package/dist/test/zip.ofd +0 -0
  537. package/dist/types/auto-imports.d.ts +9 -0
  538. package/dist/types/components.d.ts +55 -0
  539. package/dist/zhui-plus.cjs.js +1 -0
  540. package/dist/zhui-plus.es.js +2 -0
  541. package/dist/zhui.svg +1 -0
  542. package/package.json +90 -4
  543. package/packages/components/AI/index.ts +10 -0
  544. package/packages/components/AI/src/zh-aiChat.vue +841 -0
  545. package/packages/components/badge/__tests__/badge.test.ts +38 -0
  546. package/packages/components/badge/index.ts +10 -0
  547. package/packages/components/badge/src/zh-badge.vue +86 -0
  548. package/packages/components/badge/style.scss +1 -0
  549. package/packages/components/button/__tests__/button.test.ts +94 -0
  550. package/packages/components/button/__tests__/buttonGroup.test.ts +46 -0
  551. package/packages/components/button/index.ts +11 -0
  552. package/packages/components/button/src/zh-button-group.vue +50 -0
  553. package/packages/components/button/src/zh-button.vue +152 -0
  554. package/packages/components/button/style/index.css +140 -0
  555. package/packages/components/charts/geo.json +11147 -0
  556. package/packages/components/charts/index.ts +35 -0
  557. package/packages/components/charts/src/zh-barChart.vue +97 -0
  558. package/packages/components/charts/src/zh-baseChart.vue +196 -0
  559. package/packages/components/charts/src/zh-lineBarChart.vue +113 -0
  560. package/packages/components/charts/src/zh-lineChart.vue +93 -0
  561. package/packages/components/charts/src/zh-mapChart.vue +214 -0
  562. package/packages/components/charts/src/zh-pictorialBar.vue +72 -0
  563. package/packages/components/charts/src/zh-pieChart.vue +67 -0
  564. package/packages/components/charts/src/zh-radarChart.vue +131 -0
  565. package/packages/components/charts/src/zh-scatterChart.vue +152 -0
  566. package/packages/components/chat/index.ts +10 -0
  567. package/packages/components/chat/src/zh-chat.vue +889 -0
  568. package/packages/components/container/index.ts +18 -0
  569. package/packages/components/container/src/zh-aside.vue +34 -0
  570. package/packages/components/container/src/zh-container.vue +45 -0
  571. package/packages/components/container/src/zh-footer.vue +33 -0
  572. package/packages/components/container/src/zh-header.vue +34 -0
  573. package/packages/components/container/src/zh-main.vue +26 -0
  574. package/packages/components/directive/focus.ts +14 -0
  575. package/packages/components/directive/idCard.ts +12 -0
  576. package/packages/components/directive/index.ts +19 -0
  577. package/packages/components/directive/number.ts +10 -0
  578. package/packages/components/directive/permission.ts +57 -0
  579. package/packages/components/directive/phone.ts +12 -0
  580. package/packages/components/drawer/index.ts +10 -0
  581. package/packages/components/drawer/src/zh-drawer.vue +78 -0
  582. package/packages/components/drawer/style/animation.scss +35 -0
  583. package/packages/components/drawer/style/index.scss +52 -0
  584. package/packages/components/drawer/style/media.scss +6 -0
  585. package/packages/components/fileViewer/index.ts +9 -0
  586. package/packages/components/fileViewer/src/liteofd/annotLayer.ts +203 -0
  587. package/packages/components/fileViewer/src/liteofd/asn1js/LICENSE +15 -0
  588. package/packages/components/fileViewer/src/liteofd/asn1js/README.md +108 -0
  589. package/packages/components/fileViewer/src/liteofd/asn1js/asn1.js +627 -0
  590. package/packages/components/fileViewer/src/liteofd/asn1js/base64.js +103 -0
  591. package/packages/components/fileViewer/src/liteofd/asn1js/defs.js +138 -0
  592. package/packages/components/fileViewer/src/liteofd/asn1js/dumpASN1.js +79 -0
  593. package/packages/components/fileViewer/src/liteofd/asn1js/hex.js +69 -0
  594. package/packages/components/fileViewer/src/liteofd/asn1js/int10.js +106 -0
  595. package/packages/components/fileViewer/src/liteofd/asn1js/oids.js +2725 -0
  596. package/packages/components/fileViewer/src/liteofd/asn1js/rfcdef.js +10377 -0
  597. package/packages/components/fileViewer/src/liteofd/attrType.ts +173 -0
  598. package/packages/components/fileViewer/src/liteofd/contentLayer.ts +203 -0
  599. package/packages/components/fileViewer/src/liteofd/elements/AnnotationPathSvg.ts +122 -0
  600. package/packages/components/fileViewer/src/liteofd/elements/BaseSvg.ts +6 -0
  601. package/packages/components/fileViewer/src/liteofd/elements/ImageSvg.ts +212 -0
  602. package/packages/components/fileViewer/src/liteofd/elements/PathSvg.ts +460 -0
  603. package/packages/components/fileViewer/src/liteofd/elements/SignatureElement.ts +231 -0
  604. package/packages/components/fileViewer/src/liteofd/elements/TextSvg.ts +235 -0
  605. package/packages/components/fileViewer/src/liteofd/elements/ofdAnnotationElement.ts +133 -0
  606. package/packages/components/fileViewer/src/liteofd/elements/ofdPageContainer.ts +183 -0
  607. package/packages/components/fileViewer/src/liteofd/elements/ofdPageRender.ts +71 -0
  608. package/packages/components/fileViewer/src/liteofd/elements/signObject.json +10084 -0
  609. package/packages/components/fileViewer/src/liteofd/elements/signature.json +381 -0
  610. package/packages/components/fileViewer/src/liteofd/font/arithmetic_decoder.js +182 -0
  611. package/packages/components/fileViewer/src/liteofd/font/ascii_85_stream.js +98 -0
  612. package/packages/components/fileViewer/src/liteofd/font/ascii_hex_stream.js +79 -0
  613. package/packages/components/fileViewer/src/liteofd/font/base_stream.js +110 -0
  614. package/packages/components/fileViewer/src/liteofd/font/bidi.js +440 -0
  615. package/packages/components/fileViewer/src/liteofd/font/binary_cmap.js +326 -0
  616. package/packages/components/fileViewer/src/liteofd/font/calibri_factors.js +309 -0
  617. package/packages/components/fileViewer/src/liteofd/font/ccitt.js +1059 -0
  618. package/packages/components/fileViewer/src/liteofd/font/ccitt_stream.js +60 -0
  619. package/packages/components/fileViewer/src/liteofd/font/cff_font.js +139 -0
  620. package/packages/components/fileViewer/src/liteofd/font/cff_parser.js +1940 -0
  621. package/packages/components/fileViewer/src/liteofd/font/charsets.js +119 -0
  622. package/packages/components/fileViewer/src/liteofd/font/chunked_stream.js +94 -0
  623. package/packages/components/fileViewer/src/liteofd/font/cmap.js +726 -0
  624. package/packages/components/fileViewer/src/liteofd/font/colorspace.js +1336 -0
  625. package/packages/components/fileViewer/src/liteofd/font/core_utils.js +636 -0
  626. package/packages/components/fileViewer/src/liteofd/font/decode_stream.js +177 -0
  627. package/packages/components/fileViewer/src/liteofd/font/differences.js +906 -0
  628. package/packages/components/fileViewer/src/liteofd/font/encodings.js +301 -0
  629. package/packages/components/fileViewer/src/liteofd/font/flate_stream.js +413 -0
  630. package/packages/components/fileViewer/src/liteofd/font/font_loader.js +455 -0
  631. package/packages/components/fileViewer/src/liteofd/font/font_renderer.js +900 -0
  632. package/packages/components/fileViewer/src/liteofd/font/font_substitutions.js +553 -0
  633. package/packages/components/fileViewer/src/liteofd/font/fonts copy.js +3391 -0
  634. package/packages/components/fileViewer/src/liteofd/font/fonts.js +3585 -0
  635. package/packages/components/fileViewer/src/liteofd/font/fonts_utils.js +178 -0
  636. package/packages/components/fileViewer/src/liteofd/font/function.js +1241 -0
  637. package/packages/components/fileViewer/src/liteofd/font/glyf.js +701 -0
  638. package/packages/components/fileViewer/src/liteofd/font/glyphlist.js +4557 -0
  639. package/packages/components/fileViewer/src/liteofd/font/helvetica_factors.js +352 -0
  640. package/packages/components/fileViewer/src/liteofd/font/image.js +986 -0
  641. package/packages/components/fileViewer/src/liteofd/font/image_resizer.js +398 -0
  642. package/packages/components/fileViewer/src/liteofd/font/image_utils.js +286 -0
  643. package/packages/components/fileViewer/src/liteofd/font/jbig2_stream.js +74 -0
  644. package/packages/components/fileViewer/src/liteofd/font/jpeg_stream.js +106 -0
  645. package/packages/components/fileViewer/src/liteofd/font/jpg.js +1590 -0
  646. package/packages/components/fileViewer/src/liteofd/font/jpx.js +2349 -0
  647. package/packages/components/fileViewer/src/liteofd/font/jpx_stream.js +87 -0
  648. package/packages/components/fileViewer/src/liteofd/font/liberationsans_widths.js +429 -0
  649. package/packages/components/fileViewer/src/liteofd/font/lzw_stream.js +150 -0
  650. package/packages/components/fileViewer/src/liteofd/font/metrics.d.ts +1 -0
  651. package/packages/components/fileViewer/src/liteofd/font/metrics.js +3057 -0
  652. package/packages/components/fileViewer/src/liteofd/font/murmurhash3.js +135 -0
  653. package/packages/components/fileViewer/src/liteofd/font/myriadpro_factors.js +291 -0
  654. package/packages/components/fileViewer/src/liteofd/font/ofd_stream.js +402 -0
  655. package/packages/components/fileViewer/src/liteofd/font/opentype_file_builder.js +154 -0
  656. package/packages/components/fileViewer/src/liteofd/font/parser.js +1409 -0
  657. package/packages/components/fileViewer/src/liteofd/font/pattern.js +1005 -0
  658. package/packages/components/fileViewer/src/liteofd/font/predictor_stream.js +234 -0
  659. package/packages/components/fileViewer/src/liteofd/font/primitives.js +354 -0
  660. package/packages/components/fileViewer/src/liteofd/font/properties.json +2110 -0
  661. package/packages/components/fileViewer/src/liteofd/font/ps_parser.js +268 -0
  662. package/packages/components/fileViewer/src/liteofd/font/run_length_stream.js +61 -0
  663. package/packages/components/fileViewer/src/liteofd/font/segoeui_factors.js +308 -0
  664. package/packages/components/fileViewer/src/liteofd/font/standard_fonts.js +915 -0
  665. package/packages/components/fileViewer/src/liteofd/font/stream.js +99 -0
  666. package/packages/components/fileViewer/src/liteofd/font/to_unicode_map.js +111 -0
  667. package/packages/components/fileViewer/src/liteofd/font/translatedFont.js +3125 -0
  668. package/packages/components/fileViewer/src/liteofd/font/type1_font.js +443 -0
  669. package/packages/components/fileViewer/src/liteofd/font/type1_parser.js +804 -0
  670. package/packages/components/fileViewer/src/liteofd/font/unicode.js +274 -0
  671. package/packages/components/fileViewer/src/liteofd/font/util.js +1159 -0
  672. package/packages/components/fileViewer/src/liteofd/font/xfa_fonts.js +296 -0
  673. package/packages/components/fileViewer/src/liteofd/jbig2/arithmetic_decoder.js +183 -0
  674. package/packages/components/fileViewer/src/liteofd/jbig2/ccitt.js +1070 -0
  675. package/packages/components/fileViewer/src/liteofd/jbig2/core_utils.js +180 -0
  676. package/packages/components/fileViewer/src/liteofd/jbig2/is_node.js +27 -0
  677. package/packages/components/fileViewer/src/liteofd/jbig2/jbig2.js +2589 -0
  678. package/packages/components/fileViewer/src/liteofd/jbig2/jbig2_stream.js +81 -0
  679. package/packages/components/fileViewer/src/liteofd/jbig2/primitives.js +371 -0
  680. package/packages/components/fileViewer/src/liteofd/jbig2/stream.js +1348 -0
  681. package/packages/components/fileViewer/src/liteofd/jbig2/util.js +970 -0
  682. package/packages/components/fileViewer/src/liteofd/layer.ts +12 -0
  683. package/packages/components/fileViewer/src/liteofd/liteOfd.ts +185 -0
  684. package/packages/components/fileViewer/src/liteofd/ofdActions.ts +29 -0
  685. package/packages/components/fileViewer/src/liteofd/ofdCanvas.ts +19 -0
  686. package/packages/components/fileViewer/src/liteofd/ofdData.ts +28 -0
  687. package/packages/components/fileViewer/src/liteofd/ofdDocument.ts +109 -0
  688. package/packages/components/fileViewer/src/liteofd/ofdFont.ts +425 -0
  689. package/packages/components/fileViewer/src/liteofd/ofdRender.ts +259 -0
  690. package/packages/components/fileViewer/src/liteofd/ofdWriter.ts +142 -0
  691. package/packages/components/fileViewer/src/liteofd/ofdtools.ts +43 -0
  692. package/packages/components/fileViewer/src/liteofd/parser.ts +499 -0
  693. package/packages/components/fileViewer/src/liteofd/promiseCapability.ts +47 -0
  694. package/packages/components/fileViewer/src/liteofd/utils/commonFont.ts +15 -0
  695. package/packages/components/fileViewer/src/liteofd/utils/elementUtils.ts +362 -0
  696. package/packages/components/fileViewer/src/liteofd/utils/jsonToXml.ts +95 -0
  697. package/packages/components/fileViewer/src/liteofd/utils/ofdUtils.ts +301 -0
  698. package/packages/components/fileViewer/src/liteofd/utils/signatureUtil.ts +246 -0
  699. package/packages/components/fileViewer/src/liteofd/utils/sm3.ts +235 -0
  700. package/packages/components/fileViewer/src/liteofd/utils/utils.ts +489 -0
  701. package/packages/components/fileViewer/src/liteofd/utils/verify_signature_util.ts +41 -0
  702. package/packages/components/fileViewer/src/ofd/CircleLoading.vue +64 -0
  703. package/packages/components/fileViewer/src/ofd/OfdPreview.vue +456 -0
  704. package/packages/components/fileViewer/src/ofd/OfdViewer.vue +211 -0
  705. package/packages/components/fileViewer/src/ofd/PageIndicator.vue +88 -0
  706. package/packages/components/fileViewer/src/ofd/RatioIndicator.vue +271 -0
  707. package/packages/components/fileViewer/src/ofd/ToolTip.vue +81 -0
  708. package/packages/components/fileViewer/src/zh-fileViewer.vue +426 -0
  709. package/packages/components/form/index.ts +11 -0
  710. package/packages/components/form/src/zh-form-item.vue +299 -0
  711. package/packages/components/form/src/zh-form.vue +90 -0
  712. package/packages/components/hideNumber/index.ts +9 -0
  713. package/packages/components/hideNumber/src/zh-hide-number.vue +37 -0
  714. package/packages/components/icon/index.ts +10 -0
  715. package/packages/components/icon/src/zh-icon.vue +32 -0
  716. package/packages/components/image/index.ts +9 -0
  717. package/packages/components/image/src/zh-image.vue +245 -0
  718. package/packages/components/index.ts +112 -0
  719. package/packages/components/input/index.ts +10 -0
  720. package/packages/components/input/src/input.com.ts +30 -0
  721. package/packages/components/input/src/input.type.ts +1 -0
  722. package/packages/components/input/src/zh-input.vue +92 -0
  723. package/packages/components/input/style/index.scss +30 -0
  724. package/packages/components/layout/index.ts +12 -0
  725. package/packages/components/layout/src/zh-col.tsx +81 -0
  726. package/packages/components/layout/src/zh-row.tsx +58 -0
  727. package/packages/components/layout/style/row.scss +6 -0
  728. package/packages/components/map/index.ts +18 -0
  729. package/packages/components/map/src/zh-amap.vue +999 -0
  730. package/packages/components/map/src/zh-bmap.vue +1578 -0
  731. package/packages/components/map/src/zh-omap.vue +1522 -0
  732. package/packages/components/map/src/zh-smap.vue +1555 -0
  733. package/packages/components/map/src/zh-tmap.vue +1058 -0
  734. package/packages/components/message/index.ts +8 -0
  735. package/packages/components/message/src/data.com.ts +61 -0
  736. package/packages/components/message/src/message-icon.vue +60 -0
  737. package/packages/components/message/src/message.ts +89 -0
  738. package/packages/components/message/src/message.type.ts +40 -0
  739. package/packages/components/message/src/zh-message.vue +133 -0
  740. package/packages/components/message-box/index.ts +12 -0
  741. package/packages/components/message-box/src/messageBox.help.ts +40 -0
  742. package/packages/components/message-box/src/messageBox.ts +126 -0
  743. package/packages/components/message-box/src/zh-message-box.vue +94 -0
  744. package/packages/components/message-box/style/index.css +29 -0
  745. package/packages/components/noData/index.ts +9 -0
  746. package/packages/components/noData/src/zh-no-data.vue +42 -0
  747. package/packages/components/operationColumn/index.ts +9 -0
  748. package/packages/components/operationColumn/src/zh-operationColumn.vue +113 -0
  749. package/packages/components/provider/index.ts +11 -0
  750. package/packages/components/provider/src/zh-authControl.vue +28 -0
  751. package/packages/components/provider/src/zh-authProvider.vue +36 -0
  752. package/packages/components/qrcode/index.ts +9 -0
  753. package/packages/components/qrcode/src/zh-qrcode.vue +271 -0
  754. package/packages/components/radio/index.ts +10 -0
  755. package/packages/components/radio/src/zh-radio.vue +86 -0
  756. package/packages/components/searchForm/index.ts +9 -0
  757. package/packages/components/searchForm/src/zh-search-form.vue +340 -0
  758. package/packages/components/signature/index.ts +10 -0
  759. package/packages/components/signature/src/zh-signature.vue +355 -0
  760. package/packages/components/switch/index.ts +10 -0
  761. package/packages/components/switch/src/zh-switch.vue +162 -0
  762. package/packages/components/table/index.ts +10 -0
  763. package/packages/components/table/src/types.ts +62 -0
  764. package/packages/components/table/src/zh-table.vue +220 -0
  765. package/packages/components/upload/index.ts +15 -0
  766. package/packages/components/upload/src/zh-cupload.vue +147 -0
  767. package/packages/components/upload/src/zh-upload.vue +258 -0
  768. package/packages/components/upload/src/zh-uploadCard.vue +176 -0
  769. package/packages/components/upload/src/zh-uploadDialog.vue +165 -0
  770. package/packages/components/videoPlayer/index.ts +12 -0
  771. package/packages/components/videoPlayer/src/PlayerManager.js +706 -0
  772. package/packages/components/videoPlayer/src/api.js +354 -0
  773. package/packages/components/videoPlayer/src/errorHandler.ts +39 -0
  774. package/packages/components/videoPlayer/src/resourceLoader.ts +68 -0
  775. package/packages/components/videoPlayer/src/useDahuaPlayer.ts +242 -0
  776. package/packages/components/videoPlayer/src/zh-dhPlayer.vue +119 -0
  777. package/packages/components/videoPlayer/src/zh-hlsPlayer.vue +575 -0
  778. package/packages/resolver/index.ts +324 -0
  779. package/packages/styles/_element.scss +324 -0
  780. package/packages/styles/_variable.scss +136 -0
  781. package/packages/styles/index.scss +3 -0
  782. package/packages/tokens/tokens.ts +2 -0
  783. package/packages/types/form.ts +205 -0
  784. package/packages/types/index.ts +4 -0
  785. package/packages/types/player.ts +80 -0
  786. package/packages/types/provider.ts +4 -0
  787. package/packages/types/searchForm.ts +24 -0
  788. package/packages/utils/common/__tests__/common.test.ts +12 -0
  789. package/packages/utils/common/common.ts +68 -0
  790. package/packages/utils/constant.ts +12 -0
  791. package/packages/utils/copy.ts +20 -0
  792. package/packages/utils/data.ts +62 -0
  793. package/packages/utils/echarts/echarts.ts +34 -0
  794. package/packages/utils/event.ts +37 -0
  795. package/packages/utils/hooks/__tests__/hooks.test.ts +24 -0
  796. package/packages/utils/hooks/data.ts +100 -0
  797. package/packages/utils/hooks/hooks.util.ts +39 -0
  798. package/packages/utils/hooks/index.ts +1 -0
  799. package/packages/utils/hooks/useBreakpoint.ts +89 -0
  800. package/packages/utils/hooks/useEcharts.ts +56 -0
  801. package/packages/utils/hooks/useEventListener.ts +57 -0
  802. package/packages/utils/hooks/useLegendProcessor.ts +92 -0
  803. package/packages/utils/hooks/usePermission.ts +22 -0
  804. package/packages/utils/hooks/useTimeout.ts +45 -0
  805. package/packages/utils/is.ts +79 -0
  806. package/packages/utils/utils.ts +136 -0
  807. package/packages/utils/vue/util-modal.vue +61 -0
  808. package/types/auto-imports.d.ts +9 -0
  809. package/types/component.d.ts +6 -0
  810. package/types/components.d.ts +131 -0
  811. package/types/defaults.d.ts +5 -0
  812. package/types/el-components.d.ts +23 -0
  813. package/types/global.d.ts +130 -0
  814. package/types/index.d.ts +11 -0
  815. package/types/zh-components.d.ts +23 -0
  816. package/types/zhui.d.ts +76 -0
  817. package/.idea/workspace.xml +0 -72
  818. package/README.md +0 -1
  819. package/dist/zh-ui.es.js +0 -56706
  820. package/dist/zh-ui.umd.js +0 -67
@@ -0,0 +1,1555 @@
1
+ <template>
2
+ <div class="tianditu-map-container">
3
+ <!-- 地图容器 -->
4
+ <div ref="mapContainerRef" class="map-container"></div>
5
+
6
+ <!-- 轨迹控制面板(仅在启用轨迹时显示) -->
7
+ <div class="track-control-panel" v-if="showTrackPanel && trackMode">
8
+ <div class="control-buttons">
9
+ <button @click="playTrack" :disabled="isPlaying" class="btn-play">▶ 播放</button>
10
+ <button @click="pauseTrack" :disabled="!isPlaying" class="btn-pause">⏸ 暂停</button>
11
+ <button @click="stopTrack" class="btn-stop">⏹ 停止</button>
12
+ <button @click="resetTrack" class="btn-reset">🔄 重置</button>
13
+ <button @click="toggleCorrection" :class="{ active: enableCorrection }" class="btn-correction">
14
+ 🧹 轨迹纠偏 {{ enableCorrection ? "开" : "关" }}
15
+ </button>
16
+ <button @click="toggleFollowCar" :class="{ active: followCarMode }" class="btn-follow">
17
+ 🚗 跟随 {{ followCarMode ? "开" : "关" }}
18
+ </button>
19
+ </div>
20
+ <div class="progress-bar">
21
+ <span>进度: {{ progressPercent }}%</span>
22
+ <input type="range" v-model.number="progressPercent" @input="seekTo" min="0" max="100" step="1" />
23
+ </div>
24
+ <div class="track-info">
25
+ <span>当前点: {{ currentIndex + 1 }} / {{ displayPoints.length }}</span>
26
+ <span>剩余距离: {{ remainingDistance.toFixed(2) }} 米</span>
27
+ <span>总距离: {{ totalDistance.toFixed(2) }} 米</span>
28
+ <span v-if="correctionInfo.corrected">已纠偏 {{ correctionInfo.correctedCount }} 个点</span>
29
+ </div>
30
+ </div>
31
+
32
+ <!-- 自定义UI插槽 -->
33
+ <div class="custom-ui-slot">
34
+ <slot name="customUI" :map="map" :T="T" :isMapReady="isMapReady" :trackInfo="trackInfo"></slot>
35
+ </div>
36
+
37
+ <!-- 自定义弹窗插槽 -->
38
+ <slot name="popup" :isOpen="isPopupOpen" :position="popupPosition" :data="popupData" :closePopup="closeInfoWindow"></slot>
39
+ </div>
40
+ </template>
41
+
42
+ <script setup lang="ts">
43
+ import { ref, onMounted, onBeforeUnmount, watch, shallowRef, computed, nextTick } from "vue";
44
+
45
+ // ==================== 类型定义 ====================
46
+ /** 经纬度坐标 */
47
+ export interface LngLat {
48
+ lng: number;
49
+ lat: number;
50
+ }
51
+
52
+ /** 标准化轨迹点 */
53
+ export interface TrackPoint extends LngLat {
54
+ speed?: number;
55
+ time?: number;
56
+ }
57
+
58
+ /** 原始轨迹点(支持数组或对象格式) */
59
+ export type RawTrackPoint = [number, number] | [number, number, number] | LngLat;
60
+
61
+ /** 标记样式配置 */
62
+ export interface MarkerStyle {
63
+ url?: string;
64
+ size?: { width: number; height: number };
65
+ anchor?: { x: number; y: number };
66
+ label?: string;
67
+ labelColor?: string;
68
+ labelSize?: number;
69
+ id?: string;
70
+ }
71
+
72
+ /** 标记配置 */
73
+ export interface MarkerOptions {
74
+ position: [number, number];
75
+ title?: string;
76
+ icon?: string;
77
+ iconSize?: { width: number; height: number };
78
+ iconOffset?: { x: number; y: number };
79
+ label?: string;
80
+ labelStyle?: Record<string, string>;
81
+ draggable?: boolean;
82
+ autoShowInfo?: boolean;
83
+ infoContent?: string;
84
+ extData?: Record<string, any>;
85
+ customStyle?: MarkerStyle;
86
+ }
87
+
88
+ /** 线配置 */
89
+ export interface PolylineOptions {
90
+ path: [number, number][];
91
+ color?: string;
92
+ weight?: number;
93
+ opacity?: number;
94
+ lineDash?: number[];
95
+ extData?: Record<string, any>;
96
+ }
97
+
98
+ /** 多边形配置 */
99
+ export interface PolygonOptions {
100
+ paths: [number, number][][];
101
+ fillColor?: string;
102
+ fillOpacity?: number;
103
+ strokeColor?: string;
104
+ strokeWeight?: number;
105
+ extData?: Record<string, any>;
106
+ }
107
+
108
+ /** 圆形配置 */
109
+ export interface CircleOptions {
110
+ center: [number, number];
111
+ radius: number;
112
+ fillColor?: string;
113
+ fillOpacity?: number;
114
+ strokeColor?: string;
115
+ strokeWeight?: number;
116
+ extData?: Record<string, any>;
117
+ }
118
+
119
+ /** 热力图数据点 */
120
+ export interface HeatmapDataPoint {
121
+ lng: number;
122
+ lat: number;
123
+ count: number;
124
+ }
125
+
126
+ /** 聚合点配置 */
127
+ export interface ClusterPoint {
128
+ position: [number, number];
129
+ title?: string;
130
+ extData?: Record<string, any>;
131
+ customStyle?: MarkerStyle;
132
+ }
133
+
134
+ /** 聚合样式配置 */
135
+ export interface ClusterStyle {
136
+ url?: string;
137
+ size?: { width: number; height: number };
138
+ textColor?: string;
139
+ textSize?: number;
140
+ }
141
+
142
+ /** 轨迹纠偏信息 */
143
+ export interface CorrectionInfo {
144
+ corrected: boolean;
145
+ correctedCount: number;
146
+ originalCount: number;
147
+ }
148
+
149
+ /** 轨迹信息 */
150
+ export interface TrackInfo {
151
+ currentIndex: number;
152
+ totalPoints: number;
153
+ progress: number;
154
+ remainingDistance: number;
155
+ totalDistance: number;
156
+ isPlaying: boolean;
157
+ }
158
+
159
+ /** 地图控件配置 */
160
+ export interface ControlsConfig {
161
+ zoom?: boolean;
162
+ scale?: boolean;
163
+ overview?: boolean;
164
+ }
165
+
166
+ /** 默认样式配置 */
167
+ export interface DefaultStyles {
168
+ marker: { icon: string; offset: [number, number] };
169
+ polyline: { color: string; weight: number; opacity: number };
170
+ polygon: { fillColor: string; fillOpacity: number; strokeColor: string; strokeWeight: number };
171
+ cluster: { url: string; size: { width: number; height: number }; textColor: string; textSize: number };
172
+ }
173
+
174
+ /** 地图初始化配置 */
175
+ export interface MapOptions {
176
+ center?: [number, number];
177
+ zoom?: number;
178
+ maxZoom?: number;
179
+ minZoom?: number;
180
+ viewMode?: "2D" | "3D";
181
+ }
182
+
183
+ // 底图类型映射
184
+ const baseLayerUrls = {
185
+ vec: { base: "vec_w", annot: "cva_w" },
186
+ img: { base: "img_w", annot: "cia_w" },
187
+ ter: { base: "ter_w", annot: "cta_w" },
188
+ };
189
+
190
+ // ==================== Props 配置 ====================
191
+ const props = defineProps({
192
+ // 天地图API密钥(必填)
193
+ tk: { type: String, required: true },
194
+ // 地图类型:'vec'矢量, 'img'影像, 'ter'地形
195
+ mapType: { type: String, default: "vec", validator: (val: string) => ["vec", "img", "ter"].includes(val) },
196
+ // 是否显示注记层
197
+ showAnnotation: { type: Boolean, default: true },
198
+ // 地图初始化配置
199
+ mapOptions: {
200
+ type: Object as () => MapOptions,
201
+ default: () => ({
202
+ center: [116.397428, 39.90923],
203
+ zoom: 12,
204
+ maxZoom: 18,
205
+ minZoom: 3,
206
+ viewMode: "2D",
207
+ }),
208
+ },
209
+ // 是否启用地图控件
210
+ controls: {
211
+ type: Object as () => ControlsConfig,
212
+ default: () => ({ zoom: true, scale: true, overview: false }),
213
+ },
214
+ // 是否启用随机二级域名
215
+ randomSubdomain: { type: Boolean, default: true },
216
+ // 默认样式
217
+ defaultStyles: {
218
+ type: Object as () => DefaultStyles,
219
+ default: () => ({
220
+ marker: { icon: "", offset: [-15, -30] },
221
+ polyline: { color: "#3366FF", weight: 4, opacity: 0.8 },
222
+ polygon: { fillColor: "#00b0ff", fillOpacity: 0.4, strokeColor: "#0088ff", strokeWeight: 2 },
223
+ cluster: { url: "https://api.tianditu.gov.cn/v4.0/images/marker.png", size: { width: 40, height: 40 }, textColor: "#fff", textSize: 14 },
224
+ }),
225
+ },
226
+
227
+ // ========== 轨迹相关配置 ==========
228
+ trackMode: { type: Boolean, default: false },
229
+ originalTrackData: { type: Array as () => RawTrackPoint[], default: () => [] },
230
+ showTrackPanel: { type: Boolean, default: true },
231
+ enableCorrection: { type: Boolean, default: true },
232
+ maxGapDistance: { type: Number, default: 100 },
233
+ simplifyTolerance: { type: Number, default: 5 },
234
+ autoFitBounds: { type: Boolean, default: true },
235
+ autoRotateCar: { type: Boolean, default: true },
236
+ speed: { type: Number, default: 500 },
237
+ carIcon: { type: String, default: "https://api.tianditu.gov.cn/v4.0/images/car.png" },
238
+ carIconSize: { type: Object as () => { width: number; height: number }, default: () => ({ width: 40, height: 40 }) },
239
+ trackColor: { type: String, default: "#FF6B6B" },
240
+ trackWidth: { type: Number, default: 5 },
241
+ showStartEndMarkers: { type: Boolean, default: true },
242
+ autoPlay: { type: Boolean, default: false },
243
+ defaultFollowCar: { type: Boolean, default: true },
244
+ });
245
+
246
+ // ==================== Emits ====================
247
+ const emit = defineEmits<{
248
+ (e: "ready", payload: { map: any; T: any }): void;
249
+ (e: "click", payload: LngLat): void;
250
+ (e: "rightClick", payload: LngLat): void;
251
+ (e: "doubleClick", payload: LngLat): void;
252
+ (e: "zoomEnd", payload: { zoom: number }): void;
253
+ (e: "moveEnd", payload: { center: [number, number] }): void;
254
+ (e: "markerClick", payload: { marker: any; position: [number, number]; title?: string; extData?: Record<string, any> }): void;
255
+ (e: "markerDragEnd", payload: { marker: any; position: [number, number]; extData?: Record<string, any> }): void;
256
+ (e: "polylineClick", payload: { polyline: any; path: [number, number][]; extData?: Record<string, any> }): void;
257
+ (e: "polygonClick", payload: { polygon: any; paths: [number, number][][]; extData?: Record<string, any> }): void;
258
+ (e: "circleClick", payload: { circle: any; center: [number, number]; radius: number; extData?: Record<string, any> }): void;
259
+ (e: "infoWindowClose"): void;
260
+ (e: "clusterClick", payload: { cluster: any; points: any[] }): void;
261
+ (e: "trackReady", payload: { map: any; T: any; trackInfo: TrackInfo }): void;
262
+ (e: "trackPlay"): void;
263
+ (e: "trackPause"): void;
264
+ (e: "trackStop"): void;
265
+ (e: "trackComplete", payload: { totalDistance: number; totalPoints: number }): void;
266
+ (e: "trackPointChange", payload: { index: number; point: TrackPoint; remainingDistance: number; totalDistance: number }): void;
267
+ (e: "trackCorrectionComplete", payload: { originalCount: number; correctedCount: number; finalCount: number }): void;
268
+ }>();
269
+
270
+ // ==================== 响应式数据 ====================
271
+ const mapContainerRef = ref<HTMLElement | null>(null);
272
+ const map = shallowRef<any>(null);
273
+ const T = shallowRef<any>(null);
274
+ const isMapReady = ref(false);
275
+ const isLoading = ref(false);
276
+ let currentMapType = props.mapType;
277
+
278
+ // 覆盖物存储
279
+ const markers = ref<any[]>([]);
280
+ const polylines = ref<any[]>([]);
281
+ const polygons = ref<any[]>([]);
282
+ const circles = ref<any[]>([]);
283
+ let markerCluster: any = null;
284
+ let heatmap: any = null;
285
+ let geocoder: any = null;
286
+ let infoWindow: any = null;
287
+
288
+ // 弹窗相关
289
+ const isPopupOpen = ref(false);
290
+ const popupPosition = ref<LngLat>({ lng: 0, lat: 0 });
291
+ const popupData = ref<any>(null);
292
+
293
+ // 轨迹相关
294
+ const trackLine = shallowRef<any>(null);
295
+ const carMarker = shallowRef<any>(null);
296
+ const startMarker = shallowRef<any>(null);
297
+ const endMarker = shallowRef<any>(null);
298
+ const animationTimer = ref<ReturnType<typeof setTimeout> | null>(null);
299
+ const isPlaying = ref(false);
300
+ const followCarMode = ref(props.defaultFollowCar);
301
+ const currentIndex = ref(0);
302
+ const progressPercent = ref(0);
303
+
304
+ // 轨迹数据
305
+ const rawPoints = ref<TrackPoint[]>([]);
306
+ const displayPoints = ref<TrackPoint[]>([]);
307
+ const distances = ref<number[]>([]);
308
+ const totalDistance = ref(0);
309
+ const remainingDistance = ref(0);
310
+ const segmentAngles = ref<number[]>([]);
311
+ const correctionInfo = ref<CorrectionInfo>({ corrected: false, correctedCount: 0, originalCount: 0 });
312
+
313
+ // 轨迹信息计算属性
314
+ const trackInfo = computed<TrackInfo>(() => ({
315
+ currentIndex: currentIndex.value,
316
+ totalPoints: displayPoints.value.length,
317
+ progress: progressPercent.value,
318
+ remainingDistance: remainingDistance.value,
319
+ totalDistance: totalDistance.value,
320
+ isPlaying: isPlaying.value,
321
+ }));
322
+
323
+ // 加载状态
324
+ let loadPromise: Promise<any> | null = null;
325
+
326
+ // ==================== SDK加载 ====================
327
+ const loadTiandituSDK = (): Promise<any> => {
328
+ if (loadPromise) return loadPromise;
329
+ if (typeof window !== "undefined" && (window as any).T) {
330
+ T.value = (window as any).T;
331
+ return Promise.resolve(T.value);
332
+ }
333
+
334
+ isLoading.value = true;
335
+ loadPromise = new Promise((resolve, reject) => {
336
+ const script = document.createElement("script");
337
+ script.src = `https://api.tianditu.gov.cn/api?v=4.0&tk=${props.tk}`;
338
+ script.onload = () => {
339
+ if ((window as any).T) {
340
+ T.value = (window as any).T;
341
+ isLoading.value = false;
342
+ resolve(T.value);
343
+ } else {
344
+ reject(new Error("天地图SDK加载失败"));
345
+ }
346
+ };
347
+ script.onerror = () => {
348
+ isLoading.value = false;
349
+ reject(new Error("天地图SDK加载失败,请检查网络或API Key"));
350
+ };
351
+ document.head.appendChild(script);
352
+ // 聚合插件
353
+ const script1 = document.createElement("script");
354
+ script1.src = `https://api.tianditu.gov.cn/api?v=4.0&tk=${props.tk}&plugin=MarkerClusterer`;
355
+ document.head.appendChild(script1);
356
+ // 热力图插件
357
+ const script2 = document.createElement("script");
358
+ script2.src = `https://api.tianditu.gov.cn/api?v=4.0&tk=${props.tk}&plugin=Heatmap`;
359
+ document.head.appendChild(script2);
360
+ });
361
+
362
+ return loadPromise;
363
+ };
364
+
365
+ // ==================== 工具函数 ====================
366
+ /** 获取随机子域名 */
367
+ const getSubdomain = (): string => {
368
+ if (!props.randomSubdomain) return "t0";
369
+ const randomNum = Math.floor(Math.random() * 7);
370
+ return `t${randomNum}`;
371
+ };
372
+
373
+ /** 计算两点之间的距离(米)- Haversine公式 */
374
+ const calculateDistance = (p1: LngLat, p2: LngLat): number => {
375
+ const R = 6371000;
376
+ const lat1 = (p1.lat * Math.PI) / 180;
377
+ const lat2 = (p2.lat * Math.PI) / 180;
378
+ const deltaLat = ((p2.lat - p1.lat) * Math.PI) / 180;
379
+ const deltaLng = ((p2.lng - p1.lng) * Math.PI) / 180;
380
+ const a = Math.sin(deltaLat / 2) ** 2 + Math.cos(lat1) * Math.cos(lat2) * Math.sin(deltaLng / 2) ** 2;
381
+ return R * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
382
+ };
383
+
384
+ /** 计算两点之间的方位角(度) */
385
+ const calculateBearing = (p1: LngLat, p2: LngLat): number => {
386
+ const lat1 = (p1.lat * Math.PI) / 180;
387
+ const lat2 = (p2.lat * Math.PI) / 180;
388
+ const deltaLng = ((p2.lng - p1.lng) * Math.PI) / 180;
389
+ const x = Math.sin(deltaLng) * Math.cos(lat2);
390
+ const y = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(deltaLng);
391
+ let bearing = (Math.atan2(x, y) * 180) / Math.PI;
392
+ return (bearing + 360) % 360;
393
+ };
394
+
395
+ /** 标准化轨迹点 */
396
+ const normalizePoint = (point: RawTrackPoint |any): TrackPoint => {
397
+ if (Array.isArray(point)) {
398
+ return {
399
+ lng: point[0],
400
+ lat: point[1],
401
+ speed: point[2] || 30,
402
+ time: point[3] || 0,
403
+ };
404
+ }
405
+ return {
406
+ lng: point.lng,
407
+ lat: point.lat,
408
+ speed: (point as any).speed || 30,
409
+ time: (point as any).time || 0,
410
+ };
411
+ };
412
+
413
+ /** 将经纬度转换为LngLat对象 */
414
+ const toLngLat = (lng: number, lat: number): any => {
415
+ if (!T.value) return null;
416
+ return new T.value.LngLat(lng, lat);
417
+ };
418
+
419
+ /** 道格拉斯-普克抽稀算法 */
420
+ const douglasPeucker = (points: TrackPoint[], tolerance: number): TrackPoint[] => {
421
+ if (points.length <= 2) return points;
422
+
423
+ let maxDist = 0;
424
+ let maxIdx = 0;
425
+
426
+ const perpendicularDistance = (p: TrackPoint, p1: TrackPoint, p2: TrackPoint): number => {
427
+ const area = Math.abs((p2.lng - p1.lng) * (p1.lat - p.lat) - (p1.lng - p.lng) * (p2.lat - p1.lat));
428
+ const bottom = Math.hypot(p2.lng - p1.lng, p2.lat - p1.lat);
429
+ return bottom === 0 ? Math.hypot(p.lng - p1.lng, p.lat - p1.lat) : area / bottom;
430
+ };
431
+
432
+ for (let i = 1; i < points.length - 1; i++) {
433
+ const dist = perpendicularDistance(points[i], points[0], points[points.length - 1]);
434
+ if (dist > maxDist) {
435
+ maxDist = dist;
436
+ maxIdx = i;
437
+ }
438
+ }
439
+
440
+ if (maxDist > tolerance) {
441
+ const left = douglasPeucker(points.slice(0, maxIdx + 1), tolerance);
442
+ const right = douglasPeucker(points.slice(maxIdx), tolerance);
443
+ return left.slice(0, -1).concat(right);
444
+ }
445
+
446
+ return [points[0], points[points.length - 1]];
447
+ };
448
+
449
+ /** 卡尔曼滤波平滑轨迹点 */
450
+ const kalmanFilter = (points: TrackPoint[]): TrackPoint[] => {
451
+ if (points.length < 3) return points;
452
+ const Q = 0.01;
453
+ const R = 0.1;
454
+
455
+ const filtered: TrackPoint[] = [points[0]];
456
+
457
+ for (let i = 1; i < points.length - 1; i++) {
458
+ const prev = filtered[i - 1];
459
+ const curr = points[i];
460
+ const K = Q / (Q + R);
461
+ filtered.push({
462
+ lng: prev.lng + K * (curr.lng - prev.lng),
463
+ lat: prev.lat + K * (curr.lat - prev.lat),
464
+ speed: curr.speed,
465
+ time: curr.time,
466
+ });
467
+ }
468
+
469
+ filtered.push(points[points.length - 1]);
470
+ return filtered;
471
+ };
472
+
473
+ /** 轨迹纠偏 */
474
+ const correctTrack = (points: TrackPoint[]): TrackPoint[] => {
475
+ if (!props.enableCorrection) return points;
476
+
477
+ let corrected = [...points];
478
+ let correctedCount = 0;
479
+
480
+ // 断点检测
481
+ const segments: TrackPoint[][] = [];
482
+ let currentSegment: TrackPoint[] = [corrected[0]];
483
+
484
+ for (let i = 1; i < corrected.length; i++) {
485
+ const dist = calculateDistance(corrected[i - 1], corrected[i]);
486
+ if (dist > props.maxGapDistance && currentSegment.length > 0) {
487
+ segments.push(currentSegment);
488
+ currentSegment = [corrected[i]];
489
+ } else {
490
+ currentSegment.push(corrected[i]);
491
+ }
492
+ }
493
+ if (currentSegment.length > 0) segments.push(currentSegment);
494
+
495
+ // 抽稀和平滑
496
+ const result: TrackPoint[] = [];
497
+ for (const seg of segments) {
498
+ if (seg.length < 2) {
499
+ result.push(...seg);
500
+ } else {
501
+ const simplified = douglasPeucker(seg, props.simplifyTolerance);
502
+ correctedCount += seg.length - simplified.length;
503
+ result.push(...kalmanFilter(simplified));
504
+ }
505
+ }
506
+
507
+ correctionInfo.value = {
508
+ corrected: props.enableCorrection,
509
+ correctedCount,
510
+ originalCount: points.length,
511
+ };
512
+
513
+ emit("trackCorrectionComplete", {
514
+ originalCount: points.length,
515
+ correctedCount,
516
+ finalCount: result.length,
517
+ });
518
+
519
+ return result;
520
+ };
521
+
522
+ /** 处理轨迹数据 */
523
+ const processTrackData = async (): Promise<void> => {
524
+ if (!props.trackMode || !props.originalTrackData.length) return;
525
+
526
+ rawPoints.value = props.originalTrackData.map(normalizePoint);
527
+ let processed = correctTrack(rawPoints.value);
528
+ displayPoints.value = processed;
529
+
530
+ // 计算距离和角度
531
+ distances.value = [];
532
+ segmentAngles.value = [];
533
+ totalDistance.value = 0;
534
+
535
+ for (let i = 0; i < displayPoints.value.length - 1; i++) {
536
+ const dist = calculateDistance(displayPoints.value[i], displayPoints.value[i + 1]);
537
+ distances.value.push(dist);
538
+ totalDistance.value += dist;
539
+ segmentAngles.value.push(calculateBearing(displayPoints.value[i], displayPoints.value[i + 1]));
540
+ }
541
+
542
+ remainingDistance.value = totalDistance.value;
543
+ };
544
+
545
+ // ==================== 地图初始化 ====================
546
+ /** 加载底图图层 */
547
+ const loadBaseLayers = (): void => {
548
+ if (!map.value || !T.value) return;
549
+
550
+ const layerConfig = baseLayerUrls[currentMapType as keyof typeof baseLayerUrls];
551
+ if (!layerConfig) return;
552
+
553
+ // 底图图层
554
+ const baseUrl = `https://${getSubdomain()}.tianditu.gov.cn/${layerConfig.base}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${layerConfig.base}&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=${props.tk}`;
555
+ const baseLayer = new T.value.TileLayer(baseUrl, {
556
+ minZoom: props.mapOptions.minZoom,
557
+ maxZoom: props.mapOptions.maxZoom,
558
+ });
559
+ map.value.addLayer(baseLayer);
560
+
561
+ // 注记图层
562
+ if (props.showAnnotation) {
563
+ const annotUrl = `https://${getSubdomain()}.tianditu.gov.cn/${layerConfig.annot}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${layerConfig.annot}&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=${props.tk}`;
564
+ const annotLayer = new T.value.TileLayer(annotUrl, {
565
+ minZoom: props.mapOptions.minZoom,
566
+ maxZoom: props.mapOptions.maxZoom,
567
+ });
568
+ map.value.addLayer(annotLayer);
569
+ }
570
+ };
571
+
572
+ /** 添加手动缩放控件(天地图v4.0控件兼容) */
573
+ const addManualControls = (): void => {
574
+ if (!mapContainerRef.value) return;
575
+
576
+ if (props.controls.zoom) {
577
+ const zoomContainer = document.createElement("div");
578
+ zoomContainer.className = "tdt-zoom-control";
579
+ zoomContainer.style.cssText = `
580
+ position: absolute;
581
+ right: 10px;
582
+ top: 10px;
583
+ z-index: 1000;
584
+ background: white;
585
+ border-radius: 4px;
586
+ box-shadow: 0 2px 6px rgba(0,0,0,0.3);
587
+ display: flex;
588
+ flex-direction: column;
589
+ `;
590
+
591
+ const zoomInBtn = document.createElement("button");
592
+ zoomInBtn.innerHTML = "+";
593
+ zoomInBtn.style.cssText = `
594
+ width: 30px;
595
+ height: 30px;
596
+ border: none;
597
+ border-bottom: 1px solid #ccc;
598
+ background: white;
599
+ cursor: pointer;
600
+ font-size: 18px;
601
+ font-weight: bold;
602
+ border-radius: 4px 4px 0 0;
603
+ `;
604
+ zoomInBtn.onclick = () => {
605
+ const currentZoom = map.value.getZoom();
606
+ map.value.setZoom(currentZoom + 1);
607
+ };
608
+
609
+ const zoomOutBtn = document.createElement("button");
610
+ zoomOutBtn.innerHTML = "-";
611
+ zoomOutBtn.style.cssText = `
612
+ width: 30px;
613
+ height: 30px;
614
+ border: none;
615
+ background: white;
616
+ cursor: pointer;
617
+ font-size: 18px;
618
+ font-weight: bold;
619
+ border-radius: 0 0 4px 4px;
620
+ `;
621
+ zoomOutBtn.onclick = () => {
622
+ const currentZoom = map.value.getZoom();
623
+ map.value.setZoom(currentZoom - 1);
624
+ };
625
+
626
+ zoomContainer.appendChild(zoomInBtn);
627
+ zoomContainer.appendChild(zoomOutBtn);
628
+ mapContainerRef.value.appendChild(zoomContainer);
629
+ }
630
+
631
+ if (props.controls.scale) {
632
+ const scaleContainer = document.createElement("div");
633
+ scaleContainer.className = "tdt-scale-control";
634
+ scaleContainer.style.cssText = `
635
+ position: absolute;
636
+ bottom: 20px;
637
+ left: 20px;
638
+ z-index: 1000;
639
+ background: rgba(255,255,255,0.8);
640
+ padding: 4px 8px;
641
+ border-radius: 4px;
642
+ font-size: 12px;
643
+ font-family: monospace;
644
+ box-shadow: 0 1px 3px rgba(0,0,0,0.2);
645
+ `;
646
+
647
+ const updateScale = () => {
648
+ const zoom = map.value.getZoom();
649
+ const scale = Math.pow(2, 12 - zoom);
650
+ scaleContainer.innerHTML = `1:${Math.round(scale * 100000)}`;
651
+ };
652
+
653
+ updateScale();
654
+ map.value.addEventListener("zoomend", updateScale);
655
+ map.value.addEventListener("moveend", updateScale);
656
+ mapContainerRef.value.appendChild(scaleContainer);
657
+ }
658
+ };
659
+
660
+ const initMap = async (): Promise<void> => {
661
+ if(map.value){
662
+ map.value?.destroy && map.value.destroy()
663
+ }
664
+ try {
665
+ await loadTiandituSDK();
666
+ if (!mapContainerRef.value) return;
667
+
668
+ const center = toLngLat(props.mapOptions.center![0], props.mapOptions.center![1]);
669
+
670
+ map.value = new T.value.Map(mapContainerRef.value, {
671
+ center: center,
672
+ zoom: props.mapOptions.zoom,
673
+ maxZoom: props.mapOptions.maxZoom,
674
+ minZoom: props.mapOptions.minZoom,
675
+ viewMode: props.mapOptions.viewMode,
676
+ crs: "EPSG:4326",
677
+ });
678
+
679
+ // 加载底图
680
+ loadBaseLayers();
681
+
682
+ // 添加手动控件(天地图v4.0没有内置控件,需要手动添加)
683
+ addManualControls();
684
+
685
+ // 绑定地图事件
686
+ map.value.addEventListener("click", (e: any) => {
687
+ emit("click", { lng: e.lnglat.lng, lat: e.lnglat.lat });
688
+ });
689
+ map.value.addEventListener("rightclick", (e: any) => {
690
+ emit("rightClick", { lng: e.lnglat.lng, lat: e.lnglat.lat });
691
+ });
692
+ map.value.addEventListener("dblclick", (e: any) => {
693
+ emit("doubleClick", { lng: e.lnglat.lng, lat: e.lnglat.lat });
694
+ });
695
+ map.value.addEventListener("zoomend", () => {
696
+ emit("zoomEnd", { zoom: map.value.getZoom() });
697
+ });
698
+ map.value.addEventListener("moveend", () => {
699
+ const center = map.value.getCenter();
700
+ emit("moveEnd", { center: [center.lng, center.lat] });
701
+ });
702
+
703
+ // 初始化服务
704
+ geocoder = new T.value.Geocoder();
705
+
706
+ // 处理轨迹
707
+ if (props.trackMode) {
708
+ await processTrackData();
709
+ drawTrackLine();
710
+ if (props.showStartEndMarkers) addStartEndMarkers();
711
+ addCarMarker();
712
+ if (props.autoFitBounds) fitTrackBounds();
713
+ if (props.autoPlay) {
714
+ await nextTick();
715
+ playTrack();
716
+ }
717
+ emit("trackReady", { map: map.value, T: T.value, trackInfo: trackInfo.value });
718
+ }
719
+
720
+ window.addEventListener("resize", () => map.value?.resize());
721
+ isMapReady.value = true;
722
+ emit("ready", { map: map.value, T: T.value });
723
+ } catch (error) {
724
+ console.error("天地图初始化失败:", error);
725
+ }
726
+ };
727
+
728
+ // ==================== 轨迹方法 ====================
729
+ /** 绘制轨迹线 */
730
+ const drawTrackLine = (): void => {
731
+ if (trackLine.value) map.value.removeOverLay(trackLine.value);
732
+ if (!displayPoints.value.length) return;
733
+
734
+ const points = displayPoints.value.map(p => toLngLat(p.lng, p.lat));
735
+ trackLine.value = new T.value.Polyline(points, {
736
+ color: props.trackColor,
737
+ weight: props.trackWidth,
738
+ opacity: 0.9,
739
+ });
740
+ trackLine.value.addTo(map.value);
741
+ };
742
+
743
+ /** 添加起点终点标记 */
744
+ const addStartEndMarkers = (): void => {
745
+ if (startMarker.value) map.value.removeOverLay(startMarker.value);
746
+ if (endMarker.value) map.value.removeOverLay(endMarker.value);
747
+ if (!displayPoints.value.length) return;
748
+
749
+ startMarker.value = new T.value.Marker(toLngLat(displayPoints.value[0].lng, displayPoints.value[0].lat), {
750
+ title: "起点",
751
+ });
752
+ endMarker.value = new T.value.Marker(toLngLat(displayPoints.value[displayPoints.value.length - 1].lng, displayPoints.value[displayPoints.value.length - 1].lat), {
753
+ title: "终点",
754
+ });
755
+ startMarker.value.addTo(map.value);
756
+ endMarker.value.addTo(map.value);
757
+ };
758
+
759
+ /** 添加小车标记 */
760
+ const addCarMarker = (): void => {
761
+ if (carMarker.value) map.value.removeOverLay(carMarker.value);
762
+ if (!displayPoints.value.length) return;
763
+
764
+ carMarker.value = new T.value.Marker(toLngLat(displayPoints.value[0].lng, displayPoints.value[0].lat), {
765
+ icon: new T.value.Icon({
766
+ iconUrl: props.carIcon,
767
+ iconSize: new T.value.Point(props.carIconSize.width, props.carIconSize.height),
768
+ }),
769
+ title: "车辆",
770
+ });
771
+ map.value.addOverLay(carMarker.value);
772
+ };
773
+
774
+ /** 更新小车位置和方向 */
775
+ const updateCarPosition = (idx: number): void => {
776
+ if (!carMarker.value || idx >= displayPoints.value.length) return;
777
+
778
+ const point = displayPoints.value[idx];
779
+ carMarker.value.setPosition(toLngLat(point.lng, point.lat));
780
+
781
+ // 天地图旋转图标需要重新设置图标样式
782
+ if (props.autoRotateCar && idx < segmentAngles.value.length) {
783
+ carMarker.value.setIcon(new T.value.Icon({
784
+ iconUrl: props.carIcon,
785
+ iconSize: new T.value.Point(props.carIconSize.width, props.carIconSize.height),
786
+ rotation: segmentAngles.value[idx],
787
+ }));
788
+ }
789
+
790
+ // 更新剩余距离
791
+ let remaining = 0;
792
+ for (let i = idx; i < distances.value.length; i++) {
793
+ remaining += distances.value[i];
794
+ }
795
+ remainingDistance.value = remaining;
796
+
797
+ emit("trackPointChange", {
798
+ index: idx,
799
+ point,
800
+ remainingDistance: remainingDistance.value,
801
+ totalDistance: totalDistance.value,
802
+ });
803
+ };
804
+
805
+ /** 自动调整轨迹视野 */
806
+ const fitTrackBounds = (): void => {
807
+ if (!map.value || !displayPoints.value.length) return;
808
+
809
+ const bounds = new T.value.LngLatBounds();
810
+ displayPoints.value.forEach(p => bounds.extend(toLngLat(p.lng, p.lat)));
811
+ map.value.setViewport(bounds, { zoomFactor: 0.1, delay: 0, padding: [50, 50, 50, 50] });
812
+ };
813
+
814
+ /** 跟随小车视野 */
815
+ const followCar = (): void => {
816
+ if (!map.value || !carMarker.value || !followCarMode.value) return;
817
+ const pos = carMarker.value.getPosition();
818
+ map.value.setCenter(pos);
819
+ };
820
+
821
+ /** 播放轨迹动画 */
822
+ const playTrack = (): void => {
823
+ if (isPlaying.value || !displayPoints.value.length) return;
824
+ if (currentIndex.value >= displayPoints.value.length - 1) resetTrack();
825
+
826
+ isPlaying.value = true;
827
+ emit("trackPlay");
828
+
829
+ const playStep = (): void => {
830
+ if (!isPlaying.value) return;
831
+
832
+ if (currentIndex.value < displayPoints.value.length - 1) {
833
+ currentIndex.value++;
834
+ updateCarPosition(currentIndex.value);
835
+ progressPercent.value = (currentIndex.value / (displayPoints.value.length - 1)) * 100;
836
+
837
+ if (followCarMode.value) followCar();
838
+
839
+ const pointSpeed = displayPoints.value[currentIndex.value]?.speed || 30;
840
+ const delay = props.speed / (pointSpeed / 30);
841
+ animationTimer.value = setTimeout(playStep, delay);
842
+ } else {
843
+ pauseTrack();
844
+ emit("trackComplete", {
845
+ totalDistance: totalDistance.value,
846
+ totalPoints: displayPoints.value.length,
847
+ });
848
+ }
849
+ };
850
+
851
+ playStep();
852
+ };
853
+
854
+ /** 暂停轨迹动画 */
855
+ const pauseTrack = (): void => {
856
+ if (animationTimer.value) {
857
+ clearTimeout(animationTimer.value);
858
+ animationTimer.value = null;
859
+ }
860
+ isPlaying.value = false;
861
+ emit("trackPause");
862
+ };
863
+
864
+ /** 停止轨迹动画 */
865
+ const stopTrack = (): void => {
866
+ pauseTrack();
867
+ currentIndex.value = 0;
868
+ progressPercent.value = 0;
869
+ updateCarPosition(0);
870
+ emit("trackStop");
871
+ };
872
+
873
+ /** 重置轨迹动画 */
874
+ const resetTrack = (): void => {
875
+ pauseTrack();
876
+ currentIndex.value = 0;
877
+ progressPercent.value = 0;
878
+ updateCarPosition(0);
879
+ if (props.autoFitBounds) fitTrackBounds();
880
+ };
881
+
882
+ /** 跳转到指定进度 */
883
+ const seekTo = (e: Event): void => {
884
+ const target = e.target as HTMLInputElement;
885
+ const percent = parseFloat(target.value);
886
+ const targetIdx = Math.floor((percent / 100) * (displayPoints.value.length - 1));
887
+ const wasPlaying = isPlaying.value;
888
+
889
+ if (wasPlaying) pauseTrack();
890
+ currentIndex.value = Math.min(targetIdx, displayPoints.value.length - 1);
891
+ progressPercent.value = percent;
892
+ updateCarPosition(currentIndex.value);
893
+ if (wasPlaying) playTrack();
894
+ };
895
+
896
+ /** 切换轨迹纠偏 */
897
+ const toggleCorrection = (): void => {
898
+ (props as any).enableCorrection = !props.enableCorrection;
899
+ processTrackData().then(() => {
900
+ drawTrackLine();
901
+ addStartEndMarkers();
902
+ addCarMarker();
903
+ updateCarPosition(currentIndex.value);
904
+ if (props.autoFitBounds) fitTrackBounds();
905
+ });
906
+ };
907
+
908
+ /** 切换跟随小车 */
909
+ const toggleFollowCar = (): void => {
910
+ followCarMode.value = !followCarMode.value;
911
+ };
912
+
913
+ // ==================== 通用地图方法 ====================
914
+ /** 添加单个标记 */
915
+ const addMarker = (options: MarkerOptions): any => {
916
+ if (!map.value) return null;
917
+
918
+ const { position, title = "", icon, iconSize = { width: 30, height: 30 }, iconOffset = { x: -15, y: -15 }, label, labelStyle, draggable = false, autoShowInfo = false, infoContent = "", extData = {}, customStyle } = options;
919
+
920
+ let markerIcon = null;
921
+ if (customStyle?.url) {
922
+ markerIcon = new T.value.Icon({
923
+ iconUrl: customStyle.url,
924
+ iconSize: new T.value.Point(customStyle.size?.width || iconSize.width, customStyle.size?.height || iconSize.height),
925
+ iconAnchor: customStyle.anchor ? new T.value.Point(customStyle.anchor.x, customStyle.anchor.y) : new T.value.Point(iconOffset.x, iconOffset.y),
926
+ });
927
+ } else if (icon) {
928
+ markerIcon = new T.value.Icon({
929
+ iconUrl: icon,
930
+ iconSize: new T.value.Point(iconSize.width, iconSize.height),
931
+ iconAnchor: new T.value.Point(iconOffset.x, iconOffset.y),
932
+ });
933
+ }
934
+
935
+ const marker = new T.value.Marker(toLngLat(position[0], position[1]), {
936
+ title: title,
937
+ icon: markerIcon,
938
+ });
939
+ marker.extData = extData;
940
+
941
+ if (label || customStyle?.label) {
942
+ const labelText = label || customStyle?.label || "";
943
+ const labelObj = new T.value.Label(labelText, { position: toLngLat(position[0], position[1]) });
944
+ if (customStyle?.labelColor) {
945
+ labelObj.setStyle({ color: customStyle.labelColor });
946
+ }
947
+ if (labelStyle) {
948
+ labelObj.setStyle(labelStyle);
949
+ }
950
+ marker.setLabel(labelObj);
951
+ }
952
+
953
+ marker.addEventListener("click", () => {
954
+ emit("markerClick", { marker, position, title, extData });
955
+ if (autoShowInfo && infoContent) openInfoWindow(position, infoContent);
956
+ });
957
+
958
+ map.value.addOverLay(marker);
959
+ markers.value.push(marker);
960
+ return marker;
961
+ };
962
+
963
+ /** 批量添加标记 */
964
+ const addMarkers = (markerList: MarkerOptions[]): any[] => {
965
+ return markerList.map(item => addMarker(item)).filter(Boolean);
966
+ };
967
+
968
+ /** 清除所有标记 */
969
+ const clearMarkers = (): void => {
970
+ markers.value.forEach(m => map.value.removeOverLay(m));
971
+ markers.value = [];
972
+ };
973
+
974
+ /** 移除指定标记 */
975
+ const removeMarker = (marker: any): void => {
976
+ const idx = markers.value.findIndex(m => m === marker);
977
+ if (idx !== -1) {
978
+ map.value.removeOverLay(marker);
979
+ markers.value.splice(idx, 1);
980
+ }
981
+ };
982
+
983
+ /** 添加线 */
984
+ const addPolyline = (options: PolylineOptions): any => {
985
+ if (!map.value) return null;
986
+
987
+ const { path, color, weight, opacity, lineDash, extData = {} } = options;
988
+ const styles = props.defaultStyles.polyline;
989
+
990
+ const points = path.map(p => toLngLat(p[0], p[1]));
991
+ const polyline = new T.value.Polyline(points, {
992
+ color: color || styles.color,
993
+ weight: weight || styles.weight,
994
+ opacity: opacity || styles.opacity,
995
+ lineDash: lineDash,
996
+ });
997
+ polyline.extData = extData;
998
+
999
+ polyline.addEventListener("click", () => emit("polylineClick", { polyline, path, extData }));
1000
+ polyline.addTo(map.value);
1001
+ polylines.value.push(polyline);
1002
+ return polyline;
1003
+ };
1004
+
1005
+ /** 清除所有线 */
1006
+ const clearPolylines = (): void => {
1007
+ polylines.value.forEach(l => map.value.removeOverLay(l));
1008
+ polylines.value = [];
1009
+ };
1010
+
1011
+ /** 添加多边形 */
1012
+ const addPolygon = (options: PolygonOptions): any => {
1013
+ if (!map.value) return null;
1014
+
1015
+ const { paths, fillColor, fillOpacity, strokeColor, strokeWeight, extData = {} } = options;
1016
+ const styles = props.defaultStyles.polygon;
1017
+
1018
+ const polygonPaths = paths.map(ring => ring.map(p => toLngLat(p[0], p[1])));
1019
+ const polygon = new T.value.Polygon(polygonPaths, {
1020
+ fillColor: fillColor || styles.fillColor,
1021
+ fillOpacity: fillOpacity || styles.fillOpacity,
1022
+ strokeColor: strokeColor || styles.strokeColor,
1023
+ strokeWeight: strokeWeight || styles.strokeWeight,
1024
+ });
1025
+ polygon.extData = extData;
1026
+
1027
+ polygon.addEventListener("click", () => emit("polygonClick", { polygon, paths, extData }));
1028
+ polygon.addTo(map.value);
1029
+ polygons.value.push(polygon);
1030
+ return polygon;
1031
+ };
1032
+
1033
+ /** 清除所有多边形 */
1034
+ const clearPolygons = (): void => {
1035
+ polygons.value.forEach(p => map.value.removeOverLay(p));
1036
+ polygons.value = [];
1037
+ };
1038
+
1039
+ /** 添加圆形 */
1040
+ const addCircle = (options: CircleOptions): any => {
1041
+ if (!map.value) return null;
1042
+
1043
+ const { center, radius, fillColor, fillOpacity, strokeColor, strokeWeight, extData = {} } = options;
1044
+ const styles = props.defaultStyles.polygon;
1045
+
1046
+ const circle = new T.value.Circle(toLngLat(center[0], center[1]), radius, {
1047
+ fillColor: fillColor || styles.fillColor,
1048
+ fillOpacity: fillOpacity || styles.fillOpacity,
1049
+ strokeColor: strokeColor || styles.strokeColor,
1050
+ strokeWeight: strokeWeight || styles.strokeWeight,
1051
+ });
1052
+ circle.extData = extData;
1053
+
1054
+ circle.addEventListener("click", () => emit("circleClick", { circle, center, radius, extData }));
1055
+ circle.addTo(map.value);
1056
+ circles.value.push(circle);
1057
+ return circle;
1058
+ };
1059
+
1060
+ /** 清除所有圆形 */
1061
+ const clearCircles = (): void => {
1062
+ circles.value.forEach(c => map.value.removeOverLay(c));
1063
+ circles.value = [];
1064
+ };
1065
+
1066
+ /** 清除所有覆盖物 */
1067
+ const clearAllOverlays = (): void => {
1068
+ clearMarkers();
1069
+ clearPolylines();
1070
+ clearPolygons();
1071
+ clearCircles();
1072
+ clearMarkerCluster();
1073
+ removeHeatmap();
1074
+ };
1075
+
1076
+ /** 添加标注聚合(需要引入MarkerClusterer插件) */
1077
+ const addMarkerCluster = (points: ClusterPoint[], options: { gridSize?: number; minClusterSize?: number; maxZoom?: number; styles?: ClusterStyle[] } = {}): any => {
1078
+ if (!map.value) return null;
1079
+
1080
+ if (!(window as any).MarkerClusterer) {
1081
+ console.warn("请先引入MarkerClusterer插件,在index.html中添加: script src='https://api.tianditu.gov.cn/api?v=4.0&tk=您的密钥&plugin=MarkerClusterer'");
1082
+ return null;
1083
+ }
1084
+
1085
+ if (markerCluster) {
1086
+ markerCluster.clearMarkers();
1087
+ }
1088
+
1089
+ const markersList = points.map((point) => {
1090
+ let marker: any;
1091
+ if (point.customStyle?.url) {
1092
+ const icon = new T.value.Icon({
1093
+ iconUrl: point.customStyle.url,
1094
+ iconSize: new T.value.Point(point.customStyle.size?.width || 30, point.customStyle.size?.height || 30),
1095
+ iconAnchor: point.customStyle.anchor ? new T.value.Point(point.customStyle.anchor.x, point.customStyle.anchor.y) : new T.value.Point(15, 30),
1096
+ });
1097
+ marker = new T.value.Marker(toLngLat(point.position[0], point.position[1]), { icon, title: point.title || "" });
1098
+ } else {
1099
+ marker = new T.value.Marker(toLngLat(point.position[0], point.position[1]), { title: point.title || "" });
1100
+ }
1101
+ marker.extData = point.extData || {};
1102
+ return marker;
1103
+ });
1104
+
1105
+ // 聚合样式配置
1106
+ const clusterStyles = options.styles?.map(style => ({
1107
+ url: style.url || props.defaultStyles.cluster.url,
1108
+ size: style.size || props.defaultStyles.cluster.size,
1109
+ textColor: style.textColor || props.defaultStyles.cluster.textColor,
1110
+ textSize: style.textSize || props.defaultStyles.cluster.textSize,
1111
+ }));
1112
+
1113
+ markerCluster = new (window as any).MarkerClusterer(map.value, markersList, {
1114
+ gridSize: options.gridSize || 60,
1115
+ minClusterSize: options.minClusterSize || 2,
1116
+ maxZoom: options.maxZoom || 15,
1117
+ styles: clusterStyles,
1118
+ });
1119
+
1120
+ markerCluster.addEventListener("click", (e: any) => {
1121
+ emit("clusterClick", { cluster: e, points: e.markers });
1122
+ });
1123
+
1124
+ return markerCluster;
1125
+ };
1126
+
1127
+ /** 清除聚合 */
1128
+ const clearMarkerCluster = (): void => {
1129
+ if (markerCluster) {
1130
+ markerCluster.clearMarkers();
1131
+ markerCluster = null;
1132
+ }
1133
+ };
1134
+
1135
+ /** 添加热力图(需要引入Heatmap插件) */
1136
+ const addHeatmap = (data: HeatmapDataPoint[], options: { radius?: number; opacity?: number; gradient?: Record<string, string>; max?: number } = {}): any => {
1137
+ if (!map.value) return null;
1138
+
1139
+ if (!(window as any).HeatmapOverlay) {
1140
+ console.warn("请先引入Heatmap插件,在index.html中添加: script src='https://api.tianditu.gov.cn/api?v=4.0&tk=您的密钥&plugin=Heatmap'");
1141
+ return null;
1142
+ }
1143
+
1144
+ if (heatmap) {
1145
+ heatmap.setMap(null);
1146
+ }
1147
+
1148
+ const heatmapData = data.map(item => ({
1149
+ lng: item.lng,
1150
+ lat: item.lat,
1151
+ count: item.count || 1,
1152
+ }));
1153
+
1154
+ const defaultConfig = {
1155
+ radius: options.radius || 30,
1156
+ opacity: options.opacity || 0.8,
1157
+ gradient: options.gradient || {
1158
+ 0.2: "blue",
1159
+ 0.4: "cyan",
1160
+ 0.6: "lime",
1161
+ 0.8: "yellow",
1162
+ 1.0: "red",
1163
+ },
1164
+ };
1165
+
1166
+ heatmap = new (window as any).HeatmapOverlay(map.value, defaultConfig);
1167
+ heatmap.setDataSet({ data: heatmapData, max: options.max || 100 });
1168
+
1169
+ return heatmap;
1170
+ };
1171
+
1172
+ /** 移除热力图 */
1173
+ const removeHeatmap = (): void => {
1174
+ if (heatmap) {
1175
+ heatmap.setMap(null);
1176
+ heatmap = null;
1177
+ }
1178
+ };
1179
+
1180
+ /** 打开信息窗口 */
1181
+ const openInfoWindow = (position: [number, number], content: string | HTMLElement, options: { offsetX?: number; offsetY?: number; autoClose?: boolean; closeDelay?: number } = {}): void => {
1182
+ if (!map.value) return;
1183
+ if (infoWindow) infoWindow.close();
1184
+
1185
+ const contentStr = typeof content === "string" ? content : content.outerHTML;
1186
+
1187
+ infoWindow = new T.value.InfoWindow({
1188
+ content: contentStr,
1189
+ position: toLngLat(position[0], position[1]),
1190
+ offset: new T.value.Point(options.offsetX || 0, options.offsetY || -20),
1191
+ });
1192
+
1193
+ infoWindow.addEventListener("close", () => {
1194
+ emit("infoWindowClose");
1195
+ isPopupOpen.value = false;
1196
+ });
1197
+
1198
+ infoWindow.open(map.value);
1199
+ isPopupOpen.value = true;
1200
+ popupPosition.value = { lng: position[0], lat: position[1] };
1201
+ popupData.value = { content: contentStr };
1202
+
1203
+ if (options.autoClose !== false) {
1204
+ setTimeout(() => closeInfoWindow(), options.closeDelay || 5000);
1205
+ }
1206
+ };
1207
+
1208
+ /** 关闭信息窗口 */
1209
+ const closeInfoWindow = (): void => {
1210
+ if (infoWindow) {
1211
+ infoWindow.close();
1212
+ infoWindow = null;
1213
+ }
1214
+ isPopupOpen.value = false;
1215
+ popupData.value = null;
1216
+ };
1217
+
1218
+ /** 逆地理编码 */
1219
+ const reGeoCode = (position: [number, number]): Promise<{ formattedAddress: string; addressComponent: any; position: [number, number] }> => {
1220
+ return new Promise((resolve, reject) => {
1221
+ if (!geocoder) {
1222
+ reject(new Error("地理编码服务未初始化"));
1223
+ return;
1224
+ }
1225
+
1226
+ geocoder.getLocation(toLngLat(position[0], position[1]), (result: any) => {
1227
+ if (result && result.address) {
1228
+ resolve({
1229
+ formattedAddress: result.address,
1230
+ addressComponent: result.addressComponents,
1231
+ position,
1232
+ });
1233
+ } else {
1234
+ reject(new Error("逆地理编码失败"));
1235
+ }
1236
+ });
1237
+ });
1238
+ };
1239
+
1240
+ /** 正地理编码 */
1241
+ const geoCode = (address: string): Promise<{ lng: number; lat: number; formattedAddress: string }> => {
1242
+ return new Promise((resolve, reject) => {
1243
+ if (!geocoder) {
1244
+ reject(new Error("地理编码服务未初始化"));
1245
+ return;
1246
+ }
1247
+
1248
+ geocoder.getPoint(address, (point: any) => {
1249
+ if (point) {
1250
+ resolve({
1251
+ lng: point.lng,
1252
+ lat: point.lat,
1253
+ formattedAddress: address,
1254
+ });
1255
+ } else {
1256
+ reject(new Error("地理编码失败"));
1257
+ }
1258
+ });
1259
+ });
1260
+ };
1261
+
1262
+ /** 设置地图中心点 */
1263
+ const setCenter = (position: [number, number], animate: boolean = true): void => {
1264
+ if (!map.value) return;
1265
+ const point = toLngLat(position[0], position[1]);
1266
+ animate ? map.value.panTo(point) : map.value.setCenter(point);
1267
+ };
1268
+
1269
+ /** 获取地图中心点 */
1270
+ const getCenter = (): [number, number] | null => {
1271
+ if (!map.value) return null;
1272
+ const center = map.value.getCenter();
1273
+ return [center.lng, center.lat];
1274
+ };
1275
+
1276
+ /** 设置缩放级别 */
1277
+ const setZoom = (zoom: number): void => {
1278
+ map.value?.setZoom(zoom);
1279
+ };
1280
+
1281
+ /** 获取缩放级别 */
1282
+ const getZoom = (): number | null => {
1283
+ return map.value?.getZoom() || null;
1284
+ };
1285
+
1286
+ /** 适应视野 */
1287
+ const fitBounds = (points: [number, number][], padding: number = 50): void => {
1288
+ if (!map.value || !points?.length) return;
1289
+ const bounds = new T.value.LngLatBounds();
1290
+ points.forEach(p => bounds.extend(toLngLat(p[0], p[1])));
1291
+ map.value.setViewport(bounds, { padding: [padding, padding, padding, padding] });
1292
+ };
1293
+
1294
+ /** 切换地图类型 */
1295
+ const setMapType = (type: "vec" | "img" | "ter"): void => {
1296
+ if (!map.value || !T.value) return;
1297
+ currentMapType = type;
1298
+ // 清除所有现有图层
1299
+ const layers = map.value.getLayers();
1300
+ const layersToRemove: any[] = [];
1301
+ layers.forEach((layer: any) => {
1302
+ layersToRemove.push(layer);
1303
+ });
1304
+ layersToRemove.forEach((layer: any) => {
1305
+ map.value.removeLayer(layer);
1306
+ });
1307
+ loadBaseLayers();
1308
+ };
1309
+
1310
+ /** 获取地图实例 */
1311
+ const getMapInstance = (): any => map.value;
1312
+
1313
+ /** 获取T构造函数 */
1314
+ const getT = (): any => T.value;
1315
+
1316
+ // ==================== 生命周期 ====================
1317
+ onMounted(() => {
1318
+ initMap();
1319
+ });
1320
+
1321
+ onBeforeUnmount(() => {
1322
+ if (animationTimer.value) clearTimeout(animationTimer.value);
1323
+ map.value?.destroy && map.value.destroy();
1324
+ });
1325
+
1326
+ watch(
1327
+ () => props.originalTrackData,
1328
+ async () => {
1329
+ if (isMapReady.value && props.trackMode) {
1330
+ await processTrackData();
1331
+ drawTrackLine();
1332
+ addStartEndMarkers();
1333
+ addCarMarker();
1334
+ updateCarPosition(currentIndex.value);
1335
+ if (props.autoFitBounds) fitTrackBounds();
1336
+ }
1337
+ },
1338
+ { deep: true }
1339
+ );
1340
+
1341
+ watch(
1342
+ () => props.mapType,
1343
+ (newType) => {
1344
+ if (isMapReady.value) {
1345
+ setMapType(newType as "vec" | "img" | "ter");
1346
+ }
1347
+ }
1348
+ );
1349
+
1350
+ // ==================== 对外暴露 ====================
1351
+ defineExpose({
1352
+ // 地图控制
1353
+ setCenter,
1354
+ getCenter,
1355
+ setZoom,
1356
+ getZoom,
1357
+ fitBounds,
1358
+ setMapType,
1359
+ getMapInstance,
1360
+ getT,
1361
+ // 打点
1362
+ addMarker,
1363
+ addMarkers,
1364
+ clearMarkers,
1365
+ removeMarker,
1366
+ // 画线
1367
+ addPolyline,
1368
+ clearPolylines,
1369
+ // 画面
1370
+ addPolygon,
1371
+ clearPolygons,
1372
+ addCircle,
1373
+ clearCircles,
1374
+ // 清除所有
1375
+ clearAllOverlays,
1376
+ // 聚合
1377
+ addMarkerCluster,
1378
+ clearMarkerCluster,
1379
+ // 热力图
1380
+ addHeatmap,
1381
+ removeHeatmap,
1382
+ // 地理编码
1383
+ reGeoCode,
1384
+ geoCode,
1385
+ // 弹窗
1386
+ openInfoWindow,
1387
+ closeInfoWindow,
1388
+ // 轨迹
1389
+ playTrack,
1390
+ pauseTrack,
1391
+ stopTrack,
1392
+ resetTrack,
1393
+ fitTrackBounds,
1394
+ followCar,
1395
+ toggleFollowCar,
1396
+ getTrackPoints: () => displayPoints.value,
1397
+ getCurrentPosition: () => displayPoints.value[currentIndex.value],
1398
+ getTrackInfo: () => trackInfo.value,
1399
+ isPlaying,
1400
+ // 状态
1401
+ isMapReady,
1402
+ initMap,
1403
+ });
1404
+ </script>
1405
+
1406
+ <style scoped>
1407
+ .tianditu-map-container {
1408
+ position: relative;
1409
+ width: 100%;
1410
+ height: 100%;
1411
+ min-height: 500px;
1412
+ }
1413
+
1414
+ .map-container {
1415
+ width: 100%;
1416
+ height: 100%;
1417
+ }
1418
+
1419
+ .track-control-panel {
1420
+ position: absolute;
1421
+ bottom: 20px;
1422
+ left: 20px;
1423
+ right: 20px;
1424
+ background: rgba(0, 0, 0, 0.8);
1425
+ backdrop-filter: blur(10px);
1426
+ border-radius: 12px;
1427
+ padding: 12px 20px;
1428
+ color: white;
1429
+ z-index: 100;
1430
+ font-size: 14px;
1431
+ }
1432
+
1433
+ .control-buttons {
1434
+ display: flex;
1435
+ gap: 10px;
1436
+ margin-bottom: 10px;
1437
+ flex-wrap: wrap;
1438
+ }
1439
+
1440
+ .control-buttons button {
1441
+ padding: 8px 16px;
1442
+ border: none;
1443
+ border-radius: 6px;
1444
+ cursor: pointer;
1445
+ font-size: 14px;
1446
+ font-weight: 500;
1447
+ transition: all 0.2s;
1448
+ }
1449
+
1450
+ .control-buttons button:disabled {
1451
+ opacity: 0.5;
1452
+ cursor: not-allowed;
1453
+ }
1454
+
1455
+ .btn-play {
1456
+ background: #4caf50;
1457
+ color: white;
1458
+ }
1459
+
1460
+ .btn-play:hover:not(:disabled) {
1461
+ background: #45a049;
1462
+ }
1463
+
1464
+ .btn-pause {
1465
+ background: #ff9800;
1466
+ color: white;
1467
+ }
1468
+
1469
+ .btn-pause:hover:not(:disabled) {
1470
+ background: #e68900;
1471
+ }
1472
+
1473
+ .btn-stop {
1474
+ background: #f44336;
1475
+ color: white;
1476
+ }
1477
+
1478
+ .btn-stop:hover:not(:disabled) {
1479
+ background: #da190b;
1480
+ }
1481
+
1482
+ .btn-reset {
1483
+ background: #2196f3;
1484
+ color: white;
1485
+ }
1486
+
1487
+ .btn-reset:hover:not(:disabled) {
1488
+ background: #0b7dda;
1489
+ }
1490
+
1491
+ .btn-correction {
1492
+ background: #9c27b0;
1493
+ color: white;
1494
+ }
1495
+
1496
+ .btn-correction.active {
1497
+ background: #4caf50;
1498
+ }
1499
+
1500
+ .btn-follow {
1501
+ background: #607d8b;
1502
+ color: white;
1503
+ }
1504
+
1505
+ .btn-follow.active {
1506
+ background: #4caf50;
1507
+ }
1508
+
1509
+ .progress-bar {
1510
+ display: flex;
1511
+ align-items: center;
1512
+ gap: 15px;
1513
+ margin-bottom: 10px;
1514
+ }
1515
+
1516
+ .progress-bar span {
1517
+ min-width: 60px;
1518
+ }
1519
+
1520
+ .progress-bar input {
1521
+ flex: 1;
1522
+ height: 4px;
1523
+ border-radius: 2px;
1524
+ cursor: pointer;
1525
+ }
1526
+
1527
+ .track-info {
1528
+ display: flex;
1529
+ gap: 20px;
1530
+ font-size: 12px;
1531
+ color: #ccc;
1532
+ flex-wrap: wrap;
1533
+ }
1534
+
1535
+ .custom-ui-slot {
1536
+ position: absolute;
1537
+ top: 10px;
1538
+ right: 10px;
1539
+ z-index: 10;
1540
+ pointer-events: none;
1541
+ }
1542
+
1543
+ .custom-ui-slot > * {
1544
+ pointer-events: auto;
1545
+ }
1546
+
1547
+ /* 手动控件样式 */
1548
+ .tdt-zoom-control button:hover {
1549
+ background-color: #f0f0f0;
1550
+ }
1551
+
1552
+ .tdt-scale-control {
1553
+ font-family: monospace;
1554
+ }
1555
+ </style>