@zgfe/business-lib 1.1.55-beta.0 → 1.1.55-beta.10
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 +8 -0
- package/es/addToPanel/index.js +3 -1
- package/es/assets/demo/picker.d.ts +2 -0
- package/es/assets/demo/picker.js +22 -0
- package/es/assets/styles/chunks.less +10 -5
- package/es/assets/styles/resetAntd.less +1 -8
- package/es/assets/styles/variable.less +3 -0
- package/es/attrCondition/styles/index.less +0 -1
- package/es/attrConditions/styles/index.less +3 -5
- package/es/attributeSelector/index.js +1 -1
- package/es/attributeSelector/styles/index.less +4 -0
- package/es/chart/demo/data/data.js +1 -1
- package/es/chart/demo/pie.js +2 -4
- package/es/chart/index.js +1 -1
- package/es/chart/types.d.ts +3 -0
- package/es/chart/util/chartOptionConfig.d.ts +1 -1
- package/es/chart/util/chartOptionConfig.js +23 -4
- package/es/chart/util/formatData.d.ts +3 -0
- package/es/chart/util/formatData.js +4 -1
- package/es/chart/util/formatOption.js +3 -0
- package/es/demoWrapper/index.js +2 -2
- package/es/eventSelector/demo/index.js +1 -6
- package/es/eventSelector/index.js +1 -1
- package/es/eventSelector/styles/index.less +5 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/layout/optionTitle/index.js +8 -3
- package/es/layout/optionTitle/layout.js +1 -1
- package/es/layout/optionTitle/styles/index.less +14 -0
- package/es/quickDatePicker/demo/index.d.ts +3 -0
- package/es/quickDatePicker/demo/index.js +36 -0
- package/es/quickDatePicker/index.d.ts +6 -0
- package/es/quickDatePicker/index.js +153 -0
- package/es/quickDatePicker/styles/index.less +124 -0
- package/es/quickDatePicker/types.d.ts +24 -0
- package/es/quickDatePicker/types.js +1 -0
- package/es/quickDatePicker/utils.d.ts +10 -0
- package/es/quickDatePicker/utils.js +42 -0
- package/es/targetConditionGroup/styles/index.less +3 -0
- package/es/targetSelector/styles/index.less +3 -0
- package/es/userGroup/index.js +10 -2
- package/es/userGroup/styles/index.less +3 -1
- package/es/utils/ajax.js +23 -8
- package/es/utils/demo/interruption.d.ts +2 -0
- package/es/utils/demo/interruption.js +38 -0
- package/package.json +2 -2
|
@@ -15,6 +15,10 @@ var chartTypes = [{
|
|
|
15
15
|
label: '汇总图',
|
|
16
16
|
value: 'bar',
|
|
17
17
|
icon: 'huizongtu'
|
|
18
|
+
}, {
|
|
19
|
+
label: '占比图',
|
|
20
|
+
value: 'pie',
|
|
21
|
+
icon: 'huizongtu'
|
|
18
22
|
}, {
|
|
19
23
|
label: '地图',
|
|
20
24
|
value: 'map',
|
|
@@ -32,6 +36,10 @@ var chartTypes = [{
|
|
|
32
36
|
label: '汇总图',
|
|
33
37
|
value: 'bar',
|
|
34
38
|
icon: 'huizongtu'
|
|
39
|
+
}, {
|
|
40
|
+
label: '占比图',
|
|
41
|
+
value: 'pie',
|
|
42
|
+
icon: 'huizongtu'
|
|
35
43
|
}]
|
|
36
44
|
}, {
|
|
37
45
|
label: '分数',
|
package/es/addToPanel/index.js
CHANGED
|
@@ -43,6 +43,7 @@ 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'];
|
|
46
47
|
useEffect(function () {
|
|
47
48
|
queryGroups();
|
|
48
49
|
}, []);
|
|
@@ -166,6 +167,7 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
166
167
|
}
|
|
167
168
|
return /*#__PURE__*/React.createElement(BizDialog, {
|
|
168
169
|
open: true,
|
|
170
|
+
width: "auto",
|
|
169
171
|
title: props.type === 'edit' ? '修改当前看板指标' : '向看板添加指标',
|
|
170
172
|
maskClosable: false,
|
|
171
173
|
onCancel: props.onCancel,
|
|
@@ -248,7 +250,7 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
248
250
|
}, function (_ref) {
|
|
249
251
|
var getFieldValue = _ref.getFieldValue;
|
|
250
252
|
var type = getFieldValue('chartType');
|
|
251
|
-
return type
|
|
253
|
+
return showTypes.indexOf(type) > -1 ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
252
254
|
label: "\u663E\u793A",
|
|
253
255
|
name: "showList",
|
|
254
256
|
colon: false,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Card, DatePicker, Space } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import AssetsDemo from '.';
|
|
4
|
+
var RangePicker = DatePicker.RangePicker;
|
|
5
|
+
export default (function () {
|
|
6
|
+
return /*#__PURE__*/React.createElement(AssetsDemo, null, /*#__PURE__*/React.createElement(Card, {
|
|
7
|
+
title: "Input"
|
|
8
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
9
|
+
direction: "vertical",
|
|
10
|
+
size: 12
|
|
11
|
+
}, /*#__PURE__*/React.createElement(RangePicker, null), /*#__PURE__*/React.createElement(RangePicker, {
|
|
12
|
+
showTime: true
|
|
13
|
+
}), /*#__PURE__*/React.createElement(RangePicker, {
|
|
14
|
+
picker: "week"
|
|
15
|
+
}), /*#__PURE__*/React.createElement(RangePicker, {
|
|
16
|
+
picker: "month"
|
|
17
|
+
}), /*#__PURE__*/React.createElement(RangePicker, {
|
|
18
|
+
picker: "quarter"
|
|
19
|
+
}), /*#__PURE__*/React.createElement(RangePicker, {
|
|
20
|
+
picker: "year"
|
|
21
|
+
}))));
|
|
22
|
+
});
|
|
@@ -25,10 +25,15 @@
|
|
|
25
25
|
|
|
26
26
|
// 下拉组件操作栏样式
|
|
27
27
|
.__select-handle {
|
|
28
|
-
padding: @padding-xss;
|
|
29
|
-
border: 1px solid @border-color-base;
|
|
28
|
+
// padding: @padding-xss;
|
|
29
|
+
// border: 1px solid @border-color-base;
|
|
30
|
+
background: @custom-background;
|
|
31
|
+
border: 1px solid @custom-background;
|
|
30
32
|
border-radius: @border-radius-small;
|
|
31
33
|
cursor: pointer;
|
|
34
|
+
&:hover {
|
|
35
|
+
border: 1px solid @primary-color;
|
|
36
|
+
}
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
// 下拉组件展开panel样式
|
|
@@ -118,7 +123,7 @@
|
|
|
118
123
|
.__default-overflow();
|
|
119
124
|
|
|
120
125
|
&:hover:not(.disable) {
|
|
121
|
-
background-color: @background-color-base;
|
|
126
|
+
// background-color: @background-color-base;
|
|
122
127
|
border-color: @primary-color;
|
|
123
128
|
box-shadow: none;
|
|
124
129
|
}
|
|
@@ -132,14 +137,14 @@
|
|
|
132
137
|
|
|
133
138
|
// 下拉框常用样式
|
|
134
139
|
.__select-normal-secondary {
|
|
135
|
-
background-color: @white;
|
|
140
|
+
// background-color: @white;
|
|
136
141
|
border: 1px solid @border-color-base;
|
|
137
142
|
border-radius: @border-radius-small;
|
|
138
143
|
|
|
139
144
|
&:not(.disable) {
|
|
140
145
|
&:hover,
|
|
141
146
|
&.active {
|
|
142
|
-
.__default-hover();
|
|
147
|
+
// .__default-hover();
|
|
143
148
|
border-color: @border-color-base;
|
|
144
149
|
box-shadow: none;
|
|
145
150
|
}
|
|
@@ -162,14 +162,7 @@
|
|
|
162
162
|
|
|
163
163
|
&:hover:not(.ant-picker-disabled),
|
|
164
164
|
&.ant-picker-focused {
|
|
165
|
-
|
|
166
|
-
border-color: @border-color-base!important;
|
|
167
|
-
box-shadow: none !important;
|
|
168
|
-
|
|
169
|
-
span,
|
|
170
|
-
input {
|
|
171
|
-
color: @primary-color!important;
|
|
172
|
-
}
|
|
165
|
+
border-color: @primary-color!important;
|
|
173
166
|
}
|
|
174
167
|
|
|
175
168
|
.ant-picker-active-bar {
|
|
@@ -12,3 +12,6 @@
|
|
|
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
|
-
&.border {
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
// &.border {
|
|
6
|
+
// .__select-handle();
|
|
7
|
+
// }
|
|
8
8
|
&-panel {
|
|
9
9
|
display: flex;
|
|
10
10
|
width: 100%;
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
.biz-attr-select-handle {
|
|
20
20
|
margin-bottom: 2px;
|
|
21
21
|
padding: 0;
|
|
22
|
-
border: none;
|
|
23
|
-
border-radius: 0;
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
.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: classPrefix
|
|
86
|
+
className: "".concat(classPrefix, " ").concat(visible ? 'focus' : '')
|
|
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,9 +6,7 @@ export default (function () {
|
|
|
6
6
|
data: pieData,
|
|
7
7
|
type: "pie",
|
|
8
8
|
showAll: false,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
colors: ['#1D9ED1', '#F383A2', '#9FB40F', '#FF6B3B', '#8C8C47'],
|
|
12
|
-
showList: ['付款成功', '搜索商品', '查看商品详情', 'click']
|
|
9
|
+
showList: ['搜索商品', '查看商品详情', 'pv', 'scroll'],
|
|
10
|
+
radius: ['30%', '75%']
|
|
13
11
|
});
|
|
14
12
|
});
|
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, tooltipFormatter);
|
|
59
|
+
eOption = getPieOption(rData, legendPosition, legendOrient, props.showLabel, props.radius, props.center, 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,6 +29,9 @@ 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>;
|
|
32
35
|
tooltipFormatter?: (param: any) => string;
|
|
33
36
|
xAxisFormatter?: (param: any) => string;
|
|
34
37
|
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', tooltipFormatter?: ((value: any) => string) | undefined) => EChartsOption;
|
|
20
|
+
export declare const getPieOption: (seriesData?: object[], legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical', showLabel?: boolean, radius?: string | number | Array<string | number>, center?: Array<string | number>, tooltipFormatter?: ((value: any) => string) | undefined, legendFormatter?: ((value: any) => string) | undefined) => EChartsOption;
|
|
21
21
|
export declare const getMapOption: (seriesData: object[] | undefined, maxMinValue: {
|
|
22
22
|
min: number;
|
|
23
23
|
max: number;
|
|
@@ -7,6 +7,7 @@ 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';
|
|
10
11
|
export var baseConfig = {
|
|
11
12
|
color: chartColors,
|
|
12
13
|
backgroundColor: '#fff',
|
|
@@ -26,6 +27,7 @@ export var legendConfig = {
|
|
|
26
27
|
itemHeight: 10,
|
|
27
28
|
itemWidth: 10,
|
|
28
29
|
itemGap: 21,
|
|
30
|
+
z: 10,
|
|
29
31
|
textStyle: {
|
|
30
32
|
color: '#5F6085',
|
|
31
33
|
height: 10,
|
|
@@ -36,7 +38,6 @@ export var legendConfig = {
|
|
|
36
38
|
}
|
|
37
39
|
},
|
|
38
40
|
formatter: ['{a|{name}}'].join('\n'),
|
|
39
|
-
pageIconSize: 10,
|
|
40
41
|
pageTextStyle: {
|
|
41
42
|
color: '#5F6085'
|
|
42
43
|
},
|
|
@@ -200,12 +201,29 @@ export var getPieOption = function getPieOption() {
|
|
|
200
201
|
var seriesData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
201
202
|
var legendPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
|
|
202
203
|
var legendOrient = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'horizontal';
|
|
203
|
-
var
|
|
204
|
+
var showLabel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
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;
|
|
204
209
|
var series = [{
|
|
205
210
|
type: 'pie',
|
|
206
211
|
data: seriesData,
|
|
207
212
|
label: {
|
|
208
|
-
show:
|
|
213
|
+
show: showLabel,
|
|
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
|
+
}
|
|
209
227
|
}
|
|
210
228
|
}];
|
|
211
229
|
var tooltip = JSON.parse(JSON.stringify(tooltipConfig)),
|
|
@@ -220,6 +238,7 @@ export var getPieOption = function getPieOption() {
|
|
|
220
238
|
legend.width = 50;
|
|
221
239
|
grid.left = '10%';
|
|
222
240
|
}
|
|
241
|
+
legend.formatter = legendFormatter ? legendFormatter : legendFormatterDefault;
|
|
223
242
|
tooltip.trigger = 'item';
|
|
224
243
|
if (tooltipFormatter) {
|
|
225
244
|
tooltip.formatter = tooltipFormatter;
|
|
@@ -228,7 +247,7 @@ export var getPieOption = function getPieOption() {
|
|
|
228
247
|
var name = params.name,
|
|
229
248
|
value = params.value,
|
|
230
249
|
color = params.color;
|
|
231
|
-
return "<div class=\"biz-chart-tooltip-item\">\n <
|
|
250
|
+
return "<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"biz-tooltip-marker\" style=\"background:".concat(color, "\"></span>\n <div class=\"biz-tooltip-name\">").concat(name, "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(value, "</span>\n </div>");
|
|
232
251
|
};
|
|
233
252
|
}
|
|
234
253
|
return _objectSpread(_objectSpread({}, baseConfig), {}, {
|
|
@@ -2,6 +2,9 @@ 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
|
+
};
|
|
5
8
|
}[];
|
|
6
9
|
export declare const formatChartData: (data: ChartTypes.Value, showAll?: boolean, showList?: Array<any>, reverseXAxis?: boolean, color?: string[]) => {
|
|
7
10
|
x_axis: string[];
|
|
@@ -22,6 +22,9 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params) {
|
|
|
22
22
|
lineLabel = util.toThousands(lineLabel);
|
|
23
23
|
}
|
|
24
24
|
var name = item.seriesName.trim();
|
|
25
|
+
if (item.seriesType === 'bar' && params.length === 1 && !name) {
|
|
26
|
+
name = (item.data && item.data.label ? item.data.label : item.name).trim();
|
|
27
|
+
}
|
|
25
28
|
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"biz-tooltip-marker\" style=\"background:".concat(item.color, "\"></span>\n <div class=\"biz-tooltip-name\">").concat(name, "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(lineLabel, "</span>\n </div>"));
|
|
26
29
|
});
|
|
27
30
|
return htmlArray.join('');
|
package/es/demoWrapper/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import request from '../utils/ajax';
|
|
|
11
11
|
import DemoContent from './content';
|
|
12
12
|
import DemoHeader from './head';
|
|
13
13
|
import './index.less';
|
|
14
|
+
import { ResponseStatus } from '../utils/type';
|
|
14
15
|
var DemoWrapper = function DemoWrapper(_ref) {
|
|
15
16
|
var children = _ref.children,
|
|
16
17
|
className = _ref.className,
|
|
@@ -38,8 +39,7 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
38
39
|
}, []);
|
|
39
40
|
function getCurrentUser() {
|
|
40
41
|
request('/zg/web/v2/user/getUserInfo').then(function (res) {
|
|
41
|
-
|
|
42
|
-
if (res === null || (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.ret) === '-1') setNotLogin(true);
|
|
42
|
+
if (!res || new RegExp("".concat(ResponseStatus.notLogin)).test(res.code)) setNotLogin(true);
|
|
43
43
|
}).catch(function (err) {
|
|
44
44
|
console.error('获取用户信息失败', err);
|
|
45
45
|
}).finally(function () {
|
|
@@ -25,12 +25,7 @@ var EventDemo = function EventDemo() {
|
|
|
25
25
|
var onChange = function onChange(data) {
|
|
26
26
|
setValue(data);
|
|
27
27
|
};
|
|
28
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
style: {
|
|
30
|
-
height: '500px',
|
|
31
|
-
overflow: 'auto'
|
|
32
|
-
}
|
|
33
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
34
29
|
style: {
|
|
35
30
|
height: '700px'
|
|
36
31
|
}
|
|
@@ -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' : ''].join(' ')
|
|
103
|
+
className: [classPrefix, border ? 'border' : '', visible ? 'focus' : ''].join(' ')
|
|
104
104
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
105
105
|
dropdownRender: function dropdownRender() {
|
|
106
106
|
return /*#__PURE__*/React.createElement(EventListPanel, {
|
|
@@ -1,12 +1,16 @@
|
|
|
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
|
+
}
|
|
4
9
|
&.border {
|
|
5
10
|
.biz-event-select-handle {
|
|
6
11
|
.__select-handle();
|
|
7
12
|
}
|
|
8
13
|
}
|
|
9
|
-
position: relative;
|
|
10
14
|
&-list-panel {
|
|
11
15
|
display: flex;
|
|
12
16
|
flex-direction: row;
|
package/es/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ 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';
|
|
11
12
|
import BizSelect from './select';
|
|
12
13
|
import BizDialog from './dialog';
|
|
13
14
|
import BizChart from './chart';
|
|
@@ -34,7 +35,7 @@ import BizAttrCondition from './attrCondition';
|
|
|
34
35
|
import BizAttrConditionGroup from './attrCondition/group';
|
|
35
36
|
import BizTargetFromPanel from './layout/optionTitle';
|
|
36
37
|
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, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
|
|
38
|
+
export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizQuickDatePicker, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
|
|
38
39
|
export type { UserGroupTypes } from './userGroup/types';
|
|
39
40
|
export type { BizSelectTypes } from './select/types';
|
|
40
41
|
export type { AttributeSelect } from './attributeSelector/types';
|
package/es/index.js
CHANGED
|
@@ -7,6 +7,7 @@ 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';
|
|
10
11
|
import BizSelect from './select';
|
|
11
12
|
import BizDialog from './dialog';
|
|
12
13
|
import BizChart from './chart';
|
|
@@ -33,4 +34,4 @@ import BizAttrCondition from './attrCondition';
|
|
|
33
34
|
import BizAttrConditionGroup from './attrCondition/group';
|
|
34
35
|
import BizTargetFromPanel from './layout/optionTitle';
|
|
35
36
|
import { BizTargetFromPanelContext } from './layout/optionTitle/types';
|
|
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 };
|
|
37
|
+
export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizQuickDatePicker, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
|
|
@@ -127,14 +127,17 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
127
127
|
});
|
|
128
128
|
};
|
|
129
129
|
if (!((_props$value10 = props.value) === null || _props$value10 === void 0 ? void 0 : _props$value10.panelId)) {
|
|
130
|
-
return /*#__PURE__*/React.createElement(
|
|
130
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: "".concat(classPrefix, "-content")
|
|
132
|
+
}, props.children);
|
|
131
133
|
}
|
|
132
134
|
return /*#__PURE__*/React.createElement(BizTargetFromPanelContext.Provider, {
|
|
133
135
|
value: {
|
|
134
136
|
handleSearch: setBtnOptions
|
|
135
137
|
}
|
|
136
138
|
}, /*#__PURE__*/React.createElement(Spin, {
|
|
137
|
-
spinning: loading
|
|
139
|
+
spinning: loading,
|
|
140
|
+
wrapperClassName: classPrefix
|
|
138
141
|
}, /*#__PURE__*/React.createElement(BizOptionLayout, {
|
|
139
142
|
ref: titleRef,
|
|
140
143
|
value: title,
|
|
@@ -145,7 +148,9 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
145
148
|
onBack: function onBack() {
|
|
146
149
|
return onClick(BizOptionTitleProps.OptionTypes.CANCEL);
|
|
147
150
|
}
|
|
148
|
-
},
|
|
151
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
className: "".concat(classPrefix, "-content ").concat(classPrefix, "-content2")
|
|
153
|
+
}, props.children), showDialog && /*#__PURE__*/React.createElement(BizAddToPanel, {
|
|
149
154
|
defaultValue: {
|
|
150
155
|
panel: {
|
|
151
156
|
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,6 +1,11 @@
|
|
|
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
|
+
}
|
|
4
9
|
/*更多按钮*/
|
|
5
10
|
&-btn-more {
|
|
6
11
|
width: @height-base;
|
|
@@ -16,4 +21,13 @@
|
|
|
16
21
|
.__default-hover();
|
|
17
22
|
}
|
|
18
23
|
}
|
|
24
|
+
|
|
25
|
+
&-content {
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
overflow: auto;
|
|
29
|
+
}
|
|
30
|
+
&-content2 {
|
|
31
|
+
height: calc(100% - 64px);
|
|
32
|
+
}
|
|
19
33
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
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;
|
|
@@ -0,0 +1,153 @@
|
|
|
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;
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
.ant-picker-focused {
|
|
11
|
+
box-shadow: none !important;
|
|
12
|
+
}
|
|
13
|
+
> :nth-child(1) {
|
|
14
|
+
float: left;
|
|
15
|
+
height: 24px;
|
|
16
|
+
margin-right: 8px;
|
|
17
|
+
padding: 2px 8px;
|
|
18
|
+
color: #165dff;
|
|
19
|
+
vertical-align: middle;
|
|
20
|
+
background: #e8efff;
|
|
21
|
+
}
|
|
22
|
+
.ant-picker {
|
|
23
|
+
padding: 0;
|
|
24
|
+
vertical-align: middle;
|
|
25
|
+
border: none;
|
|
26
|
+
border-radius: 0 !important;
|
|
27
|
+
.ant-picker-clear {
|
|
28
|
+
right: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.ant-picker:hover {
|
|
32
|
+
.ant-picker-input > input,
|
|
33
|
+
.ant-picker-range-separator {
|
|
34
|
+
color: #021429 !important;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
&-content {
|
|
38
|
+
float: left;
|
|
39
|
+
.ant-picker-panel-container {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: row-reverse;
|
|
42
|
+
.ant-picker-footer {
|
|
43
|
+
width: auto;
|
|
44
|
+
min-width: auto;
|
|
45
|
+
border-bottom: 1px solid #e8efff;
|
|
46
|
+
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
&-options {
|
|
50
|
+
width: 170px;
|
|
51
|
+
padding-bottom: 25px;
|
|
52
|
+
color: #67727f;
|
|
53
|
+
ol,
|
|
54
|
+
li {
|
|
55
|
+
margin: 0;
|
|
56
|
+
padding: 0;
|
|
57
|
+
list-style: none;
|
|
58
|
+
list-style-type: none;
|
|
59
|
+
}
|
|
60
|
+
> :nth-child(1),
|
|
61
|
+
> :nth-child(2) {
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-wrap: wrap;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
margin-top: 8px;
|
|
66
|
+
padding-bottom: 4px;
|
|
67
|
+
border-bottom: 1px solid #ecedf0;
|
|
68
|
+
li {
|
|
69
|
+
width: 81px;
|
|
70
|
+
height: 24px;
|
|
71
|
+
margin-bottom: 8px;
|
|
72
|
+
line-height: 24px;
|
|
73
|
+
text-align: center;
|
|
74
|
+
background: #fafafb;
|
|
75
|
+
border-radius: 24px;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
> :nth-child(2) {
|
|
80
|
+
margin-top: 14px;
|
|
81
|
+
li {
|
|
82
|
+
border-radius: 0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
> :nth-child(3) {
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: space-between;
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 32px;
|
|
90
|
+
margin-top: 12px;
|
|
91
|
+
padding: 0 12px;
|
|
92
|
+
line-height: 32px;
|
|
93
|
+
background: #fafafb;
|
|
94
|
+
> :first-child {
|
|
95
|
+
transform: rotate(180deg);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
.active,
|
|
99
|
+
li.active {
|
|
100
|
+
color: #165dff;
|
|
101
|
+
background: #e8efff;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.biz-quick-date-picker-wrap:hover {
|
|
108
|
+
border: 1px solid #165dff;
|
|
109
|
+
}
|
|
110
|
+
.biz-quick-date-picker-wrap.focus {
|
|
111
|
+
box-shadow: 0 0 0 4px #f0f7ff;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.clearfix:after {
|
|
115
|
+
display: block;
|
|
116
|
+
clear: both;
|
|
117
|
+
height: 0;
|
|
118
|
+
content: '';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.clearfix {
|
|
122
|
+
/* 触发 hasLayout */
|
|
123
|
+
zoom: 1;
|
|
124
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
}];
|
package/es/userGroup/index.js
CHANGED
|
@@ -40,8 +40,15 @@ 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
|
+
};
|
|
43
50
|
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className: classPrefix
|
|
51
|
+
className: "".concat(classPrefix, " ").concat(focus ? 'focus' : '')
|
|
45
52
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
46
53
|
loading: loading,
|
|
47
54
|
active: true,
|
|
@@ -57,7 +64,8 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
57
64
|
border: false,
|
|
58
65
|
disableItemList: props.disableItemList,
|
|
59
66
|
onChange: onChange,
|
|
60
|
-
minDropdownWidth: 284
|
|
67
|
+
minDropdownWidth: 284,
|
|
68
|
+
onVisibleChange: onVisibleChange
|
|
61
69
|
}), /*#__PURE__*/React.createElement(BizTargetOptionIcon, {
|
|
62
70
|
name: "delete",
|
|
63
71
|
icon: "qingchu",
|
package/es/utils/ajax.js
CHANGED
|
@@ -78,8 +78,10 @@ export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
78
78
|
flag = true;
|
|
79
79
|
} else if (new RegExp("".concat(ResponseStatus.notLogin)).test(apiResult.code)) {
|
|
80
80
|
msg = '账户未登录或登录已失效';
|
|
81
|
+
flag = true;
|
|
81
82
|
} else if (new RegExp("".concat(ResponseStatus.noPermission)).test(apiResult.code)) {
|
|
82
83
|
msg = '账户没有权限';
|
|
84
|
+
flag = true;
|
|
83
85
|
}
|
|
84
86
|
if (!flag) {
|
|
85
87
|
msg = apiResult.msg || msg;
|
|
@@ -88,6 +90,7 @@ export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
88
90
|
description: msg
|
|
89
91
|
});
|
|
90
92
|
message.error(msg);
|
|
93
|
+
throw new Error(msg);
|
|
91
94
|
}
|
|
92
95
|
return apiResult;
|
|
93
96
|
}
|
|
@@ -137,28 +140,40 @@ function _request() {
|
|
|
137
140
|
return req(params.url, params.options);
|
|
138
141
|
case 14:
|
|
139
142
|
res = _context.sent;
|
|
143
|
+
if (res) {
|
|
144
|
+
_context.next = 17;
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
throw new Error('Request Interruption');
|
|
148
|
+
case 17:
|
|
140
149
|
if (!(((_params$options2 = params.options) === null || _params$options2 === void 0 ? void 0 : _params$options2.responseType) === 'blob')) {
|
|
141
|
-
_context.next =
|
|
150
|
+
_context.next = 23;
|
|
142
151
|
break;
|
|
143
152
|
}
|
|
144
153
|
if (!util.isBlob(res.data)) {
|
|
145
|
-
_context.next =
|
|
154
|
+
_context.next = 22;
|
|
146
155
|
break;
|
|
147
156
|
}
|
|
148
157
|
return _context.abrupt("return", downloadFile(res, params.options.fileName));
|
|
149
|
-
case
|
|
158
|
+
case 22:
|
|
150
159
|
res = res.data;
|
|
151
|
-
case
|
|
160
|
+
case 23:
|
|
152
161
|
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));
|
|
153
|
-
case
|
|
154
|
-
_context.prev =
|
|
162
|
+
case 26:
|
|
163
|
+
_context.prev = 26;
|
|
155
164
|
_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:
|
|
156
171
|
return _context.abrupt("return", null);
|
|
157
|
-
case
|
|
172
|
+
case 31:
|
|
158
173
|
case "end":
|
|
159
174
|
return _context.stop();
|
|
160
175
|
}
|
|
161
|
-
}, _callee, null, [[0,
|
|
176
|
+
}, _callee, null, [[0, 26]]);
|
|
162
177
|
}));
|
|
163
178
|
return _request.apply(this, arguments);
|
|
164
179
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.55-beta.
|
|
3
|
+
"version": "1.1.55-beta.10",
|
|
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": "bddf2a9466460102f38498748c4eff5bcdb9dad9"
|
|
64
64
|
}
|