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,109 +934,109 @@ export default { ...@@ -934,109 +934,109 @@ 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, f: "json",
type: "POST", tags: this.industryTree_apaas_Config["1"],
contentType: "application/x-www-form-urlencoded", title: "测试添加服务5",
//data: json, url:
data: { "https://apaasgis.wodcloud.com/server/rest/services/GZ_FJXQZTT/FeatureServer",
f: "json", type: this.dataTree_apaas_config["19"],
tags: this.industryTree_apaas_Config["1"], token: this.portalUser.token,
title: "测试添加服务5", };
url: this.$http
"https://apaasgis.wodcloud.com/server/rest/services/GZ_FJXQZTT/FeatureServer", .post(url, data)
type: this.dataTree_apaas_config["19"], .then((response) => {
token: this.portalUser.token, if (response.data.success == 1) {
}, this.shareItem(response.data.id);
dataType: "json", //dataType不能少
success: function (result) {
if (result.error != null) {
alert("添加专题图到Portal中失败," + result.error.message);
} 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, items: itemid,
dataType: "json", everyone: true,
method: "POST", token: this.portalUser.token,
data: { f: "json",
items: itemid, groups: null,
everyone: true, };
token: this.portalUser.token, this.$http
f: "json", .post(searchUrl, data)
groups: null, .then((response) => {
}, console.log(response);
success: function (data) {}, })
error: function (err) { .catch((error) => {
alert(err); 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, token: this.portalUser.token,
dataType: "json", f: "json",
method: "POST", };
data: { this.$http
token: this.portalUser.token, .post(searchUrl, data)
f: "json", .then((response) => {
}, console.log(response);
success: function (data) { 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]) {
sectors = this.industryTree_apaas_Config[tag]; sectors = this.industryTree_apaas_Config[tag];
return; return;
} }
}); });
this.form = { this.form = {
name: data.item.title, name: data.item.title,
desc: data.item.description, desc: data.item.description,
area: sectors, area: sectors,
origin: "", origin: "",
code: "自动生成", code: "自动生成",
resource: 1, resource: 1,
}; };
this.cover = this.cover =
"https://apaasgis.wodcloud.com/portal/sharing/rest/content/items/" + "https://apaasgis.wodcloud.com/portal/sharing/rest/content/items/" +
data.item.id + data.item.id +
"/info/" + "/info/" +
data.item.thumbnail + data.item.thumbnail +
"?token=" + "?token=" +
this.portalUser.token; this.portalUser.token;
this.iportal_id = data.item.id; this.iportal_id = data.item.id;
this.serviceUrl = data.item.url; this.serviceUrl = data.item.url;
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);
}, });
});
}, },
}, },
mounted() { mounted() {
...@@ -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