Toggle navigation
Toggle navigation
This project
Loading...
Sign in
monitor_v3
/
hg-monitor-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
王涛
4 years ago
Commit
b8157372cfe9947a1e87a22514dcae554965cb13
1 parent
d7e452eb
文件预览;文档管理优化
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
5 deletions
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/document/index.html
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/document/index.js
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/upload/index.html
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/upload/index.js
hg-monitor-web-base/src/main/resources/static/vue3/src/script/global.js
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/document/index.html
View file @
b815737
...
...
@@ -101,7 +101,7 @@
</el-link>
<br/>
<el-link
type=
"info"
:underline=
"false"
@
click=
"reNameFile(file,false)"
>
<
span
v-if=
"!reNameFileFlg[file.id]"
>
{{file.fileName}}
</span
>
<
div
v-if=
"!reNameFileFlg[file.id]"
style=
"width: 120px;overflow: hidden;text-overflow: ellipsis;text-align: left;"
>
{{file.fileName}}
</div
>
<el-input
:autofocus=
"true"
v-if=
"reNameFileFlg[file.id]"
placeholder=
"输入文件名"
v-model=
"file.fileName"
@
blur=
"reNameFile(file,true)"
></el-input>
</el-link>
</div>
...
...
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/document/index.js
View file @
b815737
...
...
@@ -150,7 +150,7 @@ export default {
getPage
(
id
);
}
else
{
proxy
.
$global
.
viewer
(
item
.
localPath
);
proxy
.
$global
.
viewer
(
item
.
localPath
,
proxy
);
}
}
...
...
@@ -556,6 +556,10 @@ export default {
if
(
type
==
'folder'
){
url
=
`
/
inspection
-
report
/
file
/
rename
/
user
`
;
}
if
(
item
.
fileName
==
null
||
item
.
fileName
==
''
){
proxy
.
$global
.
showMsg
(
"文件名称不能为空!"
,
"warning"
);
return
;
}
// 执行改名
proxy
.
$http
.
get
(
url
,
{
id
:
item
.
id
,
name
:
item
.
fileName
},
function
(
res
)
{
if
(
res
&&
res
.
success
)
{
...
...
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/upload/index.html
View file @
b815737
...
...
@@ -34,6 +34,7 @@
:before-upload=
"beforeUpload"
:multiple=
"false"
:http-request=
"getInsetFile"
:on-change=
"fileChange"
:auto-upload=
"true"
>
<el-button
size=
"small"
type=
"primary"
>
上传照片
</el-button>
</el-upload>
...
...
hg-monitor-web-base/src/main/resources/static/vue3/src/components/common/upload/index.js
View file @
b815737
...
...
@@ -120,6 +120,7 @@ export default {
category
:
props
.
category
,
docNo
:
props
.
docNo
}
debugger
// 上传文件
proxy
.
$http
.
uploadFile
(
"/inspection-report/file/upload"
,
params
,
function
(
res
)
{
if
(
res
&&
res
.
code
==
0
)
{
...
...
@@ -131,6 +132,11 @@ export default {
})
}
let
fileChange
=
(
file
,
fileList
)
=>
{
debugger
console
.
log
(
file
,
fileList
);
}
// 上传按钮点击
let
uploadFile
=
()
=>
{
proxy
.
$refs
.
upload
.
submit
()
...
...
@@ -167,7 +173,8 @@ export default {
show
,
uploadFile
,
hidedialog
,
beforeUpload
beforeUpload
,
fileChange
}
}
}
...
...
hg-monitor-web-base/src/main/resources/static/vue3/src/script/global.js
View file @
b815737
...
...
@@ -123,8 +123,14 @@ global.getQueryVariable = (variable) => {
* 文件预览
* @param path
*/
global
.
viewer
=
(
path
)
=>
{
window
.
open
(
"/src/lib/extend/pdfjs/web/viewer.html?test="
+
encodeURIComponent
(
path
));
global
.
viewer
=
(
path
,
proxy
)
=>
{
proxy
.
$http
.
get
(
`
/
api
-
web
/
openoffice
/
convertPdf
/
?
path
=
$
{
encodeURIComponent
(
path
)}
`
,
{},
function
(
res
)
{
if
(
res
&&
res
.
success
)
{
window
.
open
(
"/src/lib/extend/pdfjs/web/viewer.html?test="
+
encodeURIComponent
(
res
.
str
));
}
else
{
global
.
showMsg
(
data
.
msg
,
"error"
)
}
})
}
/**
...
...
Please
register
or
login
to post a comment