index.vue 6.71 KB
Newer Older
neogcg's avatar
neogcg committed
1 2 3 4
<template>
  <div class="leakage-cable">
    <!-- 设备连接维修历史 -->
    <div class="leakage-top">
neogcg's avatar
neogcg committed
5
      <div style="color: #666666"></div>
neogcg's avatar
neogcg committed
6 7 8 9 10 11 12 13 14 15 16 17 18
      <div class="operate-btn">
        <el-button
          :type="multipleSelection.length ? 'primary' : 'info'"
          :disabled="!multipleSelection.length"
          >删除</el-button
        >
        <el-button type="primary">刷新</el-button>
        <el-button type="primary">查询</el-button>
        <el-button type="primary">导出</el-button>
        <el-button type="primary">清空数据</el-button>
      </div>
    </div>
    <el-table
neogcg's avatar
neogcg committed
19
      :data="tableData2"
neogcg's avatar
neogcg committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
      style="width: 100%"
      :cell-class-name="cellClassFn"
      :header-cell-style="{ background: '#EAF1FE', color: '#666666' }"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />

      <el-table-column prop="netDevice" label="网元设备" align="center" />
      <el-table-column
        prop="linkStatus"
        label="连接状态"
        width="150"
        align="center"
      >
      </el-table-column>
      <el-table-column prop="netDevice2" label="网元设备" align="center">
      </el-table-column>
neogcg's avatar
neogcg committed
37
      <el-table-column prop="repairPerson" label="维修人员信息" align="center">
neogcg's avatar
neogcg committed
38 39 40
      </el-table-column>
      <el-table-column
        prop="linkRepairDate"
neogcg's avatar
neogcg committed
41
        label="连接告警维修时间"
neogcg's avatar
neogcg committed
42 43 44 45
  
        align="center"
      />
    </el-table>
neogcg's avatar
neogcg committed
46
    <Pagination
neogcg's avatar
neogcg committed
47 48 49 50 51 52
      :limit="searchForm.pageSize"
      :page="searchForm.pageNum"
      :total="total"
      class="pagination"
      @pagination="handlePageChange"
    >
neogcg's avatar
neogcg committed
53
    </Pagination>
neogcg's avatar
neogcg committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67
  </div>
</template>
<script>
import Pagination from "@/components/Pagination";
export default {
  props: [],
  components: { Pagination },
  data() {
    return {
      multipleSelection: [],
      searchForm: {
        pageNum: 1,
        pageSize: 10,
      },
neogcg's avatar
neogcg committed
68
      total: 14,
neogcg's avatar
neogcg committed
69
tableData2:[],
neogcg's avatar
neogcg committed
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 178 179
      tableData: [
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          repairPerson: "张三",
          linkRepairDate: "2022/12/18 11:59:42",
        },
        {
          netDevice: "现场管理单元 K65+308",
          linkStatus: "连接正常",
          netDevice2: "故障定位单元 K64+287",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "现场管理单元 K65+308",
          linkStatus: "连接正常",
          netDevice2: "故障定位单元 K64+287",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "现场管理单元 K65+308",
          linkStatus: "连接正常",
          netDevice2: "故障定位单元 K64+287",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "现场管理单元 K65+308",
          linkStatus: "连接正常",
          netDevice2: "故障定位单元 K64+287",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
        {
          netDevice: "监控中心LSC",
          linkStatus: "连接异常",
          netDevice2: "现场管理单元 K65+308",
          linkRepairDate: "2022/12/18 11:59:42",
          repairPerson: "张三",
        },
      ],
    };
  },
  computed: {},
  methods: {
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handlePageChange(pageData) {
      this.searchForm.pageSize = pageData.size;
      this.searchForm.pageNum = pageData.page;
neogcg's avatar
neogcg committed
180
        this.getTableData()
neogcg's avatar
neogcg committed
181
    },
neogcg's avatar
neogcg committed
182 183 184 185 186
      getTableData() {
      this.tableData2 = this.tableData.slice(( this.searchForm.pageNum - 1) * this.searchForm.pageSize,
         this.searchForm.pageNum * this.searchForm.pageSize
      );
      this.total = this.tableData.length
neogcg's avatar
neogcg committed
187
  
neogcg's avatar
neogcg committed
188
    },
neogcg's avatar
neogcg committed
189 190 191 192 193 194 195 196 197 198 199
    cellClassFn({ row, column, rowIndex, columnIndex }) {
      if (row.linkStatus == "连接异常" && column.label == "连接状态") {
        return "emergency";
      } else if (row.linkStatus == "连接正常" && column.label == "连接状态") {
        return "normal";
      }
      if (rowIndex % 2 == 1) {
        return "stripe";
      }
    },
  },
neogcg's avatar
neogcg committed
200
  mounted() {
neogcg's avatar
neogcg committed
201
     this.getTableData()
neogcg's avatar
neogcg committed
202
  },
neogcg's avatar
neogcg committed
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
};
</script>
<style lang="scss" scoped>
.leakage-cable {
  .leakage-top {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
  }
  & ::v-deep .cell {
    color: #333333;
  }

  & ::v-deep .stripe {
    background-color: #eaf1fe;
  }
  & ::v-deep .emergency {
    background-color: #f00;
  }
  & ::v-deep .important {
    background-color: #f89850;
  }
  & ::v-deep .normal {
    background-color: green;
  }

  .page {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    .pageNum {
      margin: 0 20px;
    }
  }
}
</style>