Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
standalone-anyremote
Overview
Overview
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
qlintonger xeno
standalone-anyremote
Commits
e411a69f
Commit
e411a69f
authored
May 07, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: pdf文件预览下载
parent
3804a457
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
src/views/remote/videoCall/chatDetails.vue
+23
-3
No files found.
src/views/remote/videoCall/chatDetails.vue
View file @
e411a69f
...
@@ -10,18 +10,22 @@
...
@@ -10,18 +10,22 @@
</div>
</div>
<!-- 聊天信息 -->
<!-- 聊天信息 -->
<template
v-if=
"type == 'txt'"
>
<template
v-if=
"type == 'txt'"
>
<div
:class=
"
{ 'bg-primary-hover': isSelf, 'bg-theme-bg3': !isSelf }" class="p-4 rounded leading-[22px] text-theme-text1">
{{
data
.
message
||
''
}}
</div>
<div
:class=
"
{ 'bg-primary-hover': isSelf, 'bg-theme-bg3': !isSelf }" class="p-4 rounded leading-[22px] text-theme-text1
break-all
">
{{
data
.
message
||
''
}}
</div>
</
template
>
</
template
>
<
template
v-else-if=
"type == 'image'"
>
<
template
v-else-if=
"type == 'image'"
>
<a-image
width=
"100%"
:height=
"160"
:src=
"data.src"
></a-image>
<a-image
width=
"100%"
:height=
"160"
:src=
"data.src"
></a-image>
</
template
>
</
template
>
<
template
v-else-if=
"type == 'pdf'"
>
<
template
v-else-if=
"type == 'pdf'"
>
<div
:class=
"
{ 'bg-primary-hover': isSelf, 'bg-theme-bg3': !isSelf }" class="py-[10px] px-3 rounded flex-center justify-between leading-[22px] text-theme-text1 w-full">
<div
:class=
"
{ 'bg-primary-hover': isSelf, 'bg-theme-bg3': !isSelf }"
class="py-[10px] px-3 rounded flex-center justify-between leading-[22px] text-theme-text1 w-full cursor-pointer"
@click="handlePreview"
>
<div
class=
"flex-center"
>
<div
class=
"flex-center"
>
<global-icon
icon=
"file"
></global-icon>
<global-icon
icon=
"file"
></global-icon>
<span
class=
"ml-3"
>
{{
data
.
fileName
||
''
}}
</span>
<span
class=
"ml-3"
>
{{
data
.
fileName
||
''
}}
</span>
</div>
</div>
<
a
:href=
"data.src"
download
target=
"_blank"
><global-icon
icon=
"download"
class=
"cursor-pointer"
></global-icon></a
>
<
global-icon
icon=
"download"
class=
"cursor-pointer"
@
click
.
stop=
"handleDown"
></global-icon
>
</div>
</div>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
...
@@ -29,9 +33,16 @@
...
@@ -29,9 +33,16 @@
</
template
>
</
template
>
</div>
</div>
</div>
</div>
<global-model
v-model:visible=
"showPreview"
width=
"80%"
:footer=
"false"
:simple=
"true"
>
<div
style=
"height: 80vh"
>
<iframe
:src=
"data.src"
frameborder=
"0"
width=
"100%"
height=
"100%"
></iframe>
</div>
</global-model>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
directlyDownloadFromURL
}
from
'@/utils/downloadData/downloadBlob'
interface
Props
{
interface
Props
{
isSelf
?:
boolean
isSelf
?:
boolean
type
?:
'txt'
|
'image'
|
'pdf'
|
'video'
type
?:
'txt'
|
'image'
|
'pdf'
|
'video'
...
@@ -42,5 +53,14 @@ const ps = withDefaults(defineProps<Props>(), {
...
@@ -42,5 +53,14 @@ const ps = withDefaults(defineProps<Props>(), {
type
:
'txt'
,
type
:
'txt'
,
data
:
()
=>
{}
data
:
()
=>
{}
})
})
//预览文件
const
showPreview
=
ref
(
false
)
const
handlePreview
=
()
=>
{
showPreview
.
value
=
true
}
//下载文件
const
handleDown
=
()
=>
{
directlyDownloadFromURL
(
ps
.
data
?.
src
,
ps
.
data
?.
fileName
)
}
</
script
>
</
script
>
<
style
lang=
"less"
scoped
></
style
>
<
style
lang=
"less"
scoped
></
style
>
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