huangjn 3 rokov pred
rodič
commit
8e52638823
2 zmenil súbory, kde vykonal 119 pridanie a 75 odobranie
  1. 25 1
      src/api/news/news.js
  2. 94 74
      src/views/wel/index.vue

+ 25 - 1
src/api/news/news.js

@@ -43,4 +43,28 @@ export const queryBusinessUserOpinionAll = (params) => {
         method: 'post',
         params
     })
-}
+}
+
+//获取人员账户统计
+export const queryProjectUserAmount = () => {
+  return request({
+    url: '/api/blade-manager/managerHomePage/queryProjectUserAmount',
+    method: 'post'
+  })
+}
+
+//证书统计
+export const queryProjectPfx = () => {
+  return request({
+    url: '/api/blade-manager/managerHomePage/queryProjectPfx',
+    method: 'post'
+  })
+}
+
+//维护类型统计汇总
+export const queryOpinionTypeAmount = () => {
+  return request({
+    url: '/api/blade-manager/managerHomePage/queryOpinionTypeAmount',
+    method: 'post'
+  })
+}

+ 94 - 74
src/views/wel/index.vue

@@ -1,22 +1,18 @@
 <template>
   <div class="boxswai">
     <div class="boxnei flex flex-d-c">
-      <el-menu
-        :default-active="activeIndex"
+      <el-menu :default-active="activeIndex"
         class="el-menu-demo"
         mode="horizontal"
         text-color='black'
         active-text-color='#1684FC'
         @select="handleSelect"
       >
-        <el-menu-item index="1">我的待办工单</el-menu-item>
-        <el-menu-item
-          index="2"
-          :disabled="!menuTag"
-        >所有代办工单</el-menu-item>
+        <el-menu-item index="1" v-model="activeIndex">我的待办工单</el-menu-item>
+        <el-menu-item index="2" v-model="activeIndex">所有代办工单</el-menu-item>
       </el-menu>
       <div class="information flex1">
-        <el-collapse v-show="activeIndex==1">
+        <el-collapse v-show="activeIndex == 1">
           <el-collapse-item
             :name="item.title"
             v-for="(item,key) in collapseData1"
@@ -26,7 +22,7 @@
               <i
                 class="el-icon-chat-dot-round"
                 style="fontSize:18px;margin-right:10px;"
-              > </i>待办工单任务:{{item.title}}
+              > </i>{{item.title}}
             </template>
             <div>
               <el-button
@@ -54,38 +50,40 @@
               <i
                 class="el-icon-chat-dot-round"
                 style="fontSize:18px;margin-right:10px;"
-              > </i>待办工单任务:{{item.title}}
+              > </i>{{item.title}}
             </template>
-            <div>
-              <el-button
-                type="text"
-                style="color:rgb(65, 80, 88);"
-              >立即处理</el-button>
-            </div>
-            <div>
-              <el-button
-                type="text"
-                v-throttle="3000"
-                @click="ignore2(key)"
-                style="color:rgb(65, 80, 88);"
-              >忽略</el-button>
+            <div v-show="item.operation">
+              <div>
+                <el-button
+                  type="text"
+                  style="color:rgb(65, 80, 88);"
+                >立即处理</el-button>
+              </div>
+              <div>
+                <el-button
+                  type="text"
+                  v-throttle="3000"
+                  @click="ignore2(key)"
+                  style="color:rgb(65, 80, 88);"
+                >忽略</el-button>
+              </div>
             </div>
           </el-collapse-item>
         </el-collapse>
       </div>
       <el-row :gutter="20" class="mg-t-20">
         <el-col :span="8">
-          <div class="chart-title">证书统计(总计362个)</div>
+          <div class="chart-title">证书统计(总计XXXXX个)</div>
           <div id="container"></div>
         </el-col>
         <el-col :span="8">
-          <div class="chart-title">人员账户统计(总计1365位)</div>
+          <div class="chart-title">人员账户统计(总计{{personAmount}}位)</div>
           <div id="container2"></div>
         </el-col>
         <el-col :span="8">
           <div class="chart-title">
             <span>维护类型统计汇总</span>
-            <el-select v-model="projectId" placeholder="请选择项目" size="small">
+            <el-select v-model="projectId" placeholder="请选择项目" size="small" @change="selectProjectOpinion">
               <el-option
                 v-for="item in projectList"
                 :key="item.id"
@@ -103,65 +101,59 @@
 <script>
 // 引入统计图
 import { Area, Column, Pie } from '@antv/g2plot';
-import { queryBusinessUserOpinion, queryBusinessUserOpinionAll } from '@/api/news/news.js'
-import { getProjectList } from "@/api/manager/projectinfo";
+import { queryBusinessUserOpinion, queryBusinessUserOpinionAll, queryProjectUserAmount, queryProjectPfx, queryOpinionTypeAmount } from '@/api/news/news.js';
 export default {
   data () {
     return {
-      LineData: [
-        {"category": "个人证书","project": "奉建路","value": 100},
-        {"category": "企业证书","project": "奉建路","value": 150},
-        {"category": "个人证书","project": "陈油路","value": 140},
-        {"category": "企业证书","project": "陈油路","value": 100},
-        {"category": "个人证书","project": "西环线","value": 230},
-        {"category": "企业证书","project": "西环线","value": 200},
-      ],//折现统计图数据
-      ColumnData: [
-        {"category": "施工方","project": "奉建路","value": 100},
-        {"category": "监理方","project": "奉建路","value": 150},
-        {"category": "指挥部","project": "奉建路","value": 202},
-        {"category": "施工方","project": "陈油路","value": 140},
-        {"category": "监理方","project": "陈油路","value": 100},
-        {"category": "指挥部","project": "陈油路","value": 174},
-        {"category": "施工方","project": "西环线","value": 230},
-        {"category": "监理方","project": "西环线","value": 200},
-        {"category": "指挥部","project": "西环线","value": 213},
-      ],//条形统计图数据
-      PieData: [
-        { type: '业务问题', value: 100 },
-        { type: '操作问题', value: 150 },
-        { type: '系统问题', value: 130 },
-      ],//饼图统计图数据
+      LineData: [],//折线统计图数据
+      ColumnData: [],//条形统计图数据
+      personAmount: 0,
+      PieData: [],//饼图统计图数据
       activeIndex: '1',
       collapseData1: [],//
       collapseData2: [],//
-      menuTag: true,
-
+      userOpinionTypeList:[],
       projectList:[],
       projectId:'',
     }
   },
   methods: {
-    async handleSelect () {
-      if (this.activeIndex == 2) {
-        if (this.collapseData2.length) {
+    selectProjectOpinion(){
+      let _this = this;
+      this.userOpinionTypeList.forEach(vo => {
+        if(vo.projectId === _this.projectId){
+          _this.PieData = [];
+          let problemType = vo.problemType;
+          let problemTypeAmount = vo.problemTypeAmount;
+          _this.projectId = vo.projectId;
+          problemType.forEach((name, index) => {
+            _this.PieData.push({type : name, value : Number(problemTypeAmount[index])});
+          });
+        }
+      })
+    },
+    async handleSelect (key) {
+      if (key == 2) {
+        if (this.collapseData2.length <= 0) {
           await this.queryBusinessUserOpinionAll()
-          this.collapseData = this.collapseData2
+          this.collapseData = this.collapseData2;
+        } else {
+          this.collapseData = this.collapseData2;
         }
       } else {
         if (this.collapseData1.length > 0) {
-          this.collapseData = this.collapseData1
+          this.collapseData = this.collapseData1;
         }
       }
+      this.activeIndex = key
     },
     async queryBusinessUserOpinion () {//获取我的消息
       const { data: res } = await queryBusinessUserOpinion({
         current: 1,
         size: 999999
       })
-      console.log(res);
       if (res.code == 200) {
-        this.collapseData1 = res.data.userOpinionList
+        this.collapseData1 = res.data.userOpinionFlowList
         this.menuTag = res.data.operation
       }
     },
@@ -170,9 +162,8 @@ export default {
         current: 1,
         size: 999999
       })
-      console.log(res);
       if (res.code == 200) {
-        this.collapseData2 = res.data.userOpinionList
+        this.collapseData2 = res.data.userOpinionFlowList;
       }
     },
     ignore (key) {
@@ -181,7 +172,8 @@ export default {
     ignore2 (key) {
       this.collapseData2.splice(this.collapseData2.indexOf(this.collapseData2[key]), 1)
     },
-    LineV () {
+    async LineV () {
+      await this.queryProjectPfx();
       const line = new Area('container', {
         data: this.LineData,
         xField: 'project',
@@ -195,7 +187,8 @@ export default {
       });
       line.render();
     },
-    ColumnV () {
+    async ColumnV () {
+      await this.queryProjectUserAmount();
       const columnPlot = new Column('container2', {
         data: this.ColumnData,
         isGroup: true,
@@ -226,7 +219,8 @@ export default {
 
       columnPlot.render();
     },
-    PieV () {
+    async PieV () {
+      await this.queryOpinionTypeAmount();
       const piePlot = new Pie('container3', {
         appendPadding: 10,
         data: this.PieData,
@@ -245,17 +239,43 @@ export default {
       });
       piePlot.render();
     },
-
-    //获取项目列表
-    getProjectList() {
-      getProjectList(1, 999).then((res) => {
-        this.projectList = res.data.data.records;
+    //获取人员账户
+    async queryProjectUserAmount(){
+      const {data : res} = await queryProjectUserAmount();
+      let records = res.data.projectUserAmountVOList;
+      records.forEach(vo => {
+        this.ColumnData.push({"category": "施工方","project": vo.projectName,"value": vo.contractor});
+        this.ColumnData.push({"category": "监理方","project": vo.projectName,"value": vo.supervision});
+        this.ColumnData.push({"category": "指挥部","project": vo.projectName,"value": vo.owner});
       });
+      this.personAmount = res.data.projectUserAmount;
     },
+    //证书统计
+    async queryProjectPfx(){
+      let _this = this;
+      const {data : res} = await queryProjectPfx();
+      let pfxList = res.data.pfxList;
+      pfxList.forEach(vo => {
+        _this.LineData.push({"category": "个人证书","project": vo.projectName,"value": Number(vo.personalCount)});
+        _this.LineData.push({"category": "企业证书","project": vo.projectName,"value": Number(vo.enterpriseCount)});
+      });
+    },
+    //维护类型统计汇总
+    async queryOpinionTypeAmount(){
+      let _this = this;
+        const {data : res} = await queryOpinionTypeAmount();
+        this.userOpinionTypeList = res.data.userOpinionList;
+        let problemType = this.userOpinionTypeList[0].problemType;
+        let problemTypeAmount = this.userOpinionTypeList[0].problemTypeAmount;
+        this.projectId = this.userOpinionTypeList[0].projectId;
+        problemType.forEach((name, index) => {
+          _this.PieData.push({type : name, value : Number(problemTypeAmount[index])});
+        });
+        this.projectList = res.data.projectInfos;
+    }
   },
   created () {
-    this.queryBusinessUserOpinion()
-    this.getProjectList();
+    this.queryBusinessUserOpinion();
   },
   mounted () {
     this.LineV()
@@ -313,4 +333,4 @@ export default {
   font-size: 18px;
   color: rgba(119, 40, 245, 0.85);
 }
-</style>
+</style>