Commit 05658fff authored by 刘殿昕's avatar 刘殿昕

对接口

parent b1032fcd
......@@ -404,8 +404,11 @@ width: 620px!important;
.el-button {
border-radius: 8px;
}
/* 下拉选样式 */
/* .el-select-dropdown {
/*
下拉选样式
此处勿删,apaasV3下拉选择样式统一用这个
*/
.el-select-dropdown {
border-radius: 8px;
}
.el-select-dropdown__list {
......@@ -437,7 +440,7 @@ width: 620px!important;
}
.el-popper[x-placement^=top] .popper__arrow::after {
border-top-color: transparent;
} */
}
/* 单选激活样式 */
.el-radio__input.is-checked .el-radio__inner {
border-color: #838383;
......
......@@ -30,7 +30,9 @@ export default {
tabSize: 4,
highlightActiveLine: false
});
this.getValue();
if (this.url) {
this.getValue();
}
},
watch: {},
methods: {
......@@ -38,7 +40,7 @@ export default {
this.$http
.get(this.url)
.then(response => {
this.aceEditor.setValue(JSON.stringify(response.data, null, "\t"));
this.aceEditor.setValue(response.data);
})
.catch(function(response) {
console.log(response);
......@@ -46,6 +48,9 @@ export default {
},
parentHandleclick() {
this.$emit("getEditValue", this.aceEditor.getValue());
},
getCodesVal() {
return this.aceEditor.getValue();
}
}
};
......
......@@ -2,19 +2,25 @@
<div class="table_in_s">
<el-select
ref="inp"
v-model="selectValue" :disabled="couldNotEdit"
v-model="selectValue"
:disabled="couldNotEdit"
size="small"
@input="changeValue"
class="table_in_select"
placeholder="请选择"
>
<template v-if="selectArr&&selectArr.length>0">
<el-option v-for="(item,index) in selectArr" :key="index+3500" :label="item.label" :value="item.value"></el-option>
</template>
<template v-else>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</template>
<template v-if="selectArr && selectArr.length > 0">
<el-option
v-for="(item,index) in selectArr"
:key="index+3500"
:label="item.label"
:value="item.value"
></el-option>
</template>
<template v-else>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</template>
</el-select>
</div>
</template>
......@@ -23,9 +29,11 @@
import helper from "@/services/helper";
export default {
props: {
selectArr:{
selectArr: {
type: Array,
default: []
default: () => {
[];
}
},
item: {
type: String,
......@@ -42,7 +50,7 @@ export default {
couldNotEdit: {
type: Boolean,
default: false
},
}
},
data: () => ({
selectValue: ""
......@@ -78,6 +86,6 @@ export default {
border-radius: 4px;
}
.table_in_s .el-input.is-disabled .el-input__inner {
color: #70747C;
color: #70747c;
}
</style>
\ No newline at end of file
......@@ -367,6 +367,10 @@ export default {
type: Boolean,
default: true,
},
datas: {
type: Array,
default: null,
},
},
data() {
return {
......@@ -444,6 +448,9 @@ export default {
// console.log(this.emptyText);
// the if statement is to choose which data could be show, only used for test and template
this.selectedTabsPage = [];
if (this.datas) {
this.selectedTabsPage = this.datas;
}
this.pagination.total = 0;
if (this.autoAdd) {
this.addRow();
......
......@@ -73,7 +73,7 @@
<div class="sjfw_qqt">
<el-radio v-model="sjfwQqt" label="JSON">JSON</el-radio>
</div>
<v-apaas-code></v-apaas-code>
<v-apaas-code ref="jsonCodes"></v-apaas-code>
</el-tab-pane>
<el-tab-pane label="授权信息" name="2">
<el-row class="sqxx_row">
......@@ -120,7 +120,8 @@
size="mini"
:border="true"
:headers="sjfw_qqcstx"
url="qqcstx"
url
:datas="datas"
:searchShow="false"
:addRowBtn="false"
:autoAdd="false"
......@@ -140,7 +141,8 @@
size="mini"
:border="true"
:headers="sjfw_fhcstx"
url="fhcstx"
url
:datas="datas"
:searchShow="false"
:addRowBtn="false"
:autoAdd="false"
......@@ -285,10 +287,10 @@ export default {
{ label: "请求值", prop: "requestValue", type: "input", align: "left" }
],
sjfw_qqcstx: [
{ label: "字段编码", prop: "unicode", type: "", align: "left" },
{ label: "示例值", prop: "examples", type: "input", align: "left" },
{ label: "字段类型", prop: "type", type: "", align: "left" },
{ label: "字段名称", prop: "name", type: "input", align: "left" },
{ label: "字段编码", prop: "name", type: "", align: "left" },
{ label: "示例值", prop: "example", type: "input", align: "left" },
{ label: "字段类型", prop: "field_type", type: "", align: "left" },
{ label: "字段名称", prop: "label", type: "input", align: "left" },
{
label: "是否必须",
prop: "needable",
......@@ -296,18 +298,18 @@ export default {
align: "left",
width: 100
},
{ label: "字段说明", prop: "explanation", type: "input", align: "left" }
{ label: "字段说明", prop: "descript", type: "input", align: "left" }
],
sjfw_fhcstx: [
{ label: "字段编码", prop: "unicode", type: "", align: "left" },
{ label: "字段类型", prop: "type", type: "popover", align: "left" },
{ label: "字段名称", prop: "name", type: "input", align: "left" },
{ label: "字段说明", prop: "explanation", type: "input", align: "left" }
{ label: "字段编码", prop: "name", type: "", align: "left" },
{ label: "字段类型", prop: "field_type", type: "popover", align: "left" },
{ label: "字段名称", prop: "label", type: "input", align: "left" },
{ label: "字段说明", prop: "descript", type: "input", align: "left" }
],
url: "",
emptyText: "暂时没数据",
resultShow: false,
optionsSq: [{ label: "Bearer Token", value: "Bearer Token" }],
optionsSq: [{ label: "Bearer Token", value: "Bearer" }],
sqfsVal: "",
tokenVal: "",
sjfwQqt: "JSON",
......@@ -351,7 +353,65 @@ export default {
{ label: "教育机构", value: 9 },
{ label: "其他", value: 10 }
],
optionsOrganization: []
optionsOrganization: [],
datas: [
{
id: 123134445,
name: "name",
field_type: "string",
label: "",
descript: "",
example: "lisi",
children: null
},
{
id: 1213445,
name: "age",
field_type: "float",
label: "",
descript: "",
example: "22.00",
children: null
},
{
id: 12313444,
name: "childs",
field_type: "array",
label: "",
descript: "",
example: "",
children: [
{
id: 1231345,
name: "",
field_type: "object",
label: "",
descript: "",
example: "",
children: [
{
id: 123344445,
name: "name",
field_type: "string",
label: "",
descript: "",
example: "lili",
children: null
},
{
id: 11344445,
name: "age",
field_type: "float",
label: "",
descript: "",
example: "2.00",
children: null
}
]
}
]
}
]
}),
computed: {},
watch: {},
......@@ -362,6 +422,54 @@ export default {
},
clickFwcs() {
this.resultShow = true;
let aothorization = {};
if (this.sqfsVal != "") {
aothorization[this.sqfsVal] = this.tokenVal;
}
let request = this.$refs.fwcs_sjfw_qq.getTableData();
console.log(request);
let requestData = {};
for (let i = 0; i < request.length; i++) {
if (
request[i] &&
request[i].requestEncoding &&
request[i].requestValue &&
request[i].requestEncoding != "" &&
request[i].requestValue != ""
) {
if (
Object.keys(requestData).indexOf(request[i].requestEncoding) == -1
) {
requestData[request[i].requestEncoding] = [];
requestData[request[i].requestEncoding][0] =
request[i].requestValue;
} else {
requestData[request[i].requestEncoding].push(
request[i].requestValue
);
}
}
}
let url = `/apaas/service/v3/service/manager/test`;
let query = {
method: this.select,
url: this.input3,
Authorization: aothorization,
params: requestData,
body: this.$refs.jsonCodes.getCodesVal()
};
this.$http
.post(url, query)
.then(response => {
if (response.data.success == 1) {
this.l4 = response.data.data;
} else {
console.log(response.data.console.error);
}
})
.catch(function(response) {
console.log("unkonw error");
});
},
clickTab() {},
clickNext() {
......
......@@ -540,6 +540,58 @@
"name": "王小虎",
"explanation": "上海市普陀区金沙江路 1516 弄"
}
],
"body_fields": [
{
"name": "name",
"field_type": "string",
"label": "",
"descript": "",
"example": "lisi",
"children": null
},
{
"name": "age",
"field_type": "float",
"label": "",
"descript": "",
"example": "22.00",
"children": null
},
{
"name": "childs",
"field_type": "array",
"label": "",
"descript": "",
"example": "",
"children": [
{
"name": "",
"field_type": "object",
"label": "",
"descript": "",
"example": "",
"children": [
{
"name": "name",
"field_type": "string",
"label": "",
"descript": "",
"example": "lili",
"children": null
},
{
"name": "age",
"field_type": "float",
"label": "",
"descript": "",
"example": "2.00",
"children": null
}
]
}
]
}
]
}
}
}
\ No newline at end of file
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