@cloudbase/weda-ui 3.20.1 → 3.20.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.
Files changed (49) hide show
  1. package/dist/configs/components/chart/bar.js +2 -2
  2. package/dist/configs/components/chart/line.js +2 -2
  3. package/dist/configs/components/chart/pie.js +2 -2
  4. package/dist/configs/components/chart/statisticsCard.json +5 -12
  5. package/dist/configs/components/form/location.json +3 -9
  6. package/dist/configs/components/form-location.d.ts +2 -2
  7. package/dist/configs/components/form-location.js +1 -1
  8. package/dist/configs/components/scrollVeiw.json +43 -79
  9. package/dist/configs/components/wd-calendar.d.ts +4 -0
  10. package/dist/configs/components/wd-calendar.js +23 -1
  11. package/dist/configs/components/wd-cascader.d.ts +7 -12
  12. package/dist/configs/components/wd-cascader.js +12 -1
  13. package/dist/configs/components/wd-checkbox.d.ts +4 -1
  14. package/dist/configs/components/wd-checkbox.js +11 -1
  15. package/dist/configs/components/wd-location.d.ts +2 -2
  16. package/dist/configs/components/wd-location.js +1 -1
  17. package/dist/configs/components/wd-radio.d.ts +4 -1
  18. package/dist/configs/components/wd-select-multiple.d.ts +4 -1
  19. package/dist/configs/components/wd-select-multiple.js +11 -1
  20. package/dist/configs/components/wd-select.d.ts +4 -1
  21. package/dist/configs/components/wd-table.js +3 -2
  22. package/dist/configs/components/wd-tag-select.d.ts +4 -1
  23. package/dist/configs/components/wd-tag-select.js +11 -1
  24. package/dist/configs/components/wd-top-tab.d.ts +1 -1
  25. package/dist/configs/components/wd-top-tab.js +2 -1
  26. package/dist/configs/index.d.ts +102 -60
  27. package/dist/configs/type-utils/type-form.d.ts +10 -4
  28. package/dist/configs/type-utils/type-form.js +31 -4
  29. package/dist/enum/index.js +1 -0
  30. package/dist/style/index.css +1 -0
  31. package/dist/style/index.scss +1 -1
  32. package/dist/style/weda-ui.min.css +2 -2
  33. package/dist/web/components/form/location/common/propsConfig.d.ts +3 -3
  34. package/dist/web/components/form/location/common/propsConfig.js +2 -2
  35. package/dist/web/components/form/location/components/LocationH5/location.h5.js +36 -27
  36. package/dist/web/components/form/location/components/LocationPC/Header.js +2 -2
  37. package/dist/web/components/form/location/components/LocationPC/location.PC.js +38 -41
  38. package/dist/web/components/form-location/index.d.ts +1 -1
  39. package/dist/web/components/form-location/index.js +3 -3
  40. package/dist/web/components/wd-calendar/wd-calendar.js +4 -11
  41. package/dist/web/components/wd-calendar/weeks.d.ts +1 -1
  42. package/dist/web/components/wd-calendar/weeks.js +2 -2
  43. package/dist/web/components/wd-form/index.js +12 -7
  44. package/dist/web/components/wd-location/wd-location.d.ts +1 -1
  45. package/dist/web/components/wd-location/wd-location.js +2 -2
  46. package/dist/web/components/wd-select/select/selectUI.js +4 -1
  47. package/dist/web/components/wd-table/components/ExportFileModalByApi/index.js +3 -2
  48. package/dist/web/components/wd-table/hooks/useTableData.js +8 -3
  49. package/package.json +1 -1
@@ -8,7 +8,7 @@ export namespace propTypes {
8
8
  const APIKEY: PropTypes.Requireable<string>;
9
9
  const showLngLat: PropTypes.Requireable<boolean>;
10
10
  const showMap: PropTypes.Requireable<boolean>;
11
- const defauleShowLocation: PropTypes.Requireable<boolean>;
11
+ const defaultShowLocation: PropTypes.Requireable<boolean>;
12
12
  const drag: PropTypes.Requireable<boolean>;
13
13
  const zoom: PropTypes.Requireable<boolean>;
14
14
  const disabled: PropTypes.Requireable<boolean>;
@@ -31,8 +31,8 @@ export namespace defaultProps {
31
31
  export { showLngLat_1 as showLngLat };
32
32
  const showMap_1: boolean;
33
33
  export { showMap_1 as showMap };
34
- const defauleShowLocation_1: boolean;
35
- export { defauleShowLocation_1 as defauleShowLocation };
34
+ const defaultShowLocation_1: boolean;
35
+ export { defaultShowLocation_1 as defaultShowLocation };
36
36
  const drag_1: boolean;
37
37
  export { drag_1 as drag };
38
38
  const zoom_1: boolean;
@@ -11,7 +11,7 @@ export const propTypes = {
11
11
  APIKEY: PropTypes.string,
12
12
  showLngLat: PropTypes.bool,
13
13
  showMap: PropTypes.bool,
14
- defauleShowLocation: PropTypes.bool,
14
+ defaultShowLocation: PropTypes.bool,
15
15
  drag: PropTypes.bool,
16
16
  zoom: PropTypes.bool,
17
17
  disabled: PropTypes.bool,
@@ -30,7 +30,7 @@ export const defaultProps = {
30
30
  APIKEY: '',
31
31
  showLngLat: false,
32
32
  showMap: false,
33
- defauleShowLocation: false,
33
+ defaultShowLocation: false,
34
34
  drag: true,
35
35
  zoom: true,
36
36
  disabled: false,
@@ -52,33 +52,24 @@ export default function LocationH5(props) {
52
52
  const currentLocations = useRef();
53
53
  const customLocation = useRef();
54
54
  useEffect(() => {
55
- if (value || !currentLocations.current)
56
- return;
57
- setUserSelectStatus('');
58
- // 重置表单时
59
- const { poiname, detailedAddress, latlng: { lat, lng }, } = currentLocations.current;
60
- let location = {
61
- poiname,
62
- detailedAddress,
63
- latlng: { lat, lng },
64
- };
65
- if (locationType === 1) {
66
- location.locationType = 1;
55
+ if (locationType !== 3) {
56
+ // 默认位置选择无时【locationType=1】
57
+ let location = {
58
+ latlng: {
59
+ lat: 39.98410411,
60
+ lng: 116.307503,
61
+ },
62
+ poiname: '',
63
+ detailedAddress: '',
64
+ locationType,
65
+ };
66
+ // 默认位置选择当前用户位置时【locationType=2】
67
+ if (locationType === 2 && currentLocations.current) {
68
+ location = currentLocations.current;
69
+ }
70
+ setLocation(location);
71
+ setUserSelectStatus((location === null || location === void 0 ? void 0 : location.detailedAddress) ? 'selected' : '');
67
72
  }
68
- setLocation(location);
69
- }, [value, locationType]);
70
- useEffect(() => {
71
- let loc = {
72
- latlng: {
73
- lat: 39.98410411,
74
- lng: 116.307503,
75
- },
76
- poiname: '',
77
- detailedAddress: '',
78
- locationType,
79
- };
80
- setLocation(loc);
81
- // 暂不支持自定位置,初始化表单值都是{}
82
73
  }, [locationType]);
83
74
  useEffect(() => {
84
75
  if (checkCustomLocation(value)) {
@@ -91,8 +82,26 @@ export default function LocationH5(props) {
91
82
  latlng: { lng: coordinates[0], lat: coordinates[1] },
92
83
  };
93
84
  customLocation.current = value;
94
- setUserSelectStatus('selected');
95
85
  setLocation(loc);
86
+ setUserSelectStatus('selected');
87
+ }
88
+ else {
89
+ // 默认位置选择无时【locationType=1】
90
+ let location = {
91
+ latlng: {
92
+ lat: 39.98410411,
93
+ lng: 116.307503,
94
+ },
95
+ poiname: '',
96
+ detailedAddress: '',
97
+ locationType,
98
+ };
99
+ // 默认位置选择当前用户位置时【locationType=2】
100
+ if (locationType === 2 && currentLocations.current) {
101
+ location = currentLocations.current;
102
+ }
103
+ setLocation(location);
104
+ setUserSelectStatus((location === null || location === void 0 ? void 0 : location.poiname) ? 'selected' : '');
96
105
  }
97
106
  }, [value]);
98
107
  // 获取定位信息
@@ -13,10 +13,10 @@ const Header = ({ onClick, isEdit, info, disabled, showLngLat, locationType, dat
13
13
  if (locationType === 1 && info.locationType === 1) {
14
14
  status = false;
15
15
  }
16
- else if (locationType === 2 && !dataSourceStatus) {
16
+ else if ([2, 3].includes(locationType) && !dataSourceStatus) {
17
17
  status = false;
18
18
  }
19
- else if (locationType === 2 && !apiKeyStatus.status) {
19
+ else if ([2, 3].includes(locationType) && !apiKeyStatus.status) {
20
20
  status = false;
21
21
  }
22
22
  else if (!currentLocStatus) {
@@ -56,6 +56,26 @@ export default function LocationPC(props) {
56
56
  dataSourceStatus,
57
57
  eventsChange,
58
58
  });
59
+ useEffect(() => {
60
+ if (locationType !== 3) {
61
+ // 默认位置选择无时【locationType=1】
62
+ let location = {
63
+ latlng: {
64
+ lat: 39.98410411,
65
+ lng: 116.307503,
66
+ },
67
+ poiname: '',
68
+ detailedAddress: '',
69
+ locationType,
70
+ };
71
+ // 默认位置选择当前用户位置时【locationType=2】
72
+ if (locationType === 2 && currentLocations.current) {
73
+ location = currentLocations.current;
74
+ }
75
+ setLocation(location);
76
+ setUserSelectStatus((location === null || location === void 0 ? void 0 : location.detailedAddress) ? 'selected' : '');
77
+ }
78
+ }, [locationType]);
59
79
  useEffect(() => {
60
80
  if (checkCustomLocation(value)) {
61
81
  // 表单为新增时回传点位信息
@@ -70,23 +90,25 @@ export default function LocationPC(props) {
70
90
  setLocation(loc);
71
91
  setUserSelectStatus('selected');
72
92
  }
73
- }, [value]);
74
- useEffect(() => {
75
- if (value || !currentLocations.current)
76
- return;
77
- setUserSelectStatus('');
78
- // 重置表单时
79
- const { poiname, detailedAddress, latlng: { lat, lng }, } = currentLocations.current;
80
- let location = {
81
- poiname,
82
- detailedAddress,
83
- latlng: { lat, lng },
84
- };
85
- if (locationType === 1) {
86
- location.locationType = 1;
93
+ else {
94
+ // 默认位置选择无时【locationType=1】
95
+ let location = {
96
+ latlng: {
97
+ lat: 39.98410411,
98
+ lng: 116.307503,
99
+ },
100
+ poiname: '',
101
+ detailedAddress: '',
102
+ locationType,
103
+ };
104
+ // 默认位置选择当前用户位置时【locationType=2】
105
+ if (locationType === 2 && currentLocations.current) {
106
+ location = currentLocations.current;
107
+ }
108
+ setLocation(location);
109
+ setUserSelectStatus((location === null || location === void 0 ? void 0 : location.poiname) ? 'selected' : '');
87
110
  }
88
- setLocation(location);
89
- }, [value, locationType]);
111
+ }, [value]);
90
112
  const showToast = (message) => {
91
113
  weui.toast(message, {
92
114
  duration: 3000,
@@ -156,31 +178,6 @@ export default function LocationPC(props) {
156
178
  });
157
179
  }
158
180
  }, [dataSource]);
159
- useEffect(() => {
160
- let loc = {
161
- latlng: {
162
- lat: 39.98410411,
163
- lng: 116.307503,
164
- },
165
- poiname: '',
166
- detailedAddress: '',
167
- locationType,
168
- };
169
- switch (locationType) {
170
- case 2:
171
- loc = {
172
- latlng: {
173
- lat: location.latlng.lat,
174
- lng: location.latlng.lng,
175
- },
176
- poiname: location.poiname,
177
- detailedAddress: location.detailedAddress,
178
- };
179
- break;
180
- }
181
- setLocation(loc);
182
- // 暂不支持自定位置,初始化表单值都是{}
183
- }, [locationType]);
184
181
  const getIsShowMap = () => {
185
182
  let status = showMap;
186
183
  if (locationType === 1 && location.locationType === 1) {
@@ -30,7 +30,7 @@ declare const FormLocation: React.ForwardRefExoticComponent<CommonPropsType & {
30
30
  customRange: number;
31
31
  requiredFlag: boolean;
32
32
  requiredMsg: string;
33
- defauleShowLocation: boolean;
33
+ defaultShowLocation: boolean;
34
34
  dataSource: Record<string, unknown>;
35
35
  } & {
36
36
  onChange: (v: DataType['value']) => void;
@@ -5,10 +5,10 @@ import Location from '../form/location';
5
5
  import Tips from '../form/tips';
6
6
  import { useFormInputTrait } from '../form-input-hooks';
7
7
  const FormLocation = React.forwardRef(function FormLocation(props, inputRef) {
8
- const { className, id, style, events, required, requiredFlag, label, labelVisible, customRange, dataSource, defauleShowLocation, locationRange, locationType, showLngLat, showMap, zoom, drag,
8
+ const { className, id, style, events, required, requiredFlag, label, labelVisible, customRange, dataSource, defaultShowLocation, locationRange, locationType, showLngLat, showMap, zoom, drag,
9
9
  // @ts-expect-error 里面有,但dataForm没有,但json有传
10
10
  customLocation, ...restProps } = props;
11
- const { value, name, onChange, disabled, layout, readOnly, validateErrorMsg, validateState, visible, } = useFormInputTrait({
11
+ const { value, name, onChange, disabled, layout, readOnly, validateErrorMsg, validateState, visible } = useFormInputTrait({
12
12
  name: restProps.name,
13
13
  inputRef,
14
14
  required,
@@ -18,6 +18,6 @@ const FormLocation = React.forwardRef(function FormLocation(props, inputRef) {
18
18
  if (!visible) {
19
19
  return null;
20
20
  }
21
- return (_jsxs(FormItemWrapper, { children: [_jsx(Location, { id: id, style: style, className: className, events: events, name: name, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, value: value, customLocation: customLocation, customRange: customRange, dataSource: dataSource, defauleShowLocation: defauleShowLocation, drag: drag, locationType: locationType, locationRange: locationRange, showLngLat: showLngLat, showMap: showMap, zoom: zoom, onChange: onChange, readOnly: readOnly }), (validateState === 'error' || validateState === 'warn') && (_jsx(Tips, { tips: validateErrorMsg, type: "warn" }))] }));
21
+ return (_jsxs(FormItemWrapper, { children: [_jsx(Location, { id: id, style: style, className: className, events: events, name: name, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, value: value, customLocation: customLocation, customRange: customRange, dataSource: dataSource, defaultShowLocation: defaultShowLocation, drag: drag, locationType: locationType, locationRange: locationRange, showLngLat: showLngLat, showMap: showMap, zoom: zoom, onChange: onChange, readOnly: readOnly }), (validateState === 'error' || validateState === 'warn') && _jsx(Tips, { tips: validateErrorMsg, type: "warn" })] }));
22
22
  });
23
23
  export default FormLocation;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo, forwardRef, useImperativeHandle, useCallback, } from 'react';
2
+ import { useMemo, forwardRef, useImperativeHandle, useCallback } from 'react';
3
3
  import { usePlatform } from '../../utils/platform';
4
4
  import { setRefProp } from '../../utils/tool';
5
5
  import classNames from '../../utils/classnames';
@@ -12,7 +12,7 @@ import './style';
12
12
  * 日历标准化
13
13
  */
14
14
  export const WdClendar = forwardRef(function WdClendar(props, ref) {
15
- const { initVisible = true, configData, events, id, className, style, } = props;
15
+ const { initVisible = true, configData, events, id, className, style, start = null, end = null } = props;
16
16
  const valueStamp = useMemo(() => { var _a, _b; return (_b = (_a = getStartMoment('day', props.value)) === null || _a === void 0 ? void 0 : _a.valueOf()) !== null && _b !== void 0 ? _b : null; }, [props.value]);
17
17
  const monthStamp = useMemo(() => { var _a, _b; return (_b = (_a = getStartMoment('month', props.initMonth)) === null || _a === void 0 ? void 0 : _a.valueOf()) !== null && _b !== void 0 ? _b : null; }, [props.initMonth]);
18
18
  const [value, setValue] = useSyncValue(valueStamp);
@@ -23,7 +23,7 @@ export const WdClendar = forwardRef(function WdClendar(props, ref) {
23
23
  const cls = classNames(blockName, 'weda-ui', `${blockName}-${platform}`, className);
24
24
  const { year: monthYear, month: monthMonth } = yearMonthItem;
25
25
  const configDataObj = useMemo(() => getConfigDataObj(configData), [configData]);
26
- const weeks = useMemo(() => convertWeeks(monthYear, monthMonth, configDataObj), [monthYear, monthMonth, configDataObj]);
26
+ const weeks = useMemo(() => convertWeeks(monthYear, monthMonth, configDataObj, [start, end]), [monthYear, monthMonth, configDataObj, start, end]);
27
27
  // 含转时间戳逻辑
28
28
  const setValueMethod = useCallback((v) => {
29
29
  var _a;
@@ -45,14 +45,7 @@ export const WdClendar = forwardRef(function WdClendar(props, ref) {
45
45
  initMonth: monthValue,
46
46
  initVisible,
47
47
  value,
48
- }), [
49
- setValueMethod,
50
- setInitMonthMethod,
51
- configData,
52
- monthValue,
53
- initVisible,
54
- value,
55
- ]);
48
+ }), [setValueMethod, setInitMonthMethod, configData, monthValue, initVisible, value]);
56
49
  // 选中日期
57
50
  const handleChange = (item) => {
58
51
  var _a, _b;
@@ -9,7 +9,7 @@ interface IconfigDataObj {
9
9
  }
10
10
  export declare const blockName = "weda-calendar";
11
11
  export declare const getConfigDataObj: (configData?: IconfigData[]) => IconfigDataObj;
12
- export declare const convertWeeks: (year: any, month: any, configDataObj?: IconfigDataObj) => import("../../utils/hooks/useFormLegacy").IWeekItem[][] | {
12
+ export declare const convertWeeks: (year: any, month: any, configDataObj?: IconfigDataObj, range?: any[]) => import("../../utils/hooks/useFormLegacy").IWeekItem[][] | {
13
13
  matchDate?: string;
14
14
  disabled?: string | boolean;
15
15
  marked?: string | boolean;
@@ -17,8 +17,8 @@ export const getConfigDataObj = (configData) => {
17
17
  return obj;
18
18
  };
19
19
  // 年月转星期
20
- export const convertWeeks = (year, month, configDataObj) => {
21
- const weeks = convertYearMonthToWeeks(year, month, null, {
20
+ export const convertWeeks = (year, month, configDataObj, range) => {
21
+ const weeks = convertYearMonthToWeeks(year, month, range, {
22
22
  isPreNext: true,
23
23
  isDynamic: true,
24
24
  });
@@ -347,7 +347,7 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
347
347
  useSetWidgetApi(() => {
348
348
  const r = {
349
349
  formType,
350
- addFormItem(name, formItem, { initialValue, namePath }) {
350
+ addFormItem(name, formItem, { initialValue, namePath } = {}) {
351
351
  if (isNil(name) || (typeof name === 'string' && name.length === 0)) {
352
352
  // name 没设置或为空串的时候不受表单容器控制
353
353
  console.warn(`组件 #${formItem === null || formItem === void 0 ? void 0 : formItem.id} 表单key(表单输入类组件 name 属性)没设置或为空串的时候不受表单容器控制`);
@@ -395,8 +395,8 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
395
395
  setValueDebounce(value);
396
396
  }
397
397
  else {
398
- const _formFieldsValue = deepClone(formFieldsValue);
399
- setValueDebounce({ ..._formFieldsValue, ...value });
398
+ const _formData = deepClone(formData);
399
+ setValueDebounce({ ..._formData, ...value });
400
400
  }
401
401
  },
402
402
  reset() {
@@ -453,8 +453,6 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
453
453
  }, [
454
454
  formType,
455
455
  submitParams,
456
- setValue,
457
- setValueDebounce,
458
456
  initialValues,
459
457
  authValue,
460
458
  layout,
@@ -473,6 +471,9 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
473
471
  enableSubmit,
474
472
  fieldInitValueCache,
475
473
  formsItemMap,
474
+ setValueDebounce,
475
+ formData,
476
+ setValue,
476
477
  validate,
477
478
  eventsRef,
478
479
  submit,
@@ -522,8 +523,12 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
522
523
  return;
523
524
  }
524
525
  lodashSet(_formData, namePath, value);
525
- setValue(_formData);
526
- }, [formData, setValue]);
526
+ if (typeof _formData !== 'object' || _formData === null) {
527
+ console.warn('setValue data need expect a object but got null', _formData);
528
+ return;
529
+ }
530
+ setFormData(_formData);
531
+ }, [formData]);
527
532
  if (initValueLoadingStatus === 'hidden') {
528
533
  return null;
529
534
  }
@@ -9,5 +9,5 @@ export declare const WdLocation: React.ForwardRefExoticComponent<WdLocationProps
9
9
  export interface WdLocationProps extends CommonPropsType, DataType {
10
10
  classRoot?: string;
11
11
  customLocation?: any;
12
- defauleShowLocation?: any;
12
+ defaultShowLocation?: any;
13
13
  }
@@ -13,7 +13,7 @@ import './style';
13
13
  * 地图-标准化
14
14
  */
15
15
  export const WdLocation = forwardRef(function WdLocation(props, ref) {
16
- const { classRoot = 'location', clearable = X_RUNTIME_DEFAULT.clearable, placeholder = '选择地理位置', customLocation, customRange = X_RUNTIME_DEFAULT.customRange, dataSource = X_RUNTIME_DEFAULT._dataSourceInLocation, defauleShowLocation, drag = X_RUNTIME_DEFAULT.drag, locationType = X_RUNTIME_DEFAULT.locationType, locationRange = X_RUNTIME_DEFAULT.locationRange, showLngLat = X_RUNTIME_DEFAULT.showLngLat, showMap = X_RUNTIME_DEFAULT.showMap, zoom = X_RUNTIME_DEFAULT.zoom, events = emptyObject, id, } = props;
16
+ const { classRoot = 'location', clearable = X_RUNTIME_DEFAULT.clearable, placeholder = '选择地理位置', customLocation, customRange = X_RUNTIME_DEFAULT.customRange, dataSource = X_RUNTIME_DEFAULT._dataSourceInLocation, defaultShowLocation, drag = X_RUNTIME_DEFAULT.drag, locationType = X_RUNTIME_DEFAULT.locationType, locationRange = X_RUNTIME_DEFAULT.locationRange, showLngLat = X_RUNTIME_DEFAULT.showLngLat, showMap = X_RUNTIME_DEFAULT.showMap, zoom = X_RUNTIME_DEFAULT.zoom, events = emptyObject, id, } = props;
17
17
  const traitProps = { ...props, inputRef: ref };
18
18
  const trait = useFormInputTrait(traitProps);
19
19
  const { value, onChange, disabled, readOnly, visible } = trait;
@@ -48,5 +48,5 @@ export const WdLocation = forwardRef(function WdLocation(props, ref) {
48
48
  const inputWrapProps = { ...props, classRoot, disabled, ...clearProps };
49
49
  if (!visible)
50
50
  return null;
51
- return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { recycleBack: setIsInit, children: _jsx(Location, { events: events, labelVisible: false, placeholder: placeholder, value: value, customLocation: customLocation, customRange: customRange, dataSource: dataSource, defauleShowLocation: defauleShowLocation, drag: drag, locationType: locationType, locationRange: locationRange, showLngLat: showLngLat, showMap: showMap, zoom: zoom, readOnly: readOnly, disabled: disabled, decorator: null, onChange: onChange, id: id }) }) }) }) }));
51
+ return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { recycleBack: setIsInit, children: _jsx(Location, { events: events, labelVisible: false, placeholder: placeholder, value: value, customLocation: customLocation, customRange: customRange, dataSource: dataSource, defaultShowLocation: defaultShowLocation, drag: drag, locationType: locationType, locationRange: locationRange, showLngLat: showLngLat, showMap: showMap, zoom: zoom, readOnly: readOnly, disabled: disabled, decorator: null, onChange: onChange, id: id }) }) }) }) }));
52
52
  });
@@ -153,7 +153,10 @@ export function SelectUI(props) {
153
153
  // 缓存展示的选中项
154
154
  setSelectedItem((selectItem) => {
155
155
  const newSelectItem = getSelectedItem(options, value);
156
- return (newSelectItem === null || newSelectItem === void 0 ? void 0 : newSelectItem.length) ? newSelectItem : selectItem;
156
+ if (value !== null && value !== undefined) {
157
+ return (newSelectItem === null || newSelectItem === void 0 ? void 0 : newSelectItem.length) ? newSelectItem : selectItem;
158
+ }
159
+ return newSelectItem;
157
160
  });
158
161
  }, [options, value]);
159
162
  const readValue = useMemo(() => {
@@ -18,7 +18,8 @@ export const ExportFileModal = ({ fields, columns, isExportFileModalByApiVisible
18
18
  (field === null || field === void 0 ? void 0 : field.format) !== 'many-many' &&
19
19
  (field === null || field === void 0 ? void 0 : field.format) !== 'many-one' &&
20
20
  (field === null || field === void 0 ? void 0 : field.format) !== 'one-many' &&
21
- (field === null || field === void 0 ? void 0 : field.format) !== 'one-one') {
21
+ (field === null || field === void 0 ? void 0 : field.format) !== 'one-one' &&
22
+ (field === null || field === void 0 ? void 0 : field.format) !== 'one-one-r') {
22
23
  supportFields.push(field);
23
24
  }
24
25
  });
@@ -36,7 +37,7 @@ export const ExportFileModal = ({ fields, columns, isExportFileModalByApiVisible
36
37
  .filter((el) => {
37
38
  const field = fields.find((i) => (i === null || i === void 0 ? void 0 : i.name) === (el === null || el === void 0 ? void 0 : el.key) && el.isRelated);
38
39
  const format = field === null || field === void 0 ? void 0 : field.format;
39
- return el.isRelated && el.isExport && format !== 'many-many' && format !== 'one-many';
40
+ return el.isRelated && el.isExport && format !== 'many-many' && format !== 'one-many' && format !== 'one-one-r';
40
41
  })
41
42
  .map((item) => {
42
43
  return {
@@ -19,12 +19,15 @@ export const useTableData = ({ dataSourceAPI, connectorMethod, query, events, is
19
19
  const fetchVersion = (fetchRef.current.version = getUuid());
20
20
  let data = { records: [], total: 0 };
21
21
  setTableLoading(true);
22
+ let canCallQuerySuccess = true;
22
23
  try {
23
24
  if (isModel) {
24
25
  if (supportManyRelated) {
25
26
  // select为空对象时报错,避免传空对象给数组
26
27
  const select = (query === null || query === void 0 ? void 0 : query.select) || {};
28
+ canCallQuerySuccess = false;
27
29
  if (Object.keys(select).length !== 0) {
30
+ canCallQuerySuccess = true;
28
31
  data = await dataSourceAPI.getRecordListV2(query, { swr });
29
32
  data.records = data.records || [];
30
33
  }
@@ -50,9 +53,11 @@ export const useTableData = ({ dataSourceAPI, connectorMethod, query, events, is
50
53
  else {
51
54
  setTableData(records);
52
55
  }
53
- events === null || events === void 0 ? void 0 : events.querySuccess({
54
- data: Object.assign({}, data, query),
55
- });
56
+ if (canCallQuerySuccess) {
57
+ events === null || events === void 0 ? void 0 : events.querySuccess({
58
+ data: Object.assign({}, data, query),
59
+ });
60
+ }
56
61
  (records === null || records === void 0 ? void 0 : records.length) === 0 &&
57
62
  (events === null || events === void 0 ? void 0 : events.queryEmpty({
58
63
  data: Object.assign({}, data, query),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "3.20.1",
3
+ "version": "3.20.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index",
6
6
  "miniprogram": "mpdist",