Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
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
viitto
pptist
Commits
fe9f1074
Commit
fe9f1074
authored
Jun 17, 2024
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善文件下载部分缺漏
parent
e5d1132b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
FileService.ts
src/services/FileService.ts
+3
-3
Share.vue
src/views/SellTemplate/Share.vue
+11
-6
No files found.
src/services/FileService.ts
View file @
fe9f1074
...
...
@@ -21,7 +21,7 @@ const fetchWithTimeout = (url:string, timeout:number)=>{
}
class
FileService
{
static
downloadLinePdfAsync
=
async
(
id
:
any
)
=>
{
let
url
=
`
https://fileservice.oytour.com
/api/pdf/
${
id
}
`
let
url
=
`
${
process
.
env
.
VUE_APP_PDF_URL
}
/api/pdf/
${
id
}
`
try
{
const
response
=
await
fetchWithTimeout
(
url
,
60
*
1000
);
// 处理响应
...
...
@@ -103,7 +103,7 @@ class FileService {
}
static
notifyFontUpdateAsync
=
async
(
fileName
:
string
)
=>
{
await
fetch
(
'https://fileservice.oytour.com/api/file/downfont/'
+
fileName
)
await
fetch
(
`
${
process
.
env
.
VUE_APP_PDF_URL
}
/api/file/downfont/`
+
fileName
)
}
static
uploadToFontServerAsync
=
async
(
file
:
File
)
=>
{
...
...
@@ -111,7 +111,7 @@ class FileService {
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
file
);
const
response
=
await
fetch
(
'https://fileservice.oytour.com/api/file/uploadfont'
,
{
const
response
=
await
fetch
(
`
${
process
.
env
.
VUE_APP_PDF_URL
}
/api/file/uploadfont`
,
{
method
:
'POST'
,
body
:
formData
,
});
...
...
src/views/SellTemplate/Share.vue
View file @
fe9f1074
...
...
@@ -82,7 +82,8 @@
<template
#
dropdown
>
<el-dropdown-menu
class=
"q-pa-md"
>
<el-dropdown-item
v-if=
"scope.row.IsEdit && scope.row.FileType!=0"
icon=
"EditPen"
@
click=
"editorFileHandler(scope.row)"
>
编辑
</el-dropdown-item>
<el-dropdown-item
v-if=
"scope.row.IsDownload && scope.row.FileType!=0"
icon=
"Download"
@
click=
"exportDocument(scope.row)"
>
导出
</el-dropdown-item>
<el-dropdown-item
v-if=
"scope.row.IsDownload && scope.row.FileType!=0"
icon=
"Download"
@
click=
"exportDocument(scope.row,0)"
>
导出PDF
</el-dropdown-item>
<el-dropdown-item
v-if=
"scope.row.IsDownload && scope.row.FileType!=0"
icon=
"Download"
@
click=
"exportDocument(scope.row,2)"
>
导出图片
</el-dropdown-item>
<el-dropdown-item
icon=
"CopyDocument"
v-if=
"scope.row.IsView"
@
click=
"openCopyHandler(scope.row)"
>
复制到
</el-dropdown-item>
</el-dropdown-menu>
</
template
>
...
...
@@ -103,7 +104,7 @@ import { ApiResult } from "@/configs/axios";
import
ConfigService
from
"@/services/ConfigService"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
PropType
,
inject
,
reactive
,
ref
,
watch
}
from
"vue"
;
import
{
createPlayLink
,
createSaleEditorLink
,
formatDateTimeToRead
,
query
}
from
'@/utils/common'
import
{
createPlayLink
,
createSaleEditorLink
,
downLoadFile
,
formatDateTimeToRead
,
query
}
from
'@/utils/common'
import
breadPeeling
from
'./components/breadPeeling.vue'
import
CopyFile
from
'./components/CopyFile.vue'
import
{
injectKeyTemplate
}
from
"@/types/injectKey"
;
...
...
@@ -203,10 +204,14 @@ const openFileDocument = (item:any) => {
const
url
=
createPlayLink
(
item
.
FileId
,
0
,
2
)
//`${location.origin}/?uid=${param.uid}&sellId=${item.FileId}&ViewSlideshow=2`
window
.
open
(
url
);
}
const
exportDocument
=
(
item
:
any
)
=>
{
let
url
=
`https://fileservice.oytour.com/api/img/
${
item
.
FileId
}
/1/png/1/
${
item
.
HashInfo
}
`
if
(
item
.
FileType
==
1
)
url
=
`https://fileservice.oytour.com/api/pdf/
${
item
.
FileId
}
/
${
item
.
HashInfo
}
`
window
.
open
(
url
);
const
exportDocument
=
(
item
:
any
,
type
:
0
|
1
|
2
)
=>
{
downLoadFile
({
Id
:
item
.
FileId
,
Hash
:
item
.
HashInfo
,
Range
:
'0'
,
Quality
:
1
,
DownloadType
:
type
})
}
const
changeFolderHandler
=
async
(
item
:
any
)
=>
{
if
(
item
.
FileType
==
0
){
...
...
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