Commit e3916d05 authored by zhengjinlei's avatar zhengjinlei

数据统计

parent 50394f56
......@@ -71,7 +71,7 @@
prop="ratio"
label="违规占比">
{# <template slot-scope="scope">#}
{# {{scope}}%#}
{# {{scope.row.ratio * 100}}%#}
{# </template>#}
</el-table-column>
<el-table-column
......@@ -80,6 +80,16 @@
label="排名">
</el-table-column>
</el-table>
<el-pagination
@current-change='CurrentChange'
style='margin: 0 auto;text-align:center;margin-bottom:20px;'
layout="prev, pager, next"
:hide-on-single-page="isHidePage"
background
:page-size="pagesize"
:total="total">
</el-pagination>
</div>
</div>
......
......@@ -67,15 +67,18 @@ new Vue({
changeRange(dateRange){
this.start_date = dateRange[0];
this.end_date = dateRange[1];
this.currentPage = 1;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
},
changeTask(msg){
this.taskvalue = msg;
this.currentPage = 1;
this.getTake()
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
},
changeTake(msg){
this.takevalue = msg;
this.currentPage = 1;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
},
getTask(){
......
......@@ -11,7 +11,11 @@ new Vue({
takeList:[],
takevalue: '',
loading: true,
tableData: []
tableData: [],
currentPage:1,
pagesize: 15,
total: 10,
isHidePage: true,
}
},
methods: {
......@@ -19,15 +23,18 @@ new Vue({
console.log(dateRange);
this.start_date = dateRange[0];
this.end_date = dateRange[1];
this.currentPage = 1;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
},
changeTask(msg){
console.log(msg);
this.currentPage = 1;
this.taskvalue = msg;
this.getTake()
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
},
changeTake(msg){
this.currentPage = 1;
this.takevalue = msg;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
console.log(msg);
......@@ -79,9 +86,10 @@ new Vue({
},
getRule(task,start_date,end_date,agentName){
let that = this;
let page = this.currentPage;
let arr = [];
this.$loading({text:'数据加载中...'});
RquestsPost('api/v1/tasks/seat_rule/',{task,start_date,end_date,agentName}).then(data => {
RquestsPost('api/v1/tasks/seat_rule/',{task,start_date,end_date,agentName,page}).then(data => {
console.log(data.data);
if(data.code != 0){
that.$message(data.msg);
......@@ -92,6 +100,8 @@ new Vue({
}
}
this.tableData = data.data;
this.total = data.count;
this.isHidePage = !(data.data.length > 0);
if(!data.data){
this.$loading().close();
......@@ -104,6 +114,12 @@ new Vue({
this.$loading().close();
})
},
CurrentChange(page){
this.currentPage = page;
//this.tableData = this.basearr.concat(this.allData.slice((page-1)*this.pagesize,page*this.pagesize));
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
//that.allData = data.data;
},
dateFormat(date){
return date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate();
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment