index.vue 2.69 KB
Newer Older
1
<template>
neogcg's avatar
neogcg committed
2

neogcg's avatar
neogcg committed
3 4 5 6 7 8 9 10 11 12
  <div class="leakage-cable">
    <el-button-group>
      <el-button
        v-for="item in tabs"
        :key="item.key"
        :type="activeName === item.key ? 'primary' : ''"
        @click="changeType(item)"
        >{{ item.label }}</el-button
      >
    </el-button-group>
neogcg's avatar
neogcg committed
13 14 15

    <railWayTable v-if="activeName == '0'"></railWayTable>
    <stationTable v-if="activeName == '1'"></stationTable>
neogcg's avatar
neogcg committed
16 17 18
    <fsuTable v-if="activeName == '2'"></fsuTable>
    <monitorTable v-if="activeName == '3'"></monitorTable>
    <leakyTable v-if="activeName == '4'"></leakyTable>
19
  </div>
neogcg's avatar
neogcg committed
20
  
21 22 23
</template>

<script>
neogcg's avatar
neogcg committed
24 25
import railWayTable from "./comp/railWayTable.vue";
import stationTable from "./comp/stationTable.vue";
neogcg's avatar
neogcg committed
26 27 28
import fsuTable from "./comp/fsuTable.vue";
import monitorTable from "./comp/monitorTable.vue";
import leakyTable from "./comp/leakyTable.vue";
neogcg's avatar
neogcg committed
29
import Pagination from "@/components/Pagination";
neogcg's avatar
neogcg committed
30 31 32 33 34 35
import {
  railWaylist,
  railWaybatchDelete,
  railWaydetail,
  sitelist,
} from "../api";
36
export default {
neogcg's avatar
neogcg committed
37 38 39 40 41 42 43 44
  components: {
    Pagination,
    railWayTable,
    stationTable,
    fsuTable,
    monitorTable,
    leakyTable,
  },
45 46
  data() {
    return {
neogcg's avatar
neogcg committed
47
      params: {
48
        pageNum: 1,
neogcg's avatar
neogcg committed
49
        pageSize: 10,
50 51
      },
      total: 10,
neogcg's avatar
neogcg committed
52
      activeName: "0",
53 54
      tabs: [
        {
neogcg's avatar
neogcg committed
55 56
          label: "铁路线",
          key: "0",
57 58
        },
        {
neogcg's avatar
neogcg committed
59 60
          label: "站点",
          key: "1",
61 62
        },
        {
neogcg's avatar
neogcg committed
63 64
          label: "FSU",
          key: "2",
65 66
        },
        {
neogcg's avatar
neogcg committed
67
          label: "监测设备",
neogcg's avatar
neogcg committed
68
          key: "3",
69 70
        },
        {
neogcg's avatar
neogcg committed
71 72
          label: "漏缆",
          key: "4",
73 74
        },
        {
neogcg's avatar
neogcg committed
75 76 77
          label: "天馈线",
          key: "5",
        },
78
      ],
neogcg's avatar
neogcg committed
79
      tableData2: [],
neogcg's avatar
neogcg committed
80
      tableData: [],
neogcg's avatar
neogcg committed
81
      multipleSelection: [],
neogcg's avatar
neogcg committed
82
      ids: [],
neogcg's avatar
neogcg committed
83
    };
84 85 86
  },
  methods: {
    tableRowClassName({ row, rowIndex }) {
neogcg's avatar
neogcg committed
87
      return rowIndex % 2 === 0 ? "" : "single-row";
88 89
    },
    changeType(item) {
neogcg's avatar
neogcg committed
90
      this.activeName = item.key;
91
    },
neogcg's avatar
neogcg committed
92

93 94 95
    refresh() {},
    query() {},
    exportData() {},
neogcg's avatar
neogcg committed
96
  },
neogcg's avatar
neogcg committed
97
  mounted() {},
neogcg's avatar
neogcg committed
98
};
99 100
</script>

neogcg's avatar
neogcg committed
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
<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 .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;
    }
  }
130
}
neogcg's avatar
neogcg committed
131 132
</style>
<style lang="scss">
133 134 135 136
.statistics-table {
  .single-row {
    background: #f1f6ff;
  }
neogcg's avatar
neogcg committed
137 138
  td {
    padding: 5px !important;
139 140 141
  }
}
</style>