zyf-model-engine 0.0.1
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/.editorconfig +15 -0
- package/.env +13 -0
- package/.env.development +20 -0
- package/.env.production +25 -0
- package/.env.test +25 -0
- package/.eslintignore +15 -0
- package/.eslintrc-auto-import.json +65 -0
- package/.eslintrc.cjs +66 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +5 -0
- package/.prettierignore +9 -0
- package/.prettierrc.cjs +41 -0
- package/.stylelintignore +4 -0
- package/.stylelintrc.cjs +40 -0
- package/.vscode/extensions.json +14 -0
- package/.vscode/settings.json +92 -0
- package/CHANGELOG.md +246 -0
- package/LICENSE +21 -0
- package/README.md +205 -0
- package/auto-imports.d.ts +132 -0
- package/build/getEnv.ts +46 -0
- package/build/plugins.ts +138 -0
- package/build/proxy.ts +28 -0
- package/commitlint.config.cjs +84 -0
- package/components.d.ts +28 -0
- package/index.html +105 -0
- package/lint-staged.config.cjs +8 -0
- package/package.json +108 -0
- package/postcss.config.cjs +5 -0
- package/public/logo.png +0 -0
- package/src/App.vue +16 -0
- package/src/api/config/servicePort.ts +3 -0
- package/src/api/enums/httpEnum.ts +35 -0
- package/src/api/helper/axiosCancel.ts +50 -0
- package/src/api/helper/axiosFileCancel.ts +62 -0
- package/src/api/helper/checkStatus.ts +97 -0
- package/src/api/index.ts +142 -0
- package/src/api/interface/index.ts +27 -0
- package/src/assets/global-icons/icon-demo.svg +1 -0
- package/src/assets/iconfont/iconfont.scss +44 -0
- package/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/assets/images/empty-img.png +0 -0
- package/src/assets/option-icons/add.svg +1 -0
- package/src/assets/option-icons/check.svg +1 -0
- package/src/assets/option-icons/config.svg +1 -0
- package/src/assets/option-icons/del.svg +1 -0
- package/src/assets/option-icons/detail.svg +1 -0
- package/src/assets/option-icons/edit.svg +2 -0
- package/src/assets/option-icons/export.svg +1 -0
- package/src/assets/option-icons/folder.svg +1 -0
- package/src/assets/option-icons/full-screen.svg +1 -0
- package/src/assets/option-icons/more.svg +1 -0
- package/src/assets/option-icons/return.svg +1 -0
- package/src/assets/option-icons/search.svg +1 -0
- package/src/components/CSvgIcon/index.scss +23 -0
- package/src/components/CSvgIcon/index.vue +74 -0
- package/src/components/CTree/index.scss +48 -0
- package/src/components/CTree/index.vue +176 -0
- package/src/components/CTree/interface/index.ts +6 -0
- package/src/components/Dialog/index.scss +74 -0
- package/src/components/Dialog/index.vue +87 -0
- package/src/components/Empty/index.scss +16 -0
- package/src/components/Empty/index.vue +43 -0
- package/src/components/Grid/components/GridItem.vue +68 -0
- package/src/components/Grid/index.vue +167 -0
- package/src/components/Grid/interface/index.ts +6 -0
- package/src/components/Loading/index.scss +67 -0
- package/src/components/Loading/index.vue +13 -0
- package/src/components/Overflow/index.vue +76 -0
- package/src/components/ProTable/components/ColSetting.vue +45 -0
- package/src/components/ProTable/components/Pagination.vue +29 -0
- package/src/components/ProTable/components/SearchForm/components/SearchFormItem.vue +93 -0
- package/src/components/ProTable/components/SearchForm/index.scss +12 -0
- package/src/components/ProTable/components/SearchForm/index.vue +91 -0
- package/src/components/ProTable/components/TableColumn.vue +56 -0
- package/src/components/ProTable/index.scss +14 -0
- package/src/components/ProTable/index.vue +274 -0
- package/src/components/ProTable/interface/index.ts +86 -0
- package/src/components/ScrollBox/index.vue +44 -0
- package/src/components/SvgIcon/index.vue +20 -0
- package/src/components/Tabs/index.vue +142 -0
- package/src/config/index.ts +12 -0
- package/src/config/nprogress.ts +12 -0
- package/src/config/piniaPersist.ts +19 -0
- package/src/config/serviceLoading.ts +45 -0
- package/src/enums/httpEnum.ts +24 -0
- package/src/hooks/interface/index.ts +32 -0
- package/src/hooks/useOnline.ts +27 -0
- package/src/hooks/useTable.ts +167 -0
- package/src/main.ts +35 -0
- package/src/plugins/button/button.vue +56 -0
- package/src/plugins/index.js +26 -0
- package/src/plugins/index.vue +24 -0
- package/src/plugins/msg/msg.vue +56 -0
- package/src/stores/commonStore.ts +9 -0
- package/src/stores/index.ts +8 -0
- package/src/stores/interface/index.ts +1 -0
- package/src/styles/common.scss +87 -0
- package/src/styles/element.scss +233 -0
- package/src/styles/reset.scss +20 -0
- package/src/styles/var.scss +2 -0
- package/src/typings/global.d.ts +37 -0
- package/src/typings/window.d.ts +8 -0
- package/src/utils/color.ts +59 -0
- package/src/utils/commonUtils.ts +175 -0
- package/src/utils/errorHandler.ts +28 -0
- package/src/utils/is.ts +147 -0
- package/src/utils/layoutUtils.ts +83 -0
- package/src/utils/localUtils.ts +42 -0
- package/src/utils/serviceDict.ts +9 -0
- package/src/vite-env.d.ts +6 -0
- package/tsconfig.json +50 -0
- package/vite.config.ts +76 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export namespace Table {
|
|
2
|
+
export interface Pageable {
|
|
3
|
+
page: number;
|
|
4
|
+
limit: number;
|
|
5
|
+
total: number;
|
|
6
|
+
}
|
|
7
|
+
export 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
|
+
|
|
25
|
+
export namespace HandleData {
|
|
26
|
+
export type MessageType = "" | "success" | "warning" | "info" | "error";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export namespace Theme {
|
|
30
|
+
export type ThemeType = "light" | "inverted" | "dark";
|
|
31
|
+
export type GreyOrWeakType = "grey" | "weak";
|
|
32
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted } from "vue";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description 网络是否可用
|
|
5
|
+
* */
|
|
6
|
+
export const useOnline = () => {
|
|
7
|
+
const online = ref(true);
|
|
8
|
+
const showStatus = (val: any) => {
|
|
9
|
+
online.value = typeof val == "boolean" ? val : val.target.online;
|
|
10
|
+
};
|
|
11
|
+
// 在页面加载后,设置正确的网络状态
|
|
12
|
+
navigator.onLine ? showStatus(true) : showStatus(false);
|
|
13
|
+
|
|
14
|
+
onMounted(() => {
|
|
15
|
+
// 开始监听网络状态的变化
|
|
16
|
+
window.addEventListener("online", showStatus);
|
|
17
|
+
window.addEventListener("offline", showStatus);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
onUnmounted(() => {
|
|
21
|
+
// 移除监听网络状态的变化
|
|
22
|
+
window.removeEventListener("online", showStatus);
|
|
23
|
+
window.removeEventListener("offline", showStatus);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return { online };
|
|
27
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { Table } from "./interface";
|
|
2
|
+
import { http } from "@/api/index";
|
|
3
|
+
import { fetchType } from "@/api/interface/index";
|
|
4
|
+
/**
|
|
5
|
+
* @description table 页面操作方法封装
|
|
6
|
+
* @param {Function} api 获取表格数据 api 方法 (必传)
|
|
7
|
+
* @param {Object} initParam 获取数据初始化参数 (非必传,默认为{})
|
|
8
|
+
* @param {Boolean} isPageable 是否有分页 (非必传,默认为true)
|
|
9
|
+
* @param {Function} dataCallBack 对后台返回的数据进行处理的方法 (非必传)
|
|
10
|
+
* */
|
|
11
|
+
export const useTable = (
|
|
12
|
+
initParam: object = {},
|
|
13
|
+
isPageable: boolean = true,
|
|
14
|
+
fetchType: fetchType,
|
|
15
|
+
tableLimit: number = 10,
|
|
16
|
+
api?: string | ((params: any) => Promise<any>),
|
|
17
|
+
|
|
18
|
+
dataCallBack?: (data: any) => any,
|
|
19
|
+
requestError?: (error: any) => void
|
|
20
|
+
) => {
|
|
21
|
+
const state = reactive<Table.StateProps>({
|
|
22
|
+
// 表格数据
|
|
23
|
+
tableData: [],
|
|
24
|
+
// 分页数据
|
|
25
|
+
pageable: {
|
|
26
|
+
// 当前页数
|
|
27
|
+
page: 1,
|
|
28
|
+
// 每页显示条数
|
|
29
|
+
limit: tableLimit,
|
|
30
|
+
// // 总条数
|
|
31
|
+
total: 0
|
|
32
|
+
},
|
|
33
|
+
// 查询参数(只包括查询)
|
|
34
|
+
searchParam: {},
|
|
35
|
+
// 初始化默认的查询参数
|
|
36
|
+
searchInitParam: {},
|
|
37
|
+
// 总参数(包含分页和查询参数)
|
|
38
|
+
totalParam: {}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @description 分页查询参数(只包括分页和表格字段排序,其他排序方式可自行配置)
|
|
43
|
+
* */
|
|
44
|
+
const pageParam = computed({
|
|
45
|
+
get: () => {
|
|
46
|
+
return {
|
|
47
|
+
page: state.pageable.page,
|
|
48
|
+
limit: state.pageable.limit
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
set: (newVal: any) => {
|
|
52
|
+
console.log("我是分页更新之后的值", newVal);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @description 获取表格数据
|
|
58
|
+
* @return void
|
|
59
|
+
* */
|
|
60
|
+
const getTableList = async () => {
|
|
61
|
+
if (!api) return;
|
|
62
|
+
try {
|
|
63
|
+
// 先把初始化参数和分页参数放到总参数里面
|
|
64
|
+
Object.assign(state.totalParam, initParam, isPageable ? pageParam.value : {});
|
|
65
|
+
|
|
66
|
+
let data =
|
|
67
|
+
typeof api === "string"
|
|
68
|
+
? await http[fetchType](api, { params: { ...state.searchInitParam, ...state.totalParam } })
|
|
69
|
+
: await api({ params: { ...state.searchInitParam, ...state.totalParam } });
|
|
70
|
+
|
|
71
|
+
dataCallBack && (data = await dataCallBack(data));
|
|
72
|
+
state.tableData = data.items || data;
|
|
73
|
+
// 解构后台返回的分页数据 (如果有分页更新分页信息)
|
|
74
|
+
if (isPageable) {
|
|
75
|
+
const { total } = data;
|
|
76
|
+
updatePageable({ ...pageParam.value, total });
|
|
77
|
+
}
|
|
78
|
+
} catch (error) {
|
|
79
|
+
requestError && requestError(error);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @description 更新查询参数
|
|
85
|
+
* @return void
|
|
86
|
+
* */
|
|
87
|
+
const updatedTotalParam = () => {
|
|
88
|
+
state.totalParam = {};
|
|
89
|
+
// 处理查询参数,可以给查询参数加自定义前缀操作
|
|
90
|
+
let nowSearchParam: Table.StateProps["searchParam"] = {};
|
|
91
|
+
// 防止手动清空输入框携带参数(这里可以自定义查询参数前缀)
|
|
92
|
+
for (let key in state.searchParam) {
|
|
93
|
+
// * 某些情况下参数为 false/0 也应该携带参数
|
|
94
|
+
if (state.searchParam[key] || state.searchParam[key] === false || state.searchParam[key] === 0) {
|
|
95
|
+
nowSearchParam[key] = state.searchParam[key];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// , isPageable ? pageParam.value : {}
|
|
100
|
+
Object.assign(state.totalParam, nowSearchParam);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @description 更新分页信息
|
|
105
|
+
* @param {Object} pageable 后台返回的分页数据
|
|
106
|
+
* @return void
|
|
107
|
+
* */
|
|
108
|
+
const updatePageable = (pageable: Table.Pageable) => {
|
|
109
|
+
Object.assign(state.pageable, pageable);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @description 表格数据查询
|
|
114
|
+
* @return void
|
|
115
|
+
* */
|
|
116
|
+
const search = () => {
|
|
117
|
+
state.pageable.page = 1;
|
|
118
|
+
updatedTotalParam();
|
|
119
|
+
getTableList();
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @description 表格数据重置
|
|
124
|
+
* @return void
|
|
125
|
+
* */
|
|
126
|
+
const reset = () => {
|
|
127
|
+
state.pageable.page = 1;
|
|
128
|
+
state.searchParam = {};
|
|
129
|
+
// 重置搜索表单的时,如果有默认搜索参数,则重置默认的搜索参数
|
|
130
|
+
Object.keys(state.searchInitParam).forEach(key => {
|
|
131
|
+
state.searchParam[key] = state.searchInitParam[key];
|
|
132
|
+
});
|
|
133
|
+
updatedTotalParam();
|
|
134
|
+
getTableList();
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @description 每页条数改变
|
|
139
|
+
* @param {Number} val 当前条数
|
|
140
|
+
* @return void
|
|
141
|
+
* */
|
|
142
|
+
const handleSizeChange = (val: number) => {
|
|
143
|
+
state.pageable.page = 1;
|
|
144
|
+
state.pageable.limit = val;
|
|
145
|
+
getTableList();
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @description 当前页改变
|
|
150
|
+
* @param {Number} val 当前页
|
|
151
|
+
* @return void
|
|
152
|
+
* */
|
|
153
|
+
const handleCurrentChange = (val: number) => {
|
|
154
|
+
state.pageable.page = val;
|
|
155
|
+
getTableList();
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
...toRefs(state),
|
|
160
|
+
getTableList,
|
|
161
|
+
search,
|
|
162
|
+
reset,
|
|
163
|
+
handleSizeChange,
|
|
164
|
+
handleCurrentChange,
|
|
165
|
+
updatedTotalParam
|
|
166
|
+
};
|
|
167
|
+
};
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createApp, VueElement } from "vue";
|
|
2
|
+
import App from "./App.vue";
|
|
3
|
+
|
|
4
|
+
// reset style sheet
|
|
5
|
+
import "@/styles/reset.scss";
|
|
6
|
+
import "@/styles/element.scss";
|
|
7
|
+
import "@/styles/reset.scss";
|
|
8
|
+
|
|
9
|
+
// element dark css
|
|
10
|
+
import "element-plus/theme-chalk/dark/css-vars.css";
|
|
11
|
+
|
|
12
|
+
// element css
|
|
13
|
+
import "element-plus/dist/index.css";
|
|
14
|
+
// custom element css
|
|
15
|
+
import "@/styles/element.scss";
|
|
16
|
+
// svg icons
|
|
17
|
+
import "virtual:svg-icons-register";
|
|
18
|
+
// element plus
|
|
19
|
+
import ElementPlus from "element-plus";
|
|
20
|
+
// element icons
|
|
21
|
+
import * as Icons from "@element-plus/icons-vue";
|
|
22
|
+
// pinia store
|
|
23
|
+
import pinia from "@/stores";
|
|
24
|
+
|
|
25
|
+
const app = createApp(App);
|
|
26
|
+
Object.keys(Icons).forEach(key => {
|
|
27
|
+
app.component(key, Icons[key as keyof typeof Icons]);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// errorHandler;
|
|
31
|
+
import errorHandler from "@/utils/errorHandler";
|
|
32
|
+
app.config.errorHandler = errorHandler;
|
|
33
|
+
|
|
34
|
+
import vueMsg from "./plugins/index.js";
|
|
35
|
+
app.use(ElementPlus).use(vueMsg).use(pinia).mount("#app");
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button class="btn">
|
|
3
|
+
<span>
|
|
4
|
+
<!-- 自定义插槽 -->
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</span>
|
|
7
|
+
</button>
|
|
8
|
+
</template>
|
|
9
|
+
<script setup></script>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
//一定要写组件名
|
|
14
|
+
name: "VueButton"
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style scoped>
|
|
19
|
+
.btn {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
width: 200px;
|
|
22
|
+
padding: 18px;
|
|
23
|
+
margin: 5px;
|
|
24
|
+
font-size: 28px;
|
|
25
|
+
font-weight: 400;
|
|
26
|
+
color: #ffffffff;
|
|
27
|
+
text-align: center;
|
|
28
|
+
vertical-align: middle;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
background-color: #f4511e;
|
|
31
|
+
border: none;
|
|
32
|
+
border-radius: 20px;
|
|
33
|
+
transition: all 0.5s;
|
|
34
|
+
}
|
|
35
|
+
.btn span {
|
|
36
|
+
position: relative;
|
|
37
|
+
display: inline-block;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
transition: 0.5s;
|
|
40
|
+
}
|
|
41
|
+
.btn span::after {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
right: -20px;
|
|
45
|
+
content: ">";
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transition: 0.5s;
|
|
48
|
+
}
|
|
49
|
+
.btn:hover span {
|
|
50
|
+
padding-right: 30px;
|
|
51
|
+
}
|
|
52
|
+
.btn:hover span::after {
|
|
53
|
+
right: 0;
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//入口文件=>插件的入口=>统一管理文件
|
|
2
|
+
//动态引入文件
|
|
3
|
+
const requireComponent = import.meta.glob("./**/*.vue", { eager: true });
|
|
4
|
+
const install = Vue => {
|
|
5
|
+
console.log(requireComponent);
|
|
6
|
+
|
|
7
|
+
Object.keys(requireComponent).forEach(fileName => {
|
|
8
|
+
//第i个组件
|
|
9
|
+
const config = requireComponent[fileName];
|
|
10
|
+
//组件名 刚才写的组件名派上用场了
|
|
11
|
+
const conponentName = config.default.name;
|
|
12
|
+
|
|
13
|
+
Vue.component(conponentName, config.default || config);
|
|
14
|
+
});
|
|
15
|
+
//这里也可以创建全局自定义指令 这里是创建了一个自动获取焦点的指令
|
|
16
|
+
Vue.directive("focus", {
|
|
17
|
+
mounted: function (el) {
|
|
18
|
+
el.focus();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//对外暴露install方法
|
|
24
|
+
export default {
|
|
25
|
+
install
|
|
26
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<input v-model="text" type="text" v-focus />
|
|
3
|
+
<vue-button @click="submit">123</vue-button>
|
|
4
|
+
<vue-msg ref="msg"></vue-msg>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { nextTick, ref } from "vue";
|
|
9
|
+
let msg = ref();
|
|
10
|
+
let text = ref("");
|
|
11
|
+
function submit() {
|
|
12
|
+
if (text.value !== "") {
|
|
13
|
+
nextTick(() => {
|
|
14
|
+
msg.value.msgPlugin("提交成功", 1000);
|
|
15
|
+
});
|
|
16
|
+
} else {
|
|
17
|
+
nextTick(() => {
|
|
18
|
+
msg.value.msgPlugin("输入不能为空", 1000);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped></style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="msg" ref="msg" :class="{ active: msgStatus }">
|
|
3
|
+
<div class="msg-warpper">
|
|
4
|
+
{{ text }}
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
<script setup>
|
|
9
|
+
import { ref } from "vue";
|
|
10
|
+
//控制组件的显示
|
|
11
|
+
let msgStatus = ref(false);
|
|
12
|
+
let text = ref("");
|
|
13
|
+
|
|
14
|
+
const msgPlugin = function (msg, time = 2000) {
|
|
15
|
+
text.value = msg;
|
|
16
|
+
msgStatus.value = true;
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
msgStatus.value = false;
|
|
19
|
+
}, time);
|
|
20
|
+
};
|
|
21
|
+
defineExpose({
|
|
22
|
+
//向外暴露方法
|
|
23
|
+
msgPlugin
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
export default {
|
|
29
|
+
name: "VueMsg"
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
.msg {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 50%;
|
|
37
|
+
left: 50%;
|
|
38
|
+
z-index: -1;
|
|
39
|
+
width: 0;
|
|
40
|
+
height: 22px;
|
|
41
|
+
min-height: 0;
|
|
42
|
+
color: #ffffff;
|
|
43
|
+
text-align: center;
|
|
44
|
+
background-color: rgb(0 0 0 / 50%);
|
|
45
|
+
border-radius: 5px;
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transition: all 0.5s;
|
|
48
|
+
transform: translate(-50%, -50%);
|
|
49
|
+
}
|
|
50
|
+
.msg.active {
|
|
51
|
+
z-index: 11;
|
|
52
|
+
width: 150px;
|
|
53
|
+
min-height: 25px;
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const storeArr = import.meta.glob("@/stores/modules/*.ts", { eager: true });
|
|
2
|
+
let store: Record<string, any> = {};
|
|
3
|
+
Object.entries(storeArr).forEach(([key, useStore]) => {
|
|
4
|
+
for (const useKey in useStore as object) {
|
|
5
|
+
store[(useStore as any)[useKey].$id] = (useStore as any)[useKey]().$state;
|
|
6
|
+
}
|
|
7
|
+
});
|
|
8
|
+
// 取出项目中的所有全局变量
|
|
9
|
+
export default store;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AssemblySizeType = "large" | "default" | "small";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* flex */
|
|
2
|
+
.flx-center {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
}
|
|
7
|
+
.flx-justify-between {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
}
|
|
12
|
+
.flx-align-center {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
.row-click {
|
|
17
|
+
color: $primary-color;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
.row-un-click {
|
|
21
|
+
color: var(--el-border-color-light);
|
|
22
|
+
cursor: not-allowed;
|
|
23
|
+
}
|
|
24
|
+
.full {
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
.w-full {
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
.h-full {
|
|
32
|
+
height: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* clearfix */
|
|
36
|
+
.clearfix::after {
|
|
37
|
+
display: block;
|
|
38
|
+
height: 0;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
clear: both;
|
|
41
|
+
content: "";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* 文字单行省略号 */
|
|
45
|
+
.sle {
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* 文字多行省略号 */
|
|
52
|
+
.mle {
|
|
53
|
+
display: -webkit-box;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
-webkit-box-orient: vertical;
|
|
56
|
+
-webkit-line-clamp: 2;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* 文字多了自动換行 */
|
|
60
|
+
.break-word {
|
|
61
|
+
word-break: break-all;
|
|
62
|
+
word-wrap: break-word;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* scroll bar */
|
|
66
|
+
::-webkit-scrollbar {
|
|
67
|
+
width: 6px;
|
|
68
|
+
height: 6px;
|
|
69
|
+
}
|
|
70
|
+
::-webkit-scrollbar-thumb {
|
|
71
|
+
background-color: var(--el-fill-color-light) !important;
|
|
72
|
+
border-radius: 5px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* nprogress */
|
|
76
|
+
#nprogress .bar {
|
|
77
|
+
background: var(--el-color-primary) !important;
|
|
78
|
+
}
|
|
79
|
+
#nprogress .spinner-icon {
|
|
80
|
+
border-top-color: var(--el-color-primary) !important;
|
|
81
|
+
border-left-color: var(--el-color-primary) !important;
|
|
82
|
+
}
|
|
83
|
+
#nprogress .peg {
|
|
84
|
+
box-shadow:
|
|
85
|
+
0 0 10px var(--el-color-primary),
|
|
86
|
+
0 0 5px var(--el-color-primary) !important;
|
|
87
|
+
}
|