mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2026-03-27 15:50:46 +00:00
优化
This commit is contained in:
parent
164c27e3bc
commit
705d4c34f2
4
packages/vite-plugin/dist/eps/index.d.ts
vendored
4
packages/vite-plugin/dist/eps/index.d.ts
vendored
@ -5,4 +5,8 @@ export declare function createEps(query?: {
|
|||||||
service: {};
|
service: {};
|
||||||
list: Eps.Entity[];
|
list: Eps.Entity[];
|
||||||
isUpdate: boolean;
|
isUpdate: boolean;
|
||||||
|
} | {
|
||||||
|
service: {};
|
||||||
|
list: never[];
|
||||||
|
isUpdate?: undefined;
|
||||||
}>;
|
}>;
|
||||||
|
|||||||
43
packages/vite-plugin/dist/index.js
vendored
43
packages/vite-plugin/dist/index.js
vendored
@ -9,6 +9,7 @@
|
|||||||
reqUrl: "",
|
reqUrl: "",
|
||||||
demo: false,
|
demo: false,
|
||||||
eps: {
|
eps: {
|
||||||
|
enable: true,
|
||||||
api: "",
|
api: "",
|
||||||
dist: "./build/cool",
|
dist: "./build/cool",
|
||||||
mapping: [
|
mapping: [
|
||||||
@ -493,21 +494,29 @@
|
|||||||
}
|
}
|
||||||
// 创建 eps
|
// 创建 eps
|
||||||
async function createEps(query) {
|
async function createEps(query) {
|
||||||
// 获取数据
|
if (config.eps.enable) {
|
||||||
await getData(query?.list || []);
|
// 获取数据
|
||||||
// 创建 service
|
await getData(query?.list || []);
|
||||||
createService();
|
// 创建 service
|
||||||
// 创建目录
|
createService();
|
||||||
createDir(getEpsPath(), true);
|
// 创建目录
|
||||||
// 创建 json 文件
|
createDir(getEpsPath(), true);
|
||||||
const isUpdate = createJson();
|
// 创建 json 文件
|
||||||
// 创建描述文件
|
const isUpdate = createJson();
|
||||||
createDescribe({ service, list });
|
// 创建描述文件
|
||||||
return {
|
createDescribe({ service, list });
|
||||||
service,
|
return {
|
||||||
list,
|
service,
|
||||||
isUpdate,
|
list,
|
||||||
};
|
isUpdate,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return {
|
||||||
|
service: {},
|
||||||
|
list: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTag(code, id) {
|
function createTag(code, id) {
|
||||||
@ -872,7 +881,9 @@ if (typeof window !== 'undefined') {
|
|||||||
config.reqUrl = options.proxy["/dev/"].target;
|
config.reqUrl = options.proxy["/dev/"].target;
|
||||||
// Eps
|
// Eps
|
||||||
if (options.eps) {
|
if (options.eps) {
|
||||||
const { dist, mapping, api } = options.eps;
|
const { dist, mapping, api, enable = true } = options.eps;
|
||||||
|
// 是否开启
|
||||||
|
config.eps.enable = enable;
|
||||||
// 类型
|
// 类型
|
||||||
if (api) {
|
if (api) {
|
||||||
config.eps.api = api;
|
config.eps.api = api;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@cool-vue/vite-plugin",
|
"name": "@cool-vue/vite-plugin",
|
||||||
"version": "7.2.1",
|
"version": "7.2.2",
|
||||||
"description": "cool-admin、cool-uni builder",
|
"description": "cool-admin、cool-uni builder",
|
||||||
"main": "/dist/index.js",
|
"main": "/dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -5,6 +5,7 @@ export const config: Config.Data = {
|
|||||||
reqUrl: "",
|
reqUrl: "",
|
||||||
demo: false,
|
demo: false,
|
||||||
eps: {
|
eps: {
|
||||||
|
enable: true,
|
||||||
api: "",
|
api: "",
|
||||||
dist: "./build/cool",
|
dist: "./build/cool",
|
||||||
mapping: [
|
mapping: [
|
||||||
|
|||||||
@ -473,24 +473,31 @@ function createService() {
|
|||||||
|
|
||||||
// 创建 eps
|
// 创建 eps
|
||||||
export async function createEps(query?: { list: any[] }) {
|
export async function createEps(query?: { list: any[] }) {
|
||||||
// 获取数据
|
if (config.eps.enable) {
|
||||||
await getData(query?.list || []);
|
// 获取数据
|
||||||
|
await getData(query?.list || []);
|
||||||
|
|
||||||
// 创建 service
|
// 创建 service
|
||||||
createService();
|
createService();
|
||||||
|
|
||||||
// 创建目录
|
// 创建目录
|
||||||
createDir(getEpsPath(), true);
|
createDir(getEpsPath(), true);
|
||||||
|
|
||||||
// 创建 json 文件
|
// 创建 json 文件
|
||||||
const isUpdate = createJson();
|
const isUpdate = createJson();
|
||||||
|
|
||||||
// 创建描述文件
|
// 创建描述文件
|
||||||
createDescribe({ service, list });
|
createDescribe({ service, list });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
service,
|
service,
|
||||||
list,
|
list,
|
||||||
isUpdate,
|
isUpdate,
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
service: {},
|
||||||
|
list: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,10 @@ export function cool(options: Config.Options) {
|
|||||||
|
|
||||||
// Eps
|
// Eps
|
||||||
if (options.eps) {
|
if (options.eps) {
|
||||||
const { dist, mapping, api } = options.eps;
|
const { dist, mapping, api, enable = true } = options.eps;
|
||||||
|
|
||||||
|
// 是否开启
|
||||||
|
config.eps.enable = enable;
|
||||||
|
|
||||||
// 类型
|
// 类型
|
||||||
if (api) {
|
if (api) {
|
||||||
|
|||||||
1
packages/vite-plugin/types/index.d.ts
vendored
1
packages/vite-plugin/types/index.d.ts
vendored
@ -62,6 +62,7 @@ export namespace Ctx {
|
|||||||
export namespace Config {
|
export namespace Config {
|
||||||
type Type = "app" | "admin";
|
type Type = "app" | "admin";
|
||||||
interface Eps {
|
interface Eps {
|
||||||
|
enable: boolean;
|
||||||
api: "app" | "admin" | (string & {});
|
api: "app" | "admin" | (string & {});
|
||||||
dist: string;
|
dist: string;
|
||||||
mapping: {
|
mapping: {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-scrollbar class="plugins__wrapper">
|
<el-scrollbar class="plugins__wrapper" @dragover="onDragover" @drop="onDrop">
|
||||||
<div class="plugins" @dragover="onDragover" @drop="onDrop">
|
<div class="plugins">
|
||||||
<el-tabs v-model="tab.active" type="card" @tab-change="tab.onChange">
|
<el-tabs v-model="tab.active" type="card" @tab-change="tab.onChange">
|
||||||
<el-tab-pane label="已安装插件" name="installed"> </el-tab-pane>
|
<el-tab-pane label="已安装插件" name="installed"> </el-tab-pane>
|
||||||
<el-tab-pane label="插件市场" name="shop"> </el-tab-pane>
|
<el-tab-pane label="插件市场" name="shop"> </el-tab-pane>
|
||||||
@ -114,7 +114,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
|||||||
import { Plus, Setting } from "@element-plus/icons-vue";
|
import { Plus, Setting } from "@element-plus/icons-vue";
|
||||||
import { marked } from "marked";
|
import { marked } from "marked";
|
||||||
import { useForm } from "@cool-vue/crud";
|
import { useForm } from "@cool-vue/crud";
|
||||||
import { merge, template } from "lodash-es";
|
import { merge } from "lodash-es";
|
||||||
|
|
||||||
const { service, refs, setRefs } = useCool();
|
const { service, refs, setRefs } = useCool();
|
||||||
const Form = useForm();
|
const Form = useForm();
|
||||||
|
|||||||
@ -24,7 +24,10 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|||||||
// vueDevTools(),
|
// vueDevTools(),
|
||||||
cool({
|
cool({
|
||||||
type: "admin",
|
type: "admin",
|
||||||
proxy
|
proxy,
|
||||||
|
eps: {
|
||||||
|
enable: true
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
visualizer({
|
visualizer({
|
||||||
open: false,
|
open: false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user