Browse Source

处理数据统计

tengmingxue 1 year ago
parent
commit
75f33dd764

+ 19 - 12
src/views/dashboard/workbench/component/SupportModule.vue

@@ -41,6 +41,13 @@ export default defineComponent({
       title: '组件支撑次数',
       interval: null,
       allTimes: ref(0),
+      objTypes: [
+        { type: '地图浏览工具', includes: ['地图浏览工具'], times: 0 },
+        { type: '服务加载工具', includes: ['服务加载工具'], times: 0 },
+        { type: 'GIS功能工具', includes: ['地图基础工具','GIS功能工具','测量工具','绘制工具'], times: 0 },
+        { type: '空间分析工具', includes: ['空间分析工具','空间分析'], times: 0 },
+        { type: '三维可视化效果工具', includes: ['底图和模型加载','覆盖物','天气效果','三维可视化效果工具'], times: 0 },
+      ],
     });
     const domRef = ref(null);
     const { proxy } = getCurrentInstance();
@@ -54,21 +61,21 @@ export default defineComponent({
       let sum = 0;
       let xAxisData = [],
         seriesData = [];
-      //const res = await queryApiUseCountDays()
-      // if(res.dateArr){
-      //   res.dateArr.map(item=>{
-      //     const Arr = item.split('-')
-      //     xAxisData.push(`${Arr[1]}/${Arr[2]}`)
-      //   })
-      //   res.list.map(item=>{
-      //     seriesData.push(parseInt(item))
-      //   })
-      // }
       res.map((item) => {
-        xAxisData.push(item['SOURCE']);
-        seriesData.push(parseInt(item['SUM(NUM)']));
+        // xAxisData.push(item['SOURCE']);
+        // seriesData.push(parseInt(item['SUM(NUM)']));
         sum += parseInt(item['SUM(NUM)']);
       });
+      data.objTypes.map(item=>{
+        const objData = res.filter(re=>item.includes.indexOf(re['SOURCE']))
+        let times = 0
+        objData.map(od=>{
+          times+=parseInt(od['SUM(NUM)'])
+        })
+        xAxisData.push(item['type']);
+        seriesData.push(times);
+      })
+
       data.allTimes = sum;
       if (seriesData.length < 1 || xAxisData.length < 1) return;
       const option = getOption(seriesData, xAxisData);

+ 14 - 5
src/views/dashboard/workbench/component/UnstructuredStatistic.vue

@@ -2,7 +2,7 @@
  * @Author: tengmingxue 1473375109@qq.com
  * @Date: 2023-09-13 10:06:22
  * @LastEditors: tengmingxue 1473375109@qq.com
- * @LastEditTime: 2024-03-06 22:05:16
+ * @LastEditTime: 2024-03-06 22:35:55
  * @FilePath: \xld-gis-admin\src\views\dashboard\workbench\component\TopCardStatistic.vue
  * @Description: 统计卡片
 -->
@@ -10,7 +10,7 @@
   <div class="ust-statistic">
     <div class="title">{{ title }}</div>
     <!-- autoplay -->
-    <a-carousel style="height: calc(100% - 40px); width: 100%" autoplay dotsClass="dotsClassBottom">
+    <a-carousel ref="domRef" style="height: calc(100% - 40px); width: 100%" dotsClass="dotsClassBottom">
       <!-- 第一页 -->
       <div class="indiv">
         <a-row :gutter="[16, 16]" class="cards">
@@ -216,7 +216,7 @@
                 <div class="img5"></div>
               </div>
               <div class="contenter">
-                <div class="res-title">文件数据</div>
+                <div class="res-title">工程图纸</div>
                 <div class="res-file">
                   <div class="num">{{dataTypeStatistic[9].sum}}</div>
                   <div class="name">文件个数</div>
@@ -372,7 +372,7 @@
   </div>
 </template>
     <script lang="ts">
-import { defineComponent, onMounted, toRefs, onUnmounted, nextTick, reactive } from 'vue';
+import { defineComponent, onMounted, toRefs, onUnmounted, nextTick, reactive,ref } from 'vue';
 import {
   DataStoreGroupByStatistics,
   QueryDataStoreData,
@@ -390,6 +390,8 @@ export default defineComponent({
   },
 
   setup(props) {
+    const domRef=ref(null)
+    const intervalId = ref()
     const data = reactive({
       statisticData: props.statisticData,
       title: '非结构化统计',
@@ -445,12 +447,19 @@ export default defineComponent({
     };
     onMounted(() => {
       queryData();
+      intervalId.value = setInterval(()=>{
+        if(domRef.value)domRef.value.next()
+      },6000)
     });
 
-    onUnmounted(() => {});
+    onUnmounted(() => {
+      if(intervalId.value) clearInterval(intervalId.value)
+    });
 
     return {
+      domRef,
       ...toRefs(data),
+      intervalId,
       queryData,
     };
   },

+ 3 - 3
src/views/dashboard/workbench/index.vue

@@ -2,7 +2,7 @@
  * @Author: tengmingxue 1473375109@qq.com
  * @Date: 2023-08-15 11:20:48
  * @LastEditors: tengmingxue 1473375109@qq.com
- * @LastEditTime: 2023-09-14 11:49:35
+ * @LastEditTime: 2024-03-06 22:36:30
  * @FilePath: \xld-gis-admin\src\views\dashboard\workbench\index.vue
  * @Description: 数据监控
 -->
@@ -23,7 +23,7 @@
         </div>
         <div class="item-statistic" style="padding-bottom: 1rem;">
           <div class="item">
-            <interface-everyday/>
+            <res-type-statistic/>
           </div>
         </div>
         <div class="item-statistic" style="padding-right:1rem;">
@@ -34,7 +34,7 @@
         </div>
         <div class="item-statistic">
           <div class="item">
-            <res-type-statistic/>
+            <interface-everyday/>
           </div>
         </div>
       </div>