adminOwnerDetailAccessControlRecord.vue
2.63 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<template>
<div class="admin-owner-detail-access-control-record">
<div class="margin-top">
<el-table
:data="accessControlRecordInfo.records"
border
style="width: 100%"
>
<el-table-column
prop="recordTypeName"
:label="$t('adminOwnerDetailAccessControlRecord.recordType')"
align="center"
/>
<el-table-column
prop="machineName"
:label="$t('adminOwnerDetailAccessControlRecord.machineName')"
align="center"
/>
<el-table-column
prop="userName"
:label="$t('adminOwnerDetailAccessControlRecord.userName')"
align="center"
/>
<el-table-column
prop="openTypeCdName"
:label="$t('adminOwnerDetailAccessControlRecord.openType')"
align="center"
/>
<el-table-column
prop="createTime"
:label="$t('adminOwnerDetailAccessControlRecord.createTime')"
align="center"
/>
</el-table>
<el-row class="margin-top">
<el-col :span="16"></el-col>
<el-col :span="8">
<el-pagination
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total"
/>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
export default {
name: 'AdminOwnerDetailAccessControlRecord',
data() {
return {
DEFAULT_PAGE: 1,
DEFAULT_ROWS: 10,
accessControlRecordInfo: {
records: [],
ownerId: ''
},
currentPage: 1,
pageSize: 10,
total: 0
}
},
methods: {
handleSwitch(data) {
this.accessControlRecordInfo.ownerId = data.ownerId
this._loadAccessControlRecordData(this.DEFAULT_PAGE, this.DEFAULT_ROWS)
},
handleCurrentChange(val) {
this.currentPage = val
this._loadAccessControlRecordData(val, this.DEFAULT_ROWS)
},
async _loadAccessControlRecordData(page, row) {
const param = {
page,
row,
objId: this.accessControlRecordInfo.ownerId,
objType: '8899'
}
try {
const response = await this.$http.get('/machineRecord.listAdminMachineRecords', { params: param })
const recordInfo = response.data
this.accessControlRecordInfo.records = recordInfo.machineRecords
this.total = recordInfo.total
this.currentPage = page
} catch (error) {
console.error('请求失败:', error)
}
}
}
}
</script>
<style scoped>
.margin-top {
margin-top: 20px;
}
</style>