Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
component
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
purplevin
component
Commits
5b30b61d
Commit
5b30b61d
authored
Sep 06, 2022
by
shuaiqiang
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复文件分割问题
parent
b0dabdac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
packages/fileSplit/src/components/SplitWordForm.vue
packages/fileSplit/src/components/SplitWordForm.vue
+14
-16
No files found.
packages/fileSplit/src/components/SplitWordForm.vue
View file @
5b30b61d
...
@@ -49,11 +49,12 @@
...
@@ -49,11 +49,12 @@
<el-button
<el-button
size=
"medium"
size=
"medium"
type=
"primary"
type=
"primary"
@
click=
"handleSplitClick"
>
>
分割
分割
</el-button>
</el-button>
<el-button
<el-button
v-if=
"
fileList[0]
"
v-if=
"
showDownload
"
size=
"medium"
size=
"medium"
type=
"primary"
type=
"primary"
@
click=
"handleDownloadClick"
@
click=
"handleDownloadClick"
...
@@ -89,6 +90,7 @@ export default {
...
@@ -89,6 +90,7 @@ export default {
return
{
return
{
uploadURL
:
'
Word/SplitRevisionDoc
'
,
uploadURL
:
'
Word/SplitRevisionDoc
'
,
fileList
:
[],
fileList
:
[],
showDownload
:
false
,
form
:
{
form
:
{
applyType
:
'
1
'
,
applyType
:
'
1
'
,
split
:
'
splitAccording
'
,
split
:
'
splitAccording
'
,
...
@@ -150,35 +152,31 @@ export default {
...
@@ -150,35 +152,31 @@ export default {
this
.
editInpIndex
=
-
1
this
.
editInpIndex
=
-
1
}
}
},
},
async
handleSplitClick
()
{
// 點擊下載按鈕
async
handleDownloadClick
()
{
if
(
this
.
fileList
.
length
<=
0
)
{
if
(
this
.
fileList
.
length
<=
0
)
{
this
.
$message
.
error
(
'
请先选择需要上传的文件!
'
)
this
.
$message
.
error
(
'
请先选择需要上传的文件!
'
)
return
false
return
false
}
}
const
formData
=
new
FormData
()
const
formData
=
new
FormData
()
const
{
form
}
=
this
const
{
form
}
=
this
formData
.
append
(
'
file
'
,
this
.
fileList
[
0
].
raw
)
formData
.
append
(
'
file
'
,
this
.
fileList
[
0
].
raw
)
formData
.
append
(
'
applyType
'
,
form
.
applyType
)
formData
.
append
(
'
applyType
'
,
form
.
applyType
)
// if (form.split === 'pageNum') {
formData
.
append
(
'
abstPageRange
'
,
form
.
abstPageRange
)
formData
.
append
(
'
abstPageRange
'
,
form
.
abstPageRange
)
formData
.
append
(
'
specPageRange
'
,
form
.
specPageRange
)
formData
.
append
(
'
specPageRange
'
,
form
.
specPageRange
)
formData
.
append
(
'
claimPageRange
'
,
form
.
claimPageRange
)
formData
.
append
(
'
claimPageRange
'
,
form
.
claimPageRange
)
formData
.
append
(
'
figPageRange
'
,
form
.
figPageRange
)
formData
.
append
(
'
figPageRange
'
,
form
.
figPageRange
)
// 上傳的參數置空
this
.
response
=
await
SplitRevisionDoc
(
this
.
baseUrl
,
formData
)
// } else {
console
.
log
(
this
.
response
)
// formData.append('abstPageRange', '')
if
(
this
.
response
.
status
===
200
)
{
// formData.append('specPageRange', '')
this
.
showDownload
=
true
// formData.append('claimPageRange', '')
}
// formData.append('figPageRange', '')
},
// }
// 點擊下載按鈕
const
response
=
await
SplitRevisionDoc
(
this
.
baseUrl
,
formData
)
handleDownloadClick
()
{
if
(
response
)
{
if
(
this
.
response
.
status
===
200
)
{
this
.
fileList
=
[]
this
.
fileList
=
[]
this
.
$refs
.
upload
.
clearFiles
()
this
.
$refs
.
upload
.
clearFiles
()
const
zipFileName
=
response
.
data
const
zipFileName
=
this
.
response
.
data
this
.
downloadFile
(
zipFileName
)
this
.
downloadFile
(
zipFileName
)
}
else
{
}
else
{
this
.
$refs
.
upload
.
abort
()
this
.
$refs
.
upload
.
abort
()
...
...
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