zyf-model-engine 0.0.1 → 0.0.2
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/build/getEnv.d.ts +13 -0
- package/build/plugins.d.ts +7 -0
- package/build/proxy.d.ts +11 -0
- package/index.html +2 -100
- package/manifest.webmanifest +1 -0
- package/package.json +3 -94
- package/registerSW.js +1 -0
- package/src/api/config/servicePort.d.ts +2 -0
- package/src/api/enums/httpEnum.d.ts +29 -0
- package/src/api/helper/axiosCancel.d.ts +21 -0
- package/src/api/helper/axiosFileCancel.d.ts +27 -0
- package/src/api/helper/checkStatus.d.ts +6 -0
- package/src/api/index.d.ts +26 -0
- package/src/api/interface/index.d.ts +18 -0
- package/src/components/CTree/interface/index.d.ts +6 -0
- package/src/components/Grid/interface/index.d.ts +5 -0
- package/src/components/ProTable/interface/index.d.ts +66 -0
- package/src/config/index.d.ts +5 -0
- package/src/config/nprogress.d.ts +3 -0
- package/src/config/piniaPersist.d.ts +10 -0
- package/src/config/serviceLoading.d.ts +5 -0
- package/src/enums/httpEnum.d.ts +19 -0
- package/src/hooks/interface/index.d.ts +30 -0
- package/src/hooks/useOnline.d.ts +6 -0
- package/src/hooks/useTable.d.ts +47 -0
- package/src/main.d.ts +1 -0
- package/src/stores/commonStore.d.ts +2 -0
- package/src/stores/index.d.ts +2 -0
- package/src/stores/interface/index.d.ts +1 -0
- package/src/utils/color.d.ts +28 -0
- package/src/utils/commonUtils.d.ts +63 -0
- package/src/utils/errorHandler.d.ts +5 -0
- package/src/utils/is.d.ts +82 -0
- package/src/utils/layoutUtils.d.ts +44 -0
- package/src/utils/localUtils.d.ts +24 -0
- package/src/utils/serviceDict.d.ts +7 -0
- package/style.css +1 -0
- package/sw.js +1 -0
- package/vite.config.d.ts +2 -0
- package/workbox-3e911b1d.js +1 -0
- package/zyf-model-engine.mjs +45118 -0
- package/zyf-model-engine.umd.js +81 -0
- package/.editorconfig +0 -15
- package/.env +0 -13
- package/.env.development +0 -20
- package/.env.production +0 -25
- package/.env.test +0 -25
- package/.eslintignore +0 -15
- package/.eslintrc-auto-import.json +0 -65
- package/.eslintrc.cjs +0 -66
- package/.husky/commit-msg +0 -4
- package/.husky/pre-commit +0 -5
- package/.prettierignore +0 -9
- package/.prettierrc.cjs +0 -41
- package/.stylelintignore +0 -4
- package/.stylelintrc.cjs +0 -40
- package/.vscode/extensions.json +0 -14
- package/.vscode/settings.json +0 -92
- package/CHANGELOG.md +0 -246
- package/LICENSE +0 -21
- package/README.md +0 -205
- package/auto-imports.d.ts +0 -132
- package/build/getEnv.ts +0 -46
- package/build/plugins.ts +0 -138
- package/build/proxy.ts +0 -28
- package/commitlint.config.cjs +0 -84
- package/components.d.ts +0 -28
- package/lint-staged.config.cjs +0 -8
- package/postcss.config.cjs +0 -5
- package/src/App.vue +0 -16
- package/src/api/config/servicePort.ts +0 -3
- package/src/api/enums/httpEnum.ts +0 -35
- package/src/api/helper/axiosCancel.ts +0 -50
- package/src/api/helper/axiosFileCancel.ts +0 -62
- package/src/api/helper/checkStatus.ts +0 -97
- package/src/api/index.ts +0 -142
- package/src/api/interface/index.ts +0 -27
- package/src/assets/global-icons/icon-demo.svg +0 -1
- package/src/assets/iconfont/iconfont.scss +0 -44
- package/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/assets/images/empty-img.png +0 -0
- package/src/assets/option-icons/add.svg +0 -1
- package/src/assets/option-icons/check.svg +0 -1
- package/src/assets/option-icons/config.svg +0 -1
- package/src/assets/option-icons/del.svg +0 -1
- package/src/assets/option-icons/detail.svg +0 -1
- package/src/assets/option-icons/edit.svg +0 -2
- package/src/assets/option-icons/export.svg +0 -1
- package/src/assets/option-icons/folder.svg +0 -1
- package/src/assets/option-icons/full-screen.svg +0 -1
- package/src/assets/option-icons/more.svg +0 -1
- package/src/assets/option-icons/return.svg +0 -1
- package/src/assets/option-icons/search.svg +0 -1
- package/src/components/CSvgIcon/index.scss +0 -23
- package/src/components/CSvgIcon/index.vue +0 -74
- package/src/components/CTree/index.scss +0 -48
- package/src/components/CTree/index.vue +0 -176
- package/src/components/CTree/interface/index.ts +0 -6
- package/src/components/Dialog/index.scss +0 -74
- package/src/components/Dialog/index.vue +0 -87
- package/src/components/Empty/index.scss +0 -16
- package/src/components/Empty/index.vue +0 -43
- package/src/components/Grid/components/GridItem.vue +0 -68
- package/src/components/Grid/index.vue +0 -167
- package/src/components/Grid/interface/index.ts +0 -6
- package/src/components/Loading/index.scss +0 -67
- package/src/components/Loading/index.vue +0 -13
- package/src/components/Overflow/index.vue +0 -76
- package/src/components/ProTable/components/ColSetting.vue +0 -45
- package/src/components/ProTable/components/Pagination.vue +0 -29
- package/src/components/ProTable/components/SearchForm/components/SearchFormItem.vue +0 -93
- package/src/components/ProTable/components/SearchForm/index.scss +0 -12
- package/src/components/ProTable/components/SearchForm/index.vue +0 -91
- package/src/components/ProTable/components/TableColumn.vue +0 -56
- package/src/components/ProTable/index.scss +0 -14
- package/src/components/ProTable/index.vue +0 -274
- package/src/components/ProTable/interface/index.ts +0 -86
- package/src/components/ScrollBox/index.vue +0 -44
- package/src/components/SvgIcon/index.vue +0 -20
- package/src/components/Tabs/index.vue +0 -142
- package/src/config/index.ts +0 -12
- package/src/config/nprogress.ts +0 -12
- package/src/config/piniaPersist.ts +0 -19
- package/src/config/serviceLoading.ts +0 -45
- package/src/enums/httpEnum.ts +0 -24
- package/src/hooks/interface/index.ts +0 -32
- package/src/hooks/useOnline.ts +0 -27
- package/src/hooks/useTable.ts +0 -167
- package/src/main.ts +0 -35
- package/src/plugins/button/button.vue +0 -56
- package/src/plugins/index.js +0 -26
- package/src/plugins/index.vue +0 -24
- package/src/plugins/msg/msg.vue +0 -56
- package/src/stores/commonStore.ts +0 -9
- package/src/stores/index.ts +0 -8
- package/src/stores/interface/index.ts +0 -1
- package/src/styles/common.scss +0 -87
- package/src/styles/element.scss +0 -233
- package/src/styles/reset.scss +0 -20
- package/src/styles/var.scss +0 -2
- package/src/typings/global.d.ts +0 -37
- package/src/typings/window.d.ts +0 -8
- package/src/utils/color.ts +0 -59
- package/src/utils/commonUtils.ts +0 -175
- package/src/utils/errorHandler.ts +0 -28
- package/src/utils/is.ts +0 -147
- package/src/utils/layoutUtils.ts +0 -83
- package/src/utils/localUtils.ts +0 -42
- package/src/utils/serviceDict.ts +0 -9
- package/src/vite-env.d.ts +0 -6
- package/tsconfig.json +0 -50
- package/vite.config.ts +0 -76
- /package/{public/logo.png → logo.png} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function isDevFn(mode: string): boolean;
|
|
2
|
+
export declare function isProdFn(mode: string): boolean;
|
|
3
|
+
export declare function isTestFn(mode: string): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* 是否生成包预览
|
|
6
|
+
*/
|
|
7
|
+
export declare function isReportMode(): boolean;
|
|
8
|
+
export declare function wrapperEnv(envConf: Recordable): ViteEnv;
|
|
9
|
+
/**
|
|
10
|
+
* 获取用户根目录
|
|
11
|
+
* @param dir file path
|
|
12
|
+
*/
|
|
13
|
+
export declare function getRootPath(...dir: string[]): string;
|
package/build/proxy.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProxyOptions } from 'vite';
|
|
2
|
+
|
|
3
|
+
declare type ProxyItem = [string, string];
|
|
4
|
+
declare type ProxyList = ProxyItem[];
|
|
5
|
+
declare type ProxyTargetList = Record<string, ProxyOptions>;
|
|
6
|
+
/**
|
|
7
|
+
* 创建代理,用于解析 .env.development 代理配置
|
|
8
|
+
* @param list
|
|
9
|
+
*/
|
|
10
|
+
export declare function createProxy(list?: ProxyList): ProxyTargetList;
|
|
11
|
+
export {};
|
package/index.html
CHANGED
|
@@ -1,105 +1,7 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title><%- title %></title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="app">
|
|
11
|
-
<style>
|
|
12
|
-
html,
|
|
13
|
-
body,
|
|
14
|
-
#app {
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
padding: 0;
|
|
18
|
-
margin: 0;
|
|
19
|
-
}
|
|
20
|
-
.loading-box {
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 100%;
|
|
27
|
-
}
|
|
28
|
-
.loading-box .loading-wrap {
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
padding: 98px;
|
|
33
|
-
}
|
|
34
|
-
.dot {
|
|
35
|
-
position: relative;
|
|
36
|
-
box-sizing: border-box;
|
|
37
|
-
display: inline-block;
|
|
38
|
-
width: 32px;
|
|
39
|
-
height: 32px;
|
|
40
|
-
font-size: 32px;
|
|
41
|
-
transform: rotate(45deg);
|
|
42
|
-
animation: ant-rotate 1.2s infinite linear;
|
|
43
|
-
}
|
|
44
|
-
.dot i {
|
|
45
|
-
position: absolute;
|
|
46
|
-
display: block;
|
|
47
|
-
width: 14px;
|
|
48
|
-
height: 14px;
|
|
49
|
-
background-color: #409eff;
|
|
50
|
-
border-radius: 100%;
|
|
51
|
-
opacity: 0.3;
|
|
52
|
-
transform: scale(0.75);
|
|
53
|
-
transform-origin: 50% 50%;
|
|
54
|
-
animation: ant-spin-move 1s infinite linear alternate;
|
|
55
|
-
}
|
|
56
|
-
.dot i:nth-child(1) {
|
|
57
|
-
top: 0;
|
|
58
|
-
left: 0;
|
|
59
|
-
}
|
|
60
|
-
.dot i:nth-child(2) {
|
|
61
|
-
top: 0;
|
|
62
|
-
right: 0;
|
|
63
|
-
animation-delay: 0.4s;
|
|
64
|
-
}
|
|
65
|
-
.dot i:nth-child(3) {
|
|
66
|
-
right: 0;
|
|
67
|
-
bottom: 0;
|
|
68
|
-
animation-delay: 0.8s;
|
|
69
|
-
}
|
|
70
|
-
.dot i:nth-child(4) {
|
|
71
|
-
bottom: 0;
|
|
72
|
-
left: 0;
|
|
73
|
-
animation-delay: 1.2s;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@keyframes ant-rotate {
|
|
77
|
-
to {
|
|
78
|
-
transform: rotate(405deg);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@keyframes ant-spin-move {
|
|
83
|
-
to {
|
|
84
|
-
opacity: 1;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
</style>
|
|
88
|
-
<div class="loading-box">
|
|
89
|
-
<div class="loading-wrap">
|
|
90
|
-
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
<script>
|
|
95
|
-
const globalState = JSON.parse(window.localStorage.getItem("%VITE_GLOB_DEMO_KEY%" + "global"));
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="./logo.png"><meta name="viewport" content="width=device-width,initial-scale=1"><title>模型引擎</title><script type="module" crossorigin src="./zyf-model-engine.umd.js"></script><link rel="stylesheet" href="./style.css"><link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head><body><div id="app"><style>#app,body,html{width:100%;height:100%;padding:0;margin:0}.loading-box{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.loading-box .loading-wrap{display:flex;align-items:center;justify-content:center;padding:98px}.dot{position:relative;box-sizing:border-box;display:inline-block;width:32px;height:32px;font-size:32px;transform:rotate(45deg);animation:ant-rotate 1.2s infinite linear}.dot i{position:absolute;display:block;width:14px;height:14px;background-color:#409eff;border-radius:100%;opacity:.3;transform:scale(.75);transform-origin:50% 50%;animation:ant-spin-move 1s infinite linear alternate}.dot i:first-child{top:0;left:0}.dot i:nth-child(2){top:0;right:0;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;animation-delay:1.2s}@keyframes ant-rotate{to{transform:rotate(405deg)}}@keyframes ant-spin-move{to{opacity:1}}</style><div class="loading-box"><div class="loading-wrap"><span class="dot dot-spin"><i></i><i></i><i></i><i></i></span></div></div></div><script>const globalState = JSON.parse(window.localStorage.getItem("zyf_model_engine" + "global"));
|
|
96
2
|
if (globalState) {
|
|
97
3
|
const dot = document.querySelectorAll(".dot i");
|
|
98
4
|
const html = document.querySelector("html");
|
|
99
5
|
dot.forEach(item => (item.style.background = globalState.primary));
|
|
100
6
|
if (globalState.isDark) html.style.background = "#141414";
|
|
101
|
-
}
|
|
102
|
-
</script>
|
|
103
|
-
<script type="module" src="/src/main.ts"></script>
|
|
104
|
-
</body>
|
|
105
|
-
</html>
|
|
7
|
+
}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"模型引擎","short_name":"模型引擎","start_url":"./","display":"standalone","background_color":"#ffffff","lang":"en","scope":"./","theme_color":"#ffffff","icons":[{"src":"/logo.png","sizes":"192x192","type":"image/png"},{"src":"/logo.png","sizes":"512x512","type":"image/png"},{"src":"/logo.png","sizes":"512x512","type":"image/png","purpose":"any maskable"}]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zyf-model-engine",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.2",
|
|
5
5
|
"main": "zyf-model-engine.ts",
|
|
6
6
|
"description": "插件发布测试",
|
|
7
7
|
"author": {
|
|
@@ -11,98 +11,7 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"types": "lib/index.d.ts",
|
|
13
13
|
"scripts": {
|
|
14
|
-
"
|
|
15
|
-
"build": " vite build --mode production",
|
|
16
|
-
"build:dev": "vue-tsc && vite build --mode development",
|
|
17
|
-
"build:test": "vue-tsc && vite build --mode test",
|
|
18
|
-
"build:test-no-check": "vite build --mode test",
|
|
19
|
-
"build:pro": "vue-tsc && vite build --mode production",
|
|
20
|
-
"build:pro-no-check": "vite build --mode production",
|
|
21
|
-
"type:check": "vue-tsc --noEmit --skipLibCheck",
|
|
22
|
-
"preview": "npm run build:dev && vite preview",
|
|
23
|
-
"lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
|
|
24
|
-
"lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"",
|
|
25
|
-
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
|
|
26
|
-
"lint:lint-staged": "lint-staged",
|
|
27
|
-
"prepare": "husky install",
|
|
28
|
-
"release": "standard-version",
|
|
29
|
-
"commit": "git add -A && czg && git push"
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
30
15
|
},
|
|
31
|
-
"
|
|
32
|
-
"@element-plus/icons-vue": "^2.1.0",
|
|
33
|
-
"@vueuse/core": "^10.3.0",
|
|
34
|
-
"axios": "^1.4.0",
|
|
35
|
-
"dayjs": "^1.11.9",
|
|
36
|
-
"element-plus": "^2.3.4",
|
|
37
|
-
"nprogress": "^0.2.0",
|
|
38
|
-
"pinia": "^2.1.6",
|
|
39
|
-
"pinia-plugin-persistedstate": "^3.2.0",
|
|
40
|
-
"qs": "^6.11.2",
|
|
41
|
-
"screenfull": "^6.0.2",
|
|
42
|
-
"vue": "^3.3.4"
|
|
43
|
-
},
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"@commitlint/cli": "^17.6.7",
|
|
46
|
-
"@commitlint/config-conventional": "^17.6.7",
|
|
47
|
-
"@types/nprogress": "^0.2.0",
|
|
48
|
-
"@types/qs": "^6.9.7",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
|
50
|
-
"@typescript-eslint/parser": "^6.2.1",
|
|
51
|
-
"@vitejs/plugin-vue": "^4.2.3",
|
|
52
|
-
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
53
|
-
"autoprefixer": "^10.4.14",
|
|
54
|
-
"cz-git": "^1.7.0",
|
|
55
|
-
"czg": "^1.7.0",
|
|
56
|
-
"eslint": "^8.46.0",
|
|
57
|
-
"eslint-config-prettier": "^8.9.0",
|
|
58
|
-
"eslint-plugin-prettier": "^5.0.0",
|
|
59
|
-
"eslint-plugin-vue": "^9.16.1",
|
|
60
|
-
"husky": "^8.0.3",
|
|
61
|
-
"lint-staged": "^13.2.3",
|
|
62
|
-
"postcss": "^8.4.27",
|
|
63
|
-
"postcss-html": "^1.5.0",
|
|
64
|
-
"prettier": "^3.0.0",
|
|
65
|
-
"rollup-plugin-visualizer": "^5.9.2",
|
|
66
|
-
"sass": "1.64.2",
|
|
67
|
-
"standard-version": "^9.5.0",
|
|
68
|
-
"stylelint": "^15.10.2",
|
|
69
|
-
"stylelint-config-html": "^1.1.0",
|
|
70
|
-
"stylelint-config-recess-order": "^4.3.0",
|
|
71
|
-
"stylelint-config-recommended-scss": "^12.0.0",
|
|
72
|
-
"stylelint-config-recommended-vue": "^1.5.0",
|
|
73
|
-
"stylelint-config-standard": "^34.0.0",
|
|
74
|
-
"stylelint-config-standard-scss": "^10.0.0",
|
|
75
|
-
"typescript": "4.3.5",
|
|
76
|
-
"unplugin-auto-import": "^0.11.2",
|
|
77
|
-
"unplugin-vue-components": "^0.22.8",
|
|
78
|
-
"unplugin-vue-setup-extend-plus": "^1.0.0",
|
|
79
|
-
"vite": "^4.4.8",
|
|
80
|
-
"vite-plugin-compression": "^0.5.1",
|
|
81
|
-
"vite-plugin-dts": "^4.2.4",
|
|
82
|
-
"vite-plugin-eslint": "^1.8.1",
|
|
83
|
-
"vite-plugin-html": "^3.2.0",
|
|
84
|
-
"vite-plugin-pwa": "^0.16.4",
|
|
85
|
-
"vite-plugin-svg-icons": "^2.0.1",
|
|
86
|
-
"vue-tsc": "^1.8.8"
|
|
87
|
-
},
|
|
88
|
-
"engines": {
|
|
89
|
-
"node": ">=16.0.0"
|
|
90
|
-
},
|
|
91
|
-
"browserslist": {
|
|
92
|
-
"production": [
|
|
93
|
-
"> 1%",
|
|
94
|
-
"not dead",
|
|
95
|
-
"not op_mini all"
|
|
96
|
-
],
|
|
97
|
-
"development": [
|
|
98
|
-
"last 1 chrome version",
|
|
99
|
-
"last 1 firefox version",
|
|
100
|
-
"last 1 safari version"
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
|
-
"config": {
|
|
104
|
-
"commitizen": {
|
|
105
|
-
"path": "node_modules/cz-git"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
16
|
+
"keywords": []
|
|
108
17
|
}
|
package/registerSW.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('./sw.js', { scope: './' })})}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description:请求配置
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ResultEnum {
|
|
5
|
+
SUCCESS = 200,
|
|
6
|
+
ERROR = 500,
|
|
7
|
+
OVERDUE = 401,
|
|
8
|
+
TIMEOUT = 30000,
|
|
9
|
+
TYPE = "success"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @description:请求方法
|
|
13
|
+
*/
|
|
14
|
+
export declare enum RequestEnum {
|
|
15
|
+
GET = "GET",
|
|
16
|
+
POST = "POST",
|
|
17
|
+
PATCH = "PATCH",
|
|
18
|
+
PUT = "PUT",
|
|
19
|
+
DELETE = "DELETE"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @description:常用的 contentTyp 类型
|
|
23
|
+
*/
|
|
24
|
+
export declare enum ContentTypeEnum {
|
|
25
|
+
JSON = "application/json;charset=UTF-8",
|
|
26
|
+
TEXT = "text/plain;charset=UTF-8",
|
|
27
|
+
FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8",
|
|
28
|
+
FORM_DATA = "multipart/form-data;charset=UTF-8"
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CustomAxiosRequestConfig } from '../index';
|
|
2
|
+
|
|
3
|
+
export declare let pendingMap: Map<string, AbortController>;
|
|
4
|
+
export declare const getPendingUrl: (config: CustomAxiosRequestConfig) => string;
|
|
5
|
+
export declare class AxiosCanceler {
|
|
6
|
+
/**
|
|
7
|
+
* @description: 添加请求
|
|
8
|
+
* @param {Object} config
|
|
9
|
+
* @return void
|
|
10
|
+
*/
|
|
11
|
+
addPending(config: CustomAxiosRequestConfig): void;
|
|
12
|
+
/**
|
|
13
|
+
* @description: 移除请求
|
|
14
|
+
* @param {Object} config
|
|
15
|
+
*/
|
|
16
|
+
removePending(config: CustomAxiosRequestConfig): void;
|
|
17
|
+
/**
|
|
18
|
+
* @description: 清空所有pending
|
|
19
|
+
*/
|
|
20
|
+
removeAllPending(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CustomAxiosRequestConfig } from '../index';
|
|
2
|
+
|
|
3
|
+
export declare let pendingMap: Map<string, AbortController>;
|
|
4
|
+
export declare const getPendingUrl: (config: CustomAxiosRequestConfig) => string;
|
|
5
|
+
export declare class AxiosFileCancel {
|
|
6
|
+
size(): number;
|
|
7
|
+
/**
|
|
8
|
+
* @description: 添加请求
|
|
9
|
+
* @param {Object} config
|
|
10
|
+
* @return void
|
|
11
|
+
*/
|
|
12
|
+
addPending(config: CustomAxiosRequestConfig): void;
|
|
13
|
+
/**
|
|
14
|
+
* @description: 移除请求
|
|
15
|
+
* @param {Object} config
|
|
16
|
+
*/
|
|
17
|
+
removePending(config: CustomAxiosRequestConfig): void;
|
|
18
|
+
/**
|
|
19
|
+
* @description: 根据fileUid移除指定请求
|
|
20
|
+
* @param {number} fileUid
|
|
21
|
+
*/
|
|
22
|
+
removeSpecifyPending(fileUid: number): void;
|
|
23
|
+
/**
|
|
24
|
+
* @description: 清空所有pending
|
|
25
|
+
*/
|
|
26
|
+
removeAllPending(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
+
import { AxiosCanceler } from './helper/axiosCancel';
|
|
3
|
+
import { AxiosFileCancel } from './helper/axiosFileCancel';
|
|
4
|
+
import { ResultData } from './interface';
|
|
5
|
+
|
|
6
|
+
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
|
|
7
|
+
noLoading?: boolean;
|
|
8
|
+
repeatRequestCancel?: boolean;
|
|
9
|
+
fileUid?: number;
|
|
10
|
+
}
|
|
11
|
+
declare class RequestHttp {
|
|
12
|
+
service: AxiosInstance;
|
|
13
|
+
constructor(config: AxiosRequestConfig);
|
|
14
|
+
/**
|
|
15
|
+
* @description 常用请求方法封装
|
|
16
|
+
*/
|
|
17
|
+
get<T>(url: string, params?: object, _object?: {}): Promise<ResultData<T>>;
|
|
18
|
+
post<T>(url: string, params?: object | string, _object?: {}): Promise<ResultData<T>>;
|
|
19
|
+
put<T>(url: string, params?: object, _object?: {}): Promise<ResultData<T>>;
|
|
20
|
+
delete<T>(url: string, params?: any, _object?: {}): Promise<ResultData<T>>;
|
|
21
|
+
download(url: string, params?: object, _object?: {}): Promise<BlobPart>;
|
|
22
|
+
}
|
|
23
|
+
export declare const http: RequestHttp;
|
|
24
|
+
export declare const axiosController: AxiosCanceler;
|
|
25
|
+
export declare const axiosFileController: AxiosFileCancel;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare type fetchType = "get" | "post" | "put" | "delete" | "download";
|
|
2
|
+
export interface Result {
|
|
3
|
+
code: string;
|
|
4
|
+
msg: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ResultData<T = any> extends Result {
|
|
7
|
+
data: T;
|
|
8
|
+
}
|
|
9
|
+
export interface ResPage<T> {
|
|
10
|
+
list: T[];
|
|
11
|
+
page: number;
|
|
12
|
+
limit: number;
|
|
13
|
+
total: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ReqPage {
|
|
16
|
+
page: number;
|
|
17
|
+
limit: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { VNode, ComponentPublicInstance } from 'vue';
|
|
2
|
+
import { BreakPoint, Responsive } from '../../Grid/interface';
|
|
3
|
+
import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults';
|
|
4
|
+
import { ProTableProps, default as ProTable } from '../index.vue';
|
|
5
|
+
|
|
6
|
+
export interface tableTreeProps {
|
|
7
|
+
hasChildren: string;
|
|
8
|
+
children: string;
|
|
9
|
+
}
|
|
10
|
+
export interface EnumProps {
|
|
11
|
+
label?: string;
|
|
12
|
+
value?: string | number | boolean | any[];
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
tagType?: string;
|
|
15
|
+
children?: EnumProps[];
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
export declare type TypeProps = "index" | "selection" | "expand";
|
|
19
|
+
export declare type SearchType = "input" | "input-number" | "select" | "select-v2" | "tree-select" | "cascader" | "date-picker" | "time-picker" | "time-select" | "switch" | "slider";
|
|
20
|
+
export declare type SearchRenderScope = {
|
|
21
|
+
searchParam: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
placeholder: string;
|
|
25
|
+
clearable: boolean;
|
|
26
|
+
options: EnumProps[];
|
|
27
|
+
data: EnumProps[];
|
|
28
|
+
};
|
|
29
|
+
export declare type SearchProps = {
|
|
30
|
+
el?: SearchType;
|
|
31
|
+
props?: any;
|
|
32
|
+
key?: string;
|
|
33
|
+
order?: number;
|
|
34
|
+
span?: number;
|
|
35
|
+
offset?: number;
|
|
36
|
+
defaultValue?: string | number | boolean | any[];
|
|
37
|
+
render?: (scope: SearchRenderScope) => VNode;
|
|
38
|
+
} & Partial<Record<BreakPoint, Responsive>>;
|
|
39
|
+
export declare type FieldNamesProps = {
|
|
40
|
+
label: string;
|
|
41
|
+
value: string;
|
|
42
|
+
children?: string;
|
|
43
|
+
};
|
|
44
|
+
export declare type RenderScope<T> = {
|
|
45
|
+
row: T;
|
|
46
|
+
$index: number;
|
|
47
|
+
column: TableColumnCtx<T>;
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
};
|
|
50
|
+
export declare type HeaderRenderScope<T> = {
|
|
51
|
+
$index: number;
|
|
52
|
+
column: TableColumnCtx<T>;
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
};
|
|
55
|
+
export interface ColumnProps<T = any> extends Partial<Omit<TableColumnCtx<T>, "children" | "renderCell" | "renderHeader">> {
|
|
56
|
+
tag?: boolean;
|
|
57
|
+
isShow?: boolean;
|
|
58
|
+
search?: SearchProps | undefined;
|
|
59
|
+
enum?: EnumProps[] | ((params?: any) => Promise<any>);
|
|
60
|
+
isFilterEnum?: boolean;
|
|
61
|
+
fieldNames?: FieldNamesProps;
|
|
62
|
+
headerRender?: (scope: HeaderRenderScope<T>) => VNode;
|
|
63
|
+
render?: (scope: RenderScope<T>) => VNode | string;
|
|
64
|
+
_children?: ColumnProps<T>[];
|
|
65
|
+
}
|
|
66
|
+
export declare type ProTableInstance = Omit<InstanceType<typeof ProTable>, keyof ComponentPublicInstance | keyof ProTableProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PersistedStateOptions } from 'pinia-plugin-persistedstate';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description pinia 持久化参数配置
|
|
5
|
+
* @param {String} key 存储到持久化的 name
|
|
6
|
+
* @param {Array} paths 需要持久化的 state name
|
|
7
|
+
* @return persist
|
|
8
|
+
* */
|
|
9
|
+
declare const piniaPersistConfig: (key: string, paths?: string[]) => PersistedStateOptions;
|
|
10
|
+
export default piniaPersistConfig;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description:请求方法
|
|
3
|
+
*/
|
|
4
|
+
export declare enum RequestEnum {
|
|
5
|
+
GET = "GET",
|
|
6
|
+
POST = "POST",
|
|
7
|
+
PATCH = "PATCH",
|
|
8
|
+
PUT = "PUT",
|
|
9
|
+
DELETE = "DELETE"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @description:常用的 contentTyp 类型
|
|
13
|
+
*/
|
|
14
|
+
export declare enum ContentTypeEnum {
|
|
15
|
+
JSON = "application/json;charset=UTF-8",
|
|
16
|
+
TEXT = "text/plain;charset=UTF-8",
|
|
17
|
+
FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8",
|
|
18
|
+
FORM_DATA = "multipart/form-data;charset=UTF-8"
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare namespace Table {
|
|
2
|
+
interface Pageable {
|
|
3
|
+
page: number;
|
|
4
|
+
limit: number;
|
|
5
|
+
total: number;
|
|
6
|
+
}
|
|
7
|
+
interface StateProps {
|
|
8
|
+
tableData: any[];
|
|
9
|
+
pageable: Pageable;
|
|
10
|
+
searchParam: {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
};
|
|
13
|
+
searchInitParam: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
totalParam: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
icon?: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export declare namespace HandleData {
|
|
25
|
+
type MessageType = "" | "success" | "warning" | "info" | "error";
|
|
26
|
+
}
|
|
27
|
+
export declare namespace Theme {
|
|
28
|
+
type ThemeType = "light" | "inverted" | "dark";
|
|
29
|
+
type GreyOrWeakType = "grey" | "weak";
|
|
30
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { fetchType } from '../api/interface/index';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description table 页面操作方法封装
|
|
5
|
+
* @param {Function} api 获取表格数据 api 方法 (必传)
|
|
6
|
+
* @param {Object} initParam 获取数据初始化参数 (非必传,默认为{})
|
|
7
|
+
* @param {Boolean} isPageable 是否有分页 (非必传,默认为true)
|
|
8
|
+
* @param {Function} dataCallBack 对后台返回的数据进行处理的方法 (非必传)
|
|
9
|
+
* */
|
|
10
|
+
export declare const useTable: (initParam: object, isPageable: boolean, fetchType: fetchType, tableLimit?: number, api?: string | ((params: any) => Promise<any>), dataCallBack?: (data: any) => any, requestError?: (error: any) => void) => {
|
|
11
|
+
getTableList: () => Promise<void>;
|
|
12
|
+
search: () => void;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
handleSizeChange: (val: number) => void;
|
|
15
|
+
handleCurrentChange: (val: number) => void;
|
|
16
|
+
updatedTotalParam: () => void;
|
|
17
|
+
tableData: import('vue').Ref<any[], any[]>;
|
|
18
|
+
pageable: import('vue').Ref<{
|
|
19
|
+
page: number;
|
|
20
|
+
limit: number;
|
|
21
|
+
total: number;
|
|
22
|
+
}, {
|
|
23
|
+
page: number;
|
|
24
|
+
limit: number;
|
|
25
|
+
total: number;
|
|
26
|
+
}>;
|
|
27
|
+
searchParam: import('vue').Ref<{
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}, {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}>;
|
|
32
|
+
searchInitParam: import('vue').Ref<{
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}, {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}>;
|
|
37
|
+
totalParam: import('vue').Ref<{
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}, {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}>;
|
|
42
|
+
icon?: import('vue').Ref<{
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}, {
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}>;
|
|
47
|
+
};
|
package/src/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type AssemblySizeType = "large" | "default" | "small";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description hex颜色转rgb颜色
|
|
3
|
+
* @param {String} str 颜色值字符串
|
|
4
|
+
* @returns {String} 返回处理后的颜色值
|
|
5
|
+
*/
|
|
6
|
+
export declare function hexToRgb(str: any): any;
|
|
7
|
+
/**
|
|
8
|
+
* @description rgb颜色转Hex颜色
|
|
9
|
+
* @param {*} r 代表红色
|
|
10
|
+
* @param {*} g 代表绿色
|
|
11
|
+
* @param {*} b 代表蓝色
|
|
12
|
+
* @returns {String} 返回处理后的颜色值
|
|
13
|
+
*/
|
|
14
|
+
export declare function rgbToHex(r: any, g: any, b: any): string | import('element-plus').MessageHandler;
|
|
15
|
+
/**
|
|
16
|
+
* @description 加深颜色值
|
|
17
|
+
* @param {String} color 颜色值字符串
|
|
18
|
+
* @param {Number} level 加深的程度,限0-1之间
|
|
19
|
+
* @returns {String} 返回处理后的颜色值
|
|
20
|
+
*/
|
|
21
|
+
export declare function getDarkColor(color: string, level: number): string | import('element-plus').MessageHandler;
|
|
22
|
+
/**
|
|
23
|
+
* @description 变浅颜色值
|
|
24
|
+
* @param {String} color 颜色值字符串
|
|
25
|
+
* @param {Number} level 加深的程度,限0-1之间
|
|
26
|
+
* @returns {String} 返回处理后的颜色值
|
|
27
|
+
*/
|
|
28
|
+
export declare function getLightColor(color: string, level: number): string | import('element-plus').MessageHandler;
|