szld-libs 0.3.80 → 0.3.82
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/dist/szld-components.es.js +7207 -7269
- package/dist/szld-components.umd.js +39 -39
- package/es/components/DynamicFormMobile/func.d.ts +1 -2
- package/es/components/DynamicFormMobile/func.js +1 -2
- package/es/components/DynamicFormMobile/myCheckbox/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/myCheckbox/index.js +15 -68
- package/es/components/DynamicFormMobile/myRadio/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/myRadio/index.js +15 -70
- package/es/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
- package/es/hooks/useUniversalTable.d.ts +3 -2
- package/es/hooks/useUniversalTable.js +51 -34
- package/lib/components/DynamicFormMobile/func.d.ts +1 -2
- package/lib/components/DynamicFormMobile/func.js +1 -2
- package/lib/components/DynamicFormMobile/myCheckbox/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/myCheckbox/index.js +15 -68
- package/lib/components/DynamicFormMobile/myRadio/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/myRadio/index.js +15 -70
- package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
- package/lib/hooks/useUniversalTable.d.ts +3 -2
- package/lib/hooks/useUniversalTable.js +51 -34
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ declare function useUniversalTable(): {
|
|
|
29
29
|
formItems: import("szld-libs/lib/components/CreateForm").CreateFormItemProps<import("szld-libs/lib/components/CreateForm").ValueType>[];
|
|
30
30
|
selList: any[];
|
|
31
31
|
}>;
|
|
32
|
-
handleUniversalDelete: ({ commonRequest, refresh, interfaceType, record, configData, title, okText, cancelText, getTitle, pageID, }: {
|
|
32
|
+
handleUniversalDelete: ({ commonRequest, refresh, interfaceType, record, configData, title, okText, cancelText, getTitle, pageID, deleteItem, }: {
|
|
33
33
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
34
34
|
refresh: () => void;
|
|
35
35
|
interfaceType?: string | undefined;
|
|
@@ -40,7 +40,8 @@ declare function useUniversalTable(): {
|
|
|
40
40
|
cancelText?: string | undefined;
|
|
41
41
|
getTitle?: ((pageID: string, dataID: string, defaultTitle?: string) => string) | undefined;
|
|
42
42
|
pageID?: string | undefined;
|
|
43
|
-
|
|
43
|
+
deleteItem?: Record<string, any> | undefined;
|
|
44
|
+
}) => Promise<void>;
|
|
44
45
|
handleUniversalSearch: ({ values, currentSelList, currentActive, onSearch, tabItems, }: {
|
|
45
46
|
values: any;
|
|
46
47
|
currentSelList: any[];
|
|
@@ -206,7 +206,6 @@ function useUniversalTable() {
|
|
|
206
206
|
formItemProps: { style: { marginBottom: 10, minWidth: 127 } }
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
;
|
|
210
209
|
return { formItems, selList: selListData };
|
|
211
210
|
} catch (error) {
|
|
212
211
|
return { formItems: [], selList: [] };
|
|
@@ -308,7 +307,7 @@ function useUniversalTable() {
|
|
|
308
307
|
return numA - numB;
|
|
309
308
|
});
|
|
310
309
|
};
|
|
311
|
-
const handleUniversalDelete = ({
|
|
310
|
+
const handleUniversalDelete = async ({
|
|
312
311
|
commonRequest,
|
|
313
312
|
refresh,
|
|
314
313
|
interfaceType = "YLFWLRInstanceDelete",
|
|
@@ -318,41 +317,59 @@ function useUniversalTable() {
|
|
|
318
317
|
okText,
|
|
319
318
|
cancelText,
|
|
320
319
|
getTitle,
|
|
321
|
-
pageID
|
|
320
|
+
pageID,
|
|
321
|
+
deleteItem
|
|
322
322
|
}) => {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const params = {
|
|
331
|
-
instanceid: record == null ? void 0 : record.instanceid,
|
|
332
|
-
asid: record == null ? void 0 : record.asid,
|
|
333
|
-
...obj
|
|
334
|
-
};
|
|
335
|
-
modal.confirm({
|
|
336
|
-
title: title || "",
|
|
337
|
-
icon: null,
|
|
338
|
-
okType: "danger",
|
|
339
|
-
okText: okText || "",
|
|
340
|
-
cancelText: cancelText || "",
|
|
341
|
-
onOk: () => {
|
|
342
|
-
return new Promise(async (resolve, reject) => {
|
|
343
|
-
const res = await commonRequest(interfaceType, params);
|
|
344
|
-
const msg = getTitle && getTitle(pageID || "", res == null ? void 0 : res["msg-code"], res == null ? void 0 : res.msg) || "删除失败";
|
|
345
|
-
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
346
|
-
message.success(msg);
|
|
347
|
-
refresh();
|
|
348
|
-
resolve(res);
|
|
349
|
-
} else {
|
|
350
|
-
message.error(msg || "删除失败");
|
|
351
|
-
reject(res);
|
|
352
|
-
}
|
|
323
|
+
var _a, _b;
|
|
324
|
+
try {
|
|
325
|
+
let mustAttrid = (configData == null ? void 0 : configData["must-attrid"]) || [];
|
|
326
|
+
const sourceNumber = (deleteItem == null ? void 0 : deleteItem["source-number"]) || "";
|
|
327
|
+
if (!(mustAttrid == null ? void 0 : mustAttrid.length) && sourceNumber) {
|
|
328
|
+
const res = await commonRequest("YLKHDSelPCParam", {
|
|
329
|
+
"source-number": Number(sourceNumber)
|
|
353
330
|
});
|
|
331
|
+
if (res && res.ReturnValue === 1 && res.data) {
|
|
332
|
+
mustAttrid = ((_b = (_a = res.data) == null ? void 0 : _a["sourceNumber"]) == null ? void 0 : _b["must-attrid"]) || [];
|
|
333
|
+
}
|
|
354
334
|
}
|
|
355
|
-
|
|
335
|
+
if (!(mustAttrid == null ? void 0 : mustAttrid.length)) {
|
|
336
|
+
message.error("请先配置must-attrid");
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
const obj = {};
|
|
340
|
+
for (const [key, value] of Object.entries(record)) {
|
|
341
|
+
if (mustAttrid.includes(key)) {
|
|
342
|
+
obj[key] = value;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const params = {
|
|
346
|
+
instanceid: record == null ? void 0 : record.instanceid,
|
|
347
|
+
asid: record == null ? void 0 : record.asid,
|
|
348
|
+
...obj
|
|
349
|
+
};
|
|
350
|
+
modal.confirm({
|
|
351
|
+
title: title || "",
|
|
352
|
+
icon: null,
|
|
353
|
+
okType: "danger",
|
|
354
|
+
okText: okText || "",
|
|
355
|
+
cancelText: cancelText || "",
|
|
356
|
+
onOk: () => {
|
|
357
|
+
return new Promise(async (resolve, reject) => {
|
|
358
|
+
const res = await commonRequest(interfaceType, params);
|
|
359
|
+
const msg = getTitle && getTitle(pageID || "", res == null ? void 0 : res["msg-code"], res == null ? void 0 : res.msg) || "删除失败";
|
|
360
|
+
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
361
|
+
message.success(msg);
|
|
362
|
+
refresh();
|
|
363
|
+
resolve(res);
|
|
364
|
+
} else {
|
|
365
|
+
message.error(msg || "删除失败");
|
|
366
|
+
reject(res);
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
} catch (error) {
|
|
372
|
+
}
|
|
356
373
|
};
|
|
357
374
|
const handleUniversalSearch = ({
|
|
358
375
|
values,
|