Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lmp_web
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
yujian
lmp_web
Commits
ed58da1a
Commit
ed58da1a
authored
Dec 21, 2023
by
mhw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
txt预览修改
parent
d38b3763
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
index.vue
...e/testOnline/components/contentView/filePreview/index.vue
+4
-2
No files found.
src/views/gptTraining/modelService/testOnline/components/contentView/filePreview/index.vue
View file @
ed58da1a
...
@@ -13,7 +13,8 @@
...
@@ -13,7 +13,8 @@
</div>
</div>
<pdf
:page=
"currentPage"
:src=
"url"
class=
"pdf"
></pdf>
<pdf
:page=
"currentPage"
:src=
"url"
class=
"pdf"
></pdf>
</
template
>
</
template
>
<div
class=
"txt"
v-else-if=
"['txt'].indexOf(fileType)>-1"
v-html=
"txtContent"
>
<div
class=
"txt"
v-else-if=
"['txt'].indexOf(fileType)>-1"
>
{{ txtContent }}
</div>
</div>
<div
class=
"video"
v-if=
"['mp4', 'webm', 'ogg', 'ogv'].indexOf(fileType)>-1&&url"
>
<div
class=
"video"
v-if=
"['mp4', 'webm', 'ogg', 'ogv'].indexOf(fileType)>-1&&url"
>
<video
controls
style=
"width: 100%"
>
<video
controls
style=
"width: 100%"
>
...
@@ -68,7 +69,7 @@ export default {
...
@@ -68,7 +69,7 @@ export default {
fileReader
.
addEventListener
(
'load'
,
()
=>
{
fileReader
.
addEventListener
(
'load'
,
()
=>
{
const
fileContent
=
fileReader
.
result
;
const
fileContent
=
fileReader
.
result
;
// 处理文件内容
// 处理文件内容
this
.
txtContent
=
fileContent
.
replace
(
/
\n
/g
,
'<br/>'
)
this
.
txtContent
=
fileContent
});
});
fileReader
.
readAsText
(
res
,
'utf-8'
);
fileReader
.
readAsText
(
res
,
'utf-8'
);
...
@@ -136,6 +137,7 @@ export default {
...
@@ -136,6 +137,7 @@ export default {
.txt
{
.txt
{
height
:
100%
;
height
:
100%
;
overflow
:
auto
;
overflow
:
auto
;
white-space
:
pre-line
;
}
}
.pagination
{
.pagination
{
...
...
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