@zgfe/modules-page 1.0.1-alpha.26 → 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.
@@ -73,7 +73,7 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
73
73
  onValuesChange: onChange
74
74
  }, /*#__PURE__*/React.createElement(Form.Item, {
75
75
  name: "userGroup",
76
- label: ""
76
+ className: "".concat(classPrefix, "-item1")
77
77
  }, /*#__PURE__*/React.createElement(BizUserGroupHeader, {
78
78
  max: 2,
79
79
  enableTags: true
@@ -2,7 +2,7 @@
2
2
 
3
3
  .page-search-panel {
4
4
  &-title.ant-form-item {
5
- margin-bottom: 12px;
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 24px;
45
- &:hover {
46
- background: #e8efff;
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
  }
@@ -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
- getPageResult(param, setResult, setLoading);
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
  // 改变查询条件/
@@ -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
- }).finally(function () {
78
- loadingCallback(false);
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.26",
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.82-user.2",
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": "18d2be84424a8fb824b296e6edf306c46bc11ec9"
53
+ "gitHead": "d9f733682c23bcd39bfeef149fd9a0d6c00e344c"
54
54
  }