Kaynağa Gözat

new page ready

Changpeng Duan 5 yıl önce
ebeveyn
işleme
4636a75b7a
2 değiştirilmiş dosya ile 59 ekleme ve 43 silme
  1. 58 42
      src/views/Equip.vue
  2. 1 1
      src/views/Region.vue

+ 58 - 42
src/views/Equip.vue

@@ -54,9 +54,11 @@
         </div>
         <el-table
                 :data="tableData"
+                is-horizontal-resize
+                :default-sort="{prop: 'date', order: 'descending'}"
+                v-loading="loading"
                 class=""
                 stripe
-                @selection-change="handleSelectionChange"
         >
             <el-table-column
                     type="selection"
@@ -165,7 +167,9 @@
 <script>
     import Global from '../Global.js'
     import dialog_referrer_list from '../components/dialog_referrer_list'
+    import {DetectorQuery} from '../api/getApiRes.js'
 
+    let qs = require('qs');
     export default {
         data() {
             return {
@@ -203,30 +207,65 @@
                     total: 10,
                     pageIndex: 1,
                 },
+                pageination: {
+                    pageItem: 10,
+                    pageoptions: pageOptions(),
+                    total: 300,
+                    pageIndex: 1,
+                },
+                draw: 1,
+                start: 0,
+                recordsTotal: 0,
+                tableData: [],
+                allTableData: [],
+                limit: '10',
+                multipleSort: false,
+                loading: true,
+                fileList: [],
                 multipleSelection: [],
-                tableData: [{
-                    date: '2016-05-02',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1518 弄'
-                }, {
-                    date: '2016-05-04',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1517 弄'
-                }, {
-                    date: '2016-05-01',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1519 弄'
-                }, {
-                    date: '2016-05-03',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1516 弄'
-                }]
+                detectedmac: '',
             }
         },
         mounted() {
             this.getTableQuery();
         },
         methods: {
+            // 页面数据查询
+            getTableQuery() {
+                // 获取探测器列表
+                this.getDetOption();
+                let that = this;
+                that.loading = true;
+                // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
+                let param = {
+                    token: localStorage.token,
+                    supregionid: 0,//
+                    regionid: 0,//
+                    comid : 1,//
+                    tagname: that.panel.tagname,//标签名
+                    start: 1,//
+                    tableMax: 300,//
+                };
+                let postdata = qs.stringify(param);
+                DetectorQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.allTableData = json.Rs;
+                            that.recordsTotal = json.Rs.length;
+                        } else {
+                            that.allTableData = [];
+                            that.recordsTotal = 0;
+                        }
+
+                        // 设置分页数据
+                        that.setPaginations();
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             // 跳转tab页面
             goTab(url) {
                 this.$router.push({path: url});
@@ -242,30 +281,7 @@
             },
             // 页面数据查询
             getTableQuery() {
-                // let that = this;
-                // that.loading = true;
-                // let url = headapi + '?ctl=ajax&mod=dial&act=taskListQuery';//获取
-                // let param = {
-                //     'taskstatus': that.panel.taskstatus,
-                //     'bt': globaltime2String(that.panel.time1[0]),
-                //     'et': globaltime2String(that.panel.time1[1]),
-                //     'KEYWORD': that.panel.keyword,
-                //     'USERCODE': that.panel.USERCODE,
-                // };
-                // let JSON = '';
-                // let postdata = qs.stringify(param);
-                // axios.post(url, postdata)
-                //     .then(function (response) {
-                //         JSON = response.data;
-                //         that.loading = false;
-                //         that.allTableData = JSON.rs;
-                //         that.recordsTotal = JSON.rs.length;
-                //         // 设置分页数据
-                //         that.setPaginations();
-                //     })
-                //     .catch(function (error) {
-                //         console.log(error);
-                //     });
+
             },
             // 设置分页数据
             setPaginations() {

+ 1 - 1
src/views/Region.vue

@@ -306,7 +306,7 @@
                     height: 300,
                     picMemo: 300,
                     picType: that.dialog_level, //图片类型,1:主图 2:平面图
-                    Key: that.dialog.Key,
+                    key: that.dialog.Key,
                 };
                 let postdata = qs.stringify(param);
                 RegionAdd(postdata).then(res => {