alarmingSensitive.vue
3.03 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
<!-- 敏感行为警告页面 -->
<template>
<div class="alarming">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="敏感记录" name="1">
<el-table :data="recordSensitive" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="createBy" label="操作员工">
</el-table-column>
<el-table-column prop="auditUserName" label="操作对象">
</el-table-column>
<el-table-column prop="patternWords" label="敏感行为">
</el-table-column>
<el-table-column prop="updateTime" label="操作时间">
</el-table-column>
</el-table>
<pagination
v-show="recordPageTotal > 0"
:total="recordPageTotal"
:page.sync="recordPageConfig.pageNum"
:limit.sync="recordPageConfig.pageSize"
@pagination="getSensiveRecordList()"
/>
</el-tab-pane>
<el-tab-pane label="敏感行为管理" name="2">
<el-table :data="tabData" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="actName" label="敏感操作">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-switch v-model="scope.row.enableFlag" :active-value="1" :inactive-value="2" @change="handleStatusChange(scope.row)"></el-switch>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getSensitiveManagementList()"
/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import * as sensitiveApis from '@/api/conversation/security'
export default {
data() {
return {
activeName: '1',
recordSensitive: [],
tabData: [],
total: 0,
query: {
pageNum: 1,
pageSize: 10
},
recordPageTotal: 0,
recordPageConfig: {
pageNum: 1,
pageSize: 10
}
}
},
mounted() {
this.getSensiveRecordList()
},
methods: {
getSensiveRecordList() {
sensitiveApis.getSensitiveRecord(this.recordPageConfig).then(res => {
if (res.code === 200) {
this.recordSensitive = res.rows
this.recordPageTotal = Number(res.total)
}
})
},
getSensitiveManagementList() {
sensitiveApis.getSensitiveManagement(this.query).then(res => {
if (res.code === 200) {
this.tabData = res.rows
this.total = Number(res.total)
}
})
},
handleStatusChange(e) {
console.log(e)
},
handleClick(tab, event) {
console.log(this.activeName==='2')
if(this.activeName==='2'){
this.getSensitiveManagementList()
}else{
this.getSensiveRecordList()
}
}
}
}
</script>