szld-libs 0.3.36 → 0.3.37
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.
|
@@ -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, isDefaultWidth, }: {
|
|
4
|
+
handleUniversalHeaderToColumns: ({ universalHeader, extraBtn, operationColumnConfig, attributeSetId, getTitle, downloadText, isDefaultWidth, otherLangPageId, }: {
|
|
5
5
|
universalHeader: any[];
|
|
6
6
|
extraBtn?: ((record: any, content: string, item: any) => ReactNode) | undefined;
|
|
7
7
|
operationColumnConfig?: any;
|
|
8
8
|
attributeSetId?: string | undefined;
|
|
9
|
-
getTitle?: ((commonId: string, code: string
|
|
9
|
+
getTitle?: ((commonId: string, code: string) => string) | undefined;
|
|
10
10
|
downloadText?: string | undefined;
|
|
11
11
|
isDefaultWidth?: boolean | undefined;
|
|
12
|
+
otherLangPageId?: string | undefined;
|
|
12
13
|
}) => any[] | import("antd/es/message/interface").MessageType;
|
|
13
14
|
handleSelListToFormItems: ({ selListData, handleSearch, handleReset, detail, styles, attributeSetId, commonRequest, commonRequestWidthParams, getTitle, searchText, resetText, }: {
|
|
14
15
|
selListData: any[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { handleBaseAttrList, handleSelectOptions } from "../utils/method";
|
|
3
3
|
import { handleGetAttrList } from "../utils/szxkFunc";
|
|
4
|
-
import { App, Flex, Space, Button } from "antd";
|
|
4
|
+
import { App, Flex, Space, Button, Tooltip } from "antd";
|
|
5
5
|
import { downloadUrl } from "../utils/download";
|
|
6
6
|
function useUniversalTable() {
|
|
7
7
|
const { message, modal } = App.useApp();
|
|
@@ -198,14 +198,15 @@ function useUniversalTable() {
|
|
|
198
198
|
attributeSetId,
|
|
199
199
|
getTitle,
|
|
200
200
|
downloadText = "下载",
|
|
201
|
-
isDefaultWidth = true
|
|
201
|
+
isDefaultWidth = true,
|
|
202
|
+
otherLangPageId
|
|
202
203
|
}) => {
|
|
203
204
|
if (!(universalHeader == null ? void 0 : universalHeader.length))
|
|
204
205
|
return message.error("请配置 universalHeader表头数据");
|
|
205
206
|
const sortedHeader = handleSortByHeaderNumber(universalHeader);
|
|
206
207
|
const list = sortedHeader == null ? void 0 : sortedHeader.map((item) => {
|
|
207
208
|
const column = {
|
|
208
|
-
title: attributeSetId ? (getTitle == null ? void 0 : getTitle(attributeSetId, item == null ? void 0 : item["header-attribute-id"]
|
|
209
|
+
title: attributeSetId ? (getTitle == null ? void 0 : getTitle(attributeSetId, item == null ? void 0 : item["header-attribute-id"])) || "" : (item == null ? void 0 : item["header-name"]) || "",
|
|
209
210
|
dataIndex: (item == null ? void 0 : item["header-attribute-id"]) || "",
|
|
210
211
|
width: isDefaultWidth ? (item == null ? void 0 : item["header-width"]) || 180 : void 0,
|
|
211
212
|
render: (text) => {
|
|
@@ -226,6 +227,9 @@ function useUniversalTable() {
|
|
|
226
227
|
}
|
|
227
228
|
return /* @__PURE__ */ jsx(Space, {});
|
|
228
229
|
}
|
|
230
|
+
if ((item == null ? void 0 : item["show-lang-data-id"]) && otherLangPageId) {
|
|
231
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: text, children: /* @__PURE__ */ jsx("span", { style: { cursor: "pointer" }, children: (getTitle == null ? void 0 : getTitle(otherLangPageId, text)) || "-" }) });
|
|
232
|
+
}
|
|
229
233
|
return text || "-";
|
|
230
234
|
}
|
|
231
235
|
};
|
|
@@ -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, isDefaultWidth, }: {
|
|
4
|
+
handleUniversalHeaderToColumns: ({ universalHeader, extraBtn, operationColumnConfig, attributeSetId, getTitle, downloadText, isDefaultWidth, otherLangPageId, }: {
|
|
5
5
|
universalHeader: any[];
|
|
6
6
|
extraBtn?: ((record: any, content: string, item: any) => ReactNode) | undefined;
|
|
7
7
|
operationColumnConfig?: any;
|
|
8
8
|
attributeSetId?: string | undefined;
|
|
9
|
-
getTitle?: ((commonId: string, code: string
|
|
9
|
+
getTitle?: ((commonId: string, code: string) => string) | undefined;
|
|
10
10
|
downloadText?: string | undefined;
|
|
11
11
|
isDefaultWidth?: boolean | undefined;
|
|
12
|
+
otherLangPageId?: string | undefined;
|
|
12
13
|
}) => any[] | import("antd/es/message/interface").MessageType;
|
|
13
14
|
handleSelListToFormItems: ({ selListData, handleSearch, handleReset, detail, styles, attributeSetId, commonRequest, commonRequestWidthParams, getTitle, searchText, resetText, }: {
|
|
14
15
|
selListData: any[];
|
|
@@ -199,14 +199,15 @@ function useUniversalTable() {
|
|
|
199
199
|
attributeSetId,
|
|
200
200
|
getTitle,
|
|
201
201
|
downloadText = "下载",
|
|
202
|
-
isDefaultWidth = true
|
|
202
|
+
isDefaultWidth = true,
|
|
203
|
+
otherLangPageId
|
|
203
204
|
}) => {
|
|
204
205
|
if (!(universalHeader == null ? void 0 : universalHeader.length))
|
|
205
206
|
return message.error("请配置 universalHeader表头数据");
|
|
206
207
|
const sortedHeader = handleSortByHeaderNumber(universalHeader);
|
|
207
208
|
const list = sortedHeader == null ? void 0 : sortedHeader.map((item) => {
|
|
208
209
|
const column = {
|
|
209
|
-
title: attributeSetId ? (getTitle == null ? void 0 : getTitle(attributeSetId, item == null ? void 0 : item["header-attribute-id"]
|
|
210
|
+
title: attributeSetId ? (getTitle == null ? void 0 : getTitle(attributeSetId, item == null ? void 0 : item["header-attribute-id"])) || "" : (item == null ? void 0 : item["header-name"]) || "",
|
|
210
211
|
dataIndex: (item == null ? void 0 : item["header-attribute-id"]) || "",
|
|
211
212
|
width: isDefaultWidth ? (item == null ? void 0 : item["header-width"]) || 180 : void 0,
|
|
212
213
|
render: (text) => {
|
|
@@ -227,6 +228,9 @@ function useUniversalTable() {
|
|
|
227
228
|
}
|
|
228
229
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Space, {});
|
|
229
230
|
}
|
|
231
|
+
if ((item == null ? void 0 : item["show-lang-data-id"]) && otherLangPageId) {
|
|
232
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { cursor: "pointer" }, children: (getTitle == null ? void 0 : getTitle(otherLangPageId, text)) || "-" }) });
|
|
233
|
+
}
|
|
230
234
|
return text || "-";
|
|
231
235
|
}
|
|
232
236
|
};
|