Commit d3f549ba authored by 张洋's avatar 张洋

修改时空服务注册功能(如果配置为needLogin则不调用portal注册以及隐藏预览按钮)

parent 96e5a0e9
<template> <template>
<div class="map_view"> <div class="map_view">
<a class="map_view_action" href="#" @click.prevent.stop="viewAction"> <a
v-if="showView"
class="map_view_action"
href="#"
@click.prevent.stop="viewAction"
>
<img :src="require('../../assets/imgs/ic_yulan.png')" /> <img :src="require('../../assets/imgs/ic_yulan.png')" />
</a> </a>
...@@ -13,7 +18,11 @@ ...@@ -13,7 +18,11 @@
:before-close="beforeClose" :before-close="beforeClose"
> >
<div class="map_view_container"> <div class="map_view_container">
<iframe v-if="src" :src="src" frameborder="0"></iframe> <iframe
v-if="src"
:src="src"
frameborder="0"
></iframe>
</div> </div>
</el-dialog> </el-dialog>
</transition> </transition>
...@@ -26,25 +35,32 @@ export default { ...@@ -26,25 +35,32 @@ export default {
name: "map-view", name: "map-view",
data: () => ({ data: () => ({
showDialog: false, showDialog: false,
src: "", showView: false,
src: ""
}), }),
props: { props: {
id: { id: {
type: [String, Number], type: [String, Number],
required: true, required: true
}, }
}, },
methods: { methods: {
viewAction() { viewAction() {
this.src = gisServiceUrl + `/portal/apaasplat/viewer/previewMap.html?id=${this.id}`; this.src =
gisServiceUrl +
`/portal/apaasplat/viewer/previewMap.html?id=${this.id}`;
this.showDialog = true; this.showDialog = true;
}, },
beforeClose(done) { beforeClose(done) {
this.src = ""; this.src = "";
done(); done();
}
}, },
}, mounted() {
this.showView =
window.serviceConfig && window.serviceConfig.state == "needLogin";
}
}; };
</script> </script>
......
<template> <template>
<div class="map_view"> <div class="map_view">
<a class="map_view_action" href="#" @click.prevent.stop="viewAction"> <a
v-if="showView"
class="map_view_action"
href="#"
@click.prevent.stop="viewAction"
>
<img :src="require('../../assets/imgs/ic_yulan.png')" /> <img :src="require('../../assets/imgs/ic_yulan.png')" />
</a> </a>
...@@ -13,7 +18,11 @@ ...@@ -13,7 +18,11 @@
:before-close="beforeClose" :before-close="beforeClose"
> >
<div class="map_view_container"> <div class="map_view_container">
<workflows-view :zoom="0.8" :id="id" :hideDetail="true"></workflows-view> <workflows-view
:zoom="0.8"
:id="id"
:hideDetail="true"
></workflows-view>
</div> </div>
</el-dialog> </el-dialog>
</transition> </transition>
...@@ -21,19 +30,20 @@ ...@@ -21,19 +30,20 @@
</template> </template>
<script> <script>
import workflowsView from '@/components/work-flow/workflows-view' import workflowsView from "@/components/work-flow/workflows-view";
export default { export default {
name: "map-view", name: "map-view",
components:{ components: {
workflowsView workflowsView
}, },
data: () => ({ data: () => ({
showDialog: false, showDialog: false,
showView: false
}), }),
props: { props: {
id: { id: {
type: Number, type: Number,
required: true, required: true
} }
}, },
methods: { methods: {
...@@ -42,8 +52,12 @@ export default { ...@@ -42,8 +52,12 @@ export default {
}, },
beforeClose(done) { beforeClose(done) {
done(); done();
}
}, },
}, mounted() {
this.showView =
window.serviceConfig && window.serviceConfig.state == "needLogin";
}
}; };
</script> </script>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment