@zgfe/modules-page 1.0.1-alpha.3 → 1.0.1-alpha.30
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/dist/esm/components/content/index.d.ts +1 -1
- package/dist/esm/components/content/index.js +5 -1
- package/dist/esm/components/content/types.d.ts +1 -0
- package/dist/esm/components/content/utils.d.ts +4 -15
- package/dist/esm/components/content/utils.js +12 -12
- package/dist/esm/components/detail/images/percent.png +0 -0
- package/dist/esm/components/detail/index.js +35 -56
- package/dist/esm/components/detail/index.less +9 -2
- package/dist/esm/components/groupModal/index.d.ts +2 -6
- package/dist/esm/components/groupModal/index.js +16 -12
- package/dist/esm/components/groupModal/index.less +23 -1
- package/dist/esm/components/groupModal/inputSelect.js +1 -0
- package/dist/esm/components/groupModal/types.d.ts +2 -0
- package/dist/esm/components/pageSelect/index.js +48 -37
- package/dist/esm/components/pageSelect/types.d.ts +0 -2
- package/dist/esm/components/searchPanel/index.d.ts +1 -1
- package/dist/esm/components/searchPanel/index.js +14 -37
- package/dist/esm/components/searchPanel/index.less +7 -34
- package/dist/esm/components/searchPanel/types.d.ts +3 -3
- package/dist/esm/components/searchPanel/util.d.ts +4 -4
- package/dist/esm/components/searchPanel/util.js +35 -29
- package/dist/esm/components/topContent/index.less +1 -0
- package/dist/esm/constants/api.js +1 -1
- package/dist/esm/modules/empty/index.js +3 -1
- package/dist/esm/modules/empty/index.less +11 -6
- package/dist/esm/modules/home/demo/index.js +60 -2
- package/dist/esm/modules/home/index.js +96 -50
- package/dist/esm/modules/home/style/index.less +23 -0
- package/dist/esm/modules/home/types.d.ts +9 -1
- package/dist/esm/modules/home/utils.d.ts +3 -3
- package/dist/esm/modules/home/utils.js +33 -12
- package/package.json +3 -3
- package/dist/esm/components/detail/images/color_pallete_percent.png +0 -0
|
@@ -17,21 +17,21 @@ import "./index.less";
|
|
|
17
17
|
import { ModulesPageContext } from "../../modules/home/types";
|
|
18
18
|
import { Tooltip } from 'antd';
|
|
19
19
|
var PageSelect = function PageSelect(props) {
|
|
20
|
-
// 根据类型展示的列表
|
|
21
|
-
var _useState = useState([]),
|
|
22
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
-
options = _useState2[0],
|
|
24
|
-
setOptions = _useState2[1];
|
|
25
20
|
// 当前类型
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
currentType =
|
|
29
|
-
setCurrentType =
|
|
21
|
+
var _useState = useState(pageTypes[0]),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
currentType = _useState2[0],
|
|
24
|
+
setCurrentType = _useState2[1];
|
|
30
25
|
// 当前页面/分组
|
|
31
|
-
var
|
|
26
|
+
var _useState3 = useState(),
|
|
27
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
28
|
+
currentValue = _useState4[0],
|
|
29
|
+
setCurrentValue = _useState4[1];
|
|
30
|
+
// 是否第一次
|
|
31
|
+
var _useState5 = useState(true),
|
|
32
32
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
isFirst = _useState6[0],
|
|
34
|
+
setIsFirst = _useState6[1];
|
|
35
35
|
var classPrefix = 'page-select';
|
|
36
36
|
var _useContext = useContext(ModulesPageContext),
|
|
37
37
|
pageList = _useContext.pageList,
|
|
@@ -39,26 +39,30 @@ var PageSelect = function PageSelect(props) {
|
|
|
39
39
|
currentClickPage = _useContext.currentClickPage;
|
|
40
40
|
useEffect(function () {
|
|
41
41
|
var _props$value, _props$value2;
|
|
42
|
-
if (!props.value) return;
|
|
43
42
|
var type = (_props$value = props.value) !== null && _props$value !== void 0 && _props$value.pageGroup || ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.pageGroup) === 0 ? 1 : 0;
|
|
44
43
|
setCurrentType(pageTypes[type]);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
if (props.value) {
|
|
45
|
+
setCurrentValue(function () {
|
|
46
|
+
if (type === 0) {
|
|
47
|
+
var data = props.value;
|
|
48
|
+
return {
|
|
49
|
+
id: "".concat(data.pageTitle ? data.pageTitle + '-' : '').concat(data.pageUrl),
|
|
50
|
+
pageTitle: data.pageTitle,
|
|
51
|
+
pageUrl: data.pageUrl
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return pageGroupList.filter(function (item) {
|
|
55
|
+
var _props$value3;
|
|
56
|
+
return item.id == ((_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.pageGroup);
|
|
57
|
+
})[0];
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
setTimeout(function () {
|
|
61
|
+
setIsFirst(false);
|
|
62
|
+
}, 0);
|
|
59
63
|
}, []);
|
|
60
64
|
useEffect(function () {
|
|
61
|
-
if (!currentClickPage) return;
|
|
65
|
+
if (!currentClickPage || isFirst) return;
|
|
62
66
|
setCurrentValue(function () {
|
|
63
67
|
if (currentClickPage && currentClickPage.pageUrl) {
|
|
64
68
|
var _ref = currentClickPage,
|
|
@@ -72,14 +76,18 @@ var PageSelect = function PageSelect(props) {
|
|
|
72
76
|
});
|
|
73
77
|
}, [currentClickPage]);
|
|
74
78
|
useEffect(function () {
|
|
79
|
+
if (isFirst) return;
|
|
75
80
|
var list = currentType.value === 'page' ? pageList : pageGroupList;
|
|
76
|
-
setOptions(list);
|
|
77
81
|
setCurrentValue(list[0]);
|
|
78
|
-
}, [currentType
|
|
82
|
+
}, [currentType]);
|
|
79
83
|
useEffect(function () {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
if (props.value) return;
|
|
85
|
+
setCurrentValue(pageList[0]);
|
|
86
|
+
}, [pageList.length]);
|
|
87
|
+
useEffect(function () {
|
|
88
|
+
if (!currentValue) return;
|
|
89
|
+
props.onChange && props.onChange(_objectSpread(_objectSpread({}, currentValue), {}, {
|
|
90
|
+
pageGroup: currentType.value === 'pageGroup' ? currentValue === null || currentValue === void 0 ? void 0 : currentValue.id : undefined
|
|
83
91
|
}));
|
|
84
92
|
}, [currentType, currentValue]);
|
|
85
93
|
var getCustomLabel = function getCustomLabel(node, option) {
|
|
@@ -101,7 +109,7 @@ var PageSelect = function PageSelect(props) {
|
|
|
101
109
|
}, /*#__PURE__*/React.createElement("div", {
|
|
102
110
|
className: "".concat(classPrefix, "-panel")
|
|
103
111
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
104
|
-
|
|
112
|
+
value: currentType,
|
|
105
113
|
className: "".concat(classPrefix, "-panel-type"),
|
|
106
114
|
options: pageTypes,
|
|
107
115
|
popupContainer: true,
|
|
@@ -112,10 +120,10 @@ var PageSelect = function PageSelect(props) {
|
|
|
112
120
|
}), /*#__PURE__*/React.createElement(BizSelect, {
|
|
113
121
|
value: currentValue,
|
|
114
122
|
className: "".concat(classPrefix, "-panel-page"),
|
|
115
|
-
options:
|
|
123
|
+
options: currentType.value === 'page' ? pageList : pageGroupList,
|
|
116
124
|
labelField: currentType.value === 'page' ? 'pageTitle' : 'name',
|
|
117
125
|
popupContainer: true,
|
|
118
|
-
enableSearch:
|
|
126
|
+
enableSearch: true,
|
|
119
127
|
onChange: setCurrentValue,
|
|
120
128
|
customLabel: getCustomLabel
|
|
121
129
|
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -123,7 +131,10 @@ var PageSelect = function PageSelect(props) {
|
|
|
123
131
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
124
132
|
className: "".concat(classPrefix, "-panel-icon").concat(!props.enableAdd ? ' disabled' : ''),
|
|
125
133
|
type: "shaixuan",
|
|
126
|
-
onClick:
|
|
134
|
+
onClick: function onClick() {
|
|
135
|
+
if (!props.enableAdd) return;
|
|
136
|
+
props.onAdd && props.onAdd();
|
|
137
|
+
}
|
|
127
138
|
}))));
|
|
128
139
|
};
|
|
129
140
|
export default PageSelect;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SearchPanelProps } from './types';
|
|
3
3
|
import './index.less';
|
|
4
|
-
declare const SearchPanel: React.
|
|
4
|
+
declare const SearchPanel: React.ForwardRefExoticComponent<SearchPanelProps & React.RefAttributes<any>>;
|
|
5
5
|
export default SearchPanel;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
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."); }
|
|
4
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); }
|
|
@@ -6,12 +5,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6
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; } }
|
|
7
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
7
|
import { Form, Skeleton } from 'antd';
|
|
9
|
-
import React, {
|
|
8
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
10
9
|
import "./index.less";
|
|
11
|
-
import { BizAttrConditionGroup,
|
|
10
|
+
import { BizAttrConditionGroup, BizUserGroupHeader } from '@zgfe/business-lib';
|
|
12
11
|
import PageSelect from "../pageSelect";
|
|
13
12
|
import { formValue, formatValue } from "./util";
|
|
14
|
-
var SearchPanel = function
|
|
13
|
+
var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
15
14
|
var classPrefix = 'page-search-panel';
|
|
16
15
|
// form 值
|
|
17
16
|
var _Form$useForm = Form.useForm(),
|
|
@@ -33,11 +32,9 @@ var SearchPanel = function SearchPanel(props) {
|
|
|
33
32
|
count = _useState6[0],
|
|
34
33
|
setCount = _useState6[1];
|
|
35
34
|
var groupRef = useRef(null);
|
|
36
|
-
var _useContext = useContext(BizGlobalDataContext),
|
|
37
|
-
userGroupList = _useContext.userGroupList;
|
|
38
35
|
useEffect(function () {
|
|
39
36
|
var _data$filters;
|
|
40
|
-
var data = formValue(props.value
|
|
37
|
+
var data = formValue(props.value);
|
|
41
38
|
setCount(((_data$filters = data.filters) === null || _data$filters === void 0 ? void 0 : _data$filters.conditions.length) || 0);
|
|
42
39
|
setFormData(data);
|
|
43
40
|
setTimeout(function () {
|
|
@@ -53,7 +50,6 @@ var SearchPanel = function SearchPanel(props) {
|
|
|
53
50
|
*/
|
|
54
51
|
var onChange = function onChange(_changedValues, allValues) {
|
|
55
52
|
setFormData(allValues);
|
|
56
|
-
console.log(formatValue(allValues), 'onChange allValues');
|
|
57
53
|
props.onChange && props.onChange(formatValue(allValues));
|
|
58
54
|
};
|
|
59
55
|
var onAdd = function onAdd() {
|
|
@@ -76,33 +72,14 @@ var SearchPanel = function SearchPanel(props) {
|
|
|
76
72
|
initialValues: formData,
|
|
77
73
|
onValuesChange: onChange
|
|
78
74
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, fields.map(function (field, index) {
|
|
88
|
-
return /*#__PURE__*/React.createElement(Form.Item, _extends({}, field, {
|
|
89
|
-
className: "".concat(classPrefix, "-item"),
|
|
90
|
-
key: field.key
|
|
91
|
-
}), /*#__PURE__*/React.createElement(BizUserGroup, {
|
|
92
|
-
onDelete: function onDelete() {
|
|
93
|
-
return remove(index);
|
|
94
|
-
}
|
|
95
|
-
}));
|
|
96
|
-
})), fields.length < 2 && /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
className: "".concat(classPrefix, "-add"),
|
|
98
|
-
onClick: function onClick() {
|
|
99
|
-
return add();
|
|
100
|
-
}
|
|
101
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
102
|
-
className: "biz-icon",
|
|
103
|
-
type: 'tianjia1'
|
|
104
|
-
}), "\u6DFB\u52A0\u7528\u6237\u7FA4"));
|
|
105
|
-
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
75
|
+
name: "userGroup",
|
|
76
|
+
className: "".concat(classPrefix, "-item1")
|
|
77
|
+
}, /*#__PURE__*/React.createElement(BizUserGroupHeader, {
|
|
78
|
+
max: 2,
|
|
79
|
+
enableTags: true
|
|
80
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
ref: ref
|
|
82
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
106
83
|
className: "".concat(classPrefix, "-title")
|
|
107
84
|
}, " \u9875\u9762 "), /*#__PURE__*/React.createElement(Form.Item, {
|
|
108
85
|
className: "".concat(classPrefix, "-item2"),
|
|
@@ -118,6 +95,6 @@ var SearchPanel = function SearchPanel(props) {
|
|
|
118
95
|
onlyAnd: true,
|
|
119
96
|
enableDelete: true,
|
|
120
97
|
onConditionsCount: setCount
|
|
121
|
-
})))));
|
|
122
|
-
};
|
|
98
|
+
}))))));
|
|
99
|
+
});
|
|
123
100
|
export default SearchPanel;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
.page-search-panel {
|
|
4
4
|
&-title.ant-form-item {
|
|
5
|
-
margin-bottom:
|
|
5
|
+
margin-bottom: 8px;
|
|
6
6
|
padding-left: 24px;
|
|
7
7
|
color: @text-color-secondary;
|
|
8
8
|
font-weight: 500;
|
|
@@ -13,42 +13,15 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
&-item-horizontal {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-wrap: wrap;
|
|
19
|
-
gap: 16px;
|
|
20
|
-
padding: 0 24px;
|
|
21
|
-
&:hover {
|
|
22
|
-
background: #e8efff;
|
|
23
|
-
}
|
|
24
|
-
.page-search-panel-item.ant-form-item {
|
|
25
|
-
margin-bottom: 0;
|
|
26
|
-
padding: 4px 0;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
&-add {
|
|
30
|
-
width: fit-content;
|
|
31
|
-
height: 20px;
|
|
32
|
-
margin-top: 8px;
|
|
33
|
-
margin-left: 24px;
|
|
34
|
-
color: @primary-color;
|
|
35
|
-
line-height: 20px;
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
span {
|
|
38
|
-
margin-right: 4px;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
16
|
|
|
42
|
-
&-item3:not(.page-search-panel-hidden) {
|
|
17
|
+
&-item3.ant-form-item:not(.page-search-panel-hidden) {
|
|
43
18
|
margin-bottom: 20px;
|
|
44
|
-
padding: 4px 24px;
|
|
45
|
-
&:hover {
|
|
46
|
-
background: #e8efff;
|
|
47
|
-
}
|
|
48
19
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
20
|
+
&-item1.ant-form-item {
|
|
21
|
+
margin-bottom: 20px !important;
|
|
22
|
+
}
|
|
23
|
+
&-item2.ant-form-item {
|
|
24
|
+
margin-bottom: 4px !important;
|
|
52
25
|
}
|
|
53
26
|
|
|
54
27
|
&-hidden.ant-form-item {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AttrConditionTypes
|
|
1
|
+
import { AttrConditionTypes } from '@zgfe/business-lib';
|
|
2
2
|
export interface SearchPanelProps {
|
|
3
3
|
value?: SearchValue;
|
|
4
4
|
onChange?: (data: SearchValue) => void;
|
|
5
5
|
}
|
|
6
6
|
export interface SearchValue {
|
|
7
|
-
userGroup?: number[];
|
|
7
|
+
userGroup?: (number | string[])[];
|
|
8
8
|
pageUrl?: string;
|
|
9
9
|
pageTitle?: string;
|
|
10
10
|
pageGroup?: number;
|
|
@@ -12,7 +12,7 @@ export interface SearchValue {
|
|
|
12
12
|
type?: string;
|
|
13
13
|
}
|
|
14
14
|
export interface FormValue {
|
|
15
|
-
userGroup?:
|
|
15
|
+
userGroup?: (number | string[])[];
|
|
16
16
|
page?: PageTypes;
|
|
17
17
|
filters?: AttrConditionTypes.GroupValue;
|
|
18
18
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AttrConditionTypes } from '@zgfe/business-lib';
|
|
2
2
|
import { FormValue, SearchValue } from './types';
|
|
3
|
-
export declare const formValue: (source?: SearchValue
|
|
3
|
+
export declare const formValue: (source?: SearchValue) => FormValue;
|
|
4
4
|
export declare const formatValue: (source: FormValue) => {
|
|
5
|
-
userGroup: number[];
|
|
5
|
+
userGroup: (number | string[])[];
|
|
6
6
|
pageTitle: string | undefined;
|
|
7
7
|
pageUrl: string | undefined;
|
|
8
8
|
pageGroup: number | undefined;
|
|
9
|
-
filters:
|
|
9
|
+
filters: AttrConditionTypes.GroupValue | undefined;
|
|
10
10
|
};
|
|
@@ -1,47 +1,53 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
|
|
2
|
+
import { OperateTypes } from '@zgfe/business-lib/es/attrConditions/types';
|
|
3
|
+
export var formValue = function formValue(source) {
|
|
3
4
|
var data = _.cloneDeep(source) || {};
|
|
4
|
-
|
|
5
|
-
var result = [];
|
|
6
|
-
if (data.userGroup && data.userGroup.length) {
|
|
7
|
-
userGroupList === null || userGroupList === void 0 ? void 0 : userGroupList.forEach(function (user) {
|
|
8
|
-
var _data$userGroup;
|
|
9
|
-
if ((_data$userGroup = data.userGroup) !== null && _data$userGroup !== void 0 && _data$userGroup.includes(user.id)) {
|
|
10
|
-
result.push(user);
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
} else {
|
|
14
|
-
result = userGroupList ? [userGroupList[0]] : [{
|
|
15
|
-
id: 0,
|
|
16
|
-
name: '所有用户'
|
|
17
|
-
}];
|
|
18
|
-
}
|
|
19
|
-
var page = {
|
|
20
|
-
type: 'page',
|
|
5
|
+
var page = !data.pageUrl && !data.pageTitle && !data.pageGroup && data.pageGroup != 0 ? undefined : {
|
|
21
6
|
pageGroup: data === null || data === void 0 ? void 0 : data.pageGroup,
|
|
22
7
|
pageUrl: data === null || data === void 0 ? void 0 : data.pageUrl,
|
|
23
8
|
pageTitle: data === null || data === void 0 ? void 0 : data.pageTitle
|
|
24
9
|
};
|
|
25
10
|
return {
|
|
26
|
-
userGroup:
|
|
11
|
+
userGroup: data.userGroup || [0],
|
|
27
12
|
page: page,
|
|
28
13
|
filters: data.filters
|
|
29
14
|
};
|
|
30
15
|
};
|
|
31
16
|
export var formatValue = function formatValue(source) {
|
|
32
|
-
var _data$
|
|
17
|
+
var _data$userGroup, _data$page, _data$page2, _data$page3;
|
|
33
18
|
var data = _.cloneDeep(source) || {};
|
|
34
|
-
var
|
|
35
|
-
(_data$userGroup2 = data.userGroup) === null || _data$userGroup2 === void 0 ? void 0 : _data$userGroup2.forEach(function (item) {
|
|
36
|
-
if (item) {
|
|
37
|
-
group.push(item.id);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
19
|
+
var filters = getConditionList(data.filters);
|
|
40
20
|
return {
|
|
41
|
-
userGroup:
|
|
21
|
+
userGroup: ((_data$userGroup = data.userGroup) === null || _data$userGroup === void 0 ? void 0 : _data$userGroup.filter(function (item) {
|
|
22
|
+
return item || item === 0;
|
|
23
|
+
})) || [0],
|
|
42
24
|
pageTitle: (_data$page = data.page) === null || _data$page === void 0 ? void 0 : _data$page.pageTitle,
|
|
43
25
|
pageUrl: (_data$page2 = data.page) === null || _data$page2 === void 0 ? void 0 : _data$page2.pageUrl,
|
|
44
26
|
pageGroup: (_data$page3 = data.page) === null || _data$page3 === void 0 ? void 0 : _data$page3.pageGroup,
|
|
45
|
-
filters:
|
|
27
|
+
filters: filters
|
|
46
28
|
};
|
|
47
|
-
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 筛选条件当未选择值时,不查询
|
|
33
|
+
* @param filters 筛选条件数组
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
function getConditionList(filters) {
|
|
37
|
+
if (!filters || !filters.conditions) return;
|
|
38
|
+
var conditionList = [];
|
|
39
|
+
filters.conditions.forEach(function (item) {
|
|
40
|
+
if (!item.attrId && !item.attrName) return;
|
|
41
|
+
if (!item.values || !item.values.length) {
|
|
42
|
+
if (item.operator === OperateTypes.IsNotNull || item.operator === OperateTypes.IsNull) {
|
|
43
|
+
conditionList.push(item);
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
conditionList.push(item);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return conditionList.length ? {
|
|
50
|
+
conditions: conditionList,
|
|
51
|
+
relation: 'and'
|
|
52
|
+
} : undefined;
|
|
53
|
+
}
|
|
@@ -28,6 +28,8 @@ var EmptyPanel = function EmptyPanel() {
|
|
|
28
28
|
}, /*#__PURE__*/React.createElement("div", {
|
|
29
29
|
className: "".concat(classPrefix, "-title")
|
|
30
30
|
}, "\u9875\u9762\u70B9\u51FB\u5206\u6790"), /*#__PURE__*/React.createElement("p", null, "\u9875\u9762\u7684\u70B9\u51FB\u6548\u679C\u5C55\u793A\uFF0C\u53EF\u4EE5\u66F4\u52A0\u76F4\u89C2\u7684\u770B\u51FA\u9875\u9762\u4E2D\u70B9\u51FB\u7684\u5206\u5E03\u60C5\u51B5"), /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "".concat(classPrefix, "-content2")
|
|
32
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31
33
|
className: "".concat(classPrefix, "-title-secondary")
|
|
32
34
|
}, "\u8BBE\u7F6E\u65B9\u6CD5"), /*#__PURE__*/React.createElement("p", null, "\u70B9\u51FB\u5206\u6790\u6570\u636E\u9ED8\u8BA4\u4E3A\u4E0D\u91C7\u96C6\uFF0C\u5982\u9700\u91C7\u96C6\uFF0C\u53EF\u5728\u76F8\u5E94\u9875\u9762\u7684SDK\u4EE3\u7801\u4E2D\u52A0\u5165\u4EE5\u4E0B\u53C2\u6570\u914D\u7F6E"), /*#__PURE__*/React.createElement("div", {
|
|
33
35
|
className: "".concat(classPrefix, "-code-container")
|
|
@@ -40,7 +42,7 @@ var EmptyPanel = function EmptyPanel() {
|
|
|
40
42
|
className: "".concat(classPrefix, "-code")
|
|
41
43
|
}, "autoTrack: true,", /*#__PURE__*/React.createElement("span", null, "//\u5168\u57CB\u70B9\u5F00\u5173")), /*#__PURE__*/React.createElement("div", {
|
|
42
44
|
className: "".concat(classPrefix, "-code")
|
|
43
|
-
}, "singlePage: false", /*#__PURE__*/React.createElement("span", null, "//\u662F\u5426\u4E3A\u5355\u9875\u9762\u5E94\u7528 \u9ED8\u8BA4\u4E3Afalse")), /*#__PURE__*/React.createElement("div", null, '}', ");")), /*#__PURE__*/React.createElement("p", null, "\u9002\u7528\u4E8ELanding Page\u3001\u6D3B\u52A8\u9875\u3001\u5B98\u7F51\uFF0C\u9875\u9762\u7B80\u5355\u53EF\u4F7F\u7528\u9875\u9762\u70B9\u51FB\u5206\u6790\u63D0\u5347\u6548\u7387\uFF0C\u5EFA\u8BAE\u4E0D\u8981\u5728\u590D\u6742\u9875\u9762\u4F7F\u7528\u3002")), /*#__PURE__*/React.createElement("img", {
|
|
45
|
+
}, "singlePage: false", /*#__PURE__*/React.createElement("span", null, "//\u662F\u5426\u4E3A\u5355\u9875\u9762\u5E94\u7528 \u9ED8\u8BA4\u4E3Afalse")), /*#__PURE__*/React.createElement("div", null, '}', ");")), /*#__PURE__*/React.createElement("p", null, "\u9002\u7528\u4E8ELanding Page\u3001\u6D3B\u52A8\u9875\u3001\u5B98\u7F51\uFF0C\u9875\u9762\u7B80\u5355\u53EF\u4F7F\u7528\u9875\u9762\u70B9\u51FB\u5206\u6790\u63D0\u5347\u6548\u7387\uFF0C\u5EFA\u8BAE\u4E0D\u8981\u5728\u590D\u6742\u9875\u9762\u4F7F\u7528\u3002"))), /*#__PURE__*/React.createElement("img", {
|
|
44
46
|
className: "".concat(classPrefix, "-img"),
|
|
45
47
|
src: chartImg
|
|
46
48
|
}));
|
|
@@ -9,13 +9,19 @@
|
|
|
9
9
|
background: url(./img/bg.png);
|
|
10
10
|
background-size: cover;
|
|
11
11
|
&-content {
|
|
12
|
-
width:
|
|
12
|
+
width: 406px;
|
|
13
13
|
margin-left: 136px;
|
|
14
14
|
p {
|
|
15
15
|
color: #9aa1a9;
|
|
16
16
|
font-size: 14px;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
&-content2 {
|
|
20
|
+
width: 400px;
|
|
21
|
+
p {
|
|
22
|
+
margin-bottom: 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
19
25
|
&-title {
|
|
20
26
|
margin-bottom: 24px;
|
|
21
27
|
font-weight: 500;
|
|
@@ -31,10 +37,10 @@
|
|
|
31
37
|
&-code-container {
|
|
32
38
|
position: relative;
|
|
33
39
|
height: 200px;
|
|
40
|
+
margin: 8px 0;
|
|
34
41
|
padding: 16px;
|
|
35
|
-
background: #
|
|
42
|
+
background: #fafafb;
|
|
36
43
|
border-radius: 8px;
|
|
37
|
-
|
|
38
44
|
&:hover {
|
|
39
45
|
.empty-panel-code-copy {
|
|
40
46
|
display: flex;
|
|
@@ -57,12 +63,11 @@
|
|
|
57
63
|
}
|
|
58
64
|
&-code-copy {
|
|
59
65
|
position: absolute;
|
|
60
|
-
top:
|
|
61
|
-
right:
|
|
66
|
+
top: 16px;
|
|
67
|
+
right: 16px;
|
|
62
68
|
display: flex;
|
|
63
69
|
display: none;
|
|
64
70
|
align-items: center;
|
|
65
|
-
align-items: center;
|
|
66
71
|
height: 24px;
|
|
67
72
|
padding: 0 8px;
|
|
68
73
|
background: #f2f3f4;
|
|
@@ -1,14 +1,72 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ModulesPage } from '@zgfe/modules-page';
|
|
3
3
|
import { DemoWrapper } from '@zgfe/business-lib';
|
|
4
|
+
var defaultValue = {
|
|
5
|
+
pageTitle: '进入百度首页894854121612',
|
|
6
|
+
appId: 225,
|
|
7
|
+
module: 'page',
|
|
8
|
+
pageUrl: 'http://baidu.com/query/894854121612',
|
|
9
|
+
time: {
|
|
10
|
+
unit: 'day',
|
|
11
|
+
end: '2023-09-14',
|
|
12
|
+
begin: '2023-08-31',
|
|
13
|
+
relative: [14, 0]
|
|
14
|
+
},
|
|
15
|
+
filters: {
|
|
16
|
+
conditions: [{
|
|
17
|
+
attrId: 0,
|
|
18
|
+
propCategory: 'userProp',
|
|
19
|
+
values: ['实名'],
|
|
20
|
+
dimensionSub: 'is_anonymous',
|
|
21
|
+
label: '实名/匿名',
|
|
22
|
+
type: 1,
|
|
23
|
+
category: 'fixed',
|
|
24
|
+
operator: 'equal',
|
|
25
|
+
attrName: 'is_anonymous'
|
|
26
|
+
}, {
|
|
27
|
+
attrId: 0,
|
|
28
|
+
propCategory: 'userProp',
|
|
29
|
+
values: ['30', '1'],
|
|
30
|
+
dimensionSub: 'last_visit_time',
|
|
31
|
+
label: '最后一次访问时间',
|
|
32
|
+
type: 3,
|
|
33
|
+
category: 'fixed',
|
|
34
|
+
operator: 'relative',
|
|
35
|
+
attrName: 'last_visit_time'
|
|
36
|
+
}, {
|
|
37
|
+
attrId: 0,
|
|
38
|
+
propCategory: 'envProp',
|
|
39
|
+
type: 1,
|
|
40
|
+
operator: 'equal',
|
|
41
|
+
values: ['baidu'],
|
|
42
|
+
dimensionSub: 'website',
|
|
43
|
+
label: '来源域名',
|
|
44
|
+
attrName: 'website',
|
|
45
|
+
category: 'fixed'
|
|
46
|
+
}],
|
|
47
|
+
relation: 'and'
|
|
48
|
+
},
|
|
49
|
+
userGroup: [758, 757],
|
|
50
|
+
platform: 3
|
|
51
|
+
};
|
|
4
52
|
export default (function () {
|
|
53
|
+
var onClickWarn = function onClickWarn() {
|
|
54
|
+
console.log('onClickWarn');
|
|
55
|
+
};
|
|
56
|
+
var onChange = function onChange(data) {
|
|
57
|
+
console.log('onChange:', data);
|
|
58
|
+
};
|
|
5
59
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
6
60
|
needMeta: true,
|
|
7
|
-
defaultApp:
|
|
61
|
+
defaultApp: 225
|
|
8
62
|
}, /*#__PURE__*/React.createElement("div", {
|
|
9
63
|
style: {
|
|
10
64
|
height: 750,
|
|
11
65
|
overflow: 'auto'
|
|
12
66
|
}
|
|
13
|
-
}, /*#__PURE__*/React.createElement(ModulesPage,
|
|
67
|
+
}, /*#__PURE__*/React.createElement(ModulesPage, {
|
|
68
|
+
value: defaultValue,
|
|
69
|
+
onClickWarn: onClickWarn,
|
|
70
|
+
onChange: onChange
|
|
71
|
+
})));
|
|
14
72
|
});
|