@cqsjjb/jjb-react-admin-component 3.0.24 → 3.0.25
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.
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { tools } from '@cqsjjb/jjb-common-lib';
|
|
4
4
|
import { FilePdfOutlined, LinkOutlined } from '@ant-design/icons';
|
|
5
|
-
import { Modal, Descriptions, Empty, Image, Tooltip, Tag, Spin } from 'antd';
|
|
5
|
+
import { Modal, Descriptions, Empty, Image, Tooltip, Tag, Spin, Table } from 'antd';
|
|
6
6
|
const formilyItemMargin = new Map([['small', 8], ['middle', 12], ['default', 16]]);
|
|
7
7
|
export default function FormilyDescriptions(props) {
|
|
8
8
|
const [regions, setRegions] = React.useState([]);
|
|
@@ -34,6 +34,7 @@ export default function FormilyDescriptions(props) {
|
|
|
34
34
|
return {
|
|
35
35
|
key: childIndex,
|
|
36
36
|
label: child.name,
|
|
37
|
+
span: child.formType === 'Table' ? props.column : 1,
|
|
37
38
|
children: /*#__PURE__*/React.createElement(ItemRender, _extends({
|
|
38
39
|
data: child
|
|
39
40
|
}, props))
|
|
@@ -64,7 +65,15 @@ function ItemRender(props) {
|
|
|
64
65
|
imageHeight,
|
|
65
66
|
imagePreview
|
|
66
67
|
} = props;
|
|
67
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, tools.isArray(data.value) ? tools.isStringArray(data.value) || tools.isNumberArray(data.value) ? data.value.join('、') : tools.isObjectArray(data.value) ? /*#__PURE__*/React.createElement("div",
|
|
68
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, tools.isArray(data.value) ? tools.isStringArray(data.value) || tools.isNumberArray(data.value) ? data.value.join('、') : tools.isObjectArray(data.value) ? data.formType === 'Table' ? /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
style: {
|
|
70
|
+
width: '100%'
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
73
|
+
columns: data.enumList,
|
|
74
|
+
dataSource: data.value,
|
|
75
|
+
pagination: false
|
|
76
|
+
})) : /*#__PURE__*/React.createElement("div", null, data.value.map((next, nextIndex) => {
|
|
68
77
|
if (next.url) {
|
|
69
78
|
if (next.isImage) {
|
|
70
79
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { tools } from '@cqsjjb/jjb-common-lib';
|
|
4
4
|
import { FilePdfOutlined, LinkOutlined } from '@ant-design/icons';
|
|
5
|
-
import { Modal, Descriptions, Empty, Image, Tooltip, Tag, Spin } from 'antd';
|
|
5
|
+
import { Modal, Descriptions, Empty, Image, Tooltip, Tag, Spin, Table } from 'antd';
|
|
6
6
|
|
|
7
7
|
const formilyItemMargin = new Map([
|
|
8
8
|
[ 'small', 8 ],
|
|
@@ -44,6 +44,9 @@ export default function FormilyDescriptions(props) {
|
|
|
44
44
|
return {
|
|
45
45
|
key: childIndex,
|
|
46
46
|
label: child.name,
|
|
47
|
+
span: child.formType === 'Table'
|
|
48
|
+
? props.column
|
|
49
|
+
: 1,
|
|
47
50
|
children: (
|
|
48
51
|
<ItemRender data={child} {...props} />
|
|
49
52
|
)
|
|
@@ -87,73 +90,83 @@ function ItemRender(props) {
|
|
|
87
90
|
? (tools.isStringArray(data.value) || tools.isNumberArray(data.value))
|
|
88
91
|
? data.value.join('、')
|
|
89
92
|
: tools.isObjectArray(data.value)
|
|
90
|
-
?
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
93
|
+
? data.formType === 'Table'
|
|
94
|
+
? (
|
|
95
|
+
<div style={{ width: '100%' }}>
|
|
96
|
+
<Table
|
|
97
|
+
columns={data.enumList}
|
|
98
|
+
dataSource={data.value}
|
|
99
|
+
pagination={false}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
)
|
|
103
|
+
: (
|
|
104
|
+
<div>
|
|
105
|
+
{data.value.map((next, nextIndex) => {
|
|
106
|
+
if (next.url) {
|
|
107
|
+
if (next.isImage) {
|
|
108
|
+
return (
|
|
109
|
+
<span
|
|
110
|
+
key={nextIndex}
|
|
111
|
+
style={{
|
|
112
|
+
display: 'inline-block',
|
|
113
|
+
marginRight: 4,
|
|
114
|
+
marginBottom: 4
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
<Image
|
|
118
|
+
src={next.url}
|
|
119
|
+
width={imageWidth || 64}
|
|
120
|
+
height={imageHeight || 64}
|
|
121
|
+
preview={imagePreview}
|
|
122
|
+
/>
|
|
123
|
+
</span>
|
|
124
|
+
);
|
|
125
|
+
} else {
|
|
126
|
+
return (
|
|
127
|
+
<Tooltip title={next.url}>
|
|
128
|
+
{/\.pdf$/.test(next.url)
|
|
129
|
+
? (
|
|
130
|
+
<a
|
|
131
|
+
key={nextIndex}
|
|
132
|
+
style={{
|
|
133
|
+
gap: 4,
|
|
134
|
+
display: 'flex',
|
|
135
|
+
alignItems: 'center'
|
|
136
|
+
}}
|
|
137
|
+
onClick={() => {
|
|
138
|
+
setOpen(true);
|
|
139
|
+
setPreviewUrl(next.url);
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
<FilePdfOutlined />
|
|
143
|
+
点击查看
|
|
144
|
+
</a>
|
|
145
|
+
)
|
|
146
|
+
: (
|
|
147
|
+
<a
|
|
148
|
+
key={nextIndex}
|
|
149
|
+
href={next.url}
|
|
150
|
+
style={{
|
|
151
|
+
gap: 4,
|
|
152
|
+
display: 'flex',
|
|
153
|
+
alignItems: 'center'
|
|
154
|
+
}}
|
|
155
|
+
target="_blank"
|
|
156
|
+
>
|
|
157
|
+
<LinkOutlined />
|
|
158
|
+
点击下载
|
|
159
|
+
</a>
|
|
160
|
+
)}
|
|
161
|
+
</Tooltip>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
112
164
|
} else {
|
|
113
|
-
return (
|
|
114
|
-
<Tooltip title={next.url}>
|
|
115
|
-
{/\.pdf$/.test(next.url)
|
|
116
|
-
? (
|
|
117
|
-
<a
|
|
118
|
-
key={nextIndex}
|
|
119
|
-
style={{
|
|
120
|
-
gap: 4,
|
|
121
|
-
display: 'flex',
|
|
122
|
-
alignItems: 'center'
|
|
123
|
-
}}
|
|
124
|
-
onClick={() => {
|
|
125
|
-
setOpen(true);
|
|
126
|
-
setPreviewUrl(next.url);
|
|
127
|
-
}}
|
|
128
|
-
>
|
|
129
|
-
<FilePdfOutlined />
|
|
130
|
-
点击查看
|
|
131
|
-
</a>
|
|
132
|
-
)
|
|
133
|
-
: (
|
|
134
|
-
<a
|
|
135
|
-
key={nextIndex}
|
|
136
|
-
href={next.url}
|
|
137
|
-
style={{
|
|
138
|
-
gap: 4,
|
|
139
|
-
display: 'flex',
|
|
140
|
-
alignItems: 'center'
|
|
141
|
-
}}
|
|
142
|
-
target="_blank"
|
|
143
|
-
>
|
|
144
|
-
<LinkOutlined />
|
|
145
|
-
点击下载
|
|
146
|
-
</a>
|
|
147
|
-
)}
|
|
148
|
-
</Tooltip>
|
|
149
|
-
);
|
|
165
|
+
return tools.textPlaceholder(next.name);
|
|
150
166
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
})}
|
|
155
|
-
</div>
|
|
156
|
-
)
|
|
167
|
+
})}
|
|
168
|
+
</div>
|
|
169
|
+
)
|
|
157
170
|
: tools.textPlaceholder()
|
|
158
171
|
: (
|
|
159
172
|
<RenderText
|