wangrong
2021-11-24 130b72d6c5734f8acaac0214b6dfe5c8bfa319c3
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
101
102
103
104
105
106
107
108
109
110
111
112
113
<template>
  <div>
    <el-table
      :data="data"
      style="width: 100%; margin-bottom: 10px"
      height="400"
      border
      stripe
      size="mini"
      v-loading="loading"
    >
      <el-table-column type="index" label="#"> </el-table-column>
      <el-table-column
        prop="frequency"
        label="频率"
        sortable
        width="80"
        class-name="custom-column"
      >
      </el-table-column>
      <el-table-column
        prop="name"
        label="名称"
        sortable
        width="300"
        class-name="custom-column"
      >
      </el-table-column>
      <el-table-column
        prop="area"
        label="地区"
        align="center"
        class-name="custom-column"
      >
      </el-table-column>
      <el-table-column label="录音" align="center" class-name="custom-column">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.is_recording"
            :active-value="1"
            :inactive-value="0"
            :width="35"
            :ref="scope.row.id"
            disabled
          >
          </el-switch>
        </template>
      </el-table-column>
    </el-table>
    <Pagination
      ref="pagination"
      totalCountOrURL="Terminal/cnt_WhiteListOfTask"
      :params="queryParams"
      @change="handlePageChange"
    ></Pagination>
  </div>
</template>
 
<script>
import Pagination from "@/components/pageNations/Pagnations";
export default {
  props: ["whiteListIdArr"],
  components: {
    Pagination,
  },
  mounted() {
    this.getData();
  },
  watch: {
    whiteListIdArr() {
      this.getData();
    },
  },
  data() {
    return {
      data: [],
      queryParams: {
        page: 1,
        size: 10,
      },
      loading: false,
    };
  },
  methods: {
    handlePageChange(params) {
      this.queryParams.page = params.page;
      this.queryParams.size = params.size;
      this.getData();
    },
    getData() {
      if (this.whiteListIdArr) {
        this.loading = true;
        let idArr = [];
        for (let key in this.whiteListIdArr) {
          idArr.push(key);
        }
        this.queryParams.options = [
          {
            type: "6",
            name: "id",
            value: idArr,
          },
        ];
      } else {
        this.data = [];
      }
    },
  },
};
</script>
 
<style scoped>
</style>