fast-vue-multi-pages-vite 1.0.0
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/README.md +63 -0
- package/component/fast-layout-body.vue +100 -0
- package/component/fast-layout-fullscreen.vue +32 -0
- package/component/fast-panel-collapse.vue +108 -0
- package/dist/cjs/FastVueMultiTool.d.ts +107 -0
- package/dist/cjs/FastVueMultiTool.js +112 -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 +128 -0
- package/dist/cjs/http/FastVueMultiHttp.js +426 -0
- package/dist/cjs/http/FastVueMultiSimpleJsonResponse.d.ts +67 -0
- package/dist/cjs/http/FastVueMultiSimpleJsonResponse.js +126 -0
- package/dist/cjs/http/FastVueMultiSimpleRequestConfig.d.ts +21 -0
- package/dist/cjs/http/FastVueMultiSimpleRequestConfig.js +25 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +11 -0
- package/dist/cjs/loader/index.d.ts +2 -0
- package/dist/cjs/loader/index.js +89 -0
- package/dist/cjs/native/FastVueNative.d.ts +76 -0
- package/dist/cjs/native/FastVueNative.js +184 -0
- package/dist/cjs/other/FastVueMultiAnimate.d.ts +29 -0
- package/dist/cjs/other/FastVueMultiAnimate.js +80 -0
- package/dist/cjs/other/FastVueMultiBase64.d.ts +12 -0
- package/dist/cjs/other/FastVueMultiBase64.js +22 -0
- package/dist/cjs/other/FastVueMultiBoolean.d.ts +13 -0
- package/dist/cjs/other/FastVueMultiBoolean.js +57 -0
- package/dist/cjs/other/FastVueMultiClipboard.d.ts +7 -0
- package/dist/cjs/other/FastVueMultiClipboard.js +15 -0
- package/dist/cjs/other/FastVueMultiDate.d.ts +30 -0
- package/dist/cjs/other/FastVueMultiDate.js +168 -0
- package/dist/cjs/other/FastVueMultiElement.d.ts +52 -0
- package/dist/cjs/other/FastVueMultiElement.js +173 -0
- package/dist/cjs/other/FastVueMultiEventBus.d.ts +23 -0
- package/dist/cjs/other/FastVueMultiEventBus.js +115 -0
- package/dist/cjs/other/FastVueMultiFile.d.ts +18 -0
- package/dist/cjs/other/FastVueMultiFile.js +83 -0
- package/dist/cjs/other/FastVueMultiFunction.d.ts +19 -0
- package/dist/cjs/other/FastVueMultiFunction.js +68 -0
- package/dist/cjs/other/FastVueMultiObject.d.ts +17 -0
- package/dist/cjs/other/FastVueMultiObject.js +65 -0
- package/dist/cjs/other/FastVueMultiStore.d.ts +13 -0
- package/dist/cjs/other/FastVueMultiStore.js +23 -0
- package/dist/cjs/other/FastVueMultiUUID.d.ts +29 -0
- package/dist/cjs/other/FastVueMultiUUID.js +49 -0
- package/dist/cjs/other/FastVueMultiWatcher.d.ts +23 -0
- package/dist/cjs/other/FastVueMultiWatcher.js +114 -0
- package/dist/cjs/other/FastVueMultiWindow.d.ts +30 -0
- package/dist/cjs/other/FastVueMultiWindow.js +67 -0
- package/dist/cjs/vite/FastBuildOption.d.ts +207 -0
- package/dist/cjs/vite/FastBuildOption.js +213 -0
- package/dist/cjs/vite/FastPages.d.ts +25 -0
- package/dist/cjs/vite/FastPages.js +172 -0
- package/dist/cjs/vite/FastViteMultiConfig.d.ts +13 -0
- package/dist/cjs/vite/FastViteMultiConfig.js +36 -0
- package/dist/cjs/vite/FastViteMultiInjectJsPlugin.d.ts +21 -0
- package/dist/cjs/vite/FastViteMultiInjectJsPlugin.js +115 -0
- package/dist/cjs/vite/FastViteMultiPages.d.ts +58 -0
- package/dist/cjs/vite/FastViteMultiPages.js +190 -0
- package/dist/cjs/vite/FastViteMultiPagesPlugin.d.ts +11 -0
- package/dist/cjs/vite/FastViteMultiPagesPlugin.js +28 -0
- package/dist/cjs/vite/index.d.ts +2 -0
- package/dist/cjs/vite/index.js +5 -0
- package/dist/cjs/vue/FastVueMultiConfig.d.ts +18 -0
- package/dist/cjs/vue/FastVueMultiConfig.js +43 -0
- package/dist/esm/FastVueMultiTool.d.ts +107 -0
- package/dist/esm/FastVueMultiTool.js +100 -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 +128 -0
- package/dist/esm/http/FastVueMultiHttp.js +458 -0
- package/dist/esm/http/FastVueMultiSimpleJsonResponse.d.ts +67 -0
- package/dist/esm/http/FastVueMultiSimpleJsonResponse.js +127 -0
- package/dist/esm/http/FastVueMultiSimpleRequestConfig.d.ts +21 -0
- package/dist/esm/http/FastVueMultiSimpleRequestConfig.js +30 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/loader/index.d.ts +2 -0
- package/dist/esm/loader/index.js +89 -0
- package/dist/esm/native/FastVueNative.d.ts +76 -0
- package/dist/esm/native/FastVueNative.js +191 -0
- package/dist/esm/other/FastVueMultiAnimate.d.ts +29 -0
- package/dist/esm/other/FastVueMultiAnimate.js +88 -0
- package/dist/esm/other/FastVueMultiBase64.d.ts +12 -0
- package/dist/esm/other/FastVueMultiBase64.js +27 -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 +7 -0
- package/dist/esm/other/FastVueMultiClipboard.js +19 -0
- package/dist/esm/other/FastVueMultiDate.d.ts +30 -0
- package/dist/esm/other/FastVueMultiDate.js +171 -0
- package/dist/esm/other/FastVueMultiElement.d.ts +52 -0
- package/dist/esm/other/FastVueMultiElement.js +177 -0
- package/dist/esm/other/FastVueMultiEventBus.d.ts +23 -0
- package/dist/esm/other/FastVueMultiEventBus.js +122 -0
- package/dist/esm/other/FastVueMultiFile.d.ts +18 -0
- package/dist/esm/other/FastVueMultiFile.js +99 -0
- package/dist/esm/other/FastVueMultiFunction.d.ts +19 -0
- package/dist/esm/other/FastVueMultiFunction.js +97 -0
- package/dist/esm/other/FastVueMultiObject.d.ts +17 -0
- package/dist/esm/other/FastVueMultiObject.js +69 -0
- package/dist/esm/other/FastVueMultiStore.d.ts +13 -0
- package/dist/esm/other/FastVueMultiStore.js +27 -0
- package/dist/esm/other/FastVueMultiUUID.d.ts +29 -0
- package/dist/esm/other/FastVueMultiUUID.js +54 -0
- package/dist/esm/other/FastVueMultiWatcher.d.ts +23 -0
- package/dist/esm/other/FastVueMultiWatcher.js +122 -0
- package/dist/esm/other/FastVueMultiWindow.d.ts +30 -0
- package/dist/esm/other/FastVueMultiWindow.js +70 -0
- package/dist/esm/vite/FastBuildOption.d.ts +207 -0
- package/dist/esm/vite/FastBuildOption.js +133 -0
- package/dist/esm/vite/FastPages.d.ts +25 -0
- package/dist/esm/vite/FastPages.js +166 -0
- package/dist/esm/vite/FastViteMultiConfig.d.ts +13 -0
- package/dist/esm/vite/FastViteMultiConfig.js +41 -0
- package/dist/esm/vite/FastViteMultiInjectJsPlugin.d.ts +21 -0
- package/dist/esm/vite/FastViteMultiInjectJsPlugin.js +118 -0
- package/dist/esm/vite/FastViteMultiPages.d.ts +58 -0
- package/dist/esm/vite/FastViteMultiPages.js +194 -0
- package/dist/esm/vite/FastViteMultiPagesPlugin.d.ts +11 -0
- package/dist/esm/vite/FastViteMultiPagesPlugin.js +27 -0
- package/dist/esm/vite/index.d.ts +2 -0
- package/dist/esm/vite/index.js +6 -0
- package/dist/esm/vue/FastVueMultiConfig.d.ts +18 -0
- package/dist/esm/vue/FastVueMultiConfig.js +48 -0
- package/package.json +72 -0
- package/vite/FastViteBuildPages.d.ts +40 -0
- package/vite/FastViteBuildPages.js +251 -0
- package/vite/FastViteMultiConfig.d.ts +13 -0
- package/vite/FastViteMultiConfig.js +36 -0
- package/vite/FastViteMultiInjectJs.d.ts +11 -0
- package/vite/FastViteMultiInjectJs.js +69 -0
- package/vite/FastViteMultiPages.d.ts +77 -0
- package/vite/FastViteMultiPages.js +302 -0
- package/vite/FastViteMultiPagesOption.d.ts +173 -0
- package/vite/FastViteMultiPagesOption.js +179 -0
- package/vite/FastViteTransformVue.d.ts +4 -0
- package/vite/FastViteTransformVue.js +87 -0
- package/vite/index.d.ts +3 -0
- package/vite/index.js +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# fast-vue-multi-pages-vite
|
|
2
|
+
### Vite-快速搭建VUE项目工具类的基本库,主要用于每个功能页面独立生成html,不使用vue单页面功能。
|
|
3
|
+
|
|
4
|
+
## Install
|
|
5
|
+
```
|
|
6
|
+
npm i fast-vue-multi-pages-vite
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Package.json配置
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"fast-vue-multi-pages-vite": "^1.0.0", //具体版本以npm库更新为准
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## 配置vue.config.js 文件,快速配置VUE项目代码,复制如下代码:
|
|
20
|
+
```
|
|
21
|
+
const {FastViteMultiPages} = require("fast-vue-multi-pages/vue");
|
|
22
|
+
|
|
23
|
+
const result = FastViteMultiPages.getDefaultVueConfig(__dirname, {
|
|
24
|
+
projectTitle: "项目标题",
|
|
25
|
+
projectPagesDir: ["src/user_pages"],
|
|
26
|
+
projectOutDir: "dist",
|
|
27
|
+
autoCreateProjectIndexPage: false,
|
|
28
|
+
autoCreatePageConfigFile: true,
|
|
29
|
+
buildLevel: 1,
|
|
30
|
+
httpFinalParams: {
|
|
31
|
+
userTest: true,
|
|
32
|
+
},
|
|
33
|
+
httpBeforeRequest: function (config) {
|
|
34
|
+
console.log("httpBeforeRequest", config);
|
|
35
|
+
},
|
|
36
|
+
httpAfterRequest: function (response) {
|
|
37
|
+
console.log("httpAfterRequest", response);
|
|
38
|
+
},
|
|
39
|
+
globalConfig: {},
|
|
40
|
+
injectJsFiles: ["src/js/iconfont.js"],
|
|
41
|
+
clientStrict: true
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
module.exports = result;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# 使用默认工具类
|
|
49
|
+
|
|
50
|
+
### 引用库之后,在项目中导入即可,例如:
|
|
51
|
+
```
|
|
52
|
+
import {FastVueMultiTool} from "fast-vue-multi-pages-vite";
|
|
53
|
+
|
|
54
|
+
FastVueMultiTool.Http.get("接口地址", {
|
|
55
|
+
orderId: 1
|
|
56
|
+
}).then(result => {
|
|
57
|
+
if (result.isSuccess()) {
|
|
58
|
+
console.error(result.getData());
|
|
59
|
+
} else {
|
|
60
|
+
console.error(result.getMessage());
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import {defineComponent} from 'vue'
|
|
3
|
+
import {FastVueMultiTool} from "fast-vue-multi-pages-vite";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 浮动垂直 header-body-footer 布局,其中:header 与 footer 布局将悬浮在body中
|
|
7
|
+
*/
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: "fast-layout-body",
|
|
10
|
+
props: {
|
|
11
|
+
/**
|
|
12
|
+
* header默认高度
|
|
13
|
+
*/
|
|
14
|
+
headerDefaultHeight: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "0px",
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* footer默认高度
|
|
20
|
+
*/
|
|
21
|
+
footerDefaultHeight: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "0px",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
footerHeight: this.footerDefaultHeight,
|
|
29
|
+
headerHeight: this.headerDefaultHeight,
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
created() {
|
|
33
|
+
this.$nextTick(() => {
|
|
34
|
+
this.headerHeight = FastVueMultiTool.Element.getRealSize(this.$refs.header).height + "px";
|
|
35
|
+
this.footerHeight = FastVueMultiTool.Element.getRealSize(this.$refs.footer).height + "px";
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
|
|
44
|
+
<!--suppress HtmlUnknownAttribute -->
|
|
45
|
+
<div fast-layout-float-v-header-body-footer class="fast-layout-float-layout-container">
|
|
46
|
+
<div ref="header" class="fast-layout-float-layout-header">
|
|
47
|
+
<slot name="header"></slot>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="fast-layout-float-layout-body">
|
|
51
|
+
<div :style="{height:headerHeight}"></div>
|
|
52
|
+
|
|
53
|
+
<slot name="body"></slot>
|
|
54
|
+
|
|
55
|
+
<div :style="{height:footerHeight}"></div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div ref="footer" class="fast-layout-float-layout-footer">
|
|
59
|
+
<slot name="footer"></slot>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<style scoped>
|
|
67
|
+
|
|
68
|
+
.fast-layout-float-layout-container {
|
|
69
|
+
position: relative;
|
|
70
|
+
height: 100vh;
|
|
71
|
+
width: 100vw;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.fast-layout-float-layout-body {
|
|
76
|
+
height: 100%;
|
|
77
|
+
width: 100%;
|
|
78
|
+
overflow: auto;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.fast-layout-float-layout-header {
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: 0;
|
|
84
|
+
left: 0;
|
|
85
|
+
right: 0;
|
|
86
|
+
width: 100%;
|
|
87
|
+
z-index: 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
.fast-layout-float-layout-footer {
|
|
92
|
+
position: absolute;
|
|
93
|
+
bottom: 0;
|
|
94
|
+
left: 0;
|
|
95
|
+
right: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
z-index: 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import {defineComponent} from 'vue'
|
|
3
|
+
|
|
4
|
+
export default defineComponent({
|
|
5
|
+
name: "fast-layout-fullscreen",
|
|
6
|
+
props: {
|
|
7
|
+
scrollable: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: false,
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<!--suppress HtmlUnknownAttribute -->
|
|
17
|
+
<div fast-layout-fullscreen class="fast-layout-container-fullscreen" :style="{overflow:scrollable?'auto':'hidden'}">
|
|
18
|
+
<slot/>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<style scoped>
|
|
23
|
+
.fast-layout-container-fullscreen {
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
right: 0;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
width: 100vw !important;
|
|
29
|
+
height: 100vh !important;
|
|
30
|
+
position: fixed;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import {defineComponent} from 'vue'
|
|
3
|
+
import {FastVueMultiTool} from "fast-vue-multi-pages";
|
|
4
|
+
|
|
5
|
+
export default defineComponent({
|
|
6
|
+
name: "fast-panel-collapse",
|
|
7
|
+
props: {
|
|
8
|
+
collapsed: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: false
|
|
11
|
+
},
|
|
12
|
+
duration: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 300
|
|
15
|
+
},
|
|
16
|
+
showEasing: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'linear'
|
|
19
|
+
},
|
|
20
|
+
closeEasing: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'linear'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:collapsed"],
|
|
26
|
+
watch: {
|
|
27
|
+
collapsed(newValue) {
|
|
28
|
+
if (newValue) {
|
|
29
|
+
this.closePanel();
|
|
30
|
+
} else {
|
|
31
|
+
this.showPanel();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
panelCode: "",
|
|
38
|
+
initSize: {
|
|
39
|
+
width: 0,
|
|
40
|
+
height: 0
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
created() {
|
|
45
|
+
this.panelCode = FastVueMultiTool.UUID.buildOnlyCode("Panel");
|
|
46
|
+
this.$nextTick(() => {
|
|
47
|
+
this.initSize = FastVueMultiTool.Element.getRealSize(this.$refs.content);
|
|
48
|
+
if (this.collapsed) {
|
|
49
|
+
this.$refs.panel.style.height = "0px";
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
methods: {
|
|
54
|
+
showPanel() {
|
|
55
|
+
this.$nextTick(() => {
|
|
56
|
+
this.initSize = FastVueMultiTool.Element.getRealSize(this.$refs.content);
|
|
57
|
+
FastVueMultiTool.Animate.startValueAnimate(this.panelCode, {
|
|
58
|
+
from: 0,
|
|
59
|
+
to: this.initSize.height,
|
|
60
|
+
duration: this.duration,
|
|
61
|
+
easing: this.showEasing,
|
|
62
|
+
update: (value) => {
|
|
63
|
+
this.$refs.panel.style.height = value + "px";
|
|
64
|
+
},
|
|
65
|
+
begin: () => {
|
|
66
|
+
this.$refs.panel.style.height = "0px";
|
|
67
|
+
},
|
|
68
|
+
complete: () => {
|
|
69
|
+
this.$refs.panel.style.height = this.initSize.height + "px";
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
closePanel() {
|
|
75
|
+
this.$nextTick(() => {
|
|
76
|
+
this.initSize = FastVueMultiTool.Element.getRealSize(this.$refs.content);
|
|
77
|
+
FastVueMultiTool.Animate.startValueAnimate(this.panelCode, {
|
|
78
|
+
from: this.initSize.height,
|
|
79
|
+
to: 0,
|
|
80
|
+
duration: this.duration,
|
|
81
|
+
easing: this.closeEasing,
|
|
82
|
+
update: (value) => {
|
|
83
|
+
this.$refs.panel.style.height = value + "px";
|
|
84
|
+
},
|
|
85
|
+
complete: () => {
|
|
86
|
+
this.$refs.panel.style.height = "0px";
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<template>
|
|
97
|
+
<div ref="panel" class="fast-panel-collapse">
|
|
98
|
+
<div ref="content">
|
|
99
|
+
<slot/>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</template>
|
|
103
|
+
|
|
104
|
+
<style scoped>
|
|
105
|
+
.fast-panel-collapse {
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { FastVueMultiHttp } from "./http/FastVueMultiHttp";
|
|
3
|
+
import { FastVueMultiStore } from "./other/FastVueMultiStore";
|
|
4
|
+
import { FastViteMultiConfig } from "./vite/FastViteMultiConfig";
|
|
5
|
+
import { FastVueMultiCookie } from "./http/FastVueMultiCookie";
|
|
6
|
+
import { FastVueMultiClipboard } from "./other/FastVueMultiClipboard";
|
|
7
|
+
import { FastVueMultiDate } from "./other/FastVueMultiDate";
|
|
8
|
+
import { FastVueMultiBoolean } from "./other/FastVueMultiBoolean";
|
|
9
|
+
import { FastVueMultiFunction } from "./other/FastVueMultiFunction";
|
|
10
|
+
import { FastVueMultiElement } from "./other/FastVueMultiElement";
|
|
11
|
+
import { FastVueMultiWindow } from "./other/FastVueMultiWindow";
|
|
12
|
+
import { FastVueMultiFile } from "./other/FastVueMultiFile";
|
|
13
|
+
import { FastVueMultiBase64 } from "./other/FastVueMultiBase64";
|
|
14
|
+
import { FastVueMultiEventBus } from "./other/FastVueMultiEventBus";
|
|
15
|
+
import { FastVueMultiObject } from "./other/FastVueMultiObject";
|
|
16
|
+
import { FastVueMultiUUID } from "./other/FastVueMultiUUID";
|
|
17
|
+
import { FastVueMultiAnimate } from "./other/FastVueMultiAnimate";
|
|
18
|
+
import moment from "moment";
|
|
19
|
+
/**
|
|
20
|
+
* FastVueMultiTool 工具类
|
|
21
|
+
*/
|
|
22
|
+
export declare class FastVueMultiTool {
|
|
23
|
+
/**
|
|
24
|
+
* 页面配置工具类
|
|
25
|
+
*/
|
|
26
|
+
static PageConfig: typeof FastViteMultiConfig;
|
|
27
|
+
/**
|
|
28
|
+
* 常规的网络接口请求类,返回格式要求为JSON:{success:true,message:"消息",data:{}}
|
|
29
|
+
*/
|
|
30
|
+
static SimpleHttp: typeof FastVueMultiHttp.Simple;
|
|
31
|
+
/**
|
|
32
|
+
* 网络请求工具类
|
|
33
|
+
*/
|
|
34
|
+
static Http: typeof FastVueMultiHttp.Base;
|
|
35
|
+
/**
|
|
36
|
+
* 页面数据缓存工具类
|
|
37
|
+
*/
|
|
38
|
+
static Store: typeof FastVueMultiStore;
|
|
39
|
+
/**
|
|
40
|
+
* cookie操作
|
|
41
|
+
*/
|
|
42
|
+
static Cookie: typeof FastVueMultiCookie;
|
|
43
|
+
/**
|
|
44
|
+
* 剪贴板操作
|
|
45
|
+
*/
|
|
46
|
+
static Clipboard: typeof FastVueMultiClipboard;
|
|
47
|
+
/**
|
|
48
|
+
* Lodash工具类 https://lodash.com/docs/
|
|
49
|
+
*/
|
|
50
|
+
static Lodash: _.LoDashStatic;
|
|
51
|
+
/**
|
|
52
|
+
* Lodash工具类 https://lodash.com/docs/
|
|
53
|
+
*/
|
|
54
|
+
static _: _.LoDashStatic;
|
|
55
|
+
/**
|
|
56
|
+
* crypto-js工具类 https://cryptojs.gitbook.io/docs/
|
|
57
|
+
*/
|
|
58
|
+
static Crypto: any;
|
|
59
|
+
/**
|
|
60
|
+
* 日期类操作
|
|
61
|
+
*/
|
|
62
|
+
static Date: typeof FastVueMultiDate;
|
|
63
|
+
/**
|
|
64
|
+
* boolean工具类
|
|
65
|
+
*/
|
|
66
|
+
static Boolean: typeof FastVueMultiBoolean;
|
|
67
|
+
/**
|
|
68
|
+
* function工具类
|
|
69
|
+
*/
|
|
70
|
+
static Function: typeof FastVueMultiFunction;
|
|
71
|
+
/**
|
|
72
|
+
* html元素操作工具类
|
|
73
|
+
*/
|
|
74
|
+
static Element: typeof FastVueMultiElement;
|
|
75
|
+
/**
|
|
76
|
+
* window对象相关操作
|
|
77
|
+
*/
|
|
78
|
+
static Window: typeof FastVueMultiWindow;
|
|
79
|
+
/**
|
|
80
|
+
* 文件选择器
|
|
81
|
+
*/
|
|
82
|
+
static File: typeof FastVueMultiFile;
|
|
83
|
+
/**
|
|
84
|
+
* base64相关操作
|
|
85
|
+
*/
|
|
86
|
+
static Base64: typeof FastVueMultiBase64;
|
|
87
|
+
/**
|
|
88
|
+
* 事件传递
|
|
89
|
+
*/
|
|
90
|
+
static EventBus: typeof FastVueMultiEventBus;
|
|
91
|
+
/**
|
|
92
|
+
* 对象相关操作
|
|
93
|
+
*/
|
|
94
|
+
static Object: typeof FastVueMultiObject;
|
|
95
|
+
/**
|
|
96
|
+
* UUID操作
|
|
97
|
+
*/
|
|
98
|
+
static UUID: typeof FastVueMultiUUID;
|
|
99
|
+
/**
|
|
100
|
+
* 数值动画类
|
|
101
|
+
*/
|
|
102
|
+
static Animate: typeof FastVueMultiAnimate;
|
|
103
|
+
/**
|
|
104
|
+
* moment工具类 http://momentjs.com/
|
|
105
|
+
*/
|
|
106
|
+
static Moment: typeof moment;
|
|
107
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FastVueMultiTool = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
6
|
+
const FastVueMultiHttp_1 = require("./http/FastVueMultiHttp");
|
|
7
|
+
const FastVueMultiStore_1 = require("./other/FastVueMultiStore");
|
|
8
|
+
const FastViteMultiConfig_1 = require("./vite/FastViteMultiConfig");
|
|
9
|
+
const FastVueMultiCookie_1 = require("./http/FastVueMultiCookie");
|
|
10
|
+
const FastVueMultiClipboard_1 = require("./other/FastVueMultiClipboard");
|
|
11
|
+
const FastVueMultiDate_1 = require("./other/FastVueMultiDate");
|
|
12
|
+
const FastVueMultiBoolean_1 = require("./other/FastVueMultiBoolean");
|
|
13
|
+
const FastVueMultiFunction_1 = require("./other/FastVueMultiFunction");
|
|
14
|
+
const FastVueMultiElement_1 = require("./other/FastVueMultiElement");
|
|
15
|
+
const FastVueMultiWindow_1 = require("./other/FastVueMultiWindow");
|
|
16
|
+
const FastVueMultiFile_1 = require("./other/FastVueMultiFile");
|
|
17
|
+
const FastVueMultiBase64_1 = require("./other/FastVueMultiBase64");
|
|
18
|
+
const FastVueMultiEventBus_1 = require("./other/FastVueMultiEventBus");
|
|
19
|
+
const FastVueMultiObject_1 = require("./other/FastVueMultiObject");
|
|
20
|
+
const FastVueMultiUUID_1 = require("./other/FastVueMultiUUID");
|
|
21
|
+
const FastVueMultiAnimate_1 = require("./other/FastVueMultiAnimate");
|
|
22
|
+
const moment_1 = tslib_1.__importDefault(require("moment"));
|
|
23
|
+
/**
|
|
24
|
+
* FastVueMultiTool 工具类
|
|
25
|
+
*/
|
|
26
|
+
class FastVueMultiTool {
|
|
27
|
+
/**
|
|
28
|
+
* 页面配置工具类
|
|
29
|
+
*/
|
|
30
|
+
static PageConfig = FastViteMultiConfig_1.FastViteMultiConfig;
|
|
31
|
+
/**
|
|
32
|
+
* 常规的网络接口请求类,返回格式要求为JSON:{success:true,message:"消息",data:{}}
|
|
33
|
+
*/
|
|
34
|
+
static SimpleHttp = FastVueMultiHttp_1.FastVueMultiHttp.Simple;
|
|
35
|
+
/**
|
|
36
|
+
* 网络请求工具类
|
|
37
|
+
*/
|
|
38
|
+
static Http = FastVueMultiHttp_1.FastVueMultiHttp.Base;
|
|
39
|
+
/**
|
|
40
|
+
* 页面数据缓存工具类
|
|
41
|
+
*/
|
|
42
|
+
static Store = FastVueMultiStore_1.FastVueMultiStore;
|
|
43
|
+
/**
|
|
44
|
+
* cookie操作
|
|
45
|
+
*/
|
|
46
|
+
static Cookie = FastVueMultiCookie_1.FastVueMultiCookie;
|
|
47
|
+
/**
|
|
48
|
+
* 剪贴板操作
|
|
49
|
+
*/
|
|
50
|
+
static Clipboard = FastVueMultiClipboard_1.FastVueMultiClipboard;
|
|
51
|
+
/**
|
|
52
|
+
* Lodash工具类 https://lodash.com/docs/
|
|
53
|
+
*/
|
|
54
|
+
static Lodash = lodash_1.default;
|
|
55
|
+
/**
|
|
56
|
+
* Lodash工具类 https://lodash.com/docs/
|
|
57
|
+
*/
|
|
58
|
+
static _ = lodash_1.default;
|
|
59
|
+
/**
|
|
60
|
+
* crypto-js工具类 https://cryptojs.gitbook.io/docs/
|
|
61
|
+
*/
|
|
62
|
+
static Crypto = require("crypto-js");
|
|
63
|
+
/**
|
|
64
|
+
* 日期类操作
|
|
65
|
+
*/
|
|
66
|
+
static Date = FastVueMultiDate_1.FastVueMultiDate;
|
|
67
|
+
/**
|
|
68
|
+
* boolean工具类
|
|
69
|
+
*/
|
|
70
|
+
static Boolean = FastVueMultiBoolean_1.FastVueMultiBoolean;
|
|
71
|
+
/**
|
|
72
|
+
* function工具类
|
|
73
|
+
*/
|
|
74
|
+
static Function = FastVueMultiFunction_1.FastVueMultiFunction;
|
|
75
|
+
/**
|
|
76
|
+
* html元素操作工具类
|
|
77
|
+
*/
|
|
78
|
+
static Element = FastVueMultiElement_1.FastVueMultiElement;
|
|
79
|
+
/**
|
|
80
|
+
* window对象相关操作
|
|
81
|
+
*/
|
|
82
|
+
static Window = FastVueMultiWindow_1.FastVueMultiWindow;
|
|
83
|
+
/**
|
|
84
|
+
* 文件选择器
|
|
85
|
+
*/
|
|
86
|
+
static File = FastVueMultiFile_1.FastVueMultiFile;
|
|
87
|
+
/**
|
|
88
|
+
* base64相关操作
|
|
89
|
+
*/
|
|
90
|
+
static Base64 = FastVueMultiBase64_1.FastVueMultiBase64;
|
|
91
|
+
/**
|
|
92
|
+
* 事件传递
|
|
93
|
+
*/
|
|
94
|
+
static EventBus = FastVueMultiEventBus_1.FastVueMultiEventBus;
|
|
95
|
+
/**
|
|
96
|
+
* 对象相关操作
|
|
97
|
+
*/
|
|
98
|
+
static Object = FastVueMultiObject_1.FastVueMultiObject;
|
|
99
|
+
/**
|
|
100
|
+
* UUID操作
|
|
101
|
+
*/
|
|
102
|
+
static UUID = FastVueMultiUUID_1.FastVueMultiUUID;
|
|
103
|
+
/**
|
|
104
|
+
* 数值动画类
|
|
105
|
+
*/
|
|
106
|
+
static Animate = FastVueMultiAnimate_1.FastVueMultiAnimate;
|
|
107
|
+
/**
|
|
108
|
+
* moment工具类 http://momentjs.com/
|
|
109
|
+
*/
|
|
110
|
+
static Moment = moment_1.default;
|
|
111
|
+
}
|
|
112
|
+
exports.FastVueMultiTool = FastVueMultiTool;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class FastVueMultiCookie {
|
|
2
|
+
/**
|
|
3
|
+
* 设置cookie
|
|
4
|
+
* @param key 键
|
|
5
|
+
* @param value 值
|
|
6
|
+
*/
|
|
7
|
+
static setCookie(key: string, value: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* 获取cookie
|
|
10
|
+
* @param key 键
|
|
11
|
+
*/
|
|
12
|
+
static getCookie(key: string): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* 删除cookie
|
|
15
|
+
* @param key 键
|
|
16
|
+
*/
|
|
17
|
+
static removeCookie(key: string): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FastVueMultiCookie = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const js_cookie_1 = tslib_1.__importDefault(require("js-cookie"));
|
|
6
|
+
class FastVueMultiCookie {
|
|
7
|
+
/**
|
|
8
|
+
* 设置cookie
|
|
9
|
+
* @param key 键
|
|
10
|
+
* @param value 值
|
|
11
|
+
*/
|
|
12
|
+
static setCookie(key, value) {
|
|
13
|
+
js_cookie_1.default.set(key, value);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 获取cookie
|
|
17
|
+
* @param key 键
|
|
18
|
+
*/
|
|
19
|
+
static getCookie(key) {
|
|
20
|
+
return js_cookie_1.default.get(key);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 删除cookie
|
|
24
|
+
* @param key 键
|
|
25
|
+
*/
|
|
26
|
+
static removeCookie(key) {
|
|
27
|
+
js_cookie_1.default.remove(key);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.FastVueMultiCookie = FastVueMultiCookie;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { AxiosPromise } from 'axios';
|
|
2
|
+
import { FastVueMultiSimpleJsonResponse } from './FastVueMultiSimpleJsonResponse';
|
|
3
|
+
import { FastVueMultiSimpleRequestConfig } from './FastVueMultiSimpleRequestConfig';
|
|
4
|
+
/**
|
|
5
|
+
* FastVueMultiHttp 网咯请求接口工具类
|
|
6
|
+
* @author Janesen
|
|
7
|
+
*/
|
|
8
|
+
export declare namespace FastVueMultiHttp {
|
|
9
|
+
/**
|
|
10
|
+
* 基本的网络请求接口
|
|
11
|
+
*/
|
|
12
|
+
class Base {
|
|
13
|
+
/**
|
|
14
|
+
* 获取地址栏携带的参数
|
|
15
|
+
* @param paramName 参数名
|
|
16
|
+
*/
|
|
17
|
+
static getWindowUrlParam(paramName: string): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* 获取地址栏携带的参数对象信息
|
|
20
|
+
*/
|
|
21
|
+
static getWindowUrlInfo(): any;
|
|
22
|
+
/**
|
|
23
|
+
* 获取url的参数
|
|
24
|
+
* @param url 地址
|
|
25
|
+
* @param paramName 参数名
|
|
26
|
+
*/
|
|
27
|
+
static getUrlParam(url: string, paramName: string): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* 获取url的参数实体对象
|
|
30
|
+
* @param url 地址
|
|
31
|
+
*/
|
|
32
|
+
static getUrlParamInfo(url: string): any;
|
|
33
|
+
/**
|
|
34
|
+
* 追加url参数
|
|
35
|
+
* @param url
|
|
36
|
+
* @param params
|
|
37
|
+
*/
|
|
38
|
+
static appendUrlParams(url: string, params: any): string;
|
|
39
|
+
/**
|
|
40
|
+
* 合并多个FormData参数
|
|
41
|
+
* @param formData
|
|
42
|
+
*/
|
|
43
|
+
static mergeFormData(...formData: FormData[]): FormData;
|
|
44
|
+
/**
|
|
45
|
+
* 如果是formData对象则转转换参数为object对象
|
|
46
|
+
* @param param
|
|
47
|
+
*/
|
|
48
|
+
static convertToObject(param: any): object;
|
|
49
|
+
/**
|
|
50
|
+
* 转换参数为FormData格式
|
|
51
|
+
* @param param 任意格式的参数,FormData、Object、Function
|
|
52
|
+
*/
|
|
53
|
+
static convertToFormData(param: any): FormData;
|
|
54
|
+
/**
|
|
55
|
+
* 合并参数并转换为FormData格式
|
|
56
|
+
* @param params 任意多个参数,FormData、Object、Function
|
|
57
|
+
*/
|
|
58
|
+
static mergeParams(...params: any[]): FormData;
|
|
59
|
+
/**
|
|
60
|
+
* 将数组格式的参数合并
|
|
61
|
+
* @param params 数组
|
|
62
|
+
*/
|
|
63
|
+
static mergeParamsByArray(params: any[]): FormData;
|
|
64
|
+
/**
|
|
65
|
+
* 发起接口请求
|
|
66
|
+
* @param method 请求方法,例如,post、get
|
|
67
|
+
* @param url 请求地址
|
|
68
|
+
* @param params 请求参数
|
|
69
|
+
*/
|
|
70
|
+
static doRequest(method: string, url: string, params: any): AxiosPromise;
|
|
71
|
+
/**
|
|
72
|
+
* 执行post请求
|
|
73
|
+
* @param url 请求地址
|
|
74
|
+
* @param params 请求参数,可为object或form data
|
|
75
|
+
*/
|
|
76
|
+
static doPost(url: string, params: any): AxiosPromise;
|
|
77
|
+
/**
|
|
78
|
+
* 执行get请求
|
|
79
|
+
* @param url 请求接口地址
|
|
80
|
+
* @param params 请求接口参数
|
|
81
|
+
*/
|
|
82
|
+
static doGet(url: string, params?: any): AxiosPromise;
|
|
83
|
+
/**
|
|
84
|
+
* 获取请求接口的默认头信息配置
|
|
85
|
+
*/
|
|
86
|
+
static getFinalHeaders(): any;
|
|
87
|
+
/**
|
|
88
|
+
* 获取接口的全局参数
|
|
89
|
+
*/
|
|
90
|
+
static getFinalParams(): any;
|
|
91
|
+
/**
|
|
92
|
+
* 构建接口请求的缓存key
|
|
93
|
+
* @param url 请求地址
|
|
94
|
+
* @param params 请求参数
|
|
95
|
+
*/
|
|
96
|
+
static buildCacheKey(url: string, params: any): string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 常规的接口请求类,返回格式要求为JSON:{success:true,message:"消息",data:{}}
|
|
100
|
+
*/
|
|
101
|
+
class Simple extends Base {
|
|
102
|
+
/**
|
|
103
|
+
* 发起请求接口
|
|
104
|
+
* @param method 请求方法,例如:post、get
|
|
105
|
+
* @param url 接口地址 完整的地址,例如:http://loalhost:8080/user/login
|
|
106
|
+
* @param params 参数
|
|
107
|
+
* @param config 请求配置
|
|
108
|
+
* @param callBack 请求接口回调函数,在使用alwaysCache和alwaysBackRequest参数为true时,必须使用回调函数接收
|
|
109
|
+
*/
|
|
110
|
+
static request(method: string, url: string, params?: any, config?: FastVueMultiSimpleRequestConfig, callBack?: (result: FastVueMultiSimpleJsonResponse) => void): Promise<FastVueMultiSimpleJsonResponse>;
|
|
111
|
+
/**
|
|
112
|
+
* post请求接口
|
|
113
|
+
* @param url 接口地址 完整的地址,例如:http://loalhost:8080/user/login
|
|
114
|
+
* @param params 参数
|
|
115
|
+
* @param config 请求配置
|
|
116
|
+
* @param callBack 请求接口回调函数,在使用alwaysCache和alwaysBackRequest参数为true时,必须使用回调函数接收
|
|
117
|
+
*/
|
|
118
|
+
static post(url: string, params?: any, config?: FastVueMultiSimpleRequestConfig, callBack?: (result: FastVueMultiSimpleJsonResponse) => void): Promise<FastVueMultiSimpleJsonResponse>;
|
|
119
|
+
/**
|
|
120
|
+
* get请求接口
|
|
121
|
+
* @param url 接口地址 完整的地址,例如:http://loalhost:8080/user/login
|
|
122
|
+
* @param params 参数
|
|
123
|
+
* @param config 请求配置
|
|
124
|
+
* @param callBack 请求接口回调函数,在使用alwaysCache和alwaysBackRequest参数为true时,必须使用回调函数接收
|
|
125
|
+
*/
|
|
126
|
+
static get(url: string, params?: any, config?: FastVueMultiSimpleRequestConfig, callBack?: (result: FastVueMultiSimpleJsonResponse) => void): Promise<FastVueMultiSimpleJsonResponse>;
|
|
127
|
+
}
|
|
128
|
+
}
|