@kengic/core.react 0.0.1-beta.77 → 0.0.1-beta.79
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/kengic-core.react.js
CHANGED
|
@@ -22804,7 +22804,7 @@ function getArchtype(e) {
|
|
|
22804
22804
|
function has(e, t) {
|
|
22805
22805
|
return getArchtype(e) === 2 ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
|
|
22806
22806
|
}
|
|
22807
|
-
function set$
|
|
22807
|
+
function set$1(e, t, r) {
|
|
22808
22808
|
const n = getArchtype(e);
|
|
22809
22809
|
n === 2 ? e.set(t, r) : n === 3 ? e.add(r) : e[t] = r;
|
|
22810
22810
|
}
|
|
@@ -22939,7 +22939,7 @@ function finalizeProperty(e, t, r, n, a, s, u) {
|
|
|
22939
22939
|
if (process.env.NODE_ENV !== "production" && a === r && die(5), isDraft(a)) {
|
|
22940
22940
|
const p = s && t && t.type_ !== 3 && // Set objects are atomic since they have no keys.
|
|
22941
22941
|
!has(t.assigned_, n) ? s.concat(n) : void 0, C = finalize(e, a, p);
|
|
22942
|
-
if (set$
|
|
22942
|
+
if (set$1(r, n, C), isDraft(C))
|
|
22943
22943
|
e.canAutoFreeze_ = !1;
|
|
22944
22944
|
else
|
|
22945
22945
|
return;
|
|
@@ -23184,7 +23184,7 @@ function currentImpl(e) {
|
|
|
23184
23184
|
} else
|
|
23185
23185
|
r = shallowCopy(e, !0);
|
|
23186
23186
|
return each$8(r, (n, a) => {
|
|
23187
|
-
set$
|
|
23187
|
+
set$1(r, n, currentImpl(a));
|
|
23188
23188
|
}), t && (t.finalized_ = !1), r;
|
|
23189
23189
|
}
|
|
23190
23190
|
var immer = new Immer2(), produce = immer.produce;
|
|
@@ -23872,6 +23872,7 @@ function noop$4() {
|
|
|
23872
23872
|
function formatProdErrorMessage(e) {
|
|
23873
23873
|
return `Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `;
|
|
23874
23874
|
}
|
|
23875
|
+
console.log("BBB KgSlice");
|
|
23875
23876
|
const KgSlice = createSlice({
|
|
23876
23877
|
initialState: { option: {} },
|
|
23877
23878
|
name: "Kg",
|
|
@@ -23882,13 +23883,15 @@ const KgSlice = createSlice({
|
|
|
23882
23883
|
* @param state
|
|
23883
23884
|
* @param action
|
|
23884
23885
|
*/
|
|
23885
|
-
|
|
23886
|
+
optionReducer(e, t) {
|
|
23886
23887
|
console.log("111", e, t.payload), e.option = t.payload ?? {};
|
|
23887
23888
|
}
|
|
23888
23889
|
}
|
|
23889
|
-
})
|
|
23890
|
-
|
|
23891
|
-
|
|
23890
|
+
});
|
|
23891
|
+
console.log("CCC KgSlice", KgSlice);
|
|
23892
|
+
const { optionReducer } = KgSlice.actions;
|
|
23893
|
+
function optionSelector(e) {
|
|
23894
|
+
return console.log("222", e, e.Kg.option), e.Kg.option;
|
|
23892
23895
|
}
|
|
23893
23896
|
var classnames = { exports: {} };
|
|
23894
23897
|
/*!
|
|
@@ -25979,7 +25982,7 @@ function internalSet(e, t, r, n) {
|
|
|
25979
25982
|
var a = _toArray(t), s = a[0], u = a.slice(1), p;
|
|
25980
25983
|
return !e && typeof s == "number" ? p = [] : Array.isArray(e) ? p = _toConsumableArray(e) : p = _objectSpread2$7({}, e), n && r === void 0 && u.length === 1 ? delete p[s][u[0]] : p[s] = internalSet(p[s], u, r, n), p;
|
|
25981
25984
|
}
|
|
25982
|
-
function set
|
|
25985
|
+
function set(e, t, r) {
|
|
25983
25986
|
var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
|
|
25984
25987
|
return t.length && n && r === void 0 && !get$1(e, t.slice(0, -1)) ? e : internalSet(e, t, r, n);
|
|
25985
25988
|
}
|
|
@@ -26001,12 +26004,12 @@ function merge$1() {
|
|
|
26001
26004
|
if (!C.has(w)) {
|
|
26002
26005
|
C.add(w);
|
|
26003
26006
|
var G = get$1(n, u);
|
|
26004
|
-
D ? n = set
|
|
26007
|
+
D ? n = set(n, u, []) : (!G || _typeof$1(G) !== "object") && (n = set(n, u, createEmpty(w))), keys$1(w).forEach(function(ne) {
|
|
26005
26008
|
s([].concat(_toConsumableArray(u), [ne]), C);
|
|
26006
26009
|
});
|
|
26007
26010
|
}
|
|
26008
26011
|
} else
|
|
26009
|
-
n = set
|
|
26012
|
+
n = set(n, u, w);
|
|
26010
26013
|
}
|
|
26011
26014
|
s([]);
|
|
26012
26015
|
}), n;
|
|
@@ -30130,7 +30133,7 @@ function _modernUnmount() {
|
|
|
30130
30133
|
function legacyUnmount(e) {
|
|
30131
30134
|
unmountComponentAtNode(e);
|
|
30132
30135
|
}
|
|
30133
|
-
function unmount
|
|
30136
|
+
function unmount(e) {
|
|
30134
30137
|
return _unmount.apply(this, arguments);
|
|
30135
30138
|
}
|
|
30136
30139
|
function _unmount() {
|
|
@@ -30291,7 +30294,7 @@ const WaveEffect = (e) => {
|
|
|
30291
30294
|
var ca;
|
|
30292
30295
|
if (ia.deadline || ia.propertyName === "opacity") {
|
|
30293
30296
|
const sa = (ca = a.current) === null || ca === void 0 ? void 0 : ca.parentElement;
|
|
30294
|
-
unmount
|
|
30297
|
+
unmount(sa).then(() => {
|
|
30295
30298
|
sa == null || sa.remove();
|
|
30296
30299
|
});
|
|
30297
30300
|
}
|
|
@@ -34193,7 +34196,7 @@ function cloneByNamePathList(e, t) {
|
|
|
34193
34196
|
var r = {};
|
|
34194
34197
|
return t.forEach(function(n) {
|
|
34195
34198
|
var a = get$1(e, n);
|
|
34196
|
-
r = set
|
|
34199
|
+
r = set(r, n, a);
|
|
34197
34200
|
}), r;
|
|
34198
34201
|
}
|
|
34199
34202
|
function containsNamePath(e, t) {
|
|
@@ -34687,7 +34690,7 @@ var NameMap = /* @__PURE__ */ function() {
|
|
|
34687
34690
|
var s, u = merge$1(n, r.store);
|
|
34688
34691
|
(s = r.prevWithoutPreserves) === null || s === void 0 || s.map(function(p) {
|
|
34689
34692
|
var C = p.key;
|
|
34690
|
-
u = set
|
|
34693
|
+
u = set(u, C, get$1(n, C));
|
|
34691
34694
|
}), r.prevWithoutPreserves = null, r.updateStore(u);
|
|
34692
34695
|
}
|
|
34693
34696
|
}), _defineProperty(this, "destroyForm", function(n) {
|
|
@@ -34870,7 +34873,7 @@ var NameMap = /* @__PURE__ */ function() {
|
|
|
34870
34873
|
warningOnce(!1, "Multiple Field with path '".concat(ne.join("."), "' set 'initialValue'. Can not decide which one to pick."));
|
|
34871
34874
|
else if (se) {
|
|
34872
34875
|
var ue = r.getFieldValue(ne), ae = D.isListField();
|
|
34873
|
-
!ae && (!n.skipExist || ue === void 0) && r.updateStore(set
|
|
34876
|
+
!ae && (!n.skipExist || ue === void 0) && r.updateStore(set(r.store, ne, _toConsumableArray(se)[0].value));
|
|
34874
34877
|
}
|
|
34875
34878
|
}
|
|
34876
34879
|
}
|
|
@@ -34897,7 +34900,7 @@ var NameMap = /* @__PURE__ */ function() {
|
|
|
34897
34900
|
var s = n.map(getNamePath);
|
|
34898
34901
|
s.forEach(function(u) {
|
|
34899
34902
|
var p = r.getInitialValue(u);
|
|
34900
|
-
r.updateStore(set
|
|
34903
|
+
r.updateStore(set(r.store, u, p));
|
|
34901
34904
|
}), r.resetWithFieldInitialValue({
|
|
34902
34905
|
namePathList: s
|
|
34903
34906
|
}), r.notifyObservers(a, s, {
|
|
@@ -34908,7 +34911,7 @@ var NameMap = /* @__PURE__ */ function() {
|
|
|
34908
34911
|
var a = r.store, s = [];
|
|
34909
34912
|
n.forEach(function(u) {
|
|
34910
34913
|
var p = u.name, C = _objectWithoutProperties(u, _excluded$D), w = getNamePath(p);
|
|
34911
|
-
s.push(w), "value" in C && r.updateStore(set
|
|
34914
|
+
s.push(w), "value" in C && r.updateStore(set(r.store, w, C.value)), r.notifyObservers(a, [w], {
|
|
34912
34915
|
type: "setField",
|
|
34913
34916
|
data: u
|
|
34914
34917
|
});
|
|
@@ -34928,7 +34931,7 @@ var NameMap = /* @__PURE__ */ function() {
|
|
|
34928
34931
|
var a = n.props.initialValue;
|
|
34929
34932
|
if (a !== void 0) {
|
|
34930
34933
|
var s = n.getNamePath(), u = get$1(r.store, s);
|
|
34931
|
-
u === void 0 && r.updateStore(set
|
|
34934
|
+
u === void 0 && r.updateStore(set(r.store, s, a));
|
|
34932
34935
|
}
|
|
34933
34936
|
}), _defineProperty(this, "isMergedPreserve", function(n) {
|
|
34934
34937
|
var a = n !== void 0 ? n : r.preserve;
|
|
@@ -34959,7 +34962,7 @@ var NameMap = /* @__PURE__ */ function() {
|
|
|
34959
34962
|
);
|
|
34960
34963
|
})) {
|
|
34961
34964
|
var D = r.store;
|
|
34962
|
-
r.updateStore(set
|
|
34965
|
+
r.updateStore(set(D, a, w, !0)), r.notifyObservers(D, [a], {
|
|
34963
34966
|
type: "remove"
|
|
34964
34967
|
}), r.triggerDependenciesUpdate(D, a);
|
|
34965
34968
|
}
|
|
@@ -35000,7 +35003,7 @@ var NameMap = /* @__PURE__ */ function() {
|
|
|
35000
35003
|
}), s;
|
|
35001
35004
|
}), _defineProperty(this, "updateValue", function(n, a) {
|
|
35002
35005
|
var s = getNamePath(n), u = r.store;
|
|
35003
|
-
r.updateStore(set
|
|
35006
|
+
r.updateStore(set(r.store, s, a)), r.notifyObservers(u, [s], {
|
|
35004
35007
|
type: "valueUpdate",
|
|
35005
35008
|
source: "internal"
|
|
35006
35009
|
}), r.notifyWatch([s]);
|
|
@@ -36710,7 +36713,7 @@ function confirm(e) {
|
|
|
36710
36713
|
destroyFns.splice(ue, 1);
|
|
36711
36714
|
break;
|
|
36712
36715
|
}
|
|
36713
|
-
unmount
|
|
36716
|
+
unmount(r);
|
|
36714
36717
|
}
|
|
36715
36718
|
function u(w) {
|
|
36716
36719
|
clearTimeout(a), a = setTimeout(() => {
|
|
@@ -67470,7 +67473,9 @@ function emit(e) {
|
|
|
67470
67473
|
parameter: n
|
|
67471
67474
|
});
|
|
67472
67475
|
}
|
|
67473
|
-
const LOCAL_STORAGE_KEY__WORK_STATION = "KgWorkStation.workStation", LOCAL_STORAGE_KEY__WORK_STATION_AREA = "KgWorkStation.workStationArea"
|
|
67476
|
+
const LOCAL_STORAGE_KEY__WORK_STATION = "KgWorkStation.workStation", LOCAL_STORAGE_KEY__WORK_STATION_AREA = "KgWorkStation.workStationArea";
|
|
67477
|
+
console.log("BBB KgWorkStationSlice");
|
|
67478
|
+
const KgWorkStationSlice = createSlice({
|
|
67474
67479
|
initialState: {
|
|
67475
67480
|
"": {
|
|
67476
67481
|
isMount: !0,
|
|
@@ -67487,7 +67492,7 @@ const LOCAL_STORAGE_KEY__WORK_STATION = "KgWorkStation.workStation", LOCAL_STORA
|
|
|
67487
67492
|
* @param state
|
|
67488
67493
|
* @param action
|
|
67489
67494
|
*/
|
|
67490
|
-
|
|
67495
|
+
closeModalReducer(e, t) {
|
|
67491
67496
|
const r = t.payload.id ?? "";
|
|
67492
67497
|
let n = e[r];
|
|
67493
67498
|
n && (n.props.KgWorkStationModal.isOpen = !1);
|
|
@@ -67498,7 +67503,7 @@ const LOCAL_STORAGE_KEY__WORK_STATION = "KgWorkStation.workStation", LOCAL_STORA
|
|
|
67498
67503
|
* @param state
|
|
67499
67504
|
* @param action
|
|
67500
67505
|
*/
|
|
67501
|
-
|
|
67506
|
+
mountReducer(e, t) {
|
|
67502
67507
|
const r = t.payload.id ?? "";
|
|
67503
67508
|
e[r] = {
|
|
67504
67509
|
isMount: !0,
|
|
@@ -67511,7 +67516,7 @@ const LOCAL_STORAGE_KEY__WORK_STATION = "KgWorkStation.workStation", LOCAL_STORA
|
|
|
67511
67516
|
* @param state
|
|
67512
67517
|
* @param action
|
|
67513
67518
|
*/
|
|
67514
|
-
|
|
67519
|
+
openModalReducer(e, t) {
|
|
67515
67520
|
const r = t.payload.id ?? "";
|
|
67516
67521
|
let n = e[r];
|
|
67517
67522
|
n && (n.props.KgWorkStationModal.isOpen = !0);
|
|
@@ -67522,33 +67527,33 @@ const LOCAL_STORAGE_KEY__WORK_STATION = "KgWorkStation.workStation", LOCAL_STORA
|
|
|
67522
67527
|
* @param state
|
|
67523
67528
|
* @param action
|
|
67524
67529
|
*/
|
|
67525
|
-
|
|
67530
|
+
setReducer(e, t) {
|
|
67526
67531
|
var a, s;
|
|
67527
67532
|
const r = t.payload.id ?? "";
|
|
67528
67533
|
let n = e[r];
|
|
67529
67534
|
n && ((s = (a = t.payload).fn) == null || s.call(a, n));
|
|
67530
67535
|
},
|
|
67531
67536
|
/**
|
|
67532
|
-
*
|
|
67537
|
+
* 设置当前选择的工作区.
|
|
67533
67538
|
*
|
|
67534
67539
|
* @param state
|
|
67535
67540
|
* @param action
|
|
67536
67541
|
*/
|
|
67537
|
-
|
|
67542
|
+
setWorkStationAreaReducer(e, t) {
|
|
67538
67543
|
const r = t.payload.id ?? "";
|
|
67539
67544
|
let n = e[r];
|
|
67540
|
-
n && (n.
|
|
67545
|
+
n && (n.workStationArea = t.payload.workStationArea ? { ...t.payload.workStationArea } : null, storejs.set(LOCAL_STORAGE_KEY__WORK_STATION_AREA, n.workStationArea));
|
|
67541
67546
|
},
|
|
67542
67547
|
/**
|
|
67543
|
-
*
|
|
67548
|
+
* 设置当前选择的工作站.
|
|
67544
67549
|
*
|
|
67545
67550
|
* @param state
|
|
67546
67551
|
* @param action
|
|
67547
67552
|
*/
|
|
67548
|
-
|
|
67553
|
+
setWorkStationReducer(e, t) {
|
|
67549
67554
|
const r = t.payload.id ?? "";
|
|
67550
67555
|
let n = e[r];
|
|
67551
|
-
n && (n.
|
|
67556
|
+
n && (n.workStation = t.payload.workStation ? { ...t.payload.workStation } : null, storejs.set(LOCAL_STORAGE_KEY__WORK_STATION, n.workStation));
|
|
67552
67557
|
},
|
|
67553
67558
|
/**
|
|
67554
67559
|
* 卸载. 释放组件资源.
|
|
@@ -67556,35 +67561,37 @@ const LOCAL_STORAGE_KEY__WORK_STATION = "KgWorkStation.workStation", LOCAL_STORA
|
|
|
67556
67561
|
* @param state
|
|
67557
67562
|
* @param action
|
|
67558
67563
|
*/
|
|
67559
|
-
|
|
67564
|
+
unmountReducer(e, t) {
|
|
67560
67565
|
const r = t.payload.id ?? "";
|
|
67561
67566
|
delete e[r];
|
|
67562
67567
|
}
|
|
67563
67568
|
}
|
|
67564
|
-
})
|
|
67565
|
-
|
|
67569
|
+
});
|
|
67570
|
+
console.log("CCC KgWorkStationSlice", KgWorkStationSlice);
|
|
67571
|
+
const { setReducer, mountReducer, openModalReducer, closeModalReducer, setWorkStationReducer, setWorkStationAreaReducer, unmountReducer } = KgWorkStationSlice.actions;
|
|
67572
|
+
function isVisibleSelector(e) {
|
|
67566
67573
|
return (t) => {
|
|
67567
67574
|
var r, n;
|
|
67568
|
-
return ((n = (r = t[e]) == null ? void 0 : r.props) == null ? void 0 : n.isVisible) ?? !1;
|
|
67575
|
+
return ((n = (r = t.KgWorkStation[e]) == null ? void 0 : r.props) == null ? void 0 : n.isVisible) ?? !1;
|
|
67569
67576
|
};
|
|
67570
67577
|
}
|
|
67571
|
-
function
|
|
67578
|
+
function isOpenSelector(e) {
|
|
67572
67579
|
return (t) => {
|
|
67573
67580
|
var r, n, a;
|
|
67574
|
-
return ((a = (n = (r = t[e]) == null ? void 0 : r.props) == null ? void 0 : n.KgWorkStationModal) == null ? void 0 : a.isOpen) ?? !1;
|
|
67581
|
+
return ((a = (n = (r = t.KgWorkStation[e]) == null ? void 0 : r.props) == null ? void 0 : n.KgWorkStationModal) == null ? void 0 : a.isOpen) ?? !1;
|
|
67575
67582
|
};
|
|
67576
67583
|
}
|
|
67577
|
-
function
|
|
67584
|
+
function workStationSelector(e = "") {
|
|
67578
67585
|
return (t) => {
|
|
67579
67586
|
var n;
|
|
67580
|
-
let r = ((n = t[e]) == null ? void 0 : n.workStation) ?? null;
|
|
67587
|
+
let r = ((n = t.KgWorkStation[e]) == null ? void 0 : n.workStation) ?? null;
|
|
67581
67588
|
return r || (r = storejs.get(LOCAL_STORAGE_KEY__WORK_STATION, null)), r;
|
|
67582
67589
|
};
|
|
67583
67590
|
}
|
|
67584
|
-
function
|
|
67591
|
+
function workStationAreaSelector(e = "") {
|
|
67585
67592
|
return (t) => {
|
|
67586
67593
|
var n;
|
|
67587
|
-
let r = ((n = t[e]) == null ? void 0 : n.workStationArea) ?? null;
|
|
67594
|
+
let r = ((n = t.KgWorkStation[e]) == null ? void 0 : n.workStationArea) ?? null;
|
|
67588
67595
|
return r || (r = storejs.get(LOCAL_STORAGE_KEY__WORK_STATION_AREA, null)), r;
|
|
67589
67596
|
};
|
|
67590
67597
|
}
|
|
@@ -67610,16 +67617,12 @@ function doKgWorkStation(e = "") {
|
|
|
67610
67617
|
let t = {
|
|
67611
67618
|
closeModal() {
|
|
67612
67619
|
var r, n;
|
|
67613
|
-
((n = (r = store.getState().Kg.option) == null ? void 0 : r.KgWorkStation) == null ? void 0 : n.isOn) !== !1 && store.dispatch(
|
|
67620
|
+
((n = (r = store.getState().Kg.option) == null ? void 0 : r.KgWorkStation) == null ? void 0 : n.isOn) !== !1 && store.dispatch(closeModalReducer({ id: e }));
|
|
67614
67621
|
},
|
|
67615
67622
|
get(r) {
|
|
67616
67623
|
const n = ref(store.getState().KgWorkStation[e]), a = store.subscribe(() => n.value = r(store.getState().KgWorkStation[e]));
|
|
67617
67624
|
return [n, a];
|
|
67618
67625
|
},
|
|
67619
|
-
getIsVisible() {
|
|
67620
|
-
const r = ref(getIsVisible(e)(store.getState().KgWorkStation)), n = store.subscribe(() => r.value = getIsVisible(e)(store.getState().KgWorkStation));
|
|
67621
|
-
return [r, n];
|
|
67622
|
-
},
|
|
67623
67626
|
id: e,
|
|
67624
67627
|
onMount: si({
|
|
67625
67628
|
event: "onMount",
|
|
@@ -67633,12 +67636,12 @@ function doKgWorkStation(e = "") {
|
|
|
67633
67636
|
}),
|
|
67634
67637
|
openModal() {
|
|
67635
67638
|
var r, n;
|
|
67636
|
-
((n = (r = store.getState().Kg.option) == null ? void 0 : r.KgWorkStation) == null ? void 0 : n.isOn) !== !1 && store.dispatch(
|
|
67639
|
+
((n = (r = store.getState().Kg.option) == null ? void 0 : r.KgWorkStation) == null ? void 0 : n.isOn) !== !1 && store.dispatch(openModalReducer({ id: e }));
|
|
67637
67640
|
},
|
|
67638
67641
|
set(r) {
|
|
67639
67642
|
var n;
|
|
67640
|
-
ii(`${e} | doKgWorkStation | set() | 进入`), ((n = store.getState().KgWorkStation[e]) == null ? void 0 : n.isMount) === !0 ? store.dispatch(
|
|
67641
|
-
store.dispatch(
|
|
67643
|
+
ii(`${e} | doKgWorkStation | set() | 进入`), ((n = store.getState().KgWorkStation[e]) == null ? void 0 : n.isMount) === !0 ? store.dispatch(setReducer({ fn: r, id: e })) : this.onMount(async () => (ii(`${e} | doKgWorkStation | set() | dispatch set`), setTimeout(() => {
|
|
67644
|
+
store.dispatch(setReducer({ fn: r, id: e }));
|
|
67642
67645
|
}), !1), !0);
|
|
67643
67646
|
},
|
|
67644
67647
|
store,
|
|
@@ -67655,13 +67658,13 @@ function doKgWorkStation(e = "") {
|
|
|
67655
67658
|
get(r, n) {
|
|
67656
67659
|
switch (n) {
|
|
67657
67660
|
case "workStation":
|
|
67658
|
-
return
|
|
67661
|
+
return workStationSelector(e)(store.getState());
|
|
67659
67662
|
case "workStation$": {
|
|
67660
|
-
const a = ref(
|
|
67663
|
+
const a = ref(workStationSelector(e)(store.getState())), s = store.subscribe(() => a.value = workStationSelector(e)(store.getState()));
|
|
67661
67664
|
return [a, s];
|
|
67662
67665
|
}
|
|
67663
67666
|
case "workStationArea":
|
|
67664
|
-
return
|
|
67667
|
+
return workStationAreaSelector(e)(store.getState());
|
|
67665
67668
|
}
|
|
67666
67669
|
return Reflect.get(r, n);
|
|
67667
67670
|
}
|
|
@@ -67741,7 +67744,7 @@ class KgUtil {
|
|
|
67741
67744
|
}
|
|
67742
67745
|
function KgWorkStationModal() {
|
|
67743
67746
|
var ha;
|
|
67744
|
-
const e = useID(), t = doKgWorkStation(e), r = useIntl(), n = useKg(), a = useDispatch(), s = useSelector(
|
|
67747
|
+
const e = useID(), t = doKgWorkStation(e), r = useIntl(), n = useKg(), a = useDispatch(), s = useSelector(isVisibleSelector(e)), u = useSelector(isOpenSelector(e)), [p, C] = reactExports.useState([]), [w, D] = reactExports.useState([]), [G, ne] = reactExports.useState([]), [oe, se] = reactExports.useState(""), [ue, ae] = reactExports.useState(""), ct = useSelector(workStationSelector()), ea = useSelector(workStationAreaSelector()), ut = ((ha = p.find((ua) => ua.devcod === w[0])) == null ? void 0 : ha.workstationAreas) ?? [], ra = p.filter((ua) => {
|
|
67745
67748
|
var Ca, ba, da, pa;
|
|
67746
67749
|
return oe ? ((ba = (Ca = ua.devcod) == null ? void 0 : Ca.toLowerCase()) == null ? void 0 : ba.includes(oe.toLowerCase())) || ((pa = (da = ua.devcodDsc) == null ? void 0 : da.toLowerCase()) == null ? void 0 : pa.includes(oe.toLowerCase())) : ua;
|
|
67747
67750
|
}) ?? [], ta = ut.filter((ua) => {
|
|
@@ -67811,7 +67814,7 @@ function KgWorkStationModal() {
|
|
|
67811
67814
|
}
|
|
67812
67815
|
function ya() {
|
|
67813
67816
|
const ua = () => {
|
|
67814
|
-
a(
|
|
67817
|
+
a(setWorkStationReducer({ workStation: p.find((Ca) => Ca.devcod === w[0]) ?? null })), a(setWorkStationAreaReducer({ workStationArea: ut.find((Ca) => Ca.wrkare === G[0]) ?? null }));
|
|
67815
67818
|
};
|
|
67816
67819
|
s ? (w[0] !== (ct == null ? void 0 : ct.devcod) || G[0] !== (ea == null ? void 0 : ea.wrkare)) && (ua(), KgUtil.confirm({
|
|
67817
67820
|
content: n.t("KgWorkStation.reloadMessage"),
|
|
@@ -67882,10 +67885,10 @@ function KgWorkStationModal() {
|
|
|
67882
67885
|
}
|
|
67883
67886
|
function KgWorkStation() {
|
|
67884
67887
|
var G;
|
|
67885
|
-
const e = useSelector(
|
|
67888
|
+
const e = useSelector(optionSelector);
|
|
67886
67889
|
if (console.log("333", e), !(((G = e == null ? void 0 : e.KgWorkStation) == null ? void 0 : G.isOn) !== !1))
|
|
67887
67890
|
return null;
|
|
67888
|
-
const r = useID(), n = useKg(), a = doKgWorkStation(r), s = useSelector(
|
|
67891
|
+
const r = useID(), n = useKg(), a = doKgWorkStation(r), s = useSelector(isVisibleSelector(r)), u = useSelector(workStationSelector()), p = useSelector(workStationAreaSelector()), C = (() => {
|
|
67889
67892
|
let ne = "text";
|
|
67890
67893
|
return s || (ne += " kgcrant-kg-invisible"), ne;
|
|
67891
67894
|
})(), w = (() => {
|
|
@@ -67916,7 +67919,7 @@ class KgWorkStationElement extends HTMLElement {
|
|
|
67916
67919
|
D_(this, "unmount", null);
|
|
67917
67920
|
}
|
|
67918
67921
|
connectedCallback() {
|
|
67919
|
-
this.id || (this.id = h.uuid()), store.dispatch(
|
|
67922
|
+
this.id || (this.id = h.uuid()), store.dispatch(mountReducer({ id: this.id }));
|
|
67920
67923
|
const r = createRoot$1(this);
|
|
67921
67924
|
r.render(
|
|
67922
67925
|
/* @__PURE__ */ jsxRuntimeExports.jsx(KgProvider, { id: this.id, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Provider_default, { store, children: /* @__PURE__ */ jsxRuntimeExports.jsx(KgWorkStation, {}) }) })
|
|
@@ -67924,7 +67927,7 @@ class KgWorkStationElement extends HTMLElement {
|
|
|
67924
67927
|
}
|
|
67925
67928
|
disconnectedCallback() {
|
|
67926
67929
|
var r;
|
|
67927
|
-
(r = this.unmount) == null || r.call(this), this.unmount = null, store.dispatch(
|
|
67930
|
+
(r = this.unmount) == null || r.call(this), this.unmount = null, store.dispatch(unmountReducer({ id: this.id }));
|
|
67928
67931
|
}
|
|
67929
67932
|
}
|
|
67930
67933
|
function initKgWorkStationElement() {
|
|
@@ -67935,7 +67938,7 @@ function initWebComponents() {
|
|
|
67935
67938
|
}
|
|
67936
67939
|
function initKgCoreReact(e) {
|
|
67937
67940
|
const { ref: t, option: r } = e ?? {};
|
|
67938
|
-
setRef(t), store.dispatch(
|
|
67941
|
+
setRef(t), store.dispatch(optionReducer(r)), initWebComponents();
|
|
67939
67942
|
}
|
|
67940
67943
|
export {
|
|
67941
67944
|
doKgWorkStation,
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PayloadAction, Slice, SliceSelectors } from '@reduxjs/toolkit';
|
|
2
|
+
import { IState } from '../../index.store.ts';
|
|
2
3
|
export interface IKgOption {
|
|
3
4
|
/** 选择工作站. */
|
|
4
5
|
KgWorkStation?: {
|
|
@@ -16,7 +17,7 @@ export type IKgState = {
|
|
|
16
17
|
option: IKgOption;
|
|
17
18
|
};
|
|
18
19
|
export declare const KgSlice: Slice<IKgState, {
|
|
19
|
-
|
|
20
|
+
optionReducer(state: IKgState, action: PayloadAction<IKgOption | null | undefined>): void;
|
|
20
21
|
}, string, string, SliceSelectors<IKgState>>;
|
|
21
|
-
export declare const
|
|
22
|
-
export declare function
|
|
22
|
+
export declare const optionReducer: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<IKgOption | null | undefined, `${string}/optionReducer`>;
|
|
23
|
+
export declare function optionSelector(state: IState): IKgOption;
|
|
@@ -17,12 +17,6 @@ export interface IDoKgWorkStation {
|
|
|
17
17
|
get<T extends {
|
|
18
18
|
value: any;
|
|
19
19
|
}>(fn: (state: IKgWorkStationState[string]) => any): [T, () => void];
|
|
20
|
-
/**
|
|
21
|
-
* <p>获取「是否显示」. 在 vue 项目中使用.</p>
|
|
22
|
-
*/
|
|
23
|
-
getIsVisible(): [{
|
|
24
|
-
value: boolean;
|
|
25
|
-
}, () => void];
|
|
26
20
|
id: string;
|
|
27
21
|
/**
|
|
28
22
|
* 监听事件: 挂载.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PayloadAction
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
2
|
import { WorkstationAreaDTO, WorkstationDTO } from '../../api/WMS/models.ts';
|
|
3
|
+
import { IState } from '../../index.store.ts';
|
|
3
4
|
import { KgWorkStationProps } from './index.vm';
|
|
4
5
|
export type IKgWorkStationState = Record<string, {
|
|
5
6
|
/**
|
|
@@ -16,51 +17,93 @@ export type IKgWorkStationState = Record<string, {
|
|
|
16
17
|
*/
|
|
17
18
|
workStationArea: WorkstationAreaDTO | null;
|
|
18
19
|
}>;
|
|
19
|
-
export declare const KgWorkStationSlice: Slice<IKgWorkStationState, {
|
|
20
|
-
|
|
20
|
+
export declare const KgWorkStationSlice: import("@reduxjs/toolkit").Slice<IKgWorkStationState, {
|
|
21
|
+
/**
|
|
22
|
+
* 关闭弹窗.
|
|
23
|
+
*
|
|
24
|
+
* @param state
|
|
25
|
+
* @param action
|
|
26
|
+
*/
|
|
27
|
+
closeModalReducer(state: IKgWorkStationState, action: PayloadAction<{
|
|
21
28
|
id: string | null | undefined;
|
|
22
29
|
}>): void;
|
|
23
|
-
|
|
30
|
+
/**
|
|
31
|
+
* 挂载. 组件做初始化.
|
|
32
|
+
*
|
|
33
|
+
* @param state
|
|
34
|
+
* @param action
|
|
35
|
+
*/
|
|
36
|
+
mountReducer(state: IKgWorkStationState, action: PayloadAction<{
|
|
24
37
|
id: string | null | undefined;
|
|
25
38
|
}>): void;
|
|
26
|
-
|
|
39
|
+
/**
|
|
40
|
+
* 打开弹窗.
|
|
41
|
+
*
|
|
42
|
+
* @param state
|
|
43
|
+
* @param action
|
|
44
|
+
*/
|
|
45
|
+
openModalReducer(state: IKgWorkStationState, action: PayloadAction<{
|
|
27
46
|
id: string | null | undefined;
|
|
28
47
|
}>): void;
|
|
29
|
-
|
|
48
|
+
/**
|
|
49
|
+
* 设置数据.
|
|
50
|
+
*
|
|
51
|
+
* @param state
|
|
52
|
+
* @param action
|
|
53
|
+
*/
|
|
54
|
+
setReducer(state: IKgWorkStationState, action: PayloadAction<{
|
|
30
55
|
id: string | null | undefined;
|
|
31
56
|
fn: (state: IKgWorkStationState[string]) => void;
|
|
32
57
|
}>): void;
|
|
33
|
-
|
|
58
|
+
/**
|
|
59
|
+
* 设置当前选择的工作区.
|
|
60
|
+
*
|
|
61
|
+
* @param state
|
|
62
|
+
* @param action
|
|
63
|
+
*/
|
|
64
|
+
setWorkStationAreaReducer(state: IKgWorkStationState, action: PayloadAction<{
|
|
34
65
|
id?: string | null | undefined;
|
|
35
|
-
|
|
66
|
+
workStationArea: WorkstationAreaDTO | null;
|
|
36
67
|
}>): void;
|
|
37
|
-
|
|
68
|
+
/**
|
|
69
|
+
* 设置当前选择的工作站.
|
|
70
|
+
*
|
|
71
|
+
* @param state
|
|
72
|
+
* @param action
|
|
73
|
+
*/
|
|
74
|
+
setWorkStationReducer(state: IKgWorkStationState, action: PayloadAction<{
|
|
38
75
|
id?: string | null | undefined;
|
|
39
|
-
|
|
76
|
+
workStation: WorkstationDTO | null;
|
|
40
77
|
}>): void;
|
|
41
|
-
|
|
78
|
+
/**
|
|
79
|
+
* 卸载. 释放组件资源.
|
|
80
|
+
*
|
|
81
|
+
* @param state
|
|
82
|
+
* @param action
|
|
83
|
+
*/
|
|
84
|
+
unmountReducer(state: IKgWorkStationState, action: PayloadAction<{
|
|
42
85
|
id: string | null | undefined;
|
|
43
86
|
}>): void;
|
|
44
|
-
},
|
|
45
|
-
export declare const
|
|
87
|
+
}, "KgWorkStation", "KgWorkStation", import("@reduxjs/toolkit").SliceSelectors<IKgWorkStationState>>;
|
|
88
|
+
export declare const setReducer: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
46
89
|
id: string | null | undefined;
|
|
47
90
|
fn: (state: IKgWorkStationState[string]) => void;
|
|
48
|
-
},
|
|
91
|
+
}, "KgWorkStation/setReducer">, mountReducer: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
49
92
|
id: string | null | undefined;
|
|
50
|
-
},
|
|
93
|
+
}, "KgWorkStation/mountReducer">, openModalReducer: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
51
94
|
id: string | null | undefined;
|
|
52
|
-
},
|
|
95
|
+
}, "KgWorkStation/openModalReducer">, closeModalReducer: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
53
96
|
id: string | null | undefined;
|
|
54
|
-
},
|
|
97
|
+
}, "KgWorkStation/closeModalReducer">, setWorkStationReducer: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
55
98
|
id?: string | null | undefined;
|
|
56
99
|
workStation: WorkstationDTO | null;
|
|
57
|
-
},
|
|
100
|
+
}, "KgWorkStation/setWorkStationReducer">, setWorkStationAreaReducer: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
58
101
|
id?: string | null | undefined;
|
|
59
102
|
workStationArea: WorkstationAreaDTO | null;
|
|
60
|
-
},
|
|
103
|
+
}, "KgWorkStation/setWorkStationAreaReducer">, unmountReducer: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
61
104
|
id: string | null | undefined;
|
|
62
|
-
},
|
|
63
|
-
export declare function
|
|
64
|
-
export declare function
|
|
65
|
-
export declare function
|
|
66
|
-
export declare function
|
|
105
|
+
}, "KgWorkStation/unmountReducer">;
|
|
106
|
+
export declare function isVisibleSelector(id: string): (state: IState) => boolean;
|
|
107
|
+
export declare function isOpenSelector(id: string): (state: IState) => boolean;
|
|
108
|
+
export declare function workStationSelector(id?: string): (state: IState) => WorkstationDTO | null;
|
|
109
|
+
export declare function workStationAreaSelector(id?: string): (state: IState) => WorkstationAreaDTO | null;
|
package/src/index.store.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { IKgState, IKgWorkStationState } from './component';
|
|
2
|
+
export type IState = {
|
|
3
|
+
Kg: IKgState;
|
|
4
|
+
KgWorkStation: IKgWorkStationState;
|
|
5
|
+
};
|
|
1
6
|
export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
2
|
-
Kg:
|
|
3
|
-
KgWorkStation:
|
|
7
|
+
Kg: IKgState;
|
|
8
|
+
KgWorkStation: IKgWorkStationState;
|
|
4
9
|
}, import("@reduxjs/toolkit").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{
|
|
5
10
|
dispatch: import("@reduxjs/toolkit").ThunkDispatch<{
|
|
6
|
-
Kg:
|
|
7
|
-
KgWorkStation:
|
|
11
|
+
Kg: IKgState;
|
|
12
|
+
KgWorkStation: IKgWorkStationState;
|
|
8
13
|
}, undefined, import("@reduxjs/toolkit").UnknownAction>;
|
|
9
14
|
}>, import("@reduxjs/toolkit").StoreEnhancer]>>;
|