Browse Source

Merge branch 'msg-sever' into dev

haojianlong 5 years ago
parent
commit
2d92785449
1 changed files with 37 additions and 23 deletions
  1. 37 23
      src/components/point/report/tabFunNumOverview.vue

+ 37 - 23
src/components/point/report/tabFunNumOverview.vue

@@ -2,8 +2,8 @@
   <div id="tabFunNumOverview">
     <!-- 查询 新增 -->
     <div class="query-area" style="padding:10px;">
-      <el-input :placeholder="`请输入表号功能号`" v-model="tabFunNum" @keyup.enter.native="getOverViewList()" style="width:240px;">
-        <i slot="suffix" class="el-input__icon el-icon-search" @click="getOverViewList()"></i>
+      <el-input :placeholder="`请输入表号功能号`" v-model="tabFunNum" @keyup.enter.native="handleCurrentChange(1)" style="width:240px;">
+        <i slot="suffix" class="el-input__icon el-icon-search" @click="handleCurrentChange(1)"></i>
       </el-input>
       <p style="overflow: hidden;float:right;">
         <el-button style="height:32px" @click='handleDrawer({},3)'>新增自定义</el-button>
@@ -22,17 +22,19 @@
         <el-table-column prop='MeterFunc' label='表号-功能号' show-overflow-tooltip min-width="100" header-align='left'></el-table-column>
         <el-table-column prop='Data.Data' label='查看分精度' show-overflow-tooltip min-width="90" header-align='center' align='center'>
           <template slot-scope="scope">
-            <el-button style="padding:7px 15px;" @click="handleDrawer(scope.row, 0)"><i class="el-icon-s-data" style="font-size:15px;"></i></el-button>
+            <el-button style="padding:7px 15px;" @click="handleDrawer(scope.row, 0)"><i class="el-icon-s-data" style="font-size:15px;"></i>
+            </el-button>
           </template>
         </el-table-column>
-        <el-table-column prop='Data.Time' label='对应值 - 获取时间' show-overflow-tooltip min-width="270" header-align='center' align='center' style="position:relative;">
+        <el-table-column prop='Data.Time' label='对应值 - 获取时间' show-overflow-tooltip min-width="270" header-align='center' align='center'
+          style="position:relative;">
           <template slot-scope="scope">
             <div style="width:175px;display:inline-block;">
               <span style="line-height:29px;">{{ scope.row.Data? (scope.row.Data.Data  || '--'): '--' }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
               <span style="line-height:29px;">{{ scope.row.Data? scope.row.Data.Time : '' }}</span>
             </div>
             <span style="width:55.33px;display:inline-block;padding-left:10px;">
-            <el-button class="dialog-btn" @click="refreshThisRow(scope.row)"><i class="el-icon-refresh"></i></el-button>
+              <el-button class="dialog-btn" @click="refreshThisRow(scope.row)"><i class="el-icon-refresh"></i></el-button>
             </span>
           </template>
         </el-table-column>
@@ -48,15 +50,15 @@
           <template slot-scope="scope">
             <span style="display:inline-block;width:16px;line-height:29px;">{{ scope.row.RelatedInstance }}</span>
             <span style="width:55.33px;display:inline-block;padding-left:10px;">
-              <el-button class="dialog-btn" v-if="scope.row.RelatedInstance" @click="handleDrawer(scope.row, 2)"><i class="el-icon-coin"></i></el-button>
+              <el-button class="dialog-btn" v-if="scope.row.RelatedInstance" @click="handleDrawer(scope.row, 2)"><i class="el-icon-coin"></i>
+              </el-button>
             </span>
           </template>
         </el-table-column>
       </el-table>
       <!-- 分页 -->
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="pageSizes"
-        :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="allTableData.length"
-        style="float:right;margin-top:10px;padding:2px 5px;">
+        :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total" style="float:right;margin-top:10px;padding:2px 5px;">
       </el-pagination>
     </div>
     <!-- 对话框和抽屉统一放在drawers中 -->
@@ -96,10 +98,12 @@ export default {
         color: '#2b2b2b',
         lineHeight: '30px'
       },
-      allTableData: [],//所有表格数据
+      // allTableData: [],//所有表格数据
+      tableData: [],
       pageSizes: [10, 20, 50, 100],
       pageSize: 50,
       currentPage: 1,
+      total: 0,
       loading: false,//加载
       tabFunNum: null,//表号功能号
       //抽屉
@@ -134,8 +138,15 @@ export default {
     //获取统计数据
     getOverViewList() {
       this.loading = true;
-      getTabFunNumOverview({ MeterFunc: this.tabFunNum }, res => {
-        this.allTableData = res.Content;
+      let pa = {
+        MeterFunc: this.tabFunNum,
+        PageSize: this.pageSize,
+        PageNumber: this.currentPage
+      }
+      getTabFunNumOverview(pa, res => {
+        // this.allTableData = res.Content;
+        this.tableData = res.Content;
+        this.total = res.Total
         this.loading = false;
       });
     },
@@ -158,11 +169,14 @@ export default {
     },
     //分页更换size
     handleSizeChange(val) {
+      this.currentPage = 1;
       this.pageSize = val;
+      this.getOverViewList()
     },
     //分页更换页
     handleCurrentChange(val) {
       this.currentPage = val;
+      this.getOverViewList()
     },
     //子组件关闭抽屉
     closeDrawer() {
@@ -181,12 +195,12 @@ export default {
   },
   computed: {
     //根据分页,获取要展示的tableData
-    tableData: function () {
-      return this.allTableData.slice(
-        (this.currentPage - 1) * this.pageSize,
-        (this.currentPage * this.pageSize < this.allTableData.length) ? this.currentPage * this.pageSize : this.allTableData.length);
+    // tableData: function () {
+    //   return this.allTableData.slice(
+    //     (this.currentPage - 1) * this.pageSize,
+    //     (this.currentPage * this.pageSize < this.allTableData.length) ? this.currentPage * this.pageSize : this.allTableData.length);
 
-    }
+    // }
   },
   components: {
     historyChart,
@@ -214,20 +228,20 @@ export default {
   cursor: pointer;
   float: right;
 }
-.dialog-btn{
-  display:none;
-  height:29px;
+.dialog-btn {
+  display: none;
+  height: 29px;
 }
 /deep/ .el-drawer__body {
   height: 90%;
   overflow-y: auto;
 }
-/deep/ .el-table__body-wrapper tr:hover{
-  .dialog-btn{
-    display:inline;
+/deep/ .el-table__body-wrapper tr:hover {
+  .dialog-btn {
+    display: inline;
   }
 }
 /deep/ .el-dialog__body {
-  padding-bottom:20px;
+  padding-bottom: 20px;
 }
 </style>