This commit is contained in:
Ray.Hao
2026-04-13 08:06:57 +08:00
12 changed files with 465 additions and 454 deletions

View File

@@ -8,15 +8,15 @@ export default defineMock([
code: "00000",
data: [
{
value: 1,
value: "1",
label: "有来技术",
children: [
{
value: 2,
value: "2",
label: "研发部门",
},
{
value: 3,
value: "3",
label: "测试部门",
},
],
@@ -33,16 +33,16 @@ export default defineMock([
code: "00000",
data: [
{
id: 1,
parentId: 0,
id: "1",
parentId: "0",
name: "有来技术",
code: "YOULAI",
sort: 1,
status: 1,
children: [
{
id: 2,
parentId: 1,
id: "2",
parentId: "1",
name: "研发部门",
code: "RD001",
sort: 1,
@@ -52,8 +52,8 @@ export default defineMock([
updateTime: "2022-04-19 12:46",
},
{
id: 3,
parentId: 1,
id: "3",
parentId: "1",
name: "测试部门",
code: "QA001",
sort: 1,
@@ -127,26 +127,26 @@ export default defineMock([
// 部门映射表数据
const deptMap: Record<string, any> = {
1: {
id: 1,
id: "1",
name: "有来技术",
code: "YOULAI",
parentId: 0,
parentId: "0",
status: 1,
sort: 1,
},
2: {
id: 2,
id: "2",
name: "研发部门",
code: "RD001",
parentId: 1,
parentId: "1",
status: 1,
sort: 1,
},
3: {
id: 3,
id: "3",
name: "测试部门",
code: "QA001",
parentId: 1,
parentId: "1",
status: 1,
sort: 1,
},

View File

@@ -9,7 +9,7 @@ export default defineMock([
data: {
list: [
{
id: 1,
id: "1",
name: "性别",
dictCode: "gender",
status: 1,
@@ -104,7 +104,7 @@ export default defineMock([
data: {
list: [
{
id: 1,
id: "1",
dictCode: "gender",
label: "男",
value: "1",
@@ -113,7 +113,7 @@ export default defineMock([
tagType: "P",
},
{
id: 2,
id: "2",
dictCode: "gender",
label: "女",
value: "2",
@@ -122,7 +122,7 @@ export default defineMock([
tagType: "D",
},
{
id: 3,
id: "3",
dictCode: "gender",
label: "保密",
value: "0",
@@ -276,7 +276,7 @@ export default defineMock([
// 字典映射表数据
const dictMap: Record<string, any> = {
1: {
id: 1,
id: "1",
name: "性别",
dictCode: "gender",
status: 1,
@@ -286,7 +286,7 @@ const dictMap: Record<string, any> = {
// 字典项映射表数据
const dictItemMap: Record<string, any> = {
1: {
id: 1,
id: "1",
value: "1",
label: "男",
sort: 1,
@@ -294,7 +294,7 @@ const dictItemMap: Record<string, any> = {
tagType: "P",
},
2: {
id: 2,
id: "2",
value: "2",
label: "女",
sort: 2,
@@ -302,7 +302,7 @@ const dictItemMap: Record<string, any> = {
tagType: "D",
},
3: {
id: 3,
id: "3",
value: "0",
label: "保密",
sort: 3,

View File

@@ -9,7 +9,7 @@ export default defineMock([
data: {
list: [
{
id: 36192,
id: "36192",
module: "菜单",
content: "菜单列表",
requestUri: "/api/v1/menus",
@@ -24,7 +24,7 @@ export default defineMock([
operator: "系统管理员",
},
{
id: 36190,
id: "36190",
module: "字典",
content: "字典分页列表",
requestUri: "/api/v1/dicts",
@@ -39,7 +39,7 @@ export default defineMock([
operator: "系统管理员",
},
{
id: 36193,
id: "36193",
module: "部门",
content: "部门列表",
requestUri: "/api/v1/depts",
@@ -54,7 +54,7 @@ export default defineMock([
operator: "系统管理员",
},
{
id: 36191,
id: "36191",
module: "菜单",
content: "菜单列表",
requestUri: "/api/v1/menus",
@@ -69,7 +69,7 @@ export default defineMock([
operator: "系统管理员",
},
{
id: 36189,
id: "36189",
module: "角色",
content: "角色分页列表",
requestUri: "/api/v1/roles",
@@ -84,7 +84,7 @@ export default defineMock([
operator: "系统管理员",
},
{
id: 36188,
id: "36188",
module: "用户",
content: "用户分页列表",
requestUri: "/api/v1/users",
@@ -99,7 +99,7 @@ export default defineMock([
operator: "系统管理员",
},
{
id: 36187,
id: "36187",
module: "登录",
content: "登录",
requestUri: "/api/v1/auth/login",
@@ -114,7 +114,7 @@ export default defineMock([
operator: "系统管理员",
},
{
id: 36186,
id: "36186",
module: "登录",
content: "登录",
requestUri: "/api/v1/auth/login",
@@ -129,7 +129,7 @@ export default defineMock([
operator: "系统管理员",
},
{
id: 36185,
id: "36185",
module: "登录",
content: "登录",
requestUri: "/api/v1/auth/login",
@@ -144,7 +144,7 @@ export default defineMock([
operator: "系统管理员",
},
{
id: 36184,
id: "36184",
module: "登录",
content: "登录",
requestUri: "/api/v1/auth/login",

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@ export default defineMock([
data: {
list: [
{
id: 1,
id: "1",
title: "v2.12.0 新增系统日志,访问趋势统计功能。",
publishStatus: 1,
type: 1,
@@ -22,7 +22,7 @@ export default defineMock([
revokeTime: "2024-09-30 17:21",
},
{
id: 2,
id: "2",
title: "v2.13.0 新增菜单搜索。",
publishStatus: 1,
type: 1,
@@ -35,7 +35,7 @@ export default defineMock([
revokeTime: "2024-09-30 17:21",
},
{
id: 3,
id: "3",
title: "\r\nv2.14.0 新增个人中心。",
publishStatus: 1,
type: 1,
@@ -48,7 +48,7 @@ export default defineMock([
revokeTime: "2024-09-30 17:21",
},
{
id: 4,
id: "4",
title: "v2.15.0 登录页面改造。",
publishStatus: 1,
type: 1,
@@ -61,7 +61,7 @@ export default defineMock([
revokeTime: "2024-09-30 17:21",
},
{
id: 5,
id: "5",
title: "v2.16.0 通知公告、字典翻译组件。",
publishStatus: 1,
type: 1,
@@ -74,7 +74,7 @@ export default defineMock([
revokeTime: "2024-09-30 17:21",
},
{
id: 6,
id: "6",
title: "系统将于本周六凌晨 2 点进行维护,预计维护时间为 2 小时。",
publishStatus: 1,
type: 2,
@@ -87,7 +87,7 @@ export default defineMock([
revokeTime: "2024-09-30 17:21",
},
{
id: 7,
id: "7",
title: "最近发现一些钓鱼邮件,请大家提高警惕,不要点击陌生链接。",
publishStatus: 1,
type: 3,
@@ -100,7 +100,7 @@ export default defineMock([
revokeTime: "2024-09-30 17:21",
},
{
id: 8,
id: "8",
title: "国庆假期从 10 月 1 日至 10 月 7 日放假,共 7 天。",
publishStatus: 1,
type: 4,
@@ -113,7 +113,7 @@ export default defineMock([
revokeTime: "2024-09-30 17:21",
},
{
id: 9,
id: "9",
title: "公司将在 10 月 15 日举办新产品发布会,敬请期待。",
publishStatus: 1,
type: 5,
@@ -126,7 +126,7 @@ export default defineMock([
revokeTime: "2024-09-30 17:21",
},
{
id: 10,
id: "10",
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
publishStatus: 1,
type: 1,
@@ -218,7 +218,7 @@ export default defineMock([
data: {
list: [
{
id: 10,
id: "10",
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
type: 1,
level: "L",
@@ -227,7 +227,7 @@ export default defineMock([
isRead: 0,
},
{
id: 9,
id: "9",
title: "公司将在 10 月 15 日举办新产品发布会,敬请期待。",
type: 5,
level: "L",
@@ -236,7 +236,7 @@ export default defineMock([
isRead: 0,
},
{
id: 8,
id: "8",
title: "国庆假期从 10 月 1 日至 10 月 7 日放假,共 7 天。",
type: 4,
level: "L",
@@ -245,7 +245,7 @@ export default defineMock([
isRead: 0,
},
{
id: 7,
id: "7",
title: "最近发现一些钓鱼邮件,请大家提高警惕,不要点击陌生链接。",
type: 3,
level: "L",
@@ -254,7 +254,7 @@ export default defineMock([
isRead: 0,
},
{
id: 6,
id: "6",
title: "系统将于本周六凌晨 2 点进行维护,预计维护时间为 2 小时。",
type: 2,
level: "L",
@@ -273,7 +273,7 @@ export default defineMock([
// 通知映射表数据
const noticeMap: Record<string, any> = {
1: {
id: 1,
id: "1",
title: "v2.12.0 新增系统日志,访问趋势统计功能。",
publishStatus: 1,
type: 1,
@@ -287,7 +287,7 @@ const noticeMap: Record<string, any> = {
revokeTime: "2024-09-30 17:21",
},
2: {
id: 2,
id: "2",
title: "v2.13.0 新增菜单搜索。",
publishStatus: 1,
type: 1,
@@ -301,7 +301,7 @@ const noticeMap: Record<string, any> = {
revokeTime: "2024-09-30 17:21",
},
3: {
id: 3,
id: "3",
title: "\r\nv2.14.0 新增个人中心。",
publishStatus: 1,
type: 1,
@@ -315,7 +315,7 @@ const noticeMap: Record<string, any> = {
revokeTime: "2024-09-30 17:21",
},
4: {
id: 4,
id: "4",
title: "v2.15.0 登录页面改造。",
publishStatus: 1,
type: 1,
@@ -330,7 +330,7 @@ const noticeMap: Record<string, any> = {
},
5: {
id: 5,
id: "5",
title: "v2.16.0 通知公告、字典翻译组件。",
publishStatus: 1,
type: 1,
@@ -344,7 +344,7 @@ const noticeMap: Record<string, any> = {
revokeTime: "2024-09-30 17:21",
},
6: {
id: 6,
id: "6",
title: "系统将于本周六凌晨 2 点进行维护,预计维护时间为 2 小时。",
publishStatus: 1,
type: 2,
@@ -358,7 +358,7 @@ const noticeMap: Record<string, any> = {
revokeTime: "2024-09-30 17:21",
},
7: {
id: 7,
id: "7",
title: "最近发现一些钓鱼邮件,请大家提高警惕,不要点击陌生链接。",
publishStatus: 1,
type: 3,
@@ -372,7 +372,7 @@ const noticeMap: Record<string, any> = {
revokeTime: "2024-09-30 17:21",
},
8: {
id: 8,
id: "8",
title: "国庆假期从 10 月 1 日至 10 月 7 日放假,共 7 天。",
publishStatus: 1,
type: 4,
@@ -386,7 +386,7 @@ const noticeMap: Record<string, any> = {
revokeTime: "2024-09-30 17:21",
},
9: {
id: 9,
id: "9",
title: "公司将在 10 月 15 日举办新产品发布会,敬请期待。",
publishStatus: 1,
type: 5,
@@ -400,7 +400,7 @@ const noticeMap: Record<string, any> = {
revokeTime: "2024-09-30 17:21",
},
10: {
id: 10,
id: "10",
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
publishStatus: 1,
type: 1,

View File

@@ -7,12 +7,12 @@ export default defineMock([
body: {
code: "00000",
data: [
{ value: 2, label: "系统管理员" },
{ value: 4, label: "部门主管" },
{ value: 5, label: "部门成员" },
{ value: 6, label: "普通员工" },
{ value: 7, label: "自定义权限用户" },
{ value: 3, label: "访问游客" },
{ value: "2", label: "系统管理员" },
{ value: "4", label: "部门主管" },
{ value: "5", label: "部门成员" },
{ value: "6", label: "普通员工" },
{ value: "7", label: "自定义权限用户" },
{ value: "3", label: "访问游客" },
],
msg: "一切ok",
},
@@ -26,7 +26,7 @@ export default defineMock([
data: {
list: [
{
id: 2,
id: "2",
name: "系统管理员",
code: "ADMIN",
status: 1,
@@ -36,7 +36,7 @@ export default defineMock([
updateTime: null,
},
{
id: 3,
id: "3",
name: "访问游客",
code: "GUEST",
status: 1,
@@ -46,7 +46,7 @@ export default defineMock([
updateTime: "2019-05-05 16:00:00",
},
{
id: 4,
id: "4",
name: "部门主管",
code: "DEPT_MANAGER",
status: 1,
@@ -56,7 +56,7 @@ export default defineMock([
updateTime: null,
},
{
id: 5,
id: "5",
name: "部门成员",
code: "DEPT_MEMBER",
status: 1,
@@ -66,7 +66,7 @@ export default defineMock([
updateTime: null,
},
{
id: 6,
id: "6",
name: "普通员工",
code: "EMPLOYEE",
status: 1,
@@ -76,7 +76,7 @@ export default defineMock([
updateTime: null,
},
{
id: 7,
id: "7",
name: "自定义权限用户",
code: "CUSTOM_USER",
status: 1,
@@ -187,7 +187,7 @@ export default defineMock([
// 角色映射表数据
const roleMap: Record<string, any> = {
2: {
id: 2,
id: "2",
name: "系统管理员",
code: "ADMIN",
status: 1,
@@ -197,7 +197,7 @@ const roleMap: Record<string, any> = {
updateTime: null,
},
3: {
id: 3,
id: "3",
name: "访问游客",
code: "GUEST",
status: 1,
@@ -207,7 +207,7 @@ const roleMap: Record<string, any> = {
updateTime: "2019-05-05 16:00:00",
},
4: {
id: 4,
id: "4",
name: "部门主管",
code: "DEPT_MANAGER",
status: 1,
@@ -217,7 +217,7 @@ const roleMap: Record<string, any> = {
updateTime: null,
},
5: {
id: 5,
id: "5",
name: "部门成员",
code: "DEPT_MEMBER",
status: 1,
@@ -227,7 +227,7 @@ const roleMap: Record<string, any> = {
updateTime: null,
},
6: {
id: 6,
id: "6",
name: "普通员工",
code: "EMPLOYEE",
status: 1,
@@ -237,7 +237,7 @@ const roleMap: Record<string, any> = {
updateTime: null,
},
7: {
id: 7,
id: "7",
name: "自定义权限用户",
code: "CUSTOM_USER",
status: 1,

View File

@@ -9,7 +9,7 @@ export default defineMock([
data: {
list: [
{
id: 1,
id: "1",
name: "基础版",
code: "BASIC",
status: 1,
@@ -19,7 +19,7 @@ export default defineMock([
updateTime: "2026-03-01 10:00:00",
},
{
id: 2,
id: "2",
name: "专业版",
code: "PRO",
status: 1,
@@ -40,8 +40,8 @@ export default defineMock([
body: {
code: "00000",
data: [
{ value: 1, label: "基础版" },
{ value: 2, label: "专业版" },
{ value: "1", label: "基础版" },
{ value: "2", label: "专业版" },
],
msg: "一切ok",
},
@@ -54,7 +54,7 @@ export default defineMock([
const form =
planId === 2
? {
id: 2,
id: "2",
name: "专业版",
code: "PRO",
status: 1,
@@ -62,7 +62,7 @@ export default defineMock([
remark: "",
}
: {
id: 1,
id: "1",
name: "基础版",
code: "BASIC",
status: 1,

View File

@@ -8,7 +8,7 @@ export default defineMock([
code: "00000",
data: [
{
id: 1,
id: "1",
name: "默认租户",
code: "default",
contactName: "管理员",
@@ -16,14 +16,14 @@ export default defineMock([
contactEmail: "",
domain: "default",
logo: "",
planId: 1,
planId: "1",
status: 1,
remark: "",
expireTime: null,
isDefault: true,
},
{
id: 2,
id: "2",
name: "演示租户",
code: "demo",
contactName: "演示用户",
@@ -31,7 +31,7 @@ export default defineMock([
contactEmail: "",
domain: "demo",
logo: "",
planId: 2,
planId: "2",
status: 1,
remark: "",
expireTime: null,
@@ -47,7 +47,7 @@ export default defineMock([
body: {
code: "00000",
data: {
id: 1,
id: "1",
name: "默认租户",
code: "default",
contactName: "管理员",
@@ -55,7 +55,7 @@ export default defineMock([
contactEmail: "",
domain: "default",
logo: "",
planId: 1,
planId: "1",
status: 1,
remark: "",
expireTime: null,
@@ -72,7 +72,7 @@ export default defineMock([
data: {
list: [
{
id: 1,
id: "1",
name: "默认租户",
code: "default",
contactName: "管理员",
@@ -80,7 +80,7 @@ export default defineMock([
contactEmail: "",
domain: "default",
logo: "",
planId: 1,
planId: "1",
status: 1,
remark: "",
expireTime: null,
@@ -88,7 +88,7 @@ export default defineMock([
updateTime: "2026-03-01 10:00:00",
},
{
id: 2,
id: "2",
name: "演示租户",
code: "demo",
contactName: "演示用户",
@@ -96,7 +96,7 @@ export default defineMock([
contactEmail: "",
domain: "demo",
logo: "",
planId: 2,
planId: "2",
status: 1,
remark: "",
expireTime: null,
@@ -117,7 +117,7 @@ export default defineMock([
const form =
tenantId === 2
? {
id: 2,
id: "2",
name: "演示租户",
code: "demo",
domain: "demo",
@@ -125,13 +125,13 @@ export default defineMock([
contactPhone: "17621210366",
contactEmail: "",
logo: "",
planId: 2,
planId: "2",
status: 1,
remark: "",
expireTime: null,
}
: {
id: 1,
id: "1",
name: "默认租户",
code: "default",
domain: "default",
@@ -139,7 +139,7 @@ export default defineMock([
contactPhone: "17621210366",
contactEmail: "",
logo: "",
planId: 1,
planId: "1",
status: 1,
remark: "",
expireTime: null,
@@ -158,7 +158,7 @@ export default defineMock([
body: {
code: "00000",
data: {
tenantId: 3,
tenantId: "3",
tenantCode: "test",
tenantName: "测试租户",
adminUsername: "admin",
@@ -221,7 +221,7 @@ export default defineMock([
const allTenants = [
{
id: 1,
id: "1",
name: "默认租户",
code: "default",
contactName: "管理员",
@@ -229,14 +229,14 @@ export default defineMock([
contactEmail: "",
domain: "default",
logo: "",
planId: 1,
planId: "1",
status: 1,
remark: "",
expireTime: null,
isDefault: true,
},
{
id: 2,
id: "2",
name: "演示租户",
code: "demo",
contactName: "演示用户",
@@ -244,7 +244,7 @@ export default defineMock([
contactEmail: "",
domain: "demo",
logo: "",
planId: 2,
planId: "2",
status: 1,
remark: "",
expireTime: null,

View File

@@ -7,7 +7,7 @@ export default defineMock([
body: {
code: "00000",
data: {
userId: 2,
userId: "2",
username: "admin",
nickname: "系统管理员",
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
@@ -72,7 +72,7 @@ export default defineMock([
data: {
list: [
{
id: 2,
id: "2",
username: "admin",
nickname: "系统管理员",
mobile: "17621210366",
@@ -80,11 +80,11 @@ export default defineMock([
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "",
status: 1,
deptId: 1,
deptId: "1",
roleIds: [2],
},
{
id: 3,
id: "3",
username: "test",
nickname: "测试小用户",
mobile: "17621210366",
@@ -92,7 +92,7 @@ export default defineMock([
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "youlaitech@163.com",
status: 1,
deptId: 3,
deptId: "3",
roleIds: [3],
},
],
@@ -182,7 +182,7 @@ export default defineMock([
body: {
code: "00000",
data: {
id: 2,
id: "2",
username: "admin",
nickname: "系统管理员",
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
@@ -224,7 +224,7 @@ export default defineMock([
// 用户映射表数据
const userMap: Record<string, any> = {
2: {
id: 2,
id: "2",
username: "admin",
nickname: "系统管理员",
mobile: "17621210366",
@@ -232,11 +232,11 @@ const userMap: Record<string, any> = {
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "",
status: 1,
deptId: 1,
deptId: "1",
roleIds: [2],
},
3: {
id: 3,
id: "3",
username: "test",
nickname: "测试小用户",
mobile: "17621210366",
@@ -244,7 +244,7 @@ const userMap: Record<string, any> = {
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "youlaitech@163.com",
status: 1,
deptId: 3,
deptId: "3",
roleIds: [3],
},
};

View File

@@ -1,7 +1,7 @@
{
"name": "vue3-element-admin",
"description": "Vue3 + Vite + TypeScript + Element-Plus 的后台管理模板vue-element-admin 的 Vue3 版本",
"version": "4.4.0",
"version": "4.4.1",
"private": true,
"type": "module",
"scripts": {

View File

@@ -515,7 +515,7 @@ const displayTransitionTotalPvCount = computed(() =>
// 访问趋势日期范围(单位:天)
const visitTrendDateRange = ref(7);
// 访问趋势图表配置
const visitTrendChartOptions = ref();
const visitTrendChartOptions = ref({});
/**
* 获取访客统计数据
@@ -558,7 +558,7 @@ const updateVisitTrendChartOptions = (data: VisitTrendDetail) => {
trigger: "axis",
},
legend: {
data: ["浏览量(PV)", "访客(UV)"],
data: ["浏览量(PV)", "访客(UV)"],
bottom: 0,
},
grid: {

View File

@@ -9,20 +9,20 @@ import { mockDevServerPlugin } from "vite-plugin-mock-dev-server";
import UnoCSS from "unocss/vite";
import { resolve } from "path";
import { name, version, engines, dependencies, devDependencies } from "./package.json";
import { name, version } from "./package.json";
// 平台名称、版本、运行所需的 node 版本、依赖、构建时间的类型提示
// 平台名称、版本信息
const __APP_INFO__ = {
pkg: { name, version, engines, dependencies, devDependencies },
pkg: { name, version },
buildTimestamp: Date.now(),
};
const pathSrc = resolve(__dirname, "src");
// ESM 模式下使用 import.meta.dirnameNode 20.11+
const pathSrc = resolve(import.meta.dirname, "src");
// Vite配置 https://cn.vitejs.dev/config
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
const env = loadEnv(mode, process.cwd());
const isProduction = mode === "production";
return {
resolve: {
@@ -85,7 +85,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
//dts: "src/types/components.d.ts",
}),
] as PluginOption[],
// 预加载项目必需的组件
// 预加载项目必需的依赖
optimizeDeps: {
include: [
"vue",
@@ -111,112 +111,103 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
"element-plus/es",
"element-plus/es/locale/lang/en",
"element-plus/es/locale/lang/zh-cn",
"element-plus/es/components/alert/style/index",
"element-plus/es/components/avatar/style/index",
"element-plus/es/components/backtop/style/index",
"element-plus/es/components/badge/style/index",
"element-plus/es/components/base/style/index",
"element-plus/es/components/breadcrumb-item/style/index",
"element-plus/es/components/breadcrumb/style/index",
"element-plus/es/components/button/style/index",
"element-plus/es/components/card/style/index",
"element-plus/es/components/cascader/style/index",
"element-plus/es/components/checkbox-group/style/index",
"element-plus/es/components/checkbox/style/index",
"element-plus/es/components/col/style/index",
"element-plus/es/components/color-picker/style/index",
"element-plus/es/components/config-provider/style/index",
"element-plus/es/components/date-picker/style/index",
"element-plus/es/components/descriptions-item/style/index",
"element-plus/es/components/descriptions/style/index",
"element-plus/es/components/dialog/style/index",
"element-plus/es/components/divider/style/index",
"element-plus/es/components/drawer/style/index",
"element-plus/es/components/dropdown-item/style/index",
"element-plus/es/components/dropdown-menu/style/index",
"element-plus/es/components/dropdown/style/index",
"element-plus/es/components/empty/style/index",
"element-plus/es/components/form-item/style/index",
"element-plus/es/components/form/style/index",
"element-plus/es/components/icon/style/index",
"element-plus/es/components/image-viewer/style/index",
"element-plus/es/components/image/style/index",
"element-plus/es/components/input-number/style/index",
"element-plus/es/components/input-tag/style/index",
"element-plus/es/components/input/style/index",
"element-plus/es/components/link/style/index",
"element-plus/es/components/loading/style/index",
"element-plus/es/components/menu-item/style/index",
"element-plus/es/components/menu/style/index",
"element-plus/es/components/message-box/style/index",
"element-plus/es/components/message/style/index",
"element-plus/es/components/notification/style/index",
"element-plus/es/components/option/style/index",
"element-plus/es/components/pagination/style/index",
"element-plus/es/components/popover/style/index",
"element-plus/es/components/progress/style/index",
"element-plus/es/components/radio-button/style/index",
"element-plus/es/components/radio-group/style/index",
"element-plus/es/components/radio/style/index",
"element-plus/es/components/row/style/index",
"element-plus/es/components/scrollbar/style/index",
"element-plus/es/components/select/style/index",
"element-plus/es/components/skeleton-item/style/index",
"element-plus/es/components/skeleton/style/index",
"element-plus/es/components/step/style/index",
"element-plus/es/components/steps/style/index",
"element-plus/es/components/sub-menu/style/index",
"element-plus/es/components/switch/style/index",
"element-plus/es/components/tab-pane/style/index",
"element-plus/es/components/table-column/style/index",
"element-plus/es/components/table/style/index",
"element-plus/es/components/tabs/style/index",
"element-plus/es/components/tag/style/index",
"element-plus/es/components/text/style/index",
"element-plus/es/components/time-picker/style/index",
"element-plus/es/components/time-select/style/index",
"element-plus/es/components/timeline-item/style/index",
"element-plus/es/components/timeline/style/index",
"element-plus/es/components/tooltip/style/index",
"element-plus/es/components/tree-select/style/index",
"element-plus/es/components/tree/style/index",
"element-plus/es/components/upload/style/index",
"element-plus/es/components/watermark/style/index",
"element-plus/es/components/checkbox-button/style/index",
"element-plus/es/components/space/style/index",
// Element Plus 组件样式预构建(避免按需发现时触发页面重载)
...[
"alert",
"avatar",
"backtop",
"badge",
"base",
"breadcrumb",
"breadcrumb-item",
"button",
"card",
"cascader",
"checkbox",
"checkbox-group",
"checkbox-button",
"col",
"color-picker",
"config-provider",
"date-picker",
"descriptions",
"descriptions-item",
"dialog",
"divider",
"drawer",
"dropdown",
"dropdown-item",
"dropdown-menu",
"empty",
"form",
"form-item",
"icon",
"image",
"image-viewer",
"input",
"input-number",
"input-tag",
"link",
"loading",
"menu",
"menu-item",
"message",
"message-box",
"notification",
"option",
"pagination",
"popover",
"progress",
"radio",
"radio-button",
"radio-group",
"row",
"scrollbar",
"select",
"skeleton",
"skeleton-item",
"space",
"step",
"steps",
"sub-menu",
"switch",
"tab-pane",
"table",
"table-column",
"tabs",
"tag",
"text",
"time-picker",
"time-select",
"timeline",
"timeline-item",
"tooltip",
"tree",
"tree-select",
"upload",
"watermark",
].map((c) => `element-plus/es/components/${c}/style/index`),
],
},
// 构建配置
// 构建配置Vite 8 使用 Rolldown + Oxc
build: {
chunkSizeWarningLimit: 2000, // 消除打包大小超过500kb警告
chunkSizeWarningLimit: 1200, // chunk 大小警告阈值
reportCompressedSize: false,
minify: isProduction ? "terser" : false, // Vite 8 推荐使用 terser 进行生产压缩
terserOptions: isProduction
? {
compress: {
drop_console: true, // 生产环境移除 console
drop_debugger: true, // 生产环境移除 debugger
},
}
: undefined,
rollupOptions: {
cssMinify: "lightningcss", // Vite 8 默认使用 Lightning CSS 压缩
// minify 默认使用 'oxc',压缩速度比 terser 快 30-90 倍
rolldownOptions: {
output: {
// manualChunks: {
// "vue-i18n": ["vue-i18n"],
// },
// 用于从入口点创建的块的打包输出格式[name]表示文件名,[hash]表示该文件内容hash值
// 用于从入口点创建的块的打包输出格式
entryFileNames: "js/[name].[hash].js",
// 用于命名代码拆分时创建的共享块的输出命名
chunkFileNames: "js/[name].[hash].js",
// 用于输出静态资源的命名[ext]表示文件扩展名
// 用于输出静态资源的命名
assetFileNames: (assetInfo: any) => {
// Vite 8 / Rolldown: 添加空值保护
if (!assetInfo.name) {
return "assets/[name].[hash][extname]";
}
const info = assetInfo.name.split(".");
let extType = info[info.length - 1];
// console.log('文件信息', assetInfo.name)
if (/\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/i.test(assetInfo.name)) {
extType = "media";
} else if (/\.(png|jpe?g|gif|svg)(\?.*)?$/.test(assetInfo.name)) {