@hzab/form-render 0.4.2 → 0.5.1

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.
Files changed (29) hide show
  1. package/lib/index.js +1 -1
  2. package/package.json +1 -1
  3. package/src/common/date-utils.ts +18 -0
  4. package/src/common/formily-utils.ts +13 -0
  5. package/src/components/DatePicker/index.tsx +74 -60
  6. package/src/components/LocationPicker/Map/AMap/common/loader.ts +1 -1
  7. package/src/components/LocationPicker/Map/AMap/common/utils.ts +14 -4
  8. package/src/components/LocationPicker/Map/AMap/index.jsx +3 -2
  9. package/src/components/LocationPicker/README.md +29 -21
  10. package/src/components/LocationPicker/assets/svg-icon.js +86 -0
  11. package/src/components/LocationPicker/common/utils.ts +2 -22
  12. package/src/components/LocationPicker/components/MapSearch/index.less +1 -1
  13. package/src/components/LocationPicker/components/ModalContent/index.less +17 -5
  14. package/src/components/LocationPicker/components/ModalContent/index.tsx +82 -72
  15. package/src/components/LocationPicker/components/Notice/index.tsx +1 -6
  16. package/src/components/LocationPicker/components/ResInfo/index.less +8 -2
  17. package/src/components/LocationPicker/components/ResInfo/index.tsx +14 -20
  18. package/src/components/LocationPicker/index.tsx +33 -86
  19. package/src/components/LocationPicker/servers/index.ts +54 -26
  20. package/src/components/Text/index.tsx +0 -2
  21. package/lib/static/imgs/marker-icon_ab8bbcc8cb.svg +0 -4
  22. package/lib/static/imgs/picker-icon_24d725ef02.svg +0 -5
  23. package/lib/static/imgs/position-icon_5bcb8a742e.svg +0 -6
  24. package/lib/static/imgs/reset-icon_9edad62306.svg +0 -5
  25. package/src/components/LocationPicker/assets/marker-icon.svg +0 -4
  26. package/src/components/LocationPicker/assets/picker-icon.svg +0 -5
  27. package/src/components/LocationPicker/assets/position-icon.svg +0 -6
  28. package/src/components/LocationPicker/assets/reset-icon.svg +0 -5
  29. package/src/components/LocationPicker/marker-icon.png +0 -0
@@ -1,59 +1,68 @@
1
- import { useField, useFieldSchema, observer } from "@formily/react";
2
- import { DatePicker as AntdDatePicker } from "antd";
3
- import type { DatePickerProps, RangePickerProps } from 'antd/es/date-picker';
4
- import { connect, mapProps } from "@formily/react";
1
+ import { useField, useFieldSchema, connect, mapProps } from "@formily/react";
2
+ import { DatePicker as AntdDatePicker } from "@formily/antd";
5
3
 
6
- const { RangePicker } = AntdDatePicker
4
+ import { DatePickerProps, RangePickerProps } from "antd/lib/date-picker";
7
5
 
6
+ import { getParentValue } from "../../common/formily-utils";
7
+ import { dateable } from "../../common/date-utils";
8
8
 
9
-
10
- /**
11
- * 获取父级的数据对象(包括当前项的对象)
12
- * { 当详情: xxx, 其他项: lll }
13
- * @param field
14
- * @returns
15
- */
16
- export function getParentValue(field) {
17
- let form = field?.parent?.value || field?.value;
18
- if (Array.isArray(form)) {
19
- form = form[field.index];
20
- }
21
- return form;
22
- }
9
+ const { RangePicker } = AntdDatePicker;
23
10
 
24
11
  type DatePickerT = React.FC<any> & {
25
12
  RangePicker?: React.FC<any>;
26
13
  };
27
14
 
28
- export const DatePicker: DatePickerT = observer((props: any) => {
29
- return <AntdDatePicker
30
- {...props}
31
- />
32
- });
15
+ const handleProps = (props: DatePickerProps) => {
16
+ const getDefaultFormat = (props: DatePickerProps) => {
17
+ if (props["picker"] === "month") {
18
+ return "YYYY-MM";
19
+ } else if (props["picker"] === "quarter") {
20
+ return "YYYY-\\QQ";
21
+ } else if (props["picker"] === "year") {
22
+ return "YYYY";
23
+ } else if (props["picker"] === "week") {
24
+ return "gggg-wo";
25
+ }
26
+ return props["showTime"] ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
27
+ };
28
+ const format = props["format"] || (getDefaultFormat(props) as any);
33
29
 
30
+ return {
31
+ ...props,
32
+ format,
33
+ value: dateable(props.value, format === "gggg-wo" ? "gggg-ww" : format),
34
+ };
35
+ };
34
36
 
35
- DatePicker.RangePicker = observer((props:any) => {
37
+ export const DatePicker: DatePickerT = connect(
38
+ AntdDatePicker,
39
+ mapProps((props: any) => {
40
+ const datePickerProps = handleProps(props);
41
+ return datePickerProps;
42
+ }),
43
+ );
36
44
 
37
- const field: any = useField();
38
- const fieldSchema = useFieldSchema();
39
- const {
40
- /**
45
+ DatePicker.RangePicker = connect(
46
+ (props: any) => {
47
+ const field: any = useField();
48
+ const fieldSchema = useFieldSchema();
49
+ const {
50
+ /**
41
51
  *
42
52
  isSplitTimes
43
53
  true: 拆分为 startKey和 endKey 两个字段
44
54
  false: 不做拆分
45
55
  */
46
- isSplitTimes = false,
47
- startKey = "startTime",
48
- endKey = "endTime",
49
- } = props;
50
-
56
+ isSplitTimes = false,
57
+ startKey = "startTime",
58
+ endKey = "endTime",
59
+ } = props;
51
60
 
52
- const handleOnConfirm = (startTime, endTime) => {
53
- const res = {
54
- [startKey]: startTime,
55
- [endKey]: endTime,
56
- };
61
+ const handleOnConfirm = (startTime, endTime) => {
62
+ const res = {
63
+ [startKey]: startTime,
64
+ [endKey]: endTime,
65
+ };
57
66
 
58
67
  if (!field.parent) {
59
68
  field.form.setValues(res);
@@ -64,26 +73,31 @@ DatePicker.RangePicker = observer((props:any) => {
64
73
  parentVal[key] = res[key];
65
74
  });
66
75
  }
67
- }
68
-
69
- const handleOnChange = (dates, dateStrings) => {
70
- const startTime = dateStrings[0]
71
- const endTime = dateStrings[1]
72
- props.onChange && props.onChange(dates);
73
- if(!isSplitTimes) return
74
- if ((props.pick === 'date' || !props.pick) && !props.showTime) {
75
- handleOnConfirm(startTime + " 00:00:00", endTime + " 23:59:59")
76
- return
77
- }
78
- handleOnConfirm(startTime, endTime)
79
- };
76
+ };
80
77
 
81
- return <RangePicker
82
- {...props}
83
- onChange={(
84
- value: DatePickerProps['value'] | RangePickerProps['value'],
85
- dateString: [string, string] | string,
86
- ) => handleOnChange(value, dateString)}
87
- />
88
- });
78
+ const handleOnChange = (dates, dateStrings) => {
79
+ const startTime = dates[0];
80
+ const endTime = dates[1];
81
+ props.onChange && props.onChange(dates);
82
+ if (!isSplitTimes) return;
83
+ if ((props.pick === "date" || !props.pick) && !props.showTime) {
84
+ handleOnConfirm(startTime + " 00:00:00", endTime + " 23:59:59");
85
+ return;
86
+ }
87
+ handleOnConfirm(startTime, endTime);
88
+ };
89
89
 
90
+ return (
91
+ <RangePicker
92
+ {...props}
93
+ onChange={(
94
+ value: DatePickerProps["value"] | RangePickerProps["value"],
95
+ dateString: [string, string] | string,
96
+ ) => handleOnChange(value, dateString)}
97
+ />
98
+ );
99
+ },
100
+ mapProps((props: any) => {
101
+ return handleProps(props);
102
+ }),
103
+ );
@@ -1,4 +1,4 @@
1
- const defaultVersion = "1.4.15";
1
+ const defaultVersion = "2.0";
2
2
  const defaultPlugins = ["AMap.Geocoder", "AMap.Autocomplete"];
3
3
 
4
4
  if (!window._AMapLoaderTemp) {
@@ -1,5 +1,5 @@
1
1
  import AMapLoader from "./loader";
2
- import MarkerIcon from "../../../assets/marker-icon.svg";
2
+ import { markerIconBase64 } from "../../../assets/svg-icon";
3
3
 
4
4
  if (!window._AMapLoaderTemp) {
5
5
  window._AMapLoaderTemp = {};
@@ -27,6 +27,7 @@ export type setMarkerOptT = {
27
27
  marker?: Object;
28
28
  map?: Object;
29
29
  AMap?: Object;
30
+ markerIconConf?: Object;
30
31
  };
31
32
 
32
33
  export type markersT = {
@@ -38,13 +39,15 @@ export class MapUtils {
38
39
  public AMap;
39
40
  public markers: markersT = {};
40
41
  public pickerMarker;
42
+ public markerIconConf;
41
43
 
42
- constructor({ map, AMap }) {
44
+ constructor({ map, AMap, markerIconConf }) {
43
45
  if (!map) {
44
46
  throw new Error("请传入地图实例");
45
47
  }
46
48
  this.map = map;
47
49
  this.AMap = AMap;
50
+ this.markerIconConf = markerIconConf || {};
48
51
  }
49
52
 
50
53
  /**
@@ -83,10 +86,14 @@ export class MapUtils {
83
86
  * @returns
84
87
  */
85
88
  setMarker(lon, lat, opt?: setMarkerOptT) {
86
- const { id = Date.now(), marker, map = this.map, AMap = this.AMap } = opt || {};
89
+ const { id = Date.now(), marker, map = this.map, AMap = this.AMap, markerIconConf = {} } = opt || {};
87
90
  if (!(AMap && map)) {
88
91
  throw new Error("请传入地图实例和 AMap");
89
92
  }
93
+ if (lon === null || lon === undefined || lat === null || lat === undefined) {
94
+ console.warn("setMarker 请传入正确的经纬度");
95
+ return;
96
+ }
90
97
  const position = new AMap.LngLat(lon, lat);
91
98
  let _marker = marker || this.markers[id];
92
99
  // 创建 Marker 或修改位置
@@ -95,10 +102,13 @@ export class MapUtils {
95
102
  _marker.setPosition(position);
96
103
  return _marker;
97
104
  }
105
+
98
106
  const icon = new AMap.Icon({
99
107
  size: new AMap.Size(34, 34), //图标尺寸
100
- image: MarkerIcon, // Icon 的图像
108
+ image: markerIconBase64, // Icon 的图像
101
109
  imageSize: new AMap.Size(34, 34), // 根据所设置的大小拉伸或压缩图片
110
+ ...this.markerIconConf,
111
+ ...markerIconConf,
102
112
  });
103
113
  const _m = new AMap.Marker({
104
114
  offset: new AMap.Pixel(-17, -34),
@@ -17,7 +17,7 @@ function AMapCom(props) {
17
17
  const mapDomRef = useRef();
18
18
 
19
19
  useEffect(() => {
20
- const { key, securityJsCode, plugins } = props;
20
+ const { key, securityJsCode, plugins, markerIconConf } = props;
21
21
  AMapLoader({
22
22
  key,
23
23
  securityJsCode,
@@ -28,7 +28,8 @@ function AMapCom(props) {
28
28
  zoom: zoom || 11,
29
29
  center: center || [120.160217, 30.243861],
30
30
  });
31
- init && init({ map: mapRef.current, mapUtils: new MapUtils({ map: mapRef.current, AMap }), AMap });
31
+ init &&
32
+ init({ map: mapRef.current, mapUtils: new MapUtils({ map: mapRef.current, AMap, markerIconConf }), AMap });
32
33
  });
33
34
  }, []);
34
35
 
@@ -1,8 +1,13 @@
1
- #### 使用前安装依赖
1
+ ## 使用前安装依赖
2
2
 
3
3
  npm install @amap/amap-jsapi-loader
4
4
 
5
- #### 引入
5
+ ## 注意事项
6
+
7
+ - isObjectRes 在 @hzab/form-render0.5.0 版本中去除,结果全部存放在对象中
8
+ - changeMode 在 @hzab/form-render0.5.1 版本中去除,仅允许点击地图选点
9
+
10
+ ## 引入
6
11
 
7
12
  ```jsx
8
13
  import MapLocationPoint from "./mapLocationPoint";
@@ -14,22 +19,25 @@ export default function AMap(props) {
14
19
 
15
20
  ### InfoPanel Attributes
16
21
 
17
- | 参数 | 类型 | 必填 | 默认值 | 说明 |
18
- | ------------- | --------- | ---- | --------- | ----------------------------------------------------------- |
19
- | mode | string | 否 | dialog | 地图显示的类型, dialog 弹窗显示、 show 直接显示 |
20
- | layout | string | 否 | ver | 选择器和地图的布局 hor 水平、 ver 垂直 |
21
- | hasSearch | boolean | 否 | true | 是否允许搜索 |
22
- | isObjectRes | boolean | 否 | true | 是否把数据存放在对象中 |
23
- | isAutoFixAddr | boolean | 否 | false | 打开地图时是否根据经纬度自动修正已填的地址 |
24
- | changeMode | string | 否 | move | 改变经纬度等数据的触发模式;移动地图:move,点击地图:click |
25
- | lonKey | string | 否 | longitude | 经度字段 key |
26
- | latKey | string | 否 | latitude | 维度字段 key |
27
- | addrKey | string | 否 | address | 地址字段 key |
28
- | isAutoSearch | boolean | 否 | false | 搜索框是否自动搜索 |
29
- | pickerIcon | ReactNode | 否 | - | 地图选点弹窗开启按钮的 icon 元素 |
30
- | pickerIconUrl | string | 否 | - | 地图选点弹窗开启按钮的 icon img 的地址 |
31
-
32
- - isObjectRes 是否把数据存放在对象中
33
-
34
- - true: 把所有数据存放在一个对象中(该对象和其他表单项平级),对象 key 为当前项的 name;
35
- - false: 所有数据打平放到当前的 data 中,和其他表单项平级
22
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
23
+ | ------------------ | ------- | ---- | --------- | ------------------------------------------------ |
24
+ | mode | string | 否 | dialog | 地图显示的类型, dialog 弹窗显示、 show 直接显示 |
25
+ | layout | string | 否 | ver | 选择器和地图的布局 hor 水平、 ver 垂直 |
26
+ | hasSearch | boolean | 否 | true | 是否允许搜索 |
27
+ | isAutoFixAddr | boolean | 否 | false | 打开地图时是否根据经纬度自动修正已填的地址 |
28
+ | lonKey | string | 否 | longitude | 经度字段 key |
29
+ | latKey | string | 否 | latitude | 维度字段 key |
30
+ | addrKey | string | 否 | address | 地址字段 key |
31
+ | isAutoSearch | boolean | 否 | false | 搜索框是否自动搜索 |
32
+ | markerIconConf | Object | 否 | - | markerIcon 配置对象 |
33
+ | icons | Object | 否 | - | icon 图片配置 |
34
+ | getCurPositionConf | Object | 否 | - | getCurrentPosition Config |
35
+
36
+ #### icons
37
+
38
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
39
+ | ------------ | ------ | ---- | ------ | ------------------------ |
40
+ | markerIcon | string | 否 | dialog | marker icon 图片地址 |
41
+ | pickerIcon | string | 否 | dialog | 选点 icon 图片地址或元素 |
42
+ | positionIcon | string | 否 | dialog | 定位 icon 图片地址或元素 |
43
+ | resetIcon | string | 否 | dialog | 重置 icon 图片地址或元素 |
@@ -0,0 +1,86 @@
1
+ export const markerIcon = (
2
+ <svg
3
+ t="1708497164654"
4
+ className="marker-icon"
5
+ viewBox="0 0 1024 1024"
6
+ version="1.1"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ p-id="8489"
9
+ width="200"
10
+ height="200"
11
+ >
12
+ <path
13
+ d="M512 1024c-205.76-241.472-326.272-411.712-361.664-510.72a384 384 0 1 1 723.072 0.832C837.76 612.928 717.312 782.848 512 1024.064z m0-512a128 128 0 1 0 0-256 128 128 0 0 0 0 256z"
14
+ fill="#1677ff"
15
+ p-id="8490"
16
+ ></path>
17
+ </svg>
18
+ );
19
+
20
+ export const markerIconBase64 = `data:image/svg+xml;charset=utf-8;base64,ICA8c3ZnCiAgICB0PSIxNzA4NDk3MTY0NjU0IgogICAgY2xhc3M9Imljb24iCiAgICB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IgogICAgdmVyc2lvbj0iMS4xIgogICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICAgcC1pZD0iODQ4OSIKICAgIHdpZHRoPSIyMDAiCiAgICBoZWlnaHQ9IjIwMCIKICA+CiAgICA8cGF0aAogICAgICBkPSJNNTEyIDEwMjRjLTIwNS43Ni0yNDEuNDcyLTMyNi4yNzItNDExLjcxMi0zNjEuNjY0LTUxMC43MmEzODQgMzg0IDAgMSAxIDcyMy4wNzIgMC44MzJDODM3Ljc2IDYxMi45MjggNzE3LjMxMiA3ODIuODQ4IDUxMiAxMDI0LjA2NHogbTAtNTEyYTEyOCAxMjggMCAxIDAgMC0yNTYgMTI4IDEyOCAwIDAgMCAwIDI1NnoiCiAgICAgIGZpbGw9IiMxNjc3ZmYiCiAgICAgIHAtaWQ9Ijg0OTAiCiAgICA+PC9wYXRoPgogIDwvc3ZnPg==`;
21
+
22
+ export const pickerIcon = (
23
+ <svg
24
+ t="1708305242338"
25
+ className="picker-icon"
26
+ viewBox="0 0 1088 1024"
27
+ version="1.1"
28
+ xmlns="http://www.w3.org/2000/svg"
29
+ p-id="1494"
30
+ width="200"
31
+ height="200"
32
+ >
33
+ <path
34
+ d="M812.224 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576 193.472-184.448 288-338.432 288-456.576z m-288 544c-234.688-213.312-352-394.688-352-544a352 352 0 1 1 704 0c0 149.312-117.312 330.688-352 544z"
35
+ fill="#1677ff"
36
+ p-id="1495"
37
+ ></path>
38
+ <path
39
+ d="M524.224 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128z m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256z m345.6 192l102.4 256h-288v-64h-320v64h-288l102.4-256h691.2z m-68.928 0H247.552l-76.8 192h706.944l-76.8-192z"
40
+ fill="#1677ff"
41
+ p-id="1496"
42
+ ></path>
43
+ </svg>
44
+ );
45
+
46
+ export const positionIcon = (
47
+ <svg
48
+ t="1708478996666"
49
+ className="position-icon"
50
+ viewBox="0 0 1024 1024"
51
+ version="1.1"
52
+ xmlns="http://www.w3.org/2000/svg"
53
+ p-id="6897"
54
+ // xmlns:xlink="http://www.w3.org/1999/xlink"
55
+ width="200"
56
+ height="200"
57
+ >
58
+ <path
59
+ d="M895.044488 550.176484l-42.200124 0C834.62235 708.540282 709.048353 834.001715 550.718325 852.244194l0 42.258453c0 21.946848-17.790178 39.730886-39.729863 39.730886s-39.729863-17.784038-39.729863-39.730886l0-42.258453C312.926524 834.001715 187.354574 708.540282 169.131537 550.176484l-42.199101 0c-21.940708 0-39.730886-17.786085-39.730886-39.729863 0-21.940708 17.789155-39.726793 39.730886-39.726793l42.257429 0c18.24248-158.335145 143.711076-283.907095 302.068733-302.126039l0-42.200124c0-21.940708 17.789155-39.730886 39.729863-39.730886s39.729863 17.789155 39.729863 39.730886l0 42.258453c158.331052 18.241456 283.904025 143.706983 302.126039 302.06771l42.200124 0c21.940708 0 39.729863 17.786085 39.729863 39.726793C934.774351 532.390399 916.986219 550.176484 895.044488 550.176484zM696.395172 470.719828l76.16161 0c-17.251919-114.39847-107.492176-204.651007-221.838458-221.913159l0 76.236312c0 21.939685-17.790178 39.726793-39.729863 39.726793s-39.729863-17.787108-39.729863-39.726793l0-76.165704c-114.39233 17.256012-204.644867 107.495246-221.910089 221.842551l76.233242 0c21.946848 0 39.729863 17.786085 39.729863 39.726793 0 21.943778-17.781992 39.729863-39.729863 39.729863l-76.162634 0c17.251919 114.39847 107.498316 204.649983 221.839481 221.910089l0-76.234265c0-21.943778 17.789155-39.72577 39.729863-39.72577s39.729863 17.781992 39.729863 39.72577l0 76.234265c114.346281-17.260106 204.586538-107.511619 221.838458-221.910089l-76.16161 0c-21.941732 0-39.729863-17.786085-39.729863-39.729863C656.665309 488.505913 674.453441 470.719828 696.395172 470.719828zM510.988462 550.176484c-21.939685 0-39.729863-17.786085-39.729863-39.729863 0-21.940708 17.789155-39.726793 39.729863-39.726793s39.729863 17.786085 39.729863 39.726793C550.718325 532.390399 532.928147 550.176484 510.988462 550.176484z"
60
+ fill="#000000"
61
+ p-id="6898"
62
+ ></path>
63
+ </svg>
64
+ );
65
+
66
+ export const resetIcon = (
67
+ <svg
68
+ t="1708485324277"
69
+ className="reset-icon"
70
+ viewBox="0 0 1024 1024"
71
+ version="1.1"
72
+ xmlns="http://www.w3.org/2000/svg"
73
+ p-id="7503"
74
+ width="200"
75
+ height="200"
76
+ >
77
+ <path
78
+ d="M512 682.666667c71.296 0 128-56.789333 128-128s-56.704-128-128-128-128 56.789333-128 128 56.704 128 128 128z"
79
+ p-id="7504"
80
+ ></path>
81
+ <path
82
+ d="M888.192 477.269333a381.44 381.44 0 0 0-57.813333-137.344 386.261333 386.261333 0 0 0-103.68-103.68 381.866667 381.866667 0 0 0-137.344-57.813333 385.194667 385.194667 0 0 0-78.421334-7.68V85.333333L341.333333 213.333333l169.6 128V256.085333c20.650667-0.085333 41.301333 1.877333 61.226667 5.973334a297.002667 297.002667 0 0 1 106.752 44.928 298.88 298.88 0 0 1 80.725333 80.725333A297.258667 297.258667 0 0 1 810.666667 554.666667a300.032 300.032 0 0 1-23.466667 116.266666 303.36 303.36 0 0 1-27.477333 50.688 307.2 307.2 0 0 1-36.608 44.330667 299.861333 299.861333 0 0 1-150.869334 81.365333 304.213333 304.213333 0 0 1-120.405333 0 297.002667 297.002667 0 0 1-106.794667-44.970666 298.752 298.752 0 0 1-80.64-80.64A298.496 298.496 0 0 1 213.333333 554.666667H128a384.853333 384.853333 0 0 0 65.664 214.784 388.096 388.096 0 0 0 103.594667 103.594666A381.866667 381.866667 0 0 0 512 938.666667a387.84 387.84 0 0 0 77.397333-7.808 384.597333 384.597333 0 0 0 137.301334-57.813334 379.136 379.136 0 0 0 56.789333-46.890666 393.728 393.728 0 0 0 46.933333-56.832A381.952 381.952 0 0 0 896 554.666667a387.84 387.84 0 0 0-7.808-77.397334z"
83
+ p-id="7505"
84
+ ></path>
85
+ </svg>
86
+ );
@@ -10,18 +10,12 @@
10
10
  addr: value[addrKey],
11
11
  }
12
12
  */
13
- export function getPropsValue(value = {}, field: any, opt) {
14
- const { isObjectRes = true, lonKey = "longitude", latKey = "latitude", addrKey = "address" } = opt || {};
13
+ export function getPropsValue(value = {}, opt) {
14
+ const { lonKey = "longitude", latKey = "latitude", addrKey = "address" } = opt || {};
15
15
  let lon = value[lonKey];
16
16
  let lat = value[latKey];
17
17
  let addr = value[addrKey];
18
18
  // 数据和其他子项平级的情况
19
- let form = getParentValue(field);
20
- if (form && isObjectRes === false) {
21
- lon = form[lonKey];
22
- lat = form[latKey];
23
- addr = form[addrKey];
24
- }
25
19
  const res = {
26
20
  lon,
27
21
  lat,
@@ -29,17 +23,3 @@ export function getPropsValue(value = {}, field: any, opt) {
29
23
  };
30
24
  return res;
31
25
  }
32
-
33
- /**
34
- * 获取父级的数据对象(包括当前项的对象)
35
- * { 当详情: xxx, 其他项: lll }
36
- * @param field
37
- * @returns
38
- */
39
- export function getParentValue(field) {
40
- let form = field?.parent?.value || field?.value;
41
- if (Array.isArray(form)) {
42
- form = form[field.index];
43
- }
44
- return form;
45
- }
@@ -1,4 +1,4 @@
1
- .location-map-search {
1
+ .ant-select-auto-complete.location-map-search {
2
2
  width: 300px;
3
3
  position: absolute;
4
4
  top: 0;
@@ -9,6 +9,7 @@
9
9
  position: relative;
10
10
  width: 100%;
11
11
  flex: 1;
12
+ height: 500px;
12
13
  .a-map-container {
13
14
  height: inherit;
14
15
  .amap-logo,
@@ -17,23 +18,35 @@
17
18
  }
18
19
  }
19
20
 
20
- .location-picker-center-icon {
21
+ .location-picker-center-icon-box {
21
22
  position: absolute;
22
23
  top: 50%;
23
24
  left: 50%;
24
- transform: translate(-50%, -100%);
25
25
  width: 34px;
26
+ height: 34px;
27
+ transform: translate(-50%, -100%);
26
28
  color: #1677ff;
29
+ pointer-events: none;
30
+ img,
31
+ svg {
32
+ width: 34px;
33
+ height: 34px;
34
+ pointer-events: none;
35
+ }
27
36
  }
28
37
 
29
38
  .set-map-actions {
30
39
  position: absolute;
31
40
  right: 20px;
32
41
  bottom: 20px;
33
- & > img {
42
+ .actions-icon-box {
43
+ margin-bottom: 8px;
44
+ }
45
+ img,
46
+ svg {
34
47
  display: block;
35
48
  width: 32px;
36
- margin-bottom: 8px;
49
+ height: 32px;
37
50
  padding: 4px;
38
51
  background-color: #fff;
39
52
  border-radius: 8px;
@@ -70,7 +83,6 @@
70
83
  .location-picker-info {
71
84
  margin-right: 20px;
72
85
  }
73
- .location-picker-info;
74
86
  }
75
87
  &.location-modal-content-layout-hor-reverse {
76
88
  flex-direction: row-reverse;