@zgfe/business-lib 1.1.84-panel0.2 → 1.1.84
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 +5 -2
- package/es/addToPanel/index.js +2 -2
- package/es/attrCondition/group.js +7 -6
- package/es/attrCondition/styles/index.less +13 -3
- package/es/attrCondition/useAttrCondition.js +1 -1
- package/es/attributeSelector/index.js +2 -1
- package/es/attributeSelector/listPanel.js +2 -2
- package/es/attributeSelector/util.js +2 -2
- package/es/chart/demo/data/data.js +9 -0
- package/es/chart/demo/pie.js +1 -3
- package/es/chart/styles/index.less +1 -0
- package/es/chart/util/chartOptionConfig.d.ts +2 -8
- package/es/chart/util/chartOptionConfig.js +25 -4
- package/es/chart/util/formatOption.js +1 -1
- package/es/eventSelector/index.js +1 -0
- package/es/formulaTarget/components/formulaItem/index.js +2 -1
- package/es/hooks/useBizStore.js +1 -1
- package/es/layout/optionTitle/index.js +1 -0
- package/es/layout/optionTitle/types.d.ts +1 -0
- package/es/loading/demo/index.js +7 -1
- package/es/loading/index.js +5 -2
- package/es/loading/styles/index.less +4 -1
- package/es/loading/types.d.ts +1 -0
- package/es/select/handle.js +6 -1
- package/es/select/index.js +1 -0
- package/es/select/styles/handle.less +11 -3
- package/es/select/types.d.ts +1 -0
- package/es/table/demo/index.js +1 -0
- package/es/targetConditionGroup/components/targetDimension.js +11 -1
- package/es/userGroup/styles/index.less +7 -2
- package/es/userGroupHeader/demo/index.js +1 -1
- package/es/userGroupHeader/index.js +12 -45
- package/es/userGroupHeader/styles/index.less +11 -14
- package/es/userTagsSelector/index.js +1 -0
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import React, { useState } from 'react';
|
|
8
8
|
import { BizAddToPanel } from '@zgfe/business-lib';
|
|
9
9
|
import { Button } from 'antd';
|
|
10
|
+
import { DemoWrapper } from '@zgfe/business-lib';
|
|
10
11
|
var chartTypes = [{
|
|
11
12
|
label: '趋势图',
|
|
12
13
|
value: 'line',
|
|
@@ -78,7 +79,9 @@ export default (function () {
|
|
|
78
79
|
_useState2 = _slicedToArray(_useState, 2),
|
|
79
80
|
showDialog = _useState2[0],
|
|
80
81
|
setShowDialog = _useState2[1];
|
|
81
|
-
return /*#__PURE__*/React.createElement(
|
|
82
|
+
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
83
|
+
needMeta: true
|
|
84
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
82
85
|
onClick: function onClick() {
|
|
83
86
|
setShowDialog(true);
|
|
84
87
|
}
|
|
@@ -92,5 +95,5 @@ export default (function () {
|
|
|
92
95
|
onOk: function onOk() {
|
|
93
96
|
setShowDialog(false);
|
|
94
97
|
}
|
|
95
|
-
}));
|
|
98
|
+
})));
|
|
96
99
|
});
|
package/es/addToPanel/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
44
44
|
router = _useContext.router,
|
|
45
45
|
routes = _useContext.routes,
|
|
46
46
|
isDemo = _useContext.isDemo;
|
|
47
|
-
var showTypes = ['line', 'bar', 'pie'];
|
|
47
|
+
var showTypes = ['line', 'bar', 'pie', 'funnelBar', 'funnelLine'];
|
|
48
48
|
useEffect(function () {
|
|
49
49
|
queryGroups();
|
|
50
50
|
}, []);
|
|
@@ -128,8 +128,8 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
128
128
|
data: data
|
|
129
129
|
}).then(function (res) {
|
|
130
130
|
var _result$panel2;
|
|
131
|
-
if (!res) return;
|
|
132
131
|
setLoading(false);
|
|
132
|
+
if (!res) return;
|
|
133
133
|
var result = res.data;
|
|
134
134
|
notification.success({
|
|
135
135
|
message: /*#__PURE__*/React.createElement(React.Fragment, null, msgType, "\u81F3", /*#__PURE__*/React.createElement("a", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import useConditionGroup from './useConditionGroup';
|
|
3
|
-
import { Skeleton
|
|
3
|
+
import { Skeleton } from 'antd';
|
|
4
4
|
import BizAttrCondition from '.';
|
|
5
5
|
var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
6
6
|
var showHandle = props.showHandle,
|
|
@@ -38,11 +38,12 @@ var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
38
38
|
className: "".concat(classPrefix, "-operate-text ").concat(relation === 'and' || props.onlyAnd ? 'active' : '', " ").concat(props.onlyAnd ? 'only-and' : '')
|
|
39
39
|
}, /*#__PURE__*/React.createElement("span", null, "\u4E14")), !props.onlyAnd && /*#__PURE__*/React.createElement("div", {
|
|
40
40
|
className: "".concat(classPrefix, "-operate-text ").concat(relation === 'or' ? 'active' : '')
|
|
41
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u6216")))) : null, /*#__PURE__*/React.createElement(
|
|
42
|
-
className: "".concat(classPrefix, "-container")
|
|
43
|
-
direction: "vertical"
|
|
41
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u6216")))) : null, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: "".concat(classPrefix, "-container")
|
|
44
43
|
}, conditions.map(function (item, index) {
|
|
45
|
-
return /*#__PURE__*/React.createElement(
|
|
44
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: "".concat(classPrefix, "-container-item")
|
|
46
|
+
}, /*#__PURE__*/React.createElement(BizAttrCondition, {
|
|
46
47
|
key: item.key,
|
|
47
48
|
value: item.data,
|
|
48
49
|
eventIdList: eventIdList,
|
|
@@ -57,7 +58,7 @@ var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
57
58
|
onDelete: function onDelete() {
|
|
58
59
|
return _onDelete(index);
|
|
59
60
|
}
|
|
60
|
-
});
|
|
61
|
+
}));
|
|
61
62
|
}))));
|
|
62
63
|
});
|
|
63
64
|
BizAttrConditionGroup.defaultProps = {
|
|
@@ -28,15 +28,25 @@
|
|
|
28
28
|
max-width: calc(100% - 380px);
|
|
29
29
|
}
|
|
30
30
|
&-container {
|
|
31
|
+
display: flex;
|
|
31
32
|
flex: 1;
|
|
32
|
-
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: 4px;
|
|
33
35
|
width: 100%;
|
|
36
|
+
max-width: calc(100% + 33px);
|
|
37
|
+
margin-left: -33px;
|
|
38
|
+
&-item {
|
|
39
|
+
padding: 4px 0 4px 48px;
|
|
40
|
+
&:hover {
|
|
41
|
+
background: #e8efff;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
34
44
|
}
|
|
35
45
|
&-handle {
|
|
36
46
|
position: relative;
|
|
37
47
|
width: 1px;
|
|
38
|
-
margin-right:
|
|
39
|
-
margin-left:
|
|
48
|
+
margin-right: 0;
|
|
49
|
+
margin-left: 32px;
|
|
40
50
|
background: @border-color-base;
|
|
41
51
|
}
|
|
42
52
|
&-operate {
|
|
@@ -49,7 +49,7 @@ var useAttrCondition = function useAttrCondition(props) {
|
|
|
49
49
|
propCategory: data.propCategory,
|
|
50
50
|
type: data.type,
|
|
51
51
|
category: data.category,
|
|
52
|
-
key: "".concat(data.propCategory, "-").concat(data.
|
|
52
|
+
key: "".concat(data.propCategory, "-").concat(data.attrName),
|
|
53
53
|
subtype: data.subtype,
|
|
54
54
|
label: data.label,
|
|
55
55
|
dimensionSub: data.dimensionSub || data.attrName
|
|
@@ -128,7 +128,8 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
128
128
|
size: props.size,
|
|
129
129
|
label: (currentAttr === null || currentAttr === void 0 ? void 0 : currentAttr.alias) || (currentAttr === null || currentAttr === void 0 ? void 0 : currentAttr.label),
|
|
130
130
|
placeholder: placeholder,
|
|
131
|
-
status: props.status
|
|
131
|
+
status: props.status,
|
|
132
|
+
open: visible
|
|
132
133
|
}))), enableDelete ? /*#__PURE__*/React.createElement(BizTargetOptionIcon, {
|
|
133
134
|
name: "delete",
|
|
134
135
|
icon: "qingchu",
|
|
@@ -52,11 +52,11 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
52
52
|
}, [eventGroupList]);
|
|
53
53
|
var disableItemlist = (_props$disableItemLis = props.disableItemList) === null || _props$disableItemLis === void 0 ? void 0 : _props$disableItemLis.map(function (item) {
|
|
54
54
|
if (item.propCategory === 'envProp') {
|
|
55
|
-
item.key = "envProp-".concat(item.
|
|
55
|
+
item.key = "envProp-".concat(item.name);
|
|
56
56
|
} else if (item.propCategory === 'eventProp') {
|
|
57
57
|
item.key = "eventProp-".concat(item.id);
|
|
58
58
|
} else if (item.propCategory === 'userProp') {
|
|
59
|
-
item.key = "userProp-".concat(item.
|
|
59
|
+
item.key = "userProp-".concat(item.name);
|
|
60
60
|
}
|
|
61
61
|
return item;
|
|
62
62
|
});
|
|
@@ -59,7 +59,7 @@ export default function convertAttributeData(store) {
|
|
|
59
59
|
isHidden: prop.hidden,
|
|
60
60
|
alias: prop.alias_name,
|
|
61
61
|
category: prop.category,
|
|
62
|
-
key: "envProp-".concat(prop.
|
|
62
|
+
key: "envProp-".concat(prop.name),
|
|
63
63
|
label: prop.text,
|
|
64
64
|
name: prop.name,
|
|
65
65
|
propCategory: 'envProp',
|
|
@@ -74,7 +74,7 @@ export default function convertAttributeData(store) {
|
|
|
74
74
|
isHidden: prop.hidden,
|
|
75
75
|
alias: prop.alias_name,
|
|
76
76
|
category: prop.category,
|
|
77
|
-
key: "userProp-".concat(prop.
|
|
77
|
+
key: "userProp-".concat(prop.name),
|
|
78
78
|
label: prop.text || prop.name,
|
|
79
79
|
name: prop.name,
|
|
80
80
|
propCategory: 'userProp',
|
|
@@ -12,6 +12,15 @@ export default {
|
|
|
12
12
|
}, {
|
|
13
13
|
names: ['pv'],
|
|
14
14
|
values: [104, 89, 109, 103, 112, 93, 87, 101, 101, 97, 102, 110, 106, 98]
|
|
15
|
+
}, {
|
|
16
|
+
names: ['申请退货2'],
|
|
17
|
+
values: [5, 11, 14, 9, 8, 14, 9, 10, 12, 12, 14, 16, 12, 10]
|
|
18
|
+
}, {
|
|
19
|
+
names: ['搜索商品2'],
|
|
20
|
+
values: [75, 68, 86, 80, 87, 71, 72, 81, 77, 74, 78, 76, 76, 79]
|
|
21
|
+
}, {
|
|
22
|
+
names: ['付款成功11付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功'],
|
|
23
|
+
values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
|
|
15
24
|
}, {
|
|
16
25
|
names: ['查看商品详情'],
|
|
17
26
|
values: [122, 107, 132, 113, 133, 115, 106, 127, 132, 117, 119, 123, 119, 117]
|
package/es/chart/demo/pie.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { GridComponentOption, TitleComponentOption, TooltipComponentOption } from 'echarts/types/dist/echarts';
|
|
2
|
-
import { BarSeriesOption, LegendComponentOption, LineSeriesOption, PieSeriesOption, ToolboxComponentOption, XAXisOption, YAXisOption } from 'echarts/types/dist/shared';
|
|
2
|
+
import { BarSeriesOption, GridOption, LegendComponentOption, LineSeriesOption, PieSeriesOption, ToolboxComponentOption, XAXisOption, YAXisOption } from 'echarts/types/dist/shared';
|
|
3
3
|
import '../styles/index.less';
|
|
4
4
|
import { ChartTypes } from '../types';
|
|
5
5
|
export type EChartsOption = echarts.ComposeOption<TitleComponentOption | ToolboxComponentOption | TooltipComponentOption | GridComponentOption | LegendComponentOption | LineSeriesOption | BarSeriesOption | PieSeriesOption>;
|
|
6
6
|
export declare const baseConfig: EChartsOption;
|
|
7
7
|
export declare const seriesConfig: any;
|
|
8
8
|
export declare const legendConfig: LegendComponentOption;
|
|
9
|
-
export declare const gridConfig:
|
|
10
|
-
left: string;
|
|
11
|
-
right: string;
|
|
12
|
-
bottom: number;
|
|
13
|
-
top: number;
|
|
14
|
-
containLabel: boolean;
|
|
15
|
-
};
|
|
9
|
+
export declare const gridConfig: GridOption;
|
|
16
10
|
export declare const xAxisConfig: XAXisOption;
|
|
17
11
|
export declare const yAxisConfig: YAXisOption;
|
|
18
12
|
export declare const tooltipConfig: TooltipComponentOption;
|
|
@@ -201,10 +201,10 @@ export var getChartOption = function getChartOption(chartType, data) {
|
|
|
201
201
|
};
|
|
202
202
|
export var getPieOption = function getPieOption() {
|
|
203
203
|
var seriesData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
204
|
-
var legendPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '
|
|
204
|
+
var legendPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'bottom';
|
|
205
205
|
var legendOrient = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'horizontal';
|
|
206
206
|
var showLabel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
207
|
-
var radius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [
|
|
207
|
+
var radius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['50%', '65%'];
|
|
208
208
|
var center = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ['50%', '50%'];
|
|
209
209
|
var tooltipFormatter = arguments.length > 6 ? arguments[6] : undefined;
|
|
210
210
|
var legendFormatter = arguments.length > 7 ? arguments[7] : undefined;
|
|
@@ -213,9 +213,25 @@ export var getPieOption = function getPieOption() {
|
|
|
213
213
|
data: seriesData,
|
|
214
214
|
label: {
|
|
215
215
|
show: showLabel,
|
|
216
|
-
color: '
|
|
216
|
+
color: '#021429',
|
|
217
|
+
fontSize: 10,
|
|
218
|
+
fontWight: 500,
|
|
217
219
|
formatter: function formatter(params) {
|
|
218
|
-
|
|
220
|
+
console.log('params:', params);
|
|
221
|
+
return "{a|".concat("} ", util.strMiddleSplit(params.name), " {b|").concat(params.value, "}");
|
|
222
|
+
},
|
|
223
|
+
rich: {
|
|
224
|
+
a: {
|
|
225
|
+
backgroundColor: 'inherit',
|
|
226
|
+
width: 6,
|
|
227
|
+
height: 6,
|
|
228
|
+
borderRadius: 6
|
|
229
|
+
},
|
|
230
|
+
b: {
|
|
231
|
+
color: '#67727F',
|
|
232
|
+
fontSize: 10,
|
|
233
|
+
fontWight: 400
|
|
234
|
+
}
|
|
219
235
|
}
|
|
220
236
|
},
|
|
221
237
|
radius: radius,
|
|
@@ -239,6 +255,11 @@ export var getPieOption = function getPieOption() {
|
|
|
239
255
|
legend.height = 'auto';
|
|
240
256
|
legend.width = 50;
|
|
241
257
|
grid.left = '10%';
|
|
258
|
+
} else {
|
|
259
|
+
if (legendPosition === 'bottom') {
|
|
260
|
+
grid.top = 'bottom';
|
|
261
|
+
grid.bottom = '20%';
|
|
262
|
+
}
|
|
242
263
|
}
|
|
243
264
|
legend.formatter = legendFormatter ? legendFormatter : legendFormatterDefault;
|
|
244
265
|
tooltip.trigger = 'item';
|
|
@@ -26,7 +26,7 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params, resultFor
|
|
|
26
26
|
} else if (resultFormatMap && resultFormatMap[item.seriesName] && /percent/.test(resultFormatMap[item.seriesName])) {
|
|
27
27
|
lineLabel = util.toThousands(lineLabel) + '%';
|
|
28
28
|
} else {
|
|
29
|
-
lineLabel = util.toThousands(lineLabel) + unit;
|
|
29
|
+
lineLabel = util.toThousands(lineLabel) + (unit || '');
|
|
30
30
|
}
|
|
31
31
|
var name = item.seriesName.trim();
|
|
32
32
|
if (item.seriesType === 'bar' && params.length === 1 && !name) {
|
|
@@ -176,7 +176,8 @@ var FormulaItem = function FormulaItem(props) {
|
|
|
176
176
|
className: "".concat(classPrefix, "-target-handle").concat(open ? ' focus' : ''),
|
|
177
177
|
onClick: onClickHandle
|
|
178
178
|
}, /*#__PURE__*/React.createElement(SelectHandle, {
|
|
179
|
-
label: label
|
|
179
|
+
label: label,
|
|
180
|
+
open: open
|
|
180
181
|
}, /*#__PURE__*/React.createElement("span", null, label), haveFilter ? /*#__PURE__*/React.createElement(IconFont, {
|
|
181
182
|
className: "".concat(classPrefix, "-target-handle-icon"),
|
|
182
183
|
type: "a-shaixuan2"
|
package/es/hooks/useBizStore.js
CHANGED
|
@@ -84,7 +84,7 @@ function useBizStore(_ref) {
|
|
|
84
84
|
if (menuNameMap === null || menuNameMap === void 0 ? void 0 : menuNameMap.userTags) queryTags();
|
|
85
85
|
}, 300);
|
|
86
86
|
});
|
|
87
|
-
}, [currentApp]);
|
|
87
|
+
}, [currentApp === null || currentApp === void 0 ? void 0 : currentApp.id, currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform]);
|
|
88
88
|
return {
|
|
89
89
|
groupLoading: groupLoading,
|
|
90
90
|
userGroupList: userGroupList,
|
|
@@ -163,6 +163,7 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
163
163
|
params: props.value.target.params,
|
|
164
164
|
elementId: props.value.target.id,
|
|
165
165
|
showList: props.value.target.showList,
|
|
166
|
+
showOptions: props.showOptions,
|
|
166
167
|
onCancel: onCancel,
|
|
167
168
|
onOk: onPanelSave
|
|
168
169
|
}))));
|
package/es/loading/demo/index.js
CHANGED
|
@@ -2,5 +2,11 @@ import { BizLoading } from '@zgfe/business-lib';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
4
4
|
export default (function () {
|
|
5
|
-
return /*#__PURE__*/React.createElement(
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6
|
+
style: {
|
|
7
|
+
height: 500
|
|
8
|
+
}
|
|
9
|
+
}, /*#__PURE__*/React.createElement(BizLoading, {
|
|
10
|
+
spinning: true
|
|
11
|
+
}, /*#__PURE__*/React.createElement("div", null, "\u5185\u5BB9\u533A\u57DF")));
|
|
6
12
|
});
|
package/es/loading/index.js
CHANGED
|
@@ -3,9 +3,12 @@ import './styles/index.less';
|
|
|
3
3
|
import { Spin } from 'antd';
|
|
4
4
|
export var classPrefix = 'biz-loading';
|
|
5
5
|
var BizLoading = function BizLoading(props) {
|
|
6
|
+
var loading = props.spinning === undefined ? true : props.spinning;
|
|
6
7
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
7
|
-
className: "".concat(classPrefix, "-container ").concat(props.className ? props.className : ''),
|
|
8
|
-
|
|
8
|
+
className: "".concat(classPrefix, "-container ").concat(loading ? 'loading' : '', " ").concat(props.className ? props.className : ''),
|
|
9
|
+
wrapperClassName: "".concat(classPrefix, "-wrapper ").concat(loading ? 'loading' : ''),
|
|
10
|
+
spinning: loading,
|
|
11
|
+
tip: "".concat(props.loadingText === undefined ? '数据正在努力加载中,请稍等~' : props.loadingText),
|
|
9
12
|
size: "large"
|
|
10
13
|
}, props.children);
|
|
11
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '../../assets/styles/inner.less';
|
|
2
2
|
|
|
3
3
|
.biz-loading {
|
|
4
|
-
&-container {
|
|
4
|
+
&-container.loading {
|
|
5
5
|
display: flex !important;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
@@ -14,4 +14,7 @@
|
|
|
14
14
|
font-size: 14px;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
&-wrapper.loading {
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
17
20
|
}
|
package/es/loading/types.d.ts
CHANGED
package/es/select/handle.js
CHANGED
|
@@ -101,6 +101,8 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
101
101
|
return /*#__PURE__*/React.createElement("div", {
|
|
102
102
|
ref: handleRef,
|
|
103
103
|
className: "".concat(classPrefix, "-input ").concat(classPrefix, "-input-multiple\n ").concat(props.theme ? props.theme : '', " ").concat(props.disable ? 'disable' : '', " \n ").concat(mergedStatus ? "".concat(classPrefix, "-status-").concat(mergedStatus) : '', "\n ").concat(focus ? 'active' : '', " ").concat(border ? '' : 'borderless', " ").concat(props.size ? props.size : '')
|
|
104
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: "".concat(classPrefix, "-multiple-content")
|
|
104
106
|
}, props.value && props.value.length > 0 ? props.value.map(function (item, index) {
|
|
105
107
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
106
108
|
title: item[labelField],
|
|
@@ -130,6 +132,9 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
130
132
|
value: searchValue,
|
|
131
133
|
onChange: onSearch,
|
|
132
134
|
onKeyDown: onKeyDown
|
|
135
|
+
})), /*#__PURE__*/React.createElement(IconFont, {
|
|
136
|
+
className: "".concat(classPrefix, "-expand-icon").concat(props.open ? ' open' : ''),
|
|
137
|
+
type: 'xiangxia'
|
|
133
138
|
}), /*#__PURE__*/React.createElement("span", {
|
|
134
139
|
className: "".concat(classPrefix, "-temp"),
|
|
135
140
|
ref: textRef
|
|
@@ -148,7 +153,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
148
153
|
}, props.value.icon), props.children || props.label || props.value && props.value[labelField] || /*#__PURE__*/React.createElement("span", {
|
|
149
154
|
className: "".concat(classPrefix, "-holder")
|
|
150
155
|
}, placeholder || '请选择'))), /*#__PURE__*/React.createElement(IconFont, {
|
|
151
|
-
className: "".concat(classPrefix, "-expand-icon"),
|
|
156
|
+
className: "".concat(classPrefix, "-expand-icon").concat(props.open ? ' open' : ''),
|
|
152
157
|
type: 'xiangxia'
|
|
153
158
|
}));
|
|
154
159
|
});
|
package/es/select/index.js
CHANGED
|
@@ -41,11 +41,9 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
&-input-multiple {
|
|
44
|
-
|
|
45
|
-
flex-wrap: wrap;
|
|
44
|
+
display: flex;
|
|
46
45
|
align-items: center;
|
|
47
46
|
height: auto;
|
|
48
|
-
overflow: visible;
|
|
49
47
|
line-height: 1;
|
|
50
48
|
&.small {
|
|
51
49
|
height: auto;
|
|
@@ -93,6 +91,13 @@
|
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
93
|
}
|
|
94
|
+
&-multiple-content {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex: 1;
|
|
97
|
+
flex-wrap: wrap;
|
|
98
|
+
align-items: center;
|
|
99
|
+
overflow: visible;
|
|
100
|
+
}
|
|
96
101
|
|
|
97
102
|
&-search.ant-input {
|
|
98
103
|
width: auto;
|
|
@@ -129,6 +134,9 @@
|
|
|
129
134
|
width: 14px;
|
|
130
135
|
margin-left: 5px;
|
|
131
136
|
color: @text-color-secondary;
|
|
137
|
+
&.open {
|
|
138
|
+
transform: rotate(180deg);
|
|
139
|
+
}
|
|
132
140
|
}
|
|
133
141
|
|
|
134
142
|
&-tooltip {
|
package/es/select/types.d.ts
CHANGED
package/es/table/demo/index.js
CHANGED
|
@@ -27,6 +27,10 @@ var BizTargetDimension = function BizTargetDimension(props) {
|
|
|
27
27
|
setOptions = _useState6[1];
|
|
28
28
|
var _useContext = useContext(BizGlobalDataContext),
|
|
29
29
|
eventGroupList = _useContext.eventGroupList;
|
|
30
|
+
var _useState7 = useState(false),
|
|
31
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
32
|
+
visible = _useState8[0],
|
|
33
|
+
setVisible = _useState8[1];
|
|
30
34
|
useEffect(function () {
|
|
31
35
|
var _props$value;
|
|
32
36
|
var dimensionOption = normalOptionsData;
|
|
@@ -94,6 +98,9 @@ var BizTargetDimension = function BizTargetDimension(props) {
|
|
|
94
98
|
}
|
|
95
99
|
if (props.onChange) props.onChange(result);
|
|
96
100
|
};
|
|
101
|
+
var onVisibleChange = function onVisibleChange(show) {
|
|
102
|
+
setVisible(show);
|
|
103
|
+
};
|
|
97
104
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
98
105
|
overlayClassName: "".concat(classPrefix, "-dropmenu"),
|
|
99
106
|
placement: "bottom",
|
|
@@ -126,10 +133,13 @@ var BizTargetDimension = function BizTargetDimension(props) {
|
|
|
126
133
|
title: item.label
|
|
127
134
|
}, item.label);
|
|
128
135
|
}));
|
|
129
|
-
}
|
|
136
|
+
},
|
|
137
|
+
open: visible,
|
|
138
|
+
onOpenChange: onVisibleChange
|
|
130
139
|
}, /*#__PURE__*/React.createElement("div", {
|
|
131
140
|
className: "".concat(classPrefix, "-dimension")
|
|
132
141
|
}, /*#__PURE__*/React.createElement(SelectHandle, {
|
|
142
|
+
open: visible,
|
|
133
143
|
label: "".concat(dimensionParent ? dimensionParent.label : '').concat(dimension === null || dimension === void 0 ? void 0 : dimension.label)
|
|
134
144
|
})));
|
|
135
145
|
};
|
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
.biz-user-group {
|
|
4
4
|
position: relative;
|
|
5
5
|
width: 100%;
|
|
6
|
-
min-width:
|
|
6
|
+
min-width: 208px;
|
|
7
|
+
color: @text-color;
|
|
8
|
+
|
|
7
9
|
&-handle {
|
|
8
10
|
.__select-handle();
|
|
9
11
|
display: flex;
|
|
10
12
|
flex-direction: row;
|
|
13
|
+
align-items: center;
|
|
11
14
|
width: 100%;
|
|
12
15
|
min-height: @height-base;
|
|
13
16
|
padding: 4px 4px 4px 12px;
|
|
@@ -19,7 +22,7 @@
|
|
|
19
22
|
}
|
|
20
23
|
&-placeholder {
|
|
21
24
|
flex: 1;
|
|
22
|
-
color: @
|
|
25
|
+
color: @input-placeholder-color;
|
|
23
26
|
pointer-events: none;
|
|
24
27
|
}
|
|
25
28
|
&-val {
|
|
@@ -50,6 +53,8 @@
|
|
|
50
53
|
display: none;
|
|
51
54
|
flex: none;
|
|
52
55
|
width: 16px;
|
|
56
|
+
max-height: 24px;
|
|
57
|
+
margin-left: 6px;
|
|
53
58
|
text-align: center;
|
|
54
59
|
border-radius: @border-radius-small;
|
|
55
60
|
&:hover {
|
|
@@ -11,7 +11,7 @@ export default (function () {
|
|
|
11
11
|
}, /*#__PURE__*/React.createElement(BizUserGroupHeader, {
|
|
12
12
|
max: 3,
|
|
13
13
|
enableTags: true,
|
|
14
|
-
value: [['
|
|
14
|
+
value: [['4077:685001635528704'], 836, 837],
|
|
15
15
|
onChange: function onChange(value) {
|
|
16
16
|
console.log('>>>>>>>>回传值', value);
|
|
17
17
|
}
|
|
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import React, { useEffect } from 'react';
|
|
12
12
|
import './styles/index.less';
|
|
13
|
-
import { Space } from 'antd';
|
|
13
|
+
import { Space, Tooltip } from 'antd';
|
|
14
14
|
import BizUserGroup from '../userGroup';
|
|
15
15
|
import IconFont from '../icon/iconFont';
|
|
16
16
|
import _ from 'lodash';
|
|
@@ -22,16 +22,8 @@ var BizUserGroupHeader = function BizUserGroupHeader(_ref) {
|
|
|
22
22
|
var classPrefix = 'biz-user-group-header';
|
|
23
23
|
var _React$useState = React.useState([]),
|
|
24
24
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var _React$useState3 = React.useState([]),
|
|
28
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
29
|
-
tempValue = _React$useState4[0],
|
|
30
|
-
setTempValue = _React$useState4[1];
|
|
31
|
-
var _React$useState5 = React.useState(false),
|
|
32
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
33
|
-
showBtn = _React$useState6[0],
|
|
34
|
-
setShowBtn = _React$useState6[1];
|
|
25
|
+
tempValue = _React$useState2[0],
|
|
26
|
+
setTempValue = _React$useState2[1];
|
|
35
27
|
useEffect(function () {
|
|
36
28
|
var defaultValue = (value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
37
29
|
return {
|
|
@@ -41,22 +33,14 @@ var BizUserGroupHeader = function BizUserGroupHeader(_ref) {
|
|
|
41
33
|
})) || [{
|
|
42
34
|
id: Math.random().toString()
|
|
43
35
|
}];
|
|
44
|
-
setGroupList(defaultValue);
|
|
45
36
|
setTempValue(_.cloneDeep(defaultValue));
|
|
46
37
|
}, []);
|
|
47
38
|
useEffect(function () {
|
|
48
39
|
if (!onChange) return;
|
|
49
|
-
onChange(
|
|
40
|
+
onChange(tempValue.map(function (item) {
|
|
50
41
|
return item.value;
|
|
51
42
|
}));
|
|
52
|
-
}, [
|
|
53
|
-
useEffect(function () {
|
|
54
|
-
setShowBtn(!_.isEqual(groupList.map(function (item) {
|
|
55
|
-
return item.value;
|
|
56
|
-
}), tempValue.map(function (item) {
|
|
57
|
-
return item.value;
|
|
58
|
-
})));
|
|
59
|
-
}, [groupList, tempValue]);
|
|
43
|
+
}, [tempValue]);
|
|
60
44
|
function onAdd() {
|
|
61
45
|
if (max && tempValue.length >= max) return;
|
|
62
46
|
var list = _toConsumableArray(tempValue);
|
|
@@ -65,32 +49,13 @@ var BizUserGroupHeader = function BizUserGroupHeader(_ref) {
|
|
|
65
49
|
});
|
|
66
50
|
setTempValue(list);
|
|
67
51
|
}
|
|
68
|
-
function onSure() {
|
|
69
|
-
setGroupList(_.cloneDeep(tempValue));
|
|
70
|
-
}
|
|
71
|
-
function onCancel() {
|
|
72
|
-
setTempValue(_.cloneDeep(groupList).map(function (item) {
|
|
73
|
-
item.id = Math.random().toString();
|
|
74
|
-
return item;
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
77
52
|
return /*#__PURE__*/React.createElement("div", {
|
|
78
53
|
className: classPrefix
|
|
79
|
-
}, /*#__PURE__*/React.createElement(
|
|
80
|
-
direction: "vertical",
|
|
81
|
-
size: 12
|
|
82
|
-
}, /*#__PURE__*/React.createElement(Space, {
|
|
83
|
-
size: 16
|
|
84
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
85
55
|
className: "".concat(classPrefix, "-title")
|
|
86
|
-
}, "\u5206\u6790\u7528\u6237\u7FA4"),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, "\u786E\u5B9A"), /*#__PURE__*/React.createElement("a", {
|
|
90
|
-
className: "".concat(classPrefix, "-cancel"),
|
|
91
|
-
onClick: onCancel
|
|
92
|
-
}, "\u53D6\u6D88"))), /*#__PURE__*/React.createElement(Space, {
|
|
93
|
-
size: 16
|
|
56
|
+
}, "\u5206\u6790\u7528\u6237\u7FA4"), /*#__PURE__*/React.createElement(Space, {
|
|
57
|
+
size: 16,
|
|
58
|
+
className: "".concat(classPrefix, "-container")
|
|
94
59
|
}, [tempValue.map(function (item, i) {
|
|
95
60
|
return /*#__PURE__*/React.createElement(BizUserGroup, {
|
|
96
61
|
key: item.id,
|
|
@@ -108,7 +73,9 @@ var BizUserGroupHeader = function BizUserGroupHeader(_ref) {
|
|
|
108
73
|
setTempValue(list);
|
|
109
74
|
}
|
|
110
75
|
});
|
|
111
|
-
})], /*#__PURE__*/React.createElement(
|
|
76
|
+
})], /*#__PURE__*/React.createElement(Tooltip, {
|
|
77
|
+
title: "\u6DFB\u52A0\u7528\u6237\u7FA4\u505A\u5BF9\u6BD4"
|
|
78
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
112
79
|
type: "tianjia",
|
|
113
80
|
className: "".concat(classPrefix, "-add ").concat(max && tempValue.length >= max ? 'disabled' : ''),
|
|
114
81
|
onClick: onAdd
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
@import '../../assets/styles/inner.less';
|
|
2
2
|
.biz-user-group-header {
|
|
3
|
-
padding: 6px @margin-lg;
|
|
4
3
|
background: #fff;
|
|
5
4
|
&-title {
|
|
5
|
+
height: 20px;
|
|
6
|
+
margin-bottom: @margin-xs;
|
|
7
|
+
padding-left: @padding-lg;
|
|
6
8
|
color: @text-color-secondary;
|
|
7
9
|
font-weight: 500;
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
display: none;
|
|
11
|
-
color: @primary-color;
|
|
12
|
-
}
|
|
13
|
-
&-cancel {
|
|
14
|
-
display: none;
|
|
15
|
-
color: @text-color-secondary;
|
|
16
|
-
}
|
|
11
|
+
|
|
17
12
|
&-add {
|
|
18
13
|
color: @primary-color;
|
|
14
|
+
font-size: 20px !important;
|
|
19
15
|
cursor: pointer;
|
|
20
16
|
&.disabled {
|
|
21
17
|
display: none;
|
|
@@ -24,11 +20,12 @@
|
|
|
24
20
|
.biz-user {
|
|
25
21
|
width: 208px;
|
|
26
22
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
&-container {
|
|
24
|
+
width: 100%;
|
|
25
|
+
padding: @padding-xss @padding-lg;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
background: #e8efff;
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
}
|
|
@@ -94,6 +94,7 @@ var UserTagsSelect = function UserTagsSelect(props) {
|
|
|
94
94
|
}, /*#__PURE__*/React.createElement("div", {
|
|
95
95
|
className: "".concat(classPrefix, "-handle")
|
|
96
96
|
}, /*#__PURE__*/React.createElement(SelectHandle, {
|
|
97
|
+
open: visible,
|
|
97
98
|
border: false,
|
|
98
99
|
value: handleValue,
|
|
99
100
|
labelField: "handleText",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.84
|
|
3
|
+
"version": "1.1.84",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^16.12.0 || ^17.0.0",
|
|
56
56
|
"yorkie": "^2.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "ec1b767ecf3f2905264ed82beecadb3360bad72f",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|