licp
2024-04-26 0cba68c09447d2c21407b0ff0321b2cfd173552a
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
<template>
  <div class="notice-detail-page">
    <div class="notice-detail-head">
      <h4 style="margin-bottom: 16px;">{{ noticeInfo.theme }} <el-tag style="margin-left: 10px;" :type="options.find(m=>m.value==noticeInfo.messageType).type" v-if="options.find(m=>m.value==noticeInfo.messageType)">{{ options.find(m=>m.value==noticeInfo.messageType).label }}</el-tag></h4>
      <p style="font-size: 12px;color: #999;margin-bottom: 20px;">
        <!-- <span>消息类型:审批&nbsp; </span> -->
        <span>发送人:{{ noticeInfo.createUser }} </span>
        <span>&nbsp;&nbsp;</span>
        <span>收件人:{{ noticeInfo.consigneeUser }}</span>
        <span>&nbsp;&nbsp;</span>
        <span>发件时间:{{ noticeInfo.createTime }}</span>
      </p>
      <div class="notice-detail-head-content">
        <label>内容:</label>
        <div>{{ noticeInfo.content }}</div>
      </div>
    </div>
    <div class="info-box" v-if="noticeInfo.jumpPath">
      <!-- <component class="notice-content" :is="noticeInfo.jumpPath" style="height: 500px;" >
          </component> -->
    </div>
  </div>
</template>
 
<script>
const requireComponent = require.context("../view", false, /\.vue/);
var comObj = {};
requireComponent.keys().forEach(fileName => {
  var names = fileName
    .split("/")
    .pop()
    .replace(".vue", "");
  const componentConfig = requireComponent(fileName);
  comObj[names] = componentConfig.default || componentConfig;
});
export default {
  components: comObj,
  data() {
    return{
      noticeInfo:{},
      options:[]
    }
  },
  created(){
    this.noticeInfo = JSON.parse(sessionStorage.getItem("noticeInfo"));
  },
  mounted(){
    this.noticeInfo = JSON.parse(sessionStorage.getItem("noticeInfo"));
    this.$bus.$on("change", (msg) => {
      this.noticeInfo = JSON.parse(msg);
      console.log(this.noticeInfo);
      sessionStorage.setItem("noticeInfo", msg);
    });
    this.getTypeDicts()
  },
  methods:{
    getTypeDicts() {
      this.$axios.post(this.$api.enums.selectEnumByCategory, {
        category: "消息类型"
      }).then(res => {
        let data = res.data
        this.options = data;
      })
    },
  }
}
</script>
 
<style scoped>
.notice-detail-page{
  height: calc(100vh - 120px);
  overflow-y: auto;
  padding-top: 16px;
}
.notice-detail-head{
  background: #fff;
  border-radius: 3px;
  box-sizing: border-box;
  padding: 16px;
}
.info-box{
  margin-top: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 20px 20px;
  background: rgba(148, 147, 147, 0.1);
  border-radius: 8px;
}
.notice-detail-head-content div{
  border-radius: 8px;
  border: 1px solid #ccc;
  min-height: 60px;
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
  margin-top: 12px;
}
</style>