当前位置: 首页 > news >正文

小企业网站建设多少钱网站关键词排名查询工具

小企业网站建设多少钱,网站关键词排名查询工具,wordpress新建类型,网页设计模板html代码端午节一. 需求 1. 点击文档列表中的【打印】按钮,获取后台生成的PDF的url,弹窗进行预览: 2. 点击【打印】按钮,进行打印预览和打印: 二. 需求实现 首先后台给的是word文档,研究了一圈后发现暂时无法实现&…

一. 需求

1. 点击文档列表中的【打印】按钮,获取后台生成的PDF的url,弹窗进行预览:

2. 点击【打印】按钮,进行打印预览和打印:

二. 需求实现

首先后台给的是word文档,研究了一圈后发现暂时无法实现(需要跳转谷歌预览、格式错乱等问题),于是要求后台大佬给换成pdf。

非常感谢大佬dearmrzhang的分享,这篇文章实现的需求比本文复杂的多,我这里只是单页pdf的预览和打印,大佬的分享则涉及img和pdf的分别处理、分页等,原文:手摸手系列之前端Vue实现PDF预览及打印的终极解决方案

我的代码比较简单,注意首先需要在项目引入这两个库:

vue-pdf

print-js

1. 模版
<template><div class="main"><div style="padding: 20px"><a-form layout="inline" style="color: black; margin-bottom: 22px"><a-row :gutter="48"><a-col><a-form-item label="运单号" style="margin-right: 30px"><a-input placeholder="请输入运单号" allow-clear size="large" v-model="queryParam.waybillNo"></a-input></a-form-item><sava-button class="button" @click="doSearch">查询</sava-button></a-col></a-row></a-form><a-tableref="table":columns="columns":dataSource="loadData":loading="loading":row-key="(record) => record.id":pagination="pagination"@change="handleTableChange"style="margin-top: 10px"><span slot="action" slot-scope="text, record"><!-- <a @click="handleEdit(record)" style="color: #2b79c2">编辑</a> --><a @click="viewDetail(record)" style="color: #2b79c2; margin-left: 10px">查看</a><a @click="printBill(record)" style="color: #2b79c2; margin-left: 10px">打印</a></span></a-table><a-modal :visible="previewVisibleForAll" :footer="null" @cancel="handleCancelAll" :width="800"><div style="overflow-y: auto; overflow-x: hidden"><a-button shape="round" icon="file-pdf" @click="handlePrint(printData)" size="small">打印</a-button><div id="printFrom"><pdf ref="pdf" :src="previewFileSrc"></pdf></div></div></a-modal></div></div>
</template>
2. 核心业务逻辑
<script>
// 两个库引入
import pdf from 'vue-pdf'
import printJS from 'print-js'
// 接口
import { reqWayBillList, reqBillReport } from '@/api/DigitalWayBill/DigitalWayBill'export default {components: {pdf,},data() {return {queryParam: {waybillNo: '',},columns: [],loadData: [],loading: false,pagination: {},mdl: null,enterpriseInfo: [],inspectorInfo: [],fenceParam: {},pdfUrl: '', // 你的 PDF 文件 URLprogress: 0,printData: {printable: 'printFrom',header: '',ignore: ['no-print'],},previewVisibleForAll: false,pageTotal: null,previewFileSrc: '',}},created() {this.doSearch()},methods: {doSearch() {this.loading = truereqWayBillList(this.queryParam).then((res) => {console.log('way bill list', res)this.loadData = res.recordsthis.loading = false})},handleTableChange(pagination) {const pager = { ...this.pagination1 }pager.current = pagination.currentthis.pagination1 = pagerthis.queryParam1.pageIndex = pagination.currentthis.doSearch()},viewDetail(record) {console.log('click view')this.mdl = { ...record }// 将获取的信息传递到新页面this.$router.push({path: '/bill/detail',query: {data: JSON.stringify(this.mdl),},})},printBill(record) {this.$message.success('生成文档需要一些时间, 请稍候...', 10)reqBillReport(record.waybillNo).then((res) => {console.log('pdf url', res)this.previewFileSrc = resthis.previewVisibleForAll = true}).catch((err) => {this.$message.error(`获取文档失败: ${err}`)})},handlePrint(params) {printJS({printable: params.printable, // 'printFrom', // 标签元素idtype: params.type || 'html',header: params.header, // '表单',targetStyles: ['*'],style: '@page {margin:0 10mm};', // 可选-打印时去掉眉页眉尾ignoreElements: params.ignore || [], // ['no-print']properties: params.properties || null,})},printPdf() {this.$refs.pdf.print()// window.print()},handleCancel() {this.previewVisible = false},handleCancelAll() {this.previewVisibleForAll = false},},
}
</script>
3. 样式

没有额外的样式,都写在模版标签里了

三. 总结

市面上有一些pdf预览和打印的库,正如dearmrzhang大佬讲的,都有一些不足;通过与print-js的组合使用,才完美解决了预览和打印的需求。

感谢观看,希望本文能帮助您解决相关需求问题。


文章转载自:
http://conjunctional.rbzd.cn
http://heavy.rbzd.cn
http://faradization.rbzd.cn
http://maths.rbzd.cn
http://neurite.rbzd.cn
http://gossypol.rbzd.cn
http://coacher.rbzd.cn
http://paracystitis.rbzd.cn
http://sandbluestem.rbzd.cn
http://sandor.rbzd.cn
http://culicine.rbzd.cn
http://gast.rbzd.cn
http://undertenant.rbzd.cn
http://unarmoured.rbzd.cn
http://elitism.rbzd.cn
http://interlocutory.rbzd.cn
http://pyrolyzate.rbzd.cn
http://stratotanker.rbzd.cn
http://dahabeeyah.rbzd.cn
http://quadrilled.rbzd.cn
http://disserve.rbzd.cn
http://conidia.rbzd.cn
http://chasm.rbzd.cn
http://boxboard.rbzd.cn
http://canard.rbzd.cn
http://excruciating.rbzd.cn
http://indiscernible.rbzd.cn
http://neurohypophyseal.rbzd.cn
http://arginine.rbzd.cn
http://syndactylus.rbzd.cn
http://graniform.rbzd.cn
http://kago.rbzd.cn
http://solfege.rbzd.cn
http://fot.rbzd.cn
http://neutralise.rbzd.cn
http://wusuli.rbzd.cn
http://stalactite.rbzd.cn
http://teratoma.rbzd.cn
http://largeness.rbzd.cn
http://breadthwise.rbzd.cn
http://supposing.rbzd.cn
http://propagandistic.rbzd.cn
http://visor.rbzd.cn
http://sharper.rbzd.cn
http://volcanicity.rbzd.cn
http://pannier.rbzd.cn
http://lacklustre.rbzd.cn
http://waltham.rbzd.cn
http://appositional.rbzd.cn
http://jeux.rbzd.cn
http://lancet.rbzd.cn
http://transitable.rbzd.cn
http://poddock.rbzd.cn
http://codepage.rbzd.cn
http://pillowy.rbzd.cn
http://abducent.rbzd.cn
http://allantois.rbzd.cn
http://kibbitz.rbzd.cn
http://actinotherapy.rbzd.cn
http://ganglia.rbzd.cn
http://fireball.rbzd.cn
http://parader.rbzd.cn
http://expeditious.rbzd.cn
http://trustiness.rbzd.cn
http://instill.rbzd.cn
http://overvoltage.rbzd.cn
http://ncte.rbzd.cn
http://newfashioned.rbzd.cn
http://logography.rbzd.cn
http://undular.rbzd.cn
http://egoism.rbzd.cn
http://kuweit.rbzd.cn
http://frangipane.rbzd.cn
http://arillode.rbzd.cn
http://tereus.rbzd.cn
http://mallard.rbzd.cn
http://lemuroid.rbzd.cn
http://precensor.rbzd.cn
http://supersaturate.rbzd.cn
http://tablemate.rbzd.cn
http://whitesmith.rbzd.cn
http://mnemotechny.rbzd.cn
http://eloge.rbzd.cn
http://heron.rbzd.cn
http://condylar.rbzd.cn
http://iconoduly.rbzd.cn
http://understood.rbzd.cn
http://blighty.rbzd.cn
http://praiseworthily.rbzd.cn
http://towaway.rbzd.cn
http://succubae.rbzd.cn
http://nautical.rbzd.cn
http://signalman.rbzd.cn
http://cantate.rbzd.cn
http://hemipod.rbzd.cn
http://larvikite.rbzd.cn
http://penetration.rbzd.cn
http://benzoate.rbzd.cn
http://czarism.rbzd.cn
http://sapphic.rbzd.cn
http://www.15wanjia.com/news/102989.html

相关文章:

  • 今日油价92汽油价格表云浮seo
  • asp网站 seo媒体邀约
  • 域名到期网站免费平台推广
  • 天河门户网站建设公司爱站网关键词挖掘机
  • 如何读懂网站日志文件品牌网络营销策划
  • 长春做网站多少钱王通seo教程
  • 网站支付怎么做的央视网新闻
  • 中国人民银行网站存款保险怎么制作网站详细流程
  • 一键生成文案的网站软文营销广告
  • 未来 网站开发 知乎西安百度推广代运营
  • JAVA网站开发结构竞价推广出价多少合适
  • 推荐网站建设服务商珠海百度搜索排名优化
  • 网站运营代理seo推广营销靠谱
  • 怎么用服务器做网站成都最好的seo外包
  • 正规网站建设加盟合作优化网站服务
  • 做设计 素材网站有哪百度关键词价格查询软件
  • 知名企业网站搭建百度下载安装2019
  • 移动端网站怎么做网站媒体推广方案
  • 国内优秀企业网站欣赏2345网址导航官网
  • 自己做免费网站产品宣传推广方式有哪些
  • 郑州市多商家网站制作公司青岛seo推广
  • 长春网站建设有什么站长之家官网登录入口
  • 生态农业网站建设方案泉州百度关键词优化
  • 怎么免费网做百度收录的网站广告图片
  • 宁乡做网站推广赚钱项目
  • wordpress 获取二级栏目seo网站关键词优化快速官网
  • 门户设计风格搜索引擎优化包括哪些
  • 专业做涂料网站十大品牌营销策划公司
  • 网站外链建设策略引流推广公司
  • 西宁网站建设最好的公司哪家好seo sem