@zgfe/modules-page 1.0.1-alpha.1 → 1.0.1-alpha.11
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 +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/index.js +34 -55
- package/dist/esm/components/detail/index.less +1 -0
- package/dist/esm/components/groupModal/index.d.ts +2 -6
- package/dist/esm/components/groupModal/index.js +28 -24
- package/dist/esm/components/groupModal/index.less +17 -0
- package/dist/esm/components/groupModal/inputSelect.d.ts +9 -0
- package/dist/esm/components/groupModal/inputSelect.js +67 -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 +26 -3
- package/dist/esm/components/pageSelect/types.d.ts +0 -2
- package/dist/esm/components/searchPanel/index.js +2 -1
- package/dist/esm/components/searchPanel/index.less +3 -5
- package/dist/esm/components/searchPanel/util.d.ts +3 -11
- package/dist/esm/components/searchPanel/util.js +7 -11
- package/dist/esm/constants/api.js +1 -1
- package/dist/esm/modules/home/base64.d.ts +23 -0
- package/dist/esm/modules/home/base64.js +132 -0
- package/dist/esm/modules/home/demo/index.js +1 -1
- package/dist/esm/modules/home/index.js +31 -22
- package/dist/esm/modules/home/types.d.ts +4 -0
- package/dist/esm/modules/home/utils.d.ts +3 -3
- package/dist/esm/modules/home/utils.js +20 -8
- package/package.json +3 -3
- package/dist/esm/components/groupModal/mock.d.ts +0 -5
- package/dist/esm/components/groupModal/mock.js +0 -16
|
@@ -29,6 +29,10 @@ 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[];
|
|
@@ -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.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,15 @@ 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) {
|
|
17
|
+
if (!res || !res.data) {
|
|
16
18
|
callback([{
|
|
17
19
|
id: '页面概览',
|
|
18
20
|
pageTitle: '页面概览',
|
|
@@ -36,12 +38,13 @@ export var getPageList = function getPageList(data, callback) {
|
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
// 获取页面分组列表
|
|
39
|
-
export var getPageGroupList = function getPageGroupList(data, callback) {
|
|
41
|
+
export var getPageGroupList = function getPageGroupList(data, callback, loadingCallback) {
|
|
42
|
+
loadingCallback && loadingCallback(true);
|
|
40
43
|
ajax(api.getPageGroup, {
|
|
41
44
|
method: 'post',
|
|
42
45
|
data: data
|
|
43
46
|
}).then(function (res) {
|
|
44
|
-
if (!res) {
|
|
47
|
+
if (!res || !res.data) {
|
|
45
48
|
callback([{
|
|
46
49
|
id: 0,
|
|
47
50
|
name: '全部页面组'
|
|
@@ -54,6 +57,8 @@ export var getPageGroupList = function getPageGroupList(data, callback) {
|
|
|
54
57
|
name: '全部页面组'
|
|
55
58
|
});
|
|
56
59
|
callback(list);
|
|
60
|
+
}).finally(function () {
|
|
61
|
+
loadingCallback && loadingCallback(false);
|
|
57
62
|
});
|
|
58
63
|
};
|
|
59
64
|
|
|
@@ -64,7 +69,7 @@ export var getPageResult = function getPageResult(params, callback, loadingCallb
|
|
|
64
69
|
method: 'post',
|
|
65
70
|
data: params
|
|
66
71
|
}).then(function (res) {
|
|
67
|
-
if (!res) return;
|
|
72
|
+
if (!res || !res.data) return;
|
|
68
73
|
callback(res.data);
|
|
69
74
|
}).finally(function () {
|
|
70
75
|
loadingCallback(false);
|
|
@@ -80,14 +85,21 @@ export var getSocketSecret = function getSocketSecret() {
|
|
|
80
85
|
};
|
|
81
86
|
export var onDownload = function onDownload(params, currentApp) {
|
|
82
87
|
if (!params || !currentApp) return;
|
|
88
|
+
var title = params.pageTitle || '页面列表';
|
|
83
89
|
ajax(api.download, {
|
|
84
90
|
method: 'post',
|
|
85
|
-
data: _objectSpread({
|
|
91
|
+
data: _objectSpread(_objectSpread({
|
|
86
92
|
appId: currentApp.appId,
|
|
87
|
-
platform:
|
|
88
|
-
|
|
93
|
+
platform: 3,
|
|
94
|
+
modules: 'page'
|
|
95
|
+
}, params), {}, {
|
|
96
|
+
down: {
|
|
97
|
+
fname: base64.encode(title),
|
|
98
|
+
titles: []
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
89
101
|
responseType: 'blob',
|
|
90
|
-
fileName:
|
|
102
|
+
fileName: title,
|
|
91
103
|
getResponse: true
|
|
92
104
|
}).then(function () {});
|
|
93
105
|
};
|
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.11",
|
|
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.80-page.0",
|
|
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": "cbcc8106b272e3b033d7b63e9ad5f699f7ff7d7f"
|
|
54
54
|
}
|
|
@@ -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
|
-
}];
|