ContractChannelPoster.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div>
  3. <el-dialog title="二维码预览" :visible.sync="dialogVisible" width="50%" top="5vh">
  4. <div class="dia_out">
  5. <!-- <el-image class="image_class" :src="url" /> -->
  6. <el-image class="image_class" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" />
  7. </div>
  8. <span slot="footer" class="dialog-footer">
  9. <el-button type="info" round @click="downLoadImage" >下载</el-button>
  10. <el-button type="primary" round @click="dialogVisible = false">确 定</el-button>
  11. </span>
  12. </el-dialog>
  13. </div>
  14. </template>
  15. <script>
  16. import { oSessionStorage } from "../utils/utils";
  17. import { basePath } from "../utils/http";
  18. export default {
  19. data() {
  20. return {
  21. dialogVisible: false,
  22. channelId: "",
  23. url: "http://10.113.248.3:8086/file/show?filePath=./images/cloud.bef3ccbc.jpg",
  24. };
  25. },
  26. mounted() {},
  27. methods: {
  28. downLoadImage() {
  29. window.open(`${basePath}/file/download/${this.channelId}`)
  30. // this.$http.getDown(`/file/download/${this.channelId}`, {}, (res) => {
  31. // const url = window.URL.createObjectURL(new Blob([res.data])); // 创建一个URL对象
  32. // const link = document.createElement("a"); // 创建一个a标签
  33. // link.href = url; // 设置a标签的href属性为URL对象
  34. // link.setAttribute("download", "file.pdf"); // 设置a标签的download属性为要保存的文件名
  35. // document.body.appendChild(link); // 将a标签添加到DOM中
  36. // link.click(); // 模拟点击a标签进行下载
  37. // document.body.removeChild(link); // 下载完成后,移除a标签
  38. // });
  39. },
  40. open(val) {
  41. this.dialogVisible = true;
  42. this.channelId=val.channelId;
  43. this.url = basePath + "/file/show?filePath=" + val.poster;
  44. // this.queryById();
  45. },
  46. //调用查询接口
  47. // queryById() {
  48. // this.$http.get(`/sign/findById/${this.id}`, {}, (res) => {
  49. // // this.$toast.success({message:'成功'});
  50. // if (res && res.code == 200) {
  51. // //将值赋值给list
  52. // this.channelList = res.data;
  53. // } else {
  54. // this.$message.error(res.msg);
  55. // }
  56. // });
  57. // },
  58. },
  59. };
  60. </script>
  61. <style scope>
  62. .image_class {
  63. width: 270px;
  64. height: 480px;
  65. }
  66. .dia_out {
  67. /* text-align: center; */
  68. }
  69. </style>