mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 06:02:38 +08:00
优化
This commit is contained in:
parent
2ffacc2041
commit
3e2060dd8c
@ -9,7 +9,7 @@
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .eslintignore"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cool-vue/crud": "^7.1.26",
|
||||
"@cool-vue/crud": "^7.1.27",
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@vueuse/core": "^10.4.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
@ -38,7 +38,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.8.0",
|
||||
"@cool-vue/vite-plugin": "^7.1.6",
|
||||
"@cool-vue/vite-plugin": "^7.1.7",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
"@types/lodash-es": "^4.17.8",
|
||||
"@types/mockjs": "^1.0.7",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cool-vue/crud",
|
||||
"version": "7.1.26",
|
||||
"version": "7.1.27",
|
||||
"private": false,
|
||||
"main": "./dist/index.umd.min.js",
|
||||
"typings": "types/index.d.ts",
|
||||
|
@ -508,6 +508,9 @@
|
||||
}
|
||||
|
||||
.cl-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
&.el-dialog {
|
||||
border-radius: 6px;
|
||||
padding: 0;
|
||||
|
2
packages/crud/types/index.d.ts
vendored
2
packages/crud/types/index.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
/// <reference types="../index" />
|
||||
import { App } from "vue";
|
||||
import type { App } from "vue";
|
||||
import "./static/index.scss";
|
||||
declare const Crud: {
|
||||
install(app: App, options?: Options): {
|
||||
|
2
packages/crud/types/provide.d.ts
vendored
2
packages/crud/types/provide.d.ts
vendored
@ -1,3 +1,3 @@
|
||||
/// <reference types="../index" />
|
||||
import { App } from "vue";
|
||||
import { type App } from "vue";
|
||||
export declare function useProvide(app: App, options?: Options): void;
|
||||
|
20
packages/vite-plugin/dist/index.js
vendored
20
packages/vite-plugin/dist/index.js
vendored
@ -694,7 +694,9 @@
|
||||
}
|
||||
|
||||
async function createCtx() {
|
||||
let ctx = {};
|
||||
let ctx = {
|
||||
serviceLang: "Node",
|
||||
};
|
||||
if (config.type == "app") {
|
||||
const manifest = readFile(rootDir("manifest.json"), true);
|
||||
// 文件路径
|
||||
@ -753,6 +755,22 @@
|
||||
if (config.type == "admin") {
|
||||
const list = fs.readdirSync(rootDir("./src/modules"));
|
||||
ctx.modules = list.filter((e) => !e.includes("."));
|
||||
await axios
|
||||
.get(config.reqUrl + "/admin/base/comm/program", {
|
||||
timeout: 5000,
|
||||
})
|
||||
.then((res) => {
|
||||
const { code, data, message } = res.data;
|
||||
if (code === 1000) {
|
||||
ctx.serviceLang = data || "Node";
|
||||
}
|
||||
else {
|
||||
error(`[cool-ctx] ${message}`);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
// console.error(['[cool-ctx] ', err.message])
|
||||
});
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cool-vue/vite-plugin",
|
||||
"version": "7.1.6",
|
||||
"version": "7.1.7",
|
||||
"description": "cool-admin/cool-uni builder",
|
||||
"main": "/dist/index.js",
|
||||
"scripts": {
|
||||
|
@ -1,13 +1,16 @@
|
||||
import { join } from "path";
|
||||
import { readFile, rootDir, writeFile } from "../utils";
|
||||
import { readFile, rootDir, writeFile, error } from "../utils";
|
||||
import { glob } from "glob";
|
||||
import { assign, cloneDeep, isEqual, orderBy } from "lodash";
|
||||
import { config } from "../config";
|
||||
import fs from "fs";
|
||||
import axios from "axios";
|
||||
import type { Ctx } from "../../types";
|
||||
|
||||
export async function createCtx() {
|
||||
let ctx: Ctx.Data = {};
|
||||
let ctx: Ctx.Data = {
|
||||
serviceLang: "Node",
|
||||
};
|
||||
|
||||
if (config.type == "app") {
|
||||
const manifest = readFile(rootDir("manifest.json"), true);
|
||||
@ -82,6 +85,23 @@ export async function createCtx() {
|
||||
if (config.type == "admin") {
|
||||
const list = fs.readdirSync(rootDir("./src/modules"));
|
||||
ctx.modules = list.filter((e) => !e.includes("."));
|
||||
|
||||
await axios
|
||||
.get(config.reqUrl + "/admin/base/comm/program", {
|
||||
timeout: 5000,
|
||||
})
|
||||
.then((res) => {
|
||||
const { code, data, message } = res.data;
|
||||
|
||||
if (code === 1000) {
|
||||
ctx.serviceLang = data || "Node";
|
||||
} else {
|
||||
error(`[cool-ctx] ${message}`);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
// console.error(['[cool-ctx] ', err.message])
|
||||
});
|
||||
}
|
||||
|
||||
return ctx;
|
||||
|
1
packages/vite-plugin/types/index.d.ts
vendored
1
packages/vite-plugin/types/index.d.ts
vendored
@ -54,6 +54,7 @@ export namespace Ctx {
|
||||
pages?: Ctx.Pages;
|
||||
subPackages?: Ctx.SubPackages;
|
||||
modules?: string[];
|
||||
serviceLang: "Node" | "Java" | "Go" | "Python";
|
||||
[key: string]: any;
|
||||
}
|
||||
}
|
||||
|
@ -296,6 +296,7 @@ import { sleep, storage } from "/@/cool/utils";
|
||||
import dayjs from "dayjs";
|
||||
import type { CodeItem, EpsColumn } from "../types";
|
||||
import { useClipboard } from "@vueuse/core";
|
||||
import { ctx } from "virtual:ctx";
|
||||
|
||||
const { service, refs, setRefs, router } = useCool();
|
||||
const menu = useMenu();
|
||||
@ -369,10 +370,10 @@ const step = reactive({
|
||||
|
||||
// 语言
|
||||
const lang = reactive({
|
||||
value: "Node" as "Node" | "Java" | "Go" | "Python",
|
||||
value: "Node",
|
||||
|
||||
async get() {
|
||||
lang.value = await service.base.comm.program();
|
||||
get() {
|
||||
lang.value = ctx.serviceLang;
|
||||
code.active = lang.value.toLocaleLowerCase() + "-entity";
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user