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
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: {};
|
||||
list: Eps.Entity[];
|
||||
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: "",
|
||||
demo: false,
|
||||
eps: {
|
||||
enable: true,
|
||||
api: "",
|
||||
dist: "./build/cool",
|
||||
mapping: [
|
||||
@ -493,21 +494,29 @@
|
||||
}
|
||||
// 创建 eps
|
||||
async function createEps(query) {
|
||||
// 获取数据
|
||||
await getData(query?.list || []);
|
||||
// 创建 service
|
||||
createService();
|
||||
// 创建目录
|
||||
createDir(getEpsPath(), true);
|
||||
// 创建 json 文件
|
||||
const isUpdate = createJson();
|
||||
// 创建描述文件
|
||||
createDescribe({ service, list });
|
||||
return {
|
||||
service,
|
||||
list,
|
||||
isUpdate,
|
||||
};
|
||||
if (config.eps.enable) {
|
||||
// 获取数据
|
||||
await getData(query?.list || []);
|
||||
// 创建 service
|
||||
createService();
|
||||
// 创建目录
|
||||
createDir(getEpsPath(), true);
|
||||
// 创建 json 文件
|
||||
const isUpdate = createJson();
|
||||
// 创建描述文件
|
||||
createDescribe({ service, list });
|
||||
return {
|
||||
service,
|
||||
list,
|
||||
isUpdate,
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
service: {},
|
||||
list: [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function createTag(code, id) {
|
||||
@ -872,7 +881,9 @@ if (typeof window !== 'undefined') {
|
||||
config.reqUrl = options.proxy["/dev/"].target;
|
||||
// Eps
|
||||
if (options.eps) {
|
||||
const { dist, mapping, api } = options.eps;
|
||||
const { dist, mapping, api, enable = true } = options.eps;
|
||||
// 是否开启
|
||||
config.eps.enable = enable;
|
||||
// 类型
|
||||
if (api) {
|
||||
config.eps.api = api;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cool-vue/vite-plugin",
|
||||
"version": "7.2.1",
|
||||
"version": "7.2.2",
|
||||
"description": "cool-admin、cool-uni builder",
|
||||
"main": "/dist/index.js",
|
||||
"scripts": {
|
||||
|
@ -5,6 +5,7 @@ export const config: Config.Data = {
|
||||
reqUrl: "",
|
||||
demo: false,
|
||||
eps: {
|
||||
enable: true,
|
||||
api: "",
|
||||
dist: "./build/cool",
|
||||
mapping: [
|
||||
|
@ -473,24 +473,31 @@ function createService() {
|
||||
|
||||
// 创建 eps
|
||||
export async function createEps(query?: { list: any[] }) {
|
||||
// 获取数据
|
||||
await getData(query?.list || []);
|
||||
if (config.eps.enable) {
|
||||
// 获取数据
|
||||
await getData(query?.list || []);
|
||||
|
||||
// 创建 service
|
||||
createService();
|
||||
// 创建 service
|
||||
createService();
|
||||
|
||||
// 创建目录
|
||||
createDir(getEpsPath(), true);
|
||||
// 创建目录
|
||||
createDir(getEpsPath(), true);
|
||||
|
||||
// 创建 json 文件
|
||||
const isUpdate = createJson();
|
||||
// 创建 json 文件
|
||||
const isUpdate = createJson();
|
||||
|
||||
// 创建描述文件
|
||||
createDescribe({ service, list });
|
||||
// 创建描述文件
|
||||
createDescribe({ service, list });
|
||||
|
||||
return {
|
||||
service,
|
||||
list,
|
||||
isUpdate,
|
||||
};
|
||||
return {
|
||||
service,
|
||||
list,
|
||||
isUpdate,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
service: {},
|
||||
list: [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,10 @@ export function cool(options: Config.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) {
|
||||
|
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 {
|
||||
type Type = "app" | "admin";
|
||||
interface Eps {
|
||||
enable: boolean;
|
||||
api: "app" | "admin" | (string & {});
|
||||
dist: string;
|
||||
mapping: {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-scrollbar class="plugins__wrapper">
|
||||
<div class="plugins" @dragover="onDragover" @drop="onDrop">
|
||||
<el-scrollbar class="plugins__wrapper" @dragover="onDragover" @drop="onDrop">
|
||||
<div class="plugins">
|
||||
<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="shop"> </el-tab-pane>
|
||||
@ -114,7 +114,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { Plus, Setting } from "@element-plus/icons-vue";
|
||||
import { marked } from "marked";
|
||||
import { useForm } from "@cool-vue/crud";
|
||||
import { merge, template } from "lodash-es";
|
||||
import { merge } from "lodash-es";
|
||||
|
||||
const { service, refs, setRefs } = useCool();
|
||||
const Form = useForm();
|
||||
|
@ -24,7 +24,10 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
||||
// vueDevTools(),
|
||||
cool({
|
||||
type: "admin",
|
||||
proxy
|
||||
proxy,
|
||||
eps: {
|
||||
enable: true
|
||||
}
|
||||
}),
|
||||
visualizer({
|
||||
open: false,
|
||||
|
Loading…
Reference in New Issue
Block a user