Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.CadastralSystem
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
4c8e4c22
authored
2020-11-24 17:32:24 +0800
by
weimo934
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat(fjcl):添加文件预览
1 parent
0a706607
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
src/api/common.js
src/views/zd/fjcl/fjcl.vue
src/api/common.js
View file @
4c8e4c2
...
...
@@ -162,3 +162,17 @@ export function getFileLis(glbsm) {
}
})
}
/**
* 获取文件预览地址
*/
export
function
loadFile
(
url
)
{
return
request
({
url
:
"/file/loadImage"
,
method
:
'get'
,
params
:{
url
}
})
}
...
...
src/views/zd/fjcl/fjcl.vue
View file @
4c8e4c2
...
...
@@ -32,7 +32,7 @@
<td
class=
"lx"
>
{{
item
.
filepostfix
}}
</td>
<td
class=
"cz"
>
<span
@
click=
"downloadFile(item.fileurl)"
>
下载
</span>
<span>
预览
</span>
<span
@
click=
"loadFile(item.fileurl)"
>
预览
</span>
</td>
</tr>
</table>
...
...
@@ -40,7 +40,7 @@
</
template
>
<
script
>
import
{
insertFile
,
getFileLis
,
downloadFile
}
from
"./../../../api/common"
import
{
insertFile
,
getFileLis
,
downloadFile
,
loadFile
}
from
"./../../../api/common"
import
{
Message
}
from
"element-ui"
export
default
{
...
...
@@ -83,6 +83,13 @@
this
.
getFileList
(
this
.
filesData
.
glbsm
)
},
methods
:
{
loadFile
(
url
){
loadFile
(
url
).
then
(
res
=>
{
if
(
res
.
success
)
{
window
.
open
(
res
.
message
)
}
})
},
downloadFile
(
url
)
{
window
.
open
(
`/api/file/download?url=`
+
url
);
},
...
...
Please
register
or
sign in
to post a comment