@kengic/core.react 0.0.1-beta.50 → 0.0.1-beta.51
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
|
@@ -66454,52 +66454,56 @@ function List(e, t) {
|
|
|
66454
66454
|
}
|
|
66455
66455
|
List.method = "GET";
|
|
66456
66456
|
List.url = "/workstation/workstation/list";
|
|
66457
|
-
|
|
66458
|
-
|
|
66459
|
-
|
|
66460
|
-
|
|
66461
|
-
|
|
66462
|
-
|
|
66463
|
-
|
|
66464
|
-
|
|
66465
|
-
|
|
66466
|
-
|
|
66467
|
-
|
|
66468
|
-
|
|
66469
|
-
|
|
66470
|
-
|
|
66471
|
-
|
|
66472
|
-
|
|
66473
|
-
|
|
66474
|
-
|
|
66475
|
-
|
|
66476
|
-
|
|
66477
|
-
|
|
66478
|
-
|
|
66479
|
-
|
|
66480
|
-
|
|
66481
|
-
|
|
66482
|
-
|
|
66483
|
-
|
|
66484
|
-
|
|
66485
|
-
|
|
66486
|
-
|
|
66487
|
-
|
|
66488
|
-
|
|
66489
|
-
const a = cloneDeep(n);
|
|
66490
|
-
return a.okButtonProps.loading = !0, a.cancelButtonProps.disabled = !0, a;
|
|
66491
|
-
});
|
|
66492
|
-
}, r.hideLoading = () => {
|
|
66493
|
-
r.update((n) => {
|
|
66494
|
-
const a = cloneDeep(n);
|
|
66495
|
-
return a.okButtonProps.loading = !1, a.cancelButtonProps.disabled = !1, a;
|
|
66457
|
+
function useKgUtil() {
|
|
66458
|
+
const e = useIntl();
|
|
66459
|
+
return {
|
|
66460
|
+
/**
|
|
66461
|
+
* <p>确认弹窗. 设置了多个属性的默认值, 简化使用.</p>
|
|
66462
|
+
* <p>https://ant.design/components/modal#modalmethod</p>
|
|
66463
|
+
*
|
|
66464
|
+
* @param props
|
|
66465
|
+
*/
|
|
66466
|
+
confirm(t) {
|
|
66467
|
+
console.log("444");
|
|
66468
|
+
const r = Modal.confirm({
|
|
66469
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$2, { icon: "ant-design:exclamation-circle-outlined" }),
|
|
66470
|
+
title: e.formatMessage({ id: "kg.confirm" }),
|
|
66471
|
+
content: e.formatMessage({ id: "kg.confirmDelete" }),
|
|
66472
|
+
okText: e.formatMessage({ id: "kg.confirm" }),
|
|
66473
|
+
okButtonProps: {
|
|
66474
|
+
danger: !0,
|
|
66475
|
+
...t.okButtonProps ?? {}
|
|
66476
|
+
},
|
|
66477
|
+
cancelButtonProps: {
|
|
66478
|
+
// 通过设置样式, 隐藏取消按钮
|
|
66479
|
+
class: t.kgHideCancelButton === !0 ? "kg-invisible" : "",
|
|
66480
|
+
disabled: !1,
|
|
66481
|
+
...t.cancelButtonProps ?? {}
|
|
66482
|
+
},
|
|
66483
|
+
cancelText: e.formatMessage({ id: "kg.cancel" }),
|
|
66484
|
+
closable: !1,
|
|
66485
|
+
centered: !0,
|
|
66486
|
+
autoFocusButton: null,
|
|
66487
|
+
keyboard: !1,
|
|
66488
|
+
...t
|
|
66496
66489
|
});
|
|
66497
|
-
|
|
66498
|
-
|
|
66490
|
+
return r.showLoading = () => {
|
|
66491
|
+
r.update((n) => {
|
|
66492
|
+
const a = cloneDeep(n);
|
|
66493
|
+
return a.okButtonProps.loading = !0, a.cancelButtonProps.disabled = !0, a;
|
|
66494
|
+
});
|
|
66495
|
+
}, r.hideLoading = () => {
|
|
66496
|
+
r.update((n) => {
|
|
66497
|
+
const a = cloneDeep(n);
|
|
66498
|
+
return a.okButtonProps.loading = !1, a.cancelButtonProps.disabled = !1, a;
|
|
66499
|
+
});
|
|
66500
|
+
}, r;
|
|
66501
|
+
}
|
|
66502
|
+
};
|
|
66499
66503
|
}
|
|
66500
66504
|
function KgWorkStationModal() {
|
|
66501
66505
|
var oa;
|
|
66502
|
-
const e = useID(), t = doKgWorkStation(e), r = useReduxDispatch(), n =
|
|
66506
|
+
const e = useID(), t = doKgWorkStation(e), r = useReduxDispatch(), n = useKgUtil(), a = useReduxSelector(getIsVisible(e)), s = useReduxSelector(getIsOpen(e)), [u, g] = reactExports.useState([]), [C, w] = reactExports.useState([]), [D, G] = reactExports.useState([]), ne = useReduxSelector(getWorkStation(e)), oe = useReduxSelector(getWorkStationArea(e)), se = ((oa = u.find((ia) => ia.devcod === C[0])) == null ? void 0 : oa.workstationAreas) ?? [], ue = {
|
|
66503
66507
|
hideSelectAll: !0,
|
|
66504
66508
|
onChange(ia) {
|
|
66505
66509
|
w(ia.length > 1 ? [ia[0]] : ia);
|
|
@@ -66534,9 +66538,8 @@ function KgWorkStationModal() {
|
|
|
66534
66538
|
const ia = () => {
|
|
66535
66539
|
r(setWorkStation({ id: e, workStation: u.find((ca) => ca.devcod === C[0]) ?? null })), r(setWorkStationArea({ id: e, workStationArea: se.find((ca) => ca.wrkare === D[0]) ?? null }));
|
|
66536
66540
|
};
|
|
66537
|
-
a ? (C[0] !== (ne == null ? void 0 : ne.devcod) || D[0] !== (oe == null ? void 0 : oe.wrkare)) && (ia(),
|
|
66541
|
+
a ? (C[0] !== (ne == null ? void 0 : ne.devcod) || D[0] !== (oe == null ? void 0 : oe.wrkare)) && (ia(), console.log("333"), n.confirm({
|
|
66538
66542
|
content: /* @__PURE__ */ jsxRuntimeExports.jsx(MemoizedFormattedMessage, { id: "KgWorkStation.reloadMessage" }),
|
|
66539
|
-
intl: n,
|
|
66540
66543
|
kgHideCancelButton: !0,
|
|
66541
66544
|
okButtonProps: { danger: !1 },
|
|
66542
66545
|
okText: /* @__PURE__ */ jsxRuntimeExports.jsx(MemoizedFormattedMessage, { id: "kg.refresh" }),
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './kg-util.hook.tsx';
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import { ModalFuncProps } from 'antd';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 工具方法.
|
|
5
|
-
*/
|
|
6
|
-
export declare class KgUtil {
|
|
2
|
+
export declare function useKgUtil(): {
|
|
7
3
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* <p>确认弹窗. 设置了多个属性的默认值, 简化使用.</p>
|
|
5
|
+
* <p>https://ant.design/components/modal#modalmethod</p>
|
|
6
|
+
*
|
|
11
7
|
* @param props
|
|
12
8
|
*/
|
|
13
|
-
|
|
14
|
-
}
|
|
9
|
+
confirm(props: IKgVarButtonModalProperties): ModalFunc;
|
|
10
|
+
};
|
|
15
11
|
/**
|
|
16
12
|
* 按钮确认弹窗的参数.
|
|
17
13
|
*/
|
|
18
14
|
export type IKgVarButtonModalProperties = ModalFuncProps & {
|
|
19
|
-
intl: IntlShape;
|
|
20
15
|
/** 是否隐藏取消按钮. */
|
|
21
16
|
kgHideCancelButton?: boolean;
|
|
22
17
|
};
|
package/src/util/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './kg.util.tsx';
|