Commit 50565581 authored by 张俊's avatar 张俊

Merge branch 'dev' of https://cloud.wodcloud.com/git/apaas/apaas-v3-ui into dev

parents 7b9b9e53 a84d52c1
...@@ -18,26 +18,33 @@ ...@@ -18,26 +18,33 @@
export default { export default {
data() { data() {
return { return {
originUrl:'https://apaasgis.wodcloud.com/portal/apaasplat/viewer/item.html' originUrl:'https://apaasgis.wodcloud.com/portal/apaasplat/viewer/item.html',
}; };
}, },
computed:{ computed:{
itemUrl:function(){ itemUrl(){
let _self = this; let _self = this;
if(_self.$route.name == 'intelligent_details'){ if(_self.$route.name == 'intelligent_details'){
return `${_self.originUrl}?id=${_self.$route.query.id}&activeMenu=${_self.$route.query.type}` return `${_self.originUrl}?id=${_self.$route.query.id}&activeMenu=${_self.$route.query.activeMenu}`
} }
} }
}, },
mounted() { mounted() {
window.addEventListener('message',event =>{ this.$nextTick(() => {
let data = event.data; window.addEventListener('message',event =>{
if (data.cmd == 'mapmsg'){ let data = event.data;
console.log(data); if (data.cmd == 'mapdetailtoview'){
} console.log(data);
this.$store.commit("setZnztDetailsParams", data.params);
this.$router.push('/intelligent_drawing')
}
})
}) })
}, },
methods: {}, methods: {},
destroyed () {
// window.removeEventListener('message')
}
}; };
</script> </script>
......
...@@ -14,34 +14,38 @@ ...@@ -14,34 +14,38 @@
</template> </template>
<script> <script>
import { mapState } from "vuex";
export default { export default {
data() { data() {
return { return {
url:'https://apaasgis.wodcloud.com/portal/apaasplat/viewer/mapViewer.html', url:'https://apaasgis.wodcloud.com/portal/apaasplat/viewer/mapViewer.html',
queryType: '',
id: '',
}; };
}, },
computed:{ computed:{
...mapState(['znztDetailsParams']),
getZnztParams() { getZnztParams() {
return this.$store.state.znztParams; return this.$store.state.znztParams;
}, },
znztUrl(){ znztUrl(){
return this.url+this.urlParams if(this.queryType == 'webmap'){
}, return this.url + `?webmap=${this.id}`;
urlParams(){ }else if (this.queryType == 'layers'){
if(this.$store.state.znztParams){ return this.url + `?layers=${this.id}`;
return `?webmap=${this.$store.state.znztParams.id}`; }else {
}else{ return this.url
return ''
} }
}, },
}, },
watch: { watch: {
getZnztParams(newVal) { getZnztParams(newVal) {
this.urlParams = `?webmap=${newVal.id}`
console.log('智能制图参数'+newVal) console.log('智能制图参数'+newVal)
}, },
}, },
mounted() { mounted() {
this.id = this.znztDetailsParams.id;
this.queryType = this.znztDetailsParams.queryType;
this.$nextTick(() => { this.$nextTick(() => {
window.addEventListener('message',event =>{ window.addEventListener('message',event =>{
let data = event.data; let data = event.data;
...@@ -77,6 +81,27 @@ export default { ...@@ -77,6 +81,27 @@ export default {
}); });
window.open(routeData.href, '_blank'); window.open(routeData.href, '_blank');
} }
// 智能制图页面跳转
if (data.cmd == 'mapviewurl'){
console.log(data);
switch (data.params.queryType) {
case 'webmap':
this.queryType = 'webmap';
this.$store.commit("setZnztIdParams", data.params.id);
this.id = data.params.id;
break;
case 'layers':
this.queryType = 'layers';
this.$store.commit("setZnztIdParams", data.params.id);
this.id = data.params.id;
break;
default:
this.queryType = '';
this.$store.commit("setZnztIdParams", '');
this.id = '';
break;
}
}
}) })
}) })
}, },
......
...@@ -21,6 +21,12 @@ const store = new Vuex.Store({ ...@@ -21,6 +21,12 @@ const store = new Vuex.Store({
menuCartState: 0, //购物车操作都要修改这个值,menu监听这个值的变化实时获取购物车列表 menuCartState: 0, //购物车操作都要修改这个值,menu监听这个值的变化实时获取购物车列表
znztParams: null, //智能制图传入过来的数据 znztParams: null, //智能制图传入过来的数据
appBuilderParams: null, //应用程序传入过来的数据 appBuilderParams: null, //应用程序传入过来的数据
znztIdParams: '', //智能制图服务id
znztDetailsParams: {
type: '',
queryType: '',
id: '',
}, //智能制图服务详情id
}, },
getters: { getters: {
// 1:超管 2:组织管理员 3:普通用户 4:开发者 // 1:超管 2:组织管理员 3:普通用户 4:开发者
...@@ -60,6 +66,12 @@ const store = new Vuex.Store({ ...@@ -60,6 +66,12 @@ const store = new Vuex.Store({
setAppBuilderParams(state, newValue) { setAppBuilderParams(state, newValue) {
state.appBuilderParams = newValue; state.appBuilderParams = newValue;
}, },
setZnztIdParams(state, newValue) {
state.znztIdParams = newValue;
},
setZnztDetailsParams(state, newValue) {
state.znztDetailsParams = newValue;
},
}, },
}); });
......
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