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
a9fa7fc7
Commit
a9fa7fc7
authored
Sep 01, 2022
by
shuaiqiang
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor:调整文件拖拽问题
parent
ebfe74d3
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
70 deletions
+60
-70
api/convertApi.js
api/convertApi.js
+15
-15
example/App.vue
example/App.vue
+5
-4
packages/convertTool/src/components/Cn2CpcForm.vue
packages/convertTool/src/components/Cn2CpcForm.vue
+1
-2
packages/convertTool/src/components/Cn2PctForm.vue
packages/convertTool/src/components/Cn2PctForm.vue
+1
-3
packages/convertTool/src/components/Pct2CnForm.vue
packages/convertTool/src/components/Pct2CnForm.vue
+32
-39
packages/fileSplit/src/components/SplitWordForm.vue
packages/fileSplit/src/components/SplitWordForm.vue
+3
-4
packages/upload/src/index.vue
packages/upload/src/index.vue
+3
-3
No files found.
api/convertApi.js
View file @
a9fa7fc7
import
service
from
'
@utils/GraphApiService
'
import
service
from
'
@utils/GraphApiService
'
export
function
CnConversionPCT
(
baseURL
,
data
)
{
// export function CnConversionPCT(baseURL, data) {
// return service({
// baseURL: baseURL,
// url: 'Word/CN2PCT',
// method: 'post',
// data
// })
// }
export
function
fetchPctToCn
(
baseURL
,
data
)
{
return
service
({
return
service
({
baseURL
:
baseURL
,
baseURL
:
baseURL
,
url
:
'
Word/
CN2PCT
'
,
url
:
'
Word/
PCT2CN
'
,
method
:
'
post
'
,
method
:
'
POST
'
,
data
data
})
})
}
}
export
function
fetchDownloadFile
(
baseURL
,
params
)
{
// export function fetchConvertEquations(baseURL, data) {
return
service
({
baseURL
:
baseURL
,
url
:
'
RequestPayment/DownloadFile
'
,
method
:
'
get
'
,
responseType
:
'
blob
'
,
params
})
}
// export function CnConversionPCT(baseURL, data) {
// return service({
// return service({
// baseURL: baseURL,
// baseURL: baseURL,
// url: 'Word/C
N2PCT
',
// url: 'Word/C
onvertEquations
',
// method: '
post
',
// method: '
POST
',
// data
// data
// })
// })
// }
// }
\ No newline at end of file
example/App.vue
View file @
a9fa7fc7
...
@@ -2,11 +2,12 @@
...
@@ -2,11 +2,12 @@
<div
id=
"app"
>
<div
id=
"app"
>
Hi app
Hi app
<pLink
type=
"primary"
>
Test
</pLink>
<pLink
type=
"primary"
>
Test
</pLink>
<!--
<splitTool
env=
"dev_test_sz"
></splitTool>
-->
<splitTool
env=
"dev_test_sz"
></splitTool>
<!--
<convertTool
env=
"dev_test_sz"
></convertTool>
-->
<convertTool
env=
"dev_test_sz"
></convertTool>
<!--
<upload
env=
"dev_file_sz"
></upload>
-->
<fileSplit
env=
"dev_file_sz"
></fileSplit>
<upload
env=
"dev_file_sz"
></upload>
<uploadExcel
env=
"dev_test_sz"
></uploadExcel>
<uploadExcel
env=
"dev_test_sz"
></uploadExcel>
<!--
<fileSplit
env=
"dev_file_sz"
></fileSplit>
-->
</div>
</div>
</
template
>
</
template
>
...
...
packages/convertTool/src/components/Cn2CpcForm.vue
View file @
a9fa7fc7
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
:on-remove=
"handleFileRemove"
:on-remove=
"handleFileRemove"
:on-exceed=
"handleExceed"
:on-exceed=
"handleExceed"
:auto-upload=
"false"
:auto-upload=
"false"
accept=
"
application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document
"
accept=
"
.docx, .doc
"
>
>
<i
class=
"el-icon-upload"
/>
<i
class=
"el-icon-upload"
/>
<div
class=
"el-upload__text"
>
<div
class=
"el-upload__text"
>
...
@@ -47,7 +47,6 @@
...
@@ -47,7 +47,6 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
CnConversionPCT
,
fetchDownloadFile
}
from
"
@api/convertApi
"
;
import
GraphApiService
from
'
@utils/GraphApiService
'
import
GraphApiService
from
'
@utils/GraphApiService
'
export
default
{
export
default
{
name
:
'
Cn2CpcForm
'
,
name
:
'
Cn2CpcForm
'
,
...
...
packages/convertTool/src/components/Cn2PctForm.vue
View file @
a9fa7fc7
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
:on-remove=
"handleFileRemove"
:on-remove=
"handleFileRemove"
:on-exceed=
"handleExceed"
:on-exceed=
"handleExceed"
:auto-upload=
"false"
:auto-upload=
"false"
accept=
"
application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document
"
accept=
"
.docx, .doc
"
>
>
<i
class=
"el-icon-upload"
/>
<i
class=
"el-icon-upload"
/>
<div
class=
"el-upload__text"
>
<div
class=
"el-upload__text"
>
...
@@ -51,7 +51,6 @@
...
@@ -51,7 +51,6 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
CnConversionPCT
,
fetchDownloadFile
}
from
"
@api/convertApi
"
;
import
GraphApiService
from
'
@utils/GraphApiService
'
import
GraphApiService
from
'
@utils/GraphApiService
'
export
default
{
export
default
{
name
:
'
Cn2PctForm
'
,
name
:
'
Cn2PctForm
'
,
...
@@ -78,7 +77,6 @@ export default {
...
@@ -78,7 +77,6 @@ export default {
this
.
fileList
.
forEach
(
e
=>
{
this
.
fileList
.
forEach
(
e
=>
{
formData
.
append
(
'
file
'
,
e
.
raw
)
formData
.
append
(
'
file
'
,
e
.
raw
)
})
})
console
.
log
(
this
.
baseUrl
)
GraphApiService
GraphApiService
.
post
(
'
Word/CN2PCT
'
,
formData
)
.
post
(
'
Word/CN2PCT
'
,
formData
)
.
then
(
res
=>
{
.
then
(
res
=>
{
...
...
packages/convertTool/src/components/Pct2CnForm.vue
View file @
a9fa7fc7
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
:on-remove=
"handleFileRemove"
:on-remove=
"handleFileRemove"
:on-exceed=
"handleExceed"
:on-exceed=
"handleExceed"
:auto-upload=
"false"
:auto-upload=
"false"
accept=
"
application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document
"
accept=
"
.docx, .doc
"
>
>
<i
class=
"el-icon-upload"
/>
<i
class=
"el-icon-upload"
/>
<div
class=
"el-upload__text"
>
<div
class=
"el-upload__text"
>
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
GraphApiService
from
'
@utils/GraphApiService
'
import
GraphApiService
from
'
@utils/GraphApiService
'
import
{
fetchPctToCn
}
from
'
@api/convertApi
'
export
default
{
export
default
{
name
:
'
Cn2CpcForm
'
,
name
:
'
Cn2CpcForm
'
,
data
:
function
()
{
data
:
function
()
{
...
@@ -64,7 +64,7 @@ export default {
...
@@ -64,7 +64,7 @@ export default {
},
},
methods
:
{
methods
:
{
// 上传到服务器
// 上传到服务器
submitUpload
()
{
async
submitUpload
()
{
console
.
log
(
this
.
fileList
)
console
.
log
(
this
.
fileList
)
if
(
this
.
fileList
.
length
<=
0
)
{
if
(
this
.
fileList
.
length
<=
0
)
{
this
.
$message
.
error
(
'
请先选择需要上传的文件!
'
)
this
.
$message
.
error
(
'
请先选择需要上传的文件!
'
)
...
@@ -74,13 +74,12 @@ export default {
...
@@ -74,13 +74,12 @@ export default {
this
.
fileList
.
forEach
(
e
=>
{
this
.
fileList
.
forEach
(
e
=>
{
formData
.
append
(
'
file
'
,
e
.
raw
)
formData
.
append
(
'
file
'
,
e
.
raw
)
})
})
GraphApiService
.
post
(
'
Word/PCT2CN
'
,
formData
)
const
response
=
await
fetchPctToCn
(
this
.
baseUrl
,
formData
)
.
then
(
res
=>
{
if
(
response
.
status
===
200
)
{
if
(
res
.
status
===
200
)
{
this
.
fileList
=
[]
this
.
fileList
=
[]
this
.
$refs
.
upload
.
clearFiles
()
this
.
$refs
.
upload
.
clearFiles
()
const
excelFileName
=
res
.
data
const
excelFileName
=
response
.
data
GraphApiService
GraphApiService
.
get
(
'
RequestPayment/DownloadFile
'
,
{
.
get
(
'
RequestPayment/DownloadFile
'
,
{
params
:
{
params
:
{
...
@@ -88,8 +87,8 @@ export default {
...
@@ -88,8 +87,8 @@ export default {
},
},
responseType
:
'
blob
'
responseType
:
'
blob
'
})
})
.
then
(
response
=>
{
.
then
(
res
=>
{
const
blob
=
new
Blob
([
response
])
const
blob
=
new
Blob
([
res
])
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
...
@@ -103,13 +102,7 @@ export default {
...
@@ -103,13 +102,7 @@ export default {
this
.
$refs
.
upload
.
abort
()
this
.
$refs
.
upload
.
abort
()
this
.
$message
.
error
(
'
下载档案失败!
'
)
this
.
$message
.
error
(
'
下载档案失败!
'
)
}
}
console
.
log
(
res
.
data
)
console
.
log
(
response
.
data
)
})
.
catch
(
error
=>
{
console
.
log
(
'
error
'
,
error
)
this
.
$refs
.
upload
.
abort
()
this
.
$message
.
error
(
'
下载档案失败!
'
)
})
},
},
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
handelFileChange
(
file
,
fileList
)
{
handelFileChange
(
file
,
fileList
)
{
...
...
packages/fileSplit/src/components/SplitWordForm.vue
View file @
a9fa7fc7
...
@@ -75,13 +75,13 @@
...
@@ -75,13 +75,13 @@
</div>
</div>
</template>
</template>
<
script
>
<
script
>
//
import { SplitRevisionDoc } from '@api/fileApi'
import
{
SplitRevisionDoc
}
from
'
@api/fileApi
'
import
{
mixins
}
from
"
../mixin/toolMixin
"
;
import
{
mixins
}
from
"
../mixin/toolMixin
"
;
import
service
from
'
@utils/requestService
'
import
service
from
'
@utils/requestService
'
export
default
{
export
default
{
name
:
'
SplitWordForm
'
,
name
:
'
SplitWordForm
'
,
mixins
:[
"
mixin
"
],
mixins
:[
"
mixin
s
"
],
props
:{
props
:{
baseUrl
:{
baseUrl
:{
type
:
String
type
:
String
...
@@ -176,8 +176,7 @@ export default {
...
@@ -176,8 +176,7 @@ export default {
// formData.append('claimPageRange', '')
// formData.append('claimPageRange', '')
// formData.append('figPageRange', '')
// formData.append('figPageRange', '')
// }
// }
const
response
=
await
service
.
post
(
`api/v1.0/Word/SplitRevisionDoc`
,
formData
)
const
response
=
await
SplitRevisionDoc
(
this
.
baseUrl
,
formData
)
// const response = await SplitRevisionDoc(this.baseUrl, formData)
if
(
response
)
{
if
(
response
)
{
this
.
fileList
=
[]
this
.
fileList
=
[]
this
.
$refs
.
upload
.
clearFiles
()
this
.
$refs
.
upload
.
clearFiles
()
...
...
packages/upload/src/index.vue
View file @
a9fa7fc7
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
:on-change=
"handelDetailFileChange"
:on-change=
"handelDetailFileChange"
:on-remove=
"handleDetailFileRemove"
:on-remove=
"handleDetailFileRemove"
:auto-upload=
"false"
:auto-upload=
"false"
accept=
"
application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
"
accept=
"
.xls, .xlsx
"
multiple
multiple
>
>
<i
class=
"el-icon-upload"
/>
<i
class=
"el-icon-upload"
/>
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
:on-change=
"handelFileChange"
:on-change=
"handelFileChange"
:on-remove=
"handleFileRemove"
:on-remove=
"handleFileRemove"
:auto-upload=
"false"
:auto-upload=
"false"
accept=
"
application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
"
accept=
"
.xls, .xlsx
"
multiple
multiple
>
>
<i
class=
"el-icon-upload"
/>
<i
class=
"el-icon-upload"
/>
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
:on-change=
"handelDetail2FileChange"
:on-change=
"handelDetail2FileChange"
:on-remove=
"handleDetail2FileRemove"
:on-remove=
"handleDetail2FileRemove"
:auto-upload=
"false"
:auto-upload=
"false"
accept=
"
application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
"
accept=
"
.xls, .xlsx
"
multiple
multiple
>
>
<i
class=
"el-icon-upload"
/>
<i
class=
"el-icon-upload"
/>
...
...
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