初始版本,目前线上可用

This commit is contained in:
2025-11-19 12:49:16 +08:00
commit cb7f1c45e8
178 changed files with 30336 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import { App, defineAsyncComponent, defineComponent } from "vue"
const modulesComponent = import.meta.glob('../components/**/**.vue');
const install = (app: App) => {
for(const [key , value] of Object.entries(modulesComponent)) {
const name = key.slice(key.lastIndexOf('/') + 1, key.lastIndexOf('.'));
app.component(name, defineAsyncComponent(value))
}
}
export default install

View File

@@ -0,0 +1,15 @@
//重置对象属性
export function resetParams(params: { [key: string]: any }) {
Object.keys(params).forEach((key: string) => {
let keyVal = params[key];
let type = typeof keyVal;
if (type === "undefined") params[key] = undefined;
if (type === "string") params[key] = "";
if (type === "number") params[key] = 0;
if (type === "object") {
if (Array.isArray(keyVal)) params[key] = [];
if (Object.prototype.toString.call(keyVal) === "[object Object]")
params[key] = {};
}
});
}