Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporate-culture-qd
Commits
54d4394b
Commit
54d4394b
authored
Apr 29, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【优化】 perf: 打包优化,非首屏加载资源并且文件较大则改为动态加载
parent
a1251cdc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
34 deletions
+9
-34
index.ts
src/utils/excel/index.ts
+3
-2
index.ts
src/utils/md5/index.ts
+0
-30
vite.config.ts
vite.config.ts
+6
-2
No files found.
src/utils/excel/index.ts
View file @
54d4394b
import
*
as
XLSX
from
'xlsx'
import
{
push
}
from
'notivue'
/**
* 导出 Excel
...
...
@@ -21,13 +20,15 @@ export interface ExportOptions<T> {
sheetName
?:
string
}
export
function
exportExcel
<
T
>
({
export
async
function
exportExcel
<
T
>
({
data
,
columns
,
fileName
=
'导出数据'
,
sheetName
=
'Sheet1'
,
}:
ExportOptions
<
T
>
)
{
if
(
!
data
||
!
data
.
length
)
return
push
.
warning
(
'没有可导出的数据'
)
// 文件比较大 切非首屏加载 可以选择动态引入 避免首屏加载过慢
const
XLSX
=
await
import
(
'xlsx'
)
const
header
=
columns
.
map
((
col
)
=>
col
.
title
)
...
...
src/utils/md5/index.ts
deleted
100644 → 0
View file @
a1251cdc
import
CryptoJS
from
'crypto-js'
/**
* 使用 MD5 加密字符串
* @param input - 要加密的字符串
* @returns 加密后的 MD5 字符串
*/
export
function
md5Hash
(
input
:
string
):
string
{
return
CryptoJS
.
MD5
(
input
).
toString
()
}
/**
* AES 加密方法
* @param plaintext 要加密的明文
* @param key 密钥 (16, 24 或 32 字节长度的字符串)
* @returns 加密后的字符串
*/
export
function
aesEncrypt
(
plaintext
:
string
,
key
:
string
):
string
{
if
(
!
[
16
,
24
,
32
].
includes
(
key
.
length
))
{
throw
new
Error
(
'秘钥长度必须为 16, 24 或 32 字节。'
)
}
// 加密数据
const
encrypted
=
CryptoJS
.
AES
.
encrypt
(
plaintext
,
CryptoJS
.
enc
.
Utf8
.
parse
(
key
),
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
,
})
return
encrypted
.
toString
()
}
vite.config.ts
View file @
54d4394b
...
...
@@ -82,7 +82,8 @@ export default defineConfig(({ mode }) => {
// },
},
build
:
{
minify
:
true
,
// 'esbuild'
minify
:
true
,
// minify: false,
chunkSizeWarningLimit
:
1000
,
rollupOptions
:
{
output
:
{
...
...
@@ -90,9 +91,12 @@ export default defineConfig(({ mode }) => {
chunkFileNames
:
'assets/js/[name]-[hash].js'
,
codeSplitting
:
{
groups
:
[
{
name
:
'elementPlus-vendor'
,
test
:
/node_modules
[\\/]
element-plus/
,
priority
:
9
},
{
name
:
'vue-vendor'
,
test
:
/node_modules
[\\/]
vue/
,
priority
:
10
},
{
name
:
'elementPlus-vendor'
,
test
:
/node_modules
[\\/]
element-plus/
,
priority
:
9
},
{
name
:
'wangeditor-vendor'
,
test
:
/node_modules
[\\/]
@wangeditor/
,
priority
:
8
},
{
name
:
'xlsx-vendor'
,
test
:
/node_modules
[\\/]
xlsx/
,
priority
:
7
},
{
name
:
'crypto-js-vendor'
,
test
:
/node_modules
[\\/]
crypto-js/
,
priority
:
6
},
{
name
:
'vue-use-vendor'
,
test
:
/node_modules
[\\/]
@vueuse/
,
priority
:
5
},
{
name
:
'common'
,
minShareCount
:
2
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment