Blame view

src/views/workflow/components/downLoad.vue 981 Bytes
renchao@pashanhoo.com committed
1 2 3
<!--
 * @Description: 页面提供插件下载
 * @Autor: renchao
4
 * @LastEditTime: 2023-07-25 09:25:56
renchao@pashanhoo.com committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
-->
<template>
  <div class='downLoad'>
    <p>{{formData}}是否下载文件?</p>
    <div>
      <el-button @click="$popupCacel">取消</el-button>
      <el-button type="primary" @click="handleDown">确定</el-button>
    </div>
  </div>
</template>
<script>
  export default {
    props: {
      formData: {
        type: Object,
        default: {}
      }
    },
    methods: {
24 25 26 27
      /**
       * @description: 
       * @author: renchao
       */
renchao@pashanhoo.com committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
      handleDown () {
        let a = document.createElement('a')
        a.style.display = 'none'
        a.setAttribute('download', 'bg.jpg')
        // a.href = require('../../../../public/')
        document.body.appendChild(a)
        console.log('href', a.href)
        a.click()
        document.body.removeChild(a)
      }
    }
  }
</script>
<style scoped lang='scss'>
  @import "~@/styles/public.scss";
</style>