uomtiles 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{BQlj8Xoe.js → 0hm88Oke.js} +1 -1
  3. package/.output/public/_nuxt/BNfSclJ4.js +1 -0
  4. package/.output/public/_nuxt/BYzlinOr2.js +1 -0
  5. package/.output/public/_nuxt/{BiWblTbb2.js → Bd1EvHmY.js} +1 -1
  6. package/.output/public/_nuxt/Be4dNlar.js +1 -0
  7. package/.output/public/_nuxt/{C4qlzA4o.js → C7fHMLd7.js} +1 -1
  8. package/.output/public/_nuxt/CQ8inUdm.js +1 -0
  9. package/.output/public/_nuxt/{C_0VY3Cv2.js → CU486JdV2.js} +2 -2
  10. package/.output/public/_nuxt/Cc_JfSB1.js +1 -0
  11. package/.output/public/_nuxt/CgcnoKpi.js +1 -0
  12. package/.output/public/_nuxt/{CgdzV712.js → CovBj6WN.js} +1 -1
  13. package/.output/public/_nuxt/CyZDc0eO2.js +1 -0
  14. package/.output/public/_nuxt/{DtFVCXI9.js → CzFefJH0.js} +1 -1
  15. package/.output/public/_nuxt/{DL1MZZLI.js → D-t0hXHB.js} +1 -1
  16. package/.output/public/_nuxt/D3Pl7yw22.js +1 -0
  17. package/.output/public/_nuxt/D4gbGuiW.js +1 -0
  18. package/.output/public/_nuxt/{DkcySee1.js → DDp9lK3g.js} +1 -1
  19. package/.output/public/_nuxt/DIIXHC50.js +1 -0
  20. package/.output/public/_nuxt/DWFUvzz0.js +1 -0
  21. package/.output/public/_nuxt/D_VoD6-f.js +1 -0
  22. package/.output/public/_nuxt/{q7DkoVkj.js → DaQqwE3R.js} +6 -6
  23. package/.output/public/_nuxt/DfXX-x_z.js +1 -0
  24. package/.output/public/_nuxt/Dgyf2aNY.js +1 -0
  25. package/.output/public/_nuxt/DpIPeY5m.js +1 -0
  26. package/.output/public/_nuxt/GM5myUL22.js +1 -0
  27. package/.output/public/_nuxt/IC4wc76W.js +1 -0
  28. package/.output/public/_nuxt/IfL46N3Z.js +1 -0
  29. package/.output/public/_nuxt/{Oxy7pKSk.js → KEU2l6zJ.js} +1 -1
  30. package/.output/public/_nuxt/{DC3bhq63.js → Q79ec-Ro.js} +1 -1
  31. package/.output/public/_nuxt/SEETjfdJ.js +1 -0
  32. package/.output/public/_nuxt/builds/latest.json +1 -1
  33. package/.output/public/_nuxt/builds/meta/2c4adba2-91b5-44e4-91d3-50a61695207b.json +1 -0
  34. package/.output/public/_nuxt/entry.CZ_dkjcs.css +1 -0
  35. package/.output/public/_nuxt/{ByRlKR9F.js → nGp0t_eD.js} +1 -1
  36. package/.output/server/chunks/_/config.mjs +58 -6
  37. package/.output/server/chunks/_/config.mjs.map +1 -1
  38. package/.output/server/chunks/_/export.mjs +7 -0
  39. package/.output/server/chunks/_/export.mjs.map +1 -0
  40. package/.output/server/chunks/_/file-workspace.mjs +153 -58
  41. package/.output/server/chunks/_/file-workspace.mjs.map +1 -1
  42. package/.output/server/chunks/_/map-service.mjs +7 -7
  43. package/.output/server/chunks/_/map-service.mjs.map +1 -1
  44. package/.output/server/chunks/_/pixel-diff.mjs +1 -1
  45. package/.output/server/chunks/_/uom-auth.mjs +7 -7
  46. package/.output/server/chunks/_/uom-auth.mjs.map +1 -1
  47. package/.output/server/chunks/_/uom-map.mjs +6 -6
  48. package/.output/server/chunks/_/uom-map.mjs.map +1 -1
  49. package/.output/server/chunks/build/Alert-DHVVSgdD.mjs +1074 -0
  50. package/.output/server/chunks/build/Alert-DHVVSgdD.mjs.map +1 -0
  51. package/.output/server/chunks/build/{Alert-0ngTJXxP.mjs → CompletedTaskSelect-CKTpyHS3.mjs} +31 -725
  52. package/.output/server/chunks/build/CompletedTaskSelect-CKTpyHS3.mjs.map +1 -0
  53. package/.output/server/chunks/build/{PopperArrow-Bqfdf2Et.mjs → DashboardSidebarToggle-CUI9NSow.mjs} +567 -5
  54. package/.output/server/chunks/build/DashboardSidebarToggle-CUI9NSow.mjs.map +1 -0
  55. package/.output/server/chunks/build/{Empty-CkW3mADt.mjs → Empty-BGIn09cL.mjs} +2 -2
  56. package/.output/server/chunks/build/{Empty-CkW3mADt.mjs.map → Empty-BGIn09cL.mjs.map} +1 -1
  57. package/.output/server/chunks/build/{FocusScope-Cf0lg0zt.mjs → FocusScope-DNZVMnza.mjs} +2 -2
  58. package/.output/server/chunks/build/{FocusScope-Cf0lg0zt.mjs.map → FocusScope-DNZVMnza.mjs.map} +1 -1
  59. package/.output/server/chunks/build/{FormField-CEUZHcv7.mjs → FormField-DnJWfrKE.mjs} +2 -2
  60. package/.output/server/chunks/build/{FormField-CEUZHcv7.mjs.map → FormField-DnJWfrKE.mjs.map} +1 -1
  61. package/.output/server/chunks/build/{Input-BeNavYXb.mjs → Input-AdlINKtJ.mjs} +1 -1
  62. package/.output/server/chunks/build/{Input-BeNavYXb.mjs.map → Input-AdlINKtJ.mjs.map} +1 -1
  63. package/.output/server/chunks/build/{MapBaseLayerTabs-4445J6yh.mjs → MapBaseLayerTabs-CRl5Zwlr.mjs} +15 -9
  64. package/.output/server/chunks/build/{MapBaseLayerTabs-4445J6yh.mjs.map → MapBaseLayerTabs-CRl5Zwlr.mjs.map} +1 -1
  65. package/.output/server/chunks/build/{Modal-DNZtVxca.mjs → Modal-CozaqIp1.mjs} +13 -5
  66. package/.output/server/chunks/build/{Modal-DNZtVxca.mjs.map → Modal-CozaqIp1.mjs.map} +1 -1
  67. package/.output/server/chunks/build/{OnlineMap-CKwiuqUY.mjs → OnlineMap-cFSicmkV.mjs} +1 -1
  68. package/.output/server/chunks/build/{OnlineMap-CKwiuqUY.mjs.map → OnlineMap-cFSicmkV.mjs.map} +1 -1
  69. package/.output/server/chunks/build/{Pagination-CDHx4HTZ.mjs → Pagination-GvNCxmOW.mjs} +1 -1
  70. package/.output/server/chunks/build/{Pagination-CDHx4HTZ.mjs.map → Pagination-GvNCxmOW.mjs.map} +1 -1
  71. package/.output/server/chunks/build/{Slider-D-n8Y0CX.mjs → Slider-zQx1c7hB.mjs} +10 -25
  72. package/.output/server/chunks/build/Slider-zQx1c7hB.mjs.map +1 -0
  73. package/.output/server/chunks/build/{Tooltip-CkpSktvJ.mjs → Tooltip-DNUdH4oF.mjs} +3 -4
  74. package/.output/server/chunks/build/{Tooltip-CkpSktvJ.mjs.map → Tooltip-DNUdH4oF.mjs.map} +1 -1
  75. package/.output/server/chunks/build/{advanced-D1onodoF.mjs → advanced-5ZGMUBqC.mjs} +17 -18
  76. package/.output/server/chunks/build/advanced-5ZGMUBqC.mjs.map +1 -0
  77. package/.output/server/chunks/build/clamp-CdZXprXk.mjs +65 -0
  78. package/.output/server/chunks/build/clamp-CdZXprXk.mjs.map +1 -0
  79. package/.output/server/chunks/build/{compare-DmSAW8oA.mjs → compare-CtgF4Anj.mjs} +17 -17
  80. package/.output/server/chunks/build/{compare-DmSAW8oA.mjs.map → compare-CtgF4Anj.mjs.map} +1 -1
  81. package/.output/server/chunks/build/{dashboard-BJxrZ19n.mjs → dashboard-GneN-WPG.mjs} +25 -10
  82. package/.output/server/chunks/build/{dashboard-BJxrZ19n.mjs.map → dashboard-GneN-WPG.mjs.map} +1 -1
  83. package/.output/server/chunks/build/{details-CBMqXYyo.mjs → details-CgufnL1d.mjs} +4 -4
  84. package/.output/server/chunks/build/{details-CBMqXYyo.mjs.map → details-CgufnL1d.mjs.map} +1 -1
  85. package/.output/server/chunks/build/error-404-D9aQjJRn.mjs +1 -1
  86. package/.output/server/chunks/build/error-500-BNyA3wrb.mjs +1 -1
  87. package/.output/server/chunks/build/{interval-BxUMpo78.mjs → interval-9B2MrM2e.mjs} +2 -2
  88. package/.output/server/chunks/build/{interval-BxUMpo78.mjs.map → interval-9B2MrM2e.mjs.map} +1 -1
  89. package/.output/server/chunks/build/{login-lbtjN0MV.mjs → login-Cf5EiCE4.mjs} +8 -8
  90. package/.output/server/chunks/build/{login-lbtjN0MV.mjs.map → login-Cf5EiCE4.mjs.map} +1 -1
  91. package/.output/server/chunks/build/{pages-Ba0Eixbd.mjs → pages-0c5sp_lv.mjs} +8 -9
  92. package/.output/server/chunks/build/pages-0c5sp_lv.mjs.map +1 -0
  93. package/.output/server/chunks/build/{services-DuJwjAB8.mjs → services-BB49kSpd.mjs} +16 -16
  94. package/.output/server/chunks/build/{services-DuJwjAB8.mjs.map → services-BB49kSpd.mjs.map} +1 -1
  95. package/.output/server/chunks/build/{tasks-D_Q5EDnn.mjs → tasks-Aa8PwjVL.mjs} +5 -5
  96. package/.output/server/chunks/build/{tasks-D_Q5EDnn.mjs.map → tasks-Aa8PwjVL.mjs.map} +1 -1
  97. package/.output/server/chunks/build/tasks-BRcMLuRW.mjs +6121 -0
  98. package/.output/server/chunks/build/tasks-BRcMLuRW.mjs.map +1 -0
  99. package/.output/server/chunks/nitro/nitro.mjs +254 -257
  100. package/.output/server/chunks/routes/api/auth/login.post.mjs +1 -1
  101. package/.output/server/chunks/routes/api/auth/login.post.mjs.map +1 -1
  102. package/.output/server/chunks/routes/api/auth/send-sms.post.mjs +2 -2
  103. package/.output/server/chunks/routes/api/auth/send-sms.post.mjs.map +1 -1
  104. package/.output/server/chunks/routes/api/map/base/_baseLayer/_zoom/_tileX/_tileY_.get.mjs +2 -2
  105. package/.output/server/chunks/routes/api/map/base/_baseLayer/_zoom/_tileX/_tileY_.get.mjs.map +1 -1
  106. package/.output/server/chunks/routes/api/map/base/status.get.mjs +24 -0
  107. package/.output/server/chunks/routes/api/map/base/status.get.mjs.map +1 -0
  108. package/.output/server/chunks/routes/api/map/live/status.get.mjs +1 -1
  109. package/.output/server/chunks/routes/api/map/live/status.get.mjs.map +1 -1
  110. package/.output/server/chunks/routes/api/map/online/_layerGroup/_zoom/_tileX/_tileY_.get.mjs +3 -3
  111. package/.output/server/chunks/routes/api/map/online/_layerGroup/_zoom/_tileX/_tileY_.get.mjs.map +1 -1
  112. package/.output/server/chunks/routes/api/map/online-root/_layerGroup/_rootX/_rootY_.get.mjs +3 -3
  113. package/.output/server/chunks/routes/api/map/online-root/_layerGroup/_rootX/_rootY_.get.mjs.map +1 -1
  114. package/.output/server/chunks/routes/api/map-service/config.post.mjs +1 -0
  115. package/.output/server/chunks/routes/api/map-service/config.post.mjs.map +1 -1
  116. package/.output/server/chunks/routes/api/map-service/file.post.mjs +4 -3
  117. package/.output/server/chunks/routes/api/map-service/file.post.mjs.map +1 -1
  118. package/.output/server/chunks/routes/api/map-service/source.post.mjs +1 -0
  119. package/.output/server/chunks/routes/api/map-service/source.post.mjs.map +1 -1
  120. package/.output/server/chunks/routes/api/map-service/status.get.mjs +1 -0
  121. package/.output/server/chunks/routes/api/map-service/status.get.mjs.map +1 -1
  122. package/.output/server/chunks/routes/api/workspace/_filename/analysis.get.mjs +4 -3
  123. package/.output/server/chunks/routes/api/workspace/_filename/analysis.get.mjs.map +1 -1
  124. package/.output/server/chunks/routes/api/workspace/_filename/download.get.mjs +2 -1
  125. package/.output/server/chunks/routes/api/workspace/_filename/download.get.mjs.map +1 -1
  126. package/.output/server/chunks/routes/api/workspace/_filename/export/_format_.get.mjs +11 -4
  127. package/.output/server/chunks/routes/api/workspace/_filename/export/_format_.get.mjs.map +1 -1
  128. package/.output/server/chunks/routes/api/workspace/_filename/export-estimate.get.mjs +39 -0
  129. package/.output/server/chunks/routes/api/workspace/_filename/export-estimate.get.mjs.map +1 -0
  130. package/.output/server/chunks/routes/api/workspace/_filename/tile.get.mjs +3 -2
  131. package/.output/server/chunks/routes/api/workspace/_filename/tile.get.mjs.map +1 -1
  132. package/.output/server/chunks/routes/api/workspace/_filename/tiles.get.mjs +2 -1
  133. package/.output/server/chunks/routes/api/workspace/_filename/tiles.get.mjs.map +1 -1
  134. package/.output/server/chunks/routes/api/workspace/_filename_.delete.mjs +2 -1
  135. package/.output/server/chunks/routes/api/workspace/_filename_.delete.mjs.map +1 -1
  136. package/.output/server/chunks/routes/api/workspace/compare/batch.get.mjs +1 -0
  137. package/.output/server/chunks/routes/api/workspace/compare/batch.get.mjs.map +1 -1
  138. package/.output/server/chunks/routes/api/workspace/compare.post.mjs +1 -0
  139. package/.output/server/chunks/routes/api/workspace/compare.post.mjs.map +1 -1
  140. package/.output/server/chunks/routes/api/workspace/fetch.post.mjs +1 -0
  141. package/.output/server/chunks/routes/api/workspace/fetch.post.mjs.map +1 -1
  142. package/.output/server/chunks/routes/api/workspace/files.get.mjs +1 -0
  143. package/.output/server/chunks/routes/api/workspace/files.get.mjs.map +1 -1
  144. package/.output/server/chunks/routes/api/workspace/files.post.mjs +4 -3
  145. package/.output/server/chunks/routes/api/workspace/files.post.mjs.map +1 -1
  146. package/.output/server/chunks/routes/api/workspace/stop.post.mjs +2 -1
  147. package/.output/server/chunks/routes/api/workspace/stop.post.mjs.map +1 -1
  148. package/.output/server/chunks/routes/api/workspace/tasks.post.mjs +2 -1
  149. package/.output/server/chunks/routes/api/workspace/tasks.post.mjs.map +1 -1
  150. package/.output/server/chunks/routes/renderer.mjs +2 -2
  151. package/.output/server/chunks/routes/services/wms.get.mjs +3 -2
  152. package/.output/server/chunks/routes/services/wms.get.mjs.map +1 -1
  153. package/.output/server/chunks/routes/services/wmts.get.mjs +3 -2
  154. package/.output/server/chunks/routes/services/wmts.get.mjs.map +1 -1
  155. package/.output/server/chunks/virtual/entry.mjs +149 -149
  156. package/.output/server/chunks/virtual/entry.mjs.map +1 -1
  157. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  158. package/.output/server/chunks/virtual/styles.mjs +1 -1
  159. package/.output/server/package.json +1 -1
  160. package/README.md +7 -1
  161. package/dist/package.json +68 -0
  162. package/dist/shared/export.js +4 -0
  163. package/dist/shared/types/export.js +1 -0
  164. package/dist/src/cli.js +20 -3
  165. package/dist/src/config.js +2 -0
  166. package/dist/src/core/grid-renderer.js +29 -15
  167. package/dist/src/core/png.js +59 -6
  168. package/dist/src/core/shell.js +37 -0
  169. package/dist/src/core/uomtiles.js +98 -14
  170. package/package.json +1 -1
  171. package/.output/public/_nuxt/1d1PDhA4.js +0 -1
  172. package/.output/public/_nuxt/981KwFWf.js +0 -1
  173. package/.output/public/_nuxt/B30dSvM4.js +0 -1
  174. package/.output/public/_nuxt/BRkljK8J.js +0 -1
  175. package/.output/public/_nuxt/B_MqTg2k2.js +0 -1
  176. package/.output/public/_nuxt/BrPwntMr.js +0 -1
  177. package/.output/public/_nuxt/BskybydR.js +0 -1
  178. package/.output/public/_nuxt/C7HxHbxA.js +0 -1
  179. package/.output/public/_nuxt/CPuhwLY1.js +0 -1
  180. package/.output/public/_nuxt/Ce26t8_Y.js +0 -1
  181. package/.output/public/_nuxt/CfW544W5.js +0 -1
  182. package/.output/public/_nuxt/D1wVNWS0.js +0 -1
  183. package/.output/public/_nuxt/Dz7VMlHR.js +0 -1
  184. package/.output/public/_nuxt/NL65vbjG2.js +0 -1
  185. package/.output/public/_nuxt/Pik8or8N2.js +0 -1
  186. package/.output/public/_nuxt/XZ59tThl.js +0 -1
  187. package/.output/public/_nuxt/ZpWjFsgV.js +0 -1
  188. package/.output/public/_nuxt/builds/meta/9f85104e-738d-4a74-8daa-40b136ce17d5.json +0 -1
  189. package/.output/public/_nuxt/dXz6dFgW2.js +0 -1
  190. package/.output/public/_nuxt/entry.P6tFNE31.css +0 -1
  191. package/.output/public/_nuxt/j0MRD-c3.js +0 -1
  192. package/.output/public/_nuxt/zZ1EGR7Y.js +0 -1
  193. package/.output/server/chunks/build/Alert-0ngTJXxP.mjs.map +0 -1
  194. package/.output/server/chunks/build/DashboardSidebarToggle-pncTaIJq.mjs +0 -569
  195. package/.output/server/chunks/build/DashboardSidebarToggle-pncTaIJq.mjs.map +0 -1
  196. package/.output/server/chunks/build/PopperArrow-Bqfdf2Et.mjs.map +0 -1
  197. package/.output/server/chunks/build/ScrollArea-BQK3em8b.mjs +0 -379
  198. package/.output/server/chunks/build/ScrollArea-BQK3em8b.mjs.map +0 -1
  199. package/.output/server/chunks/build/Slider-D-n8Y0CX.mjs.map +0 -1
  200. package/.output/server/chunks/build/advanced-D1onodoF.mjs.map +0 -1
  201. package/.output/server/chunks/build/pages-Ba0Eixbd.mjs.map +0 -1
  202. package/.output/server/chunks/build/tasks-CyN9x492.mjs +0 -915
  203. package/.output/server/chunks/build/tasks-CyN9x492.mjs.map +0 -1
@@ -1,915 +0,0 @@
1
- import { u as useSeoMeta$1, av as useRoute$1, a as useToast, R as useState, ah as navigateTo, b as _sfc_main$1, c as _sfc_main$7, _ as _sfc_main$5, aw as page_default } from '../virtual/entry.mjs';
2
- import { _ as _sfc_main$6 } from './Modal-DNZtVxca.mjs';
3
- import { _ as _sfc_main$3, d as _sfc_main$1$1, a as _sfc_main$4, M as MapBaseLayerTabs_default, b as _sfc_main$2$1 } from './MapBaseLayerTabs-4445J6yh.mjs';
4
- import { _ as _sfc_main$9 } from './FormField-CEUZHcv7.mjs';
5
- import { F as FileDropZone_default, _ as _sfc_main } from './ScrollArea-BQK3em8b.mjs';
6
- import { _ as _sfc_main$a } from './Input-BeNavYXb.mjs';
7
- import { u as useFileWorkspace, _ as _sfc_main$2 } from './Empty-CkW3mADt.mjs';
8
- import { _ as _sfc_main$8 } from './interval-BxUMpo78.mjs';
9
- import { defineComponent, ref, reactive, computed, watch, withCtx, unref, createVNode, toDisplayString, openBlock, createBlock, createCommentVNode, Fragment, renderList, isRef, useSSRContext } from 'vue';
10
- import { ssrRenderComponent, ssrInterpolate, ssrRenderList } from 'vue/server-renderer';
11
- import { z } from 'zod';
12
- import 'unhead/plugins';
13
- import 'unhead/utils';
14
- import '../routes/renderer.mjs';
15
- import '../nitro/nitro.mjs';
16
- import 'node:http';
17
- import 'node:https';
18
- import 'node:events';
19
- import 'node:buffer';
20
- import 'node:fs';
21
- import 'node:path';
22
- import 'node:crypto';
23
- import 'node:url';
24
- import '@iconify/utils';
25
- import 'consola';
26
- import 'unhead/server';
27
- import 'unhead/legacy';
28
- import 'nostics';
29
- import 'vue-bundle-renderer/runtime';
30
- import 'devalue';
31
- import 'fnv1a-64';
32
- import 'object-identity';
33
- import 'tailwindcss/colors';
34
- import './DashboardSidebarToggle-pncTaIJq.mjs';
35
- import './FocusScope-Cf0lg0zt.mjs';
36
- import './esm-Dp2lJXbp.mjs';
37
-
38
- //#region app/pages/tasks.vue?vue&type=script&setup=true&lang.ts
39
- var tasks_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
40
- __name: "tasks",
41
- __ssrInlineRender: true,
42
- setup(__props) {
43
- useSeoMeta$1({ title: "地图下载任务" });
44
- const route = useRoute$1();
45
- const toast = useToast();
46
- const workspace = useFileWorkspace();
47
- const baseMap = useState("tasks-base-map", () => "tianditu");
48
- const taskView = ref(route.path === "/tasks/details" ? "details" : "preview");
49
- const confirmStart = ref(false);
50
- const confirmDeleteTask = ref(false);
51
- const createTaskOpen = ref(false);
52
- const createTaskState = reactive({ filename: "" });
53
- const createTaskSchema = z.object({ filename: z.string().trim().min(1, "请输入文件名").max(120, "文件名不能超过 120 个字符").refine((filename) => !filename.toLowerCase().endsWith(".uomtiles"), "扩展名由系统自动添加") });
54
- const tasks = computed(() => workspace.files.value.filter((file) => file.kind === "uomtiles"));
55
- const selectedTask = computed(() => workspace.selected.value?.kind === "uomtiles" ? workspace.selected.value : null);
56
- const selectedIsRunning = computed(() => Boolean(selectedTask.value?.locked));
57
- const taskState = computed(() => selectedIsRunning.value ? "running" : selectedTask.value?.summary?.state || "incomplete");
58
- const canStart = computed(() => Boolean(selectedTask.value && taskState.value !== "completed" && !selectedIsRunning.value));
59
- const canDelete = computed(() => Boolean(selectedTask.value && !selectedIsRunning.value && !selectedTask.value.locked));
60
- const startLabel = computed(() => selectedTask.value?.summary?.startedAt ? "继续下载" : "开始下载");
61
- const dateTime = new Intl.DateTimeFormat("zh-CN", {
62
- month: "2-digit",
63
- day: "2-digit",
64
- hour: "2-digit",
65
- minute: "2-digit"
66
- });
67
- const now = ref(Date.now());
68
- const viewItems = computed(() => [{
69
- label: "实时预览",
70
- icon: "i-lucide-map",
71
- value: "preview",
72
- disabled: !selectedTask.value
73
- }, {
74
- label: "任务明细",
75
- icon: "i-lucide-list",
76
- value: "details",
77
- disabled: !selectedTask.value
78
- }]);
79
- watch(() => route.path, (path) => {
80
- taskView.value = path === "/tasks/details" ? "details" : "preview";
81
- });
82
- watch(taskView, (view) => {
83
- if (!selectedTask.value) return;
84
- if (view === "details" && route.path !== "/tasks/details") navigateTo({ name: "tasks-details" });
85
- if (view === "preview" && route.path !== "/tasks") navigateTo({ name: "tasks" });
86
- });
87
- async function start() {
88
- try {
89
- await workspace.start();
90
- confirmStart.value = false;
91
- toast.add({
92
- title: "抓取已启动",
93
- color: "success",
94
- icon: "i-lucide-play"
95
- });
96
- } catch (error) {
97
- toast.add({
98
- title: "无法启动",
99
- description: error?.data?.statusMessage || error?.message,
100
- color: "error"
101
- });
102
- }
103
- }
104
- function stateOf(task) {
105
- return task.locked ? "running" : task.summary?.state || "incomplete";
106
- }
107
- function stateLabel(state) {
108
- return state === "running" ? "进行中" : state === "completed" ? "已完成" : "未完成";
109
- }
110
- function stateColor(state) {
111
- if (state === "running") return "info";
112
- if (state === "completed") return "success";
113
- return "neutral";
114
- }
115
- function taskColor(task) {
116
- if (selectedTask.value?.filename === task.filename) return "primary";
117
- if (stateOf(task) === "running") return "info";
118
- return "neutral";
119
- }
120
- function taskVariant(task) {
121
- return selectedTask.value?.filename === task.filename || stateOf(task) === "running" ? "soft" : "ghost";
122
- }
123
- function displayName(name) {
124
- return workspace.displayWorkspaceName(name);
125
- }
126
- function progressFor(task) {
127
- const summary = task.summary;
128
- const roots = summary?.roots || {};
129
- const total = Object.values(roots).reduce((sum, value) => sum + Number(value), 0);
130
- const completed = Number(roots.completed || 0);
131
- return {
132
- summary,
133
- total,
134
- completed,
135
- percent: total > 0 ? completed / total * 100 : 0
136
- };
137
- }
138
- function formatDuration(milliseconds) {
139
- const seconds = Math.max(0, Math.round(milliseconds / 1e3));
140
- const hours = Math.floor(seconds / 3600);
141
- const minutes = Math.floor(seconds % 3600 / 60);
142
- return hours > 0 ? `${hours}小时${minutes}分` : `${Math.max(1, minutes)}分钟`;
143
- }
144
- function etaFor(task) {
145
- const progress = progressFor(task);
146
- const startedAt = progress.summary?.startedAt ? Date.parse(progress.summary.startedAt) : NaN;
147
- if (!Number.isFinite(startedAt) || progress.completed <= 0 || progress.total <= progress.completed) return "EST 计算中";
148
- const elapsed = now.value - startedAt;
149
- return `EST ${formatDuration((progress.total - progress.completed) * elapsed / progress.completed)}`;
150
- }
151
- function openCreateTask() {
152
- const local = (/* @__PURE__ */ new Date(Date.now() - (/* @__PURE__ */ new Date()).getTimezoneOffset() * 6e4)).toISOString().slice(0, 19).replace(/:/g, "-");
153
- createTaskState.filename = `uom-${local}`;
154
- createTaskOpen.value = true;
155
- }
156
- async function createTask() {
157
- try {
158
- const created = await workspace.createTask(createTaskState.filename);
159
- createTaskOpen.value = false;
160
- toast.add({
161
- title: "任务已创建",
162
- description: displayName(created.filename),
163
- color: "success",
164
- icon: "i-lucide-file-check-2"
165
- });
166
- } catch (error) {
167
- toast.add({
168
- title: "无法创建任务",
169
- description: error?.data?.statusMessage || error?.message,
170
- color: "error"
171
- });
172
- }
173
- }
174
- async function deleteTask() {
175
- if (!selectedTask.value) return;
176
- try {
177
- await workspace.deleteTask(selectedTask.value.filename);
178
- confirmDeleteTask.value = false;
179
- toast.add({
180
- title: "任务已删除",
181
- color: "success",
182
- icon: "i-lucide-trash-2"
183
- });
184
- } catch (error) {
185
- toast.add({
186
- title: "无法删除任务",
187
- description: error?.data?.statusMessage || error?.message,
188
- color: "error"
189
- });
190
- }
191
- }
192
- async function openTask(file) {
193
- if (!file.name.toLowerCase().endsWith(".uomtiles")) {
194
- toast.add({
195
- title: "请选择 .uomtiles 文件",
196
- color: "error"
197
- });
198
- return;
199
- }
200
- try {
201
- const imported = await workspace.importFile(file);
202
- workspace.selectTask(imported.filename);
203
- } catch (error) {
204
- toast.add({
205
- title: "无法打开任务文件",
206
- description: error?.data?.message || error?.message,
207
- color: "error"
208
- });
209
- }
210
- }
211
- return (_ctx, _push, _parent, _attrs) => {
212
- const _component_UDashboardPanel = _sfc_main$3;
213
- const _component_UDashboardNavbar = _sfc_main$2$1;
214
- const _component_UButton = _sfc_main$1;
215
- const _component_FileDropZone = FileDropZone_default;
216
- const _component_UScrollArea = _sfc_main;
217
- const _component_UBadge = _sfc_main$1$1;
218
- const _component_UProgress = _sfc_main$7;
219
- const _component_UIcon = _sfc_main$5;
220
- const _component_UEmpty = _sfc_main$2;
221
- const _component_UTabs = _sfc_main$4;
222
- const _component_MapBaseLayerTabs = MapBaseLayerTabs_default;
223
- const _component_NuxtPage = page_default;
224
- const _component_UModal = _sfc_main$6;
225
- const _component_UForm = _sfc_main$8;
226
- const _component_UFormField = _sfc_main$9;
227
- const _component_UInput = _sfc_main$a;
228
- _push(`<!--[-->`);
229
- _push(ssrRenderComponent(_component_UDashboardPanel, {
230
- id: "download-tasks",
231
- class: "h-svh min-w-0 overflow-hidden",
232
- ui: { body: "gap-0 overflow-hidden p-0 sm:gap-0 sm:p-0" }
233
- }, {
234
- header: withCtx((_, _push, _parent, _scopeId) => {
235
- if (_push) _push(ssrRenderComponent(_component_UDashboardNavbar, { title: "地图下载任务" }, {
236
- right: withCtx((_, _push, _parent, _scopeId) => {
237
- if (_push) {
238
- _push(ssrRenderComponent(_component_UButton, {
239
- icon: "i-lucide-plus",
240
- label: "新建任务",
241
- color: "neutral",
242
- variant: "outline",
243
- size: "sm",
244
- onClick: openCreateTask
245
- }, null, _parent, _scopeId));
246
- _push(ssrRenderComponent(_component_UButton, {
247
- icon: "i-lucide-refresh-cw",
248
- label: "刷新",
249
- color: "neutral",
250
- variant: "outline",
251
- size: "sm",
252
- loading: unref(workspace).pending.value,
253
- onClick: unref(workspace).refresh
254
- }, null, _parent, _scopeId));
255
- if (unref(selectedTask)) _push(ssrRenderComponent(_component_UButton, {
256
- icon: "i-lucide-trash-2",
257
- label: "删除任务",
258
- color: "error",
259
- variant: "outline",
260
- size: "sm",
261
- disabled: !unref(canDelete),
262
- onClick: ($event) => confirmDeleteTask.value = true
263
- }, null, _parent, _scopeId));
264
- else _push(`<!---->`);
265
- if (unref(selectedTask) && unref(taskState) === "completed") {
266
- _push(`<!--[-->`);
267
- _push(ssrRenderComponent(_component_UButton, {
268
- to: `/api/workspace/${encodeURIComponent(unref(selectedTask).filename)}/download`,
269
- target: "_blank",
270
- icon: "i-lucide-download",
271
- label: "UOMTiles",
272
- color: "neutral",
273
- variant: "outline",
274
- size: "sm"
275
- }, null, _parent, _scopeId));
276
- _push(ssrRenderComponent(_component_UButton, {
277
- to: `/api/workspace/${encodeURIComponent(unref(selectedTask).filename)}/export/mbtiles`,
278
- target: "_blank",
279
- icon: "i-lucide-database",
280
- label: "MBTiles",
281
- color: "neutral",
282
- variant: "outline",
283
- size: "sm"
284
- }, null, _parent, _scopeId));
285
- _push(ssrRenderComponent(_component_UButton, {
286
- to: `/api/workspace/${encodeURIComponent(unref(selectedTask).filename)}/export/pmtiles`,
287
- target: "_blank",
288
- icon: "i-lucide-package",
289
- label: "PMTiles",
290
- color: "neutral",
291
- variant: "outline",
292
- size: "sm"
293
- }, null, _parent, _scopeId));
294
- _push(`<!--]-->`);
295
- } else _push(`<!---->`);
296
- if (unref(selectedIsRunning)) _push(ssrRenderComponent(_component_UButton, {
297
- icon: "i-lucide-square",
298
- label: "停止下载",
299
- color: "warning",
300
- variant: "outline",
301
- size: "sm",
302
- onClick: ($event) => unref(workspace).stop(unref(selectedTask)?.filename)
303
- }, null, _parent, _scopeId));
304
- else if (unref(canStart)) _push(ssrRenderComponent(_component_UButton, {
305
- icon: "i-lucide-play",
306
- label: unref(startLabel),
307
- variant: "outline",
308
- size: "sm",
309
- onClick: ($event) => confirmStart.value = true
310
- }, null, _parent, _scopeId));
311
- else _push(`<!---->`);
312
- } else return [
313
- createVNode(_component_UButton, {
314
- icon: "i-lucide-plus",
315
- label: "新建任务",
316
- color: "neutral",
317
- variant: "outline",
318
- size: "sm",
319
- onClick: openCreateTask
320
- }),
321
- createVNode(_component_UButton, {
322
- icon: "i-lucide-refresh-cw",
323
- label: "刷新",
324
- color: "neutral",
325
- variant: "outline",
326
- size: "sm",
327
- loading: unref(workspace).pending.value,
328
- onClick: unref(workspace).refresh
329
- }, null, 8, ["loading", "onClick"]),
330
- unref(selectedTask) ? (openBlock(), createBlock(_component_UButton, {
331
- key: 0,
332
- icon: "i-lucide-trash-2",
333
- label: "删除任务",
334
- color: "error",
335
- variant: "outline",
336
- size: "sm",
337
- disabled: !unref(canDelete),
338
- onClick: ($event) => confirmDeleteTask.value = true
339
- }, null, 8, ["disabled", "onClick"])) : createCommentVNode("", true),
340
- unref(selectedTask) && unref(taskState) === "completed" ? (openBlock(), createBlock(Fragment, { key: 1 }, [
341
- createVNode(_component_UButton, {
342
- to: `/api/workspace/${encodeURIComponent(unref(selectedTask).filename)}/download`,
343
- target: "_blank",
344
- icon: "i-lucide-download",
345
- label: "UOMTiles",
346
- color: "neutral",
347
- variant: "outline",
348
- size: "sm"
349
- }, null, 8, ["to"]),
350
- createVNode(_component_UButton, {
351
- to: `/api/workspace/${encodeURIComponent(unref(selectedTask).filename)}/export/mbtiles`,
352
- target: "_blank",
353
- icon: "i-lucide-database",
354
- label: "MBTiles",
355
- color: "neutral",
356
- variant: "outline",
357
- size: "sm"
358
- }, null, 8, ["to"]),
359
- createVNode(_component_UButton, {
360
- to: `/api/workspace/${encodeURIComponent(unref(selectedTask).filename)}/export/pmtiles`,
361
- target: "_blank",
362
- icon: "i-lucide-package",
363
- label: "PMTiles",
364
- color: "neutral",
365
- variant: "outline",
366
- size: "sm"
367
- }, null, 8, ["to"])
368
- ], 64)) : createCommentVNode("", true),
369
- unref(selectedIsRunning) ? (openBlock(), createBlock(_component_UButton, {
370
- key: 2,
371
- icon: "i-lucide-square",
372
- label: "停止下载",
373
- color: "warning",
374
- variant: "outline",
375
- size: "sm",
376
- onClick: ($event) => unref(workspace).stop(unref(selectedTask)?.filename)
377
- }, null, 8, ["onClick"])) : unref(canStart) ? (openBlock(), createBlock(_component_UButton, {
378
- key: 3,
379
- icon: "i-lucide-play",
380
- label: unref(startLabel),
381
- variant: "outline",
382
- size: "sm",
383
- onClick: ($event) => confirmStart.value = true
384
- }, null, 8, ["label", "onClick"])) : createCommentVNode("", true)
385
- ];
386
- }),
387
- _: 1
388
- }, _parent, _scopeId));
389
- else return [createVNode(_component_UDashboardNavbar, { title: "地图下载任务" }, {
390
- right: withCtx(() => [
391
- createVNode(_component_UButton, {
392
- icon: "i-lucide-plus",
393
- label: "新建任务",
394
- color: "neutral",
395
- variant: "outline",
396
- size: "sm",
397
- onClick: openCreateTask
398
- }),
399
- createVNode(_component_UButton, {
400
- icon: "i-lucide-refresh-cw",
401
- label: "刷新",
402
- color: "neutral",
403
- variant: "outline",
404
- size: "sm",
405
- loading: unref(workspace).pending.value,
406
- onClick: unref(workspace).refresh
407
- }, null, 8, ["loading", "onClick"]),
408
- unref(selectedTask) ? (openBlock(), createBlock(_component_UButton, {
409
- key: 0,
410
- icon: "i-lucide-trash-2",
411
- label: "删除任务",
412
- color: "error",
413
- variant: "outline",
414
- size: "sm",
415
- disabled: !unref(canDelete),
416
- onClick: ($event) => confirmDeleteTask.value = true
417
- }, null, 8, ["disabled", "onClick"])) : createCommentVNode("", true),
418
- unref(selectedTask) && unref(taskState) === "completed" ? (openBlock(), createBlock(Fragment, { key: 1 }, [
419
- createVNode(_component_UButton, {
420
- to: `/api/workspace/${encodeURIComponent(unref(selectedTask).filename)}/download`,
421
- target: "_blank",
422
- icon: "i-lucide-download",
423
- label: "UOMTiles",
424
- color: "neutral",
425
- variant: "outline",
426
- size: "sm"
427
- }, null, 8, ["to"]),
428
- createVNode(_component_UButton, {
429
- to: `/api/workspace/${encodeURIComponent(unref(selectedTask).filename)}/export/mbtiles`,
430
- target: "_blank",
431
- icon: "i-lucide-database",
432
- label: "MBTiles",
433
- color: "neutral",
434
- variant: "outline",
435
- size: "sm"
436
- }, null, 8, ["to"]),
437
- createVNode(_component_UButton, {
438
- to: `/api/workspace/${encodeURIComponent(unref(selectedTask).filename)}/export/pmtiles`,
439
- target: "_blank",
440
- icon: "i-lucide-package",
441
- label: "PMTiles",
442
- color: "neutral",
443
- variant: "outline",
444
- size: "sm"
445
- }, null, 8, ["to"])
446
- ], 64)) : createCommentVNode("", true),
447
- unref(selectedIsRunning) ? (openBlock(), createBlock(_component_UButton, {
448
- key: 2,
449
- icon: "i-lucide-square",
450
- label: "停止下载",
451
- color: "warning",
452
- variant: "outline",
453
- size: "sm",
454
- onClick: ($event) => unref(workspace).stop(unref(selectedTask)?.filename)
455
- }, null, 8, ["onClick"])) : unref(canStart) ? (openBlock(), createBlock(_component_UButton, {
456
- key: 3,
457
- icon: "i-lucide-play",
458
- label: unref(startLabel),
459
- variant: "outline",
460
- size: "sm",
461
- onClick: ($event) => confirmStart.value = true
462
- }, null, 8, ["label", "onClick"])) : createCommentVNode("", true)
463
- ]),
464
- _: 1
465
- })];
466
- }),
467
- body: withCtx((_, _push, _parent, _scopeId) => {
468
- if (_push) {
469
- _push(`<div class="grid min-h-0 flex-1 lg:grid-cols-[20rem_minmax(0,1fr)]"${_scopeId}><aside class="flex max-h-[24rem] min-h-0 flex-col overflow-hidden border-b border-default lg:max-h-none lg:border-r lg:border-b-0"${_scopeId}><div class="border-b border-default p-3"${_scopeId}>`);
470
- _push(ssrRenderComponent(_component_FileDropZone, {
471
- accept: ".uomtiles",
472
- title: "导入任务",
473
- pending: unref(workspace).pending.value,
474
- onSelect: openTask
475
- }, null, _parent, _scopeId));
476
- _push(`</div><div class="flex items-center justify-between gap-2 border-b border-default px-4 py-3"${_scopeId}><div class="flex items-center gap-2"${_scopeId}><h2 class="text-sm font-semibold"${_scopeId}>任务列表</h2><span class="uom-mono text-xs text-muted"${_scopeId}>${ssrInterpolate(unref(tasks).length)}</span></div></div>`);
477
- if (unref(workspace).ready.value && unref(tasks).length) _push(ssrRenderComponent(_component_UScrollArea, { class: "min-h-0 flex-1" }, {
478
- default: withCtx((_, _push, _parent, _scopeId) => {
479
- if (_push) {
480
- _push(`<div class="space-y-1 p-1"${_scopeId}><!--[-->`);
481
- ssrRenderList(unref(tasks), (task) => {
482
- _push(ssrRenderComponent(_component_UButton, {
483
- key: task.filename,
484
- type: "button",
485
- block: "",
486
- color: taskColor(task),
487
- variant: taskVariant(task),
488
- class: "h-auto min-h-16 w-full items-start justify-start px-3 py-3 text-left",
489
- "aria-pressed": unref(selectedTask)?.filename === task.filename,
490
- onClick: ($event) => unref(workspace).selectTask(task.filename)
491
- }, {
492
- default: withCtx((_, _push, _parent, _scopeId) => {
493
- if (_push) {
494
- _push(`<div class="w-full min-w-0"${_scopeId}><div class="flex items-center gap-2"${_scopeId}><span class="min-w-0 flex-1 truncate text-sm font-medium"${_scopeId}>${ssrInterpolate(displayName(task.filename))}</span>`);
495
- _push(ssrRenderComponent(_component_UBadge, {
496
- label: stateLabel(stateOf(task)),
497
- color: stateColor(stateOf(task)),
498
- variant: "subtle",
499
- size: "xs"
500
- }, null, _parent, _scopeId));
501
- _push(`</div>`);
502
- if (stateOf(task) === "running") {
503
- _push(`<div class="mt-2 space-y-1.5"${_scopeId}><div class="flex items-center justify-between gap-2 text-[11px] text-muted"${_scopeId}><span${_scopeId}>${ssrInterpolate(progressFor(task).completed)} / ${ssrInterpolate(progressFor(task).total || 6030)} 个网格</span><span class="uom-mono"${_scopeId}>${ssrInterpolate(Math.floor(progressFor(task).percent))}%</span></div>`);
504
- _push(ssrRenderComponent(_component_UProgress, {
505
- "model-value": progressFor(task).percent,
506
- max: 100,
507
- size: "sm",
508
- color: "info"
509
- }, null, _parent, _scopeId));
510
- _push(`<div class="flex items-center justify-between gap-2 text-[11px] text-muted"${_scopeId}><span${_scopeId}>正在下载</span><span class="uom-mono"${_scopeId}>${ssrInterpolate(etaFor(task))}</span></div></div>`);
511
- } else {
512
- _push(`<div class="mt-1.5 flex items-center justify-between gap-3 text-xs text-muted"${_scopeId}><span${_scopeId}>${ssrInterpolate(unref(dateTime).format(new Date(task.modifiedAt)))}</span>`);
513
- if (task.summary?.roots.completed) _push(`<span class="uom-mono"${_scopeId}>${ssrInterpolate(task.summary.roots.completed)} / 6030</span>`);
514
- else _push(`<!---->`);
515
- _push(`</div>`);
516
- }
517
- _push(`</div>`);
518
- } else return [createVNode("div", { class: "w-full min-w-0" }, [createVNode("div", { class: "flex items-center gap-2" }, [createVNode("span", { class: "min-w-0 flex-1 truncate text-sm font-medium" }, toDisplayString(displayName(task.filename)), 1), createVNode(_component_UBadge, {
519
- label: stateLabel(stateOf(task)),
520
- color: stateColor(stateOf(task)),
521
- variant: "subtle",
522
- size: "xs"
523
- }, null, 8, ["label", "color"])]), stateOf(task) === "running" ? (openBlock(), createBlock("div", {
524
- key: 0,
525
- class: "mt-2 space-y-1.5"
526
- }, [
527
- createVNode("div", { class: "flex items-center justify-between gap-2 text-[11px] text-muted" }, [createVNode("span", null, toDisplayString(progressFor(task).completed) + " / " + toDisplayString(progressFor(task).total || 6030) + " 个网格", 1), createVNode("span", { class: "uom-mono" }, toDisplayString(Math.floor(progressFor(task).percent)) + "%", 1)]),
528
- createVNode(_component_UProgress, {
529
- "model-value": progressFor(task).percent,
530
- max: 100,
531
- size: "sm",
532
- color: "info"
533
- }, null, 8, ["model-value"]),
534
- createVNode("div", { class: "flex items-center justify-between gap-2 text-[11px] text-muted" }, [createVNode("span", null, "正在下载"), createVNode("span", { class: "uom-mono" }, toDisplayString(etaFor(task)), 1)])
535
- ])) : (openBlock(), createBlock("div", {
536
- key: 1,
537
- class: "mt-1.5 flex items-center justify-between gap-3 text-xs text-muted"
538
- }, [createVNode("span", null, toDisplayString(unref(dateTime).format(new Date(task.modifiedAt))), 1), task.summary?.roots.completed ? (openBlock(), createBlock("span", {
539
- key: 0,
540
- class: "uom-mono"
541
- }, toDisplayString(task.summary.roots.completed) + " / 6030", 1)) : createCommentVNode("", true)]))])];
542
- }),
543
- _: 2
544
- }, _parent, _scopeId));
545
- });
546
- _push(`<!--]--></div>`);
547
- } else return [createVNode("div", { class: "space-y-1 p-1" }, [(openBlock(true), createBlock(Fragment, null, renderList(unref(tasks), (task) => {
548
- return openBlock(), createBlock(_component_UButton, {
549
- key: task.filename,
550
- type: "button",
551
- block: "",
552
- color: taskColor(task),
553
- variant: taskVariant(task),
554
- class: "h-auto min-h-16 w-full items-start justify-start px-3 py-3 text-left",
555
- "aria-pressed": unref(selectedTask)?.filename === task.filename,
556
- onClick: ($event) => unref(workspace).selectTask(task.filename)
557
- }, {
558
- default: withCtx(() => [createVNode("div", { class: "w-full min-w-0" }, [createVNode("div", { class: "flex items-center gap-2" }, [createVNode("span", { class: "min-w-0 flex-1 truncate text-sm font-medium" }, toDisplayString(displayName(task.filename)), 1), createVNode(_component_UBadge, {
559
- label: stateLabel(stateOf(task)),
560
- color: stateColor(stateOf(task)),
561
- variant: "subtle",
562
- size: "xs"
563
- }, null, 8, ["label", "color"])]), stateOf(task) === "running" ? (openBlock(), createBlock("div", {
564
- key: 0,
565
- class: "mt-2 space-y-1.5"
566
- }, [
567
- createVNode("div", { class: "flex items-center justify-between gap-2 text-[11px] text-muted" }, [createVNode("span", null, toDisplayString(progressFor(task).completed) + " / " + toDisplayString(progressFor(task).total || 6030) + " 个网格", 1), createVNode("span", { class: "uom-mono" }, toDisplayString(Math.floor(progressFor(task).percent)) + "%", 1)]),
568
- createVNode(_component_UProgress, {
569
- "model-value": progressFor(task).percent,
570
- max: 100,
571
- size: "sm",
572
- color: "info"
573
- }, null, 8, ["model-value"]),
574
- createVNode("div", { class: "flex items-center justify-between gap-2 text-[11px] text-muted" }, [createVNode("span", null, "正在下载"), createVNode("span", { class: "uom-mono" }, toDisplayString(etaFor(task)), 1)])
575
- ])) : (openBlock(), createBlock("div", {
576
- key: 1,
577
- class: "mt-1.5 flex items-center justify-between gap-3 text-xs text-muted"
578
- }, [createVNode("span", null, toDisplayString(unref(dateTime).format(new Date(task.modifiedAt))), 1), task.summary?.roots.completed ? (openBlock(), createBlock("span", {
579
- key: 0,
580
- class: "uom-mono"
581
- }, toDisplayString(task.summary.roots.completed) + " / 6030", 1)) : createCommentVNode("", true)]))])]),
582
- _: 2
583
- }, 1032, [
584
- "color",
585
- "variant",
586
- "aria-pressed",
587
- "onClick"
588
- ]);
589
- }), 128))])];
590
- }),
591
- _: 1
592
- }, _parent, _scopeId));
593
- else if (!unref(workspace).ready.value) {
594
- _push(`<div class="flex min-h-48 flex-1 flex-col items-center justify-center gap-3 px-4 text-sm text-muted"${_scopeId}>`);
595
- _push(ssrRenderComponent(_component_UIcon, {
596
- name: "i-lucide-loader-circle",
597
- class: "size-5 animate-spin text-primary"
598
- }, null, _parent, _scopeId));
599
- _push(`<span${_scopeId}>加载任务</span></div>`);
600
- } else {
601
- _push(`<div class="flex min-h-48 flex-1 items-center justify-center px-4 py-8"${_scopeId}>`);
602
- _push(ssrRenderComponent(_component_UEmpty, {
603
- icon: "i-lucide-files",
604
- title: "暂无任务"
605
- }, null, _parent, _scopeId));
606
- _push(`</div>`);
607
- }
608
- _push(`</aside><div class="flex min-h-0 flex-col"${_scopeId}><div class="flex min-h-12 flex-wrap items-center justify-between gap-2 border-b border-default px-4 py-1.5"${_scopeId}>`);
609
- _push(ssrRenderComponent(_component_UTabs, {
610
- modelValue: unref(taskView),
611
- "onUpdate:modelValue": ($event) => isRef(taskView) ? taskView.value = $event : null,
612
- items: unref(viewItems),
613
- content: false,
614
- size: "sm"
615
- }, null, _parent, _scopeId));
616
- _push(ssrRenderComponent(_component_MapBaseLayerTabs, {
617
- modelValue: unref(baseMap),
618
- "onUpdate:modelValue": ($event) => isRef(baseMap) ? baseMap.value = $event : null
619
- }, null, _parent, _scopeId));
620
- _push(`</div><div class="min-h-0 flex-1"${_scopeId}>`);
621
- _push(ssrRenderComponent(_component_NuxtPage, null, null, _parent, _scopeId));
622
- _push(`</div></div></div>`);
623
- } else return [createVNode("div", { class: "grid min-h-0 flex-1 lg:grid-cols-[20rem_minmax(0,1fr)]" }, [createVNode("aside", { class: "flex max-h-[24rem] min-h-0 flex-col overflow-hidden border-b border-default lg:max-h-none lg:border-r lg:border-b-0" }, [
624
- createVNode("div", { class: "border-b border-default p-3" }, [createVNode(_component_FileDropZone, {
625
- accept: ".uomtiles",
626
- title: "导入任务",
627
- pending: unref(workspace).pending.value,
628
- onSelect: openTask
629
- }, null, 8, ["pending"])]),
630
- createVNode("div", { class: "flex items-center justify-between gap-2 border-b border-default px-4 py-3" }, [createVNode("div", { class: "flex items-center gap-2" }, [createVNode("h2", { class: "text-sm font-semibold" }, "任务列表"), createVNode("span", { class: "uom-mono text-xs text-muted" }, toDisplayString(unref(tasks).length), 1)])]),
631
- unref(workspace).ready.value && unref(tasks).length ? (openBlock(), createBlock(_component_UScrollArea, {
632
- key: 0,
633
- class: "min-h-0 flex-1"
634
- }, {
635
- default: withCtx(() => [createVNode("div", { class: "space-y-1 p-1" }, [(openBlock(true), createBlock(Fragment, null, renderList(unref(tasks), (task) => {
636
- return openBlock(), createBlock(_component_UButton, {
637
- key: task.filename,
638
- type: "button",
639
- block: "",
640
- color: taskColor(task),
641
- variant: taskVariant(task),
642
- class: "h-auto min-h-16 w-full items-start justify-start px-3 py-3 text-left",
643
- "aria-pressed": unref(selectedTask)?.filename === task.filename,
644
- onClick: ($event) => unref(workspace).selectTask(task.filename)
645
- }, {
646
- default: withCtx(() => [createVNode("div", { class: "w-full min-w-0" }, [createVNode("div", { class: "flex items-center gap-2" }, [createVNode("span", { class: "min-w-0 flex-1 truncate text-sm font-medium" }, toDisplayString(displayName(task.filename)), 1), createVNode(_component_UBadge, {
647
- label: stateLabel(stateOf(task)),
648
- color: stateColor(stateOf(task)),
649
- variant: "subtle",
650
- size: "xs"
651
- }, null, 8, ["label", "color"])]), stateOf(task) === "running" ? (openBlock(), createBlock("div", {
652
- key: 0,
653
- class: "mt-2 space-y-1.5"
654
- }, [
655
- createVNode("div", { class: "flex items-center justify-between gap-2 text-[11px] text-muted" }, [createVNode("span", null, toDisplayString(progressFor(task).completed) + " / " + toDisplayString(progressFor(task).total || 6030) + " 个网格", 1), createVNode("span", { class: "uom-mono" }, toDisplayString(Math.floor(progressFor(task).percent)) + "%", 1)]),
656
- createVNode(_component_UProgress, {
657
- "model-value": progressFor(task).percent,
658
- max: 100,
659
- size: "sm",
660
- color: "info"
661
- }, null, 8, ["model-value"]),
662
- createVNode("div", { class: "flex items-center justify-between gap-2 text-[11px] text-muted" }, [createVNode("span", null, "正在下载"), createVNode("span", { class: "uom-mono" }, toDisplayString(etaFor(task)), 1)])
663
- ])) : (openBlock(), createBlock("div", {
664
- key: 1,
665
- class: "mt-1.5 flex items-center justify-between gap-3 text-xs text-muted"
666
- }, [createVNode("span", null, toDisplayString(unref(dateTime).format(new Date(task.modifiedAt))), 1), task.summary?.roots.completed ? (openBlock(), createBlock("span", {
667
- key: 0,
668
- class: "uom-mono"
669
- }, toDisplayString(task.summary.roots.completed) + " / 6030", 1)) : createCommentVNode("", true)]))])]),
670
- _: 2
671
- }, 1032, [
672
- "color",
673
- "variant",
674
- "aria-pressed",
675
- "onClick"
676
- ]);
677
- }), 128))])]),
678
- _: 1
679
- })) : !unref(workspace).ready.value ? (openBlock(), createBlock("div", {
680
- key: 1,
681
- class: "flex min-h-48 flex-1 flex-col items-center justify-center gap-3 px-4 text-sm text-muted"
682
- }, [createVNode(_component_UIcon, {
683
- name: "i-lucide-loader-circle",
684
- class: "size-5 animate-spin text-primary"
685
- }), createVNode("span", null, "加载任务")])) : (openBlock(), createBlock("div", {
686
- key: 2,
687
- class: "flex min-h-48 flex-1 items-center justify-center px-4 py-8"
688
- }, [createVNode(_component_UEmpty, {
689
- icon: "i-lucide-files",
690
- title: "暂无任务"
691
- })]))
692
- ]), createVNode("div", { class: "flex min-h-0 flex-col" }, [createVNode("div", { class: "flex min-h-12 flex-wrap items-center justify-between gap-2 border-b border-default px-4 py-1.5" }, [createVNode(_component_UTabs, {
693
- modelValue: unref(taskView),
694
- "onUpdate:modelValue": ($event) => isRef(taskView) ? taskView.value = $event : null,
695
- items: unref(viewItems),
696
- content: false,
697
- size: "sm"
698
- }, null, 8, [
699
- "modelValue",
700
- "onUpdate:modelValue",
701
- "items"
702
- ]), createVNode(_component_MapBaseLayerTabs, {
703
- modelValue: unref(baseMap),
704
- "onUpdate:modelValue": ($event) => isRef(baseMap) ? baseMap.value = $event : null
705
- }, null, 8, ["modelValue", "onUpdate:modelValue"])]), createVNode("div", { class: "min-h-0 flex-1" }, [createVNode(_component_NuxtPage)])])])];
706
- }),
707
- _: 1
708
- }, _parent));
709
- _push(ssrRenderComponent(_component_UModal, {
710
- open: unref(createTaskOpen),
711
- "onUpdate:open": ($event) => isRef(createTaskOpen) ? createTaskOpen.value = $event : null,
712
- title: "新建地图下载任务"
713
- }, {
714
- body: withCtx((_, _push, _parent, _scopeId) => {
715
- if (_push) _push(ssrRenderComponent(_component_UForm, {
716
- id: "create-task-form",
717
- schema: unref(createTaskSchema),
718
- state: unref(createTaskState),
719
- onSubmit: createTask
720
- }, {
721
- default: withCtx((_, _push, _parent, _scopeId) => {
722
- if (_push) _push(ssrRenderComponent(_component_UFormField, {
723
- name: "filename",
724
- label: "任务文件名",
725
- required: ""
726
- }, {
727
- default: withCtx((_, _push, _parent, _scopeId) => {
728
- if (_push) _push(ssrRenderComponent(_component_UInput, {
729
- modelValue: unref(createTaskState).filename,
730
- "onUpdate:modelValue": ($event) => unref(createTaskState).filename = $event,
731
- class: "w-full",
732
- autocomplete: "off",
733
- icon: "i-lucide-file-database"
734
- }, {
735
- trailing: withCtx((_, _push, _parent, _scopeId) => {
736
- if (_push) _push(`<span class="uom-mono text-xs text-muted"${_scopeId}>.uomtiles</span>`);
737
- else return [createVNode("span", { class: "uom-mono text-xs text-muted" }, ".uomtiles")];
738
- }),
739
- _: 1
740
- }, _parent, _scopeId));
741
- else return [createVNode(_component_UInput, {
742
- modelValue: unref(createTaskState).filename,
743
- "onUpdate:modelValue": ($event) => unref(createTaskState).filename = $event,
744
- class: "w-full",
745
- autocomplete: "off",
746
- icon: "i-lucide-file-database"
747
- }, {
748
- trailing: withCtx(() => [createVNode("span", { class: "uom-mono text-xs text-muted" }, ".uomtiles")]),
749
- _: 1
750
- }, 8, ["modelValue", "onUpdate:modelValue"])];
751
- }),
752
- _: 1
753
- }, _parent, _scopeId));
754
- else return [createVNode(_component_UFormField, {
755
- name: "filename",
756
- label: "任务文件名",
757
- required: ""
758
- }, {
759
- default: withCtx(() => [createVNode(_component_UInput, {
760
- modelValue: unref(createTaskState).filename,
761
- "onUpdate:modelValue": ($event) => unref(createTaskState).filename = $event,
762
- class: "w-full",
763
- autocomplete: "off",
764
- icon: "i-lucide-file-database"
765
- }, {
766
- trailing: withCtx(() => [createVNode("span", { class: "uom-mono text-xs text-muted" }, ".uomtiles")]),
767
- _: 1
768
- }, 8, ["modelValue", "onUpdate:modelValue"])]),
769
- _: 1
770
- })];
771
- }),
772
- _: 1
773
- }, _parent, _scopeId));
774
- else return [createVNode(_component_UForm, {
775
- id: "create-task-form",
776
- schema: unref(createTaskSchema),
777
- state: unref(createTaskState),
778
- onSubmit: createTask
779
- }, {
780
- default: withCtx(() => [createVNode(_component_UFormField, {
781
- name: "filename",
782
- label: "任务文件名",
783
- required: ""
784
- }, {
785
- default: withCtx(() => [createVNode(_component_UInput, {
786
- modelValue: unref(createTaskState).filename,
787
- "onUpdate:modelValue": ($event) => unref(createTaskState).filename = $event,
788
- class: "w-full",
789
- autocomplete: "off",
790
- icon: "i-lucide-file-database"
791
- }, {
792
- trailing: withCtx(() => [createVNode("span", { class: "uom-mono text-xs text-muted" }, ".uomtiles")]),
793
- _: 1
794
- }, 8, ["modelValue", "onUpdate:modelValue"])]),
795
- _: 1
796
- })]),
797
- _: 1
798
- }, 8, ["schema", "state"])];
799
- }),
800
- footer: withCtx((_, _push, _parent, _scopeId) => {
801
- if (_push) {
802
- _push(ssrRenderComponent(_component_UButton, {
803
- label: "取消",
804
- color: "neutral",
805
- variant: "ghost",
806
- onClick: ($event) => createTaskOpen.value = false
807
- }, null, _parent, _scopeId));
808
- _push(ssrRenderComponent(_component_UButton, {
809
- type: "submit",
810
- form: "create-task-form",
811
- label: "创建",
812
- icon: "i-lucide-plus",
813
- loading: unref(workspace).pending.value
814
- }, null, _parent, _scopeId));
815
- } else return [createVNode(_component_UButton, {
816
- label: "取消",
817
- color: "neutral",
818
- variant: "ghost",
819
- onClick: ($event) => createTaskOpen.value = false
820
- }, null, 8, ["onClick"]), createVNode(_component_UButton, {
821
- type: "submit",
822
- form: "create-task-form",
823
- label: "创建",
824
- icon: "i-lucide-plus",
825
- loading: unref(workspace).pending.value
826
- }, null, 8, ["loading"])];
827
- }),
828
- _: 1
829
- }, _parent));
830
- _push(ssrRenderComponent(_component_UModal, {
831
- open: unref(confirmStart),
832
- "onUpdate:open": ($event) => isRef(confirmStart) ? confirmStart.value = $event : null,
833
- title: unref(startLabel)
834
- }, {
835
- footer: withCtx((_, _push, _parent, _scopeId) => {
836
- if (_push) {
837
- _push(ssrRenderComponent(_component_UButton, {
838
- label: "取消",
839
- color: "neutral",
840
- variant: "ghost",
841
- onClick: ($event) => confirmStart.value = false
842
- }, null, _parent, _scopeId));
843
- _push(ssrRenderComponent(_component_UButton, {
844
- label: unref(startLabel),
845
- icon: "i-lucide-play",
846
- onClick: start
847
- }, null, _parent, _scopeId));
848
- } else return [createVNode(_component_UButton, {
849
- label: "取消",
850
- color: "neutral",
851
- variant: "ghost",
852
- onClick: ($event) => confirmStart.value = false
853
- }, null, 8, ["onClick"]), createVNode(_component_UButton, {
854
- label: unref(startLabel),
855
- icon: "i-lucide-play",
856
- onClick: start
857
- }, null, 8, ["label"])];
858
- }),
859
- _: 1
860
- }, _parent));
861
- _push(ssrRenderComponent(_component_UModal, {
862
- open: unref(confirmDeleteTask),
863
- "onUpdate:open": ($event) => isRef(confirmDeleteTask) ? confirmDeleteTask.value = $event : null,
864
- title: "删除地图下载任务"
865
- }, {
866
- body: withCtx((_, _push, _parent, _scopeId) => {
867
- if (_push) _push(`<p class="text-sm text-muted"${_scopeId}>确定删除“${ssrInterpolate(unref(selectedTask) ? displayName(unref(selectedTask).filename) : "")}”吗?任务文件和已抓取数据将被永久删除。</p>`);
868
- else return [createVNode("p", { class: "text-sm text-muted" }, "确定删除“" + toDisplayString(unref(selectedTask) ? displayName(unref(selectedTask).filename) : "") + "”吗?任务文件和已抓取数据将被永久删除。", 1)];
869
- }),
870
- footer: withCtx((_, _push, _parent, _scopeId) => {
871
- if (_push) {
872
- _push(ssrRenderComponent(_component_UButton, {
873
- label: "取消",
874
- color: "neutral",
875
- variant: "ghost",
876
- onClick: ($event) => confirmDeleteTask.value = false
877
- }, null, _parent, _scopeId));
878
- _push(ssrRenderComponent(_component_UButton, {
879
- label: "确认删除",
880
- icon: "i-lucide-trash-2",
881
- color: "error",
882
- loading: unref(workspace).pending.value,
883
- onClick: deleteTask
884
- }, null, _parent, _scopeId));
885
- } else return [createVNode(_component_UButton, {
886
- label: "取消",
887
- color: "neutral",
888
- variant: "ghost",
889
- onClick: ($event) => confirmDeleteTask.value = false
890
- }, null, 8, ["onClick"]), createVNode(_component_UButton, {
891
- label: "确认删除",
892
- icon: "i-lucide-trash-2",
893
- color: "error",
894
- loading: unref(workspace).pending.value,
895
- onClick: deleteTask
896
- }, null, 8, ["loading"])];
897
- }),
898
- _: 1
899
- }, _parent));
900
- _push(`<!--]-->`);
901
- };
902
- }
903
- });
904
- //#endregion
905
- //#region app/pages/tasks.vue
906
- var _sfc_setup = tasks_vue_vue_type_script_setup_true_lang_default.setup;
907
- tasks_vue_vue_type_script_setup_true_lang_default.setup = (props, ctx) => {
908
- const ssrContext = useSSRContext();
909
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/tasks.vue");
910
- return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
911
- };
912
- var tasks_default = tasks_vue_vue_type_script_setup_true_lang_default;
913
-
914
- export { tasks_default as default };
915
- //# sourceMappingURL=tasks-CyN9x492.mjs.map