Skip to content

Commit 2cc38ee

Browse files
committed
Merge branch 'youlaitech-master'
2 parents 242b49c + c87d1af commit 2cc38ee

24 files changed

+1455
-147
lines changed

Diff for: README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
## 项目简介
1919

20-
[vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) 是基于 Vue3 + Vite5+ TypeScript5 + Element-Plus + Pinia 等主流技术栈构建的免费开源的后台管理前端模板(配套[后端源码](https://gitee.com/youlaiorg/youlai-boot))。
20+
[vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) 是基于 Vue3 + Vite5+ TypeScript5 + Element-Plus + Pinia 等主流技术栈构建的免费开源的中后台管理的前端模板(配套[Java 后端源码](https://gitee.com/youlaiorg/youlai-boot))。
2121

2222

2323
## 项目特色
@@ -70,6 +70,9 @@ cd vue3-element-admin
7070
# 安装 pnpm
7171
npm install pnpm -g
7272

73+
# 设置镜像源(可忽略)
74+
pnpm config set registry https://registry.npmmirror.com
75+
7376
# 安装依赖
7477
pnpm install
7578

@@ -86,7 +89,7 @@ pnpm run dev
8689
pnpm run build
8790

8891
# 上传文件至远程服务器
89-
将打包生成在 `dist` 目录下的文件拷贝至 `/usr/share/nginx/html` 目录
92+
将本地打包生成的 dist 目录下的所有文件拷贝至服务器的 /usr/share/nginx/html 目录
9093

9194
# nginx.cofig 配置
9295
server {

Diff for: commitlint.config.cjs

+4-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ module.exports = {
5151
{ value: "perf", name: "性能: 🚀 性能优化", emoji: ":zap:" },
5252
{ value: "test", name: "测试: 🧪 添加疏漏测试或已有测试改动", emoji: ":white_check_mark:"},
5353
{ value: "build", name: "构建: 📦️ 构建流程、外部依赖变更(如升级 npm 包、修改 vite 配置等)", emoji: ":package:"},
54-
{ value: "ci", name: "集成: ⚙️ 修改 CI 配置、脚本", emoji: ":ferris_wheel:"},
55-
{ value: "revert", name: "回退: ↩️ 回滚 commit",emoji: ":rewind:"},
56-
{ value: "chore", name: "其他: 🛠️ 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)", emoji: ":hammer:"},
54+
{ value: "ci", name: "集成: ⚙️ 修改 CI 配置、脚本", emoji: ":ferris_wheel:"},
55+
{ value: "revert", name: "回退: ↩️ 回滚 commit",emoji: ":rewind:"},
56+
{ value: "chore", name: "其他: 🛠️ 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)", emoji: ":hammer:"},
57+
{ value: "wip", name: "开发中: 🚧 开发阶段临时提交", emoji: ":construction:"},
5758
],
5859
useEmoji: true,
5960
emojiAlign: "center",

Diff for: package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue3-element-admin",
3-
"version": "2.12.0",
3+
"version": "2.13.0",
44
"private": true,
55
"type": "module",
66
"scripts": {
@@ -58,7 +58,8 @@
5858
"@wangeditor/editor-for-vue": "5.1.10",
5959
"animate.css": "^4.1.1",
6060
"axios": "^1.7.2",
61-
"bootstrap": "4",
61+
"codemirror": "^5",
62+
"codemirror-editor-vue3": "^2.7.0",
6263
"color": "^4.2.3",
6364
"date-fns": "^3.6.0",
6465
"echarts": "^5.5.1",
@@ -81,6 +82,7 @@
8182
"@commitlint/cli": "^18.6.1",
8283
"@commitlint/config-conventional": "^18.6.3",
8384
"@iconify-json/ep": "^1.1.15",
85+
"@types/codemirror": "^5.60.15",
8486
"@types/color": "^3.0.6",
8587
"@types/jquery": "^3.5.30",
8688
"@types/lodash": "^4.17.6",
@@ -133,6 +135,5 @@
133135
"license": "MIT",
134136
"engines": {
135137
"node": ">=18.0.0"
136-
},
137-
"packageManager": "[email protected]+sha512.7c2ea089e1a6af306409c4fc8c4f0897bdac32b772016196c469d9428f1fe2d5a21daf8ad6512762654ac645b5d9136bb210ec9a00afa8dbc4677843ba362ecd"
138+
}
138139
}

Diff for: src/api/dict.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class DictAPI {
3434
* 新增字典
3535
*
3636
* @param data 字典表单数据
37-
* @returns 请求结果
3837
*/
3938
static add(data: DictForm) {
4039
return request({
@@ -49,7 +48,6 @@ class DictAPI {
4948
*
5049
* @param id 字典ID
5150
* @param data 字典表单数据
52-
* @returns 请求结果
5351
*/
5452
static update(id: number, data: DictForm) {
5553
return request({
@@ -63,7 +61,6 @@ class DictAPI {
6361
* 删除字典
6462
*
6563
* @param ids 字典ID,多个以英文逗号(,)分隔
66-
* @returns 请求结果
6764
*/
6865
static deleteByIds(ids: string) {
6966
return request({
@@ -72,6 +69,18 @@ class DictAPI {
7269
});
7370
}
7471

72+
/**
73+
* 获取字典列表
74+
*
75+
* @returns 字典列表
76+
*/
77+
static getList() {
78+
return request<any, OptionType[]>({
79+
url: `${DICT_BASE_URL}/list`,
80+
method: "get",
81+
});
82+
}
83+
7584
/**
7685
* 获取字典的数据项
7786
*

Diff for: src/api/file.ts

+26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import request from "@/utils/request";
22

33
class FileAPI {
4+
/**
5+
* 文件上传地址
6+
*/
7+
static uploadUrl = import.meta.env.VITE_APP_BASE_API + "/api/v1/files";
8+
49
/**
510
* 上传文件
611
*
@@ -31,6 +36,27 @@ class FileAPI {
3136
params: { filePath: filePath },
3237
});
3338
}
39+
40+
/**
41+
* 下载文件
42+
* @param url
43+
* @param fileName
44+
*/
45+
static downloadFile(url: string, fileName?: string) {
46+
return request({
47+
url: url,
48+
method: "get",
49+
responseType: "blob",
50+
}).then((res) => {
51+
const blob = new Blob([res.data]);
52+
const a = document.createElement("a");
53+
const url = window.URL.createObjectURL(blob);
54+
a.href = url;
55+
a.download = fileName || "下载文件";
56+
a.click();
57+
window.URL.revokeObjectURL(url);
58+
});
59+
}
3460
}
3561

3662
export default FileAPI;

Diff for: src/api/generator.ts

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
import request from "@/utils/request";
2+
import { FormTypeEnum } from "@/enums/FormTypeEnum";
3+
import { QueryTypeEnum } from "@/enums/QueryTypeEnum";
4+
5+
const GENERATOR_BASE_URL = "/api/v1/generator";
6+
7+
class GeneratorAPI {
8+
/** 获取数据表分页列表 */
9+
static getTablePage(params: TablePageQuery) {
10+
return request<any, PageResult<TablePageVO[]>>({
11+
url: `${GENERATOR_BASE_URL}/table/page`,
12+
method: "get",
13+
params: params,
14+
});
15+
}
16+
17+
/** 获取代码生成配置 */
18+
static getGenConfig(tableName: string) {
19+
return request<any, GenConfigForm>({
20+
url: `${GENERATOR_BASE_URL}/${tableName}/config`,
21+
method: "get",
22+
});
23+
}
24+
25+
/** 获取代码生成配置 */
26+
static saveGenConfig(tableName: string, data: GenConfigForm) {
27+
return request({
28+
url: `${GENERATOR_BASE_URL}/${tableName}/config`,
29+
method: "post",
30+
data: data,
31+
});
32+
}
33+
34+
/** 获取代码生成预览数据 */
35+
static getPreviewData(tableName: string) {
36+
return request<any, GeneratorPreviewVO[]>({
37+
url: `${GENERATOR_BASE_URL}/${tableName}/preview`,
38+
method: "get",
39+
});
40+
}
41+
}
42+
43+
export default GeneratorAPI;
44+
45+
/** 代码生成预览对象 */
46+
export interface GeneratorPreviewVO {
47+
/** 文件生成路径 */
48+
path: string;
49+
/** 文件名称 */
50+
fileName: string;
51+
/** 文件内容 */
52+
content: string;
53+
}
54+
55+
/** 数据表分页查询参数 */
56+
export interface TablePageQuery extends PageQuery {
57+
/** 关键字(表名) */
58+
keywords?: string;
59+
}
60+
61+
/** 数据表分页对象 */
62+
export interface TablePageVO {
63+
/** 表名称 */
64+
tableName: string;
65+
66+
/** 表描述 */
67+
tableComment: string;
68+
69+
/** 存储引擎 */
70+
engine: string;
71+
72+
/** 字符集排序规则 */
73+
tableCollation: string;
74+
75+
/** 创建时间 */
76+
createTime: string;
77+
}
78+
79+
/** 代码生成配置表单 */
80+
export interface GenConfigForm {
81+
/** 主键 */
82+
id?: number;
83+
84+
/** 表名 */
85+
tableName?: string;
86+
87+
/** 业务名 */
88+
businessName?: string;
89+
90+
/** 模块名 */
91+
moduleName?: string;
92+
93+
/** 包名 */
94+
packageName?: string;
95+
96+
/** 实体名 */
97+
entityName?: string;
98+
99+
/** 作者 */
100+
author?: string;
101+
102+
/** 字段配置列表 */
103+
fieldConfigs?: FieldConfig[];
104+
}
105+
106+
/** 字段配置 */
107+
interface FieldConfig {
108+
/** 主键 */
109+
id?: number;
110+
111+
/** 列名 */
112+
columnName?: string;
113+
114+
/** 列类型 */
115+
columnType?: string;
116+
117+
/** 字段名 */
118+
fieldName?: string;
119+
120+
/** 字段类型 */
121+
fieldType?: string;
122+
123+
/** 字段描述 */
124+
fieldComment?: string;
125+
126+
/** 是否在列表显示 */
127+
isShowInList?: number;
128+
129+
/** 是否在表单显示 */
130+
isShowInForm?: number;
131+
132+
/** 是否在查询条件显示 */
133+
isShowInQuery?: number;
134+
135+
/** 是否必填 */
136+
isRequired?: number;
137+
138+
/** 表单类型 */
139+
formType?: number;
140+
141+
/** 查询类型 */
142+
queryType?: number;
143+
}

Diff for: src/assets/icons/code.svg

+1
Loading

Diff for: src/assets/icons/file.svg

+1
Loading

Diff for: src/assets/icons/java.svg

+1
Loading

Diff for: src/assets/icons/typescript.svg

+1
Loading

Diff for: src/assets/icons/vue.svg

+1
Loading

Diff for: src/assets/icons/xml.svg

+1
Loading

0 commit comments

Comments
 (0)