hcong
2024-11-08 d7d7da5c09340eafcd2e2c672e6b2c001a4cc0be
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
<template>
    <el-descriptions :column="2" size="default" border>
      <el-descriptions-item label="区域">
        {{ locationStr }}
      </el-descriptions-item>
      <el-descriptions-item label="时间"> {{ time }} </el-descriptions-item>
      <el-descriptions-item label="描述">
        <span class="description"> {{ description }} </span>
      </el-descriptions-item>
    </el-descriptions>
  </template>
  <script>
  import dayjs from 'dayjs';
  export default {
    computed: {
      description() {
        let result = ''
        return result
      },
      locationStr() {
        let result = '';
        if (this.location.pName) {
          // result += this.location.pName;
          if (this.location.cName) {
            result += this.location.cName;
            if (this.location.dName) {
              result += this.location.dName;
              if (this.location.tName) {
                result += this.location.tName;
              }
            }
          }
        }
        if (result == '') {
          if (this.location.pName) {
            result += this.location.pName;
          }
        }
        return result;
      },
      time() {
        if (!this.tableData || this.tableData.length == 0) {
          return '';
        } else {
          return dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
        }
      }
    },
    props: {
      location: {},
      tableData: []
    },
    data() {
      return {
        description: ''
      };
    }
  };
  </script>
  <style scoped></style>