Browse Source

提交代码

zhangli 1 year ago
parent
commit
acda18abbd

+ 38 - 5
src/api/knowledge/statistics.js

@@ -4,15 +4,41 @@ export const returnData = {};
 
 
 returnData.baseUrl= '/api-knowledge/analysis';
 returnData.baseUrl= '/api-knowledge/analysis';
 // 组织访问量
 // 组织访问量
-returnData.organizationVisits = returnData.baseUrl + '/organizationVisits'
+returnData.organizationVisits=function (parameter) {
+  var url= returnData.baseUrl + '/organizationVisit'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
 // 组织创建知识数量
 // 组织创建知识数量
-returnData.organizationKnowledges = returnData.baseUrl + '/organizationKnowledges'
+returnData.organizationKnowledges=function (parameter) {
+  var url= returnData.baseUrl + '/organizationKnowledge'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
 //组织创建和访问专辑数量
 //组织创建和访问专辑数量
-returnData.organizationAlbums = returnData.baseUrl + '/organizationAlbums'
+returnData.organizationAlbums=function (parameter) {
+  var url= returnData.baseUrl + '/organizationAlbum'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
 //组织创建和访问地图数量
 //组织创建和访问地图数量
-returnData.organizationMaps = returnData.baseUrl + '/organizationMaps'
+returnData.organizationMaps=function (parameter) {
+  var url= returnData.baseUrl + '/organizationMap'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
 //组织访问量
 //组织访问量
-returnData.organizationSearchs = returnData.baseUrl + '/organizationSearchs'
+returnData.organizationSearchs=function (parameter) {
+  var url= returnData.baseUrl + '/organizationSearch'
+  return rxAjax.get(url,parameter).then (res => {
+    return res
+  })
+}
+
 // 用户访问总量
 // 用户访问总量
 returnData.totalUserVisits=function (parameter) {
 returnData.totalUserVisits=function (parameter) {
   var url= returnData.baseUrl + '/totalUserVisits'
   var url= returnData.baseUrl + '/totalUserVisits'
@@ -117,6 +143,13 @@ returnData.organizationSearchsColumns=function (parameter) {
     return res
     return res
   })
   })
 }
 }
+//查询数据
+returnData.searchGroups=function (parameter) {
+  var url= '/api-knowledge/common/searchGroups'
+  return rxAjax.postJson(url,parameter).then (res => {
+    return res
+  })
+}
 
 
 //获取当前时间
 //获取当前时间
 returnData.getNowDate=function(){
 returnData.getNowDate=function(){

+ 8 - 5
src/views/modules/knowledge/statistics/album.vue

@@ -35,9 +35,10 @@
         </div>
         </div>
         <div class="table-style">
         <div class="table-style">
           <div>
           <div>
-             组织创建和访问专辑数量TOP10
+             组织创建和访问专辑数量
           </div>
           </div>
-          <rx-grid
+          <DataShow :type="type" interface="2"></DataShow>
+          <!--<rx-grid
             ref="table"
             ref="table"
             style="background: #fff;min-height: 400px;"
             style="background: #fff;min-height: 400px;"
             :columns="columns"
             :columns="columns"
@@ -48,7 +49,7 @@
             :showPage="false"
             :showPage="false"
             idField="pkId"
             idField="pkId"
           > 
           > 
-          </rx-grid>
+          </rx-grid>-->
         </div>
         </div>
       </rx-fit>
       </rx-fit>
     </div> 
     </div> 
@@ -63,6 +64,7 @@ import lineEchart from './components/LineEchart';
 import pieEchart from './components/PieEchart';
 import pieEchart from './components/PieEchart';
 import barEchart from './components/BarEchart';
 import barEchart from './components/BarEchart';
 import statistics from '@/api/knowledge/statistics'
 import statistics from '@/api/knowledge/statistics'
+import DataShow from './components/DataShow';
 export default {
 export default {
   name: 'synthesize',
   name: 'synthesize',
   components: {
   components: {
@@ -71,7 +73,8 @@ export default {
     pieEchart,
     pieEchart,
     barEchart,
     barEchart,
     pieChange,
     pieChange,
-    roseEchart
+    roseEchart,
+    DataShow
   },
   },
   data() {
   data() {
     return {
     return {
@@ -304,7 +307,7 @@ export default {
     background-color: #fff;
     background-color: #fff;
     margin-top: 20px;
     margin-top: 20px;
     padding: 20px 30px;
     padding: 20px 30px;
-
+    display: inline-block;
     >div:first-child {
     >div:first-child {
       position: relative;
       position: relative;
       font-weight: bold;
       font-weight: bold;

+ 247 - 0
src/views/modules/knowledge/statistics/components/DataShow.vue

@@ -0,0 +1,247 @@
+<template>
+  <div>
+    <a-form ref="searchForm" layout="inline" style="display:flex;flex-wrap: wrap;">
+      <a-form-item
+        class="form-item-style"
+        label="组织名称"
+        name="title">
+        <a-input class="set-input" v-model="searchValue" placeholder="请输入"/>
+      </a-form-item>
+      <div style="display:flex;justify-content:center;margin-top: 3px;margin-left: 10px;">
+        <a-button @click="handleResetClick" style="margin-right:8px">重置</a-button>
+        <a-button type="primary" @click="handleSearchClick">查询</a-button>
+      </div>
+    </a-form>
+    <rx-grid
+        style="width:50%;height: 20vw;float: left;"
+        class="rx-tree-title"
+        ref="table"
+        :multiSelect="true"
+        :showPage="false"
+        :columns="columnsNew"
+        :defaultPageSize="10"
+        :dataSource="tableData"
+        @rowExpand="rowExpand"
+        :expandIconColumnIndex="0"
+        :idField="'groupId'"
+    >
+      <div  slot="name" class="rx-table-row-icon" slot-scope="{text,record}">
+        
+        <div v-if="checkId==record.pkId" style="color:#1890ff;" class="telist rx-tree-title" :title="text">{{text}}-{{ record.pkId }}</div>
+        <div v-else @click="checklist(record)" class="telist rx-tree-title" :title="text">{{text}}-{{ record.pkId }}</div>
+      </div>
+    </rx-grid>
+    <div class="rightDetail">
+      <div class="rightDetailtop">访问量明细</div>
+      <div class="rightDetailBottom" v-if="interface==0">
+        组织路径:{{showData.organization}} </br>
+        总访问量: {{showData.total}} </br>
+        知识仓库访问量:{{showData.knowledge}} </br>
+        知识专辑访问量:{{showData.album}} </br>
+        知识地图访问量:{{showData.map}} </br>
+        搜索服务访问量:{{showData.search}}
+      </div>
+      <div class="rightDetailBottom" v-if="interface==1">
+        组织路径:{{showData.organization}} </br>
+        知识总量: {{showData.total}} </br>
+        文档知识数量:{{showData.archive}} </br>
+        维基知识数量:{{showData.wiki}}
+      </div>
+      <div class="rightDetailBottom" v-if="interface==2">
+        组织路径:{{showData.organization}} </br>
+        专辑创建总量: {{showData.album}} </br>
+        专辑访问量pv:{{showData.pv}} 
+      </div>
+      <div class="rightDetailBottom" v-if="interface==3">
+        组织路径:{{showData.organization}} </br>
+        地图创建总量: {{showData.map}} </br>
+        地图访问量pv:{{showData.pv}} 
+      </div>
+      <div class="rightDetailBottom" v-if="interface==4">
+        组织路径:{{showData.organization}} </br>
+        <p v-for="(item,index) in showData.item">{{item.name}}: {{item.value}} </p>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import OsGroupApi from '@/api/user/org/osGroup'
+import statistics from '@/api/knowledge/statistics'
+export default {
+  name: 'topNav',
+  props: {
+    type: {
+      type: String
+    },
+    interface: {
+      type: String
+    }
+  },
+  data() {
+    return {
+      interface:this.interface,
+      checkId:null,
+      searchValue:'',
+      showData:{},
+      tableData:[],
+      columnsNew: [
+        {
+          title: '组名',
+          width:250,
+          dataIndex: 'name',
+          ellipsis: true,
+          scopedSlots: { customRender: 'name' }
+        }
+
+      ],
+    }
+  },
+  mounted() {
+    this.getTreeData()
+  },
+  methods: {
+    //点击
+    checklist(data){
+      this.checkId=data.pkId
+      this.getData()
+    },
+    getData(){
+      if(this.checkId==null){
+        return false
+      }
+      let getData={
+        type:this.type,
+        organizationId:this.checkId
+      }
+      if(this.interface==0){
+        statistics.organizationVisits(getData).then(result => {
+          this.showData=result.data
+        })
+      }
+      if(this.interface==1){
+        statistics.organizationKnowledges(getData).then(result => {
+          this.showData=result.data
+        })
+      }
+      if(this.interface==2){
+        statistics.organizationAlbums(getData).then(result => {
+          this.showData=result.data
+        })
+      }
+      if(this.interface==3){
+        statistics.organizationMaps(getData).then(result => {
+          this.showData=result.data
+        })
+      }
+      if(this.interface==4){
+        statistics.organizationSearchs(getData).then(result => {
+          this.showData=result.data
+        })
+      }
+    },
+    //查询
+    handleSearchClick(){
+      if(this.searchValue==''){
+        this.getTreeData()
+      }else{
+        let getData={
+          "sortOrder": "asc",
+          "params": {
+            "Q_DIM_ID__S_EQ": "1",
+            "Q_RANK_LEVEL__S_EQ": null,
+            "Q_NAME__S_LK": this.searchValue,
+            "Q_GROUP_ID__S_NEQ": ""
+          }
+        }
+        statistics.searchGroups(getData).then(result => {
+          result=this.treeData(result);
+          this.tableData = result;
+        })
+      }
+    },
+    //重置
+    handleResetClick(){
+      this.searchValue=''
+      this.getTreeData()
+    },
+    //组织结构
+    getTreeData(){
+      OsGroupApi.queryGroups(1,"0","yes").then(result => {
+          result.data=this.treeData(result.data);
+          this.tableData = result.data;
+      })
+      //清除下拉的数据
+      this.$refs.table.expandedRowKeys=[];
+    },
+    //异步加载组织
+    rowExpand(expanded,record){
+        var self=this;
+        if(expanded&&record.children&&record.children.length==0){
+          OsGroupApi.queryGroups(1,record.groupId,"yes").then(result => {
+                result.data=this.treeData(result.data);
+                self.updateData(self.tableData,result.data,record.groupId);
+                this.$refs.table.loadData();
+            })
+        }
+    },
+    //判断下级是否有子级
+    treeData(data){
+        for (var i = 0; i <data.length ; i++) {
+            if(data[i].childAmount>0){
+                data[i].children=[];
+            }
+        }
+        return data;
+    },
+    //更新数据到tableData中
+    updateData(tableData,data,groupId){
+        for (var i = 0; i <tableData.length ; i++) {
+            if(tableData[i].groupId==groupId){
+                tableData[i].children=data;
+                break;
+            }else {
+                if(tableData[i].childAmount>0){
+                    this.updateData(tableData[i].children,data,groupId);
+                }
+            }
+        }
+    }
+  },
+  watch: {
+    "type"(){
+      this.getData()
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.rx-tree-title{
+  white-space: normal;
+  overflow: hidden;
+}
+.telist{
+  cursor: pointer;
+}
+.rightDetail{
+  width: 50%;
+  float: right;
+  border-left: 1px solid #e8e8e8;
+  height: 20vw;
+}
+.rightDetailtop{
+  background: #fafafa;
+  border-bottom: 1px solid #e8e8e8;
+  width: 100%;
+  text-align: center;
+  height:54px;
+  line-height:54px;
+}
+.rightDetailBottom{
+  text-align: center;
+  line-height: 30px;
+  background: #fff;
+  height: calc(100% - 54px);
+}
+</style>

+ 6 - 3
src/views/modules/knowledge/statistics/components/RoseEchart.vue

@@ -18,6 +18,7 @@ export default {
   computed: {
   computed: {
     option() {
     option() {
       return {
       return {
+        showheigh:true,
         tooltip: {
         tooltip: {
           show: true,
           show: true,
           trigger: 'item',
           trigger: 'item',
@@ -30,20 +31,22 @@ export default {
         series: [
         series: [
           {
           {
             type: 'pie',
             type: 'pie',
+            startAngle:60,
             radius: '70%',
             radius: '70%',
             center: ['50%', '50%'],
             center: ['50%', '50%'],
             data: this.roseData,
             data: this.roseData,
-            roseType: 'radius',
+           
             labelLine: {
             labelLine: {
               lineStyle: {
               lineStyle: {
                 color: '#000',
                 color: '#000',
                 width: 0.5
                 width: 0.5
               },
               },
               length: 10,
               length: 10,
-              length2: 20
+              length2: 30
             },
             },
             emphasis: {
             emphasis: {
-              disabled: true
+              disabled: true,
+              scaleSize:20
             }
             }
           }
           }
         ],
         ],

+ 10 - 0
src/views/modules/knowledge/statistics/components/commonEchart.vue

@@ -60,6 +60,16 @@ export default {
           that.$emit('legendselectchanged',params.selected)
           that.$emit('legendselectchanged',params.selected)
         }
         }
       });
       });
+      if(that.option.showheigh){
+        let indexOfMax = 0;
+        let max = that.option.series[0].data.reduce( (a,c,i) => c.value > a ? (indexOfMax = i,c.value) : a, 0)
+        echartInstance.dispatchAction({
+          type: 'highlight',
+          seriesIndex: 0,
+          dataIndex: indexOfMax
+        });
+      }
+      
       // 监听window尺寸的变化
       // 监听window尺寸的变化
       // echartInstance.resize();
       // echartInstance.resize();
       // window.addEventListener("resize", () => {
       // window.addEventListener("resize", () => {

+ 8 - 5
src/views/modules/knowledge/statistics/map.vue

@@ -35,9 +35,10 @@
         </div>
         </div>
         <div class="table-style">
         <div class="table-style">
           <div>
           <div>
-            组织创建和访问地图数量TOP10
+            组织创建和访问地图数量
           </div>
           </div>
-          <rx-grid
+          <DataShow :type="type" interface="3"></DataShow>
+          <!--<rx-grid
             ref="table"
             ref="table"
             style="background: #fff;min-height: 400px;"
             style="background: #fff;min-height: 400px;"
             :columns="columns"
             :columns="columns"
@@ -48,7 +49,7 @@
             :showPage="false"
             :showPage="false"
             idField="pkId"
             idField="pkId"
           > 
           > 
-          </rx-grid>
+          </rx-grid>-->
         </div>
         </div>
       </rx-fit>
       </rx-fit>
     </div> 
     </div> 
@@ -63,6 +64,7 @@ import pieChange from './components/pieChange'
 import pieEchart from './components/PieEchart';
 import pieEchart from './components/PieEchart';
 import barEchartOne from './components/BarEchartOne';
 import barEchartOne from './components/BarEchartOne';
 import statistics from '@/api/knowledge/statistics'
 import statistics from '@/api/knowledge/statistics'
+import DataShow from './components/DataShow';
 export default {
 export default {
   name: 'synthesize',
   name: 'synthesize',
   components: {
   components: {
@@ -71,7 +73,8 @@ export default {
     roseEchart,
     roseEchart,
     barEchartOne,
     barEchartOne,
     pieChange,
     pieChange,
-    pieEchart
+    pieEchart,
+    DataShow
   },
   },
   data() {
   data() {
     return {
     return {
@@ -297,7 +300,7 @@ export default {
     background-color: #fff;
     background-color: #fff;
     margin-top: 20px;
     margin-top: 20px;
     padding: 20px 30px;
     padding: 20px 30px;
-
+    display: inline-block;
     >div:first-child {
     >div:first-child {
       position: relative;
       position: relative;
       font-weight: bold;
       font-weight: bold;

+ 7 - 4
src/views/modules/knowledge/statistics/search.vue

@@ -27,7 +27,8 @@
              组织访问量TOP10
              组织访问量TOP10
              <span>(pv)</span>
              <span>(pv)</span>
           </div>
           </div>
-          <rx-grid
+          <DataShow :type="type" interface="4"></DataShow>
+          <!--<rx-grid
             ref="table"
             ref="table"
             style="background: #fff;min-height: 400px;"
             style="background: #fff;min-height: 400px;"
             :columns="columns"
             :columns="columns"
@@ -38,7 +39,7 @@
             :showPage="false"
             :showPage="false"
             idField="pkId"
             idField="pkId"
           > 
           > 
-          </rx-grid>
+          </rx-grid>-->
         </div>
         </div>
       </rx-fit>
       </rx-fit>
     </div> 
     </div> 
@@ -52,6 +53,7 @@ import lineEchart from './components/LineEchart';
 import roseEchart from './components/RoseEchart';
 import roseEchart from './components/RoseEchart';
 import pieEchart from './components/PieEchart';
 import pieEchart from './components/PieEchart';
 import statistics from '@/api/knowledge/statistics'
 import statistics from '@/api/knowledge/statistics'
+import DataShow from './components/DataShow';
 export default {
 export default {
   name: 'synthesize',
   name: 'synthesize',
   components: {
   components: {
@@ -59,7 +61,8 @@ export default {
     lineEchart,
     lineEchart,
     roseEchart,
     roseEchart,
     pieEchart,
     pieEchart,
-    pieChange
+    pieChange,
+    DataShow
   },
   },
   data() {
   data() {
     return {
     return {
@@ -196,7 +199,7 @@ export default {
     background-color: #fff;
     background-color: #fff;
     margin-top: 20px;
     margin-top: 20px;
     padding: 20px 30px;
     padding: 20px 30px;
-
+    display: inline-block;
     >div:first-child {
     >div:first-child {
       position: relative;
       position: relative;
       font-weight: bold;
       font-weight: bold;

+ 10 - 6
src/views/modules/knowledge/statistics/synthesize.vue

@@ -30,10 +30,10 @@
         </div>
         </div>
         <div class="table-style">
         <div class="table-style">
           <div>
           <div>
-             组织访问量TOP10
-             <span>(pv)</span>
+             组织访问量
+             
           </div>
           </div>
-          <rx-grid
+          <!--<rx-grid
             ref="table"
             ref="table"
             style="background: #fff;min-height: 400px;"
             style="background: #fff;min-height: 400px;"
             :columns="columns"
             :columns="columns"
@@ -44,7 +44,8 @@
             :showPage="false"
             :showPage="false"
             idField="pkId"
             idField="pkId"
           > 
           > 
-          </rx-grid>
+          </rx-grid>-->
+          <DataShow :type="type" interface="0"></DataShow>
         </div>
         </div>
       </rx-fit>
       </rx-fit>
     </div> 
     </div> 
@@ -63,6 +64,7 @@ import warehousePicture from '@/assets/img/warehouse.png'
 import searchPicture from '@/assets/img/search.png'
 import searchPicture from '@/assets/img/search.png'
 import statistics from '@/api/knowledge/statistics'
 import statistics from '@/api/knowledge/statistics'
 import pieEchart from './components/PieEchart';
 import pieEchart from './components/PieEchart';
+import DataShow from './components/DataShow';
 export default {
 export default {
   name: 'synthesize',
   name: 'synthesize',
   components: {
   components: {
@@ -71,7 +73,8 @@ export default {
     roseEchart,
     roseEchart,
     littleCard,
     littleCard,
     pieEchart,
     pieEchart,
-    pieChange
+    pieChange,
+    DataShow
   },
   },
   data() {
   data() {
     return {
     return {
@@ -135,7 +138,7 @@ export default {
           sorter: true,
           sorter: true,
           sortField: 'search'
           sortField: 'search'
         },
         },
-      ],
+      ]
     }
     }
   },
   },
   mounted() {
   mounted() {
@@ -245,6 +248,7 @@ export default {
   }
   }
 
 
   .table-style {
   .table-style {
+    display: inline-block;
     width: 100%;
     width: 100%;
     background-color: #fff;
     background-color: #fff;
     margin-top: 20px;
     margin-top: 20px;

+ 8 - 5
src/views/modules/knowledge/statistics/warehouse.vue

@@ -29,9 +29,10 @@
         </div>
         </div>
         <div class="table-style">
         <div class="table-style">
           <div>
           <div>
-             组织创建知识数量TOP10
+             组织创建知识数量
           </div>
           </div>
-          <rx-grid
+          <DataShow :type="type" interface="1"></DataShow>
+          <!--<rx-grid
             ref="table"
             ref="table"
             style="background: #fff;min-height: 400px;"
             style="background: #fff;min-height: 400px;"
             :columns="columns"
             :columns="columns"
@@ -42,7 +43,7 @@
             :showPage="false"
             :showPage="false"
             idField="pkId"
             idField="pkId"
           > 
           > 
-          </rx-grid>
+          </rx-grid>-->
         </div>
         </div>
       </rx-fit>
       </rx-fit>
     </div> 
     </div> 
@@ -57,6 +58,7 @@ import pieChange from './components/pieChange'
 import pieEchart from './components/PieEchart';
 import pieEchart from './components/PieEchart';
 import barEchart from './components/BarEchart';
 import barEchart from './components/BarEchart';
 import statistics from '@/api/knowledge/statistics'
 import statistics from '@/api/knowledge/statistics'
+import DataShow from './components/DataShow';
 export default {
 export default {
   name: 'synthesize',
   name: 'synthesize',
   components: {
   components: {
@@ -65,7 +67,8 @@ export default {
     roseEchart,
     roseEchart,
     barEchart,
     barEchart,
     pieChange,
     pieChange,
-    pieEchart
+    pieEchart,
+    DataShow
   },
   },
   data() {
   data() {
     return {
     return {
@@ -258,7 +261,7 @@ export default {
     background-color: #fff;
     background-color: #fff;
     margin-top: 20px;
     margin-top: 20px;
     padding: 20px 30px;
     padding: 20px 30px;
-
+    display: inline-block;
     >div:first-child {
     >div:first-child {
       position: relative;
       position: relative;
       font-weight: bold;
       font-weight: bold;