Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-baoshen-excel
Project
Project
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
何远江
topsun-baoshen-excel
Commits
50f0d4c7
Commit
50f0d4c7
authored
Oct 18, 2024
by
何远江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b504e336
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
index.vue
src/components/PreviewExcel/index.vue
+4
-2
No files found.
src/components/PreviewExcel/index.vue
View file @
50f0d4c7
...
@@ -34,7 +34,9 @@ const generateExcel = async (path: string) => {
...
@@ -34,7 +34,9 @@ const generateExcel = async (path: string) => {
// 保存浏览文件的地址
// 保存浏览文件的地址
filePath
.
value
=
path
filePath
.
value
=
path
try
{
try
{
const
res
=
await
axios
.
get
(
'/api/sys/static/'
+
path
)
// 验证文件是否存在
await
axios
.
get
(
'/api/sys/static/'
+
path
)
LuckyExcel
.
transformExcelToLuckyByUrl
(
LuckyExcel
.
transformExcelToLuckyByUrl
(
'/api/sys/static/'
+
path
,
'/api/sys/static/'
+
path
,
new
Date
().
getTime
()
+
'.xlsx'
,
new
Date
().
getTime
()
+
'.xlsx'
,
...
@@ -55,7 +57,7 @@ const generateExcel = async (path: string) => {
...
@@ -55,7 +57,7 @@ const generateExcel = async (path: string) => {
}
}
)
)
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
,
'eeee'
)
// 验证文件是否存在,不存在报错
if
(
e
?.
response
)
{
if
(
e
?.
response
)
{
ElMessage
.
error
(
e
.
response
.
data
.
message
)
ElMessage
.
error
(
e
.
response
.
data
.
message
)
}
}
...
...
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