Xxxu
2020-07-03 1ac6ef52a03f25f9def9f6a2594d2a8196aa77f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
<template>
  <div class="streetlight-time">
    <div class="title-text">路灯定时</div>
    <div style="padding: 10px">
      <el-tabs v-model="activeName" @tab-click="handleClick()">
        <el-tab-pane label="智慧路灯定时管理" name="sma"></el-tab-pane>
        <el-tab-pane label="NB路灯定时管理" name="nb"></el-tab-pane>
      </el-tabs>
    </div>
    <el-table
      :data="dataList"
      v-loading="dataListLoading"
      :show-header="false"
      style="width: 100%;">
      <el-table-column
        prop="name"
        header-align="center"
        treeKey="timeId"
        width="150"
        label="名称">
      </el-table-column>
      <el-table-column
        prop="cron"
        header-align="center"
        align="center"
        label="定时时间">
      </el-table-column>
      <el-table-column
        fixed="right"
        header-align="center"
        align="center"
        width="150"
        label="操作">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.timeId)">修改</el-button>
          <el-button type="text" size="small" @click="deleteHandle(scope.row.timeId)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
 
<script>
export default {
  data () {
    return {
      activeName: 'sma',
      dataList: [],
      dataListLoading: false
    }
  },
  activated () {
    this.getDataList()
  },
  methods: {
    handleClick () {
    },
    getDataList () {
      this.dataListLoading = true
      this.$http({
        url: this.$http.adornUrl('/pole/poletime/list'),
        method: 'get',
        params: this.$http.adornParams()
      }).then(({data}) => {
        if (data && data.code === 0) {
          var list = []
          data.list.forEach(element => {
            if (element.parentId === null) {
              list.push(element)
            }
          })
          this.dataList = list
        } else {
          this.dataList = []
        }
        this.dataListLoading = false
      })
    }
  }
}
</script>
 
<style lang="scss" scoped>
.streetlight-time {
  margin-top: 30px;
  background-image: url(~@/assets/img/streetlight/time.png);
  background-size: 100% 100%;
  /deep/ .el-table{
    height: 175px;
    color: white;
    background-color: transparent;
    tr {
      background-color: transparent;
      td {
        border-bottom: 0px
      }
    }
  }
}
</style>