@zgfe/modules-page 1.0.1-alpha.2 → 1.0.1-alpha.21
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 +10 -11
- package/dist/esm/components/detail/images/percent.png +0 -0
- package/dist/esm/components/detail/index.js +37 -57
- 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 +36 -29
- package/dist/esm/components/groupModal/index.less +36 -1
- package/dist/esm/components/groupModal/inputSelect.d.ts +9 -0
- package/dist/esm/components/groupModal/inputSelect.js +68 -0
- package/dist/esm/components/groupModal/pageItem.js +47 -58
- package/dist/esm/components/groupModal/types.d.ts +2 -2
- package/dist/esm/components/groupModal/utils.js +2 -8
- 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 +11 -10
- package/dist/esm/components/searchPanel/index.less +3 -3
- 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 +33 -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 +7 -5
- package/dist/esm/modules/home/demo/index.js +25 -2
- package/dist/esm/modules/home/index.js +96 -50
- package/dist/esm/modules/home/style/index.less +10 -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 +25 -10
- package/package.json +4 -3
- package/dist/esm/components/detail/images/color_pallete_percent.png +0 -0
- package/dist/esm/components/groupModal/mock.d.ts +0 -5
- package/dist/esm/components/groupModal/mock.js +0 -16
|
@@ -1,14 +1,37 @@
|
|
|
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
|
+
appId: 225,
|
|
6
|
+
platform: 3,
|
|
7
|
+
module: 'page',
|
|
8
|
+
time: {
|
|
9
|
+
begin: '2023-09-09',
|
|
10
|
+
end: '2023-09-12',
|
|
11
|
+
unit: 'day'
|
|
12
|
+
},
|
|
13
|
+
userGroup: [0],
|
|
14
|
+
pageTitle: '进入百度首页780300590145',
|
|
15
|
+
pageUrl: 'http://baidu.com/query/780300590145'
|
|
16
|
+
};
|
|
4
17
|
export default (function () {
|
|
18
|
+
var onClickWarn = function onClickWarn() {
|
|
19
|
+
console.log('onClickWarn');
|
|
20
|
+
};
|
|
21
|
+
var onChange = function onChange(data) {
|
|
22
|
+
console.log('onChange:', data);
|
|
23
|
+
};
|
|
5
24
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
6
25
|
needMeta: true,
|
|
7
|
-
defaultApp:
|
|
26
|
+
defaultApp: 225
|
|
8
27
|
}, /*#__PURE__*/React.createElement("div", {
|
|
9
28
|
style: {
|
|
10
29
|
height: 750,
|
|
11
30
|
overflow: 'auto'
|
|
12
31
|
}
|
|
13
|
-
}, /*#__PURE__*/React.createElement(ModulesPage,
|
|
32
|
+
}, /*#__PURE__*/React.createElement(ModulesPage, {
|
|
33
|
+
value: defaultValue,
|
|
34
|
+
onClickWarn: onClickWarn,
|
|
35
|
+
onChange: onChange
|
|
36
|
+
})));
|
|
14
37
|
});
|
|
@@ -10,10 +10,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
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; }
|
|
11
11
|
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
13
|
+
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import EmptyPanel from "../empty";
|
|
15
15
|
import { BizGlobalDataContext, BizLayout } from '@zgfe/business-lib';
|
|
16
|
-
import { Button, Spin } from 'antd';
|
|
16
|
+
import { Button, Skeleton, Spin } from 'antd';
|
|
17
17
|
import "./style/index.less";
|
|
18
18
|
import SearchPanel from "../../components/searchPanel";
|
|
19
19
|
import TopContent from "../../components/topContent";
|
|
@@ -22,6 +22,7 @@ import { ModulesPageContext } from "./types";
|
|
|
22
22
|
import GroupModal from "../../components/groupModal";
|
|
23
23
|
import { getPageGroupList, getPageList, getPageResult, onDownload as _onDownload } from "./utils";
|
|
24
24
|
import DetailContent from "../../components/detail";
|
|
25
|
+
import _ from 'lodash';
|
|
25
26
|
var classPrefix = 'modules-page';
|
|
26
27
|
var ModulesPage = function ModulesPage(props) {
|
|
27
28
|
// 页面类型
|
|
@@ -29,54 +30,66 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
29
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
30
31
|
currentType = _useState2[0],
|
|
31
32
|
setCurrentType = _useState2[1];
|
|
32
|
-
//
|
|
33
|
+
// 最新查询条件
|
|
33
34
|
var _useState3 = useState(),
|
|
34
35
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
35
36
|
searchValue = _useState4[0],
|
|
36
37
|
setSearchValue = _useState4[1];
|
|
37
|
-
//
|
|
38
|
-
var _useState5 = useState(
|
|
38
|
+
// 上一次查询条件
|
|
39
|
+
var _useState5 = useState(),
|
|
39
40
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
originSearchValue = _useState6[0],
|
|
42
|
+
setOriginSearchValue = _useState6[1];
|
|
43
|
+
|
|
44
|
+
// 是否展示分组弹窗
|
|
45
|
+
var _useState7 = useState(false),
|
|
44
46
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
//
|
|
47
|
+
showGroup = _useState8[0],
|
|
48
|
+
setShowGroup = _useState8[1];
|
|
49
|
+
// 页面列表
|
|
48
50
|
var _useState9 = useState([]),
|
|
49
51
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//
|
|
52
|
+
pageList = _useState10[0],
|
|
53
|
+
setPageList = _useState10[1];
|
|
54
|
+
// 页面分组列表
|
|
53
55
|
var _useState11 = useState([]),
|
|
54
56
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
pageGroupList = _useState12[0],
|
|
58
|
+
setPageGroupList = _useState12[1];
|
|
59
|
+
// 查询结果
|
|
60
|
+
var _useState13 = useState([]),
|
|
58
61
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var _useState15 = useState(),
|
|
62
|
+
result = _useState14[0],
|
|
63
|
+
setResult = _useState14[1];
|
|
64
|
+
var _useState15 = useState(true),
|
|
63
65
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var _useState17 = useState('list'),
|
|
66
|
+
loading = _useState16[0],
|
|
67
|
+
setLoading = _useState16[1];
|
|
68
|
+
var _useState17 = useState(true),
|
|
68
69
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
pageLoading = _useState18[0],
|
|
71
|
+
setPageLoading = _useState18[1];
|
|
72
|
+
// 要编辑的分组
|
|
73
|
+
var _useState19 = useState(),
|
|
72
74
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
var _useState21 = useState(),
|
|
75
|
+
editGroup = _useState20[0],
|
|
76
|
+
setEditGroup = _useState20[1];
|
|
77
|
+
// 当前页面类型 list/detail
|
|
78
|
+
var _useState21 = useState('list'),
|
|
77
79
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
pageType = _useState22[0],
|
|
81
|
+
setPageType = _useState22[1];
|
|
82
|
+
var _useState23 = useState(0),
|
|
83
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
84
|
+
timer = _useState24[0],
|
|
85
|
+
setTimer = _useState24[1];
|
|
86
|
+
//当前点击内容(用于同步查询条件中的内容)
|
|
87
|
+
var _useState25 = useState(),
|
|
88
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
89
|
+
currentClickPage = _useState26[0],
|
|
90
|
+
setCurrentClickPage = _useState26[1];
|
|
91
|
+
// 查询条件ref
|
|
92
|
+
var selectRef = useRef(null);
|
|
80
93
|
var _useContext = useContext(BizGlobalDataContext),
|
|
81
94
|
eventGroupList = _useContext.eventGroupList,
|
|
82
95
|
currentApp = _useContext.currentApp;
|
|
@@ -95,10 +108,13 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
95
108
|
useEffect(function () {
|
|
96
109
|
var param = {
|
|
97
110
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
98
|
-
platform:
|
|
111
|
+
platform: 3
|
|
99
112
|
};
|
|
100
|
-
getPageGroupList(param, setPageGroupList);
|
|
101
113
|
getPageList(param, setPageList);
|
|
114
|
+
getPageGroupList(param, setPageGroupList, setPageLoading);
|
|
115
|
+
if (props.value) {
|
|
116
|
+
setSearchValue(props.value);
|
|
117
|
+
}
|
|
102
118
|
}, []);
|
|
103
119
|
useEffect(function () {
|
|
104
120
|
if (!showGroup) {
|
|
@@ -108,15 +124,26 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
108
124
|
useEffect(function () {
|
|
109
125
|
if (isEmpty) return;
|
|
110
126
|
if (!searchValue) return;
|
|
111
|
-
console.log('searchValue:', searchValue);
|
|
112
127
|
var type = searchValue !== null && searchValue !== void 0 && searchValue.pageGroup || (searchValue === null || searchValue === void 0 ? void 0 : searchValue.pageGroup) === 0 ? 'pageGroup' : 'page';
|
|
113
128
|
setCurrentType(type);
|
|
114
129
|
// 选择概览时,跳到列表页
|
|
115
130
|
if (type === 'page' && !(searchValue !== null && searchValue !== void 0 && searchValue.pageUrl) || type === 'pageGroup' && !(searchValue !== null && searchValue !== void 0 && searchValue.pageGroup)) {
|
|
116
131
|
setPageType('list');
|
|
117
132
|
}
|
|
133
|
+
if (type === 'pageGroup' && !(searchValue !== null && searchValue !== void 0 && searchValue.pageGroup)) return;
|
|
118
134
|
if (type === 'page' || pageType === 'detail') {
|
|
135
|
+
if (!searchValue.pageUrl && !searchValue.pageTitle && !searchValue.pageGroup && searchValue.pageGroup != 0) return;
|
|
119
136
|
fetch();
|
|
137
|
+
} else if (type === 'pageGroup') {
|
|
138
|
+
if (!searchValue.pageGroup && searchValue.pageGroup != 0) return;
|
|
139
|
+
props.onChange && props.onChange(_objectSpread(_objectSpread({
|
|
140
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
141
|
+
platform: 3,
|
|
142
|
+
module: 'page'
|
|
143
|
+
}, searchValue), {}, {
|
|
144
|
+
pageUrl: undefined,
|
|
145
|
+
pageTitle: undefined
|
|
146
|
+
}));
|
|
120
147
|
}
|
|
121
148
|
}, [searchValue]);
|
|
122
149
|
// 查询结果
|
|
@@ -128,12 +155,19 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
128
155
|
setTimer(setTimeout(function () {
|
|
129
156
|
var param = _objectSpread({
|
|
130
157
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
131
|
-
platform:
|
|
158
|
+
platform: 3,
|
|
159
|
+
module: 'page'
|
|
132
160
|
}, searchValue);
|
|
161
|
+
props.onChange && props.onChange(param);
|
|
162
|
+
if (_.isEqual(originSearchValue, searchValue)) {
|
|
163
|
+
setLoading(false);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
setOriginSearchValue(_.cloneDeep(searchValue));
|
|
133
167
|
getPageResult(param, setResult, setLoading);
|
|
134
168
|
}, 500));
|
|
135
169
|
};
|
|
136
|
-
//
|
|
170
|
+
// 改变查询条件/
|
|
137
171
|
var onChange = function onChange(data) {
|
|
138
172
|
setSearchValue(function (value) {
|
|
139
173
|
if (!value) return data;
|
|
@@ -150,11 +184,12 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
150
184
|
};
|
|
151
185
|
// 分组弹窗编辑回调,更新分组列表
|
|
152
186
|
var onOk = function onOk() {
|
|
187
|
+
setShowGroup(false);
|
|
153
188
|
var param = {
|
|
154
189
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
155
|
-
platform:
|
|
190
|
+
platform: 3
|
|
156
191
|
};
|
|
157
|
-
getPageGroupList(param, setPageGroupList);
|
|
192
|
+
getPageGroupList(param, setPageGroupList, setPageLoading);
|
|
158
193
|
};
|
|
159
194
|
|
|
160
195
|
// 点击表格中页面
|
|
@@ -173,6 +208,7 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
173
208
|
className: "".concat(classPrefix, "-top-render")
|
|
174
209
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
175
210
|
type: "primary",
|
|
211
|
+
disabled: loading || !result || !result.length,
|
|
176
212
|
onClick: props.onClickWarn
|
|
177
213
|
}, "\u8BBE\u7F6E\u6D41\u5931\u9884\u8B66"));
|
|
178
214
|
if (isEmpty) return /*#__PURE__*/React.createElement(EmptyPanel, null);
|
|
@@ -186,12 +222,22 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
186
222
|
}, /*#__PURE__*/React.createElement(BizLayout, {
|
|
187
223
|
title: "\u9875\u9762\u5206\u6790",
|
|
188
224
|
hasCollapse: true,
|
|
189
|
-
topPanel: /*#__PURE__*/React.createElement(
|
|
225
|
+
topPanel: /*#__PURE__*/React.createElement(Skeleton, {
|
|
226
|
+
loading: pageLoading,
|
|
227
|
+
active: true,
|
|
228
|
+
paragraph: {
|
|
229
|
+
rows: 4
|
|
230
|
+
}
|
|
231
|
+
}, /*#__PURE__*/React.createElement(SearchPanel, {
|
|
232
|
+
ref: selectRef,
|
|
190
233
|
value: searchValue,
|
|
191
234
|
onChange: onChange
|
|
192
|
-
}),
|
|
193
|
-
topRender: props.onClickWarn ? render : null
|
|
194
|
-
|
|
235
|
+
})),
|
|
236
|
+
topRender: props.onClickWarn ? render : null,
|
|
237
|
+
collapseRef: selectRef
|
|
238
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
239
|
+
spinning: pageLoading
|
|
240
|
+
}, /*#__PURE__*/React.createElement(TopContent, {
|
|
195
241
|
value: searchValue === null || searchValue === void 0 ? void 0 : searchValue.time,
|
|
196
242
|
type: currentType,
|
|
197
243
|
disabled: !result.length,
|
|
@@ -203,9 +249,9 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
203
249
|
onDownload: function onDownload() {
|
|
204
250
|
return _onDownload(searchValue, currentApp);
|
|
205
251
|
}
|
|
206
|
-
}), /*#__PURE__*/React.createElement(
|
|
207
|
-
|
|
208
|
-
}, pageType === 'list' ? /*#__PURE__*/React.createElement(PageContent, {
|
|
252
|
+
}), loading ? /*#__PURE__*/React.createElement("div", {
|
|
253
|
+
className: "".concat(classPrefix, "-content")
|
|
254
|
+
}, /*#__PURE__*/React.createElement(Spin, null)) : pageType === 'list' ? /*#__PURE__*/React.createElement(PageContent, {
|
|
209
255
|
type: currentType,
|
|
210
256
|
value: result,
|
|
211
257
|
groupId: searchValue === null || searchValue === void 0 ? void 0 : searchValue.pageGroup,
|
|
@@ -218,7 +264,7 @@ var ModulesPage = function ModulesPage(props) {
|
|
|
218
264
|
}) : /*#__PURE__*/React.createElement(DetailContent, {
|
|
219
265
|
params: searchValue,
|
|
220
266
|
result: result
|
|
221
|
-
})
|
|
267
|
+
}), showGroup ? /*#__PURE__*/React.createElement(GroupModal, {
|
|
222
268
|
value: editGroup,
|
|
223
269
|
onCancel: function onCancel() {
|
|
224
270
|
return setShowGroup(false);
|
|
@@ -5,9 +5,13 @@ export declare namespace ModulesPageTypes {
|
|
|
5
5
|
interface Props {
|
|
6
6
|
value?: Value;
|
|
7
7
|
onClickWarn?: () => void;
|
|
8
|
+
onChange?: (data: Value) => void;
|
|
8
9
|
}
|
|
9
10
|
interface Value extends SearchValue {
|
|
10
11
|
time?: DatePickerTypes.Value;
|
|
12
|
+
appId?: number | string;
|
|
13
|
+
platform?: number;
|
|
14
|
+
module?: string;
|
|
11
15
|
}
|
|
12
16
|
interface Page {
|
|
13
17
|
pageTitle?: string;
|
|
@@ -29,10 +33,14 @@ export declare namespace ModulesPageTypes {
|
|
|
29
33
|
param?: string;
|
|
30
34
|
id?: string;
|
|
31
35
|
}
|
|
36
|
+
interface Params {
|
|
37
|
+
appId?: number | string;
|
|
38
|
+
platform: number;
|
|
39
|
+
}
|
|
32
40
|
}
|
|
33
41
|
export declare const ModulesPageContext: import("react").Context<{
|
|
34
42
|
pageList: ModulesPageTypes.Page[];
|
|
35
43
|
pageGroupList: ModulesPageTypes.PageGroup[];
|
|
36
|
-
currentClickPage?: ModulesPageTypes.
|
|
44
|
+
currentClickPage?: ModulesPageTypes.Page | ModulesPageTypes.PageGroup | undefined;
|
|
37
45
|
setCurrentClickPage?: ((data: ModulesPageTypes.Page) => void) | undefined;
|
|
38
46
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModulesPageTypes } from './types';
|
|
2
2
|
import { AppInfoProps } from '@zgfe/business-lib/es/context';
|
|
3
|
-
export declare const getPageList: (data:
|
|
4
|
-
export declare const getPageGroupList: (data:
|
|
5
|
-
export declare const getPageResult: (params:
|
|
3
|
+
export declare const getPageList: (data: ModulesPageTypes.Params, callback: Function) => void;
|
|
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;
|
|
6
6
|
export declare const getSocketSecret: () => string;
|
|
7
7
|
export declare const onDownload: (params?: ModulesPageTypes.Value, currentApp?: AppInfoProps) => void;
|
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
import { ajax, util } from '@zgfe/business-lib';
|
|
7
|
+
import { ajax, util, base64 } from '@zgfe/business-lib';
|
|
8
8
|
import api from "../../constants/api";
|
|
9
9
|
// 获取页面列表
|
|
10
10
|
export var getPageList = function getPageList(data, callback) {
|
|
@@ -12,7 +12,7 @@ export var getPageList = function getPageList(data, callback) {
|
|
|
12
12
|
method: 'post',
|
|
13
13
|
data: data
|
|
14
14
|
}).then(function (res) {
|
|
15
|
-
if (!res) {
|
|
15
|
+
if (!res || !res.data) {
|
|
16
16
|
callback([{
|
|
17
17
|
id: '页面概览',
|
|
18
18
|
pageTitle: '页面概览',
|
|
@@ -36,12 +36,13 @@ export var getPageList = function getPageList(data, callback) {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
// 获取页面分组列表
|
|
39
|
-
export var getPageGroupList = function getPageGroupList(data, callback) {
|
|
39
|
+
export var getPageGroupList = function getPageGroupList(data, callback, loadingCallback) {
|
|
40
|
+
loadingCallback && loadingCallback(true);
|
|
40
41
|
ajax(api.getPageGroup, {
|
|
41
42
|
method: 'post',
|
|
42
43
|
data: data
|
|
43
44
|
}).then(function (res) {
|
|
44
|
-
if (!res) {
|
|
45
|
+
if (!res || !res.data) {
|
|
45
46
|
callback([{
|
|
46
47
|
id: 0,
|
|
47
48
|
name: '全部页面组'
|
|
@@ -54,6 +55,8 @@ export var getPageGroupList = function getPageGroupList(data, callback) {
|
|
|
54
55
|
name: '全部页面组'
|
|
55
56
|
});
|
|
56
57
|
callback(list);
|
|
58
|
+
}).finally(function () {
|
|
59
|
+
loadingCallback && loadingCallback(false);
|
|
57
60
|
});
|
|
58
61
|
};
|
|
59
62
|
|
|
@@ -64,8 +67,13 @@ export var getPageResult = function getPageResult(params, callback, loadingCallb
|
|
|
64
67
|
method: 'post',
|
|
65
68
|
data: params
|
|
66
69
|
}).then(function (res) {
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
var _res$data;
|
|
71
|
+
if (!res || !res.data) return;
|
|
72
|
+
callback((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
|
|
73
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
74
|
+
id: "".concat(item.userGroup, "-").concat(item.pageTitle, "-").concat(item.pageUrl)
|
|
75
|
+
});
|
|
76
|
+
}));
|
|
69
77
|
}).finally(function () {
|
|
70
78
|
loadingCallback(false);
|
|
71
79
|
});
|
|
@@ -80,14 +88,21 @@ export var getSocketSecret = function getSocketSecret() {
|
|
|
80
88
|
};
|
|
81
89
|
export var onDownload = function onDownload(params, currentApp) {
|
|
82
90
|
if (!params || !currentApp) return;
|
|
91
|
+
var title = params.pageTitle || '页面列表';
|
|
83
92
|
ajax(api.download, {
|
|
84
93
|
method: 'post',
|
|
85
|
-
data: _objectSpread({
|
|
94
|
+
data: _objectSpread(_objectSpread({
|
|
86
95
|
appId: currentApp.appId,
|
|
87
|
-
platform:
|
|
88
|
-
|
|
96
|
+
platform: 3,
|
|
97
|
+
module: 'page'
|
|
98
|
+
}, params), {}, {
|
|
99
|
+
down: {
|
|
100
|
+
fname: base64.encode(title, false),
|
|
101
|
+
titles: []
|
|
102
|
+
}
|
|
103
|
+
}),
|
|
89
104
|
responseType: 'blob',
|
|
90
|
-
fileName:
|
|
105
|
+
fileName: title,
|
|
91
106
|
getResponse: true
|
|
92
107
|
}).then(function () {});
|
|
93
108
|
};
|
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.21",
|
|
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.81-page.16",
|
|
43
43
|
"antd": "^4.22.6",
|
|
44
44
|
"dumi": "^1.1.0",
|
|
45
45
|
"father": "^4.0.0-rc.2",
|
|
@@ -49,5 +49,6 @@
|
|
|
49
49
|
"lodash": "^4.17.21",
|
|
50
50
|
"prettier": "^2.2.1",
|
|
51
51
|
"yorkie": "^2.0.0"
|
|
52
|
-
}
|
|
52
|
+
},
|
|
53
|
+
"gitHead": "292b16e7ca3558f9912b9b28a84bc9da0e46d37d"
|
|
53
54
|
}
|
|
Binary file
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default [{
|
|
2
|
-
label: 'file:///C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/webapps/test/test.html',
|
|
3
|
-
value: 'file:///C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/webapps/test/test.html'
|
|
4
|
-
}, {
|
|
5
|
-
label: 'file:///C:/Users/54451/Desktop/sign/signin.html',
|
|
6
|
-
value: 'file:///C:/Users/54451/Desktop/sign/signin.html'
|
|
7
|
-
}, {
|
|
8
|
-
label: 'http://localhost:8080/sign/signup.html',
|
|
9
|
-
value: 'http://localhost:8080/sign/signup.html'
|
|
10
|
-
}, {
|
|
11
|
-
label: 'http://www.yayibang.com/html/web/article/index.html',
|
|
12
|
-
value: 'http://www.yayibang.com/html/web/article/index.html'
|
|
13
|
-
}, {
|
|
14
|
-
label: 'http://localhost:8080/#/login',
|
|
15
|
-
value: 'http://localhost:8080/#/login'
|
|
16
|
-
}];
|