szld-libs 0.3.55 → 0.3.56

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.
@@ -12,7 +12,7 @@ interface IAttrSetDetailRendererProps {
12
12
  layoutType?: 'row' | 'flex';
13
13
  }
14
14
  export default function useDetailRender({ labelSpan, valueSpan, imgWidth, imgHeight, layoutType, }: IAttrSetDetailRendererProps): {
15
- renderDetail: ({ attrList, detailList, span, type, universalHeader, beforeExtraValue, operationColumn, }: {
15
+ renderDetail: ({ attrList, detailList, span, type, universalHeader, beforeExtraValue, operationColumn, langConfig, }: {
16
16
  attrList?: any[] | undefined;
17
17
  detailList?: any[] | undefined;
18
18
  span?: number | undefined;
@@ -20,6 +20,7 @@ export default function useDetailRender({ labelSpan, valueSpan, imgWidth, imgHei
20
20
  universalHeader?: any[] | undefined;
21
21
  beforeExtraValue?: string | undefined;
22
22
  operationColumn?: any;
23
+ langConfig?: any[] | undefined;
23
24
  }) => import("react/jsx-runtime").JSX.Element;
24
25
  };
25
26
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
2
  import { App, Row, Col, Flex, Table, Space, Image } from "antd";
3
3
  import { handleSetTableRowColor } from "../utils/szxkFunc";
4
- import { getJson, base64ToString } from "../utils/method";
4
+ import { getJson, base64ToString, getTitle } from "../utils/method";
5
5
  import { useMemoizedFn } from "ahooks";
6
6
  import { Fragment } from "react";
7
7
  function useDetailRender({
@@ -88,7 +88,7 @@ function useDetailRender({
88
88
  ] })
89
89
  ] }, item == null ? void 0 : item.attrid);
90
90
  };
91
- const renderTextAttr = (item, span, beforeExtraValue) => {
91
+ const renderTextAttr = (item, span, beforeExtraValue, langConfig) => {
92
92
  return /* @__PURE__ */ jsxs(Fragment, { children: [
93
93
  layoutType === "flex" && /* @__PURE__ */ jsx(Col, { span, children: /* @__PURE__ */ jsxs(Flex, { children: [
94
94
  /* @__PURE__ */ jsxs("span", { style: { flexShrink: 0 }, children: [
@@ -98,15 +98,14 @@ function useDetailRender({
98
98
  /* @__PURE__ */ jsxs("span", { style: { wordWrap: "break-word" }, children: [
99
99
  beforeExtraValue || "",
100
100
  " ",
101
- (item == null ? void 0 : item.attrvalue) || "-",
102
- " "
101
+ getTitle(langConfig || [], (item == null ? void 0 : item.attrvalue) || "-")
103
102
  ] })
104
103
  ] }) }),
105
104
  layoutType === "row" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
106
105
  /* @__PURE__ */ jsx(Col, { span: labelSpan, children: item == null ? void 0 : item.attrname }),
107
106
  /* @__PURE__ */ jsxs(Col, { span: valueSpan, style: { wordWrap: "break-word" }, children: [
108
107
  beforeExtraValue || "",
109
- (item == null ? void 0 : item.attrvalue) || "-"
108
+ getTitle(langConfig || [], (item == null ? void 0 : item.attrvalue) || "-")
110
109
  ] })
111
110
  ] })
112
111
  ] }, item == null ? void 0 : item.attrid);
@@ -115,7 +114,8 @@ function useDetailRender({
115
114
  detailList = [],
116
115
  attrList = [],
117
116
  universalHeader = [],
118
- operationColumn
117
+ operationColumn,
118
+ langConfig = []
119
119
  }) => {
120
120
  var _a;
121
121
  let columns = [];
@@ -124,7 +124,10 @@ function useDetailRender({
124
124
  title: item == null ? void 0 : item["header-name"],
125
125
  dataIndex: item == null ? void 0 : item["header-attribute-id"],
126
126
  key: item == null ? void 0 : item["header-attribute-id"],
127
- width: item == null ? void 0 : item["header-width"]
127
+ width: item == null ? void 0 : item["header-width"],
128
+ render: (text, record) => {
129
+ return getTitle(langConfig || [], text);
130
+ }
128
131
  }));
129
132
  } else {
130
133
  columns = (_a = attrList == null ? void 0 : attrList[0]) == null ? void 0 : _a.map((item) => {
@@ -133,7 +136,10 @@ function useDetailRender({
133
136
  title: item == null ? void 0 : item.attrname,
134
137
  dataIndex: item == null ? void 0 : item.attrid,
135
138
  key: item == null ? void 0 : item.attrid,
136
- width: ((_a2 = item == null ? void 0 : item.json) == null ? void 0 : _a2["input-width"]) || 200
139
+ width: ((_a2 = item == null ? void 0 : item.json) == null ? void 0 : _a2["input-width"]) || 200,
140
+ render: (text, record) => {
141
+ return getTitle(langConfig || [], text);
142
+ }
137
143
  };
138
144
  });
139
145
  }
@@ -175,7 +181,8 @@ function useDetailRender({
175
181
  type = "form",
176
182
  universalHeader = [],
177
183
  beforeExtraValue = "",
178
- operationColumn
184
+ operationColumn,
185
+ langConfig = []
179
186
  }) => {
180
187
  if (type === "table") {
181
188
  return /* @__PURE__ */ jsx(Fragment, { children: renderTableDetail({ detailList, attrList, universalHeader, operationColumn }) });
@@ -193,7 +200,7 @@ function useDetailRender({
193
200
  if ((info == null ? void 0 : info.input) === "radio-card") {
194
201
  return renderRadioCardAttr(item, span);
195
202
  }
196
- return renderTextAttr(item, span, beforeExtraValue);
203
+ return renderTextAttr(item, span, beforeExtraValue, langConfig);
197
204
  }) });
198
205
  }
199
206
  );
@@ -12,7 +12,7 @@ interface IAttrSetDetailRendererProps {
12
12
  layoutType?: 'row' | 'flex';
13
13
  }
14
14
  export default function useDetailRender({ labelSpan, valueSpan, imgWidth, imgHeight, layoutType, }: IAttrSetDetailRendererProps): {
15
- renderDetail: ({ attrList, detailList, span, type, universalHeader, beforeExtraValue, operationColumn, }: {
15
+ renderDetail: ({ attrList, detailList, span, type, universalHeader, beforeExtraValue, operationColumn, langConfig, }: {
16
16
  attrList?: any[] | undefined;
17
17
  detailList?: any[] | undefined;
18
18
  span?: number | undefined;
@@ -20,6 +20,7 @@ export default function useDetailRender({ labelSpan, valueSpan, imgWidth, imgHei
20
20
  universalHeader?: any[] | undefined;
21
21
  beforeExtraValue?: string | undefined;
22
22
  operationColumn?: any;
23
+ langConfig?: any[] | undefined;
23
24
  }) => import("react/jsx-runtime").JSX.Element;
24
25
  };
25
26
  export {};
@@ -89,7 +89,7 @@ function useDetailRender({
89
89
  ] })
90
90
  ] }, item == null ? void 0 : item.attrid);
91
91
  };
92
- const renderTextAttr = (item, span, beforeExtraValue) => {
92
+ const renderTextAttr = (item, span, beforeExtraValue, langConfig) => {
93
93
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
94
94
  layoutType === "flex" && /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
95
95
  /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { flexShrink: 0 }, children: [
@@ -99,15 +99,14 @@ function useDetailRender({
99
99
  /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { wordWrap: "break-word" }, children: [
100
100
  beforeExtraValue || "",
101
101
  " ",
102
- (item == null ? void 0 : item.attrvalue) || "-",
103
- " "
102
+ method.getTitle(langConfig || [], (item == null ? void 0 : item.attrvalue) || "-")
104
103
  ] })
105
104
  ] }) }),
106
105
  layoutType === "row" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
107
106
  /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: labelSpan, children: item == null ? void 0 : item.attrname }),
108
107
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Col, { span: valueSpan, style: { wordWrap: "break-word" }, children: [
109
108
  beforeExtraValue || "",
110
- (item == null ? void 0 : item.attrvalue) || "-"
109
+ method.getTitle(langConfig || [], (item == null ? void 0 : item.attrvalue) || "-")
111
110
  ] })
112
111
  ] })
113
112
  ] }, item == null ? void 0 : item.attrid);
@@ -116,7 +115,8 @@ function useDetailRender({
116
115
  detailList = [],
117
116
  attrList = [],
118
117
  universalHeader = [],
119
- operationColumn
118
+ operationColumn,
119
+ langConfig = []
120
120
  }) => {
121
121
  var _a;
122
122
  let columns = [];
@@ -125,7 +125,10 @@ function useDetailRender({
125
125
  title: item == null ? void 0 : item["header-name"],
126
126
  dataIndex: item == null ? void 0 : item["header-attribute-id"],
127
127
  key: item == null ? void 0 : item["header-attribute-id"],
128
- width: item == null ? void 0 : item["header-width"]
128
+ width: item == null ? void 0 : item["header-width"],
129
+ render: (text, record) => {
130
+ return method.getTitle(langConfig || [], text);
131
+ }
129
132
  }));
130
133
  } else {
131
134
  columns = (_a = attrList == null ? void 0 : attrList[0]) == null ? void 0 : _a.map((item) => {
@@ -134,7 +137,10 @@ function useDetailRender({
134
137
  title: item == null ? void 0 : item.attrname,
135
138
  dataIndex: item == null ? void 0 : item.attrid,
136
139
  key: item == null ? void 0 : item.attrid,
137
- width: ((_a2 = item == null ? void 0 : item.json) == null ? void 0 : _a2["input-width"]) || 200
140
+ width: ((_a2 = item == null ? void 0 : item.json) == null ? void 0 : _a2["input-width"]) || 200,
141
+ render: (text, record) => {
142
+ return method.getTitle(langConfig || [], text);
143
+ }
138
144
  };
139
145
  });
140
146
  }
@@ -176,7 +182,8 @@ function useDetailRender({
176
182
  type = "form",
177
183
  universalHeader = [],
178
184
  beforeExtraValue = "",
179
- operationColumn
185
+ operationColumn,
186
+ langConfig = []
180
187
  }) => {
181
188
  if (type === "table") {
182
189
  return /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: renderTableDetail({ detailList, attrList, universalHeader, operationColumn }) });
@@ -194,7 +201,7 @@ function useDetailRender({
194
201
  if ((info == null ? void 0 : info.input) === "radio-card") {
195
202
  return renderRadioCardAttr(item, span);
196
203
  }
197
- return renderTextAttr(item, span, beforeExtraValue);
204
+ return renderTextAttr(item, span, beforeExtraValue, langConfig);
198
205
  }) });
199
206
  }
200
207
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.3.55",
4
+ "version": "0.3.56",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",