@zgfe/business-lib 1.1.55-beta.7 → 1.1.55-idmapping.0
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.
- package/es/addToPanel/demo/index.js +0 -8
- package/es/addToPanel/index.js +2 -3
- package/es/assets/styles/chunks.less +5 -10
- package/es/assets/styles/resetAntd.less +6 -5
- package/es/assets/styles/variable.less +0 -3
- package/es/attrCondition/styles/index.less +1 -0
- package/es/attrConditions/styles/index.less +5 -3
- package/es/attributeSelector/index.js +1 -1
- package/es/attributeSelector/styles/index.less +0 -4
- package/es/chart/demo/data/data.js +1 -1
- package/es/chart/demo/pie.js +4 -2
- package/es/chart/index.js +1 -1
- package/es/chart/types.d.ts +0 -3
- package/es/chart/util/chartOptionConfig.d.ts +1 -1
- package/es/chart/util/chartOptionConfig.js +4 -23
- package/es/chart/util/formatData.d.ts +0 -3
- package/es/chart/util/formatData.js +1 -4
- package/es/demoWrapper/head.d.ts +0 -1
- package/es/demoWrapper/head.js +2 -8
- package/es/demoWrapper/index.js +1 -4
- package/es/eventSelector/demo/index.js +6 -1
- package/es/eventSelector/index.js +1 -1
- package/es/eventSelector/styles/index.less +1 -5
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -2
- package/es/layout/optionTitle/index.js +11 -25
- package/es/layout/optionTitle/layout.js +1 -1
- package/es/layout/optionTitle/styles/index.less +0 -14
- package/es/layout/optionTitle/types.d.ts +2 -2
- package/es/userGroup/index.js +2 -10
- package/es/userGroup/styles/index.less +1 -3
- package/es/utils/ajax.js +9 -21
- package/es/utils/demo/ajax.js +2 -1
- package/package.json +2 -2
- package/es/layout/optionTitle/demo/page.d.ts +0 -2
- package/es/layout/optionTitle/demo/page.js +0 -5
- package/es/quickDatePicker/demo/index.d.ts +0 -3
- package/es/quickDatePicker/demo/index.js +0 -36
- package/es/quickDatePicker/index.d.ts +0 -6
- package/es/quickDatePicker/index.js +0 -153
- package/es/quickDatePicker/styles/index.less +0 -121
- package/es/quickDatePicker/types.d.ts +0 -24
- package/es/quickDatePicker/types.js +0 -1
- package/es/quickDatePicker/utils.d.ts +0 -10
- package/es/quickDatePicker/utils.js +0 -42
- package/es/utils/demo/interruption.d.ts +0 -2
- package/es/utils/demo/interruption.js +0 -38
|
@@ -15,10 +15,6 @@ var chartTypes = [{
|
|
|
15
15
|
label: '汇总图',
|
|
16
16
|
value: 'bar',
|
|
17
17
|
icon: 'huizongtu'
|
|
18
|
-
}, {
|
|
19
|
-
label: '占比图',
|
|
20
|
-
value: 'pie',
|
|
21
|
-
icon: 'huizongtu'
|
|
22
18
|
}, {
|
|
23
19
|
label: '地图',
|
|
24
20
|
value: 'map',
|
|
@@ -36,10 +32,6 @@ var chartTypes = [{
|
|
|
36
32
|
label: '汇总图',
|
|
37
33
|
value: 'bar',
|
|
38
34
|
icon: 'huizongtu'
|
|
39
|
-
}, {
|
|
40
|
-
label: '占比图',
|
|
41
|
-
value: 'pie',
|
|
42
|
-
icon: 'huizongtu'
|
|
43
35
|
}]
|
|
44
36
|
}, {
|
|
45
37
|
label: '分数',
|
package/es/addToPanel/index.js
CHANGED
|
@@ -43,7 +43,6 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
43
43
|
router = _useContext.router,
|
|
44
44
|
routes = _useContext.routes,
|
|
45
45
|
isDemo = _useContext.isDemo;
|
|
46
|
-
var showTypes = ['line', 'bar', 'pie'];
|
|
47
46
|
useEffect(function () {
|
|
48
47
|
queryGroups();
|
|
49
48
|
}, []);
|
|
@@ -167,8 +166,8 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
167
166
|
}
|
|
168
167
|
return /*#__PURE__*/React.createElement(BizDialog, {
|
|
169
168
|
open: true,
|
|
170
|
-
width: "auto",
|
|
171
169
|
title: props.type === 'edit' ? '修改当前看板指标' : '向看板添加指标',
|
|
170
|
+
width: 503,
|
|
172
171
|
maskClosable: false,
|
|
173
172
|
onCancel: props.onCancel,
|
|
174
173
|
onOk: onAdd,
|
|
@@ -250,7 +249,7 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
250
249
|
}, function (_ref) {
|
|
251
250
|
var getFieldValue = _ref.getFieldValue;
|
|
252
251
|
var type = getFieldValue('chartType');
|
|
253
|
-
return
|
|
252
|
+
return type === 'line' || type === 'bar' ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
254
253
|
label: "\u663E\u793A",
|
|
255
254
|
name: "showList",
|
|
256
255
|
colon: false,
|
|
@@ -25,15 +25,10 @@
|
|
|
25
25
|
|
|
26
26
|
// 下拉组件操作栏样式
|
|
27
27
|
.__select-handle {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
background: @custom-background;
|
|
31
|
-
border: 1px solid @custom-background;
|
|
28
|
+
padding: @padding-xss;
|
|
29
|
+
border: 1px solid @border-color-base;
|
|
32
30
|
border-radius: @border-radius-small;
|
|
33
31
|
cursor: pointer;
|
|
34
|
-
&:hover {
|
|
35
|
-
border: 1px solid @primary-color;
|
|
36
|
-
}
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
// 下拉组件展开panel样式
|
|
@@ -123,7 +118,7 @@
|
|
|
123
118
|
.__default-overflow();
|
|
124
119
|
|
|
125
120
|
&:hover:not(.disable) {
|
|
126
|
-
|
|
121
|
+
background-color: @background-color-base;
|
|
127
122
|
border-color: @primary-color;
|
|
128
123
|
box-shadow: none;
|
|
129
124
|
}
|
|
@@ -137,14 +132,14 @@
|
|
|
137
132
|
|
|
138
133
|
// 下拉框常用样式
|
|
139
134
|
.__select-normal-secondary {
|
|
140
|
-
|
|
135
|
+
background-color: @white;
|
|
141
136
|
border: 1px solid @border-color-base;
|
|
142
137
|
border-radius: @border-radius-small;
|
|
143
138
|
|
|
144
139
|
&:not(.disable) {
|
|
145
140
|
&:hover,
|
|
146
141
|
&.active {
|
|
147
|
-
|
|
142
|
+
.__default-hover();
|
|
148
143
|
border-color: @border-color-base;
|
|
149
144
|
box-shadow: none;
|
|
150
145
|
}
|
|
@@ -162,13 +162,14 @@
|
|
|
162
162
|
|
|
163
163
|
&:hover:not(.ant-picker-disabled),
|
|
164
164
|
&.ant-picker-focused {
|
|
165
|
-
|
|
165
|
+
.__default-hover() !important;
|
|
166
166
|
border-color: @border-color-base!important;
|
|
167
167
|
box-shadow: none !important;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
|
|
169
|
+
span,
|
|
170
|
+
input {
|
|
171
|
+
color: @primary-color!important;
|
|
172
|
+
}
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
.ant-picker-active-bar {
|
|
@@ -12,6 +12,3 @@
|
|
|
12
12
|
@box-shadow-small: 0px 1px 2px @shadow-color-light;
|
|
13
13
|
@primary-color-hover: color(~`colorPalette('@{primary-color}', 0.1) `);
|
|
14
14
|
@box-shadow-form: 0 0 0 4px @primary-color-hover;
|
|
15
|
-
@custom-background: #fafafb;
|
|
16
|
-
@custom-focus: #f0f7ff;
|
|
17
|
-
@primary-color: '#165dff';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
/* 筛选条件 */
|
|
4
4
|
.biz-condition-item {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
&.border {
|
|
6
|
+
.__select-handle();
|
|
7
|
+
}
|
|
8
8
|
&-panel {
|
|
9
9
|
display: flex;
|
|
10
10
|
width: 100%;
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
.biz-attr-select-handle {
|
|
20
20
|
margin-bottom: 2px;
|
|
21
21
|
padding: 0;
|
|
22
|
+
border: none;
|
|
23
|
+
border-radius: 0;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
.ant-input {
|
|
@@ -83,7 +83,7 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
83
83
|
setVisible(flag);
|
|
84
84
|
};
|
|
85
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
86
|
-
className:
|
|
86
|
+
className: classPrefix
|
|
87
87
|
}, /*#__PURE__*/React.createElement("div", {
|
|
88
88
|
className: "".concat(classPrefix, "-handle")
|
|
89
89
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
x_axis: ['2022-03-31', '2022-04-01', '2022-04-02', '2022-04-03', '2022-04-04', '2022-04-05', '2022-04-06', '2022-04-07', '2022-04-08', '2022-04-09', '2022-04-10', '2022-04-11', '2022-04-12', '2022-04-13'],
|
|
3
3
|
series: [{
|
|
4
|
-
names: ['
|
|
4
|
+
names: ['付款成功'],
|
|
5
5
|
values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
|
|
6
6
|
}, {
|
|
7
7
|
names: ['注册-发送手机验证码'],
|
package/es/chart/demo/pie.js
CHANGED
|
@@ -6,7 +6,9 @@ export default (function () {
|
|
|
6
6
|
data: pieData,
|
|
7
7
|
type: "pie",
|
|
8
8
|
showAll: false,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
legendPosition: "bottom",
|
|
10
|
+
legendOrient: "vertical",
|
|
11
|
+
colors: ['#1D9ED1', '#F383A2', '#9FB40F', '#FF6B3B', '#8C8C47'],
|
|
12
|
+
showList: ['付款成功', '搜索商品', '查看商品详情', 'click']
|
|
11
13
|
});
|
|
12
14
|
});
|
package/es/chart/index.js
CHANGED
|
@@ -56,7 +56,7 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
56
56
|
if (!data) return eOption;
|
|
57
57
|
if (type === 'pie') {
|
|
58
58
|
var rData = formatPieData(data, showAll, showList);
|
|
59
|
-
eOption = getPieOption(rData, legendPosition, legendOrient,
|
|
59
|
+
eOption = getPieOption(rData, legendPosition, legendOrient, tooltipFormatter);
|
|
60
60
|
} else if (type === 'line' || type === 'bar') {
|
|
61
61
|
var _rData = formatChartData(data, showAll, showList, reverseXAxis, colors);
|
|
62
62
|
eOption = getChartOption(type, _rData, legendPosition, legendOrient, valueUnit, xRotate, yRotate, tooltipFormatter, xAxisFormatter, yAxisFormatter, legendFormatter, reverseXAxis, seriesName);
|
package/es/chart/types.d.ts
CHANGED
|
@@ -29,9 +29,6 @@ export declare namespace ChartTypes {
|
|
|
29
29
|
isCity?: boolean;
|
|
30
30
|
userGroup?: string;
|
|
31
31
|
colors?: string[];
|
|
32
|
-
showLabel?: boolean;
|
|
33
|
-
radius?: string | number | Array<string | number>;
|
|
34
|
-
center?: Array<string | number>;
|
|
35
32
|
tooltipFormatter?: (param: any) => string;
|
|
36
33
|
xAxisFormatter?: (param: any) => string;
|
|
37
34
|
yAxisFormatter?: (param: any) => string;
|
|
@@ -17,7 +17,7 @@ export declare const xAxisConfig: XAXisOption;
|
|
|
17
17
|
export declare const yAxisConfig: YAXisOption;
|
|
18
18
|
export declare const tooltipConfig: TooltipComponentOption;
|
|
19
19
|
export declare const getChartOption: (chartType: string, data: ChartTypes.Value, legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical', unit?: string, xRotate?: number, yRotate?: number, tooltipFormatter?: ((value: any) => string) | undefined, xAxisFormatter?: ((value: any) => string) | undefined, yAxisFormatter?: ((value: any) => string) | undefined, legendFormatter?: ((value: any) => string) | undefined, reverseXAxis?: boolean, seriesName?: string) => EChartsOption;
|
|
20
|
-
export declare const getPieOption: (seriesData?: object[], legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical',
|
|
20
|
+
export declare const getPieOption: (seriesData?: object[], legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical', tooltipFormatter?: ((value: any) => string) | undefined) => EChartsOption;
|
|
21
21
|
export declare const getMapOption: (seriesData: object[] | undefined, maxMinValue: {
|
|
22
22
|
min: number;
|
|
23
23
|
max: number;
|
|
@@ -7,7 +7,6 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
7
7
|
import { tooltipFormatterDefault, xAxisFormatterDefault, yAxisFormatterDefault, mapTooltipFormatter, legendFormatterDefault } from './formatOption';
|
|
8
8
|
import { chartColors } from './color';
|
|
9
9
|
import '../styles/index.less';
|
|
10
|
-
import { util } from '../../utils';
|
|
11
10
|
export var baseConfig = {
|
|
12
11
|
color: chartColors,
|
|
13
12
|
backgroundColor: '#fff',
|
|
@@ -27,7 +26,6 @@ export var legendConfig = {
|
|
|
27
26
|
itemHeight: 10,
|
|
28
27
|
itemWidth: 10,
|
|
29
28
|
itemGap: 21,
|
|
30
|
-
z: 10,
|
|
31
29
|
textStyle: {
|
|
32
30
|
color: '#5F6085',
|
|
33
31
|
height: 10,
|
|
@@ -38,6 +36,7 @@ export var legendConfig = {
|
|
|
38
36
|
}
|
|
39
37
|
},
|
|
40
38
|
formatter: ['{a|{name}}'].join('\n'),
|
|
39
|
+
pageIconSize: 10,
|
|
41
40
|
pageTextStyle: {
|
|
42
41
|
color: '#5F6085'
|
|
43
42
|
},
|
|
@@ -201,29 +200,12 @@ export var getPieOption = function getPieOption() {
|
|
|
201
200
|
var seriesData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
202
201
|
var legendPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
|
|
203
202
|
var legendOrient = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'horizontal';
|
|
204
|
-
var
|
|
205
|
-
var radius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [0, '75%'];
|
|
206
|
-
var center = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ['50%', '55%'];
|
|
207
|
-
var tooltipFormatter = arguments.length > 6 ? arguments[6] : undefined;
|
|
208
|
-
var legendFormatter = arguments.length > 7 ? arguments[7] : undefined;
|
|
203
|
+
var tooltipFormatter = arguments.length > 3 ? arguments[3] : undefined;
|
|
209
204
|
var series = [{
|
|
210
205
|
type: 'pie',
|
|
211
206
|
data: seriesData,
|
|
212
207
|
label: {
|
|
213
|
-
show:
|
|
214
|
-
color: 'inherit',
|
|
215
|
-
formatter: function formatter(params) {
|
|
216
|
-
return util.strMiddleSplit(params.name);
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
radius: radius,
|
|
220
|
-
center: center,
|
|
221
|
-
emphasis: {
|
|
222
|
-
itemStyle: {
|
|
223
|
-
shadowBlur: 10,
|
|
224
|
-
shadowOffsetX: 0,
|
|
225
|
-
shadowColor: 'rgba(0, 0, 0, 0.1)'
|
|
226
|
-
}
|
|
208
|
+
show: false
|
|
227
209
|
}
|
|
228
210
|
}];
|
|
229
211
|
var tooltip = JSON.parse(JSON.stringify(tooltipConfig)),
|
|
@@ -238,7 +220,6 @@ export var getPieOption = function getPieOption() {
|
|
|
238
220
|
legend.width = 50;
|
|
239
221
|
grid.left = '10%';
|
|
240
222
|
}
|
|
241
|
-
legend.formatter = legendFormatter ? legendFormatter : legendFormatterDefault;
|
|
242
223
|
tooltip.trigger = 'item';
|
|
243
224
|
if (tooltipFormatter) {
|
|
244
225
|
tooltip.formatter = tooltipFormatter;
|
|
@@ -247,7 +228,7 @@ export var getPieOption = function getPieOption() {
|
|
|
247
228
|
var name = params.name,
|
|
248
229
|
value = params.value,
|
|
249
230
|
color = params.color;
|
|
250
|
-
return "<div class=\"biz-chart-tooltip-item\">\n <
|
|
231
|
+
return "<div class=\"biz-chart-tooltip-item\">\n <span class=\"biz-chart-tooltip-content\">\n <span class=\"biz-tooltip-marker\" style=\"background:".concat(color, "\"></span>").concat(name, "\n </span> \n <span class=\"biz-chart-tooltip-value\">").concat(value, "</span>\n </div>");
|
|
251
232
|
};
|
|
252
233
|
}
|
|
253
234
|
return _objectSpread(_objectSpread({}, baseConfig), {}, {
|
|
@@ -2,9 +2,6 @@ import { ChartTypes } from '../types';
|
|
|
2
2
|
export declare const formatPieData: (data: ChartTypes.Value, showAll?: boolean, showList?: Array<any>) => {
|
|
3
3
|
name: string;
|
|
4
4
|
value: number;
|
|
5
|
-
itemStyle: {
|
|
6
|
-
color: string;
|
|
7
|
-
};
|
|
8
5
|
}[];
|
|
9
6
|
export declare const formatChartData: (data: ChartTypes.Value, showAll?: boolean, showList?: Array<any>, reverseXAxis?: boolean, color?: string[]) => {
|
|
10
7
|
x_axis: string[];
|
package/es/demoWrapper/head.d.ts
CHANGED
package/es/demoWrapper/head.js
CHANGED
|
@@ -4,14 +4,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
5
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { Select, Skeleton
|
|
7
|
+
import { Select, Skeleton } from 'antd';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
import request from '../utils/ajax';
|
|
10
10
|
var DemoHeader = function DemoHeader(_ref) {
|
|
11
11
|
var defaultApp = _ref.defaultApp,
|
|
12
12
|
onChangeApp = _ref.onChangeApp,
|
|
13
|
-
onLoading = _ref.onLoading
|
|
14
|
-
onLogin = _ref.onLogin;
|
|
13
|
+
onLoading = _ref.onLoading;
|
|
15
14
|
var _useState = useState([]),
|
|
16
15
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17
16
|
appList = _useState2[0],
|
|
@@ -29,11 +28,6 @@ var DemoHeader = function DemoHeader(_ref) {
|
|
|
29
28
|
function queryAppList() {
|
|
30
29
|
setLoading(true);
|
|
31
30
|
request('/zg/web/v2/data/v2ajaxGetDataByApp').then(function (res) {
|
|
32
|
-
if (!res.data) {
|
|
33
|
-
message.error('获取应用列表失败,请重新登录');
|
|
34
|
-
onLogin && onLogin();
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
31
|
setAppList(res.data.appList);
|
|
38
32
|
if (defaultApp) {
|
|
39
33
|
_onChange(res.data.appList.find(function (item) {
|
package/es/demoWrapper/index.js
CHANGED
|
@@ -60,10 +60,7 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
60
60
|
title: /*#__PURE__*/React.createElement(DemoHeader, {
|
|
61
61
|
defaultApp: defaultApp,
|
|
62
62
|
onChangeApp: setApp,
|
|
63
|
-
onLoading: setAppListLoading
|
|
64
|
-
onLogin: function onLogin() {
|
|
65
|
-
return setNotLogin(true);
|
|
66
|
-
}
|
|
63
|
+
onLoading: setAppListLoading
|
|
67
64
|
}),
|
|
68
65
|
className: className,
|
|
69
66
|
bodyStyle: {
|
|
@@ -25,7 +25,12 @@ var EventDemo = function EventDemo() {
|
|
|
25
25
|
var onChange = function onChange(data) {
|
|
26
26
|
setValue(data);
|
|
27
27
|
};
|
|
28
|
-
return /*#__PURE__*/React.createElement("div",
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
style: {
|
|
30
|
+
height: '500px',
|
|
31
|
+
overflow: 'auto'
|
|
32
|
+
}
|
|
33
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
29
34
|
style: {
|
|
30
35
|
height: '700px'
|
|
31
36
|
}
|
|
@@ -100,7 +100,7 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
100
100
|
setVisible(flag);
|
|
101
101
|
};
|
|
102
102
|
return /*#__PURE__*/React.createElement("div", {
|
|
103
|
-
className: [classPrefix, border ? 'border' : ''
|
|
103
|
+
className: [classPrefix, border ? 'border' : ''].join(' ')
|
|
104
104
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
105
105
|
dropdownRender: function dropdownRender() {
|
|
106
106
|
return /*#__PURE__*/React.createElement(EventListPanel, {
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
@import '../../assets/styles/inner.less';
|
|
2
2
|
|
|
3
3
|
.biz-event-select {
|
|
4
|
-
position: relative;
|
|
5
|
-
border-radius: 4px;
|
|
6
|
-
&.focus {
|
|
7
|
-
box-shadow: 0 0 0 4px @custom-focus;
|
|
8
|
-
}
|
|
9
4
|
&.border {
|
|
10
5
|
.biz-event-select-handle {
|
|
11
6
|
.__select-handle();
|
|
12
7
|
}
|
|
13
8
|
}
|
|
9
|
+
position: relative;
|
|
14
10
|
&-list-panel {
|
|
15
11
|
display: flex;
|
|
16
12
|
flex-direction: row;
|
package/es/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import BizTargetCondition from './targetConditionGroup';
|
|
|
8
8
|
import BizConditionItem from './attrConditions';
|
|
9
9
|
import BizConditionGroup from './attrConditions/group';
|
|
10
10
|
import BizDatePicker from './datePicker';
|
|
11
|
-
import BizQuickDatePicker from './quickDatePicker';
|
|
12
11
|
import BizSelect from './select';
|
|
13
12
|
import BizDialog from './dialog';
|
|
14
13
|
import BizChart from './chart';
|
|
@@ -35,7 +34,7 @@ import BizAttrCondition from './attrCondition';
|
|
|
35
34
|
import BizAttrConditionGroup from './attrCondition/group';
|
|
36
35
|
import BizTargetFromPanel from './layout/optionTitle';
|
|
37
36
|
import { BizTargetFromPanelContext } from './layout/optionTitle/types';
|
|
38
|
-
export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker,
|
|
37
|
+
export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
|
|
39
38
|
export type { UserGroupTypes } from './userGroup/types';
|
|
40
39
|
export type { BizSelectTypes } from './select/types';
|
|
41
40
|
export type { AttributeSelect } from './attributeSelector/types';
|
package/es/index.js
CHANGED
|
@@ -7,7 +7,6 @@ import BizTargetCondition from './targetConditionGroup';
|
|
|
7
7
|
import BizConditionItem from './attrConditions';
|
|
8
8
|
import BizConditionGroup from './attrConditions/group';
|
|
9
9
|
import BizDatePicker from './datePicker';
|
|
10
|
-
import BizQuickDatePicker from './quickDatePicker';
|
|
11
10
|
import BizSelect from './select';
|
|
12
11
|
import BizDialog from './dialog';
|
|
13
12
|
import BizChart from './chart';
|
|
@@ -34,4 +33,4 @@ import BizAttrCondition from './attrCondition';
|
|
|
34
33
|
import BizAttrConditionGroup from './attrCondition/group';
|
|
35
34
|
import BizTargetFromPanel from './layout/optionTitle';
|
|
36
35
|
import { BizTargetFromPanelContext } from './layout/optionTitle/types';
|
|
37
|
-
export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker,
|
|
36
|
+
export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
|
|
@@ -19,12 +19,12 @@ import Apis from '../../constants/apis';
|
|
|
19
19
|
import { Spin, message } from 'antd';
|
|
20
20
|
export var classPrefix = 'biz-layout-panel';
|
|
21
21
|
var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
22
|
-
var _props$value
|
|
22
|
+
var _props$value$target$p;
|
|
23
23
|
var _useState = useState([]),
|
|
24
24
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
25
|
options = _useState2[0],
|
|
26
26
|
setOptions = _useState2[1];
|
|
27
|
-
var _useState3 = useState(
|
|
27
|
+
var _useState3 = useState(props.value.target.name || '洞察'),
|
|
28
28
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
29
|
title = _useState4[0],
|
|
30
30
|
setTitle = _useState4[1];
|
|
@@ -42,14 +42,11 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
42
42
|
setLoading = _useState10[1];
|
|
43
43
|
var titleRef = useRef(null);
|
|
44
44
|
useEffect(function () {
|
|
45
|
-
|
|
46
|
-
if (!((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.panelId)) return;
|
|
47
|
-
setOptions(((_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.target.id) ? panelBtn(onClick) : panelCreateBtn(onClick));
|
|
45
|
+
setOptions(props.value.target.id ? panelBtn(onClick) : panelCreateBtn(onClick));
|
|
48
46
|
}, []);
|
|
49
47
|
var onClick = function onClick(type) {
|
|
50
48
|
if (type === BizOptionTitleProps.OptionTypes.CANCEL) {
|
|
51
|
-
var
|
|
52
|
-
var param = ((_props$value4 = props.value) === null || _props$value4 === void 0 ? void 0 : _props$value4.target.id) ? {
|
|
49
|
+
var param = props.value.target.id ? {
|
|
53
50
|
panelId: props.value.panelId,
|
|
54
51
|
elementId: props.value.target.id,
|
|
55
52
|
name: title
|
|
@@ -65,13 +62,12 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
65
62
|
}
|
|
66
63
|
};
|
|
67
64
|
var onDelete = function onDelete() {
|
|
68
|
-
var _props$value5, _props$value6;
|
|
69
65
|
setLoading(true);
|
|
70
66
|
ajax(Apis.delPanelElement, {
|
|
71
67
|
method: 'post',
|
|
72
68
|
data: {
|
|
73
|
-
panelId:
|
|
74
|
-
elementId:
|
|
69
|
+
panelId: props.value.panelId,
|
|
70
|
+
elementId: props.value.target.id
|
|
75
71
|
}
|
|
76
72
|
}).then(function (res) {
|
|
77
73
|
if (!res) return;
|
|
@@ -84,7 +80,6 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
84
80
|
});
|
|
85
81
|
};
|
|
86
82
|
var onService = function onService(value, callback) {
|
|
87
|
-
var _props$value7, _props$value8;
|
|
88
83
|
setTitle(value);
|
|
89
84
|
setBtnOptions(!value);
|
|
90
85
|
if (!value) return;
|
|
@@ -92,8 +87,8 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
92
87
|
ajax(Apis.updateElementName, {
|
|
93
88
|
method: 'post',
|
|
94
89
|
data: {
|
|
95
|
-
panelId:
|
|
96
|
-
elementId:
|
|
90
|
+
panelId: props.value.panelId,
|
|
91
|
+
elementId: props.value.target.id,
|
|
97
92
|
name: value
|
|
98
93
|
}
|
|
99
94
|
}).then(function (res) {
|
|
@@ -117,27 +112,20 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
117
112
|
};
|
|
118
113
|
var setBtnOptions = function setBtnOptions(disabled) {
|
|
119
114
|
setOptions(function (option) {
|
|
120
|
-
var _props$value9;
|
|
121
115
|
if (!option.length) return [];
|
|
122
116
|
option[option.length - 1].disabled = disabled;
|
|
123
|
-
if (
|
|
117
|
+
if (props.value.target.id) {
|
|
124
118
|
option[option.length - 2].disabled = disabled;
|
|
125
119
|
}
|
|
126
120
|
return _toConsumableArray(option);
|
|
127
121
|
});
|
|
128
122
|
};
|
|
129
|
-
if (!((_props$value10 = props.value) === null || _props$value10 === void 0 ? void 0 : _props$value10.panelId)) {
|
|
130
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
131
|
-
className: "".concat(classPrefix, "-content")
|
|
132
|
-
}, props.children);
|
|
133
|
-
}
|
|
134
123
|
return /*#__PURE__*/React.createElement(BizTargetFromPanelContext.Provider, {
|
|
135
124
|
value: {
|
|
136
125
|
handleSearch: setBtnOptions
|
|
137
126
|
}
|
|
138
127
|
}, /*#__PURE__*/React.createElement(Spin, {
|
|
139
|
-
spinning: loading
|
|
140
|
-
wrapperClassName: classPrefix
|
|
128
|
+
spinning: loading
|
|
141
129
|
}, /*#__PURE__*/React.createElement(BizOptionLayout, {
|
|
142
130
|
ref: titleRef,
|
|
143
131
|
value: title,
|
|
@@ -148,9 +136,7 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
148
136
|
onBack: function onBack() {
|
|
149
137
|
return onClick(BizOptionTitleProps.OptionTypes.CANCEL);
|
|
150
138
|
}
|
|
151
|
-
}, /*#__PURE__*/React.createElement(
|
|
152
|
-
className: "".concat(classPrefix, "-content ").concat(classPrefix, "-content2")
|
|
153
|
-
}, props.children), showDialog && /*#__PURE__*/React.createElement(BizAddToPanel, {
|
|
139
|
+
}, props.children, showDialog && /*#__PURE__*/React.createElement(BizAddToPanel, {
|
|
154
140
|
defaultValue: {
|
|
155
141
|
panel: {
|
|
156
142
|
id: props.value.panelId
|
|
@@ -7,7 +7,7 @@ var BizOptionLayout = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
7
7
|
var className = props.className;
|
|
8
8
|
var classPrefix = 'biz-option-layout';
|
|
9
9
|
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
-
className: "".concat(classPrefix, " ").concat(className
|
|
10
|
+
className: "".concat(classPrefix, " ").concat(className)
|
|
11
11
|
}, /*#__PURE__*/React.createElement("div", {
|
|
12
12
|
className: "".concat(classPrefix, "-header")
|
|
13
13
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
2
2
|
|
|
3
3
|
.biz-layout-panel {
|
|
4
|
-
width: 100%;
|
|
5
|
-
height: 100%;
|
|
6
|
-
& > .ant-spin-container {
|
|
7
|
-
height: 100%;
|
|
8
|
-
}
|
|
9
4
|
/*更多按钮*/
|
|
10
5
|
&-btn-more {
|
|
11
6
|
width: @height-base;
|
|
@@ -21,13 +16,4 @@
|
|
|
21
16
|
.__default-hover();
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
|
-
|
|
25
|
-
&-content {
|
|
26
|
-
width: 100%;
|
|
27
|
-
height: 100%;
|
|
28
|
-
overflow: auto;
|
|
29
|
-
}
|
|
30
|
-
&-content2 {
|
|
31
|
-
height: calc(100% - 64px);
|
|
32
|
-
}
|
|
33
19
|
}
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import AddToPanel from '../../addToPanel/types';
|
|
3
3
|
export declare namespace BizOptionTitleProps {
|
|
4
4
|
export interface Props {
|
|
5
|
-
value
|
|
6
|
-
styleOptions
|
|
5
|
+
value: Value;
|
|
6
|
+
styleOptions: AddToPanel.TabItem[];
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
afterEditTarget?: (type: string, value?: any) => void;
|
|
9
9
|
}
|
package/es/userGroup/index.js
CHANGED
|
@@ -40,15 +40,8 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
40
40
|
setCurrent(value);
|
|
41
41
|
if (props.onChange) props.onChange(value);
|
|
42
42
|
};
|
|
43
|
-
var _useState5 = useState(false),
|
|
44
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
-
focus = _useState6[0],
|
|
46
|
-
setFocus = _useState6[1];
|
|
47
|
-
var onVisibleChange = function onVisibleChange(visible) {
|
|
48
|
-
setFocus(visible);
|
|
49
|
-
};
|
|
50
43
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className:
|
|
44
|
+
className: classPrefix
|
|
52
45
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
53
46
|
loading: loading,
|
|
54
47
|
active: true,
|
|
@@ -64,8 +57,7 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
64
57
|
border: false,
|
|
65
58
|
disableItemList: props.disableItemList,
|
|
66
59
|
onChange: onChange,
|
|
67
|
-
minDropdownWidth: 284
|
|
68
|
-
onVisibleChange: onVisibleChange
|
|
60
|
+
minDropdownWidth: 284
|
|
69
61
|
}), /*#__PURE__*/React.createElement(BizTargetOptionIcon, {
|
|
70
62
|
name: "delete",
|
|
71
63
|
icon: "qingchu",
|
package/es/utils/ajax.js
CHANGED
|
@@ -80,6 +80,7 @@ export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
80
80
|
message.error('账户未登录或登录已失效');
|
|
81
81
|
flag = true;
|
|
82
82
|
} else if (new RegExp("".concat(ResponseStatus.noPermission)).test(apiResult.code)) {
|
|
83
|
+
msg = '账户没有权限';
|
|
83
84
|
message.error('账户没有权限');
|
|
84
85
|
flag = true;
|
|
85
86
|
}
|
|
@@ -89,7 +90,6 @@ export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
89
90
|
message: errorTitle || "\u8BF7\u6C42\u9519\u8BEF",
|
|
90
91
|
description: msg
|
|
91
92
|
});
|
|
92
|
-
message.error(msg);
|
|
93
93
|
throw new Error(msg);
|
|
94
94
|
}
|
|
95
95
|
return apiResult;
|
|
@@ -140,40 +140,28 @@ function _request() {
|
|
|
140
140
|
return req(params.url, params.options);
|
|
141
141
|
case 14:
|
|
142
142
|
res = _context.sent;
|
|
143
|
-
if (res) {
|
|
144
|
-
_context.next = 17;
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
throw new Error('Request Interruption');
|
|
148
|
-
case 17:
|
|
149
143
|
if (!(((_params$options2 = params.options) === null || _params$options2 === void 0 ? void 0 : _params$options2.responseType) === 'blob')) {
|
|
150
|
-
_context.next =
|
|
144
|
+
_context.next = 21;
|
|
151
145
|
break;
|
|
152
146
|
}
|
|
153
147
|
if (!util.isBlob(res.data)) {
|
|
154
|
-
_context.next =
|
|
148
|
+
_context.next = 20;
|
|
155
149
|
break;
|
|
156
150
|
}
|
|
157
151
|
return _context.abrupt("return", downloadFile(res, params.options.fileName));
|
|
158
|
-
case
|
|
152
|
+
case 20:
|
|
159
153
|
res = res.data;
|
|
160
|
-
case
|
|
154
|
+
case 21:
|
|
161
155
|
return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType));
|
|
162
|
-
case
|
|
163
|
-
_context.prev =
|
|
156
|
+
case 24:
|
|
157
|
+
_context.prev = 24;
|
|
164
158
|
_context.t0 = _context["catch"](0);
|
|
165
|
-
if (!(_context.t0.message === 'Request Interruption')) {
|
|
166
|
-
_context.next = 30;
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
throw new Error('Request Interruption');
|
|
170
|
-
case 30:
|
|
171
159
|
return _context.abrupt("return", null);
|
|
172
|
-
case
|
|
160
|
+
case 27:
|
|
173
161
|
case "end":
|
|
174
162
|
return _context.stop();
|
|
175
163
|
}
|
|
176
|
-
}, _callee, null, [[0,
|
|
164
|
+
}, _callee, null, [[0, 24]]);
|
|
177
165
|
}));
|
|
178
166
|
return _request.apply(this, arguments);
|
|
179
167
|
}
|
package/es/utils/demo/ajax.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Button } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ajax
|
|
3
|
+
import { ajax } from '@zgfe/business-lib';
|
|
4
|
+
import { DemoWrapper } from '@zgfe/business-lib';
|
|
4
5
|
export default (function () {
|
|
5
6
|
var onDownload = function onDownload() {
|
|
6
7
|
ajax('/zg/web/v2/openapi/label/excel/export', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.55-
|
|
3
|
+
"version": "1.1.55-idmapping.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.12.0 || ^17.0.0",
|
|
61
61
|
"yorkie": "^2.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "3f7bfa37099970ceb83db0cbbca92f15d78c3692"
|
|
64
64
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { BizQuickDatePicker } from '@zgfe/business-lib';
|
|
8
|
-
import React, { useState } from 'react';
|
|
9
|
-
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
10
|
-
export default (function () {
|
|
11
|
-
var _useState = useState({
|
|
12
|
-
unit: 'day',
|
|
13
|
-
begin: '2023-06-23',
|
|
14
|
-
end: '2023-06-30',
|
|
15
|
-
relative: 7
|
|
16
|
-
}),
|
|
17
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
-
time = _useState2[0],
|
|
19
|
-
setTime = _useState2[1];
|
|
20
|
-
var onChange = function onChange(data) {
|
|
21
|
-
console.log('777', data);
|
|
22
|
-
setTime(data);
|
|
23
|
-
};
|
|
24
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
style: {
|
|
26
|
-
display: 'flex'
|
|
27
|
-
}
|
|
28
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
style: {
|
|
30
|
-
lineHeight: '32px'
|
|
31
|
-
}
|
|
32
|
-
}, "\u9009\u62E9\u65F6\u95F4\uFF1A"), /*#__PURE__*/React.createElement(BizQuickDatePicker, {
|
|
33
|
-
defaultValue: time,
|
|
34
|
-
onChange: onChange
|
|
35
|
-
}));
|
|
36
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './styles/index.less';
|
|
3
|
-
import { QuickDatePickerTypes } from './types';
|
|
4
|
-
export declare const classPrefix = "biz-quick-date-picker-wrap";
|
|
5
|
-
declare const BizQuickDatePicker: React.FC<QuickDatePickerTypes.Props>;
|
|
6
|
-
export default BizQuickDatePicker;
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useEffect, useState } from 'react';
|
|
8
|
-
import './styles/index.less';
|
|
9
|
-
import moment from 'moment';
|
|
10
|
-
import { quickModuleOneOptions, quickModuleTwoOptions } from './utils';
|
|
11
|
-
import IconFont from '../icon/iconFont';
|
|
12
|
-
import { DatePicker } from 'antd';
|
|
13
|
-
var RangePicker = DatePicker.RangePicker;
|
|
14
|
-
export var classPrefix = 'biz-quick-date-picker-wrap';
|
|
15
|
-
var changeCount = 0;
|
|
16
|
-
var BizQuickDatePicker = function BizQuickDatePicker(props) {
|
|
17
|
-
var defaultValue = props.defaultValue;
|
|
18
|
-
var _useState = useState(false),
|
|
19
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
-
show = _useState2[0],
|
|
21
|
-
setShow = _useState2[1];
|
|
22
|
-
var _useState3 = useState(-1),
|
|
23
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
24
|
-
relative = _useState4[0],
|
|
25
|
-
setRelative = _useState4[1];
|
|
26
|
-
var _useState5 = useState('day'),
|
|
27
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
28
|
-
unit = _useState6[0],
|
|
29
|
-
setUnit = _useState6[1];
|
|
30
|
-
var _useState7 = useState([moment().subtract(6, 'day'), moment()]),
|
|
31
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
32
|
-
value = _useState8[0],
|
|
33
|
-
setValue = _useState8[1];
|
|
34
|
-
var _useState9 = useState('过去7天'),
|
|
35
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
36
|
-
showText = _useState10[0],
|
|
37
|
-
setShowText = _useState10[1];
|
|
38
|
-
useEffect(function () {
|
|
39
|
-
var _value = defaultValue || props.value;
|
|
40
|
-
if (_value) {
|
|
41
|
-
setValue([moment(_value.begin), moment(_value.end)]);
|
|
42
|
-
_value.relative && setRelative(_value.relative);
|
|
43
|
-
_value.unit && setUnit(_value.unit);
|
|
44
|
-
}
|
|
45
|
-
}, [defaultValue, props.value]);
|
|
46
|
-
var onChange = function onChange(date, dateString) {
|
|
47
|
-
changeCount++;
|
|
48
|
-
setValue(date);
|
|
49
|
-
setShowText('自定义');
|
|
50
|
-
setRelative(-1);
|
|
51
|
-
if (changeCount >= 2) {
|
|
52
|
-
setShow(false);
|
|
53
|
-
var changeValue = {
|
|
54
|
-
unit: 'day',
|
|
55
|
-
begin: dateString[0],
|
|
56
|
-
end: dateString[1],
|
|
57
|
-
relative: -1
|
|
58
|
-
};
|
|
59
|
-
props.onChange && props.onChange(changeValue);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
useEffect(function () {
|
|
63
|
-
if (!show) changeCount = 0;
|
|
64
|
-
}, [show]);
|
|
65
|
-
var onBlur = function onBlur() {
|
|
66
|
-
setShow(false);
|
|
67
|
-
};
|
|
68
|
-
var onClick = function onClick() {
|
|
69
|
-
setShow(true);
|
|
70
|
-
};
|
|
71
|
-
var disabledDate = function disabledDate(current) {
|
|
72
|
-
return current && current > moment().endOf('month');
|
|
73
|
-
};
|
|
74
|
-
var quickModuleHandle = function quickModuleHandle(item) {
|
|
75
|
-
var _value;
|
|
76
|
-
if (item.type === 'week' || item.type === 'month') {
|
|
77
|
-
switch (Number(item.value)) {
|
|
78
|
-
case 1:
|
|
79
|
-
_value = [moment().weekday(1), moment().weekday(7)];
|
|
80
|
-
break;
|
|
81
|
-
case 2:
|
|
82
|
-
_value = [moment().weekday(1).subtract(1, 'week'), moment().weekday(7).subtract(1, 'week')];
|
|
83
|
-
break;
|
|
84
|
-
case 3:
|
|
85
|
-
_value = [moment().startOf('month'), moment().endOf('month')];
|
|
86
|
-
break;
|
|
87
|
-
case 4:
|
|
88
|
-
_value = [moment().startOf('month').subtract(1, 'month'), moment().endOf('month').subtract(1, 'month')];
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
} else {
|
|
92
|
-
_value = [moment().subtract(Number(item.value) - 1, 'day'), moment()];
|
|
93
|
-
}
|
|
94
|
-
setRelative(item.value);
|
|
95
|
-
setUnit(item.type);
|
|
96
|
-
setShowText(item.label);
|
|
97
|
-
setValue(_value);
|
|
98
|
-
setShow(false);
|
|
99
|
-
if (_value) {
|
|
100
|
-
var changeValue = {
|
|
101
|
-
unit: item.type,
|
|
102
|
-
begin: _value[0].format('YYYY-MM-DD'),
|
|
103
|
-
end: _value[1].format('YYYY-MM-DD'),
|
|
104
|
-
relative: item.value
|
|
105
|
-
};
|
|
106
|
-
props.onChange && props.onChange(changeValue);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
var renderExtraFooter = function renderExtraFooter() {
|
|
110
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
111
|
-
className: "".concat(classPrefix, "-content-options")
|
|
112
|
-
}, /*#__PURE__*/React.createElement("ol", null, quickModuleOneOptions.map(function (item) {
|
|
113
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
114
|
-
className: "".concat(item.type === unit && item.value === relative ? 'active' : ''),
|
|
115
|
-
key: item.label,
|
|
116
|
-
onClick: function onClick() {
|
|
117
|
-
return quickModuleHandle(item);
|
|
118
|
-
}
|
|
119
|
-
}, item.label);
|
|
120
|
-
})), /*#__PURE__*/React.createElement("ol", null, quickModuleTwoOptions.map(function (item) {
|
|
121
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
122
|
-
className: "".concat(item.type === unit && item.value === relative ? 'active' : ''),
|
|
123
|
-
key: item.label,
|
|
124
|
-
onClick: function onClick() {
|
|
125
|
-
return quickModuleHandle(item);
|
|
126
|
-
}
|
|
127
|
-
}, item.label);
|
|
128
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
129
|
-
className: "".concat(relative === -1 ? 'active' : '')
|
|
130
|
-
}, "\u81EA\u5B9A\u4E49\u65F6\u95F4", /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IconFont, {
|
|
131
|
-
type: "fanhuiicon"
|
|
132
|
-
}))));
|
|
133
|
-
};
|
|
134
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
135
|
-
className: "".concat(classPrefix, " clearfix ").concat(show ? 'focus' : ''),
|
|
136
|
-
tabIndex: 1
|
|
137
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
138
|
-
onClick: function onClick() {
|
|
139
|
-
setShow(true);
|
|
140
|
-
}
|
|
141
|
-
}, showText), /*#__PURE__*/React.createElement(RangePicker, {
|
|
142
|
-
popupClassName: "".concat(classPrefix, "-content"),
|
|
143
|
-
separator: '至',
|
|
144
|
-
value: value,
|
|
145
|
-
onBlur: onBlur,
|
|
146
|
-
open: show,
|
|
147
|
-
onClick: onClick,
|
|
148
|
-
disabledDate: disabledDate,
|
|
149
|
-
onChange: onChange,
|
|
150
|
-
renderExtraFooter: renderExtraFooter
|
|
151
|
-
}));
|
|
152
|
-
};
|
|
153
|
-
export default BizQuickDatePicker;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
@import '../../assets/styles/inner.less';
|
|
2
|
-
|
|
3
|
-
.biz-quick-date-picker-wrap {
|
|
4
|
-
display: inline-block;
|
|
5
|
-
height: 34px;
|
|
6
|
-
padding: 4px 8px;
|
|
7
|
-
background: #fafafb;
|
|
8
|
-
border: 1px solid #fafafb;
|
|
9
|
-
border-radius: 4px;
|
|
10
|
-
> :nth-child(1) {
|
|
11
|
-
float: left;
|
|
12
|
-
height: 24px;
|
|
13
|
-
margin-right: 8px;
|
|
14
|
-
padding: 2px 8px;
|
|
15
|
-
color: #165dff;
|
|
16
|
-
vertical-align: middle;
|
|
17
|
-
background: #e8efff;
|
|
18
|
-
}
|
|
19
|
-
.ant-picker {
|
|
20
|
-
padding: 0;
|
|
21
|
-
vertical-align: middle;
|
|
22
|
-
border: none;
|
|
23
|
-
border-radius: 0 !important;
|
|
24
|
-
.ant-picker-clear {
|
|
25
|
-
right: 0;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
.ant-picker:hover {
|
|
29
|
-
.ant-picker-input > input,
|
|
30
|
-
.ant-picker-range-separator {
|
|
31
|
-
color: #021429 !important;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
&-content {
|
|
35
|
-
float: left;
|
|
36
|
-
.ant-picker-panel-container {
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: row-reverse;
|
|
39
|
-
.ant-picker-footer {
|
|
40
|
-
width: auto;
|
|
41
|
-
min-width: auto;
|
|
42
|
-
border-bottom: 1px solid #e8efff;
|
|
43
|
-
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
&-options {
|
|
47
|
-
width: 170px;
|
|
48
|
-
padding-bottom: 25px;
|
|
49
|
-
color: #67727f;
|
|
50
|
-
ol,
|
|
51
|
-
li {
|
|
52
|
-
margin: 0;
|
|
53
|
-
padding: 0;
|
|
54
|
-
list-style: none;
|
|
55
|
-
list-style-type: none;
|
|
56
|
-
}
|
|
57
|
-
> :nth-child(1),
|
|
58
|
-
> :nth-child(2) {
|
|
59
|
-
display: flex;
|
|
60
|
-
flex-wrap: wrap;
|
|
61
|
-
justify-content: space-between;
|
|
62
|
-
margin-top: 8px;
|
|
63
|
-
padding-bottom: 4px;
|
|
64
|
-
border-bottom: 1px solid #ecedf0;
|
|
65
|
-
li {
|
|
66
|
-
width: 81px;
|
|
67
|
-
height: 24px;
|
|
68
|
-
margin-bottom: 8px;
|
|
69
|
-
line-height: 24px;
|
|
70
|
-
text-align: center;
|
|
71
|
-
background: #fafafb;
|
|
72
|
-
border-radius: 24px;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
> :nth-child(2) {
|
|
77
|
-
margin-top: 14px;
|
|
78
|
-
li {
|
|
79
|
-
border-radius: 0;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
> :nth-child(3) {
|
|
83
|
-
display: flex;
|
|
84
|
-
justify-content: space-between;
|
|
85
|
-
width: 100%;
|
|
86
|
-
height: 32px;
|
|
87
|
-
margin-top: 12px;
|
|
88
|
-
padding: 0 12px;
|
|
89
|
-
line-height: 32px;
|
|
90
|
-
background: #fafafb;
|
|
91
|
-
> :first-child {
|
|
92
|
-
transform: rotate(180deg);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
.active,
|
|
96
|
-
li.active {
|
|
97
|
-
color: #165dff;
|
|
98
|
-
background: #e8efff;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.biz-quick-date-picker-wrap:hover {
|
|
105
|
-
border: 1px solid #165dff;
|
|
106
|
-
}
|
|
107
|
-
.biz-quick-date-picker-wrap.focus {
|
|
108
|
-
box-shadow: 0 0 0 4px #f0f7ff;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.clearfix:after {
|
|
112
|
-
display: block;
|
|
113
|
-
clear: both;
|
|
114
|
-
height: 0;
|
|
115
|
-
content: '';
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.clearfix {
|
|
119
|
-
/* 触发 hasLayout */
|
|
120
|
-
zoom: 1;
|
|
121
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare namespace QuickDatePickerTypes {
|
|
2
|
-
interface Options {
|
|
3
|
-
label: string;
|
|
4
|
-
value: number;
|
|
5
|
-
type: 'week' | 'month' | 'day';
|
|
6
|
-
}
|
|
7
|
-
interface Range {
|
|
8
|
-
begin: string;
|
|
9
|
-
end: string;
|
|
10
|
-
}
|
|
11
|
-
interface Value extends Range {
|
|
12
|
-
unit: 'day' | 'week' | 'month';
|
|
13
|
-
relative?: number;
|
|
14
|
-
}
|
|
15
|
-
interface Props {
|
|
16
|
-
defaultValue?: Value;
|
|
17
|
-
value?: Value;
|
|
18
|
-
onChange?: (data: Value) => void;
|
|
19
|
-
}
|
|
20
|
-
interface ListOption {
|
|
21
|
-
count: number;
|
|
22
|
-
value: string;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export var quickModuleOneOptions = [{
|
|
2
|
-
label: '本周',
|
|
3
|
-
value: 1,
|
|
4
|
-
type: 'week'
|
|
5
|
-
}, {
|
|
6
|
-
label: '上周',
|
|
7
|
-
value: 2,
|
|
8
|
-
type: 'week'
|
|
9
|
-
}, {
|
|
10
|
-
label: '本月',
|
|
11
|
-
value: 3,
|
|
12
|
-
type: 'month'
|
|
13
|
-
}, {
|
|
14
|
-
label: '上月',
|
|
15
|
-
value: 4,
|
|
16
|
-
type: 'month'
|
|
17
|
-
}];
|
|
18
|
-
export var quickModuleTwoOptions = [{
|
|
19
|
-
label: '过去5天',
|
|
20
|
-
value: 5,
|
|
21
|
-
type: 'day'
|
|
22
|
-
}, {
|
|
23
|
-
label: '过去7天',
|
|
24
|
-
value: 7,
|
|
25
|
-
type: 'day'
|
|
26
|
-
}, {
|
|
27
|
-
label: '过去14天',
|
|
28
|
-
value: 14,
|
|
29
|
-
type: 'day'
|
|
30
|
-
}, {
|
|
31
|
-
label: '过去30天',
|
|
32
|
-
value: 30,
|
|
33
|
-
type: 'day'
|
|
34
|
-
}, {
|
|
35
|
-
label: '过去60天',
|
|
36
|
-
value: 60,
|
|
37
|
-
type: 'day'
|
|
38
|
-
}, {
|
|
39
|
-
label: '过去180天',
|
|
40
|
-
value: 180,
|
|
41
|
-
type: 'day'
|
|
42
|
-
}];
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Button, message } from 'antd';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ajax } from '@zgfe/business-lib';
|
|
4
|
-
import Request from 'umi-request';
|
|
5
|
-
var CancelToken = Request.CancelToken;
|
|
6
|
-
var cancel;
|
|
7
|
-
export default (function () {
|
|
8
|
-
var getPanels = function getPanels() {
|
|
9
|
-
if (typeof cancel === 'function') {
|
|
10
|
-
cancel();
|
|
11
|
-
}
|
|
12
|
-
ajax('/zg/web/v2/apppanel/panels', {
|
|
13
|
-
method: 'post',
|
|
14
|
-
data: {
|
|
15
|
-
appId: 501648,
|
|
16
|
-
platform: 0
|
|
17
|
-
},
|
|
18
|
-
cancelToken: new CancelToken(function executor(c) {
|
|
19
|
-
cancel = c;
|
|
20
|
-
}),
|
|
21
|
-
responseWrapper: function responseWrapper(_url, res) {
|
|
22
|
-
if (/07$/.test(res.code)) {
|
|
23
|
-
console.log('reLogin-----');
|
|
24
|
-
throw new Error('reLogin');
|
|
25
|
-
}
|
|
26
|
-
return res;
|
|
27
|
-
}
|
|
28
|
-
}).then(function (res) {
|
|
29
|
-
if (!res) return;
|
|
30
|
-
message.success('请求成功');
|
|
31
|
-
}).catch(function (e) {
|
|
32
|
-
console.log(e);
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
36
|
-
onClick: getPanels
|
|
37
|
-
}, "\u8BF7\u6C42\u63A5\u53E3"));
|
|
38
|
-
});
|