mvframe 1.0.16 → 1.0.17

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 (48) hide show
  1. package/dist/@ctrl.js +710 -0
  2. package/dist/@element-plus.js +659 -0
  3. package/dist/@floating-ui.js +997 -0
  4. package/dist/@sxzz.js +552 -0
  5. package/dist/@turf.js +1 -0
  6. package/dist/@visactor.js +55144 -0
  7. package/dist/@vue.js +30 -0
  8. package/dist/@vueuse.js +583 -0
  9. package/dist/Config.js +131 -109
  10. package/dist/async-validator.js +648 -0
  11. package/dist/composition.js +104 -96
  12. package/dist/css/cpt.css +1 -1
  13. package/dist/css/style.css +1 -1
  14. package/dist/cssfontparser.js +103 -0
  15. package/dist/d3-array.js +1 -0
  16. package/dist/d3-dsv.js +1 -0
  17. package/dist/d3-geo.js +1 -0
  18. package/dist/d3-hexbin.js +1 -0
  19. package/dist/d3-hierarchy.js +1 -0
  20. package/dist/dayjs.js +642 -0
  21. package/dist/element-plus.js +33909 -0
  22. package/dist/eventemitter3.js +113 -0
  23. package/dist/geobuf.js +1 -0
  24. package/dist/geojson-dissolve.js +1 -0
  25. package/dist/geojson-flatten.js +1 -0
  26. package/dist/geojson-linestring-dissolve.js +1 -0
  27. package/dist/gifuct-js.js +110 -0
  28. package/dist/ieee754.js +1 -0
  29. package/dist/index.js +15 -3007
  30. package/dist/js-binary-schema-parser.js +307 -0
  31. package/dist/lodash-es.js +1352 -0
  32. package/dist/lodash-unified.js +1 -0
  33. package/dist/lodash.js +597 -0
  34. package/dist/lottie-web.js +1 -0
  35. package/dist/maps.js +10 -0
  36. package/dist/memoize-one.js +36 -0
  37. package/dist/normalize-wheel-es.js +88 -0
  38. package/dist/pbf.js +1 -0
  39. package/dist/roughjs.js +1 -0
  40. package/dist/simple-statistics.js +1 -0
  41. package/dist/simplify-geojson.js +1 -0
  42. package/dist/simplify-geometry.js +1 -0
  43. package/dist/topojson-client.js +1 -0
  44. package/dist/topojson-server.js +1 -0
  45. package/dist/util.js +28 -26
  46. package/dist/vendor.js +5204 -0
  47. package/package.json +12 -4
  48. package/scripts/scaffold-app.js +70 -10
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mvframe",
3
3
  "packageManager": "yarn@4.4.1",
4
- "version": "1.0.16",
4
+ "version": "1.0.17",
5
5
  "author": "matt avis",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -14,6 +14,10 @@
14
14
  "import": "./dist/composition.js",
15
15
  "require": "./dist/composition.js"
16
16
  },
17
+ "./maps": {
18
+ "import": "./dist/maps.js",
19
+ "require": "./dist/maps.js"
20
+ },
17
21
  "./store": {
18
22
  "import": "./dist/store.js",
19
23
  "require": "./dist/store.js"
@@ -34,11 +38,12 @@
34
38
  "dev": "vite",
35
39
  "build": "node scripts/prebuild.js",
36
40
  "install-cursor-skill": "node scripts/install-cursor-skill.js",
37
- "scaffold-app": "node scripts/scaffold-app.js"
41
+ "scaffold-app": "node scripts/scaffold-app.js",
42
+ "gen-icon": "node scripts/gen-iconfont-ant-names.js"
38
43
  },
39
44
  "bin": {
40
- "mvframe-install-cursor-skill": "scripts/install-cursor-skill.js",
41
- "mvframe-init-app": "scripts/scaffold-app.js"
45
+ "mvframe-init-app": "scripts/scaffold-app.js",
46
+ "mvframe-install-cursor-skill": "scripts/install-cursor-skill.js"
42
47
  },
43
48
  "files": [
44
49
  "dist/*",
@@ -50,6 +55,9 @@
50
55
  "element-plus": "^2.2.0"
51
56
  },
52
57
  "dependencies": {
58
+ "@visactor/vtable": "^1.26.0",
59
+ "@visactor/vtable-editors": "^1.26.0",
60
+ "dayjs": "^1.11.20",
53
61
  "pinia": "^3.0.0",
54
62
  "vue": "^3.3.4",
55
63
  "vue-router": "^4.6.3",
@@ -117,6 +117,7 @@ function main() {
117
117
  "src/router",
118
118
  "src/pinia/chip",
119
119
  "src/config",
120
+ "src/maps",
120
121
  "src/composition",
121
122
  ];
122
123
  for (const d of dirs) {
@@ -133,6 +134,7 @@ import mvframe from "mvframe";
133
134
  import { pinia, store } from "mvframe/store";
134
135
  import routes from "./router/routes.js";
135
136
  import appConfig from "./config/index.js";
137
+ import appMaps from "./maps/index.js";
136
138
  import "./assets/style/index.scss";
137
139
  import "mvframe/style";
138
140
  import "mvframe/style/cpt";
@@ -147,14 +149,20 @@ const launchRouteGuard = (to, from, next) => {
147
149
  return;
148
150
  }
149
151
  const launch = store.launch(pinia);
152
+ const loginPage = globalThis.$config?.loginPageName || "Entry";
153
+ const firstPage = globalThis.$config?.firstPageName || "Overview_Home";
154
+ if (launch.loggingOut && to.name === loginPage) {
155
+ next();
156
+ return;
157
+ }
150
158
  const authed = Boolean(launch.login);
151
159
  const isPublic = to.matched.some((r) => r.meta?.public);
152
160
  if (!authed && !isPublic) {
153
- next({ name: "Entry", replace: true });
161
+ next({ name: loginPage, replace: true });
154
162
  return;
155
163
  }
156
- if (authed && to.name === "Entry") {
157
- next({ name: "Overview_Home", replace: true });
164
+ if (authed && to.name === loginPage) {
165
+ next({ name: firstPage, replace: true });
158
166
  return;
159
167
  }
160
168
  next();
@@ -181,6 +189,7 @@ app.use(mvframe, {
181
189
  storeChips: import.meta.glob("./pinia/chip/*.js", { eager: true }),
182
190
  },
183
191
  config: appConfig,
192
+ maps: appMaps,
184
193
  });
185
194
  app.mount("#app");
186
195
  `,
@@ -232,6 +241,7 @@ export default [
232
241
  component: () => import("@/views/Overview/Home.vue"),
233
242
  meta: {
234
243
  title: "Overview",
244
+ admin: true,
235
245
  },
236
246
  },
237
247
  {
@@ -241,6 +251,7 @@ export default [
241
251
  meta: {
242
252
  title: "A",
243
253
  icon: "im-swap-right",
254
+ admin: true,
244
255
  },
245
256
  },
246
257
  {
@@ -250,9 +261,9 @@ export default [
250
261
  meta: {
251
262
  title: "B",
252
263
  icon: "im-swap-right",
264
+ admin: true,
253
265
  },
254
266
  children: [
255
- { path: "", redirect: { name: "B_First" } },
256
267
  {
257
268
  path: "first",
258
269
  name: "B_First",
@@ -307,6 +318,19 @@ export default {
307
318
  `,
308
319
  );
309
320
 
321
+ write(
322
+ "src/maps/index.js",
323
+ `/**
324
+ * 与 mvframe 内置 maps/chip/*.js 深度合并(不挂全局),供 useMap / getMaps / patchMaps 使用。
325
+ * 顶层键与芯片文件名一致(如 common、asa);子键用 useMap("common.vTableTool.refresh") 读取。
326
+ * @type {Record<string, unknown>}
327
+ */
328
+ export default {
329
+ // asa: { countryAll: { obj: {} } },
330
+ };
331
+ `,
332
+ );
333
+
310
334
  write(
311
335
  "src/pinia/chip/app.js",
312
336
  `/** 业务 Pinia chip:路径须为 pinia/chip/*.js,export default { state, actions } */
@@ -330,10 +354,21 @@ export default {
330
354
  write(
331
355
  "src/pinia/chip/launch.js",
332
356
  `/** 登录态:与 demo/pinia/launch.js、main.js launchRouteGuard、LoginPage 一致 */
357
+ const readLoginFromStorage = () => {
358
+ try {
359
+ const raw = localStorage.getItem("login");
360
+ if (raw == null) return false;
361
+ return raw === "true" || JSON.parse(raw) === true;
362
+ } catch {
363
+ return false;
364
+ }
365
+ };
366
+
333
367
  export default {
334
368
  state: () => ({
335
369
  userinfo: {},
336
- login: false,
370
+ login: readLoginFromStorage(),
371
+ loggingOut: false,
337
372
  }),
338
373
  actions: {
339
374
  /** 登录成功:合并写入 userinfo,并置 login: true */
@@ -343,10 +378,13 @@ export default {
343
378
  ...payload,
344
379
  };
345
380
  this.login = true;
381
+ localStorage.setItem("login", true);
346
382
  },
347
383
  clearLogin() {
348
384
  this.userinfo = {};
349
385
  this.login = false;
386
+ this.loggingOut = false;
387
+ localStorage.removeItem("login");
350
388
  },
351
389
  },
352
390
  };
@@ -424,6 +462,7 @@ const frameMenu = {
424
462
  <Login
425
463
  :form-fileds="formFileds"
426
464
  :login-methods="[0]"
465
+ :loading="loading"
427
466
  @submit="onSubmit"
428
467
  />
429
468
  </div>
@@ -437,10 +476,18 @@ defineOptions({
437
476
  const router = useRouter();
438
477
  const store = inject("store");
439
478
  const launch = store.launch();
440
-
441
- const onSubmit = (payload) => {
442
- launch.setLogin(payload ?? {});
443
- router.replace({ name: "Overview_Home" }).catch(() => {});
479
+ const loading = ref(false);
480
+
481
+ const onSubmit = async (payload) => {
482
+ loading.value = true;
483
+ try {
484
+ launch.setLogin(payload ?? {});
485
+ await router.replace({ name: "Overview_Home" });
486
+ } catch {
487
+ /* 路由失败时仍结束 loading */
488
+ } finally {
489
+ loading.value = false;
490
+ }
444
491
  };
445
492
 
446
493
  /** 与 mvframe demo 一致:自定义提交字段名 account / pwd */
@@ -611,7 +658,19 @@ export default defineConfig({
611
658
  vue(),
612
659
  AutoImport({
613
660
  include: [/\\.vue$/, /\\.vue\\?vue/, /\\.js$/],
614
- imports: ["vue", "vue-router"],
661
+ imports: [
662
+ "vue",
663
+ "vue-router",
664
+ {
665
+ "mvframe/maps": [
666
+ "useMap",
667
+ "getMaps",
668
+ "patchMaps",
669
+ "mapLang",
670
+ "mapLangPath",
671
+ ],
672
+ },
673
+ ],
615
674
  vueTemplate: true,
616
675
  dts: true,
617
676
  }),
@@ -692,6 +751,7 @@ yarn install
692
751
  | \`src/views/Overview\`、\`A\`、\`B\` | 与路由表一一对应的页面 |
693
752
  | \`src/pinia/chip/*.js\` | 业务 store → \`storeChips: import.meta.glob(...)\` |
694
753
  | \`src/config/index.js\` | 合并进 \`globalThis.$config\` |
754
+ | \`src/maps/index.js\` | 与库内置 \`maps/chip\` 深度合并(模块内);\`useMap().$l()\` / \`mapLangPath\` / \`mapLang\` 可由 auto-import 从 \`mvframe/maps\` 引入 |
695
755
  | \`src/composition\` | 可选,与 Vite 别名 \`@cps\` 对应 |
696
756
 
697
757
  ## Cursor Skill(可选)