接口列表

master
chaiyapeng 2024-08-26 14:58:15 +08:00
parent 7db2d62539
commit b07804e551
2 changed files with 151 additions and 79 deletions

View File

@ -14,3 +14,17 @@ export function findConnectorList(data) {
data:data data:data
}) })
} }
export function addConnector(data) {
return request({
url: '/mart/connector/addConnector',
method: 'post',
data:data
})
}
export function getDeleteConnector(connectorId) {
return request({
url: '/mart/connector/getDeleteConnector?connectorId='+connectorId,
method: 'get'
})
}

View File

@ -1,108 +1,149 @@
<template> <template>
<el-table <div>
:data="tableData" <el-button icon="el-icon-plus" type="primary" size="mini" @click="dialogFormVisible=true"></el-button>
style="width: 100%"> <el-table
:data="tableData"
style="width: 100%">
<el-table-column <el-table-column
label="id" label="id"
width="180"> width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorId }}</span> <span style="margin-left: 10px">{{ scope.row.connectorId }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="接口名称" label="接口名称"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorName }}</span> <span style="margin-left: 10px">{{ scope.row.connectorName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="接口描述" label="接口描述"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorDescribe }}</span> <span style="margin-left: 10px">{{ scope.row.connectorDescribe }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="接口图片" label="接口图片"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorPicture }}</span> <span style="margin-left: 10px">{{ scope.row.connectorPicture }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="公司" label="公司"
width="180"> width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorCompany }}</span> <span style="margin-left: 10px">{{ scope.row.connectorCompany }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="更新时间" label="更新时间"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorTime }}</span> <span style="margin-left: 10px">{{ scope.row.connectorTime }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="剩余次数" label="剩余次数"
width="180"> width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorResidueDegree }}</span> <span style="margin-left: 10px">{{ scope.row.connectorResidueDegree }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="购买次数" label="购买次数"
width="180"> width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorFrequency }}</span> <span style="margin-left: 10px">{{ scope.row.connectorFrequency }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="状态" label="状态"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorStatus }}</span> <span style="margin-left: 10px" v-if="scope.row.connectorStatus==0"></span>
</template> <span style="margin-left: 10px" v-if="scope.row.connectorStatus==1"></span>
</el-table-column> <span style="margin-left: 10px" v-if="scope.row.connectorStatus==2"></span>
</template>
</el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" icon="el-icon-pear"
@click="handleEdit(scope.$index, scope.row)">编辑</el-button> size="mini"
<el-button @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
size="mini" <el-button
type="danger" icon="el-icon-delete"
@click="handleDelete(scope.$index, scope.row)">删除</el-button> size="mini"
</template> type="danger"
</el-table-column> @click="handleDelete(scope.row)">删除</el-button>
</el-table> </template>
</el-table-column>
</el-table>
<!-- 新增接口-->
<el-dialog title="新增接口" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="接口名称" :label-width="formLabelWidth">
<el-input v-model="formLabelAlign.connectorName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="接口描述" :label-width="formLabelWidth">
<el-input v-model="formLabelAlign.connectorDescribe" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="接口图片" :label-width="formLabelWidth">
<el-input v-model="formLabelAlign.connectorPicture" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="公司" :label-width="formLabelWidth">
<el-input v-model="formLabelAlign.connectorCompany" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="剩余次数" :label-width="formLabelWidth">
<el-input v-model="formLabelAlign.connectorResidueDegree" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="购买次数" :label-width="formLabelWidth">
<el-input v-model="formLabelAlign.connectorFrequency" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addConnector"> </el-button>
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
//jsjsjson, //jsjsjson,
//import from ', //import from ',
import {findConnectorList} from "@/api/port/port"; import {findConnectorList} from "@/api/port/port";
import {addConnector} from "@/api/port/port";
import {getDeleteConnector} from "@/api/port/port";
export default { export default {
//import使" //import使"
components: {}, components: {},
props: {}, props: {},
data() { data() {
//" //"
return { return {
form:{}, form:{},
tableData:[], tableData:[],
formLabelAlign:{},
dialogFormVisible:false,
}; };
}, },
// data", // data",
@ -111,6 +152,23 @@ export default {
watch: {}, watch: {},
//", //",
methods: { methods: {
handleDelete(row){
getDeleteConnector(row.connectorId).then((res)=>{
alert(res.msg);
if (200==res.code){
this.findConnectorList();
}
})
},
addConnector(){
addConnector(this.formLabelAlign).then((res)=>{
alert(res.msg);
if (200==res.code){
this.findConnectorList();
this.dialogFormVisible=false;
}
})
},
findConnectorList(){ findConnectorList(){
findConnectorList(this.form).then((res)=>{ findConnectorList(this.form).then((res)=>{
this.tableData=res.data; this.tableData=res.data;