@kengic/core.react 0.0.1-beta.57 → 0.0.1-beta.59

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.
@@ -67598,25 +67598,18 @@ function setRef(e) {
67598
67598
  ref = e;
67599
67599
  }
67600
67600
  function doKgWorkStation(e = "") {
67601
- return {
67601
+ let t = {
67602
67602
  closeModal() {
67603
- var t, r;
67604
- ((r = (t = kgStore.getState().option) == null ? void 0 : t.KgWorkStation) == null ? void 0 : r.isOn) !== !1 && kgWorkStationStore.dispatch(closeModal({ id: e }));
67603
+ var r, n;
67604
+ ((n = (r = kgStore.getState().option) == null ? void 0 : r.KgWorkStation) == null ? void 0 : n.isOn) !== !1 && kgWorkStationStore.dispatch(closeModal({ id: e }));
67605
67605
  },
67606
- get(t) {
67607
- const r = ref(kgWorkStationStore.getState()[e]), n = kgWorkStationStore.subscribe(() => r.value = t(kgWorkStationStore.getState()[e]));
67608
- return [r, n];
67606
+ get(r) {
67607
+ const n = ref(kgWorkStationStore.getState()[e]), a = kgWorkStationStore.subscribe(() => n.value = r(kgWorkStationStore.getState()[e]));
67608
+ return [n, a];
67609
67609
  },
67610
67610
  getIsVisible() {
67611
- const t = ref(getIsVisible(e)(kgWorkStationStore.getState())), r = kgWorkStationStore.subscribe(() => t.value = getIsVisible(e)(kgWorkStationStore.getState()));
67612
- return [t, r];
67613
- },
67614
- getWorkStation() {
67615
- const t = ref(getWorkStation(e)(kgWorkStationStore.getState())), r = kgWorkStationStore.subscribe(() => t.value = getWorkStation(e)(kgWorkStationStore.getState()));
67616
- return [t, r];
67617
- },
67618
- getWorkStationSnapshot() {
67619
- return getWorkStation(e)(kgWorkStationStore.getState());
67611
+ const r = ref(getIsVisible(e)(kgWorkStationStore.getState())), n = kgWorkStationStore.subscribe(() => r.value = getIsVisible(e)(kgWorkStationStore.getState()));
67612
+ return [r, n];
67620
67613
  },
67621
67614
  id: e,
67622
67615
  onMount: si({
@@ -67630,22 +67623,40 @@ function doKgWorkStation(e = "") {
67630
67623
  id: e
67631
67624
  }),
67632
67625
  openModal() {
67633
- var t, r;
67634
- ((r = (t = kgStore.getState().option) == null ? void 0 : t.KgWorkStation) == null ? void 0 : r.isOn) !== !1 && kgWorkStationStore.dispatch(openModal({ id: e }));
67626
+ var r, n;
67627
+ ((n = (r = kgStore.getState().option) == null ? void 0 : r.KgWorkStation) == null ? void 0 : n.isOn) !== !1 && kgWorkStationStore.dispatch(openModal({ id: e }));
67635
67628
  },
67636
- set(t) {
67637
- var r;
67638
- ii(`${e} | doKgWorkStation | set() | 进入`), ((r = kgWorkStationStore.getState()[e]) == null ? void 0 : r.isMount) === !0 ? kgWorkStationStore.dispatch(set({ fn: t, id: e })) : this.onMount(async () => (ii(`${e} | doKgWorkStation | set() | dispatch set`), setTimeout(() => {
67639
- kgWorkStationStore.dispatch(set({ fn: t, id: e }));
67629
+ set(r) {
67630
+ var n;
67631
+ ii(`${e} | doKgWorkStation | set() | 进入`), ((n = kgWorkStationStore.getState()[e]) == null ? void 0 : n.isMount) === !0 ? kgWorkStationStore.dispatch(set({ fn: r, id: e })) : this.onMount(async () => (ii(`${e} | doKgWorkStation | set() | dispatch set`), setTimeout(() => {
67632
+ kgWorkStationStore.dispatch(set({ fn: r, id: e }));
67640
67633
  }), !1), !0);
67641
67634
  },
67642
67635
  store: kgWorkStationStore,
67643
- subscribe(t) {
67636
+ subscribe(r) {
67644
67637
  return kgWorkStationStore.subscribe(() => {
67645
- t(kgWorkStationStore.getState()[e]);
67638
+ r(kgWorkStationStore.getState()[e]);
67646
67639
  });
67647
- }
67640
+ },
67641
+ workStation: null,
67642
+ workStation$: null,
67643
+ workStationArea: null
67648
67644
  };
67645
+ return t = new Proxy(t, {
67646
+ get(r, n) {
67647
+ switch (n) {
67648
+ case "workStation":
67649
+ return getWorkStation(e)(kgWorkStationStore.getState());
67650
+ case "workStation$": {
67651
+ const a = ref(getWorkStation(e)(kgWorkStationStore.getState())), s = kgWorkStationStore.subscribe(() => a.value = getWorkStation(e)(kgWorkStationStore.getState()));
67652
+ return [a, s];
67653
+ }
67654
+ case "workStationArea":
67655
+ return getWorkStationArea(e)(kgWorkStationStore.getState());
67656
+ }
67657
+ return Reflect.get(r, n);
67658
+ }
67659
+ }), t;
67649
67660
  }
67650
67661
  let _httpClient = null;
67651
67662
  function setHttpClient(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/core.react",
3
- "version": "0.0.1-beta.57",
3
+ "version": "0.0.1-beta.59",
4
4
  "type": "module",
5
5
  "main": "./kengic-core.react.js",
6
6
  "module": "./kengic-core.react.js",
@@ -1,5 +1,5 @@
1
1
  import { IRemoveEventListener } from '@kengic/core.core';
2
- import { WorkstationDTO } from '../../api/WMS/models.ts';
2
+ import { WorkstationAreaDTO, WorkstationDTO } from '../../api/WMS/models.ts';
3
3
  import { IKgWorkStationOnMountEventListener, IKgWorkStationOnOkEventListener } from './index.event';
4
4
  import { IKgWorkStationState, kgWorkStationStore } from './index.store';
5
5
  export interface IDoKgWorkStation {
@@ -22,16 +22,6 @@ export interface IDoKgWorkStation {
22
22
  getIsVisible(): [{
23
23
  value: boolean;
24
24
  }, () => void];
25
- /**
26
- * <p>获取「当前选择的工作站」. 在 vue 项目中使用.</p>
27
- */
28
- getWorkStation(): [{
29
- value: WorkstationDTO | null;
30
- }, () => void];
31
- /**
32
- * <p>跟 {@link getWorkStation} 一样, 但获取的是快照.</p>
33
- */
34
- getWorkStationSnapshot(): WorkstationDTO | null;
35
25
  id: string;
36
26
  /**
37
27
  * 监听事件: 挂载.
@@ -64,6 +54,20 @@ export interface IDoKgWorkStation {
64
54
  * @param fn 回调函数, 可以通过参数 state 获取到最新的数据.
65
55
  */
66
56
  subscribe(fn: (state: IKgWorkStationState[string]) => void): () => void;
57
+ /**
58
+ * <p>获取「当前选择的工作站」快照. 在 vue 项目中使用.</p>
59
+ */
60
+ workStation: WorkstationDTO | null;
61
+ /**
62
+ * <p>获取「当前选择的工作站」. 在 vue 项目中使用.</p>
63
+ */
64
+ workStation$: [{
65
+ value: WorkstationDTO | null;
66
+ }, () => void];
67
+ /**
68
+ * <p>获取「当前选择的工作区」快照. 在 vue 项目中使用.</p>
69
+ */
70
+ workStationArea: WorkstationAreaDTO | null;
67
71
  }
68
72
  /**
69
73
  *