接口列表

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