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

portal

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