szld-libs 0.4.54 → 0.4.57
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 +2969 -2965
- package/dist/szld-components.umd.js +58 -58
- package/es/hooks/useUniversalTable.d.ts +4 -3
- package/es/hooks/useUniversalTable.js +7 -4
- package/es/mock/index.js +56 -567
- package/es/utils/method.js +3 -2
- package/lib/hooks/useUniversalTable.d.ts +4 -3
- package/lib/hooks/useUniversalTable.js +7 -4
- package/lib/mock/index.js +56 -567
- package/lib/utils/method.js +3 -2
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
declare function useUniversalTable(): {
|
|
4
|
-
handleUniversalHeaderToColumns: ({ universalHeader, extraBtn, operationColumnConfig, attributeSetId, getTitle, downloadText,
|
|
4
|
+
handleUniversalHeaderToColumns: ({ universalHeader, extraBtn, operationColumnConfig, attributeSetId, getTitle, downloadText, otherLangPageId, objDefaultLangPageId, }: {
|
|
5
5
|
universalHeader: any[];
|
|
6
|
-
extraBtn?:
|
|
6
|
+
extraBtn?: {
|
|
7
|
+
[key: string]: (record: any, content: string, item: any) => ReactNode;
|
|
8
|
+
} | ((record: any, content: string, item: any) => ReactNode) | undefined;
|
|
7
9
|
operationColumnConfig?: any;
|
|
8
10
|
attributeSetId?: string | undefined;
|
|
9
11
|
getTitle?: ((pageID: string, dataID: string) => string) | undefined;
|
|
10
12
|
downloadText?: string | undefined;
|
|
11
|
-
isDefaultWidth?: boolean | undefined;
|
|
12
13
|
otherLangPageId?: string | undefined;
|
|
13
14
|
objDefaultLangPageId?: string | undefined;
|
|
14
15
|
}) => any[] | import("antd/es/message/interface").MessageType;
|
|
@@ -219,7 +219,6 @@ function useUniversalTable() {
|
|
|
219
219
|
attributeSetId,
|
|
220
220
|
getTitle,
|
|
221
221
|
downloadText = "下载",
|
|
222
|
-
isDefaultWidth = true,
|
|
223
222
|
otherLangPageId,
|
|
224
223
|
objDefaultLangPageId = "5000000"
|
|
225
224
|
// 处理这种数据时 如果没有拼接页面编号则使用默认编号{"list":["021"],"delimiter":""}
|
|
@@ -231,7 +230,7 @@ function useUniversalTable() {
|
|
|
231
230
|
const column = {
|
|
232
231
|
title: attributeSetId ? (getTitle == null ? void 0 : getTitle(attributeSetId, item == null ? void 0 : item["header-attribute-id"])) || "" : (item == null ? void 0 : item["header-name"]) || "",
|
|
233
232
|
dataIndex: (item == null ? void 0 : item["header-attribute-id"]) || "",
|
|
234
|
-
width:
|
|
233
|
+
width: (item == null ? void 0 : item["header-width"]) || void 0,
|
|
235
234
|
render: (text, record) => {
|
|
236
235
|
var _a, _b, _c, _d;
|
|
237
236
|
if (text && text && typeof text === "string" && (text == null ? void 0 : text.includes("FileName")) && (text == null ? void 0 : text.includes("FilePath"))) {
|
|
@@ -275,6 +274,7 @@ function useUniversalTable() {
|
|
|
275
274
|
const showBtn = item == null ? void 0 : item["show-btn"];
|
|
276
275
|
if (mulAttrConfig && mulAttrConfig.list && Array.isArray(mulAttrConfig.list)) {
|
|
277
276
|
column.render = (_, record) => {
|
|
277
|
+
var _a;
|
|
278
278
|
const { list: list2, delimiter = "," } = mulAttrConfig;
|
|
279
279
|
const values = list2.map((attrId) => {
|
|
280
280
|
if (!attrId)
|
|
@@ -285,17 +285,20 @@ function useUniversalTable() {
|
|
|
285
285
|
if (showBtn && extraBtn) {
|
|
286
286
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
287
287
|
content ?? "-",
|
|
288
|
-
extraBtn
|
|
288
|
+
typeof extraBtn === "function" ? extraBtn(record, content, item) : null,
|
|
289
|
+
typeof extraBtn === "object" ? (_a = extraBtn == null ? void 0 : extraBtn[item == null ? void 0 : item["header-attribute-id"]]) == null ? void 0 : _a.call(extraBtn, record, content, item) : null
|
|
289
290
|
] });
|
|
290
291
|
}
|
|
291
292
|
return content || "-";
|
|
292
293
|
};
|
|
293
294
|
} else if (showBtn && extraBtn) {
|
|
294
295
|
column.render = (_, record) => {
|
|
296
|
+
var _a;
|
|
295
297
|
const content = record[column.dataIndex] || "";
|
|
296
298
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
297
299
|
content || "-",
|
|
298
|
-
extraBtn(record, content, item)
|
|
300
|
+
typeof extraBtn === "function" ? extraBtn(record, content, item) : null,
|
|
301
|
+
typeof extraBtn === "object" ? (_a = extraBtn == null ? void 0 : extraBtn[item == null ? void 0 : item["header-attribute-id"]]) == null ? void 0 : _a.call(extraBtn, record, content, item) : null
|
|
299
302
|
] });
|
|
300
303
|
};
|
|
301
304
|
}
|