Commit e3916d05 authored by zhengjinlei's avatar zhengjinlei

数据统计

parent 50394f56
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
prop="ratio" prop="ratio"
label="违规占比"> label="违规占比">
{# <template slot-scope="scope">#} {# <template slot-scope="scope">#}
{# {{scope}}%#} {# {{scope.row.ratio * 100}}%#}
{# </template>#} {# </template>#}
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -80,6 +80,16 @@ ...@@ -80,6 +80,16 @@
label="排名"> label="排名">
</el-table-column> </el-table-column>
</el-table> </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>
</div> </div>
......
...@@ -67,15 +67,18 @@ new Vue({ ...@@ -67,15 +67,18 @@ new Vue({
changeRange(dateRange){ changeRange(dateRange){
this.start_date = dateRange[0]; this.start_date = dateRange[0];
this.end_date = dateRange[1]; this.end_date = dateRange[1];
this.currentPage = 1;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
}, },
changeTask(msg){ changeTask(msg){
this.taskvalue = msg; this.taskvalue = msg;
this.currentPage = 1;
this.getTake() this.getTake()
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
}, },
changeTake(msg){ changeTake(msg){
this.takevalue = msg; this.takevalue = msg;
this.currentPage = 1;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
}, },
getTask(){ getTask(){
......
...@@ -11,7 +11,11 @@ new Vue({ ...@@ -11,7 +11,11 @@ new Vue({
takeList:[], takeList:[],
takevalue: '', takevalue: '',
loading: true, loading: true,
tableData: [] tableData: [],
currentPage:1,
pagesize: 15,
total: 10,
isHidePage: true,
} }
}, },
methods: { methods: {
...@@ -19,15 +23,18 @@ new Vue({ ...@@ -19,15 +23,18 @@ new Vue({
console.log(dateRange); console.log(dateRange);
this.start_date = dateRange[0]; this.start_date = dateRange[0];
this.end_date = dateRange[1]; this.end_date = dateRange[1];
this.currentPage = 1;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
}, },
changeTask(msg){ changeTask(msg){
console.log(msg); console.log(msg);
this.currentPage = 1;
this.taskvalue = msg; this.taskvalue = msg;
this.getTake() this.getTake()
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
}, },
changeTake(msg){ changeTake(msg){
this.currentPage = 1;
this.takevalue = msg; this.takevalue = msg;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
console.log(msg); console.log(msg);
...@@ -79,9 +86,10 @@ new Vue({ ...@@ -79,9 +86,10 @@ new Vue({
}, },
getRule(task,start_date,end_date,agentName){ getRule(task,start_date,end_date,agentName){
let that = this; let that = this;
let page = this.currentPage;
let arr = []; let arr = [];
this.$loading({text:'数据加载中...'}); 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); console.log(data.data);
if(data.code != 0){ if(data.code != 0){
that.$message(data.msg); that.$message(data.msg);
...@@ -92,6 +100,8 @@ new Vue({ ...@@ -92,6 +100,8 @@ new Vue({
} }
} }
this.tableData = data.data; this.tableData = data.data;
this.total = data.count;
this.isHidePage = !(data.data.length > 0);
if(!data.data){ if(!data.data){
this.$loading().close(); this.$loading().close();
...@@ -104,6 +114,12 @@ new Vue({ ...@@ -104,6 +114,12 @@ new Vue({
this.$loading().close(); 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){ dateFormat(date){
return date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate(); 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