UserCenter.vue 7.01 KB
Newer Older
纪泽龙's avatar
纪泽龙 committed
1
<template>
2
  <transition>
纪泽龙's avatar
纪泽龙 committed
3
    <div v-show="show" class="wrapper myCenter">
纪泽龙's avatar
纪泽龙 committed
4 5
      <div class="left">
        <div class="title-wrapper">
纪泽龙's avatar
纪泽龙 committed
6
          <div class="title">{{ title }}报警器列表</div>
纪泽龙's avatar
纪泽龙 committed
7
          <div class="close" @click="close">
纪泽龙's avatar
纪泽龙 committed
8
            <img src="@/assets/mapImages/closeBtn.png" alt="" />
纪泽龙's avatar
纪泽龙 committed
9
          </div>
纪泽龙's avatar
纪泽龙 committed
10
        </div>
纪泽龙's avatar
纪泽龙 committed
11 12 13 14 15 16 17 18 19 20 21
        <div class="bottom right-bottom-data-left">
          <el-table
            size="mini"
            :data="tableData"
            style="width: 100%"
            class="el-bottom"
            :key="Math.random()"
          >
            <!-- :height="tableHeight" -->
            <el-table-column prop="detectorCode" label="设备编号" width="180">
              <template slot-scope="scope">
纪泽龙's avatar
纪泽龙 committed
22
                <div :title="scope.row.detectorCode" class="ddd" v-unValue>
纪泽龙's avatar
纪泽龙 committed
23 24 25 26
                  {{ scope.row.detectorCode }}
                </div>
              </template>
            </el-table-column>
纪泽龙's avatar
纪泽龙 committed
27
            <el-table-column prop="detectorName" label="设备名称" width="120">
纪泽龙's avatar
纪泽龙 committed
28
              <template slot-scope="scope">
纪泽龙's avatar
纪泽龙 committed
29
                <div :title="scope.row.detectorName" class="ddd" v-unValue>
纪泽龙's avatar
纪泽龙 committed
30 31 32 33 34 35
                  {{ scope.row.detectorName }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="medium" label="监测介质" width="">
              <template slot-scope="scope">
纪泽龙's avatar
纪泽龙 committed
36
                <div v-unValue>{{ scope.row.medium }}</div>
纪泽龙's avatar
纪泽龙 committed
37 38 39
              </template>
            </el-table-column>
            <el-table-column prop="linkman" label="联系人" width="100">
纪泽龙's avatar
纪泽龙 committed
40 41 42
              <template slot-scope="scope">
                <div v-unValue>{{ scope.row.linkman }}</div>
              </template>
纪泽龙's avatar
纪泽龙 committed
43 44 45 46 47
            </el-table-column>
            <el-table-column prop="phone" label="联系电话" width="">
            </el-table-column>
            <el-table-column prop="detectorStatus" label="设备状态" width="100">
            </el-table-column>
纪泽龙's avatar
纪泽龙 committed
48
            <el-table-column prop="alarmTime" label="预警时间" width="180">
纪泽龙's avatar
纪泽龙 committed
49
              <template slot-scope="scope">
纪泽龙's avatar
纪泽龙 committed
50
                <div v-unValue>{{ scope.row.alarmTime }}</div>
纪泽龙's avatar
纪泽龙 committed
51 52 53 54 55 56 57 58 59 60
              </template>
            </el-table-column>
          </el-table>
          <div>
            <el-pagination
              @current-change="handleCurrentChangvale"
              :page-size="pageSize"
              layout="prev, pager, next, jumper"
              :total="total"
              :hide-on-single-page="total <= pageSize"
纪泽龙's avatar
纪泽龙 committed
61
              :key="total + '' + pageSize"
纪泽龙's avatar
纪泽龙 committed
62 63 64 65 66 67 68 69 70 71
            >
            </el-pagination>
          </div>
        </div>
      </div>
    </div>
  </transition>
</template>

<script>
纪泽龙's avatar
纪泽龙 committed
72 73
// import Velocity from "velocity-animate";
// import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
74
import { listDetectorInfo } from "@/api/detector/detectorInfo";
纪泽龙's avatar
纪泽龙 committed
75 76 77 78 79

export default {
  props: {
    detcetorList: {
      type: Array,
80
      default: () => [],
纪泽龙's avatar
纪泽龙 committed
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
    },
    show: {
      type: Boolean,
    },
    title: {
      type: String,
    },
    userId: {
      type: [Number, String],
    },
    total: {
      type: Number,
    },
    pageSize: {
      type: Number,
    },
  },
  data() {
    return {
      // 动画效果的切换
纪泽龙's avatar
纪泽龙 committed
101
      // tableHeight: 600,
纪泽龙's avatar
纪泽龙 committed
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
      tableData: [
        // {
        //   deviceCode: "2016-05-05",
        //   name: "王小虎",
        //   province: "上海",
        //   city: "普陀区",
        //   address: "上海市普陀区金沙江路",
        // },
      ],
    };
  },
  created() {
    console.log("list", this.detcetorList);
    // this.getList();
  },
  watch: {
    // 当组件显示的时候
    detcetorList(newData) {
      // console.log(bol);
      // if (bol) {
      console.log(newData);
      this.tableData = [...newData];
纪泽龙's avatar
纪泽龙 committed
124

纪泽龙's avatar
纪泽龙 committed
125 126 127 128 129 130 131 132 133
      // }
    },
  },

  methods: {
    handleSizeChange(val) {
      console.log(val);
    },
    handleCurrentChangvale(val) {
纪泽龙's avatar
纪泽龙 committed
134
      this.$parent.getDetectorInfoList(
135
        listDetectorInfo,
纪泽龙's avatar
纪泽龙 committed
136 137 138 139 140 141 142
        {
          userId: this.userId,
          pageNum: val,
          pageSize: this.pageSize,
        },
        this.title
      );
纪泽龙's avatar
纪泽龙 committed
143 144
    },
    close() {
纪泽龙's avatar
纪泽龙 committed
145
      // this.fade = "fade";
146
      this.$parent.userCenterShow = false;
纪泽龙's avatar
纪泽龙 committed
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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 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 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
    },
  },
};
</script>

<style lang="scss"  scoped>
.wrapper {
  // width: 978px;
  max-height: 600px;
  position: fixed;
  top: 50%;
  left: 50%;
  margin-top: -300px;
  margin-left: -500px;
  // background-color: #fff;
  display: flex;
  justify-content: space-between;
  z-index: 9999;

  & > div {
  }
  .left {
    // width: 100px;
    max-height: 598px;
    margin-right: 12px;
    // box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.16);
    // background-color: #fff;
    // color: #fff;
    font-size: 14px;
    font-weight: 400;
    .title-wrapper {
      width: 100%;
      height: 30px;
      display: flex;
      justify-content: space-between;
      background: #1890ff;
      padding: 5px;
      .title {
        width: 100%;
        color: #fff;
        text-align: center;
      }
      .close {
        box-sizing: border-box;
        padding-top: 2px;
        padding-right: 5px;
        cursor: pointer;
      }
    }
    .el-table__body-wrappe {
      height: 140px !important;
    }
    .top {
      height: 19px;
      // background-color: #053b6a;
      color: #fff;
      // line-height: 32px;
      // padding-left: 12px;
      position: relative;

      .title {
        position: absolute;
        left: 50%;
        margin-left: -92px;
        top: -5px;
      }
      .repeat {
        position: absolute;
        top: -5px;
        right: 160px;
        color: #fff;
        cursor: pointer;
        &:hover {
          color: #2788ea;
        }
      }
      .repeat2 {
        position: absolute;
        right: 206px;
        color: #67c23a;
      }
      .more {
        position: absolute;
        right: 38px;
        top: -5px;
        color: #fff;
        float: right;
        margin-right: 20px;
        cursor: pointer;
        &:hover {
          color: #2788ea;
        }
      }
    }
    .bottom {
      width: 1000px;
      margin: 0 auto;
      position: relative;
    }
  }
  .right {
    width: 740px;
    display: flex;
    flex-wrap: wrap;
    // justify-content: space-between;
    align-content: flex-start;
    // margin-top: 7px;
    & > .right-content {
      background-color: #fff;
      width: 238px;
      height: 82px;
      margin-bottom: 29px;
      box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.16);
      margin-right: 10px;
      display: flex;
      &.three {
        margin-right: 0px;
      }
      // align-items: center;
      .text-icon {
        line-height: 82px;
        padding-left: 22px;
        margin-right: 22px;
        i {
          color: #053b6a;
          font-size: 60px;
        }
      }
      .text {
        font-size: 14px;
        padding-top: 16px;
        .top {
          color: #000;
          margin-bottom: 10px;
          font-weight: 600;
        }
        .bottom {
          color: #2788ea;
        }
      }
    }
  }

  .iconfont {
    cursor: pointer;
  }
  // 单独调整下最后一个icon的大小
  .iconFontSize {
    font-size: 50px !important;
  }
}
</style>