weirenchun пре 10 месеци
родитељ
комит
2c5a479f23

+ 16 - 0
src/api/biz/index.js

@@ -16,6 +16,14 @@ export default {
   getBigCount(params) {
     return fetch('/blade-pc-applet/wechat/count/getBigCount', params)
   },
+  /**
+   * 梧桐树项目云统计
+   * @param params
+   * @returns {Promise | Promise<unknown>}
+   */
+  getProjectCount(params) {
+    return fetch('/wutong-okr/project/big-data-count', params)
+  },
   /**
    * 知库专债列表
    * @param params
@@ -69,5 +77,13 @@ export default {
    */
   bigList(params) {
     return fetch('/blade-pc-applet/informationinfo/bigList', params)
+  },
+  /**
+   * 获取汇编列表按阅读次数倒序
+   * @param params
+   * @returns {Promise | Promise<unknown>}
+   */
+  libraryList(params) {
+    return fetch('/wutong-library/library/page', params)
   }
 }

+ 1 - 1
src/views/home/components/chart2.vue

@@ -108,7 +108,7 @@ export default {
     }
   },
   created() {
-    this.timingAcquisition()
+    // this.timingAcquisition()
   },
   methods: {
     timingAcquisition() {

+ 49 - 0
src/views/home/components/chart3.vue

@@ -1,4 +1,44 @@
 <template>
+  <!--  <div class="block">-->
+  <!--    <div-->
+  <!--      v-for="index in 5"-->
+  <!--      class="flex flex-center"-->
+  <!--      style="-->
+  <!--        height: 26px;-->
+  <!--        margin-left: 10px;-->
+  <!--        margin-right: 10px;-->
+  <!--        margin-top: 7px;-->
+  <!--      "-->
+  <!--    >-->
+  <!--      <div-->
+  <!--        v-if="index <= 3"-->
+  <!--        style="width: 5%; font-size: 18px; font-weight: bold; color: #ffa100"-->
+  <!--      >-->
+  <!--        {{ index }}.-->
+  <!--      </div>-->
+  <!--      <div-->
+  <!--        v-else-->
+  <!--        style="width: 5%; font-size: 18px; font-weight: bold; color: #ffffff"-->
+  <!--      >-->
+  <!--        {{ index }}.-->
+  <!--      </div>-->
+  <!--      <div class="flex flex-align-center" style="width: 85%">-->
+  <!--        <div-->
+  <!--          style="-->
+  <!--            align-items: center;-->
+  <!--            width: 88%;-->
+  <!--            height: 26px;-->
+  <!--            margin-left: 3px;-->
+  <!--            background: rgba(171, 118, 48, 0.82);-->
+  <!--            border-radius: 20px;-->
+  <!--          "-->
+  <!--        >-->
+  <!--          什么项目的名字11111-->
+  <!--        </div>-->
+  <!--      </div>-->
+  <!--      <div style="width: 10%; color: rgb(6, 243, 223)">118</div>-->
+  <!--    </div>-->
+  <!--  </div>-->
   <div>
     <charts
       style="margin-top: -40px"
@@ -60,6 +100,8 @@ export default {
             }
           },
           axisLabel: {
+            inside: true,
+            color: '#fff',
             textStyle: {
               fontSize: "20",
               color: function(params,index) {
@@ -112,6 +154,13 @@ export default {
           this.option.series[0].data = result.data.records.map((item) => {
             return item.viewNumber
           }).reverse()
+          this.option.yAxis.data = result.data.records.map((item,index) => {
+            if (item.name.length>=16){
+              return index+1+"."+item.name.substring(0,14)+"..."
+            }else {
+              return index+1+"."+item.name
+            }
+          }).reverse()
         }
       })
     },

+ 21 - 2
src/views/home/components/left2.vue

@@ -20,7 +20,7 @@
       <img class="ico" src="@/assets/biz-img/ico4.png" />
       <div class="block ml-5">
         <div class="number1 bold">
-          {{ data.todayArticleCount ? data.todayArticleCount : 0 }}
+          {{ libraryCount }}
         </div>
         <div style="width: 80px; margin-top: 10px">
           <img class="ico-name1" src="@/assets/biz-img/xzzcsl.png" />
@@ -47,11 +47,13 @@ import crypto from '@/utils/crypto.js'
 export default {
   data() {
     return {
-      data: {}
+      data: {},
+      libraryCount: 0
     }
   },
   mounted() {
     this.getCount()
+    this.libraryList()
   },
   methods: {
     getCount() {
@@ -61,6 +63,23 @@ export default {
           this.data = result.data
         }
       })
+    },
+    libraryList() {
+      const y = new Date().getFullYear()
+      const m = new Date().getMonth() + 1
+      const d = new Date().getDate() - 1
+      let nowDate = y + '-' + m + '-' + d + ' ' + '00:00:00'
+      const data = {
+        createStartTime: nowDate,
+        createEndTime: nowDate,
+        current: 1,
+        size: 10000
+      }
+      this.$api.biz.libraryList(data).then(res => {
+        if (res.code === 200) {
+          this.libraryCount = res.data.numberOfElements
+        }
+      })
     }
   }
 }

+ 33 - 8
src/views/home/components/left3.vue

@@ -9,8 +9,8 @@
           <div class="mr-5">今日新增</div>
         </div>
         <div class="mt-5 flex flex-center-between">
-          <div class="ml-5 bold number">344</div>
-          <div class="mr-5 bold xz-number">5</div>
+          <div class="ml-5 bold number">{{ data.projectCount }}</div>
+          <div class="mr-5 bold xz-number">{{ data.todayAddProjectCount }}</div>
         </div>
       </div>
     </div>
@@ -19,12 +19,12 @@
       <div class="ml-5 lin" />
       <div class="ml-5 block">
         <div class="title flex flex-center-between">
-          <div class="ml-5">项目云累计文档数量</div>
-          <div class="mr-5">今日新增</div>
+          <div class="ml-5">项目云累计任务数量</div>
+          <div class="mr-5">今日完成</div>
         </div>
         <div class="mt-5 flex flex-center-between">
-          <div class="ml-5 bold number">3677</div>
-          <div class="mr-5 bold xz-number">35</div>
+          <div class="ml-5 bold number">{{ data.taskCount }}</div>
+          <div class="mr-5 bold xz-number">{{ data.todayAddTaskCount }}</div>
         </div>
       </div>
     </div>
@@ -34,10 +34,35 @@
 <script>
 export default {
   data() {
-    return {}
+    return {
+      data: {
+        projectCount: 0,
+        todayAddProjectCount: 0,
+        taskCount: 0,
+        todayAddTaskCount: 0
+      }
+    }
   },
   mounted() {},
-  methods: {}
+  created() {
+    this.getProjectCount()
+    this.timingAcquisition()
+  },
+
+  methods: {
+    timingAcquisition() {
+      setInterval(() => {
+        this.getProjectCount()
+      }, 90000)
+    },
+    getProjectCount() {
+      this.$api.biz.getProjectCount().then(res => {
+        if (res.code === 200) {
+          this.data = res.data
+        }
+      })
+    }
+  }
 }
 </script>