tanghaolin
2022-07-28 62aa8e0f0b366bc131309b72e1350d800d30be72
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
<template>
  <div>
    <div style="display: flex; margin-top: 0.1rem">
      <van-col :span="8">
        <div class="table_box">
          <div class="content2 table_head" style="border-top: 1px solid #e9e9e9">{{$t('ebookPage.type.TR')}}</div>
        </div>
      </van-col>
      <van-col :span="10">
        <div class="table_box">
          <div class="content2 table_head" style="border-top: 1px solid #e9e9e9">{{$t('ebookPage.name.TR')}}</div>
        </div>
      </van-col>
      <van-col :span="6">
        <div class="table_box">
          <div class="content3 table_head" style="border-top: 1px solid #e9e9e9">{{$t('ebookPage.operation.TR')}}</div>
        </div>
      </van-col>
    </div>
    <div
      style="display: flex; flex-direction: column"
      v-for="(file_item, file_index) in m_AttachFilesList"
      :key="'fileTable' + file_index"
    >
      <div style="width: 100%">
        <van-col :span="24" style="display: flex; width: 100%">
          <van-col :span="8">
            <div class="table_box">
              <div class="content2">{{ file_item.AttachType }}</div>
            </div>
          </van-col>
          <van-col :span="10" style="display: flex">
            <div class="table_box">
              <div class="content2" style="white-space: nowrap;">{{ file_item.Name }}</div>
            </div>
          </van-col>
          <van-col :span="6" style="display: flex">
            <div class="table_box">
              <div class="content3" style="color:rgb(99, 150, 194);">
                <a @click="downFileDoc(file_item)">{{$t('ebookPage.download.TR')}}</a>
              </div>
            </div>
          </van-col>
        </van-col>
      </div>
    </div>
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      m_AttachFilesList: [], //文档列表
      SeriesID: ""
    };
  },
  methods: {
    initAttachFiles(data, seriesID) {
      // console.log(data,95)
      data.forEach(element => {
        element.DsFileName =
          this.$globalConfig.WebApiUrl.FileUrl +
          "Series" +
          seriesID +
          "/" +
          element.DsFileName;
      });
      this.m_AttachFilesList = data;
    },
    getSeriesID(ID) {
      this.SeriesID = ID;
    },
    downFileDoc(fileData) {
      // console.log(fileData,75)
      var userID = this.$store.state.instante.account.UserID;
      if (userID == null || userID == 0) {
        this.m_isShowLoadingFrm = false;
        this.$store.commit(
          "instante/account/preLoginPageRoute",
          this.$route.fullPath
        );
        this.$store.dispatch("instante/account/logout");
        return;
      }
    
      this.initFileDownLog(fileData);
      window.open(fileData.DsFileName, "_blank");
    },
    //初始化附件下载日志
    initFileDownLog(FileData) {
      let url =
        this.$globalConfig.WebApiUrl.MainUrl + "v1/FileDownLog/AddSeriesAttachLog";
      this.$axios({
        method: "post",
        url: url,
        data: {
          UserType: this.$store.state.instante.account.UserType,
          UserID: this.$store.state.instante.account.UserID,
          SoftType: this.$globalConfig.SoftType,
          Lang: FileData.Language,
          FileID: FileData.ID,
          SeriesID: this.SeriesID,
          FileName: FileData.Name
        }
      })
        .then(res => {
          // console.log(res);
        })
        .catch(err => {
          console.log(err);
        });
    }
  }
};
</script>
 
<style lang="scss">
.table_box {
  width: 99%;
  height: 30px;
  display: flex;
  border-left: 1px solid #e9e9e9 !important;
  border-bottom: 1px solid #e9e9e9 !important;
  .content2 {
    width: 100%;
    height: 100%;
    line-height: 30px;
    text-align: center;
    background-color: #fff;
    border-top: 1px solid #e9e9e9 !important;
    // border-right: 1px solid #e9e9e9;
    border-bottom: 1px solid #e9e9e9 !important;
    color: #000000;
    font-size: 12px;
    .van-cell {
      padding: 0;
      line-height: 30px;
      input {
        text-align: center;
      }
    }
  }
  .content3 {
    width: 100%;
    height: 100%;
    line-height: 30px;
    text-align: center;
    background-color: #fff;
    border-top: 1px solid #e9e9e9 !important;
    border-right: 1px solid #e9e9e9 !important;
    border-bottom: 1px solid #e9e9e9 !important;
    color: #000000;
    font-size: 12px;
  }
  .table_head {
    border-top: 1px solid #e9e9e9 !important;
    border-bottom: 1px solid #e9e9e9 !important;
  }
}
</style>