@zgfe/modules-event 1.0.3 → 1.0.4
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.
|
@@ -15,7 +15,7 @@ import { Tooltip, Empty } from 'antd';
|
|
|
15
15
|
import { BizChart, BizGlobalDataContext, ajax, BizLoading } from '@zgfe/business-lib';
|
|
16
16
|
import { EventTable } from '../../components';
|
|
17
17
|
import { judgeIsCity } from '../content/utils';
|
|
18
|
-
import { getValue } from '../../modules/content/utils';
|
|
18
|
+
import { getValue, getMapChartData } from '../../modules/content/utils';
|
|
19
19
|
import { getDefaultShow, getShowColor, getUserGroupsCompareData, getSortData, getChartDataEventAliasName } from '../../utils/formData';
|
|
20
20
|
import _ from 'lodash';
|
|
21
21
|
import moment from 'moment';
|
|
@@ -152,7 +152,7 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
152
152
|
ref: ref,
|
|
153
153
|
key: chartType,
|
|
154
154
|
type: chartType,
|
|
155
|
-
data: dataSource,
|
|
155
|
+
data: chartType === 'map' ? getMapChartData(dataSource) : dataSource,
|
|
156
156
|
legendPosition: "bottom",
|
|
157
157
|
showList: showList,
|
|
158
158
|
colors: showColors,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AttributeSelect, AttrConditionTypes } from '@zgfe/business-lib';
|
|
2
2
|
import { bizAttributeSelectorValueProp } from '../../types';
|
|
3
3
|
import { EventGroup, UserProp, EnvProp } from '@zgfe/business-lib/es/attributeSelector/types';
|
|
4
|
+
export declare const getMapChartData: (data: any) => any;
|
|
4
5
|
export declare const judgeFilterValue: (data: AttrConditionTypes.GroupValue | undefined, count: number) => boolean;
|
|
5
6
|
export declare const judgeIsCity: (name: string | undefined) => boolean;
|
|
6
7
|
export declare const judgeIsArea: (name: string | undefined) => boolean;
|
|
@@ -6,6 +6,23 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import { ajax } from '@zgfe/business-lib';
|
|
8
8
|
import { Apis } from '../../constants';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
export var getMapChartData = function getMapChartData(data) {
|
|
11
|
+
var _data = _.cloneDeep(data);
|
|
12
|
+
_data.series.map(function (item) {
|
|
13
|
+
if (item.names.length > 1) {
|
|
14
|
+
if (item.names[1] === '新疆维吾尔自治区') {
|
|
15
|
+
item.names = [item.names[0], '新疆'];
|
|
16
|
+
}
|
|
17
|
+
item.names = item.names.reverse();
|
|
18
|
+
} else {
|
|
19
|
+
if (item.names[0] === '新疆维吾尔自治区') {
|
|
20
|
+
item.names = ['新疆'];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return _data;
|
|
25
|
+
};
|
|
9
26
|
export var judgeFilterValue = function judgeFilterValue(data, count) {
|
|
10
27
|
var flag = true;
|
|
11
28
|
if (data === undefined) {
|
|
@@ -39,39 +39,13 @@ export default (function () {
|
|
|
39
39
|
};
|
|
40
40
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
41
41
|
needMeta: true,
|
|
42
|
-
defaultApp:
|
|
42
|
+
defaultApp: 461
|
|
43
43
|
}, isDetail ? /*#__PURE__*/React.createElement("div", null, JSON.stringify(detailParams), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
|
|
44
44
|
onClick: function onClick() {
|
|
45
45
|
return setIsDetail(false);
|
|
46
46
|
}
|
|
47
47
|
}, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleEvent, {
|
|
48
48
|
onChange: onChange,
|
|
49
|
-
defaultValue: {
|
|
50
|
-
data: {
|
|
51
|
-
app_id: 268,
|
|
52
|
-
module: 'event',
|
|
53
|
-
appId: 268,
|
|
54
|
-
platform: 0,
|
|
55
|
-
userGroup: [],
|
|
56
|
-
time: {
|
|
57
|
-
begin: '2023-11-08',
|
|
58
|
-
end: '2023-11-15',
|
|
59
|
-
relative: [7, 0],
|
|
60
|
-
unit: 'day'
|
|
61
|
-
},
|
|
62
|
-
chartType: 'line',
|
|
63
|
-
analysisIndex: 'sum',
|
|
64
|
-
analysisAttr: 'total',
|
|
65
|
-
id: 16883,
|
|
66
|
-
name: 'revenue',
|
|
67
|
-
analysisSubject: {
|
|
68
|
-
subjectId: 53,
|
|
69
|
-
subjectName: 'price',
|
|
70
|
-
subjectAlias: null,
|
|
71
|
-
unit: '元'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
49
|
afterEditTarget: afterEditTarget,
|
|
76
50
|
onUserDrill: onUserDrill
|
|
77
51
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-event",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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": "
|
|
52
|
+
"gitHead": "f03dec4f9f77be83b16da1a9ab6ac83b67506443",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"react-copy-to-clipboard": "^5.1.0",
|
|
55
55
|
"react-highlight": "^0.15.0"
|