@zgfe/modules-event 0.0.2-event.61 → 0.0.2-event.63

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.
@@ -70,7 +70,7 @@ var EventFilter = function EventFilter(props) {
70
70
  if (_data.dimension) {
71
71
  var _attr = _data.dimension;
72
72
  setBizAttributeSelectorValue(_objectSpread(_objectSpread({}, _data.dimension), {}, {
73
- key: _attr.propCategory === 'eventProp' ? "".concat(_attr.propCategory, "-").concat(_attr.value) : "".concat(_attr.propCategory, "-").concat(_attr.value)
73
+ key: "".concat(_attr.propCategory, "-").concat(_attr.value)
74
74
  }));
75
75
  }
76
76
  }
@@ -122,7 +122,7 @@ var EventFilter = function EventFilter(props) {
122
122
  category: attr.category,
123
123
  value: _value,
124
124
  id: attr.id,
125
- key: attr.propCategory === 'eventProp' ? "".concat(attr.propCategory, "-").concat(_value) : "".concat(attr.propCategory, "-").concat(_value)
125
+ key: "".concat(attr.propCategory, "-").concat(_value)
126
126
  });
127
127
  }
128
128
  };
@@ -67,18 +67,6 @@ var EventContent = function EventContent(props) {
67
67
  var chartRef = useRef();
68
68
  useEffect(function () {
69
69
  console.log('searchData改变了,准备请求数据', searchData);
70
- if (searchData) {
71
- if (searchData.dimension) {
72
- var _getValue;
73
- var _attrName = (_getValue = getValue(searchData.dimension, eventGroupList, eventEnvList, userPropList)) === null || _getValue === void 0 ? void 0 : _getValue.name;
74
- if (_attrName) {
75
- setEnableSelectChart(judgeIsArea(_attrName));
76
- setIsCity(judgeIsCity(_attrName));
77
- }
78
- } else {
79
- setEnableSelectChart(false);
80
- }
81
- }
82
70
  if (timer) clearTimeout(timer);
83
71
  var flag = true;
84
72
  timer = setTimeout(function () {
@@ -95,6 +83,10 @@ var EventContent = function EventContent(props) {
95
83
  handleSearch && handleSearch(loading);
96
84
  }, [loading]);
97
85
  var fetchRequest = function fetchRequest(flag) {
86
+ if (JSON.stringify(searchData) === JSON.stringify(finalSearchData)) {
87
+ console.log('数据没变,终止请求');
88
+ return;
89
+ }
98
90
  if (flag !== undefined) ajaxFlag = flag;
99
91
  if (!ajaxFlag) return;
100
92
  setLoading(true);
@@ -161,6 +153,19 @@ var EventContent = function EventContent(props) {
161
153
  analysisIndex: _searchData.analysisIndex,
162
154
  chartType: _searchData.chartType
163
155
  }, data);
156
+ if (_data.dimension) {
157
+ var _getValue;
158
+ var _attrName = (_getValue = getValue(_data.dimension, eventGroupList, eventEnvList, userPropList)) === null || _getValue === void 0 ? void 0 : _getValue.name;
159
+ if (_attrName) {
160
+ setEnableSelectChart(judgeIsArea(_attrName));
161
+ setIsCity(judgeIsCity(_attrName));
162
+ }
163
+ } else {
164
+ setEnableSelectChart(false);
165
+ if (_data.chartType === 'map') {
166
+ _data.chartType = 'line';
167
+ }
168
+ }
164
169
  onChangeUrlParam(_objectSpread({}, _data));
165
170
  return _objectSpread({}, _data);
166
171
  });
@@ -28,7 +28,7 @@ export var judgeIsArea = function judgeIsArea(name) {
28
28
  };
29
29
  export var getValue = function getValue(param, eventGroupList, eventEnvList, userPropList) {
30
30
  var res = undefined;
31
- var key = param.propCategory === 'eventProp' ? "".concat(param.propCategory, "-").concat(param.value) : "".concat(param.propCategory, "-").concat(param.value, "-").concat(param.id);
31
+ var key = "".concat(param.propCategory, "-").concat(param.value);
32
32
  if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'envProp') {
33
33
  eventEnvList === null || eventEnvList === void 0 ? void 0 : eventEnvList.forEach(function (attr) {
34
34
  if (attr.key === key) res = attr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-event",
3
- "version": "0.0.2-event.61",
3
+ "version": "0.0.2-event.63",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -49,7 +49,7 @@
49
49
  "react": "^16.12.0 || ^17.0.0",
50
50
  "yorkie": "^2.0.0"
51
51
  },
52
- "gitHead": "8c79ec98431de35dafd6215ce637cdc77dbb1fc8",
52
+ "gitHead": "23bb5234cd82f3d393530950ccbe5b13bb0daead",
53
53
  "dependencies": {
54
54
  "react-copy-to-clipboard": "^5.1.0",
55
55
  "react-highlight": "^0.15.0"