Commit e64254a4 authored by 徐一鸣's avatar 徐一鸣

Merge branch 'dev' of cloud.wodcloud.com:apaas/apaas-v3-ui into dev

parents 2ac28436 796ea774
......@@ -354,13 +354,18 @@
</div>
</block-radius>
</div>
<div>
<div style="display: none">
<iframe
id="listener"
src="https://apaasgis.wodcloud.com/portal/apaasplat/viewer/addPortalItem.html"
style="width: 1000px;height: 600px"
></iframe>
</div>
<apass-dialog
ref="alertChange"
:title="dialogInfo.title"
:msg="dialogInfo.msg"
:submit="dialogInfo.submit"
></apass-dialog>
</div>
</template>
......@@ -370,10 +375,12 @@ import CesTable from "@/components/table/table-um";
import Codes from "@/components/general/codes";
import uploadFile from "@/components/general/upload_file";
import helper from "@/services/helper";
import apassDialog from "@/components/apass-dialog";
export default {
components: {
BlockRadius,
CesTable,
apassDialog,
"v-apaas-code": Codes,
uploadFile,
},
......@@ -540,6 +547,12 @@ export default {
is_map: false,
param_fields: [],
body_fields: [],
dialogInfo: {
title: "时空服务参数已修改",
msg: "",
submit: "",
},
is_portal: false,
};
},
computed: {},
......@@ -608,7 +621,7 @@ export default {
}
}
} else if (this.activeBtn == 1) {
} else if (this.activeBtn == 4) {
} else if (this.activeBtn == 4 && this.zhyyVal != 34) {
let request = this.$refs.fwcs_zhfw_qq.getTableData();
for (let i = 0; i < request.length; i++) {
if (
......@@ -722,6 +735,11 @@ export default {
console.log(value);
if (value && value != "") {
this.getItemInfo(value);
} else {
this.form.name = "";
this.form.desc = "";
this.form.area = "";
this.cover = [];
}
this.request_fields = [];
this.response_fields = [];
......@@ -778,53 +796,52 @@ export default {
if (valid) {
if (this.cover.length != 0) {
let contentType = "";
if (this.activeBtn == 0) {
contentType = this.sjfwQqt;
} else if (this.activeBtn == 1) {
let value = helper.getQueryString("id", this.serviceUrl);
if (value == "") {
this.addPortalItem();
}
} else if (this.activeBtn == 4) {
if (this.activeZh == 1) {
contentType = this.zhfwQqt;
if (this.activeBtn == 1 && !this.is_portal) {
this.addPortalItem();
} else {
if (this.activeBtn == 0) {
contentType = this.sjfwQqt;
} else if (this.activeBtn == 4) {
if (this.activeZh == 1) {
contentType = this.zhfwQqt;
}
}
let query = {
name: this.form.name,
sectors: this.form.area,
organization: this.form.origin,
cover: this.cover[0],
openness: this.form.resource,
descript: this.form.desc,
data_service_type1: this.btnList[this.activeBtn].id,
data_service_type2:
this.activeBtn == 0
? 12
: this.activeBtn == 1
? this.skfwQqt
: this.activeBtn == 4
? this.zhyyVal
: 0,
encode_method: this.form.code,
method: this.select,
url: this.serviceUrl,
request_fields:
this.body_fields.length == 0 ? [] : this.request_fields,
request_query_fields:
this.param_fields.length == 0 ? [] : this.request_fields,
response_fields: this.response_fields,
content_type: contentType,
};
this.$api.workbench.serviceAdd(query).then((response) => {
if (response.data.success == 1) {
this.$message.success("服务注册成功");
this.$router.push("/fwgl/" + this.$store.getters.level);
} else {
console.log(response.data.errMsg);
this.$message.error(response.data.errMsg);
}
});
}
let query = {
name: this.form.name,
sectors: this.form.area,
organization: this.form.origin,
cover: this.cover[0],
openness: this.form.resource,
descript: this.form.desc,
data_service_type1: this.btnList[this.activeBtn].id,
data_service_type2:
this.activeBtn == 0
? 12
: this.activeBtn == 1
? this.skfwQqt
: this.activeBtn == 4
? this.zhyyVal
: 0,
encode_method: this.form.code,
method: this.select,
url: this.serviceUrl,
request_fields:
this.body_fields.length == 0 ? [] : this.request_fields,
request_query_fields:
this.param_fields.length == 0 ? [] : this.request_fields,
response_fields: this.response_fields,
content_type: contentType,
};
this.$api.workbench.serviceAdd(query).then((response) => {
if (response.data.success == 1) {
this.$message.success("服务注册成功");
this.$router.push("/fwgl/" + this.$store.getters.level);
} else {
console.log(response.data.errMsg);
this.$message.error(response.data.errMsg);
}
});
} else {
this.$message.error("请上传服务封面");
}
......@@ -901,6 +918,7 @@ export default {
},
addPortalItem() {
console.log("添加portal");
let self = this;
document.getElementById("listener").contentWindow.postMessage(
{
cmd: "addPortalItem",
......@@ -936,16 +954,32 @@ export default {
let data = event.data.params;
self.form.name = data.name;
self.form.desc = data.descript;
self.form.area = data.sectors;
self.form.area = Number(data.sectors);
self.serviceUrl = data.url;
self.skfwQqt = data.data_service_type2;
self.skfwQqt = Number(data.data_service_type2);
self.cover[0] = data.cover;
self.dialogInfo.msg = `您的时空服务地址已更新为${
self.serviceUrl
},服务类型更新为${
self.skfwRadios.find((item) => {
return item.id == self.skfwQqt;
}).name
}`;
self.dialogInfo.submit = () => {
self.$refs.alertChange.hide();
};
self.$refs.alertChange.show();
self.is_portal = true;
} else if (event.data.cmd == "getPortalItemInfoError") {
console.log(event.data.params);
self.is_portal = false;
} else if (event.data.cmd == "addPortalItem") {
console.log(event.data.params);
self.is_portal = true;
self.registe();
} else if (event.data.cmd == "addPortalItemError") {
console.log(event.data.params);
self.is_portal = false;
}
}
});
......
......@@ -44,7 +44,7 @@ export default {
if (data.cmd == 'appbuildermsg'){
console.log(data);
this.$store.commit("setAppBuilderParams", data.params);
this.$router.push(`/fwzc/fwcs`);
this.$router.push(`/fwzc/fwcs?map=4`);
}
})
},
......
......@@ -53,7 +53,7 @@ export default {
if (data.cmd == 'mapviewmsg'){
console.log(data);
this.$store.commit("setZnztParams", data.params);
this.$router.push(`/fwzc/fwcs`);
this.$router.push(`/fwzc/fwcs?map=1`);
}
// App Builder页面 -- 新窗口打开
if (data.cmd == 'mapviewtoapp'){
......
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