Commit af3837ce authored by “yiyousong”'s avatar “yiyousong”

pref:修改接口管理接口

parent e723b303
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
ref="ruleForm" ref="ruleForm"
:model="detailsForm" :model="detailsForm"
:rules="detailsRules" :rules="detailsRules"
:label-col="{ span: 4 }" :label-col="{ span: 5 }"
:wrapper-col="{ span: 20 }" :wrapper-col="{ span: 19 }"
> >
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
...@@ -93,8 +93,14 @@ ...@@ -93,8 +93,14 @@
showSearch showSearch
optionFilterProp="label" optionFilterProp="label"
> >
<a-select-option value="1" label="分钟"> 分钟 </a-select-option> <a-select-option
<a-select-option value="2" label="小时"> 小时 </a-select-option> v-for="(v, key) of dict.limitStrategy"
:key="key"
:value="Number(key)"
:label="v"
>
{{ v }}
</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -116,7 +122,7 @@ ...@@ -116,7 +122,7 @@
<a-select-option <a-select-option
v-for="(item, index) of dict.interfaceTag" v-for="(item, index) of dict.interfaceTag"
:key="index" :key="index"
:value="index" :value="Number(index)"
> >
{{ item }} {{ item }}
</a-select-option> </a-select-option>
...@@ -131,11 +137,29 @@ ...@@ -131,11 +137,29 @@
placeholder="请选择" placeholder="请选择"
allowClear allowClear
> >
<a-select-option value="1"> 自建发布 </a-select-option> <a-select-option :value="1"> 自建发布 </a-select-option>
<a-select-option value="2"> 对接转化 </a-select-option> <a-select-option :value="2"> 对接转化 </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">
<a-form-model-item label="流控信息" prop="authInfo">
<a-input
v-model="detailsForm.authInfo"
placeholder="请输入"
allowClear
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="授权信息" prop="flowInfo">
<a-input
v-model="detailsForm.flowInfo"
placeholder="请输入"
allowClear
/>
</a-form-model-item>
</a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="请求路径" prop="requestUrl"> <a-form-model-item label="请求路径" prop="requestUrl">
<a-input <a-input
...@@ -292,6 +316,42 @@ ...@@ -292,6 +316,42 @@
添加参数 添加参数
</a-button> </a-button>
</div> </div>
<!-- 变更记录 -->
<div class="flex aic jcb mt20">
<h1 class="title_">变更记录</h1>
</div>
<a-table
size="middle"
bordered
:row-key="(record) => record.id"
:locale="{ emptyText: '无' }"
:pagination="false"
:columns="table_columns2"
:dataSource="updatePam.table"
>
<template slot="版本号" slot-scope="text, record">
<a-input v-model="record.version" placeholder="请输入" allowClear />
</template>
<template slot="变更说明" slot-scope="text, record">
<a-input v-model="record.remark" placeholder="请输入" allowClear />
</template>
<template slot="operation" slot-scope="text, record, index">
<a-button
type="link"
@click="delTabRow('updatePam', index)"
style="color: #ff4420"
>删除</a-button
>
</template>
</a-table>
<div class="table_footer">
<a-button type="primary" class="addclass" @click="addUpdatePam">
添加记录
</a-button>
</div>
<div class="drawer_footer"> <div class="drawer_footer">
<a-button type="primary" class="addclass" @click="modalSubmit"> <a-button type="primary" class="addclass" @click="modalSubmit">
保存 保存
...@@ -326,6 +386,10 @@ export default { ...@@ -326,6 +386,10 @@ export default {
authorizeInfo: undefined, authorizeInfo: undefined,
contentType: undefined, contentType: undefined,
interfaceTag: undefined, interfaceTag: undefined,
authInfo: "", // 授权信息
flowInfo: "", // 流控信息
// 变更信息
productInterfaceLogList: [],
inEncrypt: 0, inEncrypt: 0,
outEncrypt: 0, outEncrypt: 0,
}, },
...@@ -402,6 +466,31 @@ export default { ...@@ -402,6 +466,31 @@ export default {
}, },
}, },
], ],
table_columns2: [
{
title: "版本号",
align: "center",
width: "18%",
scopedSlots: {
customRender: "版本号",
},
},
{
title: "变更说明",
align: "center",
scopedSlots: {
customRender: "变更说明",
},
},
{
title: "操作",
align: "center",
width: "60px",
scopedSlots: {
customRender: "operation",
},
},
],
requestPam: { requestPam: {
type: "path", type: "path",
table: [], table: [],
...@@ -417,6 +506,14 @@ export default { ...@@ -417,6 +506,14 @@ export default {
}, },
], ],
}, },
updatePam: {
table: [
{
version: ``,
remark: ``,
},
],
},
errorCode_columns: [ errorCode_columns: [
{ {
title: "Http Code", title: "Http Code",
...@@ -503,6 +600,7 @@ export default { ...@@ -503,6 +600,7 @@ export default {
this.detailsForm = res.data; this.detailsForm = res.data;
this.requestPam = JSON.parse(res.data.requestParameters); this.requestPam = JSON.parse(res.data.requestParameters);
this.responsePam = JSON.parse(res.data.responseParameters); this.responsePam = JSON.parse(res.data.responseParameters);
this.updatePam.table = this.detailsForm.productInterfaceLogList || [];
}); });
}, },
modalSubmit() { modalSubmit() {
...@@ -512,15 +610,14 @@ export default { ...@@ -512,15 +610,14 @@ export default {
if (json.network.length) json.network = json.network.join(","); if (json.network.length) json.network = json.network.join(",");
json.requestParameters = JSON.stringify(this.requestPam); json.requestParameters = JSON.stringify(this.requestPam);
json.responseParameters = JSON.stringify(this.responsePam); json.responseParameters = JSON.stringify(this.responsePam);
json.productInterfaceLogList = this.updatePam.table;
getInterfaceSave(json).then((res) => { getInterfaceSave(json).then((res) => {
let { code, msg } = res; let { code } = res;
if (code == 1) { if (code == 1) {
this.$message.success("保存成功"); this.$message.success("保存成功");
this.resetForm(); this.resetForm();
this.modalInfo.visible = false; this.modalInfo.visible = false;
this.$parent.getList(); this.$parent.getList();
} else {
this.$message.error(msg);
} }
}); });
} else { } else {
...@@ -561,6 +658,13 @@ export default { ...@@ -561,6 +658,13 @@ export default {
describe: ``, describe: ``,
}); });
}, },
addUpdatePam() {
this.updatePam.table.push({
version: ``,
remark: ``,
});
},
delTabRow(key, index) { delTabRow(key, index) {
this[key].table.splice(index, 1); this[key].table.splice(index, 1);
}, },
...@@ -583,6 +687,14 @@ export default { ...@@ -583,6 +687,14 @@ export default {
}, },
], ],
}; };
this.updatePam = {
table: [
{
version: ``,
remark: ``,
},
],
};
this.modalInfo.visible = false; this.modalInfo.visible = false;
}); });
}, },
......
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