@zgfe/modules-page 1.0.1-alpha.25 → 1.0.1-alpha.27
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/groupModal/index.less +2 -0
- package/dist/esm/components/searchPanel/index.js +7 -31
- package/dist/esm/components/searchPanel/index.less +5 -31
- package/dist/esm/modules/empty/index.less +4 -1
- package/dist/esm/modules/home/index.js +10 -1
- package/dist/esm/modules/home/style/index.less +7 -0
- package/dist/esm/modules/home/utils.d.ts +1 -1
- package/dist/esm/modules/home/utils.js +10 -4
- package/package.json +3 -3
|
@@ -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); }
|
|
@@ -8,7 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
8
7
|
import { Form, Skeleton } from 'antd';
|
|
9
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
13
|
var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -73,35 +72,12 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
73
72
|
initialValues: formData,
|
|
74
73
|
onValuesChange: onChange
|
|
75
74
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
className: "".concat(classPrefix, "-item-horizontal")
|
|
84
|
-
}, fields.map(function (field, index) {
|
|
85
|
-
return /*#__PURE__*/React.createElement(Form.Item, _extends({}, field, {
|
|
86
|
-
className: "".concat(classPrefix, "-item"),
|
|
87
|
-
key: field.key
|
|
88
|
-
}), /*#__PURE__*/React.createElement(BizUserGroup, {
|
|
89
|
-
enableTags: true,
|
|
90
|
-
enableDelete: fields.length > 1,
|
|
91
|
-
onDelete: function onDelete() {
|
|
92
|
-
return remove(index);
|
|
93
|
-
}
|
|
94
|
-
}));
|
|
95
|
-
})), fields.length < 2 && /*#__PURE__*/React.createElement("div", {
|
|
96
|
-
className: "".concat(classPrefix, "-add"),
|
|
97
|
-
onClick: function onClick() {
|
|
98
|
-
return add();
|
|
99
|
-
}
|
|
100
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
101
|
-
className: "biz-icon",
|
|
102
|
-
type: 'tianjia1'
|
|
103
|
-
}), "\u6DFB\u52A0\u7528\u6237\u7FA4"));
|
|
104
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
name: "userGroup",
|
|
76
|
+
className: "".concat(classPrefix, "-item1")
|
|
77
|
+
}, /*#__PURE__*/React.createElement(BizUserGroupHeader, {
|
|
78
|
+
max: 2,
|
|
79
|
+
enableTags: true
|
|
80
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
105
81
|
ref: ref
|
|
106
82
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
107
83
|
className: "".concat(classPrefix, "-title")
|
|
@@ -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,40 +13,14 @@
|
|
|
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
17
|
&-item3.ant-form-item:not(.page-search-panel-hidden) {
|
|
43
18
|
margin-bottom: 20px;
|
|
44
|
-
padding: 4px
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
19
|
+
padding: 4px 0;
|
|
20
|
+
}
|
|
21
|
+
&-item1.ant-form-item {
|
|
22
|
+
margin-bottom: 20px !important;
|
|
48
23
|
}
|
|
49
|
-
|
|
50
24
|
&-item2.ant-form-item {
|
|
51
25
|
margin-bottom: 4px !important;
|
|
52
26
|
}
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
}
|
|
19
19
|
&-content2 {
|
|
20
20
|
width: 400px;
|
|
21
|
+
p {
|
|
22
|
+
margin-bottom: 0;
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
25
|
&-title {
|
|
23
26
|
margin-bottom: 24px;
|
|
@@ -34,10 +37,10 @@
|
|
|
34
37
|
&-code-container {
|
|
35
38
|
position: relative;
|
|
36
39
|
height: 200px;
|
|
40
|
+
margin: 8px 0;
|
|
37
41
|
padding: 16px;
|
|
38
42
|
background: #fafafb;
|
|
39
43
|
border-radius: 8px;
|
|
40
|
-
|
|
41
44
|
&:hover {
|
|
42
45
|
.empty-panel-code-copy {
|
|
43
46
|
display: flex;
|
|
@@ -88,6 +88,11 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
88
88
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
89
89
|
currentClickPage = _useState26[0],
|
|
90
90
|
setCurrentClickPage = _useState26[1];
|
|
91
|
+
var _React$useState = React.useState(),
|
|
92
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
93
|
+
controller = _React$useState2[0],
|
|
94
|
+
setController = _React$useState2[1];
|
|
95
|
+
|
|
91
96
|
// 查询条件ref
|
|
92
97
|
var selectRef = useRef(null);
|
|
93
98
|
var _useContext = useContext(BizGlobalDataContext),
|
|
@@ -161,7 +166,11 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
161
166
|
return;
|
|
162
167
|
}
|
|
163
168
|
setOriginSearchValue(_.cloneDeep(searchValue));
|
|
164
|
-
|
|
169
|
+
var control = new AbortController();
|
|
170
|
+
var signal = control.signal;
|
|
171
|
+
controller === null || controller === void 0 ? void 0 : controller.abort();
|
|
172
|
+
setController(control);
|
|
173
|
+
getPageResult(param, setResult, setLoading, signal);
|
|
165
174
|
}, 500));
|
|
166
175
|
};
|
|
167
176
|
// 改变查询条件/
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
padding: 4px 16px;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
.ant-btn-primary[disabled] {
|
|
13
|
+
color: #fff;
|
|
14
|
+
background: #d0dfff;
|
|
15
|
+
border-color: #d0dfff;
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
&-spin {
|
|
14
19
|
display: flex;
|
|
@@ -30,6 +35,8 @@
|
|
|
30
35
|
background-color: #fff;
|
|
31
36
|
}
|
|
32
37
|
.ant-btn {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
33
40
|
.bsicon {
|
|
34
41
|
font-size: 16px !important;
|
|
35
42
|
line-height: 1;
|
|
@@ -2,6 +2,6 @@ import { ModulesPageTypes } from './types';
|
|
|
2
2
|
import { AppInfoProps } from '@zgfe/business-lib/es/context';
|
|
3
3
|
export declare const getPageList: (data: ModulesPageTypes.Params, callback: Function) => void;
|
|
4
4
|
export declare const getPageGroupList: (data: ModulesPageTypes.Params, callback: Function, loadingCallback?: Function) => void;
|
|
5
|
-
export declare const getPageResult: (params: ModulesPageTypes.Value, callback: Function, loadingCallback: Function) => void;
|
|
5
|
+
export declare const getPageResult: (params: ModulesPageTypes.Value, callback: Function, loadingCallback: Function, signal: AbortSignal) => void;
|
|
6
6
|
export declare const getSocketSecret: () => string;
|
|
7
7
|
export declare const onDownload: (params?: ModulesPageTypes.Value, currentApp?: AppInfoProps) => void;
|
|
@@ -61,21 +61,27 @@ export var getPageGroupList = function getPageGroupList(data, callback, loadingC
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
// 获取页面查询结果
|
|
64
|
-
export var getPageResult = function getPageResult(params, callback, loadingCallback) {
|
|
64
|
+
export var getPageResult = function getPageResult(params, callback, loadingCallback, signal) {
|
|
65
65
|
loadingCallback(true);
|
|
66
66
|
ajax(api.getPageResult, {
|
|
67
67
|
method: 'post',
|
|
68
|
-
data: params
|
|
68
|
+
data: params,
|
|
69
|
+
signal: signal
|
|
69
70
|
}).then(function (res) {
|
|
70
71
|
var _res$data;
|
|
72
|
+
loadingCallback(false);
|
|
71
73
|
if (!res || !res.data) return;
|
|
72
74
|
callback((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
|
|
73
75
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
74
76
|
id: "".concat(item.userGroup, "-").concat(item.pageTitle, "-").concat(item.pageUrl)
|
|
75
77
|
});
|
|
76
78
|
}));
|
|
77
|
-
}).
|
|
78
|
-
|
|
79
|
+
}).catch(function (e) {
|
|
80
|
+
if (e.isCancel) {
|
|
81
|
+
console.log('请求被取消了');
|
|
82
|
+
} else {
|
|
83
|
+
loadingCallback(false);
|
|
84
|
+
}
|
|
79
85
|
});
|
|
80
86
|
};
|
|
81
87
|
export var getSocketSecret = function getSocketSecret() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-page",
|
|
3
|
-
"version": "1.0.1-alpha.
|
|
3
|
+
"version": "1.0.1-alpha.27",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@types/lodash": "^4.14.197",
|
|
40
40
|
"@umijs/fabric": "^2.8.1",
|
|
41
41
|
"@umijs/test": "^3.0.5",
|
|
42
|
-
"@zgfe/business-lib": "1.1.
|
|
42
|
+
"@zgfe/business-lib": "1.1.82-user.5",
|
|
43
43
|
"antd": "^4.22.6",
|
|
44
44
|
"dumi": "^1.1.0",
|
|
45
45
|
"father": "^4.0.0-rc.2",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"prettier": "^2.2.1",
|
|
51
51
|
"yorkie": "^2.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "d9f733682c23bcd39bfeef149fd9a0d6c00e344c"
|
|
54
54
|
}
|