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

对接口

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