@cqsjjb/jjb-react-admin-component 3.3.1-beta.12 → 3.3.1-beta.14
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/FormilyDescriptions/index.js +51 -18
- package/PhoneBox/index.js +12 -10
- package/package.json +1 -1
- package/ControlWrapper/index.less +0 -38
- package/PhoneBox/dianchi.png +0 -0
- package/PhoneBox/phone.png +0 -0
- package/PhoneBox/shexiang.png +0 -0
- package/PhoneBox/wangluo.png +0 -0
- package/PhoneBox/xinhao.png +0 -0
|
@@ -18,7 +18,10 @@ export default function FormilyDescriptions({
|
|
|
18
18
|
token: sessionStorage.token
|
|
19
19
|
}
|
|
20
20
|
}).then(res => res.json()).then(res => {
|
|
21
|
-
if (res.success)
|
|
21
|
+
if (res.success) {
|
|
22
|
+
setRegions(res.data);
|
|
23
|
+
props.onLoad && props.onLoad();
|
|
24
|
+
}
|
|
22
25
|
});
|
|
23
26
|
}, []);
|
|
24
27
|
const dataSource = tools.getDynamicFormilyFields(schema, values, {
|
|
@@ -85,9 +88,12 @@ export function ItemRender({
|
|
|
85
88
|
setOpen(true);
|
|
86
89
|
};
|
|
87
90
|
const renderContent = () => {
|
|
91
|
+
const systemStyle = props.systemStyle ? props.systemStyle(data.fieldCode) : {};
|
|
88
92
|
if (tools.isArray(data.value)) {
|
|
89
93
|
if (tools.isStringArray(data.value) || tools.isNumberArray(data.value)) {
|
|
90
|
-
return
|
|
94
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
style: systemStyle
|
|
96
|
+
}, data.value.join('、'));
|
|
91
97
|
}
|
|
92
98
|
if (tools.isObjectArray(data.value)) {
|
|
93
99
|
return data.formType === 'Table' ? /*#__PURE__*/React.createElement(RenderTable, {
|
|
@@ -97,7 +103,8 @@ export function ItemRender({
|
|
|
97
103
|
imageHeight: imageHeight,
|
|
98
104
|
imagePreview: imagePreview,
|
|
99
105
|
extraFileLink: extraFileLink,
|
|
100
|
-
onPreview: handlePreview
|
|
106
|
+
onPreview: handlePreview,
|
|
107
|
+
systemStyle: systemStyle
|
|
101
108
|
}) : data.value.map((file, index) => /*#__PURE__*/React.createElement(RenderFileItem, {
|
|
102
109
|
key: index,
|
|
103
110
|
url: file.url,
|
|
@@ -107,7 +114,8 @@ export function ItemRender({
|
|
|
107
114
|
imageHeight: imageHeight,
|
|
108
115
|
imagePreview: imagePreview,
|
|
109
116
|
extraFileLink: extraFileLink,
|
|
110
|
-
onPreview: () => handlePreview(file.url)
|
|
117
|
+
onPreview: () => handlePreview(file.url),
|
|
118
|
+
systemStyle: systemStyle
|
|
111
119
|
}));
|
|
112
120
|
}
|
|
113
121
|
return tools.textPlaceholder();
|
|
@@ -116,7 +124,8 @@ export function ItemRender({
|
|
|
116
124
|
name: data.name,
|
|
117
125
|
value: data.value,
|
|
118
126
|
maxTagCount: props.maxTagCount,
|
|
119
|
-
renderItemText: props.renderItemText
|
|
127
|
+
renderItemText: props.renderItemText,
|
|
128
|
+
systemStyle: systemStyle
|
|
120
129
|
});
|
|
121
130
|
};
|
|
122
131
|
return /*#__PURE__*/React.createElement(Fragment, null, renderContent(), /*#__PURE__*/React.createElement(Modal, {
|
|
@@ -141,7 +150,8 @@ export function RenderText({
|
|
|
141
150
|
value,
|
|
142
151
|
name,
|
|
143
152
|
maxTagCount = 1,
|
|
144
|
-
renderItemText
|
|
153
|
+
renderItemText,
|
|
154
|
+
systemStyle
|
|
145
155
|
}) {
|
|
146
156
|
const [text, setText] = useState();
|
|
147
157
|
const [options, setOptions] = useState([]);
|
|
@@ -168,7 +178,8 @@ export function RenderText({
|
|
|
168
178
|
width: '100%',
|
|
169
179
|
display: 'flex',
|
|
170
180
|
minHeight: 22,
|
|
171
|
-
flexDirection: 'column'
|
|
181
|
+
flexDirection: 'column',
|
|
182
|
+
...systemStyle
|
|
172
183
|
}
|
|
173
184
|
}, /*#__PURE__*/React.createElement(Spin, {
|
|
174
185
|
spinning: loading
|
|
@@ -185,10 +196,14 @@ export function RenderText({
|
|
|
185
196
|
maxTagCount: maxTagCount
|
|
186
197
|
})));
|
|
187
198
|
}
|
|
188
|
-
return
|
|
199
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
200
|
+
style: {
|
|
201
|
+
...systemStyle
|
|
202
|
+
}
|
|
203
|
+
}, renderItemText ? renderItemText({
|
|
189
204
|
text,
|
|
190
205
|
name
|
|
191
|
-
}) : tools.textPlaceholder(text);
|
|
206
|
+
}) : tools.textPlaceholder(text));
|
|
192
207
|
}
|
|
193
208
|
export function RenderFileItem(props) {
|
|
194
209
|
const {
|
|
@@ -199,16 +214,22 @@ export function RenderFileItem(props) {
|
|
|
199
214
|
imageHeight,
|
|
200
215
|
imagePreview,
|
|
201
216
|
extraFileLink,
|
|
202
|
-
onPreview
|
|
217
|
+
onPreview,
|
|
218
|
+
systemStyle
|
|
203
219
|
} = props;
|
|
204
220
|
return isImage ? /*#__PURE__*/React.createElement(RenderImage, {
|
|
205
221
|
url: url,
|
|
206
222
|
imageWidth: imageWidth,
|
|
207
223
|
imageHeight: imageHeight,
|
|
208
224
|
imagePreview: imagePreview,
|
|
209
|
-
extraFileLink: extraFileLink
|
|
225
|
+
extraFileLink: extraFileLink,
|
|
226
|
+
systemStyle: systemStyle
|
|
210
227
|
}) : /*#__PURE__*/React.createElement(Tooltip, {
|
|
211
228
|
title: url
|
|
229
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
230
|
+
style: {
|
|
231
|
+
...systemStyle
|
|
232
|
+
}
|
|
212
233
|
}, IS_PDF_REG.test(url) || IS_VIDEO_REG.test(url) ? /*#__PURE__*/React.createElement(RenderValidFile, {
|
|
213
234
|
url: url,
|
|
214
235
|
name: name,
|
|
@@ -217,20 +238,25 @@ export function RenderFileItem(props) {
|
|
|
217
238
|
}) : /*#__PURE__*/React.createElement(RenderInvalidFile, {
|
|
218
239
|
url: url,
|
|
219
240
|
name: name
|
|
220
|
-
}));
|
|
241
|
+
})));
|
|
221
242
|
}
|
|
222
243
|
export function RenderImage({
|
|
223
244
|
url,
|
|
224
245
|
imageWidth,
|
|
225
246
|
imageHeight,
|
|
226
247
|
imagePreview,
|
|
227
|
-
extraFileLink
|
|
248
|
+
extraFileLink,
|
|
249
|
+
systemStyle
|
|
228
250
|
}) {
|
|
229
251
|
return /*#__PURE__*/React.createElement("span", {
|
|
230
252
|
style: {
|
|
231
253
|
display: 'inline-block',
|
|
232
254
|
marginRight: 4,
|
|
233
|
-
marginBottom: 4
|
|
255
|
+
marginBottom: 4,
|
|
256
|
+
...(systemStyle ? {
|
|
257
|
+
...systemStyle,
|
|
258
|
+
border: `1px solid ${systemStyle?.color || '#d9d9d9'}`
|
|
259
|
+
} : {})
|
|
234
260
|
}
|
|
235
261
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
236
262
|
src: url,
|
|
@@ -279,12 +305,17 @@ export function RenderTable({
|
|
|
279
305
|
imageHeight,
|
|
280
306
|
imagePreview,
|
|
281
307
|
extraFileLink,
|
|
282
|
-
onPreview
|
|
308
|
+
onPreview,
|
|
309
|
+
systemStyle
|
|
283
310
|
}) {
|
|
284
311
|
const renderColumn = col => {
|
|
285
312
|
const originalRender = col.render;
|
|
286
313
|
col.render = row => {
|
|
287
|
-
if (tools.isNumberArray(row) || tools.isStringArray(row))
|
|
314
|
+
if (tools.isNumberArray(row) || tools.isStringArray(row)) {
|
|
315
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
316
|
+
style: systemStyle
|
|
317
|
+
}, row.join(','));
|
|
318
|
+
}
|
|
288
319
|
if (tools.isUploadFileListArray(row)) {
|
|
289
320
|
return /*#__PURE__*/React.createElement(Space, {
|
|
290
321
|
direction: "vertical"
|
|
@@ -297,7 +328,8 @@ export function RenderTable({
|
|
|
297
328
|
imageHeight: imageHeight,
|
|
298
329
|
imagePreview: imagePreview,
|
|
299
330
|
extraFileLink: extraFileLink,
|
|
300
|
-
onPreview: () => onPreview(file.url)
|
|
331
|
+
onPreview: () => onPreview(file.url),
|
|
332
|
+
systemStyle: systemStyle
|
|
301
333
|
})));
|
|
302
334
|
}
|
|
303
335
|
if (tools.isObject(row)) return '数据错误';
|
|
@@ -308,6 +340,7 @@ export function RenderTable({
|
|
|
308
340
|
return /*#__PURE__*/React.createElement(Table, {
|
|
309
341
|
rowKey: (record, index) => index,
|
|
310
342
|
columns: columns.map(renderColumn),
|
|
311
|
-
dataSource: dataSource
|
|
343
|
+
dataSource: dataSource,
|
|
344
|
+
style: systemStyle
|
|
312
345
|
});
|
|
313
346
|
}
|
package/PhoneBox/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
2
|
import { Empty, Space, message, Tooltip, Button, QRCode } from 'antd';
|
|
3
3
|
import { SyncOutlined } from '@ant-design/icons';
|
|
4
|
+
import { http } from '@cqsjjb/jjb-common-lib';
|
|
4
5
|
import shexiang from './shexiang.svg';
|
|
5
6
|
import xinhao from './xinhao.svg';
|
|
6
7
|
import wangluo from './wangluo.svg';
|
|
@@ -74,6 +75,13 @@ export default props => {
|
|
|
74
75
|
};
|
|
75
76
|
}, []);
|
|
76
77
|
|
|
78
|
+
// 获取预览地址
|
|
79
|
+
const getPreviewUrl = () => {
|
|
80
|
+
// 从url中解析出id
|
|
81
|
+
const id = new URL(iframeUrl).searchParams.get('sceneEngineId');
|
|
82
|
+
return http.Get(`/scene/engine/preview/url/${id}`);
|
|
83
|
+
};
|
|
84
|
+
|
|
77
85
|
// 二维码过期状态定时器
|
|
78
86
|
const startQrcodeTimer = () => {
|
|
79
87
|
if (qrcodeTimerId.current) {
|
|
@@ -95,19 +103,13 @@ export default props => {
|
|
|
95
103
|
}, 60000);
|
|
96
104
|
};
|
|
97
105
|
const getQrCodeUrl = () => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
setIsQrcodeExpire(false); // 重置二维码过期状态
|
|
102
|
-
startQrcodeTimer(); // 启动过期状态定时器
|
|
103
|
-
startQrcodeExpireTimeUpdateTimer(); // 启动过期时间定时器
|
|
104
|
-
});
|
|
105
|
-
} else {
|
|
106
|
-
setQrcodeUrl(`${iframeUrl}?t=${Date.now()}`);
|
|
106
|
+
const ftechFunc = fetchQrcodeUrl || getPreviewUrl;
|
|
107
|
+
ftechFunc().then(res => {
|
|
108
|
+
setQrcodeUrl(res.data);
|
|
107
109
|
setIsQrcodeExpire(false); // 重置二维码过期状态
|
|
108
110
|
startQrcodeTimer(); // 启动过期状态定时器
|
|
109
111
|
startQrcodeExpireTimeUpdateTimer(); // 启动过期时间定时器
|
|
110
|
-
}
|
|
112
|
+
});
|
|
111
113
|
};
|
|
112
114
|
return /*#__PURE__*/React.createElement("div", {
|
|
113
115
|
className: `phone-box ${size === 'small' ? 'phone-box-small' : ''}`
|
package/package.json
CHANGED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@com-prefix-cls: if(isdefined(@ant-prefix), @ant-prefix, ant);
|
|
2
|
-
|
|
3
|
-
.@{com-prefix-cls}-form-item-control-label-wrapper {
|
|
4
|
-
.@{com-prefix-cls}-form-item-control-label-span {
|
|
5
|
-
border: 1px solid #d9d9d9;
|
|
6
|
-
height: 32px;
|
|
7
|
-
line-height: 30px;
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
margin-right: -1px;
|
|
10
|
-
padding: 0 2px 0 8px;
|
|
11
|
-
border-top-left-radius: 4px;
|
|
12
|
-
border-bottom-left-radius: 4px;
|
|
13
|
-
white-space: nowrap;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&.@{com-prefix-cls}-form-item-control-label-has {
|
|
17
|
-
.@{com-prefix-cls}-select-selector, .@{com-prefix-cls}-picker, .@{com-prefix-cls}-input, .@{com-prefix-cls}-input-affix-wrapper {
|
|
18
|
-
border-top-left-radius: 0;
|
|
19
|
-
border-bottom-left-radius: 0;
|
|
20
|
-
border-left-color: transparent !important;
|
|
21
|
-
&:hover, &:focus, &:focus-within{
|
|
22
|
-
border-left-color: @colorPrimary !important;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&-default {
|
|
28
|
-
.@{com-prefix-cls}-form-item-control-label-span {
|
|
29
|
-
border-color: #d9d9d9;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&-dark {
|
|
34
|
-
.@{com-prefix-cls}-form-item-control-label-span {
|
|
35
|
-
border-color: #424242;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
package/PhoneBox/dianchi.png
DELETED
|
Binary file
|
package/PhoneBox/phone.png
DELETED
|
Binary file
|
package/PhoneBox/shexiang.png
DELETED
|
Binary file
|
package/PhoneBox/wangluo.png
DELETED
|
Binary file
|
package/PhoneBox/xinhao.png
DELETED
|
Binary file
|