Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xxx_phase2_web
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
夏敏伟
xxx_phase2_web
Commits
1f531d1f
Commit
1f531d1f
authored
Dec 04, 2023
by
以墨为白
🎧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档预览
parent
deb50e5d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
20 deletions
+78
-20
onlyoffice.html
onlyoffice.html
+24
-4
src/components/common/document_preview.vue
src/components/common/document_preview.vue
+5
-7
src/util/http_util.js
src/util/http_util.js
+4
-1
src/view/flfg/znfx.vue
src/view/flfg/znfx.vue
+13
-2
src/view/fzjc/znfx.vue
src/view/fzjc/znfx.vue
+13
-2
src/view/sjgl/wxk_public.vue
src/view/sjgl/wxk_public.vue
+19
-4
No files found.
onlyoffice.html
View file @
1f531d1f
...
...
@@ -3,7 +3,7 @@
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
<title>
文件预览
</title>
</head>
<body>
...
...
@@ -11,9 +11,29 @@
<script
src=
"http://192.168.168.213:9000/web-apps/apps/api/documents/api.js"
></script>
<script>
var
getParameters
=
function
()
{
var
search
=
window
.
location
.
search
;
var
obj
=
{};
if
(
search
!=
''
)
{
// window.location.search '' or start with '?'
search
=
search
.
substring
(
1
);
var
keypairArray
=
search
.
split
(
'
&
'
);
for
(
i
in
keypairArray
)
{
keypair
=
keypairArray
[
i
];
partArray
=
keypair
.
split
(
'
=
'
);
if
(
partArray
.
length
==
2
)
{
obj
[
partArray
[
0
]]
=
partArray
[
1
];
}
}
}
return
obj
;
}
var
param
=
getParameters
();
var
docEditor
=
new
DocsAPI
.
DocEditor
(
"
placeholder
"
,
{
"
document
"
:
{
"
fileType
"
:
"
pptx
"
,
"
fileType
"
:
param
.
fileType
.
replace
(
"
.
"
,
""
)
,
"
permissions
"
:
{
"
edit
"
:
false
,
"
copy
"
:
false
,
...
...
@@ -22,8 +42,8 @@
"
chat
"
:
false
},
// "key": "C8D7FB890BAC496FB0D27B163EDB88BDAA",
"
title
"
:
"
zf张飞.pptx
"
,
"
url
"
:
"
http://192.168.168.110:9006/document/DD27367D-5680-46FF-9A6D-F248F4567511.pptx?Content-Disposition=attachment%3B%20filename%3D%22DD27367D-5680-46FF-9A6D-F248F4567511.pptx%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=admin%2F20231127%2F%2Fs3%2Faws4_request&X-Amz-Date=20231127T031344Z&X-Amz-Expires=432000&X-Amz-SignedHeaders=host&X-Amz-Signature=c5fb3f67663eb945adfe54b8f1783b08ed08a9704464bd86465459fc0ef6917e
"
,
"
title
"
:
decodeURIComponent
(
param
.
filename
)
,
"
url
"
:
decodeURIComponent
(
param
.
url
)
,
},
"
height
"
:
"
1000px
"
,
"
width
"
:
"
100%
"
,
...
...
src/components/common/document_preview.vue
View file @
1f531d1f
<
template
>
<div>
</div>
<div
id=
"placeholder"
></div>
</
template
>
<
script
>
...
...
@@ -15,7 +13,7 @@ export default {
mounted
()
{
var
docEditor
=
new
DocsAPI
.
DocEditor
(
"
placeholder
"
,
{
"
document
"
:
{
"
fileType
"
:
"
pptx
"
,
"
fileType
"
:
this
.
fileType
,
"
permissions
"
:
{
"
edit
"
:
false
,
"
copy
"
:
false
,
...
...
@@ -24,10 +22,10 @@ export default {
"
chat
"
:
false
},
// "key": "C8D7FB890BAC496FB0D27B163EDB88BDAA",
"
title
"
:
"
zf张飞.pptx
"
,
"
url
"
:
"
http://192.168.168.110:9006/document/DD27367D-5680-46FF-9A6D-F248F4567511.pptx?Content-Disposition=attachment%3B%20filename%3D%22DD27367D-5680-46FF-9A6D-F248F4567511.pptx%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=admin%2F20231127%2F%2Fs3%2Faws4_request&X-Amz-Date=20231127T031344Z&X-Amz-Expires=432000&X-Amz-SignedHeaders=host&X-Amz-Signature=c5fb3f67663eb945adfe54b8f1783b08ed08a9704464bd86465459fc0ef6917e
"
,
"
title
"
:
this
.
filename
,
"
url
"
:
this
.
url
,
},
"
height
"
:
"
10
00px
"
,
"
height
"
:
"
4
00px
"
,
"
width
"
:
"
100%
"
,
"
editorConfig
"
:
{
"
mode
"
:
'
view
'
,
...
...
src/util/http_util.js
View file @
1f531d1f
...
...
@@ -303,7 +303,7 @@ let download = (url, filename) => {
* @return {Promise}
*/
let
getBlob
=
(
url
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
"
GET
"
,
url
,
true
);
...
...
@@ -311,6 +311,8 @@ let getBlob = (url) => {
xhr
.
onload
=
()
=>
{
if
(
xhr
.
status
===
200
)
{
resolve
(
xhr
.
response
);
}
else
{
reject
();
}
};
...
...
@@ -703,6 +705,7 @@ let post_technique_entity = (url, data, headers = {}) => {
export
{
get
,
getBlob
,
post
,
delete_util
,
fileUpload
,
...
...
src/view/flfg/znfx.vue
View file @
1f531d1f
...
...
@@ -354,7 +354,7 @@
<div
style=
"height: 400px; position: relative"
>
<!-- <video id="video" class="" preload="meta" controls width="100%" object-fit="fill" height="100%"
controlslist="nodownload" :src="video_src" disablePictureInPicture autoplay muted></video> -->
<VideoPlayer
v-if=
"centerDialogVisible_video"
:src=
"video_src"
></VideoPlayer>
<VideoPlayer
v-if=
"centerDialogVisible_video"
:src=
"video_src"
></VideoPlayer>
</div>
</el-dialog>
...
...
@@ -367,6 +367,7 @@
import
{
lastIndexOf
,
get
,
getBlob
,
post
,
fileUpload
,
delete_util
,
...
...
@@ -622,7 +623,17 @@ export default {
// let path_srt =
// "api/rest/document/pdf/" + _this.type_folder + "/" + row.file.uuid;
// window.open(path_srt);
window
.
open
(
`api/rest/file/pdf/DocumentPDF?objectName=
${
row
.
file
.
uuid
}
`
);
// window.open(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`);
getBlob
(
`api/rest/file/pdf/DocumentPDF?objectName=
${
row
.
file
.
uuid
}
`
).
then
(
res
=>
{
window
.
open
(
`api/rest/file/pdf/DocumentPDF?objectName=
${
row
.
file
.
uuid
}
`
);
}).
catch
(
err
=>
{
post
(
"
api/rest/file/path?bucket=Document&filename=
"
+
row
.
file
.
uuid
).
then
(
res
=>
{
window
.
open
(
`./onlyoffice.html?url=
${
encodeURIComponent
(
res
)}
&fileType=
${
row
.
file
.
type
}
&filename=
${
row
.
name
}
`
);
}).
catch
(
err
=>
{
this
.
$message
(
"
预览失败
"
);
});
});
}
},
//table_全文搜索预览
...
...
src/view/fzjc/znfx.vue
View file @
1f531d1f
...
...
@@ -348,7 +348,7 @@
<div
style=
"height: 400px; position: relative"
>
<!-- <video id="video" class="" preload="meta" controls width="100%" object-fit="fill" height="100%"
controlslist="nodownload" :src="video_src" disablePictureInPicture autoplay muted></video> -->
<VideoPlayer
v-if=
"centerDialogVisible_video"
:src=
"video_src"
></VideoPlayer>
<VideoPlayer
v-if=
"centerDialogVisible_video"
:src=
"video_src"
></VideoPlayer>
</div>
</el-dialog>
...
...
@@ -361,6 +361,7 @@
import
{
lastIndexOf
,
get
,
getBlob
,
post
,
fileUpload
,
delete_util
,
...
...
@@ -617,7 +618,17 @@ export default {
// let path_srt =
// "api/rest/document/pdf/" + _this.type_folder + "/" + row.file.uuid;
// window.open(path_srt);
window
.
open
(
`api/rest/file/pdf/DocumentPDF?objectName=
${
row
.
file
.
uuid
}
`
);
// window.open(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`);
getBlob
(
`api/rest/file/pdf/DocumentPDF?objectName=
${
row
.
file
.
uuid
}
`
).
then
(
res
=>
{
window
.
open
(
`api/rest/file/pdf/DocumentPDF?objectName=
${
row
.
file
.
uuid
}
`
);
}).
catch
(
err
=>
{
post
(
"
api/rest/file/path?bucket=Document&filename=
"
+
row
.
file
.
uuid
).
then
(
res
=>
{
window
.
open
(
`./onlyoffice.html?url=
${
encodeURIComponent
(
res
)}
&fileType=
${
row
.
file
.
type
}
&filename=
${
row
.
name
}
`
);
}).
catch
(
err
=>
{
this
.
$message
(
"
预览失败
"
);
});
});
}
},
//table_全文搜索预览
...
...
src/view/sjgl/wxk_public.vue
View file @
1f531d1f
...
...
@@ -274,7 +274,7 @@
<!-- <video id="video" class="" preload="meta" controls width="100%" object-fit="fill" height="100%"
controlslist="nodownload" :src="video_src" disablePictureInPicture muted autoplay type="video/x-flv"></video> -->
<VideoPlayer
v-if=
"centerDialogVisible_video"
:src=
"video_src"
></VideoPlayer>
<VideoPlayer
v-if=
"centerDialogVisible_video"
:src=
"video_src"
></VideoPlayer>
</div>
</el-dialog>
...
...
@@ -287,6 +287,7 @@
import
{
lastIndexOf
,
get
,
getBlob
,
post
,
fileUpload_PUT
,
fileUploadProgress
,
...
...
@@ -527,7 +528,7 @@ export default {
// // path_srt = path_srt + row.file.uuid;
// // _this.video_src = path_srt;
// // if (document.getElementById("video").currentTime != 0)
// // document.getElementById("video").currentTime = 0;
// }, 500);
...
...
@@ -548,7 +549,21 @@ export default {
// "/" +
// row.file.uuid;
// window.open(path_srt);
window
.
open
(
`api/rest/file/pdf/DocumentPDF?objectName=
${
row
.
file
.
uuid
}
`
);
getBlob
(
`api/rest/file/pdf/DocumentPDF?objectName=
${
row
.
file
.
uuid
}
`
).
then
(
res
=>
{
window
.
open
(
`api/rest/file/pdf/DocumentPDF?objectName=
${
row
.
file
.
uuid
}
`
);
}).
catch
(
err
=>
{
post
(
"
api/rest/file/path?bucket=Document&filename=
"
+
row
.
file
.
uuid
).
then
(
res
=>
{
window
.
open
(
`./onlyoffice.html?url=
${
encodeURIComponent
(
res
)}
&fileType=
${
row
.
file
.
type
}
&filename=
${
row
.
name
}
`
);
}).
catch
(
err
=>
{
this
.
$message
(
"
预览失败
"
);
});
});
// window.open(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`);
// post("api/rest/file/path?bucket=Document&filename=" + row.file.uuid).then(res => {
// // window.open(`./onlyoffice.html?url=${encodeURIComponent(res)}&fileType=docx&filename=${row.name}`);
// }).catch(err => {
// });
}
},
//table_全文搜索预览
...
...
@@ -764,7 +779,7 @@ export default {
//单个文件上传
let
load
=
startLoadingProgress
(
"
0%
"
);
let
self
=
this
;
this
.
centerDialogVisible_add
=
false
;
this
.
centerDialogVisible_add
=
false
;
load
.
text
=
""
;
let
md5
=
""
;
let
file
=
null
;
...
...
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