Commit 12871e8d authored by 刘殿昕's avatar 刘殿昕

服务测试,修改上传,数据采集

parent 6cb66255
......@@ -114,6 +114,19 @@ export default {
},
watch: {
list(value) {
this.getFileArray(value);
},
},
created() {
if (!this.unique) {
this.anotherData.uniqueCode = this.unique;
}
},
mounted() {
this.getFileArray(this.list);
},
methods: {
getFileArray(value) {
var getListImg = [];
if (value && value.length != 0) {
for (var i = 0; i < value.length; i++) {
......@@ -126,13 +139,6 @@ export default {
this.fileArray = [...getListImg];
this.hideUpload = this.fileArray.length >= this.max;
},
},
created() {
if (!this.unique) {
this.anotherData.uniqueCode = this.unique;
}
},
methods: {
beforeAvatarUpload(file) {
if (this.type == "mp3") {
const isMP3 = file.type === "audio/mp3";
......
<template>
<div class="fwcs">
<el-breadcrumb v-if="is_map != 0" separator="/" class="bread_crumb">
<el-breadcrumb-item :to="{ path: '/workplace' }"
>在线组件工具</el-breadcrumb-item
>
<el-breadcrumb-item :to="{ path: '/intelligent_drawing' }"
>智能制图</el-breadcrumb-item
>
<el-breadcrumb-item :to="{ path: '/workplace' }">
在线组件工具
</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/intelligent_drawing' }">
智能制图
</el-breadcrumb-item>
<el-breadcrumb-item>发布信息填写</el-breadcrumb-item>
</el-breadcrumb>
<el-breadcrumb
......@@ -14,12 +14,12 @@
separator="/"
class="bread_crumb"
>
<el-breadcrumb-item :to="{ path: '/workplace' }"
>在线组件工具</el-breadcrumb-item
>
<el-breadcrumb-item :to="{ path: '/progress/designer' }"
>流程设计</el-breadcrumb-item
>
<el-breadcrumb-item :to="{ path: '/workplace' }">
在线组件工具
</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/progress/designer' }">
流程设计
</el-breadcrumb-item>
<el-breadcrumb-item>发布信息填写</el-breadcrumb-item>
</el-breadcrumb>
<el-breadcrumb v-else separator="/" class="bread_crumb">
......@@ -80,7 +80,7 @@
(用于查询流程状态)
</p>
</div>
<div v-if="(activeBtn == 4 && zhyyVal == 24) || activeBtn == 3">
<div v-show="(activeBtn == 4 && zhyyVal == 24) || activeBtn == 3">
<div class="fwcs_fwdz">
上传接口文档
<span class="title_bc">(请上传所有服务地址完整接口文档)</span>
......@@ -96,13 +96,14 @@
class="lc_upf"
up_fz="支持.pdf,.docx,.doc,.zip,.rar 格式文件"
accepts=".pdf, .docx, .doc, .zip, .rar"
:list="jkwds"
></upload-file>
</div>
<div v-if="activeBtn == 3">
<div class="fwcs_fwdz">返回数据格式</div>
<el-radio-group v-model="gz_fhsjgs" class="gz_fhsjgs_rad">
<el-radio label="JSON">JSON</el-radio>
<el-radio label="XML">XML</el-radio>
<el-radio label="xml">XML</el-radio>
</el-radio-group>
</div>
<div v-if="!(activeBtn == 4 && zhyyVal == 24)" class="fwcs_fwdz">
......@@ -142,9 +143,9 @@
></el-option>
</el-select>
</el-input>
<el-button @click="clickFwcs()" class="fwcs_btn_fwcs"
>服务测试</el-button
>
<el-button @click="clickFwcs()" class="fwcs_btn_fwcs">
服务测试
</el-button>
</div>
<div v-if="activeBtn == 0 || activeBtn == 3">
<el-tabs v-model="activeName" class="fwcs_tabs" @tab-click="clickTab">
......@@ -177,7 +178,10 @@
<el-radio label="JSON">JSON</el-radio>
</el-radio-group>
</div>
<v-apaas-code ref="jsonCodes"></v-apaas-code>
<v-apaas-code
:key="'code' + code_1_index"
ref="jsonCodes"
></v-apaas-code>
</el-tab-pane>
<el-tab-pane label="授权信息" name="2">
<el-row class="sqxx_row">
......@@ -258,7 +262,10 @@
</el-radio-group>
</div>
<div v-show="zhfwQqt == 'JSON'">
<v-apaas-code ref="zhfwJsonCodes"></v-apaas-code>
<v-apaas-code
:key="'code' + code_2_index"
ref="zhfwJsonCodes"
></v-apaas-code>
</div>
<div v-show="zhfwQqt == 'form-data'">
<ces-table
......@@ -500,7 +507,10 @@
<el-radio label="JSON">JSON</el-radio>
</el-radio-group>
</div>
<v-apaas-code :ref="`one_json_${indexOne}`"></v-apaas-code>
<v-apaas-code
:key="'code' + indexOne"
:ref="`one_json_${indexOne}`"
></v-apaas-code>
</el-tab-pane>
<el-tab-pane label="授权信息" name="2">
<el-row class="sqxx_row">
......@@ -979,6 +989,8 @@ export default {
dataType: "",
jkwds: [],
gz_fhsjgs: "JSON",
code_1_index: 0,
code_2_index: 0,
};
},
computed: {},
......@@ -999,6 +1011,40 @@ export default {
this.select = "GET";
this.serviceUrl = "";
this.noSearchUrl = "";
this.gz_fhsjgs = "JSON";
this.zhyyVal = "";
this.datasSj = [];
this.tokenVal = "";
this.datasZh = [];
this.zhfwQqt = "JSON";
this.datasZhForm = [];
this.datasZhwww = [];
this.liucheng_list = [
{
one_input: "",
select: "GET",
serviceUrl: "",
datasSj: [],
sjfwQqt: "JSON",
sqfsVal: "",
tokenVal: "",
noSearchUrl: "",
resultShow: false,
resSuccess: false,
requestRules: 0,
responseRules: 0,
request_fields: [],
response_fields: [],
checkPass: false,
dataType: "",
body_fields: [],
param_fields: [],
},
];
this.activeName = "0";
this.code_1_index += 1;
this.code_2_index += 1;
this.jkwds = [];
},
getUrl(enUrl) {
let url = decodeURI(enUrl);
......@@ -1019,7 +1065,7 @@ export default {
this.noSearchUrl = enUrl;
}
this.serviceUrl = url;
if (this.activeBtn == 0) {
if (this.activeBtn == 0 || this.activeBtn == 3) {
this.datasSj = arr;
} else if (this.activeBtn == 4) {
this.datasZh = arr;
......@@ -1153,6 +1199,13 @@ export default {
this.activeBtn == 3 ||
(this.activeBtn == 4 && (this.zhyyVal == 22 || this.zhyyVal == 23))
) {
if (
this.activeBtn == 3 ||
(this.activeBtn == 4 && this.zhyyVal == 22)
) {
if (this.jkwds.length == 0) {
this.$message.error("请上传接口文档");
} else {
let requestData = this.$refs.fwcs_sjfw_qqcs.getTableData();
let responseData = this.$refs.fwcs_sjfw_fhcs.getTableData();
this.requestRules = 0;
......@@ -1169,6 +1222,8 @@ export default {
} else if (this.responseRules != 0) {
this.$message.error("请完善返回参数信息中的字段名称");
}
}
}
} else if (this.activeBtn == 1) {
let value = helper.getQueryString("id", this.serviceUrl);
console.log(value);
......@@ -1334,77 +1389,79 @@ export default {
}
},
registePt() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.cover.length != 0) {
let contentType = "";
if (this.activeBtn == 1 && !this.is_portal) {
this.addPortalItem();
} else {
if (this.activeBtn == 0 || this.activeBtn == 3) {
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,
portal_id: this.portal_id,
encode_method: this.form.code,
urls: [
{
name: "",
response_type:
this.activeBtn == 3 ? this.gz_fhsjgs : "JSON",
req_auth_mthod: 0,
req_auth_token: this.tokenVal,
method: this.select,
url: this.serviceUrl,
request_fields:
this.dataType == "body"
? this.request_fields
: this.body_fields,
request_query_fields:
this.dataType == "param"
? this.request_fields
: this.param_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("请上传服务封面");
}
} else {
this.$message.error("请完善服务基本信息");
}
});
console.log(this.jkwds);
// this.$refs.form.validate((valid) => {
// if (valid) {
// if (this.cover.length != 0) {
// let contentType = "";
// if (this.activeBtn == 1 && !this.is_portal) {
// this.addPortalItem();
// } else {
// if (this.activeBtn == 0 || this.activeBtn == 3) {
// 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,
// portal_id: this.portal_id,
// encode_method: this.form.code,
// doc_file: this.jkwds.length != 0 ? this.jkwds[0] : "",
// urls: [
// {
// name: "",
// response_type:
// this.activeBtn == 3 ? this.gz_fhsjgs : "JSON",
// req_auth_mthod: 0,
// req_auth_token: this.tokenVal,
// method: this.select,
// url: this.serviceUrl,
// request_fields:
// this.dataType == "body"
// ? this.request_fields
// : this.body_fields,
// request_query_fields:
// this.dataType == "param"
// ? this.request_fields
// : this.param_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("请上传服务封面");
// }
// } else {
// this.$message.error("请完善服务基本信息");
// }
// });
},
registeOne() {
this.$refs.form.validate((valid) => {
......@@ -1593,14 +1650,20 @@ export default {
// id: self.portal_id,
// });
// this.$router.push("/intelligent_drawing");
if(self.is_map == 1){
let shareWebMapParam =JSON.parse(window.sessionStorage.getItem('shareWebMapParam'))
window.location.href = '/vmap/#/map'+`?id=${shareWebMapParam.portalid}`
}else if(self.is_map == 4){
if (self.is_map == 1) {
let shareWebMapParam = JSON.parse(
window.sessionStorage.getItem("shareWebMapParam")
);
window.location.href =
"/vmap/#/map" + `?id=${shareWebMapParam.portalid}`;
} else if (self.is_map == 4) {
self.$router.back(-1);
}else{
let shareWebMapParam =JSON.parse(window.sessionStorage.getItem('shareWebMapParam'))
window.location.href = '/vmap/#/map'+`?id=${shareWebMapParam.portalid}`
} else {
let shareWebMapParam = JSON.parse(
window.sessionStorage.getItem("shareWebMapParam")
);
window.location.href =
"/vmap/#/map" + `?id=${shareWebMapParam.portalid}`;
}
} else if (type == "process") {
this.$router.push("/progress/designer");
......@@ -1794,7 +1857,6 @@ export default {
let headers = {};
let requestData = {};
let dataOne = this.liucheng_list[indexOne];
console.log(dataOne);
if (dataOne.sqfsVal != "") {
headers.Authorization = [];
headers.Authorization[0] = dataOne.sqfsVal + " " + dataOne.tokenVal;
......@@ -1823,12 +1885,8 @@ export default {
}
let bodys = "";
let contentType = "";
if (this.activeBtn == 0) {
bodys = this.$refs["one_json_" + indexOne][0]
? this.$refs["one_json_" + indexOne][0].getCodesVal()
: "";
bodys = this.$refs["one_json_" + indexOne][0].getCodesVal();
contentType = dataOne.sjfwQqt;
}
let query = {
method: dataOne.select,
url: dataOne.serviceUrl,
......
......@@ -1004,6 +1004,14 @@ export default {
color: "#58617a",
url:'/search_engine',
},
{
text: "数据采集",
pic: require("@/assets/imgs/home_tool_ic_sscj.png"),
bg: "#fff2e2",
color: "#ea7d19",
url:'https://apaas3.wodcloud.com/sjcj/ui/',
target: 1,
},
],
service_arr: [
["服务列表", "申请服务", "云资源"],
......
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