This commit is contained in:
parent
39e06e08a7
commit
11caa29bb8
|
@ -3,11 +3,11 @@ ENV = 'development'
|
|||
# http://192.168.1.43:8324/admin
|
||||
# http://mer.crmeb.net/admin
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'http://192.168.1.50:8080'
|
||||
VUE_APP_BASE_API = 'https://api.tropjoin.com/'
|
||||
# VUE_APP_BASE_API = 'https://plus.hwms.shop'
|
||||
|
||||
# socket 连接地址
|
||||
VUE_APP_WS_URL = 'ws://192.168.1.50:8080'
|
||||
VUE_APP_WS_URL = 'ws://https://api.tropjoin.com/'
|
||||
# VUE_APP_WS_URL = 'ws://plus.hwms.shop'
|
||||
|
||||
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||
|
|
|
@ -90,6 +90,7 @@
|
|||
"vuedraggable": "2.20.0",
|
||||
"vuex": "3.1.0",
|
||||
"wangeditor": "^4.7.12",
|
||||
"worker-loader": "^3.0.8",
|
||||
"xlsx": "0.14.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -183,7 +183,7 @@ export default {
|
|||
info: [
|
||||
{
|
||||
title: '标题',
|
||||
value: '促销单品',
|
||||
value: '特惠专区',
|
||||
tips: '选填,不超过4个字',
|
||||
max: 4
|
||||
},
|
||||
|
|
|
@ -230,7 +230,7 @@ export default {
|
|||
info: [
|
||||
{
|
||||
title: '标题',
|
||||
value: '促销单品',
|
||||
value: '特惠专区',
|
||||
tips: '选填,不超过4个字',
|
||||
max: 4
|
||||
},
|
||||
|
@ -247,7 +247,7 @@ export default {
|
|||
info: [
|
||||
{
|
||||
title: '标题',
|
||||
value: '促销单品',
|
||||
value: '特惠专区',
|
||||
tips: '选填,不超过4个字',
|
||||
max: 4
|
||||
},
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>iconfont Demo</title>
|
||||
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
|
||||
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
|
||||
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"
|
||||
type="image/x-icon" />
|
||||
<link rel="icon" type="image/svg+xml"
|
||||
href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" />
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
|
||||
<link rel="stylesheet" href="demo.css">
|
||||
<link rel="stylesheet" href="iconfont.css">
|
||||
|
@ -34,10 +37,12 @@
|
|||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main">
|
||||
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
|
||||
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
|
||||
<img width="200"
|
||||
src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
|
||||
|
||||
</a></h1>
|
||||
<div class="nav-tabs">
|
||||
|
@ -47,7 +52,8 @@
|
|||
<li class="dib"><span>Symbol</span></li>
|
||||
</ul>
|
||||
|
||||
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=993865" target="_blank" class="nav-more">查看项目</a>
|
||||
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=993865" target="_blank"
|
||||
class="nav-more">查看项目</a>
|
||||
|
||||
</div>
|
||||
<div class="tab-container">
|
||||
|
@ -698,7 +704,7 @@
|
|||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">促销单品</div>
|
||||
<div class="name">特惠专区</div>
|
||||
<div class="code-name">&#xe7b7;</div>
|
||||
</li>
|
||||
|
||||
|
@ -4654,7 +4660,7 @@
|
|||
<li class="dib">
|
||||
<span class="icon iconfont icon-cuxiaodanpin"></span>
|
||||
<div class="name">
|
||||
促销单品
|
||||
特惠专区
|
||||
</div>
|
||||
<div class="code-name">.icon-cuxiaodanpin
|
||||
</div>
|
||||
|
@ -9957,7 +9963,7 @@
|
|||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-cuxiaodanpin"></use>
|
||||
</svg>
|
||||
<div class="name">促销单品</div>
|
||||
<div class="name">特惠专区</div>
|
||||
<div class="code-name">#icon-cuxiaodanpin</div>
|
||||
</li>
|
||||
|
||||
|
@ -13939,4 +13945,5 @@
|
|||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -4,8 +4,7 @@
|
|||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "外包项目图标添加",
|
||||
"glyphs": [
|
||||
{
|
||||
"glyphs": [{
|
||||
"icon_id": "5387812",
|
||||
"name": "购物_o",
|
||||
"font_class": "gouwu_o",
|
||||
|
@ -756,7 +755,7 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "25889479",
|
||||
"name": "促销单品",
|
||||
"name": "特惠专区",
|
||||
"font_class": "cuxiaodanpin",
|
||||
"unicode": "e7b7",
|
||||
"unicode_decimal": 59319
|
||||
|
|
|
@ -207,7 +207,7 @@ const objTitle = {
|
|||
title: '体积(m³)'
|
||||
}
|
||||
}
|
||||
const proOptions = [{ name: '是否热卖', value: 'is_hot' }, { name: '优品推荐', value: 'is_good' }, { name: '促销单品', value: 'is_benefit' }, { name: '是否精品', value: 'is_best' }, { name: '是否新品', value: 'is_new' }]
|
||||
const proOptions = [{ name: '是否热卖', value: 'is_hot' }, { name: '优品推荐', value: 'is_good' }, { name: '特惠专区', value: 'is_benefit' }, { name: '是否精品', value: 'is_best' }, { name: '是否新品', value: 'is_new' }]
|
||||
export default {
|
||||
name: 'Info',
|
||||
props: {
|
||||
|
|
|
@ -251,7 +251,7 @@ const objTitle2 = {
|
|||
title: '体积(m³)'
|
||||
}
|
||||
}
|
||||
const proOptions = [{ name: '是否热卖', value: 'is_hot' }, { name: '优品推荐', value: 'is_good' }, { name: '促销单品', value: 'is_benefit' }, { name: '是否精品', value: 'is_best' }, { name: '是否新品', value: 'is_new' }]
|
||||
const proOptions = [{ name: '是否热卖', value: 'is_hot' }, { name: '优品推荐', value: 'is_good' }, { name: '特惠专区', value: 'is_benefit' }, { name: '是否精品', value: 'is_best' }, { name: '是否新品', value: 'is_new' }]
|
||||
export default {
|
||||
name: 'Info',
|
||||
props: {
|
||||
|
|
|
@ -207,7 +207,7 @@ const objTitle = {
|
|||
title: '体积(m³)'
|
||||
}
|
||||
}
|
||||
const proOptions = [{ name: '热门榜单', value: 'is_hot' }, { name: '促销单品', value: 'is_benefit' }, { name: '精品推荐', value: 'is_best' }, { name: '首发新品', value: 'is_new' }]
|
||||
const proOptions = [{ name: '热门榜单', value: 'is_hot' }, { name: '特惠专区', value: 'is_benefit' }, { name: '精品推荐', value: 'is_best' }, { name: '首发新品', value: 'is_new' }]
|
||||
export default {
|
||||
name: 'Info',
|
||||
props: {
|
||||
|
|
|
@ -378,6 +378,8 @@ import createWorkBook from '@/utils/newToExcel.js';
|
|||
import cardsData from "@/components/cards/index";
|
||||
import { fromList } from "@/libs/constants.js";
|
||||
import timeOptions from '@/utils/timeOptions';
|
||||
import * as FileSaver from 'file-saver'
|
||||
import Worker from "worker-loader!@/worker/calcWorker.js";
|
||||
export default {
|
||||
components: { orderDetail, cardsData, userDetails },
|
||||
data() {
|
||||
|
@ -540,31 +542,34 @@ export default {
|
|||
this.userDawer = v;
|
||||
},
|
||||
// 导出csv
|
||||
exportCsv(columns, dataList, fileName) {
|
||||
let title = columns.map(item => item);
|
||||
let keyArray = columns.map(item => item.key);
|
||||
let str = [];
|
||||
console.log(dataList);
|
||||
console.log(title);
|
||||
str.push(title.join(',') + '\n');
|
||||
for (let i = 0; i < dataList.length; i++) {
|
||||
const temp = [];
|
||||
for (let j = 0; j < keyArray.length; j++) {
|
||||
console.log(dataList[i][j]);
|
||||
temp.push(dataList[i][j]);
|
||||
}
|
||||
str.push(temp.join(',') + '\n');
|
||||
}
|
||||
console.log(str)
|
||||
let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str.join(''));
|
||||
let downloadLink = document.createElement('a');
|
||||
downloadLink.href = uri;
|
||||
downloadLink.download = fileName;
|
||||
document.body.appendChild(downloadLink);
|
||||
downloadLink.click();
|
||||
document.body.removeChild(downloadLink);
|
||||
},
|
||||
// exportCsv(columns, dataList, fileName) {
|
||||
// let title = columns.map(item => item);
|
||||
// let keyArray = columns.map(item => item.key);
|
||||
// let str = [];
|
||||
// str.push(title.join(',') + '\n');
|
||||
// for (let i = 0; i < dataList.length; i++) {
|
||||
// const temp = [];
|
||||
// for (let j = 0; j < keyArray.length; j++) {
|
||||
// console.log(dataList[i][j]);
|
||||
// temp.push(dataList[i][j]);
|
||||
// }
|
||||
// str.push(temp.join(',') + '\n');
|
||||
// }
|
||||
// let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str.join(''));
|
||||
// let downloadLink = document.createElement('a');
|
||||
// downloadLink.href = uri;
|
||||
// downloadLink.download = fileName;
|
||||
// document.body.appendChild(downloadLink);
|
||||
// downloadLink.click();
|
||||
// document.body.removeChild(downloadLink);
|
||||
// },
|
||||
async exports() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '导出中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'hsla(0, 0%, 100%, .9)'
|
||||
});
|
||||
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = []
|
||||
excelData.page = 1
|
||||
excelData.limit = 200
|
||||
|
@ -584,7 +589,35 @@ export default {
|
|||
excelData.page++
|
||||
}
|
||||
}
|
||||
this.exportCsv(lebData.header,data,lebData.filename)
|
||||
console.log('开始处理');
|
||||
// 获取计算开始的时间
|
||||
let start = performance.now();
|
||||
// 新建一个线程
|
||||
let worker = new Worker();
|
||||
// 线程之间通过postMessage进行通信
|
||||
worker.postMessage({
|
||||
header:lebData.header,
|
||||
title: lebData.title,
|
||||
data,
|
||||
foot: lebData.foot,
|
||||
filename:lebData.filename
|
||||
});
|
||||
// 监听message事件
|
||||
worker.addEventListener("message", (e) => {
|
||||
// 关闭线程
|
||||
worker.terminate();
|
||||
// 获取计算结束的时间
|
||||
let end = performance.now();
|
||||
// 得到总的计算时间
|
||||
let durationTime = end - start;
|
||||
|
||||
console.log('计算结果:', e.data);
|
||||
let { blob, filename } = e.data
|
||||
FileSaver.saveAs(blob, filename + '.xlsx')
|
||||
loading.close();
|
||||
console.log(`代码执行了 ${durationTime} 毫秒`);
|
||||
});
|
||||
// this.exportCsv(lebData.header,data,lebData.filename)
|
||||
// createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename)
|
||||
// work.saveAndDowloade(lebData.filename)
|
||||
return
|
||||
|
|
|
@ -814,7 +814,7 @@ const proOptions = [
|
|||
value: "is_hot",
|
||||
},
|
||||
{
|
||||
name: "促销单品",
|
||||
name: "特惠专区",
|
||||
value: "is_benefit",
|
||||
},
|
||||
{
|
||||
|
@ -880,7 +880,7 @@ export default {
|
|||
value: "hot",
|
||||
},
|
||||
{
|
||||
name: "促销单品",
|
||||
name: "特惠专区",
|
||||
value: "good",
|
||||
},
|
||||
{
|
||||
|
|
|
@ -769,7 +769,7 @@ const objTitle = {
|
|||
const proOptions = [
|
||||
{ name: "是否热卖", value: "is_hot" },
|
||||
{ name: "优品推荐", value: "is_good" },
|
||||
{ name: "促销单品", value: "is_benefit" },
|
||||
{ name: "特惠专区", value: "is_benefit" },
|
||||
{ name: "是否精品", value: "is_best" },
|
||||
{ name: "是否新品", value: "is_new" },
|
||||
];
|
||||
|
|
|
@ -438,7 +438,7 @@
|
|||
class="value"
|
||||
>
|
||||
<span class="value-item" v-if="productData.is_benefit"
|
||||
>促销单品</span
|
||||
>特惠专区</span
|
||||
>
|
||||
<span class="value-item" v-if="productData.is_new"
|
||||
>首发新品</span
|
||||
|
|
|
@ -363,9 +363,9 @@
|
|||
<el-divider></el-divider>
|
||||
</div>
|
||||
<div>
|
||||
<span class="spBlock spTitle mb10">热门榜单/ 精品推荐/ 首发新品/促销单品</span>
|
||||
<span class="spBlock spTitle mb10">热门榜单/ 精品推荐/ 首发新品/特惠专区</span>
|
||||
<span class="spBlock mb5">地址:<i>/pages/columnGoods/HotNewGoods/index</i></span>
|
||||
<span class="spBlock mb5">参数:<i>type: 区分列表:best为精品推荐、hot为热门榜单、new为首发新品、good为促销单品</i></span>
|
||||
<span class="spBlock mb5">参数:<i>type: 区分列表:best为精品推荐、hot为热门榜单、new为首发新品、good为特惠专区</i></span>
|
||||
<span class="spBlock spEx">例如:<i>/pages/columnGoods/HotNewGoods/index?type=best</i></span>
|
||||
<el-divider></el-divider>
|
||||
</div>
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
<el-divider />
|
||||
</div>
|
||||
<div>
|
||||
<span class="spBlock spTitle mb10">热门榜单/ 精品推荐/ 首发新品/促销单品</span>
|
||||
<span class="spBlock spTitle mb10">热门榜单/ 精品推荐/ 首发新品/特惠专区</span>
|
||||
<span class="spBlock mb5">地址:<i>/goods_list</i></span>
|
||||
<span class="spBlock mb5">参数:<i>type: 区分列表:best为精品推荐、hot为热门榜单、new为首发新品、good为促销单品</i></span>
|
||||
<span class="spBlock mb5">参数:<i>type: 区分列表:best为精品推荐、hot为热门榜单、new为首发新品、good为特惠专区</i></span>
|
||||
<span class="spBlock spEx">例如:<i>/goods_list?type=best</i></span>
|
||||
<el-divider></el-divider>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,191 @@
|
|||
// importScripts("https://cdn.bootcdn.net/ajax/libs/exceljs/4.3.0/exceljs.js");
|
||||
import ExcelJS from 'exceljs'
|
||||
onmessage = (res) => {
|
||||
const letter = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
|
||||
let lcomun = 1;
|
||||
let worksheet;
|
||||
let { header, title, data, foot, filename, sheets } = res.data;
|
||||
const workBook = new ExcelJS.Workbook();
|
||||
let long = header.length;
|
||||
/**
|
||||
* 创建工作薄
|
||||
* @param {*} sheets
|
||||
*/
|
||||
function createSheets(sheets) {
|
||||
let sheet = Array.isArray(sheets) ? sheets[0] : sheets;
|
||||
let style = Array.isArray(sheets) ? sheets[1] : {};
|
||||
worksheet = workBook.addWorksheet(sheet, style);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置表名介绍等
|
||||
* @param {*} title
|
||||
* @param {*} long
|
||||
*/
|
||||
function setTitle(title, long) {
|
||||
title = Array.isArray(title) ? title : title.split(',');
|
||||
for (let i = 0; i < title.length; i++) {
|
||||
let ti = worksheet.getRow(i + 1);
|
||||
ti.getCell(1).value = title[i];
|
||||
ti.height = 30;
|
||||
ti.font = { bold: true, size: 20, vertAlign: 'subscript', };
|
||||
ti.alignment = { vertical: 'bottom', horizontal: 'center' };
|
||||
ti.outlineLevel = 1;
|
||||
worksheet.mergeCells(i + 1, 1, i + 1, long)
|
||||
ti.commit();
|
||||
lcomun++;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 设置表头行
|
||||
* @param {*} header
|
||||
*/
|
||||
function setHeader(header) {
|
||||
const headerRow = worksheet.getRow(lcomun);
|
||||
for (let index = 1; index <= header.length; index++) {
|
||||
headerRow.getCell(index).value = header[index - 1];
|
||||
}
|
||||
headerRow.height = 25;
|
||||
headerRow.width = 50;
|
||||
headerRow.font = { bold: true, size: 18, vertAlign: 'subscript', };
|
||||
headerRow.alignment = { vertical: 'bottom', horizontal: 'center' };
|
||||
headerRow.outlineLevel = 1;
|
||||
headerRow.commit();
|
||||
lcomun++;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出内容
|
||||
* @param {*} data
|
||||
*/
|
||||
function setContent(data) {
|
||||
for (let h = 0; h < data.length; h++) {
|
||||
let satarLcomun = lcomun;
|
||||
let lcomunNow = worksheet.getRow(lcomun);
|
||||
let hasMerge = false;
|
||||
let starKey = 0;
|
||||
let endKey = 0;
|
||||
/** 循环列 */
|
||||
//需要操作第几列
|
||||
let sk = 0;
|
||||
for (let l = 0; l < data[h].length; l++) {
|
||||
if (Array.isArray(data[h][l])) {
|
||||
//数组长度
|
||||
starKey = sk;
|
||||
hasMerge = true;
|
||||
setArrayContent(data[h][l], sk);
|
||||
if (data[h][l][0]) {
|
||||
sk = sk + data[h][l][0].length
|
||||
}
|
||||
endKey = sk;
|
||||
} else {
|
||||
//不是数组
|
||||
lcomunNow.getCell(getLetter(sk)).value = data[h][l];
|
||||
lcomunNow.getCell(getLetter(sk)).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } };
|
||||
lcomunNow.alignment = { vertical: 'middle', horizontal: 'center' };
|
||||
sk++
|
||||
}
|
||||
}
|
||||
if (hasMerge) setMergeLcomun(satarLcomun, lcomun, starKey, endKey);
|
||||
lcomunNow.height = 25;
|
||||
lcomunNow.commit();
|
||||
lcomun++
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 占多行的数组
|
||||
* @param {*} arr
|
||||
* @param {*} sk
|
||||
*/
|
||||
function setArrayContent(arr, sk) {
|
||||
/**
|
||||
* 循环二维数组,在循环行
|
||||
*/
|
||||
let al = arr.length;
|
||||
let sl = al - 1;
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
let lcomunNow = worksheet.getRow(lcomun);
|
||||
for (let v = 0; v < arr[i].length; v++) {
|
||||
lcomunNow.getCell(getLetter(sk + v)).value = arr[i][v];
|
||||
lcomunNow.getCell(getLetter(sk + v)).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } };
|
||||
lcomunNow.alignment = { vertical: 'middle', horizontal: 'center' };
|
||||
}
|
||||
lcomunNow.height = 25;
|
||||
lcomunNow.commit()
|
||||
if (i < sl) lcomun++
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 合并操作
|
||||
* @param {*} satarLcomun
|
||||
* @param {*} endLcomun
|
||||
* @param {*} starKey
|
||||
* @param {*} endKey
|
||||
*/
|
||||
function setMergeLcomun(satarLcomun, endLcomun, starKey, endKey) {
|
||||
for (let ml = 0; ml < long; ml++) {
|
||||
if (ml < starKey || ml >= endKey) {
|
||||
worksheet.mergeCells(getLetter(ml) + satarLcomun + ':' + getLetter(ml) + endLcomun)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置表末尾统计备注等
|
||||
* @param {*} footData
|
||||
*/
|
||||
function setFoot(footData) {
|
||||
if (Array.isArray(footData)) {
|
||||
for (let f = 0; f < footData.length; f++) {
|
||||
let lcomunNow = worksheet.getRow(lcomun);
|
||||
lcomunNow.getCell(1).value = footData[f];
|
||||
lcomunNow.getCell(1).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } };
|
||||
lcomunNow.alignment = { vertical: 'middle', horizontal: 'left' };
|
||||
worksheet.mergeCells('A' + lcomun + ':' + getLetter(long - 1) + lcomun)
|
||||
lcomun++
|
||||
}
|
||||
} else {
|
||||
let lcomunNow = worksheet.getRow(lcomun);
|
||||
lcomunNow.getCell(1).value = footData;
|
||||
lcomunNow.getCell(1).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } };
|
||||
lcomunNow.alignment = { vertical: 'middle', horizontal: 'left' };
|
||||
worksheet.mergeCells('A' + lcomun + ':' + getLetter(long - 1) + lcomun)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理超过26个字母的列
|
||||
* @param {*} number
|
||||
* @returns
|
||||
*/
|
||||
function getLetter(number) {
|
||||
if (number < 26) {
|
||||
return letter[number];
|
||||
} else {
|
||||
let n = number % 26
|
||||
let l = Math.floor(number % 26)
|
||||
return letter[l] + letter[n]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出下载
|
||||
* @param {*} filename
|
||||
*/
|
||||
function saveAndDowloade(filename) {
|
||||
if (!filename) filename = new Date().getTime();
|
||||
workBook.xlsx.writeBuffer().then(data => {
|
||||
const blob = new Blob([data], { type: 'application/octet-stream' })
|
||||
postMessage({ blob, filename })
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
createSheets(sheets);
|
||||
setTitle(title, long);
|
||||
setHeader(header);
|
||||
setContent(data);
|
||||
setFoot(foot);
|
||||
saveAndDowloade(filename)
|
||||
}
|
||||
|
|
@ -68,6 +68,11 @@ module.exports = {
|
|||
config.plugins.delete('preload') // TODO: need test
|
||||
config.plugins.delete('prefetch') // TODO: need test
|
||||
|
||||
config.module
|
||||
.rule('worker')
|
||||
.test(/\.worker\.js$/)
|
||||
.use('worker')
|
||||
.loader('worker-loader')
|
||||
// set svg-sprite-loader
|
||||
config.module
|
||||
.rule('svg')
|
||||
|
|
Loading…
Reference in New Issue