This commit is contained in:
神仙都没用 2024-07-29 11:28:48 +08:00
parent 3e2060dd8c
commit 7e40322207
6 changed files with 164 additions and 58 deletions

View File

@ -6,8 +6,8 @@ settings:
dependencies:
'@cool-vue/crud':
specifier: ^7.1.26
version: 7.1.26(typescript@5.4.2)
specifier: ^7.1.27
version: 7.1.27(typescript@5.4.2)
'@element-plus/icons-vue':
specifier: ^2.3.1
version: 2.3.1(vue@3.4.15)
@ -86,8 +86,8 @@ dependencies:
devDependencies:
'@cool-vue/vite-plugin':
specifier: ^7.1.6
version: 7.1.6
specifier: ^7.1.7
version: 7.1.7
'@rushstack/eslint-patch':
specifier: ^1.8.0
version: 1.8.0
@ -529,8 +529,8 @@ packages:
'@babel/helper-validator-identifier': 7.24.7
to-fast-properties: 2.0.0
/@cool-vue/crud@7.1.26(typescript@5.4.2):
resolution: {integrity: sha512-v8X32My5iGqt048FWkthMxVdOY5kTf2MVLIHyr8NoCEbSFN4vzDSbLE6TWgQMHd62GCDxlB9e/QQGCc55CZGcA==}
/@cool-vue/crud@7.1.27(typescript@5.4.2):
resolution: {integrity: sha512-S/Z6Q4Aw3lshVevpizQ5Z4DarXJdkBTEZFSOlLEnBkhzBLGFBzLiNI42vkm9Ru0mcV+WNic5RJ8C99/LUhC/6g==}
dependencies:
'@element-plus/icons-vue': 2.3.1(vue@3.4.15)
array.prototype.flat: 1.3.2
@ -544,8 +544,8 @@ packages:
- typescript
dev: false
/@cool-vue/vite-plugin@7.1.6:
resolution: {integrity: sha512-nKh0YQd6yP6aRwOcPOAxN81+HJ+XR9NrF5KKaegK36FLrcHW2gnf2+qtqnbd+SFkm6BTM0iojPedW6cYU0aREg==}
/@cool-vue/vite-plugin@7.1.7:
resolution: {integrity: sha512-pSTXigNa2HrW7ps4EFEqI18KzZh19WEoDZlV8l84DDOJHV4jjaeSKbBpur/aCWBIogeZOaMCiboCCytfSUGYCQ==}
dependencies:
'@vue/compiler-sfc': 3.4.34
axios: 1.7.2
@ -1388,7 +1388,7 @@ packages:
'@babel/helper-module-imports': 7.22.15
'@babel/helper-plugin-utils': 7.24.8
'@babel/parser': 7.24.8
'@vue/compiler-sfc': 3.4.15
'@vue/compiler-sfc': 3.4.34
dev: true
/@vue/compiler-core@3.4.15:

View File

@ -1,5 +1,5 @@
import { type App, type Directive } from "vue";
import { assign, chain, isFunction } from "lodash-es";
import { assign, isFunction, orderBy } from "lodash-es";
import { filename } from "../utils";
import { module } from "../module";
import { hmr } from "../hooks";
@ -63,44 +63,41 @@ for (const i in files) {
// 创建
export function createModule(app: App) {
const list = chain(module.list)
.map((e) => {
const d = isFunction(e.value) ? e.value(app) : e.value;
// 排序
module.list.forEach((e) => {
const d = isFunction(e.value) ? e.value(app) : e.value;
if (d) {
assign(e, d);
if (d) {
assign(e, d);
}
if (!d.order) {
e.order = 0;
}
});
const list = orderBy(module.list, "order", "desc").map((e) => {
// 初始化
e.install?.(app, e.options);
// 注册组件
e.components?.forEach(async (c) => {
// @ts-ignore
const v = await (isFunction(c) ? c() : c);
const n = v.default || v;
if (n.name) {
app.component(n.name, n);
}
});
if (!d.order) {
e.order = 0;
}
// 注册指令
e.directives?.forEach((v) => {
app.directive(v.name, v.value);
});
return e;
})
.orderBy("order", "desc")
.map((e) => {
// 初始化
e.install?.(app, e.options);
// 注册组件
e.components?.forEach(async (c) => {
// @ts-ignore
const v = await (isFunction(c) ? c() : c);
const n = v.default || v;
if (n.name) {
app.component(n.name, n);
}
});
// 注册指令
e.directives?.forEach((v) => {
app.directive(v.name, v.value);
});
return e;
})
.value();
return e;
});
return {
// 模块列表

View File

@ -35,18 +35,22 @@ async function refresh() {
color: "#2c3142"
})
.then(({ captchaId, data }) => {
if (data.includes(";base64,")) {
base64.value = data;
} else {
svg.value = data;
}
if (data) {
if (data.includes(";base64,")) {
base64.value = data;
} else {
svg.value = data;
}
emit("update:modelValue", captchaId);
emit("change", {
base64,
svg,
captchaId
});
emit("update:modelValue", captchaId);
emit("change", {
base64,
svg,
captchaId
});
} else {
ElMessage.error("验证码获取失败");
}
})
.catch((err) => {
ElMessage.error(err.message);

File diff suppressed because one or more lines are too long

View File

@ -56,9 +56,8 @@ export default ({ mode }: ConfigEnv): UserConfig => {
}
},
esbuild: {
drop: isDev ? [] : ["console", "debugger"]
// drop: isDev ? [] : ["console", "debugger"]
},
build: {
minify: "esbuild",
// terserOptions: {

File diff suppressed because one or more lines are too long