@cloudbase/weda-ui 3.1.1 → 3.1.2
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/dist/asset-manifest.json +17 -0
- package/dist/configs/components/form/location.json +0 -32
- package/dist/index.html +88 -0
- package/dist/static/js/bundle.js +963 -0
- package/dist/static/js/bundle.js.map +1 -0
- package/dist/static/js/main.chunk.js +8841 -0
- package/dist/static/js/main.chunk.js.map +1 -0
- package/dist/static/js/vendors~main.chunk.js +247885 -0
- package/dist/static/js/vendors~main.chunk.js.map +1 -0
- package/dist/static/media/ef6fa527e24e354765d806b826b41391.fa67580a.svg +627 -0
- package/dist/web/components/chart/common/core/eChartBar.d.ts +36 -0
- package/dist/web/components/chart/common/core/eChartLine.d.ts +34 -0
- package/dist/web/components/chart/common/core/eChartPie.d.ts +22 -0
- package/dist/web/components/form/location/common/mapChoose.js +4 -0
- package/dist/web/components/form/location/common/propsConfig.d.ts +1 -4
- package/dist/web/components/form/location/common/propsConfig.js +0 -2
- package/dist/web/components/form/location/common/useLocationInfo.d.ts +2 -0
- package/dist/web/components/form/location/common/useLocationInfo.js +19 -3
- package/dist/web/components/form/location/components/LocationH5/index.css +1 -1
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +30 -54
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +16 -51
- package/dist/web/components/form/select/h5.js +15 -13
- package/dist/web/components/form/select/index.js +15 -13
- package/dist/web/components/richText/index.js +6 -3
- package/dist/web/utils/isObjectEqual.d.ts +1 -1
- package/package.json +3 -4
- package/CHANGELOG.md +0 -7
|
@@ -28,5 +28,41 @@ declare class EchartBar extends EchartBase {
|
|
|
28
28
|
setDirectionType({ directionType }: {
|
|
29
29
|
directionType: any;
|
|
30
30
|
}): void;
|
|
31
|
+
setOptions({ directionType, isPile, setColor, isTitle, title, titleLocation, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, legend2, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }: {
|
|
32
|
+
directionType: any;
|
|
33
|
+
isPile: any;
|
|
34
|
+
setColor: any;
|
|
35
|
+
isTitle: any;
|
|
36
|
+
title: any;
|
|
37
|
+
titleLocation: any;
|
|
38
|
+
dataSource: any;
|
|
39
|
+
filterData: any;
|
|
40
|
+
xField: any;
|
|
41
|
+
xStatistics: any;
|
|
42
|
+
groupKey: any;
|
|
43
|
+
groupKeyTimeSpan: any;
|
|
44
|
+
xIsCountEmpty: any;
|
|
45
|
+
yField: any;
|
|
46
|
+
isLegend: any;
|
|
47
|
+
legend: any;
|
|
48
|
+
legend2: any;
|
|
49
|
+
isXaxisName: any;
|
|
50
|
+
xAxisName: any;
|
|
51
|
+
isXaxisAxisLabelShow: any;
|
|
52
|
+
isXaxisAxisTickShow: any;
|
|
53
|
+
isXaxisAxisLabelRotate: any;
|
|
54
|
+
isYAxisSplitlineLinestyleWidth: any;
|
|
55
|
+
yAxisSplitlineLinestyleType: any;
|
|
56
|
+
yAxisMax: any;
|
|
57
|
+
yAxisMin: any;
|
|
58
|
+
isYAxisName: any;
|
|
59
|
+
yAxisName: any;
|
|
60
|
+
isSeriesShowSymbol: any;
|
|
61
|
+
isYAxisShow: any;
|
|
62
|
+
isUnit: any;
|
|
63
|
+
unit: any;
|
|
64
|
+
decimalDigits: any;
|
|
65
|
+
suffix: any;
|
|
66
|
+
}): Promise<any>;
|
|
31
67
|
}
|
|
32
68
|
import EchartBase from "./eChartBase";
|
|
@@ -24,5 +24,39 @@ declare class EchartLine extends EchartBase {
|
|
|
24
24
|
decimalDigits: any;
|
|
25
25
|
suffix: any;
|
|
26
26
|
}): void;
|
|
27
|
+
setOptions({ chartType, isTitle, title, titleLocation, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, legend2, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }: {
|
|
28
|
+
chartType: any;
|
|
29
|
+
isTitle: any;
|
|
30
|
+
title: any;
|
|
31
|
+
titleLocation: any;
|
|
32
|
+
dataSource: any;
|
|
33
|
+
filterData: any;
|
|
34
|
+
xField: any;
|
|
35
|
+
xStatistics: any;
|
|
36
|
+
groupKey: any;
|
|
37
|
+
groupKeyTimeSpan: any;
|
|
38
|
+
xIsCountEmpty: any;
|
|
39
|
+
yField: any;
|
|
40
|
+
isLegend: any;
|
|
41
|
+
legend: any;
|
|
42
|
+
legend2: any;
|
|
43
|
+
isXaxisName: any;
|
|
44
|
+
xAxisName: any;
|
|
45
|
+
isXaxisAxisLabelShow: any;
|
|
46
|
+
isXaxisAxisTickShow: any;
|
|
47
|
+
isXaxisAxisLabelRotate: any;
|
|
48
|
+
isYAxisSplitlineLinestyleWidth: any;
|
|
49
|
+
yAxisSplitlineLinestyleType: any;
|
|
50
|
+
yAxisMax: any;
|
|
51
|
+
yAxisMin: any;
|
|
52
|
+
isYAxisName: any;
|
|
53
|
+
yAxisName: any;
|
|
54
|
+
isSeriesShowSymbol: any;
|
|
55
|
+
isYAxisShow: any;
|
|
56
|
+
isUnit: any;
|
|
57
|
+
unit: any;
|
|
58
|
+
decimalDigits: any;
|
|
59
|
+
suffix: any;
|
|
60
|
+
}): Promise<void>;
|
|
27
61
|
}
|
|
28
62
|
import EchartBase from "./eChartBase";
|
|
@@ -24,5 +24,27 @@ declare class EchartPie extends EchartBase {
|
|
|
24
24
|
decimalDigits: any;
|
|
25
25
|
suffix: any;
|
|
26
26
|
}): void;
|
|
27
|
+
setOptions({ chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
|
|
28
|
+
chartType: any;
|
|
29
|
+
isTitle: any;
|
|
30
|
+
title: any;
|
|
31
|
+
titleLocation: any;
|
|
32
|
+
dataSource: any;
|
|
33
|
+
filterData: any;
|
|
34
|
+
setColor: any;
|
|
35
|
+
xField: any;
|
|
36
|
+
xStatistics: any;
|
|
37
|
+
xIsCountEmpty: any;
|
|
38
|
+
yField: any;
|
|
39
|
+
isLegend: any;
|
|
40
|
+
legend: any;
|
|
41
|
+
legend2: any;
|
|
42
|
+
isSeriesShowSymbol: any;
|
|
43
|
+
isPercent: any;
|
|
44
|
+
isUnit: any;
|
|
45
|
+
unit: any;
|
|
46
|
+
decimalDigits: any;
|
|
47
|
+
suffix: any;
|
|
48
|
+
}): Promise<void>;
|
|
27
49
|
}
|
|
28
50
|
import EchartBase from "./eChartBase";
|
|
@@ -13,10 +13,9 @@ export namespace propTypes {
|
|
|
13
13
|
const zoom: PropTypes.Requireable<boolean>;
|
|
14
14
|
const disabled: PropTypes.Requireable<boolean>;
|
|
15
15
|
const requiredFlag: PropTypes.Requireable<boolean>;
|
|
16
|
-
const decorator: PropTypes.Requireable<
|
|
16
|
+
const decorator: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
17
17
|
const value: PropTypes.Requireable<object>;
|
|
18
18
|
const locationType: PropTypes.Requireable<number>;
|
|
19
|
-
const customLocation: PropTypes.Requireable<object>;
|
|
20
19
|
const dataSource: PropTypes.Requireable<object>;
|
|
21
20
|
}
|
|
22
21
|
export namespace defaultProps {
|
|
@@ -44,8 +43,6 @@ export namespace defaultProps {
|
|
|
44
43
|
export { requiredFlag_1 as requiredFlag };
|
|
45
44
|
const locationType_1: number;
|
|
46
45
|
export { locationType_1 as locationType };
|
|
47
|
-
const customLocation_1: {};
|
|
48
|
-
export { customLocation_1 as customLocation };
|
|
49
46
|
export namespace value_1 {
|
|
50
47
|
const address: string;
|
|
51
48
|
namespace geopoint {
|
|
@@ -19,7 +19,6 @@ export const propTypes = {
|
|
|
19
19
|
decorator: PropTypes.oneOfType([PropTypes.array, PropTypes.node]),
|
|
20
20
|
value: PropTypes.object,
|
|
21
21
|
locationType: PropTypes.number,
|
|
22
|
-
customLocation: PropTypes.object,
|
|
23
22
|
dataSource: PropTypes.object,
|
|
24
23
|
};
|
|
25
24
|
export const defaultProps = {
|
|
@@ -37,7 +36,6 @@ export const defaultProps = {
|
|
|
37
36
|
disabled: false,
|
|
38
37
|
requiredFlag: false,
|
|
39
38
|
locationType: 1,
|
|
40
|
-
customLocation: {},
|
|
41
39
|
// 模型应用属性
|
|
42
40
|
value: {
|
|
43
41
|
address: '',
|
|
@@ -30,5 +30,7 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
|
|
|
30
30
|
}>>;
|
|
31
31
|
currentLocStatus: boolean;
|
|
32
32
|
currentLocations: React.MutableRefObject<undefined>;
|
|
33
|
+
customLocation: React.MutableRefObject<undefined>;
|
|
34
|
+
checkCustomLocation: (params: any) => boolean;
|
|
33
35
|
};
|
|
34
36
|
import * as React from "react";
|
|
@@ -14,6 +14,18 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
|
|
|
14
14
|
});
|
|
15
15
|
const [currentLocStatus, setCurrentLocStatus] = useState(false);
|
|
16
16
|
const currentLocations = useRef();
|
|
17
|
+
const customLocation = useRef();
|
|
18
|
+
const checkCustomLocation = (params) => {
|
|
19
|
+
var _a;
|
|
20
|
+
let status = true;
|
|
21
|
+
if (!(params === null || params === void 0 ? void 0 : params.address) || !(params === null || params === void 0 ? void 0 : params.detailedAddress)) {
|
|
22
|
+
status = false;
|
|
23
|
+
}
|
|
24
|
+
else if (((_a = params === null || params === void 0 ? void 0 : params.geopoint) === null || _a === void 0 ? void 0 : _a.type) != 'Point') {
|
|
25
|
+
status = false;
|
|
26
|
+
}
|
|
27
|
+
return status;
|
|
28
|
+
};
|
|
17
29
|
useEffect(() => {
|
|
18
30
|
if (!dataSourceStatus ||
|
|
19
31
|
!APIKEY ||
|
|
@@ -31,12 +43,17 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
|
|
|
31
43
|
script.onload = () => {
|
|
32
44
|
let geolocation = new window.qq.maps.Geolocation();
|
|
33
45
|
geolocation.getIpLocation(({ city, lat, lng, addr }) => {
|
|
46
|
+
setApiKeyStatus({ status: true, message: '' });
|
|
47
|
+
setCurrentLocStatus(true);
|
|
34
48
|
let locations = {
|
|
35
49
|
poiname: city + addr,
|
|
36
50
|
detailedAddress: city + addr,
|
|
37
51
|
latlng: { lat, lng },
|
|
38
52
|
locationType,
|
|
39
53
|
};
|
|
54
|
+
currentLocations.current = locations;
|
|
55
|
+
if (checkCustomLocation(customLocation.current))
|
|
56
|
+
return;
|
|
40
57
|
setLocation(locations);
|
|
41
58
|
eventsChange &&
|
|
42
59
|
eventsChange({
|
|
@@ -45,9 +62,6 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
|
|
|
45
62
|
latitude: lat,
|
|
46
63
|
longitude: lng,
|
|
47
64
|
}, locationType === 1);
|
|
48
|
-
currentLocations.current = locations;
|
|
49
|
-
setApiKeyStatus({ status: true, message: '' });
|
|
50
|
-
setCurrentLocStatus(true);
|
|
51
65
|
}, (error) => {
|
|
52
66
|
console.log('error loc', error);
|
|
53
67
|
currentLocations.current = null;
|
|
@@ -84,5 +98,7 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
|
|
|
84
98
|
setApiKeyStatus,
|
|
85
99
|
currentLocStatus,
|
|
86
100
|
currentLocations,
|
|
101
|
+
customLocation,
|
|
102
|
+
checkCustomLocation,
|
|
87
103
|
};
|
|
88
104
|
}
|
|
@@ -16,7 +16,7 @@ export default function LocationH5(props) {
|
|
|
16
16
|
// 系统属性
|
|
17
17
|
id, className, style, events,
|
|
18
18
|
// 组件属性
|
|
19
|
-
value, label, labelVisible, showLngLat, showMap, drag, zoom, disabled, requiredFlag, decorator,
|
|
19
|
+
value, label, labelVisible, showLngLat, showMap, drag, zoom, disabled, requiredFlag, decorator, locationType, dataSource, layout, locationRange, customRange, } = props;
|
|
20
20
|
const cls = classNames({
|
|
21
21
|
'weda-ui': true,
|
|
22
22
|
cloudbase_standard: true,
|
|
@@ -39,6 +39,7 @@ export default function LocationH5(props) {
|
|
|
39
39
|
latlng: { lat: 39.98410411, lng: 116.307503 },
|
|
40
40
|
});
|
|
41
41
|
const currentLocations = useRef();
|
|
42
|
+
const customLocation = useRef();
|
|
42
43
|
useEffect(() => {
|
|
43
44
|
if (value || !currentLocations.current)
|
|
44
45
|
return;
|
|
@@ -78,46 +79,24 @@ export default function LocationH5(props) {
|
|
|
78
79
|
detailedAddress: '',
|
|
79
80
|
locationType,
|
|
80
81
|
};
|
|
81
|
-
switch (locationType) {
|
|
82
|
-
case 3:
|
|
83
|
-
if (checkCustomLocation(customLocation)) {
|
|
84
|
-
showToast('位置输入格式错误请检查');
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
loc = {
|
|
89
|
-
latlng: {
|
|
90
|
-
lat: customLocation.latitude,
|
|
91
|
-
lng: customLocation.longitude,
|
|
92
|
-
},
|
|
93
|
-
poiname: customLocation.poiname,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
82
|
setLocation(loc);
|
|
99
83
|
// 暂不支持自定位置,初始化表单值都是{}
|
|
100
84
|
events.change({ value: {} });
|
|
101
85
|
}, [locationType]);
|
|
102
86
|
useEffect(() => {
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
87
|
+
if (checkCustomLocation(value)) {
|
|
88
|
+
// 表单为新增时回传点位信息
|
|
89
|
+
const { address, detailedAddress, geopoint } = value;
|
|
90
|
+
const coordinates = (geopoint === null || geopoint === void 0 ? void 0 : geopoint.coordinates) || [];
|
|
91
|
+
let loc = {
|
|
92
|
+
poiname: address,
|
|
93
|
+
detailedAddress: detailedAddress,
|
|
94
|
+
latlng: { lng: coordinates[0], lat: coordinates[1] },
|
|
95
|
+
};
|
|
96
|
+
customLocation.current = value;
|
|
97
|
+
setLocation(loc);
|
|
109
98
|
}
|
|
110
|
-
|
|
111
|
-
let loc = {
|
|
112
|
-
latlng: {
|
|
113
|
-
lat: latitude,
|
|
114
|
-
lng: longitude,
|
|
115
|
-
},
|
|
116
|
-
poiname: poiname,
|
|
117
|
-
detailedAddress: '',
|
|
118
|
-
};
|
|
119
|
-
setLocation(loc);
|
|
120
|
-
}, [customLocation, locationType]);
|
|
99
|
+
}, [value]);
|
|
121
100
|
// 获取定位信息
|
|
122
101
|
useEffect(() => {
|
|
123
102
|
if (!dataSourceStatus.status ||
|
|
@@ -138,6 +117,11 @@ export default function LocationH5(props) {
|
|
|
138
117
|
let getLocationType = inH5IsMobile() ? 'getLocation' : 'getIpLocation';
|
|
139
118
|
geolocation[getLocationType]((ipLocation) => {
|
|
140
119
|
const { city, lat, lng, addr } = ipLocation;
|
|
120
|
+
setApiKeyStatus({
|
|
121
|
+
status: true,
|
|
122
|
+
message: '',
|
|
123
|
+
});
|
|
124
|
+
setCurrentLocStatus(true);
|
|
141
125
|
let loc = {
|
|
142
126
|
poiname: city + addr,
|
|
143
127
|
detailedAddress: city + addr,
|
|
@@ -146,10 +130,12 @@ export default function LocationH5(props) {
|
|
|
146
130
|
if (locationType === 1) {
|
|
147
131
|
loc.locationType = 1;
|
|
148
132
|
}
|
|
149
|
-
setLocation(loc);
|
|
150
133
|
currentLocations.current = loc;
|
|
134
|
+
// 表单为新增时检查是否为回传点位信息
|
|
135
|
+
if (checkCustomLocation(customLocation.current))
|
|
136
|
+
return;
|
|
137
|
+
setLocation(loc);
|
|
151
138
|
if (locationType === 2) {
|
|
152
|
-
loc.locationType = 1;
|
|
153
139
|
events.change &&
|
|
154
140
|
events.change({
|
|
155
141
|
value: {
|
|
@@ -162,11 +148,6 @@ export default function LocationH5(props) {
|
|
|
162
148
|
},
|
|
163
149
|
});
|
|
164
150
|
}
|
|
165
|
-
setApiKeyStatus({
|
|
166
|
-
status: true,
|
|
167
|
-
message: '',
|
|
168
|
-
});
|
|
169
|
-
setCurrentLocStatus(true);
|
|
170
151
|
}, (error) => {
|
|
171
152
|
console.log('error loc', error);
|
|
172
153
|
currentLocations.current = null;
|
|
@@ -233,20 +214,15 @@ export default function LocationH5(props) {
|
|
|
233
214
|
}
|
|
234
215
|
}, [dataSource]);
|
|
235
216
|
const checkCustomLocation = (params) => {
|
|
236
|
-
|
|
237
|
-
let
|
|
238
|
-
if (
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
else if (!latitude || !Number(latitude)) {
|
|
242
|
-
return (message = '位置输入格式错误 请检查');
|
|
243
|
-
}
|
|
244
|
-
else if (!longitude || !Number(longitude)) {
|
|
245
|
-
return (message = '位置输入格式错误 请检查');
|
|
217
|
+
var _a;
|
|
218
|
+
let status = true;
|
|
219
|
+
if (!(params === null || params === void 0 ? void 0 : params.address) || !(params === null || params === void 0 ? void 0 : params.detailedAddress)) {
|
|
220
|
+
status = false;
|
|
246
221
|
}
|
|
247
|
-
else if (
|
|
248
|
-
|
|
222
|
+
else if (((_a = params === null || params === void 0 ? void 0 : params.geopoint) === null || _a === void 0 ? void 0 : _a.type) != 'Point') {
|
|
223
|
+
status = false;
|
|
249
224
|
}
|
|
225
|
+
return status;
|
|
250
226
|
};
|
|
251
227
|
const showToast = (message) => {
|
|
252
228
|
weui.toast(message, {
|
|
@@ -19,7 +19,7 @@ export default function LocationPC(props) {
|
|
|
19
19
|
// 系统属性
|
|
20
20
|
id, className, style, events,
|
|
21
21
|
// 组件属性
|
|
22
|
-
value, label, labelVisible,
|
|
22
|
+
value, label, labelVisible, locationType, showLngLat, showMap, drag, zoom, disabled, requiredFlag, decorator, dataSource, layout, locationRange, customRange, } = props;
|
|
23
23
|
const cls = classNames({
|
|
24
24
|
'weda-ui': true,
|
|
25
25
|
cloudbase_standard: true,
|
|
@@ -47,12 +47,26 @@ export default function LocationPC(props) {
|
|
|
47
47
|
value: noaddr ? {} : res,
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
const { location, setLocation, apiKeyStatus, setApiKeyStatus, currentLocStatus, currentLocations, } = useLocationInfo({
|
|
50
|
+
const { location, setLocation, apiKeyStatus, setApiKeyStatus, currentLocStatus, currentLocations, customLocation, checkCustomLocation, } = useLocationInfo({
|
|
51
51
|
apiKey: APIKEY,
|
|
52
52
|
locationType,
|
|
53
53
|
dataSourceStatus,
|
|
54
54
|
eventsChange,
|
|
55
55
|
});
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (checkCustomLocation(value)) {
|
|
58
|
+
// 表单为新增时回传点位信息
|
|
59
|
+
const { address, detailedAddress, geopoint } = value;
|
|
60
|
+
const coordinates = (geopoint === null || geopoint === void 0 ? void 0 : geopoint.coordinates) || [];
|
|
61
|
+
let loc = {
|
|
62
|
+
poiname: address,
|
|
63
|
+
detailedAddress: detailedAddress,
|
|
64
|
+
latlng: { lng: coordinates[0], lat: coordinates[1] },
|
|
65
|
+
};
|
|
66
|
+
customLocation.current = value;
|
|
67
|
+
setLocation(loc);
|
|
68
|
+
}
|
|
69
|
+
}, [value]);
|
|
56
70
|
useEffect(() => {
|
|
57
71
|
if (value || !currentLocations.current)
|
|
58
72
|
return;
|
|
@@ -164,20 +178,6 @@ export default function LocationPC(props) {
|
|
|
164
178
|
detailedAddress: location.detailedAddress,
|
|
165
179
|
};
|
|
166
180
|
break;
|
|
167
|
-
case 3:
|
|
168
|
-
if (checkCustomLocation(customLocation)) {
|
|
169
|
-
showToast('位置输入格式错误 请检查');
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
loc = {
|
|
173
|
-
latlng: {
|
|
174
|
-
lat: customLocation.latitude,
|
|
175
|
-
lng: customLocation.longitude,
|
|
176
|
-
},
|
|
177
|
-
poiname: customLocation.poiname,
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
break;
|
|
181
181
|
}
|
|
182
182
|
setLocation(loc);
|
|
183
183
|
// 暂不支持自定位置,初始化表单值都是{}
|
|
@@ -188,41 +188,6 @@ export default function LocationPC(props) {
|
|
|
188
188
|
detailedAddress: loc.detailedAddress,
|
|
189
189
|
}, true);
|
|
190
190
|
}, [locationType]);
|
|
191
|
-
useEffect(() => {
|
|
192
|
-
if (locationType != 3) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (checkCustomLocation(customLocation)) {
|
|
196
|
-
showToast('位置输入格式错误 请检查');
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
let { latitude, longitude, poiname, detailedAddress } = customLocation;
|
|
200
|
-
let loc = {
|
|
201
|
-
latlng: {
|
|
202
|
-
lat: latitude,
|
|
203
|
-
lng: longitude,
|
|
204
|
-
},
|
|
205
|
-
poiname,
|
|
206
|
-
detailedAddress,
|
|
207
|
-
};
|
|
208
|
-
setLocation(loc);
|
|
209
|
-
}, [customLocation, locationType]);
|
|
210
|
-
const checkCustomLocation = (params) => {
|
|
211
|
-
let { latitude, longitude } = params;
|
|
212
|
-
let message = '';
|
|
213
|
-
if (Object.prototype.toString.call(params) !== '[object Object]') {
|
|
214
|
-
return (message = '位置输入格式错误 请检查');
|
|
215
|
-
}
|
|
216
|
-
else if (!latitude || !Number(latitude)) {
|
|
217
|
-
return (message = '位置输入格式错误 请检查');
|
|
218
|
-
}
|
|
219
|
-
else if (!longitude || !Number(longitude)) {
|
|
220
|
-
return (message = '位置输入格式错误 请检查');
|
|
221
|
-
}
|
|
222
|
-
else if (!params) {
|
|
223
|
-
return (message = '位置输入格式错误 请检查');
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
191
|
const getIsShowMap = () => {
|
|
227
192
|
let status = showMap;
|
|
228
193
|
if (locationType === 1 && location.locationType === 1) {
|
|
@@ -147,19 +147,21 @@ defaultRegion, defaultMutiRegion, regionType, separator, onChange, }) {
|
|
|
147
147
|
// 获取数据列表中主列字段,将其作为选项
|
|
148
148
|
React.useEffect(() => {
|
|
149
149
|
var _a;
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
150
|
+
if (primaryField) {
|
|
151
|
+
if (records && records.length !== 0) {
|
|
152
|
+
const option = records.map((item) => {
|
|
153
|
+
return {
|
|
154
|
+
label: item[primaryField] || item._id,
|
|
155
|
+
value: item._id,
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
setOption(option);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
setOption([{ label: '', value: '' }]);
|
|
162
|
+
setSelectedValue('');
|
|
163
|
+
(_a = events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: '' });
|
|
164
|
+
}
|
|
163
165
|
}
|
|
164
166
|
}, [records]);
|
|
165
167
|
// 获取数据列表
|
|
@@ -89,19 +89,21 @@ function SelectPc({ where, dataSourceName, viewId, format, primaryField, enumNam
|
|
|
89
89
|
// 获取数据列表中主列字段,将其作为选项
|
|
90
90
|
React.useEffect(() => {
|
|
91
91
|
var _a;
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
92
|
+
if (primaryField) {
|
|
93
|
+
if (records && records.length !== 0) {
|
|
94
|
+
const option = records.map((item) => {
|
|
95
|
+
return {
|
|
96
|
+
label: item[primaryField] || item._id,
|
|
97
|
+
value: item._id,
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
setOption(option);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
setOption([{ label: '', value: '' }]);
|
|
104
|
+
setSelectedValue('');
|
|
105
|
+
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: '' });
|
|
106
|
+
}
|
|
105
107
|
}
|
|
106
108
|
}, [records]);
|
|
107
109
|
// 获取数据源列表
|
|
@@ -70,10 +70,13 @@ label, labelVisible, value: initialValue, readOnly, layout, requiredFlag, onChan
|
|
|
70
70
|
];
|
|
71
71
|
// 修改img显示逻辑
|
|
72
72
|
const blockRenderFn = (contentBlock, { editor, editorState }) => {
|
|
73
|
+
var _a;
|
|
73
74
|
if (contentBlock.getType() === 'atomic') {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
const entityKey = contentBlock.getEntityAt(0);
|
|
76
|
+
if (entityKey) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const entity = (_a = editorState === null || editorState === void 0 ? void 0 : editorState.getCurrentContent()) === null || _a === void 0 ? void 0 : _a.getEntity();
|
|
77
80
|
if (entity.getType() === 'IMAGE') {
|
|
78
81
|
return {
|
|
79
82
|
component: RichTextImg,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export function serde(a: any): any;
|
|
2
|
-
export default function _default(a: any, b: any, shouldSerde?: boolean):
|
|
2
|
+
export default function _default(a: any, b: any, shouldSerde?: boolean): any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -126,7 +126,6 @@
|
|
|
126
126
|
"jest-canvas-mock": "^2.4.0",
|
|
127
127
|
"jest-environment-jsdom": "^27",
|
|
128
128
|
"jest-preview": "^0.2.5",
|
|
129
|
-
"less": "^4.1.2",
|
|
130
129
|
"miniprogram-simulate": "^1.5.7",
|
|
131
130
|
"nano-staged": "^0.8.0",
|
|
132
131
|
"pinst": "^3.0.0",
|
|
@@ -142,7 +141,7 @@
|
|
|
142
141
|
"swc-plugin-coverage-instrument": "^0.0.6",
|
|
143
142
|
"ts-loader": "^8.2.0",
|
|
144
143
|
"typescript": "^4.6.4",
|
|
145
|
-
"webpack": "
|
|
144
|
+
"webpack": "^5.73.0",
|
|
146
145
|
"webpack-cli": "^4.9.2",
|
|
147
146
|
"webpack-dev-server": "^4.9.0",
|
|
148
147
|
"zx": "^5.2.0"
|
|
@@ -168,4 +167,4 @@
|
|
|
168
167
|
"excludeAfterRemap": false,
|
|
169
168
|
"report-dir": "cypress-coverage"
|
|
170
169
|
}
|
|
171
|
-
}
|
|
170
|
+
}
|