Commit 30aad991 authored by Mac's avatar Mac

1

parent 96903729
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
"@quasar/extras": "^1.0.0", "@quasar/extras": "^1.0.0",
"axios": "^0.18.1", "axios": "^0.18.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"element-ui": "^2.14.1",
"lockr": "^0.8.5", "lockr": "^0.8.5",
"quasar": "^1.0.0", "quasar": "^1.0.0",
"vue-i18n": "^8.0.0" "vue-i18n": "^8.0.0",
"xlsx": "^0.16.8"
}, },
"devDependencies": { "devDependencies": {
"@quasar/app": "^2.0.0", "@quasar/app": "^2.0.0",
......
...@@ -47,7 +47,8 @@ module.exports = function(ctx) { ...@@ -47,7 +47,8 @@ module.exports = function(ctx) {
build: { build: {
vueRouterMode: 'hash', // available values: 'hash', 'history' vueRouterMode: 'hash', // available values: 'hash', 'history'
env: ctx.dev ? { env: ctx.dev ? {
API: 'https://localhost:5001/api' // API: 'https://localhost:5001/api'
API: 'http://192.168.1.27:8300/api'
} : { } : {
API: 'https://prod.api.com' API: 'https://prod.api.com'
}, },
...@@ -249,4 +250,4 @@ module.exports = function(ctx) { ...@@ -249,4 +250,4 @@ module.exports = function(ctx) {
} }
} }
} }
} }
\ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios' import axios from 'axios'
Vue.use(ElementUI)
Vue.prototype.$axios = axios Vue.prototype.$axios = axios
This diff is collapsed.
This diff is collapsed.
/*!
导出简易excel
param tableH 表头数据
param tableDataList 表格数据
param tableFooterDataList 表格底部数据
*/
import XLSX from 'xlsx/types';
let downloadExcelEasy = {
downLoad: function (tableH, tableDataList, tableFooterDataList) {
// 导出文件名
let xlsxName = '团队营收报表';
// 数据源
let dataSource = tableDataList;
let wscols = {};
// 每列的宽度
wscols = [];
// 创建表头数据
let data = [tableH];
// 组装表格内容
dataSource.forEach((x,index)=>{
let obj = [];
obj.push(x.LineName+" ");
obj.push(x.TCNUM);
obj.push(x.TCID);
obj.push('否');
for (let i = 0 ; i <= data[0].length-5 ; i++ ) {
obj.push(Math.random()*9999);
}
data.push(obj);
});
// 表格底部
if (tableFooterDataList) {
let obj = [];
tableFooterDataList[0].forEach(x=> {
obj.push(x);
});
data.push(obj);
}
let colName = downloadExcelEasy.countColumn(tableH);
const ws = XLSX.utils.aoa_to_sheet(data);
ws['!cols'] = wscols;
ws['!rows'] = [];
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, xlsxName);
var dataInfo = wb.Sheets[wb.SheetNames[0]];
data[0].forEach((x,i)=>{
dataInfo[colName[i]+'1'].s={
fill: { fgColor: { rgb: "#ffff00"}},
font: {
name: '微软雅黑',
sz: 32,
color: { rgb: "#ffff00"},
bold: true,
italic: true,
underline: true
},
alignment: {
horizontal: "center",
vertical: "center"
}
}
});
XLSX.writeFile(wb, xlsxName + ".xlsx")
},
countColumn: function (data) {
let list = [];
let col = ['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'];
data.forEach((item , index)=> {
if (index < 26){
list.push(col[index])
}else if (index > 25 && index < 52) {
list.push('A'+col[index-col.length])
}else if (index > 51 && index < 78) {
list.push('B'+col[index-(col.length*2)])
}
});
return list
}
};
export default downloadExcelEasy
...@@ -80,7 +80,12 @@ const routes = [{ ...@@ -80,7 +80,12 @@ const routes = [{
{ {
path: "/financial/PlatformAccount", //平台账户 path: "/financial/PlatformAccount", //平台账户
component: () => component: () =>
import("pages/course/chapter.vue") import("pages/financial/PlatformAccount.vue")
},
{
path: "/financial/TeamRevenueReport", //营收报表
component: () =>
import("pages/financial/TeamRevenueReport.vue")
}, },
{ {
path: "/test", //API测试 path: "/test", //API测试
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment