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