Commit 2557e1b0 authored by 彭松's avatar 彭松

产品管理

parent f165714b
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
<p> <p>
<span>预约方式:</span>{{ orderInfo.up_type=='phone'?'微官网':orderInfo.up_type=='app'?'自助终端':orderInfo.up_type=='tftb'?'天府通办':'--' }} <span>预约方式:</span>{{ orderInfo.up_type=='phone'?'微官网':orderInfo.up_type=='app'?'自助终端':orderInfo.up_type=='tftb'?'天府通办':'--' }}
</p> </p>
<p>
<span>预约事项:</span>--
</p>
</div> </div>
<div class="qrcode"> <div class="qrcode">
<!-- <img src="~@/assets/images/logo.png" alt="" /> --> <!-- <img src="~@/assets/images/logo.png" alt="" /> -->
......
...@@ -2,83 +2,44 @@ ...@@ -2,83 +2,44 @@
<div class="PoliticsShow-Container"> <div class="PoliticsShow-Container">
<div class="header_box"> <div class="header_box">
<div> <div>
<button class="add_btn" @click="openDetails('新增',{})"> <button class="add_btn" @click="openDetails()">
<span>新增</span> <span>新增</span>
</button> </button>
</div> </div>
<span> <span>
<a-input <a-input allowClear v-model="query.interfaceName" placeholder="请输入接口名称查询">
allowClear
v-model="query.interfaceName"
placeholder="请输入接口名称查询"
>
<a-icon slot="prefix" type="search" /> <a-icon slot="prefix" type="search" />
</a-input> </a-input>
<a-select default-value="001"> <a-select v-model="query.interfaceSource">
<!-- <a-select-option <a-select-option value="">所有来源</a-select-option>
v-for="(item, index) of selectOptions" <a-select-option v-for="(item, index) of dict.interfaceSource" :key="index" :value="index">
:key="index" {{ item }}
:value="item.value" </a-select-option>
>
{{ item.label }}
</a-select-option> -->
<a-select-option value="001"> 来源001 </a-select-option>
<a-select-option value="002"> 来源002 </a-select-option>
</a-select> </a-select>
<a-select default-value="001"> <a-select v-model="query.interfaceTag">
<!-- <a-select-option <a-select-option value="">所有标签</a-select-option>
v-for="(item, index) of selectOptions" <a-select-option v-for="(item, index) of dict.interfaceTag" :key="index" :value="index">
:key="index" {{ item }}
:value="item.value" </a-select-option>
>
{{ item.label }}
</a-select-option> -->
<a-select-option value="001"> 标签001 </a-select-option>
<a-select-option value="002"> 标签002 </a-select-option>
</a-select> </a-select>
<a-select default-value="001"> <button class="search_btn" @click="getList()">搜索</button>
<!-- <a-select-option
v-for="(item, index) of selectOptions"
:key="index"
:value="item.value"
>
{{ item.label }}
</a-select-option> -->
<a-select-option value="001"> 策略001 </a-select-option>
<a-select-option value="002"> 策略002 </a-select-option>
</a-select>
<button class="search_btn">搜索</button>
</span> </span>
</div> </div>
<div class="main"> <div class="main">
<a-table <a-table size="small" bordered :row-key="(record) => record.id" :scroll="{ y: 590 }" :pagination="tablePagination"
size="small" @change="pagTableChange" :loading="tableLoading" :columns="tableHeaders" :dataSource="tableSourceData">
bordered <template slot="network" slot-scope="text, record,index">
:row-key="(record) => record.id" <span v-for="item, idx of dict.network" v-show="text.indexOf(idx) != -1" :key="idx"> {{ item }} </span>
:scroll="{ y: 590 }" </template>
:pagination="tablePagination"
@change="pagTableChange"
:loading="tableLoading"
:columns="tableHeaders"
:dataSource="tableSourceData"
>
<template slot="operation" slot-scope="text, record, index"> <template slot="operation" slot-scope="text, record, index">
<a-button type="link" @click="openDetails('详情',record)" <a-button type="link" @click="openDetails(record)">编辑</a-button>
>详情</a-button <a-popconfirm title="确定要删除此应用吗?" ok-text="确定" cancel-text="取消" @confirm="delRow(record)">
> <a-button type="link" style="color: #ff4420">删除{{ index + 1 }}</a-button>
<a-button type="link" @click="openDetails('编辑',record)" </a-popconfirm>
>编辑</a-button
>
<a-button type="link" style="color: #ff4420"
>删除</a-button
>
</template> </template>
</a-table> </a-table>
<Details ref="Details" /> <Details ref="Details" :dict="dict" />
</div> </div>
</div> </div>
</template> </template>
...@@ -86,7 +47,7 @@ ...@@ -86,7 +47,7 @@
<script> <script>
import table from "@/mixins/table"; import table from "@/mixins/table";
import Details from "./components/Details.vue"; import Details from "./components/Details.vue";
import {getInterfaceList} from '@/api/thePlatformIsSet.js' import { getInterfaceList, getInterfaceDelete } from '@/api/thePlatformIsSet.js'
export default { export default {
mixins: [table], mixins: [table],
name: "PortalAdminVueAlerting", name: "PortalAdminVueAlerting",
...@@ -116,12 +77,13 @@ export default { ...@@ -116,12 +77,13 @@ export default {
title: "标签", title: "标签",
align: "center", align: "center",
dataIndex: "interfaceTag", dataIndex: "interfaceTag",
customRender: (text, record, index) => this.dict.interfaceTag[text]
}, },
{ {
title: "请求协议", title: "请求协议",
align: "center", align: "center",
dataIndex: "requestProtocol", dataIndex: "requestProtocol",
customRender: (text, record, index) => `${record.requestProtocol == 1 ? 'HTTP' : 'HTTPS'}`, customRender: (text, record, index) => this.dict.requestProtocol[text]
}, },
{ {
title: "版本", title: "版本",
...@@ -132,7 +94,7 @@ export default { ...@@ -132,7 +94,7 @@ export default {
title: "来源", title: "来源",
align: "center", align: "center",
dataIndex: "interfaceSource", dataIndex: "interfaceSource",
customRender: (text, record, index) => `${record.interfaceSource == 1 ? '自有' : '非自有'}`, customRender: (text, record, index) => this.dict.interfaceSource[text]
}, },
{ {
title: "策略", title: "策略",
...@@ -144,7 +106,9 @@ export default { ...@@ -144,7 +106,9 @@ export default {
title: "访问网络", title: "访问网络",
align: "center", align: "center",
dataIndex: "network", dataIndex: "network",
customRender: (text, record, index) => `${record.network == 1 ? '互联网' : '政务网'}`, scopedSlots: {
customRender: "network",
}
}, },
{ {
...@@ -157,12 +121,19 @@ export default { ...@@ -157,12 +121,19 @@ export default {
}, },
}, },
], ],
query:{ query: {
interfaceName: undefined, interfaceName: undefined,
page:1, interfaceSource: "",
size:10, interfaceTag: ""
}, },
total:0 tablePagination: {
current: 1,
pageSize: 10
},
dict: {
},
total: 0
}; };
}, },
components: { components: {
...@@ -173,8 +144,22 @@ export default { ...@@ -173,8 +144,22 @@ export default {
}, },
methods: { methods: {
getList() { getList() {
getInterfaceList(this.query).then(res=>{ getInterfaceList({
this.tableSourceData = res.data.data page: this.tablePagination.current,
size: this.tablePagination.pageSize,
...this.query
}).then(res => {
if (res.code == 1) {
let {
data,
total,
dict
} = res.data;
this.dict = dict;
this.tableSourceData = data;
this.tablePagination.total = total;
return data
}
}) })
}, },
QueueState(type) { QueueState(type) {
...@@ -188,11 +173,35 @@ export default { ...@@ -188,11 +173,35 @@ export default {
return "type0"; return "type0";
} }
}, },
openDetails(type) { delRow(item) {
this.$refs.Details.modalInfo.title = type; getInterfaceDelete({
id: item.id
}).then((res) => {
let { code, msg } = res
if (code == 1) {
this.$message.success('删除成功');
this.getList()
} else {
this.$message.error(msg);
}
})
},
openDetails(item) {
if (item) {
this.$refs.Details.modalInfo.title = "编辑接口";
this.$refs.Details.getInfo(item.id)
} else {
this.$refs.Details.modalInfo.title = "新增接口";
}
this.$refs.Details.modalInfo.visible = true; this.$refs.Details.modalInfo.visible = true;
this.$refs.Details.modalInfo.width = "55%"; this.$refs.Details.modalInfo.width = "55%";
}, },
//分页
pagTableChange(page) {
this.tablePagination.current = page.current
this.tablePagination.pageSize = page.pageSize
this.getList();
},
}, },
}; };
</script> </script>
...@@ -201,13 +210,15 @@ export default { ...@@ -201,13 +210,15 @@ export default {
/deep/.ant-spin-container { /deep/.ant-spin-container {
display: block; display: block;
} }
.PoliticsShow-Container { .PoliticsShow-Container {
.header_box { .header_box {
padding-bottom: 1rem; padding-bottom: 1rem;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
& > div {
&>div {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
...@@ -227,6 +238,7 @@ export default { ...@@ -227,6 +238,7 @@ export default {
overflow: hidden; overflow: hidden;
background: #43a4ff; background: #43a4ff;
color: ghostwhite; color: ghostwhite;
& span { & span {
position: relative; position: relative;
z-index: 10; z-index: 10;
...@@ -262,7 +274,7 @@ export default { ...@@ -262,7 +274,7 @@ export default {
} }
} }
& > span { &>span {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
...@@ -271,21 +283,26 @@ export default { ...@@ -271,21 +283,26 @@ export default {
width: 15rem !important; width: 15rem !important;
margin-right: 1rem !important; margin-right: 1rem !important;
} }
/deep/.ant-input { /deep/.ant-input {
height: 2.3rem !important; height: 2.3rem !important;
} }
/deep/.ant-select-selection { /deep/.ant-select-selection {
width: 170px !important; width: 170px !important;
height: 2.3rem !important; height: 2.3rem !important;
margin-right: 1rem !important; margin-right: 1rem !important;
} }
/deep/.ant-select-selection__rendered { /deep/.ant-select-selection__rendered {
height: 100% !important; height: 100% !important;
} }
/deep/.ant-select-selection-selected-value { /deep/.ant-select-selection-selected-value {
height: 100% !important; height: 100% !important;
line-height: 2.3rem !important; line-height: 2.3rem !important;
} }
.search_btn { .search_btn {
padding: 0.8rem 1.2rem; padding: 0.8rem 1.2rem;
border: 0; border: 0;
...@@ -317,13 +334,16 @@ export default { ...@@ -317,13 +334,16 @@ export default {
} }
} }
} }
.main { .main {
.type0 { .type0 {
color: #888888; color: #888888;
} }
.type1 { .type1 {
color: #f94545; color: #f94545;
} }
.levelState { .levelState {
padding: 5px 8px; padding: 5px 8px;
border-radius: 8px; border-radius: 8px;
...@@ -331,12 +351,15 @@ export default { ...@@ -331,12 +351,15 @@ export default {
background: #ffedeb; background: #ffedeb;
border: 1px solid #f94545; border: 1px solid #f94545;
} }
.type2 { .type2 {
color: #04ca8f; color: #04ca8f;
} }
/deep/.ant-btn-link { /deep/.ant-btn-link {
padding: 0 !important; padding: 0 !important;
& + .ant-btn-link {
&+.ant-btn-link {
margin-left: 1rem !important; margin-left: 1rem !important;
} }
} }
......
<template> <template>
<a-drawer :destroyOnClose="true" :title="modalInfo.title" :width="modalInfo.width" :visible="modalInfo.visible" <a-drawer :destroyOnClose="true" :title="modalInfo.title" :width="modalInfo.width" :visible="modalInfo.visible"
@close="modalClose"> @close="resetForm">
<a-form-model ref="ruleForm" :model="detailsForm" :rules="detailsRules" :label-col="{ span: 4 }" <a-form-model ref="ruleForm" :model="detailsForm" :rules="detailsRules" :label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"> :wrapper-col="{ span: 20 }">
<a-row :gutter="16"> <a-row :gutter="16">
...@@ -30,14 +30,18 @@ ...@@ -30,14 +30,18 @@
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="请求路径" prop="requestUrl"> <a-form-model-item label="content-type" prop="contentType">
<a-input v-model="detailsForm.requestUrl" placeholder="请输入" allowClear /> <a-select v-model="detailsForm.contentType" placeholder="请选择" allowClear>
<a-select-option v-for="item, index in ctList" :key="index" :value="item">{{ item
}}</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="超时时长" prop="requestUrl"> <a-form-model-item label="超时时长" prop="timeoutValue">
<a-input v-model="detailsForm.requestUrl" placeholder="请输入" allowClear> <a-input v-model="detailsForm.timeoutValue" placeholder="请输入" allowClear>
<template slot="suffix"></template> <template slot="suffix"></template>
</a-input> </a-input>
</a-form-model-item> </a-form-model-item>
...@@ -56,43 +60,66 @@ ...@@ -56,43 +60,66 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="描述" prop="description"> <a-form-model-item label="接口标签" prop="interfaceTag">
<a-textarea v-model="detailsForm.description" placeholder="请输入" :rows="4" /> <a-select v-model="detailsForm.interfaceTag" placeholder="请选择" allowClear>
<a-select-option v-for="(item, index) of dict.interfaceTag" :key="index" :value="index">
{{ item }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="接口来源" prop="interfaceSource">
<a-select v-model="detailsForm.interfaceSource" placeholder="请选择" allowClear>
<a-select-option value="1"> 自建发布 </a-select-option>
<a-select-option value="2"> 对接转化 </a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="流控信息" prop="flowControl"> <a-form-model-item label="请求路径" prop="requestUrl">
<a-textarea v-model="detailsForm.flowControl" placeholder="请输入" :rows="4" /> <a-input v-model="detailsForm.requestUrl" placeholder="请输入" allowClear />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="授权信息" prop="authorizeInfo"> <a-form-model-item label="描述" prop="description">
<a-textarea v-model="detailsForm.authorizeInfo" placeholder="请输入" :rows="4" /> <a-textarea v-model="detailsForm.description" placeholder="请输入" :rows="4" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<h1 class="title_">请求参数</h1> <h1 class="title_">请求参数</h1>
<a-radio-group v-model="type" button-style="solid"> <div class="flex aic jcb mb10">
<a-radio-button value="路径参数"> 路径参数 </a-radio-button> <a-radio-group v-model="requestPam.type" button-style="solid" @change="onReqType('new')">
<a-radio-button value="path"> 路径参数 </a-radio-button>
<a-radio-button value="headers"> headers </a-radio-button> <a-radio-button value="headers"> headers </a-radio-button>
<a-radio-button value="query"> query </a-radio-button> <a-radio-button value="query"> query </a-radio-button>
<a-radio-button value="body"> body </a-radio-button> <a-radio-button value="body"> body </a-radio-button>
</a-radio-group> </a-radio-group>
<div class="flex aic">
<div class="mr10">入参是否加密</div>
<a-radio-group v-model="detailsForm.inEncrypt">
<a-radio :value="0">不加密</a-radio>
<a-radio :value="1">加密</a-radio>
</a-radio-group>
</div>
</div>
<a-table size="middle" bordered :row-key="(record) => record.id" :pagination="false" <a-table size="middle" bordered :row-key="(record) => record.id" :locale="{ emptyText: '无' }"
:columns="table_columns" :dataSource="requestParameters[type]"> :pagination="false" :columns="table_columns" :dataSource="requestPam.table">
<template slot="参数名" slot-scope="text, record, index"> <template slot="参数名" slot-scope="text, record, index">
<a-input v-model="record.name" placeholder="请输入" allowClear /> <a-input v-model="record.name" placeholder="请输入" allowClear />
</template> </template>
<template slot="关联参数" slot-scope="text, record, index">
<a-select v-model="record.association" placeholder="请选择" allowClear>
<a-select-option value="001"> 选项001 </a-select-option>
</a-select>
</template>
<template slot="参数值类型" slot-scope="text, record, index"> <template slot="参数值类型" slot-scope="text, record, index">
<a-select v-model="record.type" placeholder="请选择" allowClear> <a-select v-model="record.type" placeholder="请选择" allowClear :disabled="record.isType">
<a-select-option value="String"> String </a-select-option> <a-select-option value="String"> String </a-select-option>
<a-select-option value="Int"> Int </a-select-option>
<a-select-option value="Object"> Object </a-select-option>
<a-select-option value="[String]"> [String] </a-select-option>
<a-select-option value="[Int]"> [Int] </a-select-option>
<a-select-option value="[Object]"> [Object] </a-select-option>
</a-select> </a-select>
</template> </template>
<template slot="jsonPath" slot-scope="text, record, index"> <template slot="jsonPath" slot-scope="text, record, index">
...@@ -112,28 +139,37 @@ ...@@ -112,28 +139,37 @@
</template> </template>
<template slot="operation" slot-scope="text, record, index"> <template slot="operation" slot-scope="text, record, index">
<a-button type="link" style="color: #ff4420">删除</a-button> <a-button type="link" @click="delTabRow('requestPam', index)" style="color: #ff4420">删除</a-button>
</template> </template>
</a-table> </a-table>
<div class="table_footer"> <div class="table_footer" v-if="requestPam.type != 'path'">
<a-button type="primary" class="addclass" @click="ceshidayin"> 添加参数 </a-button> <a-button type="primary" class="addclass" @click="onReqType('add')"> 添加参数 </a-button>
</div> </div>
<div class="flex aic jcb mt20">
<h1 class="title_">响应数据</h1> <h1 class="title_">响应数据</h1>
<div class="flex aic">
<div class="mr10">出参是否加密</div>
<a-radio-group v-model="detailsForm.outEncrypt">
<a-radio :value="0">不加密</a-radio>
<a-radio :value="1">加密</a-radio>
</a-radio-group>
</div>
</div>
<a-table size="middle" bordered :row-key="(record) => record.id" :pagination="false" <a-table size="middle" bordered :row-key="(record) => record.id" :locale="{ emptyText: '无' }"
:columns="table_columns" :dataSource="responseParameters"> :pagination="false" :columns="table_columns" :dataSource="responsePam.table">
<template slot="参数名" slot-scope="text, record, index"> <template slot="参数名" slot-scope="text, record, index">
<a-input v-model="record.name" placeholder="请输入" allowClear /> <a-input v-model="record.name" placeholder="请输入" allowClear />
</template> </template>
<template slot="关联参数" slot-scope="text, record, index">
<a-select v-model="record.association" placeholder="请选择" allowClear>
<a-select-option value="001"> 选项001 </a-select-option>
</a-select>
</template>
<template slot="参数值类型" slot-scope="text, record, index"> <template slot="参数值类型" slot-scope="text, record, index">
<a-select v-model="record.type" placeholder="请选择" allowClear> <a-select v-model="record.type" placeholder="请选择" allowClear>
<a-select-option value="String"> String </a-select-option> <a-select-option value="String"> String </a-select-option>
<a-select-option value="Int"> Int </a-select-option>
<a-select-option value="Object"> Object </a-select-option>
<a-select-option value="[String]"> [String] </a-select-option>
<a-select-option value="[Int]"> [Int] </a-select-option>
<a-select-option value="[Object]"> [Object] </a-select-option>
</a-select> </a-select>
</template> </template>
<template slot="jsonPath" slot-scope="text, record, index"> <template slot="jsonPath" slot-scope="text, record, index">
...@@ -153,72 +189,33 @@ ...@@ -153,72 +189,33 @@
</template> </template>
<template slot="operation" slot-scope="text, record, index"> <template slot="operation" slot-scope="text, record, index">
<a-button type="link" style="color: #ff4420">删除</a-button> <a-button type="link" @click="delTabRow('responsePam', index)" style="color: #ff4420">删除</a-button>
</template>
</a-table>
<div class="table_footer">
<a-button type="primary" class="addclass" @click="ceshidayin"> 添加参数 </a-button>
</div>
<!-- <h1 class="title_">错误码</h1>
<a-table size="middle" bordered :row-key="(record) => record.id" :pagination="false"
:columns="errorCode_columns" :dataSource="errorCode">
<template slot="Http Code" slot-scope="text, record, index">
<a-input v-model="record.httpCode" placeholder="请输入" allowClear />
</template>
<template slot="Error Code" slot-scope="text, record, index">
<a-input v-model="record.errorCode" placeholder="请输入" allowClear />
</template>
<template slot="错误信息" slot-scope="text, record, index">
<a-input v-model="record.errorMessage" placeholder="请输入" allowClear />
</template>
<template slot="operation" slot-scope="text, record, index">
<a-button type="link" style="color: #ff4420">删除</a-button>
</template> </template>
</a-table> </a-table>
<div class="table_footer"> <div class="table_footer">
<a-button type="primary" class="addclass" @click="ceshidayin"> 添加参数 </a-button> <a-button type="primary" class="addclass" @click="addResPam"> 添加参数 </a-button>
</div> </div>
<h1 class="title_">变更历史</h1>
<a-table size="middle" bordered :row-key="(record) => record.id" :pagination="false"
:columns="changeHistory_columns" :dataSource="changeHistory">
<template slot="变更时间" slot-scope="text, record, index">
<a-input v-model="record.time" placeholder="请输入" allowClear />
</template>
<template slot="变更内容概要" slot-scope="text, record, index">
<a-input v-model="record.content" placeholder="请输入" allowClear />
</template>
<template slot="operation" slot-scope="text, record, index">
<a-button type="link" style="color: #ff4420">删除</a-button>
</template>
</a-table>
<div class="table_footer">
<a-button type="primary" class="addclass" @click="ceshidayin"> 添加参数 </a-button>
</div> -->
<div class="drawer_footer"> <div class="drawer_footer">
<a-button type="primary" class="addclass" @click="modalSubmit"> 保存 </a-button> <a-button type="primary" class="addclass" @click="modalSubmit"> 保存 </a-button>
<a-button @click="modalClose"> 取消 </a-button> <a-button @click="resetForm"> 取消 </a-button>
</div> </div>
</a-form-model> </a-form-model>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import modal from "../mixins/modal"; import modal from "../mixins/modal";
import { import {
getInterfaceSave getInterfaceSave, getInterfaceInfo
} from '@/api/thePlatformIsSet.js' } from '@/api/thePlatformIsSet.js'
export default { export default {
mixins: [modal], mixins: [modal],
name: "PortalAdminVuePicWorks", name: "PortalAdminVuePicWorks",
props: ["dict"],
data() { data() {
return { return {
detailsForm: { detailsForm: {
productId: this.$route.query.id,
interfaceName: undefined, interfaceName: undefined,
versionNumber: undefined, versionNumber: undefined,
requestType: undefined, requestType: undefined,
...@@ -230,43 +227,18 @@ ...@@ -230,43 +227,18 @@
description: undefined, description: undefined,
flowControl: undefined, flowControl: undefined,
authorizeInfo: undefined, authorizeInfo: undefined,
contentType: undefined,
interfaceTag: undefined,
inEncrypt: 0,
outEncrypt: 0
}, },
detailsRules: { detailsRules: {
interfaceName: [{ interfaceName: [{ required: true, message: "请输入", trigger: "blur" }],
required: true, versionNumber: [{ required: true, message: "请输入", trigger: "blur" }],
message: "请输入", requestType: [{ required: true, message: "请选择", trigger: "change" }],
trigger: "blur", requestProtocol: [{ required: true, message: "请选择", trigger: "change" }],
}, ], requestUrl: [{ required: true, message: "请输入", trigger: "blur" }],
versionNumber: [{ timeoutValue: [{ required: true, message: "请输入", trigger: "blur" }],
required: true,
message: "请输入",
trigger: "blur",
}, ],
requestType: [{
required: true,
message: "请输入",
trigger: "change",
}, ],
requestProtocol: [{
required: true,
message: "请输入",
trigger: "change",
}, ],
requestUrl: [{
required: true,
message: "请输入",
trigger: "blur",
}, ],
timeoutValue: [{
required: true,
message: "请输入",
trigger: "blur",
}, ],
network: [{
required: true,
message: "请输入",
trigger: "change",
}, ],
}, },
options: [{ options: [{
label: "互联网", label: "互联网",
...@@ -285,14 +257,6 @@ ...@@ -285,14 +257,6 @@
customRender: "参数名", customRender: "参数名",
}, },
}, },
{
title: "关联参数",
align: "center",
dataIndex: "association",
scopedSlots: {
customRender: "关联参数",
},
},
{ {
title: "参数值类型", title: "参数值类型",
align: "center", align: "center",
...@@ -332,6 +296,7 @@ ...@@ -332,6 +296,7 @@
scopedSlots: { scopedSlots: {
customRender: "描述", customRender: "描述",
}, },
width: 200
}, },
{ {
...@@ -344,38 +309,13 @@ ...@@ -344,38 +309,13 @@
}, },
}, },
], ],
type: '路径参数', requestPam: {
requestParameters: { type: 'path',
'路径参数': [{ table: []
name: ``, },
association: undefined, responsePam: {
type: undefined, table: [{
jsonPath: ``,
default: ``,
isMust: undefined,
describe: ``,
}],
'headers': [{
name: ``,
association: undefined,
type: undefined,
jsonPath: ``,
default: ``,
isMust: undefined,
describe: ``,
}],
'query': [{
name: ``,
association: undefined,
type: undefined,
jsonPath: ``,
default: ``,
isMust: undefined,
describe: ``,
}],
'body': [{
name: ``, name: ``,
association: undefined,
type: undefined, type: undefined,
jsonPath: ``, jsonPath: ``,
default: ``, default: ``,
...@@ -383,15 +323,6 @@ ...@@ -383,15 +323,6 @@
describe: ``, describe: ``,
}] }]
}, },
responseParameters: [{
name: ``,
association: undefined,
type: undefined,
jsonPath: ``,
default: ``,
isMust: undefined,
describe: ``,
}],
errorCode_columns: [{ errorCode_columns: [{
title: "Http Code", title: "Http Code",
align: "center", align: "center",
...@@ -451,35 +382,114 @@ ...@@ -451,35 +382,114 @@
changeHistory: [{ changeHistory: [{
time: '', time: '',
content: '' content: ''
}] }],
ctList: ["text/html", "text/xml", "application/json", "application/xml", "application/x-www-form-urlencoded", "multipart/form-data"]
}; };
}, },
mounted() {}, mounted() { },
methods: { methods: {
getInfo(id) {
getInterfaceInfo({ id: id }).then(res => {
res.data.network = res.data.network.split(',')
this.detailsForm = res.data
this.requestPam = JSON.parse(res.data.requestParameters)
this.responsePam = JSON.parse(res.data.responseParameters)
})
},
modalSubmit() { modalSubmit() {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
alert('submit!'); let json = JSON.parse(JSON.stringify(this.detailsForm))
if (json.network.length) json.network = json.network.join(',')
json.requestParameters = JSON.stringify(this.requestPam)
json.responseParameters = JSON.stringify(this.responsePam)
getInterfaceSave(json).then(res => {
let { code, msg } = res
if (code == 1) {
this.$message.success('保存成功');
this.resetForm();
this.modalInfo.visible = false
this.$parent.getList()
} else {
this.$message.error(msg);
}
})
} else { } else {
return false; return false;
} }
}); });
}, },
ceshidayin() { //type
console.log(this.请求参数_dataSource); onReqType(type) {
let index = this.requestPam.type
if (index == 'path') {
this.requestPam.table = []
} else {
let obj = {
name: ``,
type: 'String',
jsonPath: ``,
default: ``,
isMust: undefined,
describe: ``,
isType: true
}
if (index == 'body') {
obj.isType = false
}
if (type == 'new') {
this.requestPam.table = [obj]
} else {
this.requestPam.table.push(obj)
}
}
}, },
addResPam() {
this.responsePam.table.push({
name: ``,
type: undefined,
jsonPath: ``,
default: ``,
isMust: undefined,
describe: ``,
})
},
delTabRow(key, index) {
this[key].table.splice(index, 1)
},
resetForm() {
this.$nextTick(() => {
this.$refs.ruleForm.resetFields();
this.detailsForm.id=""
this.requestPam = {
type: 'path',
table: []
}
this.responsePam = {
table: [{
name: ``,
type: undefined,
jsonPath: ``,
default: ``,
isMust: undefined,
describe: ``,
}]
}
this.modalInfo.visible = false;
});
}
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/.ant-drawer-content { /deep/.ant-drawer-content {
overflow-x: hidden !important; overflow-x: hidden !important;
} }
.drawer_footer { .drawer_footer {
z-index: 1; z-index: 1;
text-align: left; text-align: left;
background: #fff; background: #fff;
...@@ -489,25 +499,21 @@ ...@@ -489,25 +499,21 @@
bottom: 0; bottom: 0;
right: 0; right: 0;
position: absolute; position: absolute;
} }
.title_ { .title_ {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
margin-bottom: 10px; margin-bottom: 10px;
} }
.table_footer { .table_footer {
text-align: center; text-align: center;
padding-top: 10px; padding-top: 10px;
} }
/deep/.ant-drawer-body { /deep/.ant-drawer-body {
margin-bottom: 100px; margin-bottom: 100px;
} }
/deep/.ant-radio-group {
margin-bottom: 10px !important;
}
</style> </style>
\ No newline at end of file
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<a-button type="link" v-if="record.appFileUrl" <a-button type="link" v-if="record.appFileUrl"
@click="handleDowload(record.appFileUrl)">下载应用{{ index + 1 }}</a-button> @click="handleDowload(record.appFileUrl)">下载应用{{ index + 1 }}</a-button>
<a-button type="link" @click="openDetails(record)">编辑{{ index + 1 }}</a-button> <a-button type="link" @click="openDetails(record)">编辑{{ index + 1 }}</a-button>
<a-popconfirm title="确定要删除此应用吗?" ok-text="Yes" cancel-text="No" @confirm="delRow(record)"> <a-popconfirm title="确定要删除此应用吗?" ok-text="确定" cancel-text="取消" @confirm="delRow(record)">
<a-button type="link" style="color: #ff4420">删除{{ index + 1 }}</a-button> <a-button type="link" style="color: #ff4420">删除{{ index + 1 }}</a-button>
</a-popconfirm> </a-popconfirm>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<a-button type="link" v-if="record.docFileUrl" @click="handleDowload(record.docFileUrl)">下载{{ index + 1 <a-button type="link" v-if="record.docFileUrl" @click="handleDowload(record.docFileUrl)">下载{{ index + 1
}}</a-button> }}</a-button>
<a-button type="link" @click="openDetails(record)">编辑{{ index + 1 }}</a-button> <a-button type="link" @click="openDetails(record)">编辑{{ index + 1 }}</a-button>
<a-popconfirm title="确定要删除此应用吗?" ok-text="Yes" cancel-text="No" @confirm="delRow(record)"> <a-popconfirm title="确定要删除此应用吗?" ok-text="确定" cancel-text="取消" @confirm="delRow(record)">
<a-button type="link" style="color: #ff4420">删除{{ index + 1 }}</a-button> <a-button type="link" style="color: #ff4420">删除{{ index + 1 }}</a-button>
</a-popconfirm> </a-popconfirm>
</template> </template>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</a-button> </a-button>
</p> </p>
<p> <p>
<a-popconfirm title="确定要删除此产品吗?" ok-text="Yes" cancel-text="No" @confirm="delModal(item)"> <a-popconfirm title="确定要删除此产品吗?" ok-text="确定" cancel-text="取消" @confirm="delModal(item)">
<a-button type="link" size="small" style="color: #ff4d4f"> <a-button type="link" size="small" style="color: #ff4d4f">
删除 删除
</a-button> </a-button>
......
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