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
f1d7fed2
Commit
f1d7fed2
authored
Sep 02, 2022
by
shuaiqiang
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:去除空格
parent
62b7f597
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
58 deletions
+58
-58
packages/convertTool/src/components/Cn2CpcForm.vue
packages/convertTool/src/components/Cn2CpcForm.vue
+20
-20
packages/convertTool/src/components/Cn2PctForm.vue
packages/convertTool/src/components/Cn2PctForm.vue
+19
-19
packages/convertTool/src/components/Pct2CnForm.vue
packages/convertTool/src/components/Pct2CnForm.vue
+19
-19
No files found.
packages/convertTool/src/components/Cn2CpcForm.vue
View file @
f1d7fed2
...
@@ -74,26 +74,26 @@ export default {
...
@@ -74,26 +74,26 @@ export default {
formData
.
append
(
'
file
'
,
e
.
raw
)
formData
.
append
(
'
file
'
,
e
.
raw
)
})
})
const
res
=
await
fetchCnToCpc
(
this
.
baseUrl
,
formData
)
const
res
=
await
fetchCnToCpc
(
this
.
baseUrl
,
formData
)
if
(
res
.
status
===
200
)
{
if
(
res
.
status
===
200
)
{
this
.
fileList
=
[]
this
.
fileList
=
[]
this
.
$refs
.
upload
.
clearFiles
()
this
.
$refs
.
upload
.
clearFiles
()
const
excelFileName
=
res
.
data
const
excelFileName
=
res
.
data
const
response
=
await
fetchDownloadFile
(
this
.
baseUrl
,{
fileName
:
excelFileName
})
const
response
=
await
fetchDownloadFile
(
this
.
baseUrl
,{
fileName
:
excelFileName
})
const
blob
=
new
Blob
([
response
])
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'
a
'
)
const
downloadElement
=
document
.
createElement
(
'
a
'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
downloadElement
.
href
=
href
downloadElement
.
href
=
href
downloadElement
.
download
=
excelFileName
.
split
(
'
/
'
)[
1
]
downloadElement
.
download
=
excelFileName
.
split
(
'
/
'
)[
1
]
document
.
body
.
appendChild
(
downloadElement
)
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
downloadElement
.
click
()
document
.
body
.
removeChild
(
downloadElement
)
document
.
body
.
removeChild
(
downloadElement
)
window
.
URL
.
revokeObjectURL
(
href
)
window
.
URL
.
revokeObjectURL
(
href
)
// })
// })
}
else
{
}
else
{
this
.
$refs
.
upload
.
abort
()
this
.
$refs
.
upload
.
abort
()
this
.
$message
.
error
(
'
下载档案失败!
'
)
this
.
$message
.
error
(
'
下载档案失败!
'
)
}
}
console
.
log
(
res
.
data
)
console
.
log
(
res
.
data
)
},
},
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
handelFileChange
(
file
,
fileList
)
{
handelFileChange
(
file
,
fileList
)
{
...
...
packages/convertTool/src/components/Cn2PctForm.vue
View file @
f1d7fed2
...
@@ -78,25 +78,25 @@ export default {
...
@@ -78,25 +78,25 @@ export default {
formData
.
append
(
'
file
'
,
e
.
raw
)
formData
.
append
(
'
file
'
,
e
.
raw
)
})
})
const
res
=
await
fetchCntToPct
(
this
.
baseUrl
,
formData
)
const
res
=
await
fetchCntToPct
(
this
.
baseUrl
,
formData
)
if
(
res
.
status
===
200
)
{
if
(
res
.
status
===
200
)
{
this
.
fileList
=
[]
this
.
fileList
=
[]
this
.
$refs
.
upload
.
clearFiles
()
this
.
$refs
.
upload
.
clearFiles
()
const
excelFileName
=
res
.
data
const
excelFileName
=
res
.
data
const
response
=
await
fetchDownloadFile
(
this
.
baseUrl
,{
fileName
:
excelFileName
})
const
response
=
await
fetchDownloadFile
(
this
.
baseUrl
,{
fileName
:
excelFileName
})
const
blob
=
new
Blob
([
response
])
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'
a
'
)
const
downloadElement
=
document
.
createElement
(
'
a
'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
downloadElement
.
href
=
href
downloadElement
.
href
=
href
downloadElement
.
download
=
excelFileName
.
split
(
'
/
'
)[
1
]
downloadElement
.
download
=
excelFileName
.
split
(
'
/
'
)[
1
]
document
.
body
.
appendChild
(
downloadElement
)
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
downloadElement
.
click
()
document
.
body
.
removeChild
(
downloadElement
)
document
.
body
.
removeChild
(
downloadElement
)
window
.
URL
.
revokeObjectURL
(
href
)
window
.
URL
.
revokeObjectURL
(
href
)
}
else
{
}
else
{
this
.
$refs
.
upload
.
abort
()
this
.
$refs
.
upload
.
abort
()
this
.
$message
.
error
(
'
下载档案失败!
'
)
this
.
$message
.
error
(
'
下载档案失败!
'
)
}
}
console
.
log
(
res
.
data
)
console
.
log
(
res
.
data
)
},
},
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
handelFileChange
(
file
,
fileList
)
{
handelFileChange
(
file
,
fileList
)
{
...
...
packages/convertTool/src/components/Pct2CnForm.vue
View file @
f1d7fed2
...
@@ -74,25 +74,25 @@ export default {
...
@@ -74,25 +74,25 @@ export default {
formData
.
append
(
'
file
'
,
e
.
raw
)
formData
.
append
(
'
file
'
,
e
.
raw
)
})
})
const
res
=
await
fetchPctToCn
(
this
.
baseUrl
,
formData
)
const
res
=
await
fetchPctToCn
(
this
.
baseUrl
,
formData
)
if
(
res
.
status
===
200
)
{
if
(
res
.
status
===
200
)
{
this
.
fileList
=
[]
this
.
fileList
=
[]
this
.
$refs
.
upload
.
clearFiles
()
this
.
$refs
.
upload
.
clearFiles
()
const
excelFileName
=
res
.
data
const
excelFileName
=
res
.
data
const
response
=
await
fetchDownloadFile
(
this
.
baseUrl
,{
fileName
:
excelFileName
})
const
response
=
await
fetchDownloadFile
(
this
.
baseUrl
,{
fileName
:
excelFileName
})
const
blob
=
new
Blob
([
response
])
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'
a
'
)
const
downloadElement
=
document
.
createElement
(
'
a
'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
downloadElement
.
href
=
href
downloadElement
.
href
=
href
downloadElement
.
download
=
excelFileName
.
split
(
'
/
'
)[
1
]
downloadElement
.
download
=
excelFileName
.
split
(
'
/
'
)[
1
]
document
.
body
.
appendChild
(
downloadElement
)
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
downloadElement
.
click
()
document
.
body
.
removeChild
(
downloadElement
)
document
.
body
.
removeChild
(
downloadElement
)
window
.
URL
.
revokeObjectURL
(
href
)
window
.
URL
.
revokeObjectURL
(
href
)
}
else
{
}
else
{
this
.
$refs
.
upload
.
abort
()
this
.
$refs
.
upload
.
abort
()
this
.
$message
.
error
(
'
下载档案失败!
'
)
this
.
$message
.
error
(
'
下载档案失败!
'
)
}
}
console
.
log
(
res
.
data
)
console
.
log
(
res
.
data
)
},
},
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
handelFileChange
(
file
,
fileList
)
{
handelFileChange
(
file
,
fileList
)
{
...
...
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