diff --git a/public/excel/wuliu.xlsx b/public/excel/wuliu.xlsx index 61517f1..e73dafd 100644 Binary files a/public/excel/wuliu.xlsx and b/public/excel/wuliu.xlsx differ diff --git a/src/views/dashboard/home.vue b/src/views/dashboard/home.vue index 1a7b240..e627af6 100644 --- a/src/views/dashboard/home.vue +++ b/src/views/dashboard/home.vue @@ -394,7 +394,6 @@ export default { this.content = this.transformSheets(sheets); }) .catch((err) => { - console.log(err) this.$message.error(err); }); }, @@ -406,8 +405,6 @@ export default { const year = time.getFullYear(); const month = time.getMonth() + 1; const date = time.getDate(); - console.log(time.getHours()); - console.log(time.getMinutes()); return ( year + format + @@ -421,7 +418,6 @@ export default { for (const key in sheets) { content1.push(XLSX.utils.sheet_to_json(sheets[key])); } - console.log(content1) this.dayData.push( { name: "收件量", data: content1[0][0].日总收件量, huanbi: content1[0][0].收件量日总环比 }, { name: "发件量", data: content1[0][0].日总发件量, huanbi: content1[0][0].发件量日总环比 }, @@ -439,14 +435,12 @@ export default { ); this.totalData = this.dayData; this.updateTime = this.formatDate(content1[0][0].日期,'/'); - console.log(this.updateTime) content1[1].map((item) => { // item.日期.substring(item.日期.length - 5).replace(".", "-") this.xData.unshift(this.formatDate(item.日期,'-').substring(this.formatDate(item.日期,'-').length - 5).replace(".", "-")); this.yData1.push(item.到件量); this.yData2.push(item.派件量); }); - console.log(this.xData) content1[3].map((item) => { this.villageData.push({ name: item.村点名称, upData: item.上行, downData: item.下行 }); }); @@ -481,20 +475,24 @@ export default { return b.count - a.count; }); }); - + var pieArr = [] content1[0].map((item) => { - this.pieData.push({ + pieArr.push({ name: item.快递名称, y: item.收件量, // percent: (item.收件量 / content1[0][0].日总收件量).toFixed(4) * 100, }); }); - this.pieData = this.pieData.sort(function (a, b) { - return b.y - a.y; + pieArr = pieArr.sort(function (a, b) { + return a.y - b.y; }); - this.pieData[0].h = 15; - this.pieData[1].h = 10; - this.pieData[2].h = 5; + pieArr.map((item,index) =>{ + this.pieData.push({ + name: item.name, + y: item.y, + h:index + 1 + }) + }) this.shouData.map((item, index) => { if (index <= 10) { this.slideList[0].arr.push({ no: index + 1, name: item.name, count: item.count }); @@ -872,7 +870,7 @@ export default { backgroundColor: null, marginTop: -10, }, - colors: ["#00bdff", "#52f4c1", "#00dbec"], + colors: ["#00bdff", "#52f4c1", "#00dbec","#ff56a1","#ffa04b","#8f58ff","#00c056","#ff3661","#ff3661"], title: { text: "", }, @@ -888,6 +886,7 @@ export default { cursor: "pointer", depth: this.fontSize(15), dataLabels: { + padding: 0, enabled: true, //是否显示饼图的线形tip distance: "11%", connectorWidth: 1, @@ -898,14 +897,14 @@ export default { }, formatter: function (params) { //this 为当前的点(扇区)对象,可以通过 console.log(this) 来查看详细信息 - return `${ + return `${ this.key }: - ${( + ${( (this.y / this.total) * 100 ).toFixed(2)}%
- ${ + ${ this.y }`; },