fei.wang
10 天以前 645834e1c3efb3a8c50dcbda98d87caba04bd421
pages/index/main.vue
@@ -17,10 +17,13 @@
            <view v-for="(item, index) in list" :key="index">
               <view>
                  <tn-button class="modal-btn" backgroundColor="#01BEFF" size="sm"
                     @click="itemClick(item,index)">删除</tn-button>
                  <view style="display: flex;margin-top: 10px;">
                     <!-- <u-checkbox-group v-model="item.checked" placement="column" @change="checkboxChange(item)">
                        <u-checkbox :customStyle="{marginTop: '5px'}">
                        </u-checkbox>
@@ -28,21 +31,31 @@
                     <view style="margin-left: 23px;margin-bottom: 10px;font-size: 20px;">告警类型:{{item.warntype}}
                     </view>
                  </view>
<view style="display: flex;">
                     <!-- <view>{{index+1}}</view>
                     <view style="margin-left: 15px;margin-bottom: 10px;color: #5e5e5e;">编号:{{item.tagid}}
                     </view>
                     <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">名称:{{item.pname}}</view> -->
                     <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">触发围栏:{{item.baoliu1}}
                     </view>
                  </view>
                  <view style="display: flex;">
                     <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">ID:{{item.tagid}}
                     <view>{{index+1}}</view>
                     <view style="margin-left: 15px;margin-bottom: 10px;color: #5e5e5e;">编号:{{item.tagid}}
                     </view>
                     <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">名称:{{item.pname}}</view>
                     <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">触发围栏:{{item.baoliu1}}</view>
                     <!-- <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">触发围栏:{{item.baoliu1}}
                     </view> -->
                  </view>
   <view style="display: flex;">
                  <view style="display: flex;">
                     <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">设备类型:{{item.pbaoliu1}}
                     </view>
                     <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">告警类型:{{item.ptype}}</view>
                     <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">告警类型:{{item.ptype}}
                     </view>
                     <!-- <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">触发围栏:{{item.baoliu1}}</view> -->
                  </view>
                  <!-- <view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">
@@ -53,8 +66,11 @@
                  <u-line style="margin-left: 14px;"></u-line>
               </view>
            </view>
         </data-list>
      </view>
      <!--    <page-pagination :total="page.total" layout="total,first,prev,page,next,last,limit,jumper"></page-pagination> -->
      <tn-skeleton :show="showSkeleton"></tn-skeleton>
      <successCom ref="refSuccess"></successCom>
   </view>
@@ -80,6 +96,11 @@
      },
      data() {
         return {
            // page: {
            //    total: 10000,
            //    pageSize: 50,
            //    currentPage: 2
            // },
            show: false,
            width: '90%',
            checkboxValue1: [],
@@ -197,21 +218,22 @@
               current: data.page,
               size: data.size,
               company: this.company,
               juese:uni.getStorageSync('juese'),
               juese: uni.getStorageSync('juese'),
            }
            if (this.vuex_is_login) {
               findwarning(params).then((res) => {
                  if (res.code == 0) {
                     let list = [];
                     setTimeout(() => {
                        let list = res.data.map(item => ({
                           ...item,
                           checked: false // 初始化checked属性为false
                        }));
                        let list = [];
                        for (var i = 0; i < res.data.records.length; i++) {
                           list.push(res.data.records[i]);
                        }
                        // this.list = []
                        this.list = [...this.list, ...list];
                        callback({
                           list: this.list,
                           total: res.data.length
                           total: res.data.total
                        });
                     }, 1500);
                  }
@@ -228,7 +250,7 @@
               current: 1,
               size: 10,
               objectid: this.keyword,
               juese:uni.getStorageSync('juese'),
               juese: uni.getStorageSync('juese'),
               company: this.company,
            }
            if (this.vuex_is_login) {
@@ -238,13 +260,13 @@
                     let list = [];
                     setTimeout(() => {
                        let list = [];
                        for (var i = 0; i < res.data.length; i++) {
                           list.push(res.data[i]);
                        for (var i = 0; i < res.data.records.length; i++) {
                           list.push(res.data.records[i]);
                        }
                        this.list = [...this.list, ...list];
                        callback({
                           list: this.list,
                           total: res.data.length
                           total: res.data.total
                        });
                     }, 1500);
                  }
@@ -253,12 +275,13 @@
         },
         // 模拟请求数据刷新
         handleRefresh(data, callback) {
            const params = {
               current: data.page,
               size: data.size,
               objectid: data.objectid,
               company: this.company,
               juese:uni.getStorageSync('juese'),
               juese: uni.getStorageSync('juese'),
            }
            if (this.vuex_is_login) {
               findwarning(params).then((res) => {
@@ -266,14 +289,14 @@
                     let list = [];
                     setTimeout(() => {
                        let list = [];
                        for (var i = 0; i < res.data.length; i++) {
                           list.push(res.data[i]);
                        for (var i = 0; i < res.data.records.length; i++) {
                           list.push(res.data.records[i]);
                        }
                        this.list = []
                        this.list = [...this.list, ...list];
                        callback({
                           list: this.list,
                           total: res.data.length
                           total: res.data.total
                        });
                     }, 1500);
                  }