浏览代码

修改上传

zhangli 2 年之前
父节点
当前提交
9022317cef

+ 7 - 0
src/api/knowledge/home.js

@@ -20,6 +20,13 @@ home.bannerGet=function (parameter) {
     return res
   })
 }
+// 搜索关键字上报接口
+home.searchKeywordTrack=function (parameter) {
+  var url= '/api-knowledge/common/searchKeywordTrack';
+  return rxAjax.postJson(url,parameter).then (res => {
+    return res
+  })
+}
 home.searchApi=function (parameter) {
   var url= '/api-knowledge/search/search';
   let config={

二进制
src/image/analysis0.png


二进制
src/image/analysis1.png


二进制
src/image/analysis2.png


+ 1 - 1
src/permission.js

@@ -16,7 +16,7 @@ router.beforeEach((to, from, next) => {
             userId:store.state.appSetting.user.userId,
             companyId:store.state.appSetting.user.companyId,
             page:to.path,
-            platform:'知识管理系统',
+            platform:'知识管理平台',
         }
         if(to.meta.subModule=='详情'){
             data.ussd='{"id":"'+to.query.pkId+'","type":""}'

+ 145 - 37
src/views/modules/knowledge/analysis/index.vue

@@ -4,21 +4,21 @@
       <div class="topBox">
         <div>
           <div class="numBox">
-            <img src="../../../../image/FloatedMenu.png"/>
+            <img src="../../../../image/analysis0.png"/>
             <div>{{format_number(totalData.knowledge)}}</div>
             <div>知识仓库总量</div>
           </div>
         </div >
         <div>
           <div class="numBox">
-            <img src="../../../../image/FloatedMenu.png"/>
+            <img src="../../../../image/analysis1.png"/>
             <div>{{format_number(totalData.map)}}</div>
             <div>知识地图总量</div>
           </div>
         </div>
         <div>
           <div class="numBox">
-            <img src="../../../../image/FloatedMenu.png"/>
+            <img src="../../../../image/analysis2.png"/>
             <div>{{format_number(totalData.album)}}</div>
             <div>知识专辑总量</div>
           </div>
@@ -31,7 +31,7 @@
           </div>
           <div>
             <div class="barNameBox" v-for="(item, index) in NameArr" :key="index">
-              <div :style="{'color':colorbarArr[index]}">■</div>
+              <div :style="{'background':colorbarArr[index]}"></div>
               <div>{{ item }}</div>
             </div>
           </div>
@@ -141,39 +141,91 @@ export default {
                 color:that.colorbarArr[num],
                 name: item.legend,
                 type: 'bar',
+                barGap:'0%',
+                barCategoryGap:'40%',
                 stack: 'Ad',
                 emphasis: {
                   focus: 'series'
                 },
-                data: [item.value]
+                data: [{value:item.value,itemStyle:{ barBorderRadius: [0, 0, 0, 0] }}],
+                percentage:[item.percentage]
               }
-              if(num==(el.values.length-1)){
+              /*if(num==(el.values.length-1)){
                 tempData.itemStyle={
                   normal: {
                     //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
                     barBorderRadius:[6, 6, 0, 0]
                   }
                 }
-              }
+              }*/
               seriesData.push(tempData)
             }else{
-              seriesData[num].data.push(item.value)
+              seriesData[num].data.push({value:item.value,itemStyle:{ barBorderRadius: [0, 0, 0, 0] }})
+              seriesData[num].percentage.push(item.percentage)
             }
           })
         });
+        //for (let i=(seriesData[0].data.length-1);i>-1;i--) { // 遍历所有的x轴数据(总数为n),为单根柱条提供data下标(0 ~ n-1)
+        for (let i in seriesData[0].data) {
+          for (let j=(seriesData.length-1);j>-1;j--) {
+            if (seriesData[j].data[i].value != 0) { // 找到第一个不为0的值,为该项添加itemStyle
+              seriesData[j].data[i]['itemStyle'] = { barBorderRadius: [4, 4, 0, 0] };
+              break;  //退出该柱条的循环
+            }
+          }
+        }
+        console.log(seriesData)
+        let offsetX = window.innerWidth/150
         var option0 = {
           legend:{
             show:false
           },
           tooltip: {
+            position: function (point, params, dom, rect, size) {
+              console.log(params)
+              let dataIndex = params[0].dataIndex
+              return {left: 56+113*dataIndex, top: point[1]};
+             // return {left: 1300, top: point[1]};
+            },
+            backgroundColor:'rgba(0,0,0,0.5)',
+            borderWidth:'0',
+            textStyle:{
+              'color':'#FAFAFB',
+              'lineHeight': 14,
+              'fontSize':14
+            },
             trigger: 'axis',
             axisPointer: {
               type: 'shadow'
+            },
+            formatter: params => {
+              let dataIndex = params[0].dataIndex
+              let resStr = ''
+              for (let i=0;i<seriesData.length;i++) {
+                if(i==0){
+                  resStr=resStr+"<div class='tooltipBox' style='margin-top:0px'><div class='tooltipLeft' style='background:"+that.colorbarArr[i]+"'></div>&nbsp;&nbsp;&nbsp;&nbsp;"+seriesData[i].data[dataIndex].value+"&nbsp;&nbsp;&nbsp;&nbsp;"+seriesData[i].percentage[dataIndex]*100+"%</div>"
+                }else{
+                  resStr=resStr+"<div class='tooltipBox'><div class='tooltipLeft' style='background:"+that.colorbarArr[i]+"'></div>&nbsp;&nbsp;&nbsp;&nbsp;"+seriesData[i].data[dataIndex].value+"&nbsp;&nbsp;&nbsp;&nbsp;"+seriesData[i].percentage[dataIndex]*100+"%</div>"
+                }
+              }
+              //const { name, value } = params
+              return resStr
             }
           },
+          /*tooltip: {
+            position: function (point, params, dom, rect, size) {
+                // 固定在顶部
+                return [point[0], '10%'];
+            },
+            trigger: 'item',
+            formatter: params => {
+              const { name, value } = params
+              return `${name} <br/>数量:${value}`
+            }
+          },*/
           grid: {
             top:'10%',
-            left: '3%',
+            left: '2%',
             right: '4%',
             bottom: '3%',
             containLabel: true
@@ -182,12 +234,40 @@ export default {
             {
               show: true,
               type: 'category',
-              data: xAxisData
+              data: xAxisData,
+              offset:offsetX,
+               // 坐标 轴线
+              axisLine: {
+                show: true,
+                lineStyle: {
+                  type: 'solid',
+                  color: '#F1F1F5',
+                  width: 1
+                },
+              },
+              axisTick:{
+                show:false
+              },
+              axisLabel:{
+                color:'#92929D',
+                fontSize:14
+              }
             }
           ],
           yAxis: [
             {
-              type: 'value'
+              type: 'value',
+              splitLine:{
+                lineStyle: {
+                  type: 'solid',
+                  color: '#F1F1F5',
+                  width: 1
+                }
+              }, 
+              axisLabel:{
+                color:'#92929D',
+                fontSize:14
+              }
             }
           ],
           series: seriesData
@@ -205,7 +285,12 @@ export default {
         that.pieTotalNum=pieData.total
         var option2 = {
           tooltip: {
-            trigger: 'item'
+            trigger: 'item',
+            backgroundColor:'rgba(0,0,0,0.5)',
+            borderWidth:'0',
+            textStyle:{
+              'color':'#FAFAFB'
+            },
           },
           grid: {
             left: '3%',
@@ -217,7 +302,7 @@ export default {
             {
               roseType: 'radius',
               top:'10%',
-              name: 'Access From',
+              name: '知识类型分布',
               type: 'pie',
               radius: '60%',
               data: [
@@ -275,6 +360,11 @@ export default {
           backgroundColor:'#fff',
           tooltip: {
             trigger: 'item',
+            backgroundColor:'rgba(0,0,0,0.5)',
+            borderWidth:'0',
+            textStyle:{
+              'color':'#FAFAFB'
+            },
             formatter: params => {
               const { name, value } = params
               return `${name} <br/>数量:${value}`
@@ -424,21 +514,21 @@ export default {
 <style lang="less" scoped>
 .contentAlbunMain{
   overflow: scroll;
-  padding: 1.5625vw 10.93vw;
+  padding: 0vw 10.93vw;
   width: 100%;
   display: flex;
   background: #FAFAFA;
   flex-direction: column;
 }
 .numBox{
-  width: 25vw;
+  width: 24.73vw;
+  height: 11.51vw;
   background: #fff;
   border-radius: 10px;
-  height: 221px;
   display: flex;
   flex-direction: column;
   align-items: center;
-  margin-top:50px;
+  margin-top:3.6465vw;
 }
 .topBox{
   display: flex;
@@ -449,8 +539,8 @@ export default {
   width: 100%;
   background: #fff;
   border-radius: 10px;
-  height: 20vw;
-  margin-top: 1.4vw;
+  height: 24.896vw;
+  margin-top: 1.25vw;
 }
 .bottomBox{
   width: 100%;
@@ -471,39 +561,39 @@ export default {
   width: 26vw;
 }
 .numBox img{
-  width: 100px;
-  height: 100px;
-  margin-top: -50px;
+  width: 5.15625vw;
+  height: 5.15625vw;
+  margin-top: -2.135vw;
 }
 .numBox div:nth-child(2){
-  font-size: 30px;
-  width: 95px;
+  font-size: 1.5625vw;
+  width: 100%;
   word-break: break-all;
   color: #202124;
-  line-height: 30px;
-  margin-top: 20px;
+  margin-top: 1.2vw;
   text-align: center;
 }
 .numBox div:last-child{
-  font-size: 18px;
-  width: 110px;
+  font-size: 0.9375vw;
+  width: 100%;
   color: #92929D;
-  margin-top: 10px;
+  margin-top: 1.2vw;
+  text-align: center;
 }
 .topTitle{
-  width: 111px;
-  margin-top: 30px;
-  margin-left: 30px;
+  width: 15.625vw;
+  margin-top: 1.5625vw;
+  margin-left: 1.5625vw;
   position: absolute;
 }
 .topTitle div:nth-child(2){
   color: #202124;
-  font-size: 30px;
+  font-size: 1.5625vw;
   word-break: break-all;
 }
 .topTitle div:first-child{
   color: rgb(146, 146, 157);
-  font-size: 18px;
+  font-size: 0.9375vw;
 }
 .topTitle div:nth-child(3){
   color: #202124;
@@ -527,13 +617,31 @@ export default {
   flex-direction: row;
   align-items: end;
   width: auto!important;
-  margin-right: 1vw;
+  margin-right: 0.8333vw;
+  font-size: 0.9375;
 }
 .barNameBox div:nth-child(1){
-  font-size: 0.6vw;
-  margin-right: 0.6vw;
+  width: 0.72vw;
+  height: 0.72vw;
+  margin-right: 0.52vw;
+  margin-bottom: 0.3vw;
+  border-radius: 2px;
 }
 .barNameBox div:nth-child(2){
   font-size: 1vw;
 }
+
+</style>
+<style>
+.tooltipLeft{
+  width: 0.6vw;
+  height: 0.6vw;
+  border-radius: 2px;
+  display: inline-block;
+}
+.tooltipBox{
+  margin-left: 16px;
+  margin-right: 16px;
+  margin-top:8px;
+}
 </style>

+ 1 - 1
src/views/modules/knowledge/components/albumList.vue

@@ -144,7 +144,7 @@ export default {
           secretType:data.secretType
         }
         home.viewApi(getData).then((res) => {
-          let datares = JSON.parse(res.data)
+          let datares = res.data
           if(this.item.documentPath.indexOf('dcc系统')==0){
             var encrypts = encrypt(this.user.userId);
             window.open(datares.url+"&userId="+encrypts)

+ 1 - 1
src/views/modules/knowledge/components/pageList.vue

@@ -191,7 +191,7 @@ export default {
           secretType:data.secretType
         }
         home.viewApi(getData).then((res) => {
-          let datares = JSON.parse(res.data)
+          let datares = res.data
           if(this.item.documentPath.indexOf('dcc系统')==0){
             var encrypts = encrypt(this.user.userId);
             window.open(datares.url+"&userId="+encrypts)

+ 37 - 11
src/views/modules/knowledge/home.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="homePage" id="homePage">
     <a-back-top :target="targetfn"/>
-    <a-carousel autoplay>
+    <a-carousel autoplay v-if="!showTap">
       <div v-for="(item, index) in bannerArr" :key="index" @click="goKnowledge(item)">
         <!--<img src="../../../image/banner.jpg" class="bannerClass"/>-->
         <img :src="'/api/api-system/system/core/sysFile/previewFile?fileId='+item.bannerFile" class="bannerClass"/>
@@ -9,17 +9,23 @@
         <p class="bannerContent">{{item.summary}}</p>
       </div>
     </a-carousel>
-    <search :hideSelect="true" searchWidth="59.58vw" class="searchbar" @searchResult="searchResult"></search>
-    <div class="searchBox">
+    <div class="searchHead">
+      <search :hideSelect="true" searchWidth="59.58vw" class="searchbar" @searchResult="searchResult"></search>
       <div class="tabBoxHome" v-if="showTap">
         <div v-for="(item, index) in tapArr" :key="index" @click="changeAction(index)" v-show="item.show">
-          <span>{{item.name}}</span>
+          <span v-if="index==2" style="padding-left: 0vw;">{{item.name}}</span>
+          <span v-else-if="index==3" style="padding-left: 0.7vw;">{{item.name}}</span>
+          <span v-else>{{item.name}}</span>
           <img v-if="tapAction==index" src="../../../image/tabAction.png"/>
         </div>
         <div class="orderBox">
           <div @click="changeOrder(index)" v-for="(item, index) in orderArr" :key="index" :class="orderFiled==index?'orderAction':''">{{item}}</div>
         </div>
       </div>
+    </div>
+    
+    <div class="searchBox">
+      
       <div class="noDataBox" v-if="dataList.length==0">
         <img src="../../../image/noDataNew.png" class="noData"/>
         <p class="noDataText">暂无搜索结果</p>
@@ -27,7 +33,7 @@
       <div v-else class="DataBox">
         <div class="listBox">
           <div class="listBoxItem" v-for="(item, index) in dataList" :key="index">
-            <pageList :item="item" type="home"></pageList>
+            <pageList class="listSearchBox listItemClass" :item="item" type="home"></pageList>
           </div>
         </div>
       </div>
@@ -92,6 +98,10 @@ export default {
     },
     // 搜索数据
     searchResult(data){
+      let postData={
+        keyword:decodeURI(data.keyword)
+      }
+      home.searchKeywordTrack(postData).then(() => {})
       this.searchData=data
       this.getDataAll(0)
     },
@@ -244,6 +254,7 @@ export default {
 .homePage{
   height: calc(100% - 0vw);
   overflow: scroll;
+  background: #FAFAFA;
 }
 .ant-carousel >>> .slick-slide {
   text-align: center;
@@ -300,7 +311,7 @@ export default {
 }
 .DataBox{
   width:100%;
-
+  margin-top: 1vw
 }
 .noDataText{
   color:#C0C0C0;
@@ -309,6 +320,7 @@ export default {
 .tabBoxHome{
   width: 100%;
   display: flex;
+  padding: 0px 10.94vw;
 }
 .orderBox div{
   color: #202124;
@@ -322,8 +334,8 @@ export default {
 }
 .tabBoxHome div{
   width: 8.12vw;
-  height:4.17vw;
-  text-align: center;
+  /*height:4.17vw;*/
+  text-align: left;
   float:left;
 }
 .tabBoxHome span{
@@ -333,6 +345,7 @@ export default {
   font-size: 0.9375vw;
   cursor: pointer;
   display: inline-block;
+  padding-left: 0.4vw;
 }
 .tabBoxHome img{
   margin-top: 0.9375vw;
@@ -345,9 +358,7 @@ export default {
   opacity: 0.73;
 }
 .listBoxItem{
-  margin-top: 0.42vw;
-  margin-bottom: 0.83vw;
-  padding: 1.5625vw;
+  /*padding: 0 1.5625vw;*/
 }
 .searchbar{
   margin-top: 1.71875vw!important;
@@ -369,4 +380,19 @@ export default {
   height: 4px;
   background: #5C86D9;
 }
+.searchHead{
+  background: #fff;
+  display: inline-grid;
+  width: 100%;
+  min-height: 7.2vw;
+}
+.listSearchBox{
+  margin-top: 0.42vw;
+  margin-bottom: 1.1vw;
+  padding: 1.5625vw;
+  border-radius: 10px;
+}
+.listItemClass{
+  background: #fff;
+}
 </style>

+ 5 - 3
src/views/modules/knowledge/warehouse/knowledgeContentInfo.vue

@@ -92,13 +92,15 @@ export default {
             userId:this.user.userId,
             companyId:this.user.companyId,
             page:'/knowledgePage/knowledgeContentInfo',
-            platform:'知识管理系统',
+            platform:'知识管理平台',
             ussd:'{"id":"'+this.detailData.pkId+'","type":"'+this.detailData.type+'"}'
           }
           //console.log(postData)
-          analysis.pageTrack(postData).then((res) => {
+          if(this.$route.query.type==1){
+            analysis.pageTrack(postData).then((res) => {
 
-          })
+            })
+          }
         }
       })
     },