zhaobao 2 tahun lalu
induk
melakukan
eab895a9ad
1 mengubah file dengan 96 tambahan dan 42 penghapusan
  1. 96 42
      src/views/particulars/check.vue

+ 96 - 42
src/views/particulars/check.vue

@@ -8,33 +8,44 @@
             <div class="lf">
                 <div class="search-container">
                     <div class="top">
-                        <el-input v-model="search.name"  class="input" placeholder="请输入任务名称" />
-                        <el-select v-model="search.level" class="select" placeholder="全部">
-                            <el-option
-                            v-for="item in options1"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                            placeholder="是否异常"
-                            />
-                        </el-select>
-                        <el-select v-model="search.value" class="select" placeholder="全部">
-                            <el-option
-                            v-for="item in options"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                            placeholder="状态"
-                            />
-                        </el-select>
-                        <el-date-picker
-                            v-model="search.time"
-                            type="date"
-                            class="date11"
-                            placeholder="请选择巡检时间"
-                            style="width:200px;margin-right: 14px;"
-                            :default-value="new Date(2010, 9, 1)"
-                        />                
+                        <div class="search-item">
+                            <el-input v-model="search.name"  class="input" placeholder="请输入任务名称" />
+                        </div>
+                        <div class="search-item">
+                            <span>是否异常:</span>
+                            <el-select v-model="search.level" class="select" placeholder="全部">
+                                <el-option
+                                v-for="item in options1"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value"
+                                placeholder="是否异常"
+                                />
+                            </el-select>                            
+                        </div>
+                        <div class="search-item">
+                            <span>状态:</span>
+                            <el-select v-model="search.value" class="select" placeholder="全部">
+                                <el-option
+                                v-for="item in options"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value"
+                                placeholder="状态"
+                                />
+                            </el-select>                            
+                        </div>
+                        <div class="search-item">
+                            <span>巡检时间:</span>
+                            <el-date-picker
+                                v-model="search.time"
+                                type="date"
+                                class="date11"
+                                placeholder="请选择巡检时间"
+                                style="width:200px;margin-right: 14px;"
+                                :default-value="new Date(2010, 9, 1)"
+                            />  
+                        </div>              
                     </div>
                     <div class="bt-group">
                         <div class="bt search" @click="searchSubmit">查询</div>
@@ -49,15 +60,18 @@
                             <td>等级</td>
                             <td>时间</td>
                         </tr>
-                        <tr v-for="(item,index) in 13" :key="index">
-                            <td>{Ⅲ号-770-32008}:存在塌石</td>
-                            <td>待整改</td>
-                            <td>较大</td>
-                            <td>22-05-04</td>
+                        <tr v-for="(item,index) in dataList" :key="index">
+                            <td>{{ item.checklistTitle }}</td>
+                            <td>{{ item.checklistTitle }}</td>
+                            <td>{{ item.checklistTitle }}</td>
+                            <td>{{ item.checklistTitle }}</td>
                         </tr>
                     </table>
                     <div class="el-pagination-wrap">
-                        <el-pagination small layout="prev, pager, next" :total="50" />
+                        <el-pagination small layout="prev, pager, next" 
+                        :total="total"
+                        @size-change="handleSizeChange"
+                        @current-change="handleCurrentChange" />
                      </div>                                   
                 </div>
             </div>
@@ -95,6 +109,7 @@
 <script>
 import Abnormal  from './components/Abnormal.vue'
 import WarnChart from './components/WarnChart.vue'
+import {getChecklistByPage} from '@/api/goaf/check'
  export default {
     name:"check",
     components:{
@@ -105,6 +120,11 @@ import WarnChart from './components/WarnChart.vue'
         return{
             activeId:'1',
             activetab:'1',
+            conditions: {
+                page: 1,
+                limit: 10,
+                goafName:""
+            },   
             items:[
                 {name:"首页",id:"1",path:"/particulars/sensor"},
                 {name:"压力传感器",id:"2",path:"/particulars/check"},
@@ -125,15 +145,16 @@ import WarnChart from './components/WarnChart.vue'
                 range:0
             } ,
             options:[
-                {label:1,value:2},
-                {label:2,value:3},
-                {label:3,value:4}
+                {label:"待整改",value:2},
+                {label:"待整改",value:3},
+                {label:"待整改",value:4}
             ] ,
             options1:[
-                {label:1,value:2},
-                {label:2,value:3},
-                {label:3,value:4}
-            ]                      
+                {label:'是',value:1},
+                {label:'否',value:0},
+            ],
+            dataList:[],
+            total:0                
         }
     },
     created(){
@@ -144,6 +165,7 @@ import WarnChart from './components/WarnChart.vue'
             this.$nextTick(()=>{
                 this.$refs['abnormal'].init();
                 this.$refs['warn-chart'].init();
+                this.getData()
             })
         },
         changeHead(item){
@@ -153,7 +175,15 @@ import WarnChart from './components/WarnChart.vue'
             this.activetab=item.id
         },
         searchSubmit(){
-
+            this.getData()
+        },
+        getData(){
+            getChecklistByPage(this.conditions).then((resp) => {
+                this.listLoading = false
+                const {data, total } = resp
+                this.dataList = data
+                this.total = total
+            })
         },
         resetSubmit(){
             this.search={
@@ -164,6 +194,14 @@ import WarnChart from './components/WarnChart.vue'
                 range:0               
             }
         },
+        handleSizeChange(limit){
+            this.conditions.limit=limit
+            this.getData()
+        },
+        handleCurrentChange(pageNumber){
+            this.conditions.page=pageNumber
+            this.getData()
+        }
     }
  }
 </script>
@@ -200,8 +238,24 @@ import WarnChart from './components/WarnChart.vue'
             .search-container{
                 padding:4.4vh 0 5vh 0;
                 box-sizing: border-box;
+                .top{
+                    display: flex;
+                    flex-wrap: wrap;
+                    .search-item{
+                        display: flex;
+                        justify-content: center;
+                        align-items: center;
+                        margin-top: 14px;
+                        span{
+                            font-family: 'Ping Hei';
+                            font-size: 14px;
+                            line-height: 1;
+                            color: rgba(255, 255, 255, 0.7);
+                        }
+                    }                    
+                }
                 .input,.select,.el-date-editor{
-                    width: 220px;
+                    width: 180px;
                     margin-right:16px;
                     color: #fff;
                 }