-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathceshi.vue
142 lines (132 loc) · 4.75 KB
/
ceshi.vue
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<template>
<div>
<Table :columns="historyColumns" :data="historyData"></Table>
<Page :total="dataCount" :page-size="pageSize" show-total class="paging" @on-change="changepage" @on-page-size-change="pages" show-sizer show-elevator show-total></Page>
</div>
</template>
<style scoped>
.paging {
float: left;
margin-top: 10px;
}
</style>
<script>
import Cookies from 'js-cookie';
export default {
data() {
return {
ajaxHistoryData: [],
// 初始化信息总条数
dataCount: 0,
// 每页显示多少条
pageSize: 10,
xia: 0, //下一页或者上一页的第一项索引值
historyColumns: [{
"type": "selection",
"align": "center",
"width": "30",
"className": "border-r"
}, {
"title": "用户名",
"align": "center",
"key": "username"
}, {
"title": "姓名",
"align": "center",
"key": "name"
}, {
"title": "所属组织机构",
"align": "center",
"key": "deptName"
}, {
"title": "状态",
"align": "center",
"key": "status"
}, {
"title": "联系电话",
"align": "center",
"key": "mobile"
}, {
'title': '操作',
'align': 'center',
'key': 'action',
render: (h, params) => {
return h('div', [
h('Icon', {
props: {
type: 'ios-baseball',
size: 16
},
style: {
marginLeft: '20px'
}
})
])
}
}],
historyData: []
}
},
methods: {
// 获取历史记录信息
handleListApproveHistory() {
let sessionId = Cookies.get('status');
let this1 = this;
this.$http({
headers: {
"Authorization": sessionId,
},
method: 'post',
url: this1.GLOBAL.BASE_URL + '/sys/user/list',
params: {
'deptId': '001',
'offset': 0, //第一页第一项的索引
'limit': 10, //每页显示的条数
},
})
.then(function(res) {
debugger
this1.ajaxHistoryData = res.data.data;
this1.dataCount = res.data.total;
this1.historyData = this1.ajaxHistoryData;
})
.catch(function(error) {
//
})
},
pages(num) { //修改每页显示条数时调用
debugger
this.pageSize = num;
this.changepage(1);
},
changepage(index) {
//index当前页码
this.xia = (index - 1) * this.pageSize;
let sessionId = Cookies.get('status');
let this1 = this;
this.$http({
headers: {
"Authorization": sessionId,
},
method: 'post',
url: this1.GLOBAL.BASE_URL + '/sys/user/list',
params: {
'deptId': '001',
'offset': this1.xia,
'limit': this1.pageSize,
},
})
.then(function(res) {
debugger
this1.historyData = res.data.data;
})
.catch(function(error) {
//
})
}
},
created() {
this.handleListApproveHistory();
}
}
</script>