Commit b524d69c authored by 刘殿昕's avatar 刘殿昕

portal

parent 23b8f1eb
...@@ -354,8 +354,8 @@ ...@@ -354,8 +354,8 @@
</div> </div>
</block-radius> </block-radius>
</div> </div>
<div style="display: none"> <div>
<iframe src="https://apaasgis.wodcloud.com/portal/apaasplat/viewer/autologin.html"></iframe> <iframe src="https://apaasgis.wodcloud.com/portal/apaasplat/viewer/autologin.html" style="width: 1000px;height: 600px"></iframe>
</div> </div>
</div> </div>
</template> </template>
...@@ -934,16 +934,11 @@ export default { ...@@ -934,16 +934,11 @@ export default {
addPortalItem() { addPortalItem() {
console.log("添加portal"); console.log("添加portal");
//添加服务到portal //添加服务到portal
var url = let url =
"https://apaasgis.wodcloud.com/portal/sharing/rest/content/users/" + "https://apaasgis.wodcloud.com/portal//portal/sharing/rest/content/users/" +
this.portalUser.username + this.portalUser.username +
"/addItem"; "/addItem";
$.ajax({ let data = {
url: url,
type: "POST",
contentType: "application/x-www-form-urlencoded",
//data: json,
data: {
f: "json", f: "json",
tags: this.industryTree_apaas_Config["1"], tags: this.industryTree_apaas_Config["1"],
title: "测试添加服务5", title: "测试添加服务5",
...@@ -951,59 +946,65 @@ export default { ...@@ -951,59 +946,65 @@ export default {
"https://apaasgis.wodcloud.com/server/rest/services/GZ_FJXQZTT/FeatureServer", "https://apaasgis.wodcloud.com/server/rest/services/GZ_FJXQZTT/FeatureServer",
type: this.dataTree_apaas_config["19"], type: this.dataTree_apaas_config["19"],
token: this.portalUser.token, token: this.portalUser.token,
}, };
dataType: "json", //dataType不能少 this.$http
success: function (result) { .post(url, data)
if (result.error != null) { .then((response) => {
alert("添加专题图到Portal中失败," + result.error.message); if (response.data.success == 1) {
this.shareItem(response.data.id);
} else { } else {
this.shareItem(result.id); this.$message({
message: `删除失败`,
type: "warning",
});
} }
}, })
error: function (xhr, status, err) { .catch((error) => {
alert("添加专题图到Portal中失败," + xhr.responseText); console.log(error);
}, this.$message({
message: `添加专题图到Portal中失败,${error}`,
type: "warning",
});
}); });
}, },
shareItem(itemid) { shareItem(itemid) {
console.log(`共享portal${itemid}`); console.log(`共享portal${itemid}`);
var searchUrl = let searchUrl =
"https://apaasgis.wodcloud.com/portal/sharing/rest/content/users/" + "https://apaasgis.wodcloud.com/portal//portal/sharing/rest/content/users/" +
this.portalUser.username + this.portalUser.username +
"/shareItems"; "/shareItems";
$.ajax({ let data = {
url: searchUrl,
dataType: "json",
method: "POST",
data: {
items: itemid, items: itemid,
everyone: true, everyone: true,
token: this.portalUser.token, token: this.portalUser.token,
f: "json", f: "json",
groups: null, groups: null,
}, };
success: function (data) {}, this.$http
error: function (err) { .post(searchUrl, data)
alert(err); .then((response) => {
}, console.log(response);
})
.catch((error) => {
console.log(error);
}); });
}, },
getItemInfo(itemid) { getItemInfo(itemid) {
console.log(`获取portal参数${itemid}`); console.log(`获取portal参数${itemid}`);
var searchUrl = let searchUrl =
"https://apaasgis.wodcloud.com/portal/sharing/rest/content/users/" + "https://apaasgis.wodcloud.com/portal//portal/sharing/rest/content/users/" +
this.portalUser.username + this.portalUser.username +
"/items/" + "/items/" +
itemid; itemid;
$.ajax({ let data = {
url: searchUrl,
dataType: "json",
method: "POST",
data: {
token: this.portalUser.token, token: this.portalUser.token,
f: "json", f: "json",
}, };
success: function (data) { this.$http
.post(searchUrl, data)
.then((response) => {
console.log(response);
if (response.data.success == 1) {
var sectors = ""; var sectors = "";
$(data.item.tags).each(function (i, tag) { $(data.item.tags).each(function (i, tag) {
if (!!this.industryTree_apaas_Config[tag]) { if (!!this.industryTree_apaas_Config[tag]) {
...@@ -1031,11 +1032,10 @@ export default { ...@@ -1031,11 +1032,10 @@ export default {
this.portal_data_service_type_2 = this.dataTree_apaas_config[ this.portal_data_service_type_2 = this.dataTree_apaas_config[
data.item.type data.item.type
]; ];
console.log(item); }
}, })
error: function (err) { .catch((error) => {
alert(err); console.log(error);
},
}); });
}, },
}, },
...@@ -1046,6 +1046,7 @@ export default { ...@@ -1046,6 +1046,7 @@ export default {
console.log(event); console.log(event);
if (event.data && event.data.cmd == "getPortalUser") { if (event.data && event.data.cmd == "getPortalUser") {
this.portalUser = event.data.params; this.portalUser = event.data.params;
console.log(this.portalUser);
this.portal_status = true; this.portal_status = true;
} }
}, },
......
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