fast-vue-multi-pages 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +63 -0
- package/dist/cjs/FastVueMultiTool.d.ts +60 -0
- package/dist/cjs/FastVueMultiTool.js +65 -0
- package/dist/cjs/http/FastVueMultiCookie.d.ts +18 -0
- package/dist/cjs/http/FastVueMultiCookie.js +30 -0
- package/dist/cjs/http/FastVueMultiHttp.d.ts +225 -0
- package/dist/cjs/http/FastVueMultiHttp.js +572 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +5 -0
- package/dist/cjs/loader/FastTagBuilderLoader.d.ts +2 -0
- package/dist/cjs/loader/FastTagBuilderLoader.js +89 -0
- package/dist/cjs/other/FastVueMultiBoolean.d.ts +13 -0
- package/dist/cjs/other/FastVueMultiBoolean.js +56 -0
- package/dist/cjs/other/FastVueMultiClipboard.d.ts +21 -0
- package/dist/cjs/other/FastVueMultiClipboard.js +38 -0
- package/dist/cjs/other/FastVueMultiDate.d.ts +30 -0
- package/dist/cjs/other/FastVueMultiDate.js +166 -0
- package/dist/cjs/other/FastVueMultiElement.d.ts +46 -0
- package/dist/cjs/other/FastVueMultiElement.js +154 -0
- package/dist/cjs/other/FastVueMultiFunction.d.ts +19 -0
- package/dist/cjs/other/FastVueMultiFunction.js +68 -0
- package/dist/cjs/other/FastVueMultiStore.d.ts +13 -0
- package/dist/cjs/other/FastVueMultiStore.js +23 -0
- package/dist/cjs/other/FastVueMultiWindow.d.ts +21 -0
- package/dist/cjs/other/FastVueMultiWindow.js +53 -0
- package/dist/cjs/store/FastVueMultiStore.d.ts +13 -0
- package/dist/cjs/store/FastVueMultiStore.js +23 -0
- package/dist/cjs/vue/FastVueMultiConfig.d.ts +18 -0
- package/dist/cjs/vue/FastVueMultiConfig.js +43 -0
- package/dist/esm/FastVueMultiTool.d.ts +60 -0
- package/dist/esm/FastVueMultiTool.js +59 -0
- package/dist/esm/http/FastVueMultiCookie.d.ts +18 -0
- package/dist/esm/http/FastVueMultiCookie.js +34 -0
- package/dist/esm/http/FastVueMultiHttp.d.ts +225 -0
- package/dist/esm/http/FastVueMultiHttp.js +608 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/loader/FastTagBuilderLoader.d.ts +2 -0
- package/dist/esm/loader/FastTagBuilderLoader.js +89 -0
- package/dist/esm/other/FastVueMultiBoolean.d.ts +13 -0
- package/dist/esm/other/FastVueMultiBoolean.js +60 -0
- package/dist/esm/other/FastVueMultiClipboard.d.ts +21 -0
- package/dist/esm/other/FastVueMultiClipboard.js +56 -0
- package/dist/esm/other/FastVueMultiDate.d.ts +30 -0
- package/dist/esm/other/FastVueMultiDate.js +170 -0
- package/dist/esm/other/FastVueMultiElement.d.ts +46 -0
- package/dist/esm/other/FastVueMultiElement.js +158 -0
- package/dist/esm/other/FastVueMultiFunction.d.ts +19 -0
- package/dist/esm/other/FastVueMultiFunction.js +97 -0
- package/dist/esm/other/FastVueMultiStore.d.ts +13 -0
- package/dist/esm/other/FastVueMultiStore.js +27 -0
- package/dist/esm/other/FastVueMultiWindow.d.ts +21 -0
- package/dist/esm/other/FastVueMultiWindow.js +57 -0
- package/dist/esm/store/FastVueMultiStore.d.ts +13 -0
- package/dist/esm/store/FastVueMultiStore.js +27 -0
- package/dist/esm/vue/FastVueMultiConfig.d.ts +18 -0
- package/dist/esm/vue/FastVueMultiConfig.js +48 -0
- package/package.json +64 -0
- package/vue/FastBuildOption.d.ts +241 -0
- package/vue/FastBuildOption.js +249 -0
- package/vue/FastInjectJsPlugin.d.ts +11 -0
- package/vue/FastInjectJsPlugin.js +101 -0
- package/vue/FastPages.d.ts +25 -0
- package/vue/FastPages.js +173 -0
- package/vue/FastVueMultiConfig.d.ts +18 -0
- package/vue/FastVueMultiConfig.js +43 -0
- package/vue/FastVueMultiPages.d.ts +62 -0
- package/vue/FastVueMultiPages.js +294 -0
- package/vue/index.d.ts +2 -0
- package/vue/index.js +5 -0
@@ -0,0 +1,97 @@
|
|
1
|
+
define(["require", "exports", "tslib", "lodash", "./FastVueMultiBoolean"], function (require, exports, tslib_1, lodash_1, FastVueMultiBoolean_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.FastVueMultiFunction = void 0;
|
5
|
+
lodash_1 = tslib_1.__importDefault(lodash_1);
|
6
|
+
var FastVueMultiFunction = /** @class */ (function () {
|
7
|
+
function FastVueMultiFunction() {
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* 判断目标类型是否为函数
|
11
|
+
* @param source
|
12
|
+
*/
|
13
|
+
FastVueMultiFunction.isFunction = function (source) {
|
14
|
+
if (source == null) {
|
15
|
+
return false;
|
16
|
+
}
|
17
|
+
return !!source && typeof source === 'function';
|
18
|
+
};
|
19
|
+
/**
|
20
|
+
* 批量执行函数并获取返回值
|
21
|
+
* @param source 单个函数或函数数组
|
22
|
+
* @param params 执行函数携带的参数
|
23
|
+
*/
|
24
|
+
FastVueMultiFunction.run = function (source) {
|
25
|
+
var params = [];
|
26
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
27
|
+
params[_i - 1] = arguments[_i];
|
28
|
+
}
|
29
|
+
var result = [];
|
30
|
+
if (this.isFunction(source)) {
|
31
|
+
result.push(source.apply(this, params));
|
32
|
+
}
|
33
|
+
else if (lodash_1.default.isArray(source)) {
|
34
|
+
for (var i = 0; i < source.length; i++) {
|
35
|
+
result.push(source[i].apply(this, params));
|
36
|
+
}
|
37
|
+
}
|
38
|
+
else if (lodash_1.default.isString(source)) {
|
39
|
+
result.push(eval(source));
|
40
|
+
}
|
41
|
+
if (result.length == 1) {
|
42
|
+
return result[0];
|
43
|
+
}
|
44
|
+
else if (result.length > 1) {
|
45
|
+
return result;
|
46
|
+
}
|
47
|
+
return null;
|
48
|
+
};
|
49
|
+
/**
|
50
|
+
* 按顺序同步执行函数,当其中一个函数返回false时,则终止后续执行
|
51
|
+
* @param source 单个函数或函数数组
|
52
|
+
* @param params 执行函数携带的参数
|
53
|
+
*/
|
54
|
+
FastVueMultiFunction.syncRun = function (source) {
|
55
|
+
var params = [];
|
56
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
57
|
+
params[_i - 1] = arguments[_i];
|
58
|
+
}
|
59
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
60
|
+
var i, result;
|
61
|
+
return tslib_1.__generator(this, function (_a) {
|
62
|
+
switch (_a.label) {
|
63
|
+
case 0:
|
64
|
+
if (!lodash_1.default.isArray(source)) return [3 /*break*/, 5];
|
65
|
+
i = 0;
|
66
|
+
_a.label = 1;
|
67
|
+
case 1:
|
68
|
+
if (!(i < source.length)) return [3 /*break*/, 4];
|
69
|
+
if (!lodash_1.default.isFunction(source[i])) return [3 /*break*/, 3];
|
70
|
+
return [4 /*yield*/, source[i].apply(this, params)];
|
71
|
+
case 2:
|
72
|
+
result = _a.sent();
|
73
|
+
if (!FastVueMultiBoolean_1.FastVueMultiBoolean.parse(result, false)) {
|
74
|
+
return [2 /*return*/];
|
75
|
+
}
|
76
|
+
_a.label = 3;
|
77
|
+
case 3:
|
78
|
+
i++;
|
79
|
+
return [3 /*break*/, 1];
|
80
|
+
case 4: return [3 /*break*/, 6];
|
81
|
+
case 5:
|
82
|
+
if (this.isFunction(source)) {
|
83
|
+
source.apply(this, params);
|
84
|
+
}
|
85
|
+
else if (lodash_1.default.isString(source)) {
|
86
|
+
eval(source);
|
87
|
+
}
|
88
|
+
_a.label = 6;
|
89
|
+
case 6: return [2 /*return*/];
|
90
|
+
}
|
91
|
+
});
|
92
|
+
});
|
93
|
+
};
|
94
|
+
return FastVueMultiFunction;
|
95
|
+
}());
|
96
|
+
exports.FastVueMultiFunction = FastVueMultiFunction;
|
97
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
define(["require", "exports", "tslib", "store2"], function (require, exports, tslib_1, store2_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.FastVueMultiStore = void 0;
|
5
|
+
store2_1 = tslib_1.__importDefault(store2_1);
|
6
|
+
var FastVueMultiStore = /** @class */ (function () {
|
7
|
+
function FastVueMultiStore() {
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* 设置缓存的值
|
11
|
+
* @param key 键
|
12
|
+
* @param value 值
|
13
|
+
*/
|
14
|
+
FastVueMultiStore.setValue = function (key, value) {
|
15
|
+
store2_1.default.set(key, value, true);
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* 获取缓存的值
|
19
|
+
* @param key 键
|
20
|
+
*/
|
21
|
+
FastVueMultiStore.getValue = function (key) {
|
22
|
+
return store2_1.default.get(key);
|
23
|
+
};
|
24
|
+
return FastVueMultiStore;
|
25
|
+
}());
|
26
|
+
exports.FastVueMultiStore = FastVueMultiStore;
|
27
|
+
});
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export declare class FastVueMultiWindow {
|
2
|
+
/**
|
3
|
+
* 添加window的onLoad事件,如果存在onLoad函数名则进行合并
|
4
|
+
* @param callBack
|
5
|
+
*/
|
6
|
+
static addOnLoad(callBack: () => void): void;
|
7
|
+
/**
|
8
|
+
* 添加window的函数,如果存在相同的函数名则进行合并
|
9
|
+
* @param functionName 函数名
|
10
|
+
* @param functionBody 函数执行的代码
|
11
|
+
*/
|
12
|
+
static addFunction(functionName: string, functionBody: (params: any) => void): void;
|
13
|
+
/**
|
14
|
+
* 安全的获取窗口宽度,有的手机渲染后document.body.clientWidth 莫明会返回0
|
15
|
+
*/
|
16
|
+
static safeGetClientWidth(): number;
|
17
|
+
/**
|
18
|
+
* 安全的获取窗口高度,有的手机渲染后document.body.clientHeight 莫明会返回0
|
19
|
+
*/
|
20
|
+
static safeGetClientHeight(): number;
|
21
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
define(["require", "exports", "tslib", "lodash"], function (require, exports, tslib_1, lodash_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.FastVueMultiWindow = void 0;
|
5
|
+
lodash_1 = tslib_1.__importDefault(lodash_1);
|
6
|
+
var FastVueMultiWindow = /** @class */ (function () {
|
7
|
+
function FastVueMultiWindow() {
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* 添加window的onLoad事件,如果存在onLoad函数名则进行合并
|
11
|
+
* @param callBack
|
12
|
+
*/
|
13
|
+
FastVueMultiWindow.addOnLoad = function (callBack) {
|
14
|
+
var oldOnload = window.onload;
|
15
|
+
if (lodash_1.default.isFunction(oldOnload)) {
|
16
|
+
window.onload = function () {
|
17
|
+
oldOnload();
|
18
|
+
callBack();
|
19
|
+
};
|
20
|
+
}
|
21
|
+
else {
|
22
|
+
window.onload = callBack;
|
23
|
+
}
|
24
|
+
};
|
25
|
+
/**
|
26
|
+
* 添加window的函数,如果存在相同的函数名则进行合并
|
27
|
+
* @param functionName 函数名
|
28
|
+
* @param functionBody 函数执行的代码
|
29
|
+
*/
|
30
|
+
FastVueMultiWindow.addFunction = function (functionName, functionBody) {
|
31
|
+
var targetFunction = window[functionName];
|
32
|
+
if (lodash_1.default.isFunction(targetFunction)) {
|
33
|
+
window[functionName] = function () {
|
34
|
+
targetFunction.apply(this, arguments);
|
35
|
+
functionBody.apply(this, arguments);
|
36
|
+
};
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
window[functionName] = functionBody;
|
40
|
+
}
|
41
|
+
};
|
42
|
+
/**
|
43
|
+
* 安全的获取窗口宽度,有的手机渲染后document.body.clientWidth 莫明会返回0
|
44
|
+
*/
|
45
|
+
FastVueMultiWindow.safeGetClientWidth = function () {
|
46
|
+
return Math.max(document.documentElement.clientWidth, document.body.clientWidth);
|
47
|
+
};
|
48
|
+
/**
|
49
|
+
* 安全的获取窗口高度,有的手机渲染后document.body.clientHeight 莫明会返回0
|
50
|
+
*/
|
51
|
+
FastVueMultiWindow.safeGetClientHeight = function () {
|
52
|
+
return Math.max(document.documentElement.clientHeight, document.body.clientHeight);
|
53
|
+
};
|
54
|
+
return FastVueMultiWindow;
|
55
|
+
}());
|
56
|
+
exports.FastVueMultiWindow = FastVueMultiWindow;
|
57
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
define(["require", "exports", "tslib", "store2"], function (require, exports, tslib_1, store2_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.FastVueMultiStore = void 0;
|
5
|
+
store2_1 = tslib_1.__importDefault(store2_1);
|
6
|
+
var FastVueMultiStore = /** @class */ (function () {
|
7
|
+
function FastVueMultiStore() {
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* 设置缓存的值
|
11
|
+
* @param key 键
|
12
|
+
* @param value 值
|
13
|
+
*/
|
14
|
+
FastVueMultiStore.setValue = function (key, value) {
|
15
|
+
store2_1.default.set(key, value, true);
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* 获取缓存的值
|
19
|
+
* @param key 键
|
20
|
+
*/
|
21
|
+
FastVueMultiStore.getValue = function (key) {
|
22
|
+
return store2_1.default.get(key);
|
23
|
+
};
|
24
|
+
return FastVueMultiStore;
|
25
|
+
}());
|
26
|
+
exports.FastVueMultiStore = FastVueMultiStore;
|
27
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export declare class FastVueMultiConfig {
|
2
|
+
private static getGlobalConfigObj;
|
3
|
+
/**
|
4
|
+
* 获取系统全局变量值
|
5
|
+
*/
|
6
|
+
static getGlobalConfig(configKey: string): any;
|
7
|
+
/**
|
8
|
+
* 设置系统全局变量值
|
9
|
+
* @param configKey 变量名称
|
10
|
+
* @param configValue 变量值
|
11
|
+
*/
|
12
|
+
static setGlobalConfig(configKey: string, configValue: any): void;
|
13
|
+
/**
|
14
|
+
* 判断目标级别是否在项目配置的编译级别内
|
15
|
+
* @param targetLevel
|
16
|
+
*/
|
17
|
+
static isBuildLevel(targetLevel: number): boolean;
|
18
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.FastVueMultiConfig = void 0;
|
5
|
+
var FastVueMultiConfig = /** @class */ (function () {
|
6
|
+
function FastVueMultiConfig() {
|
7
|
+
}
|
8
|
+
FastVueMultiConfig.getGlobalConfigObj = function () {
|
9
|
+
// @ts-ignore
|
10
|
+
if (!window["__SystemGlobalConfig"]) {
|
11
|
+
//注意:此处变量 SystemGlobalConfig 在 webpack.DefinePlugin 编译后会替换成原始值,所以需要用window对象存储一下
|
12
|
+
// @ts-ignore
|
13
|
+
window["__SystemGlobalConfig"] = SystemGlobalConfig;
|
14
|
+
}
|
15
|
+
// @ts-ignore
|
16
|
+
return window["__SystemGlobalConfig"];
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* 获取系统全局变量值
|
20
|
+
*/
|
21
|
+
FastVueMultiConfig.getGlobalConfig = function (configKey) {
|
22
|
+
try {
|
23
|
+
return this.getGlobalConfigObj()[configKey];
|
24
|
+
}
|
25
|
+
catch (e) {
|
26
|
+
console.error("获取全局变量配置异常!", e);
|
27
|
+
return null;
|
28
|
+
}
|
29
|
+
};
|
30
|
+
/**
|
31
|
+
* 设置系统全局变量值
|
32
|
+
* @param configKey 变量名称
|
33
|
+
* @param configValue 变量值
|
34
|
+
*/
|
35
|
+
FastVueMultiConfig.setGlobalConfig = function (configKey, configValue) {
|
36
|
+
this.getGlobalConfigObj()[configKey] = configValue;
|
37
|
+
};
|
38
|
+
/**
|
39
|
+
* 判断目标级别是否在项目配置的编译级别内
|
40
|
+
* @param targetLevel
|
41
|
+
*/
|
42
|
+
FastVueMultiConfig.isBuildLevel = function (targetLevel) {
|
43
|
+
return BuildLevel >= targetLevel;
|
44
|
+
};
|
45
|
+
return FastVueMultiConfig;
|
46
|
+
}());
|
47
|
+
exports.FastVueMultiConfig = FastVueMultiConfig;
|
48
|
+
});
|
package/package.json
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
{
|
2
|
+
"name": "fast-vue-multi-pages",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"author": "janesen",
|
5
|
+
"description": "快速搭建VUE项目工具类的基本库,主要用于每个功能页面独立生成html",
|
6
|
+
"main": "./dist/cjs/index.js",
|
7
|
+
"module": "./dist/esm/index.js",
|
8
|
+
"scripts": {
|
9
|
+
"tsc": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && tsc -p ./src/vue/tsconfig-cjs.json",
|
10
|
+
"login": "npm login",
|
11
|
+
"buildLocal": "npm run tsc",
|
12
|
+
"push-fastchar-appjs": "npm run buildLocal && npm publish"
|
13
|
+
},
|
14
|
+
"keywords": [
|
15
|
+
"vue",
|
16
|
+
"multi",
|
17
|
+
"page"
|
18
|
+
],
|
19
|
+
"license": "ISC",
|
20
|
+
"dependencies": {
|
21
|
+
"axios": "^1.7.2",
|
22
|
+
"lodash": "^4.17.21",
|
23
|
+
"js-base64": "^3.7.7",
|
24
|
+
"md5": "^2.3.0",
|
25
|
+
"htmlparser2": "^9.1.0",
|
26
|
+
"vconsole-webpack-plugin": "^1.8.0",
|
27
|
+
"image-webpack-loader": "^8.1.0",
|
28
|
+
"uuid": "^10.0.0",
|
29
|
+
"store2": "^2.14.3",
|
30
|
+
"moment": "^2.30.1",
|
31
|
+
"@types/js-cookie": "^3.0.6",
|
32
|
+
"clipboard-polyfill": "^4.1.0",
|
33
|
+
"@types/lodash": "^4.17.6"
|
34
|
+
},
|
35
|
+
"devDependencies": {
|
36
|
+
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
37
|
+
"@typescript-eslint/parser": "^7.16.0",
|
38
|
+
"ts-loader": "^9.5.1",
|
39
|
+
"typescript": "^5.5.3",
|
40
|
+
"webpack": "^5.92.1",
|
41
|
+
"webpack-cli": "^5.1.4"
|
42
|
+
},
|
43
|
+
"files": [
|
44
|
+
"dist/cjs",
|
45
|
+
"dist/esm",
|
46
|
+
"vue"
|
47
|
+
],
|
48
|
+
"eslintConfig": {
|
49
|
+
"root": true,
|
50
|
+
"env": {
|
51
|
+
"node": true
|
52
|
+
},
|
53
|
+
"extends": [
|
54
|
+
"eslint:recommended"
|
55
|
+
],
|
56
|
+
"parserOptions": {
|
57
|
+
"parser": "@typescript-eslint/parser"
|
58
|
+
},
|
59
|
+
"rules": {}
|
60
|
+
},
|
61
|
+
"publishConfig": {
|
62
|
+
"registry": "https://registry.npmjs.org/"
|
63
|
+
}
|
64
|
+
}
|
@@ -0,0 +1,241 @@
|
|
1
|
+
/**
|
2
|
+
* 获取编译配置的选项配置,配置选项如下:
|
3
|
+
* <br/>
|
4
|
+
* {@link projectTitle } 项目名称
|
5
|
+
* <br/>
|
6
|
+
* {@link projectPagesDir } 项目存储页面的目录地址 默认:src/pages
|
7
|
+
* <br/>
|
8
|
+
* {@link projectOutDir } 项目默认编译输出地址 默认:dist
|
9
|
+
* <br/>
|
10
|
+
* {@link projectAssetsDir } 项目资源路径,默认:assets
|
11
|
+
* <br/>
|
12
|
+
* {@link pageTemplateFileDir } 页面的入口文件模板地址,默认:public/index.html
|
13
|
+
* <br/>
|
14
|
+
* {@link pageMainFileName }页面目录下的入口文件名,默认:index.js
|
15
|
+
* <br/>
|
16
|
+
* {@link pageConfigHtmlNamePrefix }页面生成html文件时文件命名携带的前缀
|
17
|
+
* <br/>
|
18
|
+
* {@link pageConfigFileName } 页面目录下的配置文件名,默认:config.json
|
19
|
+
* <br/>
|
20
|
+
* {@link autoCreatePageConfigFile } 是否在每个页面目录下自动创建config.json文件
|
21
|
+
* <br/>
|
22
|
+
* {@link autoCreateProjectIndexPage } 是否自动创建项目的index页面
|
23
|
+
* <br/>
|
24
|
+
* {@link nodeModulesDir } 第三方插件存放目录文件夹,默认:node_modules
|
25
|
+
* <br/>
|
26
|
+
* {@link globalConfig } 系统的全局配置
|
27
|
+
* <br/>
|
28
|
+
* {@link httpFinalParams } FastVueMultiTool.Http请求接口全局请求参数。
|
29
|
+
* <br/>
|
30
|
+
* {@link httpFinalHeaders } FastVueMultiTool.Http请求接口全局请求头参数。
|
31
|
+
* <br/>
|
32
|
+
* {@link httpBeforeRequest } FastVueMultiTool.Http请求前的拦截。
|
33
|
+
* <br/>
|
34
|
+
* {@link httpAfterRequest } FastVueMultiTool.Http请求后的拦截。
|
35
|
+
* <br/>
|
36
|
+
* {@link injectJsFiles } 所有页面全局注入的js文件
|
37
|
+
* <br/>
|
38
|
+
* {@link injectJsFilter } 所有页面全局注入js文件过滤器
|
39
|
+
* <br/>
|
40
|
+
* {@link injectVariable } 所有页面全局注入js变量
|
41
|
+
* <br/>
|
42
|
+
* {@link cacheVueLoader } 是否使用vue默认的cache-loader,默认使用
|
43
|
+
* <br/>
|
44
|
+
* {@link vConsole } 开启vConsole插件的方式,默认:auto。可选值:auto(自动根据编辑的类型追加,server模式或debug模式开启),true(强制开启),false(不开启)
|
45
|
+
* <br/>
|
46
|
+
* {@link splitChunks } 将公共js代码,进行分割,默认:true
|
47
|
+
* <br/>
|
48
|
+
* {@link buildLevel} 项目编译级别,与 标签 build-level 对应
|
49
|
+
* <br/>
|
50
|
+
* {@link buildLevelTagName} 项目编译级别标签名,默认: build-level
|
51
|
+
* <br/>
|
52
|
+
* {@link chainWebpack} 配置Webpack函数function (config){};
|
53
|
+
* <br/>
|
54
|
+
* {@link configureWebpack} 配置Webpack函数function (config){};
|
55
|
+
*/
|
56
|
+
export declare class FastBuildOption {
|
57
|
+
/**
|
58
|
+
* 合并options
|
59
|
+
* @param options
|
60
|
+
*/
|
61
|
+
static merge(...options: FastBuildOption[]): FastBuildOption;
|
62
|
+
/**
|
63
|
+
* 项目名称
|
64
|
+
*/
|
65
|
+
projectTitle: string;
|
66
|
+
/**
|
67
|
+
* 项目存储页面的目录地址,默认src/pages 或者数组:["默认src/pages","默认src/pages2"]
|
68
|
+
*/
|
69
|
+
projectPagesDir: any;
|
70
|
+
/**
|
71
|
+
* 项目编译输出地址,默认:dist
|
72
|
+
*/
|
73
|
+
projectOutDir: string;
|
74
|
+
/**
|
75
|
+
* 项目资源路径,默认:assets
|
76
|
+
*/
|
77
|
+
projectAssetsDir: string;
|
78
|
+
/**
|
79
|
+
* 页面的入口文件模板地址,默认:public/index.html
|
80
|
+
*/
|
81
|
+
pageTemplateFileDir: string;
|
82
|
+
/**
|
83
|
+
* 页面目录下的入口文件名,默认:index.js
|
84
|
+
*/
|
85
|
+
pageMainFileName: string;
|
86
|
+
/**
|
87
|
+
* 页面目录下的配置文件名,默认:config.json
|
88
|
+
*/
|
89
|
+
pageConfigFileName: string;
|
90
|
+
/**
|
91
|
+
* 页面目录下的渲染模板html,如果存在则以这个模板进行渲染,默认:index.html
|
92
|
+
*/
|
93
|
+
pageMainTemplateFileName: string;
|
94
|
+
/**
|
95
|
+
* 页面生成html文件时文件命名携带的前缀
|
96
|
+
*/
|
97
|
+
pageConfigHtmlNamePrefix: string;
|
98
|
+
/**
|
99
|
+
* 是否在每个页面目录下自动创建config.json文件
|
100
|
+
*/
|
101
|
+
autoCreatePageConfigFile: boolean;
|
102
|
+
/**
|
103
|
+
* 是否自动创建项目的index页面
|
104
|
+
*/
|
105
|
+
autoCreateProjectIndexPage: boolean;
|
106
|
+
/**
|
107
|
+
* 第三方插件存放目录文件夹,默认:node_modules
|
108
|
+
*/
|
109
|
+
nodeModulesDir: string;
|
110
|
+
/**
|
111
|
+
* vue挂载的目标节点选择器
|
112
|
+
*/
|
113
|
+
mountSelector: string;
|
114
|
+
/**
|
115
|
+
* 系统的全局配置,
|
116
|
+
* @example
|
117
|
+
* globalConfig:{
|
118
|
+
* mainUrl:"http://192.168.0.1:8080/test"
|
119
|
+
* }
|
120
|
+
* 可通过 :FastBaseApp.Config.getGlobalConfig("mainUrl") 在任意js中获取配置
|
121
|
+
*/
|
122
|
+
globalConfig: object | undefined;
|
123
|
+
/**
|
124
|
+
* FastVueMultiTool.Http请求接口全局请求参数.
|
125
|
+
* @example
|
126
|
+
* httpFinalParams:{
|
127
|
+
* userId:2,
|
128
|
+
* userName:undefined //当配置undefined值时,将排除此参数属性名
|
129
|
+
* }
|
130
|
+
*/
|
131
|
+
httpFinalParams: any | undefined;
|
132
|
+
/**
|
133
|
+
* FastVueMultiTool.Http请求接口全局请求头参数.
|
134
|
+
* @example
|
135
|
+
* httpFinalHeaders:{
|
136
|
+
* userId:2,
|
137
|
+
* userName:undefined //当配置undefined值时,将排除此参数属性名
|
138
|
+
* }
|
139
|
+
*/
|
140
|
+
httpFinalHeaders: any | undefined;
|
141
|
+
/**
|
142
|
+
* FastVueMultiTool.Http请求前的拦截
|
143
|
+
* @example
|
144
|
+
* httpBeforeRequest:function(config){
|
145
|
+
* //do something
|
146
|
+
* }
|
147
|
+
*/
|
148
|
+
httpBeforeRequest: any | undefined;
|
149
|
+
/**
|
150
|
+
* FastVueMultiTool.Http请求后的拦截
|
151
|
+
* @example
|
152
|
+
* httpAfterRequest:function(response){
|
153
|
+
* //do something
|
154
|
+
* }
|
155
|
+
*/
|
156
|
+
httpAfterRequest: any | undefined;
|
157
|
+
/**
|
158
|
+
* 所有页面全局注入的js文件
|
159
|
+
* @example
|
160
|
+
* injectJsFiles:["src/js/test.js","src/js/icon.js"]
|
161
|
+
* 或
|
162
|
+
* injectJsFiles:{
|
163
|
+
* "src/js/test.js":{
|
164
|
+
* exclude:["user","set"] //排除注入页面的名称,例如:user.html,set.html
|
165
|
+
* },
|
166
|
+
* "src/js/icon.js":{
|
167
|
+
* include:["user","set"] //指定注入页面的名称,例如:user.html,set.html
|
168
|
+
* }
|
169
|
+
* }
|
170
|
+
* 或
|
171
|
+
* injectJsFiles:[
|
172
|
+
* "src/js/test.js",
|
173
|
+
* {
|
174
|
+
* "src/js/icon.js":{
|
175
|
+
* exclude:["user","set"] //排除注入页面的名称,例如:user.html,set.html
|
176
|
+
* }
|
177
|
+
* }
|
178
|
+
* ]
|
179
|
+
*/
|
180
|
+
injectJsFiles: string[] | object | undefined;
|
181
|
+
/**
|
182
|
+
* 所有页面全局注入js文件过滤器,当 {@link injectJsFiles} 为数组时生效!
|
183
|
+
* @example
|
184
|
+
* injectJsFilter:{
|
185
|
+
* include:["user","set"] //指定注入页面的名称,例如:user.html,set.html
|
186
|
+
* }
|
187
|
+
* 或
|
188
|
+
* injectJsFilter:{
|
189
|
+
* exclude:["user","set"] //排除注入页面的名称,例如:user.html,set.html
|
190
|
+
* }
|
191
|
+
*/
|
192
|
+
injectJsFilter: {
|
193
|
+
/**
|
194
|
+
* 包含指定的页面,例如:user.html,set.html 则传入["user","set"]
|
195
|
+
*/
|
196
|
+
include?: string[];
|
197
|
+
/**
|
198
|
+
* 排除指定页面,例如:user.html,set.html 则传入["user","set"]
|
199
|
+
*/
|
200
|
+
exclude?: string[];
|
201
|
+
} | undefined;
|
202
|
+
/**
|
203
|
+
* 所有页面全局js变量注入
|
204
|
+
* @example
|
205
|
+
* injectVariable:{
|
206
|
+
* getUserId:function(){
|
207
|
+
* return 1;
|
208
|
+
* },
|
209
|
+
* server:"……"
|
210
|
+
* }
|
211
|
+
*/
|
212
|
+
injectVariable: any | undefined;
|
213
|
+
/**
|
214
|
+
* 是否使用vue默认的cache-loader缓存vue-loader,如果不使用,则在build版本前将删除缓存的目录.cache/vue-loader
|
215
|
+
*/
|
216
|
+
cacheVueLoader: boolean;
|
217
|
+
/**
|
218
|
+
* 开启vConsole插件的方式,默认:auto。可选值:auto(自动根据编辑的类型追加,server模式或debug模式开启),true(强制开启),false(不开启)
|
219
|
+
*/
|
220
|
+
vConsole: string;
|
221
|
+
/**
|
222
|
+
* 将公共js代码,进行分割,默认:true
|
223
|
+
*/
|
224
|
+
splitChunks: boolean;
|
225
|
+
/**
|
226
|
+
* 项目编译级别,与 标签 build-level 对应
|
227
|
+
*/
|
228
|
+
buildLevel: number;
|
229
|
+
/**
|
230
|
+
* 编译级别的标签名,默认 build-level
|
231
|
+
*/
|
232
|
+
buildLevelTagName: string;
|
233
|
+
/**
|
234
|
+
* 插入Webpack函数function (config){};
|
235
|
+
*/
|
236
|
+
chainWebpack: ((config: any) => void);
|
237
|
+
/**
|
238
|
+
* 配置Webpack函数function (config){};
|
239
|
+
*/
|
240
|
+
configureWebpack: ((config: any) => void);
|
241
|
+
}
|