xframelib 1.1.7 → 1.1.9

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.
package/README.md CHANGED
@@ -242,6 +242,57 @@ app.config.globalProperties.$AppURL=process.env.APP_URL;
242
242
 
243
243
 
244
244
 
245
+ - **XWindowWidgetTemplate.vue 示例widget代码**
246
+
247
+ > from v1.1.9 , @close="doClosePanel" is removed
248
+
249
+ ```vue
250
+ <template>
251
+ <XWindow v-show="isShow" top="10px" left="10px" nWidth="300px" nHeight="400px" title="XWindowWidget模版"
252
+ icon="img/basicimage/arcgis_img.png" :hasMax="true"pid="widgetID" @loaded="loadedHandle" >
253
+ <span>这是XWindowWidget模版,窗体的内容示例</span>
254
+ </XWindow>
255
+ </template>
256
+
257
+ <script lang="ts" setup>
258
+ import { onMounted, ref } from 'vue';
259
+ import { Global, XWindow, XWindowManager,WindowsMap,MinWindowMap } from 'xframelib';
260
+ const widgetID = ref('xwindowWidgetTemplate');
261
+ let windowID = '';
262
+ //获取到窗体的id
263
+ function loadedHandle(panelData) {
264
+ windowID = panelData.id;
265
+ }
266
+ // 从v1.1.9版本移除
267
+ // function doClosePanel(panelData) {
268
+ // widgetID.value = panelData.pid;
269
+ // if (panelData.pid) {
270
+ // Global.LayoutManager?.unloadWidget(widgetID.value);
271
+ // }
272
+ // }
273
+ onMounted(() => {
274
+ //最小化后,定时打开widget
275
+ setTimeout(() => {
276
+ const tmpLayoutManager = Global.getLayoutManager(widgetID.value);
277
+ tmpLayoutManager?.changeWidgetVisible(widgetID.value, true);
278
+ }, 8000);
279
+ })
280
+ /**
281
+ * 对外暴露接口
282
+ */
283
+ const isShow = ref(true);
284
+ function changeVisible(isVisible: boolean = false) {
285
+ isShow.value = isVisible;
286
+ if (windowID && isVisible)
287
+ XWindowManager.openWindowPanel(windowID);
288
+ }
289
+ defineExpose({ changeVisible, isShow });
290
+ </script>
291
+ <style lang="scss" scoped></style>
292
+ ```
293
+
294
+
295
+
245
296
  ## Application Examples
246
297
 
247
298
  ![Development Template](https://zorrowm.github.io/npm/xframelib.png)
@@ -1357,7 +1357,7 @@ for (var I, x, k, C, M, U, j, N, P, D, F = a((e) => {
1357
1357
  type: "_utf32",
1358
1358
  isLE: !1
1359
1359
  }, e.ucs4le = "utf32le", e.ucs4be = "utf32be", r.prototype.encoder = n, r.prototype.decoder = i, n.prototype.write = function(e) {
1360
- for (var r = t.from(e, "ucs2"), n = t.alloc(2 * r.length), i = this.isLE ? n.writeUInt32LE : n.writeUInt32BE, o = 0, s = 0; s < r.length; s += 2) {
1360
+ for (var r = t.from(e, "ucs2"), n = t.alloc(2 * r.length + 4), i = this.isLE ? n.writeUInt32LE : n.writeUInt32BE, o = 0, s = 0; s < r.length; s += 2) {
1361
1361
  var a = r.readUInt16LE(s), c = a >= 55296 && a < 56320, f = a >= 56320 && a < 57344;
1362
1362
  if (this.highSurrogate) {
1363
1363
  if (!c && f) {
@@ -1380,13 +1380,13 @@ for (var I, x, k, C, M, U, j, N, P, D, F = a((e) => {
1380
1380
  var r = 0, n = 0, i = t.alloc(e.length + 4), s = 0, a = this.isLE, c = this.overflow, f = this.badChar;
1381
1381
  if (c.length > 0) {
1382
1382
  for (; r < e.length && c.length < 4; r++) c.push(e[r]);
1383
- 4 === c.length && (n = a ? c[r] | c[r + 1] << 8 | c[r + 2] << 16 | c[r + 3] << 24 : c[r + 3] | c[r + 2] << 8 | c[r + 1] << 16 | c[r] << 24, c.length = 0, s = o(i, s, n, f));
1383
+ 4 === c.length && (n = a ? c[0] | c[1] << 8 | c[2] << 16 | c[3] << 24 : c[3] | c[2] << 8 | c[1] << 16 | c[0] << 24, c.length = 0, s = o(i, s, n, f));
1384
1384
  }
1385
1385
  for (; r < e.length - 3; r += 4) s = o(i, s, n = a ? e[r] | e[r + 1] << 8 | e[r + 2] << 16 | e[r + 3] << 24 : e[r + 3] | e[r + 2] << 8 | e[r + 1] << 16 | e[r] << 24, f);
1386
1386
  for (; r < e.length; r++) c.push(e[r]);
1387
1387
  return i.slice(0, s).toString("ucs2");
1388
1388
  }, i.prototype.end = function() {
1389
- this.overflow.length = 0;
1389
+ if (0 !== this.overflow.length) return this.overflow.length = 0, String.fromCharCode(this.badChar);
1390
1390
  }, e.utf32 = s, e.ucs4 = "utf32", s.prototype.encoder = a, s.prototype.decoder = c, a.prototype.write = function(e) {
1391
1391
  return this.encoder.write(e);
1392
1392
  }, a.prototype.end = function() {
@@ -1672,6 +1672,8 @@ for (var I, x, k, C, M, U, j, N, P, D, F = a((e) => {
1672
1672
  elot928: "iso88597",
1673
1673
  hebrew: "iso88598",
1674
1674
  hebrew8: "iso88598",
1675
+ iso88598i: "iso88598",
1676
+ iso88598e: "iso88598",
1675
1677
  turkish: "iso88599",
1676
1678
  turkish8: "iso88599",
1677
1679
  thai: "iso885911",
@@ -378,10 +378,10 @@ var b = { hasSubscribers: !1 }, y = b, z = b, _ = "object" == typeof performance
378
378
  };
379
379
  let s = this.ttlAutopurge ? (t, e) => {
380
380
  if (i?.[t] && (clearTimeout(i[t]), i[t] = void 0), e && 0 !== e && i) {
381
- let s = setTimeout(() => {
382
- this.#C(t) && this.#L(this.#u[t], "expire");
381
+ let h = setTimeout(() => {
382
+ this.#C(t) ? (this.#L(this.#u[t], "expire"), i[t] = void 0) : s(t, r(t));
383
383
  }, e + 1);
384
- s.unref && s.unref(), i[t] = s;
384
+ h.unref && h.unref(), i[t] = h;
385
385
  }
386
386
  } : () => {};
387
387
  this.#G = (i, s) => {
@@ -400,12 +400,15 @@ var b = { hasSubscribers: !1 }, y = b, z = b, _ = "object" == typeof performance
400
400
  }
401
401
  return t;
402
402
  };
403
- this.getRemainingTTL = (i) => {
404
- let s = this.#c.get(i);
405
- if (void 0 === s) return 0;
406
- let r = t[s], o = e[s];
407
- return r && o ? r - ((h || n()) - o) : Infinity;
408
- }, this.#C = (i) => {
403
+ this.getRemainingTTL = (t) => {
404
+ let e = this.#c.get(t);
405
+ return void 0 === e ? 0 : r(e);
406
+ };
407
+ let r = (i) => {
408
+ let s = t[i], r = e[i];
409
+ return s && r ? s - ((h || n()) - r) : Infinity;
410
+ };
411
+ this.#C = (i) => {
409
412
  let s = e[i], r = t[i];
410
413
  return !!r && !!s && (h || n()) - s > r;
411
414
  };
@@ -782,7 +785,7 @@ var b = { hasSubscribers: !1 }, y = b, z = b, _ = "object" == typeof performance
782
785
  let i = !1;
783
786
  if (0 !== this.#a) {
784
787
  let s = this.#c.get(t);
785
- if (void 0 !== s) if (this.#z?.[s] && (clearTimeout(this.#z?.[s]), this.#z[s] = void 0), i = !0, 1 === this.#a) this.#J(e);
788
+ if (void 0 !== s) if (this.#z?.[s] && (clearTimeout(this.#z[s]), this.#z[s] = void 0), i = !0, 1 === this.#a) this.#J(e);
786
789
  else {
787
790
  this.#U(s);
788
791
  let i = this.#f[s];
@@ -922,10 +925,7 @@ async function L(t, e, i = "") {
922
925
  }
923
926
  async function G(t, e = "") {
924
927
  const i = await M(e);
925
- if (i) {
926
- const e = C.get(t, i);
927
- return console.log("666000", t, e), e;
928
- }
928
+ if (i) return C.get(t, i);
929
929
  }
930
930
  async function U(t, e = "") {
931
931
  const i = await M(e);
@@ -0,0 +1,2 @@
1
+ export * from './useTime';
2
+ export * from './useWidget';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @description 获取本地时间,年月日 时分秒 星期几
3
+ */
4
+ export declare function useTime(): {
5
+ year: import('vue').Ref<number, number>;
6
+ month: import('vue').Ref<number, number>;
7
+ day: import('vue').Ref<number, number>;
8
+ hour: import('vue').Ref<string | number, string | number>;
9
+ minute: import('vue').Ref<string | number, string | number>;
10
+ second: import('vue').Ref<number, number>;
11
+ week: import('vue').Ref<string, string>;
12
+ };
@@ -0,0 +1,74 @@
1
+ export interface Widget {
2
+ name: string;
3
+ key?: string;
4
+ component?: any;
5
+ autoDisable?: boolean;
6
+ disableOther?: boolean | string[];
7
+ group?: string;
8
+ visible?: boolean;
9
+ data?: any;
10
+ meta?: any;
11
+ }
12
+ /**
13
+ * 用于Widget内部控制,和Widget间通信的
14
+ * (思想来源:Mars3D)
15
+ * @returns
16
+ */
17
+ export declare function useWidget(): {
18
+ currentWidget: {
19
+ /**
20
+ * 当前widget实例对象
21
+ */
22
+ instance: import('vue').ComponentInternalInstance | null;
23
+ /**
24
+ * widget ID标识
25
+ */
26
+ wid: any;
27
+ /**
28
+ * widget配置
29
+ */
30
+ widgetConfig: any;
31
+ /**
32
+ * 当前widget所属的LayoutManager对象
33
+ */
34
+ layoutManager: import('..').LayoutManager | undefined;
35
+ /**
36
+ * 对外绑定回调函数
37
+ * @param callback
38
+ */
39
+ onUpdate(callback: any): void;
40
+ };
41
+ /**
42
+ * 获取LayoutManager
43
+ * @param layoutID 默认空,为当前对应LayoutManager
44
+ * @returns
45
+ */
46
+ getLayoutManager(layoutID?: string): import('..').LayoutManager | undefined;
47
+ /**
48
+ * 改变widget的可见性
49
+ * @param visible
50
+ * @param widgetID 默认为当前的widgetid,可插入其他widgetID
51
+ */
52
+ setVisible(visible?: boolean, widgetID?: string): void;
53
+ /**
54
+ * 出发对应widget的onUpdate
55
+ * @param widgetID
56
+ * @param args
57
+ */
58
+ updateWidget(widgetID?: string, args?: any): void;
59
+ /**
60
+ * 获取widget的当前激活状态
61
+ * (是否加载,是否可见)
62
+ * @param widgetID 默认空,为当前widgetid
63
+ * @returns
64
+ */
65
+ isActivate: (widgetID?: string) => boolean | undefined;
66
+ /**
67
+ * 激活指定 widget模块
68
+ * ( 加载或卸载 )
69
+ * @param widOption
70
+ * @param needLoad 加载还是卸载
71
+ */
72
+ activate: (widOption?: string | string[], needLoad?: boolean) => void;
73
+ disable: (option: string | string[]) => void;
74
+ };
@@ -63,7 +63,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
63
63
  default: string;
64
64
  };
65
65
  tag: {
66
- type: (StringConstructor | ObjectConstructor | ArrayConstructor | NumberConstructor)[];
66
+ type: (StringConstructor | ArrayConstructor | ObjectConstructor | NumberConstructor)[];
67
67
  default: string;
68
68
  };
69
69
  right: {
@@ -139,7 +139,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
139
139
  default: string;
140
140
  };
141
141
  tag: {
142
- type: (StringConstructor | ObjectConstructor | ArrayConstructor | NumberConstructor)[];
142
+ type: (StringConstructor | ArrayConstructor | ObjectConstructor | NumberConstructor)[];
143
143
  default: string;
144
144
  };
145
145
  right: {