szld-libs 0.3.47 → 0.3.48
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.
|
@@ -27,12 +27,17 @@ declare function useUniversalTable(): {
|
|
|
27
27
|
formItems: import("szld-libs/lib/components/CreateForm").CreateFormItemProps<import("szld-libs/lib/components/CreateForm").ValueType>[];
|
|
28
28
|
selList: any[];
|
|
29
29
|
}>;
|
|
30
|
-
handleUniversalDelete: ({ commonRequest, refresh, interfaceType, record, configData, }: {
|
|
30
|
+
handleUniversalDelete: ({ commonRequest, refresh, interfaceType, record, configData, title, okText, cancelText, getTitle, pageID, }: {
|
|
31
31
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
32
32
|
refresh: () => void;
|
|
33
33
|
interfaceType?: string | undefined;
|
|
34
34
|
record?: any;
|
|
35
35
|
configData?: any;
|
|
36
|
+
title?: string | undefined;
|
|
37
|
+
okText?: string | undefined;
|
|
38
|
+
cancelText?: string | undefined;
|
|
39
|
+
getTitle?: ((pageID: string, dataID: string, defaultTitle?: string) => string) | undefined;
|
|
40
|
+
pageID?: string | undefined;
|
|
36
41
|
}) => void;
|
|
37
42
|
handleUniversalSearch: ({ values, currentSelList, currentActive, onSearch, tabItems, }: {
|
|
38
43
|
values: any;
|
|
@@ -280,7 +280,12 @@ function useUniversalTable() {
|
|
|
280
280
|
refresh,
|
|
281
281
|
interfaceType = "YLFWLRInstanceDelete",
|
|
282
282
|
record,
|
|
283
|
-
configData
|
|
283
|
+
configData,
|
|
284
|
+
title,
|
|
285
|
+
okText,
|
|
286
|
+
cancelText,
|
|
287
|
+
getTitle,
|
|
288
|
+
pageID
|
|
284
289
|
}) => {
|
|
285
290
|
const mustAttrid = (configData == null ? void 0 : configData["must-attrid"]) || [];
|
|
286
291
|
const obj = {};
|
|
@@ -295,18 +300,21 @@ function useUniversalTable() {
|
|
|
295
300
|
...obj
|
|
296
301
|
};
|
|
297
302
|
modal.confirm({
|
|
298
|
-
title: "
|
|
303
|
+
title: title || "",
|
|
299
304
|
icon: null,
|
|
300
305
|
okType: "danger",
|
|
306
|
+
okText: okText || "",
|
|
307
|
+
cancelText: cancelText || "",
|
|
301
308
|
onOk: () => {
|
|
302
309
|
return new Promise(async (resolve, reject) => {
|
|
303
310
|
const res = await commonRequest(interfaceType, params);
|
|
311
|
+
const msg = getTitle && getTitle(pageID || "", res == null ? void 0 : res["msg-code"], res == null ? void 0 : res.msg) || "删除失败";
|
|
304
312
|
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
305
|
-
message.success(
|
|
313
|
+
message.success(msg);
|
|
306
314
|
refresh();
|
|
307
315
|
resolve(res);
|
|
308
316
|
} else {
|
|
309
|
-
message.error(
|
|
317
|
+
message.error(msg || "删除失败");
|
|
310
318
|
reject(res);
|
|
311
319
|
}
|
|
312
320
|
});
|
|
@@ -27,12 +27,17 @@ declare function useUniversalTable(): {
|
|
|
27
27
|
formItems: import("szld-libs/lib/components/CreateForm").CreateFormItemProps<import("szld-libs/lib/components/CreateForm").ValueType>[];
|
|
28
28
|
selList: any[];
|
|
29
29
|
}>;
|
|
30
|
-
handleUniversalDelete: ({ commonRequest, refresh, interfaceType, record, configData, }: {
|
|
30
|
+
handleUniversalDelete: ({ commonRequest, refresh, interfaceType, record, configData, title, okText, cancelText, getTitle, pageID, }: {
|
|
31
31
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
32
32
|
refresh: () => void;
|
|
33
33
|
interfaceType?: string | undefined;
|
|
34
34
|
record?: any;
|
|
35
35
|
configData?: any;
|
|
36
|
+
title?: string | undefined;
|
|
37
|
+
okText?: string | undefined;
|
|
38
|
+
cancelText?: string | undefined;
|
|
39
|
+
getTitle?: ((pageID: string, dataID: string, defaultTitle?: string) => string) | undefined;
|
|
40
|
+
pageID?: string | undefined;
|
|
36
41
|
}) => void;
|
|
37
42
|
handleUniversalSearch: ({ values, currentSelList, currentActive, onSearch, tabItems, }: {
|
|
38
43
|
values: any;
|
|
@@ -281,7 +281,12 @@ function useUniversalTable() {
|
|
|
281
281
|
refresh,
|
|
282
282
|
interfaceType = "YLFWLRInstanceDelete",
|
|
283
283
|
record,
|
|
284
|
-
configData
|
|
284
|
+
configData,
|
|
285
|
+
title,
|
|
286
|
+
okText,
|
|
287
|
+
cancelText,
|
|
288
|
+
getTitle,
|
|
289
|
+
pageID
|
|
285
290
|
}) => {
|
|
286
291
|
const mustAttrid = (configData == null ? void 0 : configData["must-attrid"]) || [];
|
|
287
292
|
const obj = {};
|
|
@@ -296,18 +301,21 @@ function useUniversalTable() {
|
|
|
296
301
|
...obj
|
|
297
302
|
};
|
|
298
303
|
modal.confirm({
|
|
299
|
-
title: "
|
|
304
|
+
title: title || "",
|
|
300
305
|
icon: null,
|
|
301
306
|
okType: "danger",
|
|
307
|
+
okText: okText || "",
|
|
308
|
+
cancelText: cancelText || "",
|
|
302
309
|
onOk: () => {
|
|
303
310
|
return new Promise(async (resolve, reject) => {
|
|
304
311
|
const res = await commonRequest(interfaceType, params);
|
|
312
|
+
const msg = getTitle && getTitle(pageID || "", res == null ? void 0 : res["msg-code"], res == null ? void 0 : res.msg) || "删除失败";
|
|
305
313
|
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
306
|
-
message.success(
|
|
314
|
+
message.success(msg);
|
|
307
315
|
refresh();
|
|
308
316
|
resolve(res);
|
|
309
317
|
} else {
|
|
310
|
-
message.error(
|
|
318
|
+
message.error(msg || "删除失败");
|
|
311
319
|
reject(res);
|
|
312
320
|
}
|
|
313
321
|
});
|