@zgfe/modules-page 1.0.1-alpha.0 → 1.0.1-alpha.10

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.
Files changed (31) hide show
  1. package/dist/esm/components/content/index.d.ts +1 -1
  2. package/dist/esm/components/content/index.js +1 -0
  3. package/dist/esm/components/content/utils.d.ts +4 -15
  4. package/dist/esm/components/content/utils.js +10 -11
  5. package/dist/esm/components/detail/index.js +33 -54
  6. package/dist/esm/components/groupModal/index.d.ts +2 -6
  7. package/dist/esm/components/groupModal/index.js +40 -34
  8. package/dist/esm/components/groupModal/index.less +17 -0
  9. package/dist/esm/components/groupModal/inputSelect.d.ts +9 -0
  10. package/dist/esm/components/groupModal/inputSelect.js +67 -0
  11. package/dist/esm/components/groupModal/pageItem.js +47 -58
  12. package/dist/esm/components/groupModal/types.d.ts +2 -2
  13. package/dist/esm/components/groupModal/utils.js +9 -12
  14. package/dist/esm/components/pageSelect/index.js +27 -4
  15. package/dist/esm/components/pageSelect/types.d.ts +0 -2
  16. package/dist/esm/components/searchPanel/index.js +2 -1
  17. package/dist/esm/components/searchPanel/index.less +3 -5
  18. package/dist/esm/components/searchPanel/util.d.ts +3 -11
  19. package/dist/esm/components/searchPanel/util.js +7 -11
  20. package/dist/esm/constants/api.js +1 -1
  21. package/dist/esm/modules/empty/index.less +11 -11
  22. package/dist/esm/modules/home/base64.d.ts +23 -0
  23. package/dist/esm/modules/home/base64.js +132 -0
  24. package/dist/esm/modules/home/demo/index.js +1 -1
  25. package/dist/esm/modules/home/index.js +31 -23
  26. package/dist/esm/modules/home/types.d.ts +5 -1
  27. package/dist/esm/modules/home/utils.d.ts +3 -3
  28. package/dist/esm/modules/home/utils.js +31 -7
  29. package/package.json +4 -3
  30. package/dist/esm/components/groupModal/mock.d.ts +0 -5
  31. package/dist/esm/components/groupModal/mock.js +0 -16
@@ -58,25 +58,29 @@ var ModulesPage = function ModulesPage(props) {
58
58
  _useState14 = _slicedToArray(_useState13, 2),
59
59
  loading = _useState14[0],
60
60
  setLoading = _useState14[1];
61
- // 要编辑的分组
62
- var _useState15 = useState(),
61
+ var _useState15 = useState(true),
63
62
  _useState16 = _slicedToArray(_useState15, 2),
64
- editGroup = _useState16[0],
65
- setEditGroup = _useState16[1];
66
- // 当前页面类型 list/detail
67
- var _useState17 = useState('list'),
63
+ pageLoading = _useState16[0],
64
+ setPageLoading = _useState16[1];
65
+ // 要编辑的分组
66
+ var _useState17 = useState(),
68
67
  _useState18 = _slicedToArray(_useState17, 2),
69
- pageType = _useState18[0],
70
- setPageType = _useState18[1];
71
- var _useState19 = useState(0),
68
+ editGroup = _useState18[0],
69
+ setEditGroup = _useState18[1];
70
+ // 当前页面类型 list/detail
71
+ var _useState19 = useState('list'),
72
72
  _useState20 = _slicedToArray(_useState19, 2),
73
- timer = _useState20[0],
74
- setTimer = _useState20[1];
75
- //当前点击内容(用于同步查询条件中的内容)
76
- var _useState21 = useState(),
73
+ pageType = _useState20[0],
74
+ setPageType = _useState20[1];
75
+ var _useState21 = useState(0),
77
76
  _useState22 = _slicedToArray(_useState21, 2),
78
- currentClickPage = _useState22[0],
79
- setCurrentClickPage = _useState22[1];
77
+ timer = _useState22[0],
78
+ setTimer = _useState22[1];
79
+ //当前点击内容(用于同步查询条件中的内容)
80
+ var _useState23 = useState(),
81
+ _useState24 = _slicedToArray(_useState23, 2),
82
+ currentClickPage = _useState24[0],
83
+ setCurrentClickPage = _useState24[1];
80
84
  var _useContext = useContext(BizGlobalDataContext),
81
85
  eventGroupList = _useContext.eventGroupList,
82
86
  currentApp = _useContext.currentApp;
@@ -93,13 +97,12 @@ var ModulesPage = function ModulesPage(props) {
93
97
  return flag;
94
98
  }, [eventGroupList]);
95
99
  useEffect(function () {
96
- if (isEmpty) return;
97
100
  var param = {
98
101
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
99
- platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0
102
+ platform: 3
100
103
  };
101
- getPageGroupList(param, setPageGroupList);
102
104
  getPageList(param, setPageList);
105
+ getPageGroupList(param, setPageGroupList, setPageLoading);
103
106
  }, []);
104
107
  useEffect(function () {
105
108
  if (!showGroup) {
@@ -110,12 +113,13 @@ var ModulesPage = function ModulesPage(props) {
110
113
  if (isEmpty) return;
111
114
  if (!searchValue) return;
112
115
  console.log('searchValue:', searchValue);
113
- var type = (searchValue === null || searchValue === void 0 ? void 0 : searchValue.type) || (searchValue !== null && searchValue !== void 0 && searchValue.pageGroup ? 'pageGroup' : 'page');
116
+ var type = searchValue !== null && searchValue !== void 0 && searchValue.pageGroup || (searchValue === null || searchValue === void 0 ? void 0 : searchValue.pageGroup) === 0 ? 'pageGroup' : 'page';
114
117
  setCurrentType(type);
115
118
  // 选择概览时,跳到列表页
116
119
  if (type === 'page' && !(searchValue !== null && searchValue !== void 0 && searchValue.pageUrl) || type === 'pageGroup' && !(searchValue !== null && searchValue !== void 0 && searchValue.pageGroup)) {
117
120
  setPageType('list');
118
121
  }
122
+ if (type === 'pageGroup' && !(searchValue !== null && searchValue !== void 0 && searchValue.pageGroup)) return;
119
123
  if (type === 'page' || pageType === 'detail') {
120
124
  fetch();
121
125
  }
@@ -129,7 +133,8 @@ var ModulesPage = function ModulesPage(props) {
129
133
  setTimer(setTimeout(function () {
130
134
  var param = _objectSpread({
131
135
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
132
- platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0
136
+ platform: 3,
137
+ modules: 'page'
133
138
  }, searchValue);
134
139
  getPageResult(param, setResult, setLoading);
135
140
  }, 500));
@@ -151,11 +156,12 @@ var ModulesPage = function ModulesPage(props) {
151
156
  };
152
157
  // 分组弹窗编辑回调,更新分组列表
153
158
  var onOk = function onOk() {
159
+ setShowGroup(false);
154
160
  var param = {
155
161
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
156
- platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0
162
+ platform: 3
157
163
  };
158
- getPageGroupList(param, setPageGroupList);
164
+ getPageGroupList(param, setPageGroupList, setPageLoading);
159
165
  };
160
166
 
161
167
  // 点击表格中页面
@@ -192,7 +198,9 @@ var ModulesPage = function ModulesPage(props) {
192
198
  onChange: onChange
193
199
  }),
194
200
  topRender: props.onClickWarn ? render : null
195
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TopContent, {
201
+ }, /*#__PURE__*/React.createElement(Spin, {
202
+ spinning: pageLoading
203
+ }, /*#__PURE__*/React.createElement(TopContent, {
196
204
  value: searchValue === null || searchValue === void 0 ? void 0 : searchValue.time,
197
205
  type: currentType,
198
206
  disabled: !result.length,
@@ -29,10 +29,14 @@ export declare namespace ModulesPageTypes {
29
29
  param?: string;
30
30
  id?: string;
31
31
  }
32
+ interface Params {
33
+ appId?: number | string;
34
+ platform: number;
35
+ }
32
36
  }
33
37
  export declare const ModulesPageContext: import("react").Context<{
34
38
  pageList: ModulesPageTypes.Page[];
35
39
  pageGroupList: ModulesPageTypes.PageGroup[];
36
- currentClickPage?: ModulesPageTypes.PageGroup | ModulesPageTypes.Page | undefined;
40
+ currentClickPage?: ModulesPageTypes.Page | ModulesPageTypes.PageGroup | undefined;
37
41
  setCurrentClickPage?: ((data: ModulesPageTypes.Page) => void) | undefined;
38
42
  }>;
@@ -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: any, callback: Function) => void;
4
- export declare const getPageGroupList: (data: any, callback: Function) => void;
5
- export declare const getPageResult: (params: any, callback: Function, loadingCallback: Function) => void;
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.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;
@@ -6,13 +6,22 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
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
7
  import { ajax, util } from '@zgfe/business-lib';
8
8
  import api from "../../constants/api";
9
+ import base64 from "./base64";
10
+
9
11
  // 获取页面列表
10
12
  export var getPageList = function getPageList(data, callback) {
11
13
  ajax(api.getPageList, {
12
14
  method: 'post',
13
15
  data: data
14
16
  }).then(function (res) {
15
- if (!res) return;
17
+ if (!res) {
18
+ callback([{
19
+ id: '页面概览',
20
+ pageTitle: '页面概览',
21
+ pageUrl: ''
22
+ }]);
23
+ return;
24
+ }
16
25
  var list = res.data;
17
26
  list.unshift({
18
27
  pageTitle: '页面概览',
@@ -29,18 +38,27 @@ export var getPageList = function getPageList(data, callback) {
29
38
  };
30
39
 
31
40
  // 获取页面分组列表
32
- export var getPageGroupList = function getPageGroupList(data, callback) {
41
+ export var getPageGroupList = function getPageGroupList(data, callback, loadingCallback) {
42
+ loadingCallback && loadingCallback(true);
33
43
  ajax(api.getPageGroup, {
34
44
  method: 'post',
35
45
  data: data
36
46
  }).then(function (res) {
37
- if (!res) return;
47
+ if (!res) {
48
+ callback([{
49
+ id: 0,
50
+ name: '全部页面组'
51
+ }]);
52
+ return;
53
+ }
38
54
  var list = res.data;
39
55
  list.unshift({
40
56
  id: 0,
41
57
  name: '全部页面组'
42
58
  });
43
59
  callback(list);
60
+ }).finally(function () {
61
+ loadingCallback && loadingCallback(false);
44
62
  });
45
63
  };
46
64
 
@@ -67,14 +85,20 @@ export var getSocketSecret = function getSocketSecret() {
67
85
  };
68
86
  export var onDownload = function onDownload(params, currentApp) {
69
87
  if (!params || !currentApp) return;
88
+ var title = params.pageTitle || '页面列表';
70
89
  ajax(api.download, {
71
90
  method: 'post',
72
- data: _objectSpread({
91
+ data: _objectSpread(_objectSpread({
73
92
  appId: currentApp.appId,
74
- platform: currentApp.platform
75
- }, params),
93
+ platform: 3
94
+ }, params), {}, {
95
+ down: {
96
+ fname: base64.encode(title),
97
+ titles: []
98
+ }
99
+ }),
76
100
  responseType: 'blob',
77
- fileName: '页面列表',
101
+ fileName: title,
78
102
  getResponse: true
79
103
  }).then(function () {});
80
104
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-page",
3
- "version": "1.0.1-alpha.0",
3
+ "version": "1.0.1-alpha.10",
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.76-page.0",
42
+ "@zgfe/business-lib": "1.1.80-page.0",
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": "fdd9e45dec51d4d415d507454d257171fa2b1a5c"
53
54
  }
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- label: string;
3
- value: string;
4
- }[];
5
- export default _default;
@@ -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
- }];