Browse Source

代码提交

Zhang Li, BBF-411-2(Neusoft) 1 year ago
parent
commit
5d88ec3800

+ 1 - 1
src/api/knowledge/auditProcess.js

@@ -16,7 +16,7 @@ returnData.findAllApprovalNodes=function (parameter) {
 // 保存
 returnData.batchInsertApprovalNodes=function (parameter) {
   var url= returnData.baseUrl + '/knowledgeApprovalNode/batchInsertApprovalNodes'
-  return rxAjax.postJson(url,parameter).then (res => {
+  return rxAjax.postForm(url,parameter).then (res => {
     return res
   })
 }

+ 23 - 0
src/api/knowledge/statistics/search.js

@@ -0,0 +1,23 @@
+import rxAjax from '@/assets/js/ajax.js';
+// 栏目定义 api接口
+export const returnData = {};
+
+returnData.baseUrl= '/api-knowledge';
+
+// 各业务系统分布
+returnData.searchSystemDetailVisits=function (parameter) {
+  var url= returnData.baseUrl + '/analysis/searchSystemDetailVisits'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
+
+// 组织访问量
+returnData.organizationSearchs=function (parameter) {
+  var url= returnData.baseUrl + '/analysis/organizationSearchs'
+  return rxAjax.postJson(url,parameter).then (res => {
+    return res
+  })
+}
+
+export default returnData

+ 33 - 0
src/api/knowledge/statistics/synthesize.js

@@ -0,0 +1,33 @@
+import rxAjax from '@/assets/js/ajax.js';
+// 栏目定义 api接口
+export const returnData = {};
+
+returnData.baseUrl= '/api-knowledge';
+
+// 各板块访问量分布
+returnData.moduleUserVisits=function (parameter) {
+  var url= returnData.baseUrl + '/analysis/moduleUserVisits'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
+
+// 各板块访问量分布(UV)
+returnData.moduleUserUniqueVisits=function (parameter) {
+  var url= returnData.baseUrl + '/analysis/moduleUserUniqueVisits'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
+
+// 组织访问量
+// returnData.organizationVisits=function (parameter) {
+//   var url= returnData.baseUrl + '/analysis/organizationVisits'
+//   return rxAjax.postJson(url,parameter).then (res => {
+//     return res
+//   })
+// }
+
+returnData.organizationVisits = returnData.baseUrl + '/analysis/organizationVisits'
+
+export default returnData

+ 27 - 0
src/api/knowledge/statistics/warehouse.js

@@ -0,0 +1,27 @@
+import rxAjax from '@/assets/js/ajax.js';
+// 栏目定义 api接口
+export const returnData = {};
+
+returnData.baseUrl= '/api-knowledge';
+
+// 知识类型访问量分布
+returnData.knowledgeTypeVisitProportion=function (parameter) {
+  var url= returnData.baseUrl + '/analysis/knowledgeTypeVisitProportion'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
+
+// 各一级分类知识创建数量
+returnData.level1KnowledgeHistogram=function (parameter) {
+  var url= returnData.baseUrl + '/analysis/level1KnowledgeHistogram'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
+
+// 组织创建知识数量
+// 专辑分类搜索查询
+returnData.organizationKnowledges = returnData.baseUrl + '/analysis/organizationKnowledges'
+
+export default returnData

+ 14 - 8
src/views/modules/knowledge/statistics/components/BarEchart.vue

@@ -1,5 +1,5 @@
 <template>
-  <common-echart :option="option" height="380px"></common-echart>
+  <common-echart :option="option" height="380px" @handleLegendChange="handleLegendChange"></common-echart>
 </template>
 
 <script>
@@ -14,7 +14,11 @@ export default {
       type: Array,
       default: () => []
     },
-    barData: {
+    archiveList: {
+      type: Array,
+      default: () => []
+    },
+    wikiList: {
       type: Array,
       default: () => []
     }
@@ -41,10 +45,7 @@ export default {
               return value;
             }
           },
-          data: ['一级分类A123', '一级分类B', '一级分类C', '一级分类D', '一级分类E', '一级分类F', '一级分类G',
-          '一级分类A', '一级分类B', '一级分类C', '一级分类D', '一级分类E', '一级分类F', '一级分类G',
-          '一级分类A', '一级分类B', '一级分类C', '一级分类D', '一级分类E', '一级分类F', '一级分类G',
-          '一级分类A', '一级分类B', '一级分类C', '一级分类D', '一级分类E', '一级分类F', '一级分类G',]
+          data: this.barXData
         },
         yAxis: {
           type: "value",
@@ -112,7 +113,7 @@ export default {
         series: [
           {
             name: '文档知识',
-            data: [120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110, 130,120, 200, 150, 80, 70, 110, 130,120, 200, 150, 80, 70, 110, 130],
+            data: this.archiveList,
             type: "bar",
             barGap: 0, 
             showBackground: false,
@@ -137,7 +138,7 @@ export default {
           },
           {
             name: '维基知识',
-            data: [250, 200, 150, 80, 70, 110, 130,120, 200, 150, 80, 70, 110, 130,120, 200, 150, 80, 70, 110, 130,120, 200, 150, 80, 70, 110, 130],
+            data: this.wikiList,
             type: "bar",
             showBackground: false,
             barWidth: '10px',
@@ -162,6 +163,11 @@ export default {
         ]
       };
     }
+  },
+  methods: {
+    handleLegendChange(arg) {
+      this.$emit('handleLegendChange',arg)
+    }
   }
 };
 </script>

+ 1 - 1
src/views/modules/knowledge/statistics/components/card.vue

@@ -18,7 +18,7 @@ export default {
       type: String
     },
     num: {
-      type: String
+      type: Number
     },
     picture: {
       type: String

+ 7 - 3
src/views/modules/knowledge/statistics/components/commonEchart.vue

@@ -48,14 +48,18 @@ export default {
         echarts.init(document.getElementById("baseEchart")).resize();
       });
     });
-  },
-  computed: {
-
   },
   methods: {
      _initEchart() {
       const echartInstance = echarts.init(this.$refs.baseEchartRef);
+      
       echartInstance.setOption(this.option);
+      echartInstance.off('legendselectchanged') //解决重复触发
+      echartInstance.on('legendselectchanged', (e) => {
+        // console.log(e)
+        // console.log('点击了') // 如果不加off事件,就会叠加触发
+        this.$emit('handleLegendChange',e)
+      })
       // 监听window尺寸的变化
       // echartInstance.resize();
       // window.addEventListener("resize", () => {

+ 3 - 1
src/views/modules/knowledge/statistics/components/topNav.vue

@@ -4,7 +4,7 @@
       <div class="content">
         <div>
           <span>{{ title }}</span>
-          <span>更新时间: {{ time }}</span>
+          <!-- <span>更新时间: {{ time }}</span> -->
         </div>
         <div>
           <span v-for="(item,index) in lookData" 
@@ -38,7 +38,9 @@ export default {
   },
   methods: {
     handleSearchClick(index) {
+      if(this.lookIndex == index) return
       this.lookIndex = index
+      this.$emit('handleTypeChange',index)
     }
   }
 }

+ 141 - 76
src/views/modules/knowledge/statistics/search.vue

@@ -3,7 +3,7 @@
     <div slot="center" style>
       <rx-fit>   
         <div slot="toolheader" border="false" foldbtn="false">
-          <top-nav title="搜索服务统计" time="2021-10-15 10:00:01"></top-nav>
+          <top-nav title="搜索服务统计" time="2021-10-15 10:00:01" @handleTypeChange="handleTypeChange"></top-nav>
         </div>    
         <div class="echart-style">
           <div style="width:58%;">
@@ -25,17 +25,23 @@
              组织访问量TOP10
              <span>(pv)</span>
           </div>
-          <rx-grid
-            style="background: #fff;min-height: 400px;"
-            :columns="columns"
-            :url="api.findAllKnowledge"
-            :queryParam="queryParam"
-            data-field="result.data"
-            :heightAuto="true"
-            :showPage="false"
-            idField="pkId"
-          > 
-          </rx-grid>
+          <div style="position:relative">
+            <div class="frontLoading" v-if="loading">
+              <span style="display: inline-block">
+                <a-spin />
+                <span style="color:rgba(0, 0, 0, 0.5);margin-left: 5px;font-size: 14px;">加载中...</span>
+              </span>
+            </div>
+            <a-table style="background: #fff;min-height: 400px;" 
+              :columns="columns" 
+              :data-source="dataSource" 
+              :heightauto="true" 
+              :pagination="false"
+              :scroll="{ x: 800}"
+              @change="handleSortChange">
+            </a-table>
+          </div> 
+
         </div>
       </rx-fit>
     </div> 
@@ -46,7 +52,7 @@
 import topNav from './components/topNav'
 import lineEchart from './components/LineEchart';
 import roseEchart from './components/RoseEchart';
-import api from '@/api/knowledge/manage'
+import api from '@/api/knowledge/statistics/search';
 export default {
   name: 'synthesize',
   components: {
@@ -57,76 +63,123 @@ export default {
   data() {
     return {
       api,
+      loading: false,
+      look: 'month',
+      lookData: ['month','year','total'],
       barData: [0, 200, 901, 300, 1290, 133,1, 200, 901, 300, 1290, 0],
-      roseData: [
-        { value: 19, name: '19% 平展系统' },
-        { value: 40, name: '40% 工作管理系统' },
-        { value: 20, name: '20% EIP系统' },
-        { value: 21, name: '21% 网盘系统' },
-        { value: 21, name: '21% 知识管理系统' }
-      ],
-      queryParam: {},
-      columns:  [
-        {
-          title: '公司名称',
-          dataIndex: 'author',
-          align: 'center',
-        },
-        {
-          title: '访问总量',
-          dataIndex: 'author',
-          align: 'center',
-          sorter: true,
-          sortField: 'author'
-        },
-        {
-          title: '知识管理系统',
-          dataIndex: 'author',
-          align: 'center',
-          sorter: true,
-          sortField: 'author'
-        },
-        {
-          title: 'EIP系统',
-          dataIndex: 'author',
-          align: 'center',
-          sorter: true,
-          sortField: 'author'
-        },
-        {
-          title: 'DCC系统',
-          dataIndex: 'author',
-          align: 'center',
-          sorter: true,
-          sortField: 'author'
-        },
-        {
-          title: '工作管理系统',
-          dataIndex: 'author',
-          align: 'center',
-          sorter: true,
-          sortField: 'author'
+      roseData: [],
+      queryParam: {
+        page: 1,
+        pageSize: 10,
+        params: {
+          type: 'month',
+          tops: 10
         },
-         {
-          title: '平展系统',
-          dataIndex: 'author',
-          align: 'center',
-          sorter: true,
-          sortField: 'author'
-        },
-         {
-          title: '网盘系统',
-          dataIndex: 'author',
-          align: 'center',
-          sorter: true,
-          sortField: 'author'
-        }
-      ]
+        sortField: '',
+        sortOrder: 'asc'
+      },
+      columns:  [
+        // {
+        //   title: '公司名称',
+        //   dataIndex: 'company',
+        //   align: 'center',
+        // },
+        // {
+        //   title: '访问总量',
+        //   dataIndex: 'total',
+        //   align: 'center',
+        //   sorter: true,
+        //   sortField: 'total'
+        // },
+        // {
+        //   title: '知识管理系统',
+        //   dataIndex: 'zs',
+        //   align: 'center',
+        //   sorter: true,
+        //   sortField: 'zs'
+        // },
+        // {
+        //   title: 'EIP系统',
+        //   dataIndex: 'eip',
+        //   align: 'center',
+        //   sorter: true,
+        //   sortField: 'eip'
+        // },
+        // {
+        //   title: 'DCC系统',
+        //   dataIndex: 'dcc',
+        //   align: 'center',
+        //   sorter: true,
+        //   sortField: 'dcc'
+        // },
+        // {
+        //   title: '工作管理系统',
+        //   dataIndex: 'gz',
+        //   align: 'center',
+        //   sorter: true,
+        //   sortField: 'gz'
+        // },
+        //  {
+        //   title: '平展系统',
+        //   dataIndex: 'pz',
+        //   align: 'center',
+        //   sorter: true,
+        //   sortField: 'pz'
+        // },
+        // {
+        //   title: '网盘系统',
+        //   dataIndex: 'wp',
+        //   align: 'center',
+        //   sorter: true,
+        //   sortField: 'wp'
+        // }
+      ],
+      dataSource: []
     }
   },
   created() {
+    this.init()
   },
   methods: {
+    init() {
+      api.searchSystemDetailVisits({type: this.look}).then(res => {
+        if(res.code == 200) {
+          let data = res.data
+          this.roseData = data.map(item => {
+            return {
+              value: item.value,
+              name: (item.percentage.toFixed(2))*100+`% ${item.label}`
+            }
+          })
+        }
+      })
+      this.loading = true
+      api.organizationSearchs(this.queryParam).then(res => {
+        if(res.code == 200) {
+          let data = res.data
+          data.columns.forEach(item => {
+            item.align = "center"
+            item.sorter = item.sortFiled ? true : false
+          })
+          this.columns = data.columns
+          this.dataSource = data.rows
+          this.loading = false
+        } else {
+          this.loading = false
+        }
+      })
+
+    },
+    handleSortChange(pagination, filters, sorter) {
+      this.queryParam.sortField = sorter.columnKey
+      this.queryParam.sortOrder = sorter.order.substring(0,sorter.order.length-3)
+      this.init()
+    },
+    handleTypeChange(index) {
+      this.look = this.lookData[index]
+      this.queryParam.type = this.lookData[index]
+      this.init()
+    },
   }
 }
 </script>
@@ -191,6 +244,18 @@ export default {
     }
   }
 }
+.frontLoading {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(248,248,248,0.5);
+  align-items: center;
+  justify-content: center;
+  display: flex;
+  text-align: center;
+  font-size: 16px;
+  z-index: 10000;
+}
 </style>
 <style scoped>
 /deep/   .divdefault {

+ 58 - 20
src/views/modules/knowledge/statistics/synthesize.vue

@@ -3,7 +3,7 @@
     <div slot="center" style>
       <rx-fit>   
         <div slot="toolheader" border="false" foldbtn="false">
-          <top-nav title="综合统计" time="2021-10-15 10:00:01"></top-nav>
+          <top-nav title="综合统计" time="2021-10-15 10:00:01" @handleTypeChange="handleTypeChange"></top-nav>
         </div>    
         <div class="echart-style">
           <div style="width:58%;">
@@ -21,10 +21,10 @@
           </div>
         </div>
         <div class="card-style">
-          <little-card title="知识地图访问量(uv)" num="2696" :picture="mapPicture"></little-card>
-          <little-card title="知识专辑访问量(uv)" num="2696" :picture="albumPicture"></little-card>
-          <little-card title="知识仓库访问量(uv)" num="2696" :picture="warehousePicture"></little-card>
-          <little-card title="搜索服务访问量(uv)" num="2696" :picture="searchPicture"></little-card>
+          <little-card title="知识地图访问量(uv)" :num="cardInfo.map" :picture="mapPicture"></little-card>
+          <little-card title="知识专辑访问量(uv)" :num="cardInfo.album" :picture="albumPicture"></little-card>
+          <little-card title="知识仓库访问量(uv)" :num="cardInfo.knowledge" :picture="warehousePicture"></little-card>
+          <little-card title="搜索服务访问量(uv)" :num="cardInfo.search" :picture="searchPicture"></little-card>
         </div>
         <div class="table-style">
           <div>
@@ -32,9 +32,10 @@
              <span>(pv)</span>
           </div>
           <rx-grid
+            ref="synthesizeRef"
             style="background: #fff;min-height: 400px;"
             :columns="columns"
-            :url="api.findAllKnowledge"
+            :url="api.organizationVisits"
             :queryParam="queryParam"
             data-field="result.data"
             :heightAuto="true"
@@ -57,7 +58,7 @@ import mapPicture from '@/assets/img/map.png'
 import albumPicture from '@/assets/img/album.png'
 import warehousePicture from '@/assets/img/warehouse.png'
 import searchPicture from '@/assets/img/search.png'
-import api from '@/api/knowledge/manage'
+import api from '@/api/knowledge/statistics/synthesize';
 export default {
   name: 'synthesize',
   components: {
@@ -73,6 +74,8 @@ export default {
       albumPicture,
       warehousePicture,
       searchPicture,
+      look: 'month',
+      lookData: ['month','year','total'],
       barData: [0, 200, 901, 300, 1290, 133,1, 200, 901, 300, 1290, 0],
       roseData: [
         { value: 19, name: '19% 知识仓库' },
@@ -80,54 +83,89 @@ export default {
         { value: 20, name: '20% 知识专辑' },
         { value: 21, name: '21% 搜索服务' }
       ],
-      queryParam: {},
+      cardInfo: {},
+      queryParam: {
+        type: 'month',
+        tops: 10
+      },
       columns:  [
         {
           title: '公司名称',
-          dataIndex: 'author',
+          dataIndex: 'company',
           align: 'center',
         },
         {
           title: '总访问量',
-          dataIndex: 'author',
+          dataIndex: 'total',
           align: 'center',
           sorter: true,
-          sortField: 'author'
+          sortField: 'total'
         },
         {
           title: '知识仓库访问量',
-          dataIndex: 'author',
+          dataIndex: 'knowledge',
           align: 'center',
           sorter: true,
-          sortField: 'author'
+          sortField: 'knowledge'
         },
         {
           title: '知识专辑访问量',
-          dataIndex: 'author',
+          dataIndex: 'album',
           align: 'center',
           sorter: true,
-          sortField: 'author'
+          sortField: 'album'
         },
         {
           title: '知识地图访问量',
-          dataIndex: 'author',
+          dataIndex: 'map',
           align: 'center',
           sorter: true,
-          sortField: 'author'
+          sortField: 'map'
         },
         {
           title: '搜索服务访问量',
-          dataIndex: 'author',
+          dataIndex: 'search',
           align: 'center',
           sorter: true,
-          sortField: 'author'
+          sortField: 'search'
         },
-      ]
+      ],
     }
   },
   created() {
+    this.init()
   },
   methods: {
+    init() {
+      api.moduleUserVisits({type: this.look}).then(res => {
+        if(res.code == 200) {
+          let data = res.data
+          let knowTypeList = []
+          knowTypeList.push({'value': data.knowledge, 'name': data.knowledgePercentage*100 + '% 知识仓库'})
+          knowTypeList.push({'value': data.map, 'name': data.mapPercentage*100 + '% 文档知识'})
+          knowTypeList.push({'value': data.album, 'name': data.albumPercentage*100 + '% 文档知识'})
+          knowTypeList.push({'value': data.search, 'name': data.searchPercentage*100 + '% 文档知识'})
+          this.roseData = knowTypeList
+        }
+      })
+      api.moduleUserUniqueVisits({type: this.look}).then(res => {
+        if(res.code == 200) {
+          let data = res.data
+          this.cardInfo = {
+            map: data.map,
+            album: data.album,
+            knowledge: data.knowledge,
+            search: data.search
+          }
+        }
+      })
+    },
+    handleTypeChange(index) {
+      this.look = this.lookData[index]
+      this.queryParam.type = this.lookData[index]
+      this.init()
+      this.$refs.synthesizeRef.loadData()
+    },
   }
 }
 </script>

+ 61 - 16
src/views/modules/knowledge/statistics/warehouse.vue

@@ -3,7 +3,7 @@
     <div slot="center" style>
       <rx-fit>   
         <div slot="toolheader" border="false" foldbtn="false">
-          <top-nav title="知识仓库统计" time="2021-10-15 10:00:01"></top-nav>
+          <top-nav title="知识仓库统计" time="2021-10-15 10:00:01" @handleTypeChange="handleTypeChange"></top-nav>
         </div>    
         <div class="echart-style">
           <div style="width:58%;">
@@ -23,16 +23,17 @@
         <div class="bar-style">
           <div>各一级分类知识创建数量
           </div>
-          <bar-echart></bar-echart>
+          <bar-echart :barXData="classifyList" :archiveList="archiveList" :wikiList="wikiList" @handleLegendChange="handleLegendChange"></bar-echart>
         </div>
         <div class="table-style">
           <div>
              组织创建知识数量TOP10
           </div>
           <rx-grid
+            ref="warehouseRef"
             style="background: #fff;min-height: 400px;"
             :columns="columns"
-            :url="api.findAllKnowledge"
+            :url="api.organizationKnowledges"
             :queryParam="queryParam"
             data-field="result.data"
             :heightAuto="true"
@@ -51,7 +52,7 @@ import topNav from './components/topNav'
 import lineEchart from './components/LineEchart';
 import roseEchart from './components/RoseEchart';
 import barEchart from './components/BarEchart';
-import api from '@/api/knowledge/manage';
+import api from '@/api/knowledge/statistics/warehouse';
 export default {
   name: 'synthesize',
   components: {
@@ -63,45 +64,89 @@ export default {
   data() {
     return {
       api,
+      look: 'month',
+      lookData: ['month','year','total'],
       barData: [0, 200, 901, 300, 1290, 133,1, 200, 901, 300, 1290, 0],
-      roseData: [ 
-        { value: 70, name: '70% 文档知识' },
-        { value: 30, name: '19% 维基知识' },
-      ],
-      queryParam: {},
+      roseData: [],
+      knowledgeType: 'wikiDesc',
+      classifyList: [],
+      archiveList: [],
+      wikiList: [],
+      queryParam: {
+        tops: '10',
+        type: 'month'
+      },
       columns:  [
         {
           title: '公司名称',
-          dataIndex: 'author',
+          dataIndex: 'company',
           align: 'center',
         },
         {
           title: '知识总量',
-          dataIndex: 'author',
+          dataIndex: 'total',
           align: 'center',
           sorter: true,
-          sortField: 'author'
+          sortField: 'total'
         },
         {
           title: '文档知识数量',
-          dataIndex: 'author',
+          dataIndex: 'archive',
           align: 'center',
           sorter: true,
-          sortField: 'author'
+          sortField: 'archive'
         },
         {
           title: '维基知识数量',
-          dataIndex: 'author',
+          dataIndex: 'wiki',
           align: 'center',
           sorter: true,
-          sortField: 'author'
+          sortField: 'wiki'
         }
       ]
     }
   },
   created() {
+    this.init()
   },
   methods: {
+    init() {
+      api.knowledgeTypeVisitProportion({type: this.look}).then(res => {
+        if(res.code == 200) {
+          let data = res.data
+          let knowTypeList = []
+          knowTypeList.push({'value': data.wiki, 'name': data.wikiPercentage*100 + '% 文档知识'})
+          knowTypeList.push({'value': data.archive, 'name': data.archivePercentage*100 + '% 文档知识'})
+          this.roseData = knowTypeList
+        }
+      })
+      this.getBarData()
+    },
+    getBarData() {
+      api.level1KnowledgeHistogram({type: this.look, sort: this.knowledgeType}).then(res => {
+        if(res.code == 200) {
+          let data = res.data
+          this.classifyList = data.map(item => {return item.label})
+          this.archiveList = data.map(item => {return item.archive})
+          this.wikiList = data.map(item => {return item.wiki})
+        }
+      })
+    },
+    handleTypeChange(index) {
+      this.look = this.lookData[index]
+      this.queryParam.type = this.lookData[index]
+      this.init()
+      this.$refs.warehouseRef.loadData()
+    },
+    handleLegendChange(arg) {
+      if(arg.selected['维基知识'] == true) {
+        this.knowledgeType = 'wikiDesc'
+        this.getBarData()
+      } else {
+        this.knowledgeType = 'archiveDesc'
+        this.getBarData()
+      }
+    }
   }
 }
 </script>

+ 2 - 2
vue.config.js

@@ -156,10 +156,10 @@ const vueConfig = {
     proxy: {
         '/api-knowledge': {
             // target: 'http://10.5.100.64:5208',
-            target: 'http://10.5.100.230:9009',//服务器
+            // target: 'http://10.5.100.230:9009',//服务器
             // target: 'http://www.hkcqjy.com.cn:8088',
             // target: 'http://192.168.0.185:7206',    // 张哲
-            // target: 'http://192.168.0.205:7206',//柳哥
+            target: 'http://192.168.0.205:7206',//柳哥
             // target: 'http://10.5.0.233:9900',
             // target: 'http://10.5.100.64:9900',
             pathRewrite: { '^/api': '' },