equipment.vue 6.89 KB
Newer Older
许倩倩's avatar
许倩倩 committed
1 2 3 4
<template>
  <!-- 漏缆实时状态 -->
  <div class="leakage-cable">
    <div class="leakage-top">
许倩倩's avatar
许倩倩 committed
5
      <div>
neogcg's avatar
neogcg committed
6
     
许倩倩's avatar
许倩倩 committed
7
      </div>
许倩倩's avatar
许倩倩 committed
8 9 10 11 12 13
      <div class="operate-btn">
        <el-button type="primary">刷新</el-button>
        <el-button type="primary">查询</el-button>
        <el-button type="primary">导出</el-button>
      </div>
    </div>
neogcg's avatar
neogcg committed
14
    <el-table :data="tableData2" style="width: 100%" :cell-class-name="cellClassFn" :header-cell-style="{background:'#EAF1FE',color:'#666666'}">
许倩倩's avatar
许倩倩 committed
15 16 17 18 19 20 21
      <el-table-column prop="equipment1" label="网元设备" align="center" />
      <el-table-column prop="state1" label="连接状态" align="center" />
      <el-table-column prop="equipment2" label="网元设备" align="center" />
      <el-table-column prop="state2" label="连接状态" align="center" />
      <el-table-column prop="equipment3" label="网元设备" align="center" />
      <el-table-column prop="uploadDate" label="上传时间" align="center" />
    </el-table>
许倩倩's avatar
许倩倩 committed
22 23 24 25 26 27 28
    <pagination
      :limit="searchForm.pageSize"
      :page="searchForm.pageNum"
      :total="total"
      class="pagination"
      @pagination="handlePageChange"
    />
许倩倩's avatar
许倩倩 committed
29 30 31 32
  </div>
</template>

<script>
许倩倩's avatar
许倩倩 committed
33 34
import Pagination from '@/components/Pagination'

许倩倩's avatar
许倩倩 committed
35
export default {
yanzhongrong's avatar
yanzhongrong committed
36
  components: { Pagination },
许倩倩's avatar
许倩倩 committed
37 38
  data() {
    return {
许倩倩's avatar
许倩倩 committed
39 40 41 42 43
      searchForm: {
        pageNum: 1,
        pageSize: 10
      },
      total: 10,
neogcg's avatar
neogcg committed
44
      tableData2:[],
许倩倩's avatar
许倩倩 committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
      tableData: [
        {
          equipment1: '监控中心LSC',
          state1: '连接正常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },
        {
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接正常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },{
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },{
          equipment1: '监控中心LSC',
          state1: '连接正常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },
        {
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接正常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },{
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },{
          equipment1: '监控中心LSC',
          state1: '连接正常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },
        {
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接正常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },{
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },{
          equipment1: '监控中心LSC',
          state1: '连接正常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },
        {
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接正常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },{
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },{
          equipment1: '监控中心LSC',
          state1: '连接正常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },
        {
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接正常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        },{
          equipment1: '监控中心LSC',
          state1: '连接异常',
          equipment2: '现场管理单元 K65+308',
          state2: '连接异常',
          equipment3: '天馈线A_K4563_535',
          uploadDate: '2022/12/18 11:51:12'
        }
      ],
    };
  },
  methods: {
    // 表格背景图颜色
    cellClassFn({row, column, rowIndex, columnIndex}) {
      if ((row.state1 == '连接正常' && column.property == 'state1')) {
        return 'green'
      }
      if ((row.state1 == '连接异常' && column.property == 'state1')) {
        return 'red'
      }
      if ((row.state2 == '连接正常' && column.property == 'state2')) {
        return 'green'
      } else if ((row.state2 == '连接异常' && column.property == 'state2')) {
        return 'red'
      }
      if (rowIndex%2 == 1) {
        return 'stripe'
      }
    },
许倩倩's avatar
许倩倩 committed
178
    handlePageChange(pageData) {
neogcg's avatar
neogcg committed
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
      this.searchForm.pageSize = pageData.size;
      this.searchForm.pageNum = pageData.page;
        this.getTableData()
    },
      getTableData() {
      this.tableData2 = this.tableData.slice(( this.searchForm.pageNum - 1) * this.searchForm.pageSize,
         this.searchForm.pageNum * this.searchForm.pageSize
      );
      this.total = this.tableData.length
  
    },
    },
  mounted() {
    this.getTableData()
  },
许倩倩's avatar
许倩倩 committed
194 195 196 197 198 199
};
</script>

<style lang="scss" scoped>
.leakage-cable {
  .leakage-top {
许倩倩's avatar
许倩倩 committed
200
    margin-bottom: 20px;
许倩倩's avatar
许倩倩 committed
201
    display: flex;
许倩倩's avatar
许倩倩 committed
202
    align-items: flex-end;
许倩倩's avatar
许倩倩 committed
203 204 205
    justify-content: space-between;
  }
  & ::v-deep .cell {
许倩倩's avatar
许倩倩 committed
206
    color: #333333;
许倩倩's avatar
许倩倩 committed
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
  }
  & ::v-deep .stripe {
    background-color: #EAF1FE;
  }
  & ::v-deep .red {
    background-color: #f00;
  }
  & ::v-deep .green {
    background-color: green;
  }
  .page {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    .pageNum {
      margin: 0 20px;
    }
  }
}
</style>