@kengic/core.react 0.0.1-beta.50 → 0.0.1-beta.52
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,103 +66454,106 @@ 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
|
-
var
|
|
66502
|
-
const e = useID(), t = doKgWorkStation(e), r = useReduxDispatch(), n = useIntl(), a = useReduxSelector(getIsVisible(e)),
|
|
66505
|
+
var ia;
|
|
66506
|
+
const e = useID(), t = doKgWorkStation(e), r = useReduxDispatch(), n = useIntl(), a = useKgUtil(), s = useReduxSelector(getIsVisible(e)), u = useReduxSelector(getIsOpen(e)), [g, C] = reactExports.useState([]), [w, D] = reactExports.useState([]), [G, ne] = reactExports.useState([]), oe = useReduxSelector(getWorkStation(e)), se = useReduxSelector(getWorkStationArea(e)), ue = ((ia = g.find((ca) => ca.devcod === w[0])) == null ? void 0 : ia.workstationAreas) ?? [], ae = {
|
|
66503
66507
|
hideSelectAll: !0,
|
|
66504
|
-
onChange(
|
|
66505
|
-
|
|
66508
|
+
onChange(ca) {
|
|
66509
|
+
D(ca.length > 1 ? [ca[0]] : ca);
|
|
66506
66510
|
},
|
|
66507
|
-
selectedRowKeys:
|
|
66508
|
-
},
|
|
66511
|
+
selectedRowKeys: w
|
|
66512
|
+
}, ct = {
|
|
66509
66513
|
hideSelectAll: !0,
|
|
66510
|
-
onChange(
|
|
66511
|
-
|
|
66514
|
+
onChange(ca) {
|
|
66515
|
+
ne(ca.length > 1 ? [ca[0]] : ca);
|
|
66512
66516
|
},
|
|
66513
|
-
selectedRowKeys:
|
|
66514
|
-
},
|
|
66517
|
+
selectedRowKeys: G
|
|
66518
|
+
}, ea = [
|
|
66515
66519
|
{
|
|
66516
66520
|
dataIndex: "devcodDsc",
|
|
66517
|
-
render: (
|
|
66521
|
+
render: (ca) => ca,
|
|
66518
66522
|
title: /* @__PURE__ */ jsxRuntimeExports.jsx(MemoizedFormattedMessage, { id: "KgWorkStation.workStation" })
|
|
66519
66523
|
}
|
|
66520
|
-
],
|
|
66524
|
+
], ut = [
|
|
66521
66525
|
{
|
|
66522
66526
|
dataIndex: "wrkareDsc",
|
|
66523
|
-
render: (
|
|
66527
|
+
render: (ca) => ca,
|
|
66524
66528
|
title: /* @__PURE__ */ jsxRuntimeExports.jsx(MemoizedFormattedMessage, { id: "KgWorkStation.workStationArea" })
|
|
66525
66529
|
}
|
|
66526
66530
|
];
|
|
66527
66531
|
reactExports.useEffect(() => {
|
|
66528
|
-
|
|
66529
|
-
}, [
|
|
66530
|
-
function
|
|
66532
|
+
u && oa();
|
|
66533
|
+
}, [u]);
|
|
66534
|
+
function ra() {
|
|
66531
66535
|
t.closeModal();
|
|
66532
66536
|
}
|
|
66533
|
-
function
|
|
66534
|
-
const
|
|
66535
|
-
r(setWorkStation({ id: e, workStation:
|
|
66537
|
+
function ta() {
|
|
66538
|
+
const ca = () => {
|
|
66539
|
+
r(setWorkStation({ id: e, workStation: g.find((sa) => sa.devcod === w[0]) ?? null })), r(setWorkStationArea({ id: e, workStationArea: ue.find((sa) => sa.wrkare === G[0]) ?? null }));
|
|
66536
66540
|
};
|
|
66537
|
-
|
|
66538
|
-
content:
|
|
66539
|
-
intl: n,
|
|
66541
|
+
s ? (w[0] !== (oe == null ? void 0 : oe.devcod) || G[0] !== (se == null ? void 0 : se.wrkare)) && (ca(), console.log("333"), a.confirm({
|
|
66542
|
+
content: n.formatMessage({ id: "KgWorkStation.reloadMessage" }),
|
|
66540
66543
|
kgHideCancelButton: !0,
|
|
66541
66544
|
okButtonProps: { danger: !1 },
|
|
66542
|
-
okText:
|
|
66545
|
+
okText: n.formatMessage({ id: "kg.refresh" }),
|
|
66543
66546
|
onOk: () => {
|
|
66544
66547
|
window.location.reload();
|
|
66545
66548
|
}
|
|
66546
|
-
})) : (
|
|
66549
|
+
})) : (ca(), emit({ event: "onOk", id: e, parameter: {} })), t.closeModal();
|
|
66547
66550
|
}
|
|
66548
|
-
async function
|
|
66549
|
-
var
|
|
66550
|
-
const
|
|
66551
|
-
|
|
66551
|
+
async function oa() {
|
|
66552
|
+
var sa, va;
|
|
66553
|
+
const ca = ((sa = await List({ params: { pageNo: 1, pageSize: 999 } })) == null ? void 0 : sa.records) ?? [];
|
|
66554
|
+
ca.find((ga) => ga.devcod === (oe == null ? void 0 : oe.devcod)) ? (D([oe == null ? void 0 : oe.devcod]), (va = oe == null ? void 0 : oe.workstationAreas) != null && va.find((ga) => ga.wrkare === (se == null ? void 0 : se.wrkare)) ? ne([se == null ? void 0 : se.wrkare]) : ne([])) : (D([]), ne([])), C(ca);
|
|
66552
66555
|
}
|
|
66553
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children:
|
|
66556
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: u && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
66554
66557
|
KgModal,
|
|
66555
66558
|
{
|
|
66556
66559
|
open: !0,
|
|
@@ -66559,22 +66562,22 @@ function KgWorkStationModal() {
|
|
|
66559
66562
|
confirmLoading: !1,
|
|
66560
66563
|
wrapClassName: "kgcrant-kg-work-station-modal",
|
|
66561
66564
|
zIndex: 2e3,
|
|
66562
|
-
onCancel:
|
|
66563
|
-
onOk:
|
|
66565
|
+
onCancel: ra,
|
|
66566
|
+
onOk: ta,
|
|
66564
66567
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex" }, children: [
|
|
66565
66568
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: "1", borderRight: "1px solid #f0f0f0" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
66566
66569
|
ForwardTable,
|
|
66567
66570
|
{
|
|
66568
66571
|
className: "kg-flex-table",
|
|
66569
|
-
dataSource:
|
|
66570
|
-
columns:
|
|
66572
|
+
dataSource: g,
|
|
66573
|
+
columns: ea,
|
|
66571
66574
|
size: "small",
|
|
66572
66575
|
pagination: !1,
|
|
66573
|
-
rowSelection:
|
|
66574
|
-
rowKey: (
|
|
66575
|
-
onRow: (
|
|
66576
|
+
rowSelection: ae,
|
|
66577
|
+
rowKey: (ca) => ca.devcod,
|
|
66578
|
+
onRow: (ca) => ({
|
|
66576
66579
|
onClick() {
|
|
66577
|
-
|
|
66580
|
+
w.includes(ca.devcod) ? D([]) : D([ca.devcod]);
|
|
66578
66581
|
}
|
|
66579
66582
|
})
|
|
66580
66583
|
}
|
|
@@ -66583,15 +66586,15 @@ function KgWorkStationModal() {
|
|
|
66583
66586
|
ForwardTable,
|
|
66584
66587
|
{
|
|
66585
66588
|
className: "kg-flex-table",
|
|
66586
|
-
dataSource:
|
|
66587
|
-
columns:
|
|
66589
|
+
dataSource: ue,
|
|
66590
|
+
columns: ut,
|
|
66588
66591
|
size: "small",
|
|
66589
66592
|
pagination: !1,
|
|
66590
|
-
rowSelection:
|
|
66591
|
-
rowKey: (
|
|
66592
|
-
onRow: (
|
|
66593
|
+
rowSelection: ct,
|
|
66594
|
+
rowKey: (ca) => ca.wrkare,
|
|
66595
|
+
onRow: (ca) => ({
|
|
66593
66596
|
onClick() {
|
|
66594
|
-
|
|
66597
|
+
G.includes(ca.wrkare) ? ne([]) : ne([ca.wrkare]);
|
|
66595
66598
|
}
|
|
66596
66599
|
})
|
|
66597
66600
|
}
|
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';
|