杨磊
4 天以前 ef37c59e055a990ce247b265b27d3fcef430a243
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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
<template>
  <div class="contentBox">
    <div class="crumbs">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <div v-if="this.$route.query.type == 'aboutUs'">
          <el-breadcrumb-item
            :to="{
              name: 'aboutUs-index',
            }"
            >关于我们</el-breadcrumb-item
          >
          <el-breadcrumb-item
            :to="{
              name: 'aboutUs-index',
              query: { aboutUs: 3 },
            }"
            >大事记</el-breadcrumb-item
          >
          <el-breadcrumb-item>{{ data.name }}</el-breadcrumb-item>
        </div>
        <div v-else>
          <el-breadcrumb-item :to="{ name: 'informationCenter-index' }"
            >本社资讯</el-breadcrumb-item
          >
          <el-breadcrumb-item
            :to="{
              name: 'informationCenter-index',
              query: { tabsSelected: this.$route.query.tabsSelected },
            }"
            >{{
              this.$route.query.tabsSelected == 0 ? "本社资讯" : "本社通知"
            }}</el-breadcrumb-item
          >
        </div>
      </el-breadcrumb>
    </div>
    <div class="bgcfff" v-loading="reLoading">
      <el-empty
        description="暂无数据"
        class="empty"
        :image-size="200"
        v-if="data.length == 0"
      ></el-empty>
      <div v-else>
        <div :title="data.name" class="tabs">
          <div>
            {{ data.name }}
          </div>
        </div>
        <div class="borderButtom"></div>
        <div class="wrap">
          <div class="author">
            <span v-if="data.caupress_publishDate">{{
              moment(data.caupress_publishDate).format("YYYY-MM-DD")
            }}</span>
            <span v-if="data.caupress_author"
              >作者:{{ data.caupress_author }}</span
            >
          </div>
          <div class="richTextBox" v-html="data.caupress_content"></div>
          <div class="attaText" v-if="fileList.length > 0">附件:</div>
          <div class="attachment" v-if="fileList.length > 0">
            <div
              class="itemBox"
              v-for="(item, index) in fileList"
              :key="index"
              @click="download(item)"
            >
              <div class="fileName">{{ item.FileList[0].FileName }}</div>
              <i class="el-icon-download"></i>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
export default {
  name: "home",
  data() {
    return {
      data: [],
      reLoading: true,
      fileList: [],
    };
  },
  created() {
    scrollTo(0, 0);
    this.getData();
  },
  methods: {
    getData() {
      this.reLoading = true;
 
      let query = {
        path: this.$route.query.path,
        fields: {
          caupress_publishDate: [],
          caupress_author: [],
          caupress_content: [],
        },
        filterList: {
          caupress_file: [],
        },
        itemId: this.$route.query.id,
      };
 
      this.MG.resource.getItem(query).then((res) => {
        this.data = res.datas[0];
        console.log(JSON.parse(this.data.datas.caupress_file));
        if (this.data.datas.caupress_file) {
          this.fileList = JSON.parse(this.data.datas.caupress_file);
        }
        this.reLoading = false;
      });
    },
    download(item) {
      let url =
        this.config.requestCtx + "/file/api/ApiDownload?md5=" + item.Value;
      window.open(url, "_blank");
    },
  },
};
</script>
 
<style lang="less" scoped>
.attaText {
  margin-top: 50px;
}
.attachment {
  display: flex;
  align-items: center;
  margin-top: 10px;
  flex-flow: wrap;
  .itemBox {
    margin-left: 20px;
    margin-top: 20px;
    border: 2px solid #d8d8d8;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    cursor: pointer;
    .fileName {
      width: 200px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}
.contentBox {
  padding-bottom: 120px;
  .crumbs {
    padding: 35px 0;
    line-height: 70px;
  }
  .bgcfff {
    background-color: #fff;
    .tabs {
      font-size: 30px;
      padding-top: 50px;
      padding-bottom: 30px;
      line-height: 50px;
      padding-left: 20px;
      padding-right: 20px;
      align-items: center;
      font-weight: 700;
      color: #999999;
      border-bottom: 2px solid #e6e6e6;
      text-align: center;
      color: #333333;
    }
    .borderButtom {
      width: 300px;
      margin: 0 auto;
      margin-top: -2px;
      border-bottom: 2px solid #00873c;
    }
    .wrap {
      min-height: 300px;
      padding: 0 20px 20px 20px;
      .author {
        text-align: right;
        line-height: 60px;
        color: #999999;
        font-size: 18px;
        letter-spacing: 0.45px;
        span {
          margin-left: 40px;
        }
      }
    }
  }
}
</style>