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
package/build/getEnv.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
|
|
3
|
-
export function isDevFn(mode: string): boolean {
|
|
4
|
-
return mode === "development";
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function isProdFn(mode: string): boolean {
|
|
8
|
-
return mode === "production";
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function isTestFn(mode: string): boolean {
|
|
12
|
-
return mode === "test";
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 是否生成包预览
|
|
17
|
-
*/
|
|
18
|
-
export function isReportMode(): boolean {
|
|
19
|
-
return process.env.VITE_REPORT === "true";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Read all environment variable configuration files to process.env
|
|
23
|
-
export function wrapperEnv(envConf: Recordable): ViteEnv {
|
|
24
|
-
const ret: any = {};
|
|
25
|
-
|
|
26
|
-
for (const envName of Object.keys(envConf)) {
|
|
27
|
-
let realName = envConf[envName].replace(/\\n/g, "\n");
|
|
28
|
-
realName = realName === "true" ? true : realName === "false" ? false : realName;
|
|
29
|
-
if (envName === "VITE_PORT") realName = Number(realName);
|
|
30
|
-
if (envName === "VITE_PROXY") {
|
|
31
|
-
try {
|
|
32
|
-
realName = JSON.parse(realName);
|
|
33
|
-
} catch (error) {}
|
|
34
|
-
}
|
|
35
|
-
ret[envName] = realName;
|
|
36
|
-
}
|
|
37
|
-
return ret;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* 获取用户根目录
|
|
42
|
-
* @param dir file path
|
|
43
|
-
*/
|
|
44
|
-
export function getRootPath(...dir: string[]) {
|
|
45
|
-
return path.resolve(process.cwd(), ...dir);
|
|
46
|
-
}
|
package/build/plugins.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
import { PluginOption } from "vite";
|
|
3
|
-
import { VitePWA } from "vite-plugin-pwa";
|
|
4
|
-
import { visualizer } from "rollup-plugin-visualizer";
|
|
5
|
-
import { createHtmlPlugin } from "vite-plugin-html";
|
|
6
|
-
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
|
7
|
-
import AutoImport from "unplugin-auto-import/vite";
|
|
8
|
-
import Components from "unplugin-vue-components/vite";
|
|
9
|
-
// import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
|
10
|
-
import vue from "@vitejs/plugin-vue";
|
|
11
|
-
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
12
|
-
import eslintPlugin from "vite-plugin-eslint";
|
|
13
|
-
import dts from "vite-plugin-dts";
|
|
14
|
-
/**
|
|
15
|
-
* 创建 vite 插件
|
|
16
|
-
* @param viteEnv
|
|
17
|
-
*/
|
|
18
|
-
export const createVitePlugins = (viteEnv: ViteEnv): (PluginOption | PluginOption[])[] => {
|
|
19
|
-
const { VITE_GLOB_APP_TITLE, VITE_REPORT, VITE_PWA, VITE_USER_NODE_ENV } = viteEnv;
|
|
20
|
-
return [
|
|
21
|
-
vue(),
|
|
22
|
-
dts(),
|
|
23
|
-
// vue 可以使用 jsx/tsx 语法
|
|
24
|
-
vueJsx(),
|
|
25
|
-
AutoImport({
|
|
26
|
-
// 在哪些文件里可以直接引入
|
|
27
|
-
include: [
|
|
28
|
-
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
|
|
29
|
-
/\.vue$/,
|
|
30
|
-
/\.md$/ // .md
|
|
31
|
-
],
|
|
32
|
-
// 自动引入哪些包
|
|
33
|
-
imports: [
|
|
34
|
-
// 自动引入整个模块
|
|
35
|
-
"vue",
|
|
36
|
-
{
|
|
37
|
-
"element-plus": ["ElMessage", "ElMessageBox", "ElNotification"], //消息提示/通知
|
|
38
|
-
"@/api/index": ["http", "axiosController", "axiosFileController"], // axios请求api
|
|
39
|
-
"@/utils/validate.ts": [["*", "validate"]], //文本校验函数
|
|
40
|
-
"@/utils/is/index.ts": [["*", "is"]], //判断值类型
|
|
41
|
-
"@/utils/serviceDict": [["*", "serviceDict"]] //字典库
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
// 声明文件
|
|
45
|
-
// resolvers: [ElementPlusResolver()],
|
|
46
|
-
// Auto import inside Vue template
|
|
47
|
-
vueTemplate: true,
|
|
48
|
-
dirs: ["@/utils"],
|
|
49
|
-
dts: true,
|
|
50
|
-
eslintrc: {
|
|
51
|
-
enabled: true,
|
|
52
|
-
filepath: "./.eslintrc-auto-import.json", // Default `./.eslintrc-auto-import.json`
|
|
53
|
-
globalsPropValue: true // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable')
|
|
54
|
-
} //auto generation auto-imports.d.ts file
|
|
55
|
-
}),
|
|
56
|
-
// 自动注册组件 无需再手动引入
|
|
57
|
-
//https://github.com/antfu/unplugin-auto-import/blob/HEAD/src/types.ts
|
|
58
|
-
Components(
|
|
59
|
-
VITE_USER_NODE_ENV === "development"
|
|
60
|
-
? {
|
|
61
|
-
dts: true, //默认生成的文件位置
|
|
62
|
-
dirs: ["src/components"], // 要搜索组件的目录的相对路径
|
|
63
|
-
extensions: ["vue", "jsx", "tsx"], // 文件类型
|
|
64
|
-
// deep: false, // 搜索子目录
|
|
65
|
-
// ui库解析器,也可以自定义,需要安装相关UI库
|
|
66
|
-
// resolvers: [],
|
|
67
|
-
include: [/.vue$/, /.vue?vue/],
|
|
68
|
-
exclude: [/[\/]node_modules[\/]/, /[\/].git[\/]/, /[\/].nuxt[\/]/]
|
|
69
|
-
}
|
|
70
|
-
: {}
|
|
71
|
-
),
|
|
72
|
-
// esLint 报错信息显示在浏览器界面上
|
|
73
|
-
eslintPlugin(),
|
|
74
|
-
// 注入变量到 html 文件
|
|
75
|
-
createHtmlPlugin({
|
|
76
|
-
minify: true,
|
|
77
|
-
pages: [
|
|
78
|
-
{
|
|
79
|
-
entry: "/src/main.ts",
|
|
80
|
-
filename: "index.html",
|
|
81
|
-
template: "index.html",
|
|
82
|
-
injectOptions: {
|
|
83
|
-
data: { title: VITE_GLOB_APP_TITLE }
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
}),
|
|
88
|
-
// 使用 svg 图标
|
|
89
|
-
// <SvgIcon name="xianxingdaoyu" />
|
|
90
|
-
createSvgIconsPlugin({
|
|
91
|
-
iconDirs: [
|
|
92
|
-
resolve(process.cwd(), "src/assets/global-icons"),
|
|
93
|
-
resolve(process.cwd(), "src/assets/option-icons"),
|
|
94
|
-
resolve(process.cwd(), "src/assets/route-icons")
|
|
95
|
-
]
|
|
96
|
-
// appoint svg icon using mode
|
|
97
|
-
// symbolId: "icon-[dir]-[name]"
|
|
98
|
-
}),
|
|
99
|
-
// vitePWA
|
|
100
|
-
VITE_PWA && createVitePwa(viteEnv),
|
|
101
|
-
// 是否生成包预览,分析依赖包大小做优化处理
|
|
102
|
-
VITE_REPORT && (visualizer({ filename: "stats.html", gzipSize: true, brotliSize: true }) as Plugin)
|
|
103
|
-
];
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @description VitePwa
|
|
108
|
-
* @param viteEnv
|
|
109
|
-
*/
|
|
110
|
-
const createVitePwa = (viteEnv: ViteEnv): PluginOption | PluginOption[] => {
|
|
111
|
-
const { VITE_GLOB_APP_TITLE } = viteEnv;
|
|
112
|
-
return VitePWA({
|
|
113
|
-
registerType: "autoUpdate",
|
|
114
|
-
manifest: {
|
|
115
|
-
name: VITE_GLOB_APP_TITLE,
|
|
116
|
-
short_name: VITE_GLOB_APP_TITLE,
|
|
117
|
-
theme_color: "#ffffff",
|
|
118
|
-
icons: [
|
|
119
|
-
{
|
|
120
|
-
src: "/logo.png",
|
|
121
|
-
sizes: "192x192",
|
|
122
|
-
type: "image/png"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
src: "/logo.png",
|
|
126
|
-
sizes: "512x512",
|
|
127
|
-
type: "image/png"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
src: "/logo.png",
|
|
131
|
-
sizes: "512x512",
|
|
132
|
-
type: "image/png",
|
|
133
|
-
purpose: "any maskable"
|
|
134
|
-
}
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
};
|
package/build/proxy.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ProxyOptions } from "vite";
|
|
2
|
-
|
|
3
|
-
type ProxyItem = [string, string];
|
|
4
|
-
|
|
5
|
-
type ProxyList = ProxyItem[];
|
|
6
|
-
|
|
7
|
-
type ProxyTargetList = Record<string, ProxyOptions>;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 创建代理,用于解析 .env.development 代理配置
|
|
11
|
-
* @param list
|
|
12
|
-
*/
|
|
13
|
-
export function createProxy(list: ProxyList = []) {
|
|
14
|
-
const ret: ProxyTargetList = {};
|
|
15
|
-
for (const [prefix, target] of list) {
|
|
16
|
-
const isHttps = /^https:\/\//.test(target);
|
|
17
|
-
// https://github.com/http-party/node-http-proxy#options
|
|
18
|
-
ret[prefix] = {
|
|
19
|
-
target: target,
|
|
20
|
-
changeOrigin: true,
|
|
21
|
-
ws: true,
|
|
22
|
-
rewrite: path => path.replace(new RegExp(`^${prefix}`), ""),
|
|
23
|
-
// https is require secure=false
|
|
24
|
-
...(isHttps ? { secure: false } : {})
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
return ret;
|
|
28
|
-
}
|
package/commitlint.config.cjs
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// @see: https://cz-git.qbenben.com/zh/guide
|
|
2
|
-
const fs = require("fs");
|
|
3
|
-
const path = require("path");
|
|
4
|
-
|
|
5
|
-
const scopes = fs
|
|
6
|
-
.readdirSync(path.resolve(__dirname, "src"), { withFileTypes: true })
|
|
7
|
-
.filter(dirent => dirent.isDirectory())
|
|
8
|
-
.map(dirent => dirent.name.replace(/s$/, ""));
|
|
9
|
-
|
|
10
|
-
/** @type {import('cz-git').UserConfig} */
|
|
11
|
-
module.exports = {
|
|
12
|
-
ignores: [commit => commit.includes("init")],
|
|
13
|
-
extends: ["@commitlint/config-conventional"],
|
|
14
|
-
rules: {
|
|
15
|
-
// @see: https://commitlint.js.org/#/reference-rules
|
|
16
|
-
"body-leading-blank": [2, "always"],
|
|
17
|
-
"footer-leading-blank": [1, "always"],
|
|
18
|
-
"header-max-length": [2, "always", 108],
|
|
19
|
-
"subject-empty": [2, "never"],
|
|
20
|
-
"type-empty": [2, "never"],
|
|
21
|
-
"subject-case": [0],
|
|
22
|
-
"type-enum": [
|
|
23
|
-
2,
|
|
24
|
-
"always",
|
|
25
|
-
[
|
|
26
|
-
"feat",
|
|
27
|
-
"fix",
|
|
28
|
-
"docs",
|
|
29
|
-
"style",
|
|
30
|
-
"refactor",
|
|
31
|
-
"perf",
|
|
32
|
-
"test",
|
|
33
|
-
"build",
|
|
34
|
-
"ci",
|
|
35
|
-
"chore",
|
|
36
|
-
"revert",
|
|
37
|
-
"wip",
|
|
38
|
-
"workflow",
|
|
39
|
-
"types",
|
|
40
|
-
"release"
|
|
41
|
-
]
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
prompt: {
|
|
45
|
-
messages: {
|
|
46
|
-
type: "选择你要提交的类型 :",
|
|
47
|
-
scope: "选择一个提交范围(可选):",
|
|
48
|
-
customScope: "请输入自定义的提交范围 :",
|
|
49
|
-
subject: "填写简短精炼的变更描述 :\n",
|
|
50
|
-
body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n',
|
|
51
|
-
breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n',
|
|
52
|
-
footerPrefixsSelect: "选择关联issue前缀(可选):",
|
|
53
|
-
customFooterPrefixs: "输入自定义issue前缀 :",
|
|
54
|
-
footer: "列举关联issue (可选) 例如: #31, #I3244 :\n",
|
|
55
|
-
confirmCommit: "是否提交或修改commit ?"
|
|
56
|
-
},
|
|
57
|
-
types: [
|
|
58
|
-
{ value: "feat", name: "特性: 🚀 新增功能", emoji: "🚀" },
|
|
59
|
-
{ value: "fix", name: "修复: 🧩 修复缺陷", emoji: "🧩" },
|
|
60
|
-
{ value: "docs", name: "文档: 📚 文档变更", emoji: "📚" },
|
|
61
|
-
{ value: "style", name: "格式: 🎨 代码格式(不影响功能,例如空格、分号等格式修正)", emoji: "🎨" },
|
|
62
|
-
{ value: "refactor", name: "重构: ♻️ 代码重构(不包括 bug 修复、功能新增)", emoji: "♻️" },
|
|
63
|
-
{ value: "perf", name: "性能: ⚡️ 性能优化", emoji: "⚡️" },
|
|
64
|
-
{ value: "test", name: "测试: ✅ 添加疏漏测试或已有测试改动", emoji: "✅" },
|
|
65
|
-
{
|
|
66
|
-
value: "build",
|
|
67
|
-
name: "构建: 📦️ 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)",
|
|
68
|
-
emoji: "📦️"
|
|
69
|
-
},
|
|
70
|
-
{ value: "ci", name: "集成: 🎡 修改 CI 配置、脚本", emoji: "🎡" },
|
|
71
|
-
{ value: "revert", name: "回退: ⏪️ 回滚 commit", emoji: "⏪️" },
|
|
72
|
-
{ value: "chore", name: "其他: 🔨 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)", emoji: "🔨" },
|
|
73
|
-
{ value: "wip", name: "开发: 🕔 正在开发中", emoji: "🕔" },
|
|
74
|
-
{ value: "workflow", name: "工作流: 📋 工作流程改进", emoji: "📋" },
|
|
75
|
-
{ value: "types", name: "类型: 🔰 类型定义文件修改", emoji: "🔰" }
|
|
76
|
-
],
|
|
77
|
-
useEmoji: true,
|
|
78
|
-
scopes: [...scopes],
|
|
79
|
-
customScopesAlign: "bottom",
|
|
80
|
-
emptyScopesAlias: "empty",
|
|
81
|
-
customScopesAlias: "custom",
|
|
82
|
-
allowBreakingChanges: ["feat", "fix"]
|
|
83
|
-
}
|
|
84
|
-
};
|
package/components.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// generated by unplugin-vue-components
|
|
2
|
-
// We suggest you to commit this file into source control
|
|
3
|
-
// Read more: https://github.com/vuejs/core/pull/3399
|
|
4
|
-
import '@vue/runtime-core'
|
|
5
|
-
|
|
6
|
-
export {}
|
|
7
|
-
|
|
8
|
-
declare module '@vue/runtime-core' {
|
|
9
|
-
export interface GlobalComponents {
|
|
10
|
-
ColSetting: typeof import('./src/components/ProTable/components/ColSetting.vue')['default']
|
|
11
|
-
CSvgIcon: typeof import('./src/components/CSvgIcon/index.vue')['default']
|
|
12
|
-
CTree: typeof import('./src/components/CTree/index.vue')['default']
|
|
13
|
-
Dialog: typeof import('./src/components/Dialog/index.vue')['default']
|
|
14
|
-
Empty: typeof import('./src/components/Empty/index.vue')['default']
|
|
15
|
-
Grid: typeof import('./src/components/Grid/index.vue')['default']
|
|
16
|
-
GridItem: typeof import('./src/components/Grid/components/GridItem.vue')['default']
|
|
17
|
-
Loading: typeof import('./src/components/Loading/index.vue')['default']
|
|
18
|
-
Overflow: typeof import('./src/components/Overflow/index.vue')['default']
|
|
19
|
-
Pagination: typeof import('./src/components/ProTable/components/Pagination.vue')['default']
|
|
20
|
-
ProTable: typeof import('./src/components/ProTable/index.vue')['default']
|
|
21
|
-
ScrollBox: typeof import('./src/components/ScrollBox/index.vue')['default']
|
|
22
|
-
SearchForm: typeof import('./src/components/ProTable/components/SearchForm/index.vue')['default']
|
|
23
|
-
SearchFormItem: typeof import('./src/components/ProTable/components/SearchForm/components/SearchFormItem.vue')['default']
|
|
24
|
-
SvgIcon: typeof import('./src/components/SvgIcon/index.vue')['default']
|
|
25
|
-
TableColumn: typeof import('./src/components/ProTable/components/TableColumn.vue')['default']
|
|
26
|
-
Tabs: typeof import('./src/components/Tabs/index.vue')['default']
|
|
27
|
-
}
|
|
28
|
-
}
|
package/lint-staged.config.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
|
|
3
|
-
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": ["prettier --write--parser json"],
|
|
4
|
-
"package.json": ["prettier --write"],
|
|
5
|
-
"*.vue": ["eslint --fix", "prettier --write", "stylelint --fix"],
|
|
6
|
-
"*.{scss,less,styl,html}": ["stylelint --fix", "prettier --write"],
|
|
7
|
-
"*.md": ["prettier --write"]
|
|
8
|
-
};
|
package/postcss.config.cjs
DELETED
package/src/App.vue
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-config-provider :locale="zhCn" :size="size[1]" :button="buttonConfig">
|
|
3
|
-
<test></test>
|
|
4
|
-
</el-config-provider>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import { ElConfigProvider } from "element-plus";
|
|
9
|
-
import zhCn from "element-plus/es/locale/lang/zh-cn";
|
|
10
|
-
import { AssemblySizeType } from "@/stores/interface/index";
|
|
11
|
-
import test from "@/plugins/index.vue";
|
|
12
|
-
const size: AssemblySizeType[] = ["large", "default", "small"];
|
|
13
|
-
|
|
14
|
-
// element button config
|
|
15
|
-
const buttonConfig = reactive({ autoInsertSpace: false });
|
|
16
|
-
</script>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description:请求配置
|
|
3
|
-
*/
|
|
4
|
-
export enum ResultEnum {
|
|
5
|
-
SUCCESS = 200,
|
|
6
|
-
ERROR = 500,
|
|
7
|
-
OVERDUE = 401,
|
|
8
|
-
TIMEOUT = 30000,
|
|
9
|
-
TYPE = "success"
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description:请求方法
|
|
14
|
-
*/
|
|
15
|
-
export enum RequestEnum {
|
|
16
|
-
GET = "GET",
|
|
17
|
-
POST = "POST",
|
|
18
|
-
PATCH = "PATCH",
|
|
19
|
-
PUT = "PUT",
|
|
20
|
-
DELETE = "DELETE"
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @description:常用的 contentTyp 类型
|
|
25
|
-
*/
|
|
26
|
-
export enum ContentTypeEnum {
|
|
27
|
-
// json
|
|
28
|
-
JSON = "application/json;charset=UTF-8",
|
|
29
|
-
// text
|
|
30
|
-
TEXT = "text/plain;charset=UTF-8",
|
|
31
|
-
// form-data 一般配合qs
|
|
32
|
-
FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8",
|
|
33
|
-
// form-data 上传
|
|
34
|
-
FORM_DATA = "multipart/form-data;charset=UTF-8"
|
|
35
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// ? 暂未使用,目前使用全局 Loading 来控制重复请求
|
|
2
|
-
import { CustomAxiosRequestConfig } from "../index";
|
|
3
|
-
import qs from "qs";
|
|
4
|
-
|
|
5
|
-
// 声明一个 Map 用于存储每个请求的标识 和 取消函数
|
|
6
|
-
export let pendingMap = new Map<string, AbortController>();
|
|
7
|
-
|
|
8
|
-
// 序列化参数
|
|
9
|
-
export const getPendingUrl = (config: CustomAxiosRequestConfig) =>
|
|
10
|
-
[config.method, config.url, qs.stringify(config.data), qs.stringify(config.params)].join("&");
|
|
11
|
-
|
|
12
|
-
export class AxiosCanceler {
|
|
13
|
-
/**
|
|
14
|
-
* @description: 添加请求
|
|
15
|
-
* @param {Object} config
|
|
16
|
-
* @return void
|
|
17
|
-
*/
|
|
18
|
-
addPending(config: CustomAxiosRequestConfig) {
|
|
19
|
-
// 在请求开始前,对之前的请求做检查取消操作
|
|
20
|
-
this.removePending(config);
|
|
21
|
-
const url = getPendingUrl(config);
|
|
22
|
-
const controller = new AbortController();
|
|
23
|
-
config.signal = controller.signal;
|
|
24
|
-
pendingMap.set(url, controller);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @description: 移除请求
|
|
29
|
-
* @param {Object} config
|
|
30
|
-
*/
|
|
31
|
-
removePending(config: CustomAxiosRequestConfig) {
|
|
32
|
-
const url = getPendingUrl(config);
|
|
33
|
-
// 如果在 pending 中存在当前请求标识,需要取消当前请求
|
|
34
|
-
const controller = pendingMap.get(url);
|
|
35
|
-
if (controller) {
|
|
36
|
-
controller.abort();
|
|
37
|
-
pendingMap.delete(url);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @description: 清空所有pending
|
|
43
|
-
*/
|
|
44
|
-
removeAllPending() {
|
|
45
|
-
pendingMap.forEach(controller => {
|
|
46
|
-
controller && controller.abort();
|
|
47
|
-
});
|
|
48
|
-
pendingMap.clear();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { CustomAxiosRequestConfig } from "../index";
|
|
2
|
-
import { PORT, UploadUrl } from "@/api/config/servicePort";
|
|
3
|
-
// 声明一个 Map 用于存储每个请求的标识 和 取消函数
|
|
4
|
-
export let pendingMap = new Map<string, AbortController>();
|
|
5
|
-
|
|
6
|
-
// 序列化参数
|
|
7
|
-
export const getPendingUrl = (config: CustomAxiosRequestConfig) => [config.url, config.fileUid].join("&");
|
|
8
|
-
|
|
9
|
-
export class AxiosFileCancel {
|
|
10
|
-
size() {
|
|
11
|
-
return pendingMap.size;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @description: 添加请求
|
|
15
|
-
* @param {Object} config
|
|
16
|
-
* @return void
|
|
17
|
-
*/
|
|
18
|
-
addPending(config: CustomAxiosRequestConfig) {
|
|
19
|
-
// 在请求开始前,对之前的请求做检查取消操作
|
|
20
|
-
this.removePending(config);
|
|
21
|
-
const url = getPendingUrl(config);
|
|
22
|
-
const controller = new AbortController();
|
|
23
|
-
config.signal = controller.signal;
|
|
24
|
-
pendingMap.set(url, controller);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @description: 移除请求
|
|
29
|
-
* @param {Object} config
|
|
30
|
-
*/
|
|
31
|
-
removePending(config: CustomAxiosRequestConfig) {
|
|
32
|
-
const url = getPendingUrl(config);
|
|
33
|
-
// 如果在 pending 中存在当前请求标识,需要取消当前请求
|
|
34
|
-
const controller = pendingMap.get(url);
|
|
35
|
-
if (controller) {
|
|
36
|
-
controller.abort();
|
|
37
|
-
pendingMap.delete(url);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @description: 根据fileUid移除指定请求
|
|
42
|
-
* @param {number} fileUid
|
|
43
|
-
*/
|
|
44
|
-
removeSpecifyPending(fileUid: number) {
|
|
45
|
-
let pendingUrl = [PORT + UploadUrl, fileUid].join("&");
|
|
46
|
-
// 如果在 pending 中存在当前请求标识,需要取消当前请求
|
|
47
|
-
const controller = pendingMap.get(pendingUrl);
|
|
48
|
-
if (controller) {
|
|
49
|
-
controller.abort();
|
|
50
|
-
pendingMap.delete(pendingUrl);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @description: 清空所有pending
|
|
55
|
-
*/
|
|
56
|
-
removeAllPending() {
|
|
57
|
-
pendingMap.forEach(controller => {
|
|
58
|
-
controller && controller.abort();
|
|
59
|
-
});
|
|
60
|
-
pendingMap.clear();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { ElMessage } from "element-plus";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description: 校验网络请求状态码
|
|
5
|
-
* @param {Number} status
|
|
6
|
-
* @return void
|
|
7
|
-
*/
|
|
8
|
-
export const checkStatus = (status: number) => {
|
|
9
|
-
switch (status) {
|
|
10
|
-
case 400:
|
|
11
|
-
ElMessage.error("请求失败!请您稍后重试");
|
|
12
|
-
break;
|
|
13
|
-
case 401:
|
|
14
|
-
ElMessage.error("登录失效!请您重新登录");
|
|
15
|
-
break;
|
|
16
|
-
case 403:
|
|
17
|
-
ElMessage.error("当前账号无权限访问!");
|
|
18
|
-
break;
|
|
19
|
-
case 404:
|
|
20
|
-
ElMessage.error("你所访问的资源不存在!");
|
|
21
|
-
break;
|
|
22
|
-
case 405:
|
|
23
|
-
ElMessage.error("请求方式错误!请您稍后重试");
|
|
24
|
-
break;
|
|
25
|
-
case 406:
|
|
26
|
-
ElMessage.error("请求头有误!请查看请求头配置是否有误");
|
|
27
|
-
break;
|
|
28
|
-
case 408:
|
|
29
|
-
ElMessage.error("请求超时!请您稍后重试");
|
|
30
|
-
break;
|
|
31
|
-
case 409:
|
|
32
|
-
ElMessage.error("处理请求时发生冲突。在处理请求时,资源可能已被修改。");
|
|
33
|
-
break;
|
|
34
|
-
case 410:
|
|
35
|
-
ElMessage.error("请求的URL在此服务器上不再可用,并且没有转发地址。");
|
|
36
|
-
break;
|
|
37
|
-
case 411:
|
|
38
|
-
ElMessage.error("使用此方法的请求需要一个有效的Content-Length报头。");
|
|
39
|
-
break;
|
|
40
|
-
case 412:
|
|
41
|
-
ElMessage.error("URL请求的前提条件未通过正评估。");
|
|
42
|
-
break;
|
|
43
|
-
case 413:
|
|
44
|
-
ElMessage.error("传输的数据值超过容量限制。");
|
|
45
|
-
break;
|
|
46
|
-
case 414:
|
|
47
|
-
ElMessage.error("请求的URL长度超过此服务器的容量限制。无法处理请求。");
|
|
48
|
-
break;
|
|
49
|
-
case 415:
|
|
50
|
-
ElMessage.error("服务器不支持请求中传输的媒体类型。");
|
|
51
|
-
break;
|
|
52
|
-
case 416:
|
|
53
|
-
ElMessage.error("服务器无法提供请求的范围。");
|
|
54
|
-
break;
|
|
55
|
-
case 417:
|
|
56
|
-
ElMessage.error("服务器无法满足Expect标头的要求.");
|
|
57
|
-
break;
|
|
58
|
-
case 418:
|
|
59
|
-
ElMessage.error("预料之外的请求.");
|
|
60
|
-
break;
|
|
61
|
-
case 422:
|
|
62
|
-
ElMessage.error("请求格式良好,但由于语义错误而无法执行。");
|
|
63
|
-
break;
|
|
64
|
-
case 423:
|
|
65
|
-
ElMessage.error("正在访问的资源被锁定。");
|
|
66
|
-
break;
|
|
67
|
-
case 424:
|
|
68
|
-
ElMessage.error("无法在资源上执行该方法,因为请求的操作依赖于另一个操作,而该操作失败了。");
|
|
69
|
-
break;
|
|
70
|
-
case 428:
|
|
71
|
-
ElMessage.error("这项请求必须是有条件的;尝试使用If-Match或If-Unmodified-Since。");
|
|
72
|
-
break;
|
|
73
|
-
case 429:
|
|
74
|
-
ElMessage.error("此用户已超过分配的请求数。请稍后再试。");
|
|
75
|
-
break;
|
|
76
|
-
case 431:
|
|
77
|
-
ElMessage.error("一个或多个报头字段超过最大大小。");
|
|
78
|
-
break;
|
|
79
|
-
case 451:
|
|
80
|
-
ElMessage.error("由于法律原因无法使用。");
|
|
81
|
-
break;
|
|
82
|
-
case 500:
|
|
83
|
-
ElMessage.error("服务异常!");
|
|
84
|
-
break;
|
|
85
|
-
case 502:
|
|
86
|
-
ElMessage.error("网关错误!");
|
|
87
|
-
break;
|
|
88
|
-
case 503:
|
|
89
|
-
ElMessage.error("服务不可用!");
|
|
90
|
-
break;
|
|
91
|
-
case 504:
|
|
92
|
-
ElMessage.error("网关超时!");
|
|
93
|
-
break;
|
|
94
|
-
default:
|
|
95
|
-
ElMessage.error("请求失败!");
|
|
96
|
-
}
|
|
97
|
-
};
|