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
9c7377d9
authored
2021-01-19 10:16:31 +0800
by
杨威
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://yun.pashanhoo.com:9090/renchao/CadastralSystem
2 parents
c2a10fc8
84e6cb3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
167 additions
and
0 deletions
src/views/systemTX/mapWeight/printTemplate.vue
src/views/systemTX/mapWeight/printTemplate.vue
0 → 100644
View file @
9c7377d
<
template
>
<div
class=
"printTemplate"
>
<el-form
:rules=
"rules"
:model=
"formData"
ref=
"printForm"
label-width=
"80px"
>
<el-form-item
label=
"标题:"
prop=
"title"
>
<el-input
v-model=
"formData.title"
></el-input>
</el-form-item>
<el-form-item
label=
"格式:"
prop=
"format"
>
<el-select
v-model=
"formData.format"
placeholder=
"请选择格式"
>
<el-option
v-for=
"(item,index) in formats"
:key=
"index"
:label=
"item"
:value=
"item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"模板:"
prop=
"layOut"
>
<el-select
v-model=
"formData.layOut"
placeholder=
"请选择格式"
>
<el-option
v-for=
"(item,index) in layouts"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"作者"
prop=
"author"
>
<el-input
v-model=
"formData.author"
></el-input>
</el-form-item>
<el-form-item
v-show=
"!isSuccess"
>
<el-button
type=
"primary"
@
click=
"onSubmit('printForm')"
>
确定
</el-button>
<el-button
@
click=
"resetForm('printForm')"
>
重置
</el-button>
</el-form-item>
<el-form-item
v-show=
"isSuccess"
>
<el-button
type=
"primary"
@
click=
"showResult"
>
预览
</el-button>
</el-form-item>
</el-form>
</div>
</
template
>
<
script
>
import
mapTools
from
'./js/mapTools.js'
export
default
{
props
:{
viewId
:{
type
:
String
,
default
:
""
}
},
mixins
:[
mapTools
],
data
(){
return
{
formData
:{
title
:
"地图"
,
author
:
""
,
layOut
:
"map-only"
,
format
:
"png32"
},
formats
:[
"pdf"
,
"png32"
,
"png8"
,
"jpg"
,
"gif"
,
"eps"
,
"svg"
,
"svgz"
],
layouts
:[
{
label
:
"仅地图"
,
value
:
"map-only"
},
{
label
:
"A3横向"
,
value
:
"a3-landscape"
},
{
label
:
"A3纵向"
,
value
:
"a3-portrait"
},
{
label
:
"A4横向"
,
value
:
"a4-landscape"
},
{
label
:
"A4纵向"
,
value
:
"a4-portrait"
},
{
label
:
"letter横向"
,
value
:
"letter-ansi-a-landscape"
},
{
label
:
"letter纵向"
,
value
:
"letter-ansi-a-portrait"
},
{
label
:
"B开横向"
,
value
:
"tabloid-ansi-b-landscape"
},
{
label
:
"B纵向"
,
value
:
"tabloid-ansi-b-portrait"
}
],
rules
:{
title
:
[
{
required
:
true
,
message
:
'请输入标题'
},
{
min
:
2
,
max
:
10
,
message
:
'长度在 2 到 10 个字符'
}
],
author
:[
{
min
:
2
,
max
:
10
,
message
:
'长度在 2 到 10 个字符'
}
],
layOut
:[
{
required
:
true
,
message
:
'请选择模板'
}
],
format
:[
{
required
:
true
,
message
:
'请选择格式'
}
]
},
serverUrl
:
"http://192.168.2.201:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
,
isSuccess
:
false
,
retrurnUrl
:
""
}
},
mounted
(){
this
.
initData
();
},
methods
:{
initData
(){
this
.
isSuccess
=
false
;
this
.
retrurnUrl
=
""
;
this
.
formData
=
{
title
:
"地图"
,
author
:
""
,
layOut
:
"map-only"
,
format
:
"png32"
}
},
onSubmit
(
formName
){
var
self
=
this
;
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
printMap
(
this
.
viewId
,
null
,
this
.
serverUrl
,
this
.
formData
,
function
(
res
){
if
(
res
.
url
){
self
.
isSuccess
=
true
;
self
.
retrurnUrl
=
res
.
url
;
}
});
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
showResult
(){
window
.
open
(
this
.
retrurnUrl
);
this
.
isSuccess
=
false
;
},
resetForm
(
formName
)
{
this
.
formData
=
{
title
:
"地图"
,
author
:
""
,
layOut
:
"map-only"
,
format
:
"png32"
}
}
}
}
</
script
>
<
style
scoped
lang=
"less"
>
</
style
>
Please
register
or
sign in
to post a comment