Browse Source

echarts 调整

laiguoran 3 years ago
parent
commit
30a418339e
2 changed files with 17 additions and 11 deletions
  1. 3 2
      app/controller/dashboard_controller.js
  2. 14 9
      app/view/dashboard/index.ejs

+ 3 - 2
app/controller/dashboard_controller.js

@@ -51,6 +51,7 @@ module.exports = app => {
             const maintainData = await ctx.service.maintain.getDataById(1);
             // 获取各个审批的次数及最后的审批时间
             const shenpi_count = [
+                { count: await ctx.service.advanceAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '预付款' },
                 { count: await ctx.service.ledgerAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '台账审批' },
                 { count: await ctx.service.reviseAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '台账修订' },
                 { count: await ctx.service.stageAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '计量审批' },
@@ -60,9 +61,10 @@ module.exports = app => {
             if (ctx.session.sessionProject.page_show.openChangeApply) shenpi_count.push({ count: await ctx.service.changeApplyAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '变更申请' });
             if (ctx.session.sessionProject.page_show.openChangePlan) shenpi_count.push({ count: await ctx.service.changePlanAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '变更方案' });
             shenpi_count.push({ count: await ctx.service.materialAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '材料调差' });
-            shenpi_count.push({ count: await ctx.service.advanceAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '预付款' });
+            // shenpi_count.push({ count: await ctx.service.advanceAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '预付款' });
             const total_count = ctx.app._.sumBy(shenpi_count, 'count');
             const shenpi_lastime = [
+                await ctx.service.advanceAudit.getLastEndTimeByChecked(ctx.session.sessionUser.accountId),
                 await ctx.service.ledgerAudit.getLastEndTimeByChecked(ctx.session.sessionUser.accountId),
                 await ctx.service.reviseAudit.getLastEndTimeByChecked(ctx.session.sessionUser.accountId),
                 await ctx.service.stageAudit.getLastEndTimeByChecked(ctx.session.sessionUser.accountId),
@@ -71,7 +73,6 @@ module.exports = app => {
                 ctx.session.sessionProject.page_show.openChangeApply ? await ctx.service.changeApplyAudit.getLastEndTimeByChecked(ctx.session.sessionUser.accountId) : null,
                 ctx.session.sessionProject.page_show.openChangePlan ? await ctx.service.changePlanAudit.getLastEndTimeByChecked(ctx.session.sessionUser.accountId) : null,
                 await ctx.service.materialAudit.getLastEndTimeByChecked(ctx.session.sessionUser.accountId),
-                await ctx.service.advanceAudit.getLastEndTimeByChecked(ctx.session.sessionUser.accountId),
             ];
             const last_time = ctx.app._.max(shenpi_lastime);
             console.log(ctx.app._.max(shenpi_lastime), ctx.helper.calcDayNum(last_time));

+ 14 - 9
app/view/dashboard/index.ejs

@@ -514,6 +514,7 @@
         myChart1.resize()
     }
     var myChart1 = echarts.init(document.getElementById('jechart'));
+    var transparentCount = 1;
     option = {
         // title: {
         //     text: '金额统计图',
@@ -521,21 +522,21 @@
         //     top:'7%'
         // },
         color: [
-            'rgba(250, 140, 22, 0.7)',
-            'rgba(251, 182, 45, 0.7)',
-            'rgba(82, 196, 26, 0.7)',
-            'rgba(22, 208, 208, 0.7)',
+            'rgba(241, 82, 91,'+ transparentCount +')',
+            'rgba(250, 140, 22,'+ transparentCount +')',
+            'rgba(251, 182, 45,'+ transparentCount +')',
+            'rgba(82, 196, 26,'+ transparentCount +')',
+            'rgba(22, 208, 208,'+ transparentCount +')',
             <% if (ctx.session.sessionProject.page_show.openChangeProject) { %>
-            'rgba(51, 119, 255, 0.7)',
+            'rgba(51, 119, 255,'+ transparentCount +')',
             <% } %>
             <% if (ctx.session.sessionProject.page_show.openChangeApply) { %>
-            'rgba(41, 58, 210, 0.7)',
+            'rgba(41, 58, 210,'+ transparentCount +')',
             <% } %>
             <% if (ctx.session.sessionProject.page_show.openChangePlan) { %>
-            'rgba(114, 46, 209, 0.7)',
+            'rgba(114, 46, 209,'+ transparentCount +')',
             <% } %>
-            'rgba(187, 41, 210, 0.7)',
-            'rgba(241, 82, 91, 0.7)',
+            'rgba(187, 41, 210,'+ transparentCount +')',
         ],
         tooltip: {
             trigger: 'item'
@@ -545,6 +546,8 @@
                 orient: 'vertical',
                 left: '3%',
                 top: '20%',
+                itemWidth: 15,
+                itemHeight: 15,
                 textStyle: {
                     fontSize: 12
                 },
@@ -556,6 +559,8 @@
                 orient: 'vertical',
                 right: '3%',
                 top: '20%',
+                itemWidth: 15,
+                itemHeight: 15,
                 textStyle: {
                     fontSize: 12
                 },