apiList.vue
1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!-- api列表 -->
<template>
<d2-container>
<d2-table-header title="API列表"></d2-table-header>
<d2-table
:hasNum="false"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
>
<auth-button
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
></auth-button>
</d2-table>
</d2-container>
</template>
<script>
import { apiList } from '@api/api'
export default {
name: 'apiList',
data() {
return {
searchForm: {},
getListApi: apiList,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: 'id',
prop: 'id',
width: '50px'
}, {
label: 'API分类',
prop: 'apiClassification',
formatter: (cellValue) => {
return {
1: '授权管理',
2: '设备管理',
3: '数据服务'
}[cellValue.apiClassification]
}
}, {
label: 'API名称',
prop: 'apiName'
}, {
label: '请求方式',
prop: 'requestMethod',
formatter: (cellValue) => {
return {
1: 'GET',
2: 'POST'
}[cellValue.requestMethod]
}
}, {
label: 'API接口',
prop: 'apiInterface'
}, {
label: '说明',
prop: 'description'
}, {
label: '状态',
prop: 'status',
formatter: (cellValue) => {
return {
0: '停用',
1: '可用'
}[cellValue.status]
}
}]
}
}
},
components: {},
computed: {},
mounted() { },
methods: {}
}
</script>
<style scoped>
</style>