Commit dfad2cba authored by 张洋's avatar 张洋

修改arcgis portal地址为可配置

parent 49d8016b
<template>
<div class="menu">
<img src="../assets/imgs/nav-logo.png" alt class="logo" />
<img
src="../assets/imgs/nav-logo.png"
alt
class="logo"
/>
<div
style="float: right; cursor: pointer; position: relative"
class="user_hover"
......@@ -8,14 +12,20 @@
<span
v-if="userInfo.user_name && userInfo.user_name != ''"
class="user"
>{{ userInfo.user_name }}</span
>
<span v-else @click="gotopage('login')" class="user">请登录</span>
>{{ userInfo.user_name }}</span>
<span
v-else
@click="gotopage('login')"
class="user"
>请登录</span>
<img
:class="userInfo.picture_path && false ? 'user_pic' : 'user_default'"
src="../assets/imgs/home_ic_user.png"
/>
<span class="has_msg" v-if="unreadMessageCount > 0"></span>
<span
class="has_msg"
v-if="unreadMessageCount > 0"
></span>
<!-- 菜单图片不需要动态渲染,只用ui给的图标 -->
<div
v-if="userInfo.user_name && userInfo.user_name != ''"
......@@ -56,7 +66,11 @@
:max="99"
class="number"
></el-badge>
<img src="../assets/imgs/home_ic_shop.png" alt class="car_img" />
<img
src="../assets/imgs/home_ic_shop.png"
alt
class="car_img"
/>
</div>
<div
v-if="userInfo.user_name && userInfo.user_name != ''"
......@@ -75,7 +89,10 @@
class="shop_img"
/>
<div class="shop_cell_msgs">
<p @click="getDetail(item.id)" class="shop_cell_name over_one">
<p
@click="getDetail(item.id)"
class="shop_cell_name over_one"
>
{{
item.service_id == 0
? item.application.app_name
......@@ -106,9 +123,11 @@
</div>
</div>
<div class="shop_footer">
<el-button @click="settlement" size="small" class="shop_settlement"
>去购物车申请结算</el-button
>
<el-button
@click="settlement"
size="small"
class="shop_settlement"
>去购物车申请结算</el-button>
</div>
</div>
<div
......@@ -150,7 +169,10 @@
: { left: '60px' }
"
></div>
<div class="bottom_show" v-if="now_menu == item.visit_url"></div>
<div
class="bottom_show"
v-if="now_menu == item.visit_url"
></div>
</div>
</div>
</div>
......@@ -158,6 +180,9 @@
<script>
const gisServiceUrl = window.serviceConfig.gisServiceRoot;
const gisPortalSiteName = window.serviceConfig.gisPortalSiteName
? window.serviceConfig.gisPortalSiteName
: "portal";
const state = window.serviceConfig.state;
export default {
data() {
......@@ -174,7 +199,7 @@ export default {
shopping_list: [],
menuCartNum: 0,
now_hover: -1,
show_shop_menu: false,
show_shop_menu: false
};
},
mounted() {
......@@ -193,7 +218,7 @@ export default {
},
getRouter() {
return this.$route.path;
},
}
},
watch: {
getMenuCartState(newVal) {
......@@ -207,7 +232,7 @@ export default {
) {
this.now_menu = val;
}
},
}
},
methods: {
change_now_hover(n) {
......@@ -218,7 +243,9 @@ export default {
if (state == "needLogin") {
window.location.href =
gisServiceUrl +
`/portal/sharing/rest/oauth2/signout?client_id=arcgisonline&redirect_uri=${window.location.protocol}//${window.location.host}/iam/api/logout`;
"/" +
gisPortalSiteName +
"/sharing/rest/oauth2/signout?client_id=arcgisonline&redirect_uri=${window.location.protocol}//${window.location.host}/iam/api/logout";
} else {
window.location.href = "/iam/api/logout";
}
......@@ -234,7 +261,7 @@ export default {
},
deleteItem(id) {
let query = [id];
this.$api.serviceShop.delShoppingCart(query).then((response) => {
this.$api.serviceShop.delShoppingCart(query).then(response => {
if (response.data.success == 1) {
this.$store.commit("setCartState");
this.getList();
......@@ -264,7 +291,7 @@ export default {
}
},
getList() {
this.$api.serviceShop.getShoppingCart().then((response) => {
this.$api.serviceShop.getShoppingCart().then(response => {
if (response.data.success == "1") {
this.menuCartNum = response.data.data.valid
? response.data.data.valid.length
......@@ -282,12 +309,12 @@ export default {
console.log(this.now_menu);
},
getNowMenu() {
this.$api.general.getNowMenu({ teamName: "APAAS3" }).then((response) => {
this.$api.general.getNowMenu({ teamName: "APAAS3" }).then(response => {
if (response.data.success == 1) {
let arr =
(response.data.data[0] && response.data.data[0].Child) || [];
let shop_index = arr.findIndex(
(item) => item.visit_url == "/shop/shopping_cart"
item => item.visit_url == "/shop/shopping_cart"
);
if (shop_index != -1) {
arr.splice(shop_index, 1);
......@@ -295,7 +322,7 @@ export default {
} else {
this.show_shop_menu = false;
}
let user_index = arr.findIndex((item) => item.visit_url == "/user");
let user_index = arr.findIndex(item => item.visit_url == "/user");
if (user_index != -1) {
this.user_arr = arr[user_index].Child;
arr.splice(user_index, 1);
......@@ -305,8 +332,8 @@ export default {
this.getMenuIndex();
}
});
},
},
}
}
};
</script>
......
......@@ -31,6 +31,9 @@
<script>
const gisServiceUrl = window.serviceConfig.gisServiceRoot;
const gisPortalSiteName = window.serviceConfig.gisPortalSiteName
? window.serviceConfig.gisPortalSiteName
: "portal";
export default {
name: "map-view",
data: () => ({
......@@ -48,7 +51,9 @@ export default {
viewAction() {
this.src =
gisServiceUrl +
`/portal/apaasplat/viewer/previewMap.html?id=${this.id}`;
"/" +
gisPortalSiteName +
"/apaasplat/viewer/previewMap.html?id=${this.id}";
this.showDialog = true;
},
beforeClose(done) {
......
......@@ -9,56 +9,69 @@
</div>
<div class="main-container">
<iframe ref="intelligent_appbuilder_iframe" width="100%" height="100%" scrolling="no" :src='appbuilderUrl' frameborder="0"></iframe>
<iframe
ref="intelligent_appbuilder_iframe"
width="100%"
height="100%"
scrolling="no"
:src='appbuilderUrl'
frameborder="0"
></iframe>
</div>
</div>
</template>
<script>
const gisServiceUrl = window.serviceConfig.gisServiceRoot;
const gisPortalSiteName = window.serviceConfig.gisPortalSiteName
? window.serviceConfig.gisPortalSiteName
: "portal";
export default {
data() {
return {
originUrl: gisServiceUrl + '/portal/apps/webappbuilder/index.html'
originUrl:
gisServiceUrl +
"/" +
gisPortalSiteName +
"/apps/webappbuilder/index.html"
};
},
computed:{
appbuilderUrl(){
computed: {
appbuilderUrl() {
let _self = this;
if(_self.$route.name == 'intelligent_appbuilder'){
return `${_self.originUrl}?title=${_self.$route.query.title}&tags=${_self.$route.query.tags}&summary=${_self.$route.query.summary}&sharewithwebmap=${_self.$route.query.sharewithwebmap}&webmap=${_self.$route.query.webmap}`
if (_self.$route.name == "intelligent_appbuilder") {
return `${_self.originUrl}?title=${_self.$route.query.title}&tags=${_self.$route.query.tags}&summary=${_self.$route.query.summary}&sharewithwebmap=${_self.$route.query.sharewithwebmap}&webmap=${_self.$route.query.webmap}`;
}
},
getAppBuilderParams() {
return this.$store.state.appBuilderParams;
},
}
},
watch: {
getAppBuilderParams(newVal) {
console.log('智能制图应用程序参数'+newVal)
},
console.log("智能制图应用程序参数" + newVal);
}
},
mounted() {
this.$nextTick(() => {
window.addEventListener('message',this.postmassageevt);
})
window.addEventListener("message", this.postmassageevt);
});
},
methods: {
postmassageevt(event){
postmassageevt(event) {
let data = event.data;
// App Builder发布服务
if (data.cmd == 'appbuildermsg'){
if (data.cmd == "appbuildermsg") {
console.log(data);
this.$store.commit("setAppBuilderParams", data.params);
this.$router.push(`/fwzc/fwcs?map=4`);
}
}
},
destroyed () {
window.removeEventListener('message',this.postmassageevt);
}
destroyed() {
window.removeEventListener("message", this.postmassageevt);
}
};
</script>
<style scoped>
......@@ -80,7 +93,10 @@ export default {
.intelligent_appbuilder-container .apass_breadcrumb {
padding: 0 20px;
}
.intelligent_appbuilder-container .apass_breadcrumb > .el-breadcrumb .el-breadcrumb__inner {
.intelligent_appbuilder-container
.apass_breadcrumb
> .el-breadcrumb
.el-breadcrumb__inner {
color: #626de9;
}
.intelligent_appbuilder-container
......
......@@ -9,63 +9,73 @@
</div>
<div class="main-container">
<iframe ref="intelligent_details_iframe" width="100%" height="100%" scrolling="no" :src='itemUrl' frameborder="0"></iframe>
<iframe
ref="intelligent_details_iframe"
width="100%"
height="100%"
scrolling="no"
:src='itemUrl'
frameborder="0"
></iframe>
</div>
</div>
</template>
<script>
const gisServiceUrl = window.serviceConfig.gisServiceRoot;
const gisPortalSiteName = window.serviceConfig.gisPortalSiteName
? window.serviceConfig.gisPortalSiteName
: "portal";
export default {
data() {
return {
originUrl: gisServiceUrl + '/portal/apaasplat/viewer/item.html',
originUrl:
gisServiceUrl + "/" + gisPortalSiteName + "/apaasplat/viewer/item.html"
};
},
computed:{
itemUrl(){
computed: {
itemUrl() {
let _self = this;
if(_self.$route.name == 'intelligent_details'){
return `${_self.originUrl}?id=${_self.$route.query.id}&activeMenu=${_self.$route.query.activeMenu}`
if (_self.$route.name == "intelligent_details") {
return `${_self.originUrl}?id=${_self.$route.query.id}&activeMenu=${_self.$route.query.activeMenu}`;
}
}
},
mounted() {
this.$nextTick(() => {
window.addEventListener('message',this.postmassageevt)
})
window.addEventListener("message", this.postmassageevt);
});
},
methods: {
postmassageevt(event){
postmassageevt(event) {
let data = event.data;
// App Builder页面 -- 新窗口打开
if (data.cmd == 'mapviewtoapp'){
if (data.cmd == "mapviewtoapp") {
let params = {
title: data.params.title,
tags: data.params.tags,
sharewithwebmap:data.params.shareWithWebMap,
webmap:data.params.id,
summary: data.params.summary,
sharewithwebmap: data.params.shareWithWebMap,
webmap: data.params.id,
summary: data.params.summary
};
let routeData = this.$router.resolve({
name: "intelligent_appbuilder",
query: params,
query: params
});
window.open(routeData.href, '_blank');
window.open(routeData.href, "_blank");
// this.$store.commit("setAppBuilderParams", data.params);
};
if (data.cmd == 'mapdetailtoview'){
}
if (data.cmd == "mapdetailtoview") {
console.log(data);
this.$store.commit("setZnztDetailsParams", data.params);
this.$router.push('/intelligent_drawing')
this.$router.push("/intelligent_drawing");
}
}
},
destroyed () {
window.removeEventListener('message',this.postmassageevt)
destroyed() {
window.removeEventListener("message", this.postmassageevt);
}
};
</script>
<style scoped>
......@@ -87,7 +97,10 @@ export default {
.intelligent_details-container .apass_breadcrumb {
padding: 0 20px;
}
.intelligent_details-container .apass_breadcrumb > .el-breadcrumb .el-breadcrumb__inner {
.intelligent_details-container
.apass_breadcrumb
> .el-breadcrumb
.el-breadcrumb__inner {
color: #626de9;
}
.intelligent_details-container
......
......@@ -8,7 +8,14 @@
</div>
<div class="main-container">
<iframe ref="intelligent_drawing_iframe" width="100%" height="100%" scrolling="no" :src="znztUrl" frameborder="0"></iframe>
<iframe
ref="intelligent_drawing_iframe"
width="100%"
height="100%"
scrolling="no"
:src="znztUrl"
frameborder="0"
></iframe>
</div>
</div>
</template>
......@@ -16,102 +23,109 @@
<script>
import { mapState } from "vuex";
const gisServiceUrl = window.serviceConfig.gisServiceRoot;
const gisPortalSiteName = window.serviceConfig.gisPortalSiteName
? window.serviceConfig.gisPortalSiteName
: "portal";
export default {
data() {
return {
url: gisServiceUrl + '/portal/apaasplat/viewer/mapViewer.html',
queryType: '',
id: '',
url:
gisServiceUrl +
"/" +
gisPortalSiteName +
"/apaasplat/viewer/mapViewer.html",
queryType: "",
id: ""
};
},
computed:{
...mapState(['znztDetailsParams']),
computed: {
...mapState(["znztDetailsParams"]),
getZnztParams() {
return this.$store.state.znztParams;
},
znztUrl(){
if(this.queryType == 'webmap'){
znztUrl() {
if (this.queryType == "webmap") {
return this.url + `?webmap=${this.id}`;
}else if (this.queryType == 'layers'){
} else if (this.queryType == "layers") {
return this.url + `?layers=${this.id}`;
}else {
return this.url
} else {
return this.url;
}
},
}
},
watch: {
getZnztParams(newVal) {
console.log('智能制图参数'+newVal)
},
console.log("智能制图参数" + newVal);
}
},
mounted() {
this.id = this.znztDetailsParams.id;
this.queryType = this.znztDetailsParams.queryType;
this.$nextTick(() => {
window.addEventListener('message',this.postmassageevt);
})
window.addEventListener("message", this.postmassageevt);
});
},
methods: {
postmassageevt(event){
postmassageevt(event) {
let data = event.data;
// 智能制图发布服务
if (data.cmd == 'mapviewmsg'){
if (data.cmd == "mapviewmsg") {
console.log(data);
this.$store.commit("setZnztParams", data.params);
this.$router.push(`/fwzc/fwcs?map=1`);
}
// App Builder页面 -- 新窗口打开
if (data.cmd == 'mapviewtoapp'){
if (data.cmd == "mapviewtoapp") {
console.log(data);
let params = {
title: data.params.title,
tags: data.params.tags,
sharewithwebmap:data.params.shareWithWebMap,
webmap:data.params.id,
summary: data.params.summary,
sharewithwebmap: data.params.shareWithWebMap,
webmap: data.params.id,
summary: data.params.summary
};
let routeData = this.$router.resolve({
name: "intelligent_appbuilder",
query: params,
query: params
});
window.open(routeData.href, '_blank');
window.open(routeData.href, "_blank");
// this.$store.commit("setAppBuilderParams", data.params);
}
// 智能制图服务详情--新窗口打开
if (data.cmd == 'mapdetailmsg'){
if (data.cmd == "mapdetailmsg") {
console.log(data);
let routeData = this.$router.resolve({
name: "intelligent_details",
query: data.params,
query: data.params
});
window.open(routeData.href, '_blank');
window.open(routeData.href, "_blank");
}
// 智能制图页面跳转
if (data.cmd == 'mapviewurl'){
if (data.cmd == "mapviewurl") {
console.log(data);
switch (data.params.queryType) {
case 'webmap':
this.queryType = 'webmap';
case "webmap":
this.queryType = "webmap";
this.$store.commit("setZnztIdParams", data.params.id);
this.id = data.params.id;
break;
case 'layers':
this.queryType = 'layers';
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 = '';
this.queryType = "";
this.$store.commit("setZnztIdParams", "");
this.id = "";
break;
}
}
}
},
destroyed () {
window.removeEventListener('message',this.postmassageevt);
}
destroyed() {
window.removeEventListener("message", this.postmassageevt);
}
};
</script>
......@@ -134,7 +148,10 @@ export default {
.intelligent_drawing-container .apass_breadcrumb {
padding: 0 20px;
}
.intelligent_drawing-container .apass_breadcrumb > .el-breadcrumb .el-breadcrumb__inner {
.intelligent_drawing-container
.apass_breadcrumb
> .el-breadcrumb
.el-breadcrumb__inner {
color: #626de9;
}
.intelligent_drawing-container
......
......@@ -858,6 +858,9 @@
<script>
const gisServiceUrl = window.serviceConfig.gisServiceRoot;
const gisPortalSiteName = window.serviceConfig.gisPortalSiteName
? window.serviceConfig.gisPortalSiteName
: "portal";
import BlockRadius from "@/components/general/block-radius";
import CesTable from "@/components/table/table-um";
import Codes from "@/components/general/codes";
......@@ -903,7 +906,10 @@ export default {
]
},
addPortalItemUrl:
gisServiceUrl + "/portal/apaasplat/viewer/addPortalItem.html",
gisServiceUrl +
"/" +
gisPortalSiteName +
"/apaasplat/viewer/addPortalItem.html",
btnList: [],
activeBtn: null,
serviceUrl: "",
......
window.serviceConfig = {
gisServiceRoot: 'https://apaasgis.wodcloud.com',
gisPortalSiteName: "portal",
state: "needLogin", // needLogin / notNeedLogin
cloudServiceRoot: 'https://cloud4.wodcloud.com/awecloud/login/#/',
};
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>Portal Web Map</title>
......@@ -10,21 +10,25 @@
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<script src="https://apaas.wodcloud.com/api_4.x/init.js"></script>
<script src="/apaas/ui/static/config/configmap.js"></script>
<script>
require([
"esri/config",
"esri/views/MapView",
"esri/WebMap"
], function(esriConfig, MapView, WebMap) {
], function (esriConfig, MapView, WebMap) {
//使用portal门户的地图资源
esriConfig.portalUrl = "https://apaasgis.wodcloud.com/portal";
esriConfig.portalUrl = window.serviceConfig.gisServiceRoot + "/" + (window.serviceConfig.gisPortalSiteName
? window.serviceConfig.gisPortalSiteName
: "portal");
var webmap = new WebMap({
portalItem: {
id: "aa912ada83904d7c901066673ee1a5aa"
......@@ -38,6 +42,7 @@
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
......
......@@ -34,13 +34,16 @@
<script src="https://apaas3.wodcloud.com/mapstatic/js/jquery-3.3.1.min.js"></script>
<script src="https://apaas3.wodcloud.com/mapstatic/js/echarts.min.js"></script>
<script src="https://apaas.wodcloud.com/api_4.x/init.js"></script>
<script src="/apaas/ui/static/config/configmap.js"></script>
<script>
require([
"esri/config",
"esri/views/MapView",
"esri/WebMap"
], function (esriConfig, MapView, WebMap) {
esriConfig.portalUrl = "https://apaasgis.wodcloud.com/portal";
esriConfig.portalUrl = window.serviceConfig.gisServiceRoot + "/" + (window.serviceConfig.gisPortalSiteName
? window.serviceConfig.gisPortalSiteName
: "portal");
var webmap = new WebMap({
portalItem: {
id: "b4f4797eb32342c5b679082bfbbef553"
......
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>Portal Web Map</title>
......@@ -10,29 +10,35 @@
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
.esri-view-width-xlarge .esri-popup__main-container {
width: 505px;
}
.esri-view-height-xlarge .esri-popup__main-container {
max-height: none;
}
.esri-popup__main-container {
max-height: none;
}
</style>
<script src="https://apaas.wodcloud.com/api_4.x/init.js"></script>
<script src="/apaas/ui/static/config/configmap.js"></script>
<script>
require([
"esri/config",
"esri/views/MapView",
"esri/WebMap"
], function(esriConfig, MapView, WebMap) {
esriConfig.portalUrl = "https://apaasgis.wodcloud.com/portal";
], function (esriConfig, MapView, WebMap) {
esriConfig.portalUrl = window.serviceConfig.gisServiceRoot + "/" + (window.serviceConfig.gisPortalSiteName
? window.serviceConfig.gisPortalSiteName
: "portal");
// 使用本地字体文件
esriConfig.fontsUrl = "https://apaas.wodcloud.com/mapstatic/font";
var webmap = new WebMap({
......@@ -46,11 +52,13 @@
container: "viewDiv"
});
view.when(function() {
view.popup.watch("selectedFeature", function(graphic) {
if (graphic && graphic.sourceLayer) {
view.when(function () {
view.popup.watch("selectedFeature", function (graphic) {
if (graphic && graphic.sourceLayer)
{
var layerName = graphic.sourceLayer.title;
switch (layerName) {
switch (layerName)
{
case "贵州视频监控要素微服务":
var name = graphic.attributes.NAME;
var code = graphic.attributes.CODE;
......@@ -72,7 +80,8 @@
var videoDomain = "https://apaas3.wodcloud.com/mapstatic/video/{0}.mp4";
var videoCode = code;
var videoSrc = undefined;
if (videoCode) {
if (videoCode)
{
videoSrc = videoDomain.replace("{0}", videoCode);
}
return "<iframe id='cameraiframe' src='https://apaas3.wodcloud.com/mapstatic/iframe/videoplay4test.html?camlist=" + videoCode + "&videosrc=" + videoSrc +
......@@ -81,6 +90,7 @@
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
......
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