@cqsjjb/jjb-react-admin-component 3.0.21 → 3.0.23

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.
@@ -5,7 +5,21 @@ import { FilePdfOutlined, LinkOutlined } from '@ant-design/icons';
5
5
  import { Modal, Descriptions, Empty, Image, Tooltip, Tag, Spin } from 'antd';
6
6
  const formilyItemMargin = new Map([['small', 8], ['middle', 12], ['default', 16]]);
7
7
  export default function FormilyDescriptions(props) {
8
- const dataSource = tools.getDynamicFormilyFields(props.schema, props.values);
8
+ const [regions, setRegions] = React.useState([]);
9
+ React.useEffect(() => {
10
+ fetch(`${window.location.origin}/system/operation/regions`, {
11
+ headers: {
12
+ token: sessionStorage.token
13
+ }
14
+ }).then(res => res.json()).then(res => {
15
+ if (res.success) {
16
+ setRegions(res.data);
17
+ }
18
+ });
19
+ }, []);
20
+ const dataSource = tools.getDynamicFormilyFields(props.schema, props.values, {
21
+ regions
22
+ });
9
23
  return dataSource.length === 0 ? /*#__PURE__*/React.createElement(Empty, {
10
24
  image: Empty.PRESENTED_IMAGE_SIMPLE
11
25
  }) : /*#__PURE__*/React.createElement(React.Fragment, null, dataSource.map((item, index) => {
@@ -35,7 +49,7 @@ export default function FormilyDescriptions(props) {
35
49
  title: props.title,
36
50
  extra: props.extra,
37
51
  layout: props.layout || 'vertical',
38
- column: 3,
52
+ column: props.column,
39
53
  labelStyle: props.labelStyle,
40
54
  contentStyle: props.contentStyle
41
55
  });
@@ -95,8 +109,10 @@ function ItemRender(props) {
95
109
  return tools.textPlaceholder(next.name);
96
110
  }
97
111
  })) : tools.textPlaceholder() : /*#__PURE__*/React.createElement(RenderText, {
98
- value: data.value
99
- }) /*tools.textPlaceholder(data.value)*/, /*#__PURE__*/React.createElement(Modal, {
112
+ name: data.name,
113
+ value: data.value,
114
+ renderItemText: props.renderItemText
115
+ }), /*#__PURE__*/React.createElement(Modal, {
100
116
  destroyOnClose: true,
101
117
  title: "\u67E5\u770BPDF",
102
118
  open: open,
@@ -164,5 +180,8 @@ function RenderText(props) {
164
180
  },
165
181
  index: index,
166
182
  bordered: false
167
- }, item)))) : text;
183
+ }, item)))) : props.renderItemText ? props.renderItemText({
184
+ text,
185
+ name: props.name
186
+ }) : text;
168
187
  }
@@ -11,7 +11,18 @@ const formilyItemMargin = new Map([
11
11
  ]);
12
12
 
13
13
  export default function FormilyDescriptions(props) {
14
- const dataSource = tools.getDynamicFormilyFields(props.schema, props.values);
14
+ const [ regions, setRegions ] = React.useState([]);
15
+
16
+ React.useEffect(() => {
17
+ fetch(`${window.location.origin}/system/operation/regions`, { headers: { token: sessionStorage.token } }).then(res => res.json()).then(res => {
18
+ if (res.success) {
19
+ setRegions(res.data);
20
+ }
21
+ });
22
+ }, []);
23
+
24
+ const dataSource = tools.getDynamicFormilyFields(props.schema, props.values, { regions });
25
+
15
26
  return dataSource.length === 0
16
27
  ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
17
28
  : (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqsjjb/jjb-react-admin-component",
3
- "version": "3.0.21",
3
+ "version": "3.0.23",
4
4
  "description": "jjb-react-admin-组件库@new",
5
5
  "main": "index.js",
6
6
  "author": "jjb-front-team",