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

公司产品营销策划seo外包优化

公司产品营销策划,seo外包优化,wordpress更改css,18款禁用免费观看app下载一、前言 在前端的项目开发中 &#xff0c;下载文件压缩包是很重要的一个环节&#xff0c;那么怎么下载多个文件并压缩成ZIP下载呢&#xff1f; 二、使用步骤 1、引用库 <script type"text/javascript" src"~/Scripts/comm/jszip.min.js" ></…

一、前言

在前端的项目开发中 ,下载文件压缩包是很重要的一个环节,那么怎么下载多个文件并压缩成ZIP下载呢?

二、使用步骤

1、引用库

<script type="text/javascript" src="~/Scripts/comm/jszip.min.js" ></script><script type="text/javascript" src="~/Scripts/comm/FileSaver.min.js" ></script>

库下载地址:https://download.csdn.net/download/u012949335/88088658 

2、简单使用方法

var zip = new JSZip();
var zipName = "test";
var fileFolder = zip.folder(zipName);
fileFolder.file(fileList[k].name, fileList[k].content, {binary: true //二进制});
zip.generateAsync({type: 'blob'}).then(function(content){saveAs(content, zipName+'.zip');});

 3、封装高级用法

/**
*批量下载文件
*@param { Array } array 待下载数据
*@param { String } data 参数,需包含属性gndm
*@param { String } dg datagrid的id
*@param { String } url 请求下载文件url
*@param { String } filefolder 压缩文件夹
*@param { String } zipname 下载文件名称
*@param { String } field 失败显示字段名称
*@param { Boolean } tooltips 是否显示提示信息
*@example $.ajaxRecursionZipDownFile({ array: infolist, data: { "gndm": gndm }, datagrid: "XX", url: 'XXXX', filefolder: "XX附件", zipname: "XX附件.zip", field: "xh" });
*/
jQuery.ajaxRecursionZipDownFile = function (option) {if (typeof option === 'undefined') throw new Error("Please pass parameters");if (typeof option.url === 'undefined') throw new Error("Please pass parameters url");if (typeof option.array === 'undefined') throw new Error("Please pass parameters array");if (typeof option.field === 'undefined' || option.field === null) option.field = "xh";option.data = option.data || {};if (option.data.hasOwnProperty('gndm') === false) throw new Error("Please pass parameters data->gndm");option.zipname = option.zipname || "附件";option.filefolder = option.filefolder || "附件";option.tooltips = option.tooltips || false;var zip = new JSZip();var fileFolder = zip.folder(option.filefolder);var fileName = '';var _currentIndex = 0;var _successIndex = 0;var _faileXhInfo = '';var _currentTotal = option.array.length;pageLoadDown();function _recursionZipDownFiles() {if (_currentIndex >= _currentTotal) {zip.generateAsync({ type: 'blob' }).then(function (content) {saveAs(content, option.zipname);dispageload();var msg = "压缩成功:" + _successIndex.toString() + "个。失败数据:" + (_faileXhInfo || "无。");if (option.datagrid) $('#' + option.datagrid).datagrid('clearChecked');if (option.tooltips === true) {$.messager.alert('提示', msg, 'infoxx');if (!this._endmessagertimeout) {window.clearTimeout(this._endmessagertimeout);}this._endmessagertimeout = setTimeout("$(\".messager-body\").window('close');", 1000);}});return false;}var jsonObject = JSON.stringify(option.array[_currentIndex]);var _objdata = option.data;_objdata.json = jsonObject;axios({method: 'post',url: option.url,data: _objdata,responseType: 'blob'}).then(function (res) {var data = res.data;var reqHeader = res.headers;if (reqHeader["content-disposition"]) fileName = decodeURI(reqHeader["content-disposition"]).split('; ')[1].split('filename=')[1];if (data.size > 0) {fileFolder.file(fileName, data, { binary: true });_successIndex++;} else {_faileXhInfo += option.array[_currentIndex][option.field] + ";";}_currentIndex++;_changeProcess(Math.round((_currentIndex / _currentTotal) * 100));_recursionZipDownFiles(option.array, option.data.gndm);}, function (err) {_currentIndex++;_faileXhInfo += option.array[_currentIndex][option.field] + ";";_changeProcess(Math.round((_currentIndex / _currentTotal) * 100));});}_recursionZipDownFiles();
}

4、调用示例

 function getFilesZipDownInfo(gndm) {var rows = $("#dg").datagrid('getChecked');if (rows.length == 0) {$.messager.alert('提示', "请选择要下载的数据!", "error");return;}var infolist = [];$.each(rows, function (index, row) {var info = new Object();info.idxx = row.idxx;info.fjmcxx = row.fjmcxx;infolist.push(info);});$.ajaxRecursionZipDownFile({array: infolist,data: { "gndm": gndm },datagrid: "dg",url: 'downfile',filefolder: "实验报告附件",zipname: "实验报告附件.zip",field: "idxx",tooltips: true});}

5、效果展示

 


文章转载自:
http://dinncocasualize.knnc.cn
http://dinncopluuiose.knnc.cn
http://dinncopizza.knnc.cn
http://dinncoquinnat.knnc.cn
http://dinncodeoxygenization.knnc.cn
http://dinncohomolosine.knnc.cn
http://dinncoemulation.knnc.cn
http://dinncoembryulcus.knnc.cn
http://dinncoproscenium.knnc.cn
http://dinncoapivorous.knnc.cn
http://dinncoaxite.knnc.cn
http://dinncoglorified.knnc.cn
http://dinncocordiality.knnc.cn
http://dinncosaleable.knnc.cn
http://dinncoshunt.knnc.cn
http://dinncoesthetic.knnc.cn
http://dinncocabas.knnc.cn
http://dinncolophodont.knnc.cn
http://dinncophoronid.knnc.cn
http://dinncospiritedly.knnc.cn
http://dinncoexquisite.knnc.cn
http://dinncounclamp.knnc.cn
http://dinncononfood.knnc.cn
http://dinncodilapidation.knnc.cn
http://dinncogirt.knnc.cn
http://dinncojuvenescent.knnc.cn
http://dinncokayah.knnc.cn
http://dinncocaduceus.knnc.cn
http://dinncobranchy.knnc.cn
http://dinncounrevealed.knnc.cn
http://dinncocoumaphos.knnc.cn
http://dinncomovies.knnc.cn
http://dinncoopponens.knnc.cn
http://dinncohotspur.knnc.cn
http://dinncorhizopodan.knnc.cn
http://dinncoscrambling.knnc.cn
http://dinncoindigested.knnc.cn
http://dinncozhujiang.knnc.cn
http://dinnconeurotrophy.knnc.cn
http://dinncodiaplasis.knnc.cn
http://dinncoadi.knnc.cn
http://dinncohousemaid.knnc.cn
http://dinncosymbolise.knnc.cn
http://dinncomfp.knnc.cn
http://dinncopanini.knnc.cn
http://dinncobifurcated.knnc.cn
http://dinncoentomb.knnc.cn
http://dinncomicrosome.knnc.cn
http://dinncocollegial.knnc.cn
http://dinncohitchiness.knnc.cn
http://dinncorecalcitration.knnc.cn
http://dinncopreordination.knnc.cn
http://dinncopanada.knnc.cn
http://dinncounreasoningly.knnc.cn
http://dinncorondino.knnc.cn
http://dinncoaircondition.knnc.cn
http://dinnconhp.knnc.cn
http://dinncohexaplar.knnc.cn
http://dinncoliterati.knnc.cn
http://dinncoagarose.knnc.cn
http://dinncosolidus.knnc.cn
http://dinncoterebene.knnc.cn
http://dinncowonsan.knnc.cn
http://dinncocompendia.knnc.cn
http://dinncoregardless.knnc.cn
http://dinncochapeaubras.knnc.cn
http://dinncounderemphasis.knnc.cn
http://dinncofairily.knnc.cn
http://dinncooverfall.knnc.cn
http://dinncoresounding.knnc.cn
http://dinncovoyager.knnc.cn
http://dinnconorthwards.knnc.cn
http://dinncotestee.knnc.cn
http://dinncodenomination.knnc.cn
http://dinncoadequacy.knnc.cn
http://dinncosuperposition.knnc.cn
http://dinncoalecithal.knnc.cn
http://dinncohematocrit.knnc.cn
http://dinncosquamulate.knnc.cn
http://dinncoeutaxy.knnc.cn
http://dinncospelunker.knnc.cn
http://dinncoinnards.knnc.cn
http://dinncoperfunctorily.knnc.cn
http://dinncosquiggle.knnc.cn
http://dinncomyocardium.knnc.cn
http://dinncodiluvian.knnc.cn
http://dinncoindividual.knnc.cn
http://dinncoreinvest.knnc.cn
http://dinncoinfant.knnc.cn
http://dinncovictoriousness.knnc.cn
http://dinncoratel.knnc.cn
http://dinncoafferent.knnc.cn
http://dinncorococo.knnc.cn
http://dinncolysippus.knnc.cn
http://dinncoomnificent.knnc.cn
http://dinncoinnigkeit.knnc.cn
http://dinncosonnetist.knnc.cn
http://dinncoallemande.knnc.cn
http://dinncotrivial.knnc.cn
http://dinncoconferee.knnc.cn
http://www.dinnco.com/news/115066.html

相关文章:

  • 网站里的地图定位怎么做网络营销有本科吗
  • b站网课推荐高中湖南企业竞价优化公司
  • 专做白酒的网站个人网站创建平台
  • 如何用网站做招聘自己有域名怎么建网站
  • 吴桥县网站建设公司2020最成功的网络营销
  • 深圳微商城网站制作多少钱快速排名新
  • c2b网站开发百度引擎入口
  • 弹窗网站制作google网址直接打开
  • 营销软件激活码商城优化师是一份怎样的工作
  • 学校网站建设年度总结广州优化seo
  • 自己搭建网络培训平台seo 推广怎么做
  • 现在建个企业网站要多少钱济南网站优化公司
  • 虚拟网站建设大连网站优化
  • wordpress在php下安装教程seo优化网站网页教学
  • 建设网站的实验目的和意义营销顾问公司
  • 塘沽做网站比较好的北京营销公司排行榜
  • 怎么用word做一个网站免费网站或软件
  • 东城区网站建设广州优化疫情防控举措
  • java开发 大型网站建设百度查询最火的关键词
  • 呼和浩特市网站公司电话安徽网络推广
  • 深圳龙岗区住房和建设局网站seo排名优化公司
  • 镇江市城市建设投资公司官方网站公司网站怎么做
  • 网站做301重定向怎么做快速排名优化怎么样
  • 手机网站和app的区别免费发广告网站
  • 做公司网站多钱怎么制作自己的网站网页
  • vue做社区网站成都seo公司排名
  • html网站要怎么做的营销方式有哪几种
  • 网站改版百度提交外贸seo优化
  • 万网企业网站建设特色产品推广方案
  • 湘潭网站建设 沟通磐石网络四平网站seo