XiaXxxxxx il y a 1 an
Parent
commit
dd82cd8a1c

+ 3 - 1
.env.development

@@ -11,7 +11,7 @@ VITE_GLOB_PUBLIC_PATH = /
 # VITE_PROXY = [["/api","http://192.168.2.225/api"]]
 
 # 线上演示环境
-VITE_PROXY = [["/api","http://117.174.10.73:19200"],["/agent","http://117.174.10.73:31895"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
+VITE_PROXY = [["/api","http://117.174.10.73:19200"],["/agent","http://117.174.10.73:31895"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"],["/xldAnalysisApi","http://192.168.119.47:2214/xldanalyst"]]
 # VITE_PROXY = [["/api","http://192.168.49.163:20043"],["/agent","http://192.168.49.163:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
 # VITE_PROXY = [["/api","http://127.0.0.1:20043"],["/agent","http://127.0.0.1:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
 # VITE_PROXY = [["/api","http://192.168.49.163:20043"],["/agent","http://192.168.49.163:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
@@ -37,6 +37,8 @@ VITE_GLOB_DROP_CONSOLE = true
 VITE_GLOB_API_URL=/api
 VITE_GLOB_API_URL2=/agent
 VITE_GLOB_API_MAPTOOLS=/mapTools
+# 数据监控中空间分析统计接口地址,只有现场能用
+VITE_GLOB_API_XLDANALYSIS=/xldAnalysisApi
 
 # File upload address, optional
 VITE_GLOB_UPLOAD_URL=/api/yt/oss/upload

+ 43 - 1
src/api/dashboard/index.ts

@@ -1,12 +1,54 @@
 import { BasicPageParams } from './../model/baseModel';
-import { defHttp } from '/@/utils/http/axios';
+import { defHttp, xldAnalystHttp } from '/@/utils/http/axios';
 enum HomeEnum {
   home = '/homepage/left/top',
   TenantExpireTimeList = '/homepage/right/overdue',
   EntitiesQueryFind = '/entitiesQuery/find',
   TrendAPI = '/homepage/left/bottom',
   Top10 = '/homepage/right/top10',
+  // 资源访问次数
+  GetIServerRequestCountData = '/external-service-center/IServer/getIServerRequestCountData',
+  // 资源访问次数月度
+  GetIServerRequestMonthCountData = '/external-service-center/IServer/getIServerRequestMonthCountData',
+  // 资源访问次数年度
+  GetIServerRequestYearCountData = '/external-service-center/IServer/getIServerRequestYearCountData',
+  // 分组统计组件资源申请次数
+  GetSRResourceGroup = '/datasearch-center/space/getSRResourceGroup',
+  // 空间分析统计
+  BusinessStatistics = '/BusinessStatistics'
+
+}
+// 空间服务支撑访问统计
+export const GetIServerRequestCount = () => {
+  return defHttp.post({
+    url: HomeEnum.GetIServerRequestCountData,
+  });
 }
+// 空间服务支撑访问统计月度
+export const GetIServerRequestMonthCount = () => {
+  return defHttp.post({
+    url: HomeEnum.GetIServerRequestMonthCountData,
+  });
+}
+// 空间服务支撑访问统计年度
+export const GetIServerRequestYearCount = () => {
+  return defHttp.post({
+    url: HomeEnum.GetIServerRequestYearCountData,
+  });
+}
+// 组件资源申请次数
+export const GetSRResourceGroup = () => {
+  return defHttp.post({
+    url: HomeEnum.GetSRResourceGroup,
+  });
+}
+// 空间分析统计次数
+export const GetXldAnalysisStatistics = () => {
+  return xldAnalystHttp.post({
+    url: HomeEnum.BusinessStatistics
+  })
+}
+
 
 export const getHomeData = () => {
   return defHttp.get({

+ 6 - 0
src/utils/http/axios/index.ts

@@ -224,3 +224,9 @@ export const otherHttp = createAxios({
     apiUrl: 'xxx',
   },
 });
+
+export const xldAnalystHttp = createAxios({
+  requestOptions: {
+    apiUrl: '/xldAnalysisApi',
+  },
+});

+ 261 - 0
src/views/dashboard/workbench/component/AssemblyAll.vue

@@ -0,0 +1,261 @@
+
+<template>
+  <div class="spatial-analysis-statistic">
+    <div class="title">{{ title }}</div>
+    <div class="total-num">
+      <div class="label">总次数:</div>
+      <div class="data">{{ totalNum }}</div>
+    </div>
+    <div class="echart-container" id="defect-column" ref="domRef"></div>
+  </div>
+</template>
+    
+<script>
+import {
+  defineComponent,
+  reactive,
+  toRefs,
+  onMounted,
+  ref,
+  watch,
+  getCurrentInstance,
+  shallowRef,
+  onUnmounted,
+} from 'vue';
+import moment from 'moment';
+import { queryApiUseCountDays } from '/@/api/interface/interface';
+import {GetSRResourceGroup} from '/@/api/dashboard/index';
+const props = {
+  type: {
+    type: Object,
+  },
+};
+
+export default defineComponent({
+  name: 'InterfaceEveryday',
+  components: {},
+  props,
+  setup(props) {
+    const data = reactive({
+      title: '组件支撑次数',
+      interval: null,
+    });
+    const totalNum = ref(1260);
+    const domRef = ref(null);
+    const { proxy } = getCurrentInstance();
+    const echarts = proxy.$echarts;
+    const mychart = shallowRef(null);
+    /**
+     * 查询统计数据
+     */
+    const queryData = async () => {
+      // const res = await queryApiUseCountDays()
+      // const res1 = await GetSRResourceGroup()
+      // console.log(res1)
+      let xAxisData = []
+      let seriesData = [40,35,42,45,48]
+      totalNum.value = seriesData.reduce((a, b) => a + b, 0)
+      // if (res.dateArr) {
+      //   res.list.map(item => {
+      //     seriesData.push(parseInt(item))
+      //   })
+      // }
+      if (seriesData.length < 1) return;
+      const option = getOption(seriesData);
+      mychart.value.setOption(option, true);
+    };
+
+    const setEcharts = (option) => {
+      if (mychart.value) mychart.value.clear();
+      mychart.value = echarts.init(domRef.value);
+      //const option = getOption(seriesData,xAxisData);
+      window.onresize = () => {
+        mychart.value.resize();
+      };
+    };
+
+    const getOption = (seriesData) => {
+      const maxValue = Math.max.apply(null, seriesData);
+      const xAxisData = ['地图浏览工具', '服务加载工具', 'GIS功能工具', '空间分析工具', '三维可视化效果工具'];
+      const colorList = [
+        {
+          type: 'linear',
+          x: 0,
+          y: 0,
+          x2: 0,
+          y2: 1,
+          colorStops: [
+            {
+              offset: 0,
+              color: 'rgba(6,113,221,1)', // 0% 处的颜色
+            },
+            {
+              offset: 0.5,
+              color: 'rgba(6,113,221,0.9)', // 0% 处的颜色
+            },
+            {
+              offset: 1,
+              color: 'rgba(6,113,221,0)', // 100% 处的颜色
+            },
+          ],
+          global: false, // 缺省为 false
+        },
+        {
+          type: 'linear',
+          x: 0,
+          y: 0,
+          x2: 0,
+          y2: 1,
+          colorStops: [
+            {
+              offset: 0,
+              color: 'rgba(237,172,75,1)', // 0% 处的颜色
+            },
+            {
+              offset: 0.5,
+              color: 'rgba(237,172,75,0.9)', // 0% 处的颜色
+            },
+            {
+              offset: 1,
+              color: 'rgba(237,172,75,0.2)', // 100% 处的颜色   'rgba(6,113,221,0.2)'
+            },
+          ],
+          global: false, // 缺省为 false
+        },
+      ];
+      return {
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'none',  // 'shadow',
+          },
+          formatter: (params) => {
+            return params[0].name + ': ' + params[0].value + '次';
+          },
+        },
+        grid: {
+          top: '10%',
+          left: '1%',
+          right: '1%',
+          bottom: '1%',
+          containLabel: true,
+        },
+        xAxis: [
+          {
+            data: xAxisData,
+            axisTick: { show: false },
+            axisLine: { show: false },
+            axisLabel: {
+              interval:0,
+              // rotate:15,
+              color: '#000',
+              align: 'center',
+            },
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: 'rgba(222, 222, 222, 1)',
+              },
+            },
+          },
+        ],
+        yAxis: {
+          splitLine: { show: false },
+          axisTick: { show: false },
+          axisLine: { show: false },
+          axisLabel: { show: true },
+        },
+        series: [
+          {
+            name: '调用次数',
+            type: 'bar',
+            barWidth: '12',
+            data: seriesData,//[60, 52, 200, 334, 390, 330, 220, 200, 334, 390, 330, 220],
+            itemStyle: {
+              // 柱形图圆角,鼠标移上去效果,如果只是一个数字则说明四个参数全部设置为那么多
+              normal: {
+                // 柱形图圆角,初始化效果
+                borderRadius: [15, 15, 0, 0],
+                color: (params) => {
+                  let color = colorList[0];
+                  if (params.data === maxValue) color = colorList[1];
+                  return color;
+                },
+              },
+            },
+            barGap: '0%',
+          },
+        ],
+        animationDuration: 0,//这里两个动画设置可以让图表更顺滑
+        animationEasing: 'cubicInOut'//这里两个动画设置可以让图表更顺滑
+      };
+    };
+
+    onMounted(() => {
+      setEcharts();
+      queryData();
+      if (data.interval) return;
+      data.interval = setInterval(() => {
+        queryData();
+      }, 3000);
+    });
+
+    onUnmounted(() => {
+      if (data.interval) clearInterval(data.interval);
+    });
+    return {
+      totalNum,
+      domRef,
+      mychart,
+      ...toRefs(data),
+      queryData,
+      setEcharts,
+      getOption,
+    };
+  },
+});
+</script>
+<style lang="less" scoped>
+.spatial-analysis-statistic {
+  height: 100%;
+  width: 100%;
+  padding: 1rem;
+  position: relative;
+
+  .title {
+    height: 1.2rem;
+    font-family: Source Han Sans CN;
+    font-size: 1.012rem;
+    font-weight: bold;
+    line-height: normal;
+    letter-spacing: 0em;
+    color: #3d3d3d;
+    margin-bottom: 1.2rem;
+  }
+
+  .total-num {
+    position: absolute;
+    display: flex;
+    top: 10px;
+    right: 10px;
+
+    .label {
+      font-family: 思源黑体;
+      font-size: 16px;
+      color: #3D3D3D;
+    }
+
+    .data {
+      font-family: 思源黑体;
+      font-size: 18px;
+      font-weight: 500;
+      color: #0671DD;
+    }
+  }
+
+  .echart-container {
+    height: calc(100% - 2.4rem);
+    width: 100%;
+  }
+}
+</style>

Fichier diff supprimé car celui-ci est trop grand
+ 26 - 9
src/views/dashboard/workbench/component/SpatialAnnlysis.vue


+ 19 - 9
src/views/dashboard/workbench/component/TopCardStatistic.vue

@@ -22,13 +22,13 @@
     </div>
     <div class="card card3">
       <div class="data">
-        <span class="label">支持分析</span>
-        <span class="value">{{ analysisProject }}项目</span>
+        <span class="label">支撑应用</span>
+        <span class="value">{{ analysisProject }}</span>
       </div>
     </div>
     <div class="card card4">
       <div class="data">
-        <span class="label">支持数据</span>
+        <span class="label">资源访问</span>
         <span class="value">{{ supportNum }}次</span>
       </div>
     </div>
@@ -37,6 +37,8 @@
   <script lang="ts">
 import { defineComponent, onMounted, toRefs, onUnmounted, nextTick, reactive } from 'vue';
 import { queryApiUseCountMouths } from '/@/api/interface/interface';
+import {list} from '/@/api/authorize/authorize';
+import {GetIServerRequestCount} from '/@/api/dashboard/index';
 
 export default defineComponent({
   name: 'TopCardStatistic',
@@ -64,17 +66,25 @@ export default defineComponent({
      */
     const queryData = async () => {
       let supportNum = 0;
-      const res = await queryApiUseCountMouths({});
-      if (res) {
-        res.nums.map((item) => {
-          supportNum += parseInt(item);
-        });
+      let analysisProject = 0;
+      // const res = await queryApiUseCountMouths({});
+      let sysRes = await list({});
+      let supportNumRes = await GetIServerRequestCount();
+      if (supportNumRes) {
+        // res.nums.map((item) => {
+        //   supportNum += parseInt(item);
+        // });
+        // console.log(supportNumRes)
       }
+      if(sysRes){
+        analysisProject = sysRes.length;
+      }
+      data.analysisProject = analysisProject;
       data.supportNum = supportNum;
     };
 
     onMounted(() => {
-      if (data.interval) return;
+      if (data.interval) clearInterval(data.interval);
       data.interval = setInterval(() => {
         queryData();
       }, 3000);

+ 17 - 14
src/views/dashboard/workbench/index.vue

@@ -13,34 +13,34 @@
     </div>
     <div class="bottom-statistic">
       <div class="left-statistic">
-        <div class="item-statistic" style="padding-bottom:1rem;">
+        <div class="item-statistic">
           <div class="item" style="width: 100%;">
-            <SourceAll />
+            <UnstructuredStatistic />
           </div>
         </div>
-        <div class="item-statistic" style="display: flex;">
+        <!-- <div class="item-statistic" style="display: flex;">
           <div class="item" style="width: calc(50% - 0.5rem);margin-right: 1rem;">
             <spatial-annlysis/>
           </div>
           <div class="item" style="width: calc(50% - 0.5rem);">
             <interface-everyday/>
           </div>
-        </div>
+        </div> -->
       </div>
       <div class="right-statistic">
-        <!-- <div class="item-statistic" style="padding-right:1rem;padding-bottom: 1rem;">
+        <div class="item-statistic" style="padding-right:1rem;padding-bottom: 1rem;">
           <div class="item">
             <spatial-annlysis/>
           </div>
         </div>
         <div class="item-statistic" style="padding-bottom: 1rem;">
           <div class="item">
-            <interface-everyday/>
+            <SourceClassify />
           </div>
-        </div> -->
-        <div class="item-statistic" style="padding-bottom:1rem;">
+        </div>
+        <div class="item-statistic" style="padding-right:1rem;">
           <div class="item">
-            <SourceClassify />
+            <AssemblyAll/>
           </div>
         </div>
         <div class="item-statistic">
@@ -65,9 +65,10 @@ import InterfaceMonth from './component/InterfaceMonth.vue';
 import ResTypeStatistic from './component/ResTypeStatistic.vue';
 import SourceAll from './component/SourceAll.vue';
 import SourceClassify from './component/SourceClassify.vue';
+import AssemblyAll from './component/AssemblyAll.vue';
 export default defineComponent({
   name: 'dataMonitor',
-  components: { TopCardStatistic, UnstructuredStatistic, SpatialAnnlysis,InterfaceEveryday,InterfaceMonth,ResTypeStatistic, SourceAll, SourceClassify },
+  components: { TopCardStatistic,AssemblyAll, UnstructuredStatistic, SpatialAnnlysis,InterfaceEveryday,InterfaceMonth,ResTypeStatistic, SourceAll, SourceClassify },
   setup() {
     const userInfo: any = getAuthCache(USER_INFO_KEY);
     const role: string = userInfo?.roles[0];
@@ -103,7 +104,7 @@ export default defineComponent({
     width: calc(100vw - 2rem);
     border-radius: 0.3112rem;
     .left-statistic {
-      width: calc(64% - 1rem);
+      width: 36%;
       height: 100%;
       // background: #ffffff;
       border-radius: 0.3112rem;
@@ -111,7 +112,7 @@ export default defineComponent({
 
       .item-statistic {
         width: 100%;
-        height: 50%;
+        height: 100%;
         border-radius: 0.3112rem;
 
         .item{
@@ -122,13 +123,15 @@ export default defineComponent({
       }
     }
     .right-statistic {
-      width: 36%;
+      width: calc(64% - 1rem);
       height: 100%;
       border-radius: 0.3112rem;
+      display: flex;
+      flex-wrap: wrap;
       .item-statistic {
         // float: left;
         height: 50%;
-        // width: 50%;
+        width: 50%;
         border-radius: 0.3112rem;
         .item{
           height:100%;

+ 0 - 1
src/views/dataAdmin/dataAdmin/dataBackup/index.vue

@@ -82,7 +82,6 @@ export default defineComponent({
         //获取所有备份数据
         const getDataBackUp = () => {
             return new Promise((resolve, reject) => {
-                resolve([])
                 let params = {
                     keyStr: data.searchValue,
                     satrttime: data.searchDate.length ? moment(data.searchDate[0]).format('YYYY-MM-DD HH:mm:ss') : null,

+ 1 - 1
src/views/dataAdmin/dataAdmin/dataRestore/index.vue

@@ -70,9 +70,9 @@ export default defineComponent({
         //获取所有备份数据
         const getDataBackUp = () => {
             return new Promise((resolve, reject) => {
-                resolve([])
                 let params = {
                     keyStr: data.searchValue,
+                    sfhf: data.searchStatus,
                     satrttime: data.searchDate.length ? moment(data.searchDate[0]).format('YYYY-MM-DD HH:mm:ss') : null,
                     endtime: data.searchDate.length ? moment(data.searchDate[1]).format('YYYY-MM-DD HH:mm:ss') : null
                 }