feige
2025-05-20 1e264767dd2ac93e83b57b4e8e6626621fff4c6f
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
<template>
 
 
  <div>
    <div class="form-header mt">
      <h1 style="font-size:21px;padding-top:30px;display: flex;justify-content: space-between;align-items: center;" >
        <span>视频详情下载</span>
 
      </h1>
    </div>
    <li v-for="(item,index) in fileList">
          <el-link @click="handleDownload(fileLs[index])" type="success">{{fileList[index]}}-------下载</el-link>
    </li>
      <!--  <h4 class="form-header"> </h4>
        <div style="margin-left: 20px;">
           <el-link :href="'/register'" class="psf" type="success">注册             </el-link>
                <el-link :href="'/login'" type="success">登录</el-link>
        </div> -->
        
    <el-dialog 
         :visible.sync="msk" >
            <p class="op65">点击右上角按钮,然后在弹出的菜单中,点击在浏览器中打开,即可下载视频</p>
            
    </el-dialog>
  </div>
</template>
 
<script>
import {listFScan,getFScanInfo,addFScan,delFScan,getFSInfo,updateFScan, uploadPic, uploadPic1, download} from "@/api/fscan/index";
import {blobValidate} from "@/utils/ruoyi";
export default {
  // components: {
  //   pdf
  // },
  data() {
    return {
            fileList1:[],
          fileList:[],
          fileLs:[],
          pdfSrc: '',
          numPages: undefined,
          msk: false,
    }
  },
  mounted() {
 
    const id = (this.$route.query.id)
    //发起请求拿到pdfSrc
    let _this = this
    getFScanInfo(id).then(response => {
        
     
      //console.log(response)
     // if(response.msg=="操作成功")
      {
        console.log(response.data)
    ///    _this.pdfSrc= process.env.VUE_APP_BASE_TRUE_API+response.data.filePath;
        // alert(_this.pdfSrc)
        this.fileList1 = response.data.filePath.split(",");
        for(let i = 0; i < this.fileList1.length; i++)
        {
            if(this.fileList1[i].length!=0){
            this.fileLs.push(this.fileList1[i])
          var lsr = this.fileList1[i].split("/")
          var ls = lsr[lsr.length - 1].split("_")
          var lr = ls[ls.length-1].split(".")
          var pnam = ls[0] + "." + lr[lr.length-1]
          this.fileList.push(pnam)}
          
 
 
        }
        console.log(this.fileLs)
        console.log("--------------------")
        
        // alert(1234)
      }
   
      })
  },
  methods:{
      is_weixin() {
          var ua = navigator.userAgent.toLowerCase();
          if (ua.match(/MicroMessenger/i) == "micromessenger") {
              return true;
          } else {
              return false;
          }
      },
      handleDownload(url) {
 
        if (this.is_weixin()) {
            //alert(123)
              window.location = "www.bendudu.com"
            }
            else{
                this.msk = false;
            var formData = {'path':url.replace(process.env.VUE_APP_BASE_TRUE_API,"")};
            let lens = formData.path.split(".")
            let suffix = lens[lens.length-1] 
            console.log(formData)
            download(formData).then(async (response) => {
              const isLogin = await blobValidate(response);
              let nt = new Date().getTime()
              let filename = 'scods_'+nt+'.'+suffix
              const blob = new Blob([response])
              saveAs(blob, filename)
            })
        }
      },
  }
}
</script>
<style>
    li {
      list-style-type:none;
      margin-left:20px;
      padding:10px 20px;
      background:#fff;
 
      transition:all 0.3s ease;
    }
     li:hover {
      background:#ccc;
      color:#fff;
    }
    .psf{
      margin-right: 20px;
    }
    
    .block {
      width: 100%;
      height: 400px;
      background-color: gray;
      background-image: url("/live_weixin.png");//默认路劲为public下
      background-size: 100% 100%;
    }
    .blocks {
      width: 100%;
      height: 400px;
      background-color: gray;
      background-size: 100% 100%;
    }
</style>