Skip to content

Commit 42fd6a5

Browse files
杨国璇杨国璇
杨国璇
authored and
杨国璇
committed
feat: update config
1 parent 101fce0 commit 42fd6a5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/GeolocationEditor/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import MediaQuery from 'react-responsive';
44
import Large from './lg';
55
import Small from './sm';
66

7-
const GeolocationEditor = forwardRef(({ size, config: oldConfig, ...props }, ref) => {
7+
const GeolocationEditor = forwardRef(({ size, config: propsConfig, ...props }, ref) => {
88

9-
const config = useMemo(() => ({ ...window.dtable, ...oldConfig, }), [oldConfig]);
9+
const config = useMemo(() => ({ ...window?.dtable, ...propsConfig, }), [propsConfig]);
1010

1111
const getLocationData = useCallback(() => {
1212
if (window?.app?.location) return new Promise((resolve, reject) => {

src/GeolocationEditor/map-editor-utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const MINE_MAP_ONLINE_SERVICE = {
2121
};
2222

2323
export const getMineMapUrl = (config = {}) => {
24-
const { dtableMineMapCustomConfig = {} } = { ...window.dtable, ...config };
24+
const { dtableMineMapCustomConfig = {} } = { ...window?.dtable, ...config };
2525
const { domain_url = '', data_domain_url = '', server_domain_url = '',
2626
sprite_url = '', service_url = '' } = dtableMineMapCustomConfig;
2727
return {
@@ -49,7 +49,7 @@ export const getInitCenter = (isSelectionEditor = false) => {
4949
};
5050

5151
export const getMapInfo = (config = {}) => {
52-
const { dtableBaiduMapKey: baiduMapKey, dtableGoogleMapKey: googleMapKey, dtableMineMapKey: mineMapKey } = { ...window.dtable, ...config };
52+
const { dtableBaiduMapKey: baiduMapKey, dtableGoogleMapKey: googleMapKey, dtableMineMapKey: mineMapKey } = { ...window?.dtable, ...config };
5353
let mapType;
5454
let mapKey;
5555
if (baiduMapKey) {

src/RowExpandEditor/RowExpandGeolocationEditor/lg/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ class Large extends React.Component {
122122
};
123123

124124
getLocationInfo = (value) => {
125-
const { column } = this.props;
126-
const { dtableBaiduMapKey, dtableMineMapKey } = window.dtable;
125+
const { column, config } = this.props;
126+
const { dtableBaiduMapKey, dtableMineMapKey } = { ...window?.dtable, ...config };
127127
const isBaiduMap = !!(dtableBaiduMapKey || dtableMineMapKey);
128128
return getGeolocationDisplayString(value, column.data, { isBaiduMap, hyphen: ' ' });
129129
};

0 commit comments

Comments
 (0)