Pārlūkot izejas kodu

修改问题修改新需求

zhangli 1 gadu atpakaļ
vecāks
revīzija
df73c1efa9

+ 1 - 1
src/assets/css/commons.css

@@ -1250,7 +1250,7 @@ body .rx-button-edit {
   background: #385FAD;
 }
 .ant-upload-drag-icon{
-  margin-bottom: 1vw;
+  margin-bottom: 1vw!important;
 }
 .ant-upload.ant-upload-drag .ant-upload-btn{
   min-height: 11.979vw;

+ 34 - 9
src/layouts/MainHead.vue

@@ -13,7 +13,7 @@
         }"
         v-for="(obj, index) in appSystem"
         :key="index"
-        v-if="index < numerous"
+        v-if="showBackground||obj.key!=7"
       >
         <div class="MainHead-title">{{ obj.title }}</div>
       </div>
@@ -99,20 +99,26 @@
 <script>
 import elementResizeDetectorMaker from 'element-resize-detector'
 import { mapMutations, mapState } from 'vuex'
+import api from '@/api/login.js'
 export default {
   name: 'MainHead',
   props: ['menus', 'background', 'appKey'],
   data() {
     return {
+      showBackground:false,
       show: false, //是否打开更多应用
       numerous: 5, //默认展示几个
       customArr: ['customIcon', 'userCustomIcon'], //自定义图标
-      appSystem: [{'key':1,'title':'首页','component':'/knowledgePage/home','menuNavType':2},
-                  {'key':2,'title':'知识仓库','component':'/knowledgePage/warehouseIndex','menuNavType':2},
-                  {'key':3,'title':'知识地图','component':'/knowledgePage/mapIndex','menuNavType':2},
-                  {'key':4,'title':'知识专辑','component':'/knowledgePage/albumIndex','menuNavType':2},
-                  {'key':5,'title':'知识学习','component':'http://www.hkcqjy.com.cn:8088/learning/','menuNavType':2},
-                  {'key':6,'title':'统计分析','component':'/knowledgePage/analysis','menuNavType':2},
+      appSystem: [{'key':1,'title':'首页','component':'/knowledgePage/home','menuNavType':2,'initArr':['home','']},
+                  {'key':2,'title':'知识仓库','component':'/knowledgePage/warehouseIndex','menuNavType':2,
+                  'initArr':['warehouseIndex','searchData','contentData','knowledgeAddUpdate','knowledgeContentInfo','knowledgeAuditInfo']},
+                  {'key':3,'title':'知识地图','component':'/knowledgePage/mapIndex','menuNavType':2,
+                  'initArr':['mapList','mapIndex']},
+                  {'key':4,'title':'知识专辑','component':'/knowledgePage/albumIndex','menuNavType':2,
+                  'initArr':['albumDetail','albumIndex']},
+                  {'key':5,'title':'知识学习','component':'http://www.hkcqjy.com.cn:8088/learning/','menuNavType':2,'initArr':[]},
+                  {'key':6,'title':'统计分析','component':'/knowledgePage/analysis','menuNavType':2,'initArr':['analysis']},
+                  {'key':7,'title':'管理后台','component':'/knowledge/knowledge','menuNavType':2,'initArr':[]},
                 ], //系统应用
       appSystemMore: [],
       appAdhibition: [], //应用
@@ -142,8 +148,22 @@ export default {
     this.watchSize() //计算展示几个头部栏目
   },
   methods: {
-    ...mapMutations('appSetting', ['setAppUse']),
+    ...mapMutations('appSetting', ['setAppUse','setAppKey']),
     init() {
+      let urlData = location.href.split("/").pop()
+      urlData=urlData.split("?")[0]
+      let that = this
+      this.appSystem.forEach(function(item){
+        if(item.initArr.indexOf(urlData)>-1){
+          that.setAppKey(item.key)
+        }
+      })
+      api.getLoginUserAndMenu().then((res) => {
+        let nemuArr=res.data.menus.filter((item) => {return item.parentId=='1605810703702851585'})
+        if(nemuArr.length!=0){
+          this.showBackground=true
+        }
+      })
       // console.log(this.menus)
       //张立注释,截图
       /*this.appSystem = this.menus.filter((res) => {
@@ -191,6 +211,11 @@ export default {
         //location.href=value.component
         return false;
       }
+      if(value.key==7){
+        window.open(value.component)
+        //location.href=value.component
+        return false;
+      }
       this.$emit('handClick', value)
       this.setAppUse(!head)
       this.show = false
@@ -237,7 +262,7 @@ export default {
 <style scoped>
 .MainHead {
   height: 80px;
-  max-width: 880px;
+  max-width: 70vw;
   min-width: 660px;
   padding-top: 1.09375vw;
 }

+ 1 - 1
src/store/modules/appSetting.js

@@ -10,7 +10,7 @@ const appSetting = {
         breadlist: [],
         buttons: {},
         allButtons: {},
-        appKey: ["webApp"],
+        appKey: [1],
         appUse:false,//是否选中应用
         idKey: '',//权限的key
         menuStyle: 'inline',

+ 14 - 1
src/views/modules/knowledge/album/detail.vue

@@ -101,7 +101,7 @@
           </a-upload-dragger>
           <div v-else class="imgBox">
             <img class="uploadImg" :src="'/api/api-system/system/core/sysFile/previewFile?fileId='+knowledgeForm.cover"/>
-            <rx-button style="font-size: 1vw;color: #406CC4;" class="clearBtn" :butn-icon="'none'" @click="handleFileDelClick">删除</rx-button>
+            <a-button style="font-size: 1vw;color: #406CC4;" class="clearBtn" :butn-icon="'none'" @click="handleFileDelClick">删除</a-button>
           </div>
         </a-form-model-item> 
       </a-form-model>
@@ -1563,8 +1563,21 @@ export default {
   height: 1.2vw;
   margin-left: 0.6vw;
 }
+.ant-upload-drag-icon img{
+  width: 2.29166vw;
+  height: 2.29166vw;
+}
+.ant-upload-text{
+  font-size: 0.833333vw!important;
+  margin-bottom: 0.4687vw!important;
+  line-height: 1.5vw;
+}
 </style>
 <style scoped>
+/deep/ .ant-cascader-picker-clear{
+  width: 1.2vw;
+  text-align: right;
+}
 /deep/ .ant-cascader-menus {
   left: 0!important;
 }

+ 36 - 0
src/views/modules/knowledge/analysis/aJs/chart.resize.js

@@ -0,0 +1,36 @@
+import * as echarts from 'echarts';
+import Vue from 'vue';
+import elementResizeDetectorMaker from "element-resize-detector"
+
+export var version = '0.0.1';
+var compatible = (/^2\./).test(Vue.version);
+if (!compatible) {
+    Vue.util.warn('vue echarts resize directive ' + version + ' only supports Vue 2.x, and does not support Vue ' + Vue.version);
+}
+let HANDLER = "_vue_echarts_resize_handler"
+
+function bind(el) {
+    unbind(el);
+    el[HANDLER] = function () {
+        let chart = echarts.getInstanceByDom(el);
+        if (!chart) {
+            return;
+        }
+        chart.resize();
+    }
+    //监听window窗体变化,更新echarts大小
+    //window.addEventListener("resize", el[HANDLER])
+    //监听绑定的div大小变化,更新echarts大小
+    elementResizeDetectorMaker().listenTo(el,el[HANDLER])
+    
+}
+function unbind(el) {
+    //window.removeEventListener("resize", el[HANDLER]);
+    elementResizeDetectorMaker().removeListener(el,el[HANDLER])
+    delete el[HANDLER];
+}
+var directive = {
+    bind: bind,
+    unbind: unbind
+};
+Vue.directive("on-echart-resize", directive)

+ 20 - 49
src/views/modules/knowledge/analysis/index.vue

@@ -36,21 +36,21 @@
             </div>
           </div>
         </div>
-        <div ref="eCharts0" class="barBox"></div>
+        <div ref="eCharts0" class="barBox" id="eCharts0" v-on-echart-resize></div>
       </div>
       <div class="bottomBox">
         <div class="bottomBoxLeft">
           <div class="topTitle textBorder">
             <div>高频搜索词</div>
           </div>
-          <div ref="eCharts1" class="wordCloudBox"></div>
+          <div ref="eCharts1" class="wordCloudBox" id="eCharts1" v-on-echart-resize></div>
         </div>
         <div class="bottomBoxRight">
           <div class="topTitle">
             <div>知识类型分布</div>
             <div>{{format_number(pieTotalNum)}}</div>
           </div>
-          <div ref="eCharts2" style="height: 100%;width: 100%;"></div>
+          <div ref="eCharts2" style="height: 100%;width: 100%;" id="eCharts2" v-on-echart-resize></div>
         </div>
       </div>
     </div>
@@ -61,6 +61,8 @@
 import {mapState} from "vuex";
 import analysis from '@/api/knowledge/analysis'
 import * as echarts from 'echarts'
+import elementResizeDetectorMaker from "element-resize-detector";
+import "./aJs/chart.resize";
 import 'echarts-wordcloud'
 export default {
   name: 'albumIndex',
@@ -117,6 +119,21 @@ export default {
     this.getSearchVisitHistogram();
     this.getKnowledgeTypeAmount();
     this.getSearchParticipleWordCloud();
+    let erd = elementResizeDetectorMaker();
+    let that = this;
+    window.addEventListener('resize', function () {
+      that.getSearchVisitHistogram()
+      that.getKnowledgeTypeAmount();
+      that.getSearchParticipleWordCloud();
+    });
+    erd.listenTo(document.getElementById("eCharts0"), (element) => {
+      that.$nextTick(() => {
+        //使echarts尺寸重置
+        echarts.init(document.getElementById("eCharts0")).resize();
+        echarts.init(document.getElementById("eCharts1")).resize();
+        echarts.init(document.getElementById("eCharts2")).resize();
+      });
+    });
   },
   methods: {
     //获取数量
@@ -215,52 +232,6 @@ export default {
               return resStr
             }
           },
-         /* tooltip: {
-            position: function (point, params, dom, rect, size) {
-              console.log(dom.clientWidth)
-              let dataIndex = params[0].dataIndex
-              let basNum = window.innerWidth/1920
-              //let marginNum = (dom.clientWidth-126-basNum*100)/2
-              let marginNum = 0
-              return {left: 10+(70+110*dataIndex)*basNum-marginNum, 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:'20%',
             left: '2%',

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

@@ -32,7 +32,7 @@
           <span>下载</span>
         </div>
       </template>
-      <div class="lookBox btnSmall" @click="deleteData(item)" v-if="type=='list1'&&(item.approvalStatus==4||item.approvalStatus==2)">
+      <div class="lookBox btnSmall" @click="deleteData(item)" v-if="type=='list1'&&(showDel||(item.approvalStatus==4||item.approvalStatus==2))">
         <img src="../../../../image/del.png"/>
         <span>删除</span>
       </div>
@@ -163,6 +163,10 @@ export default {
       type:Boolean,
       default: false
     },
+    showDel: {
+      type:Boolean,
+      default: false
+    },
     
   },
   computed: {

+ 3 - 0
src/views/modules/knowledge/map/index.vue

@@ -319,6 +319,9 @@ export default {
       this.pointNum = -1
     },
     changeType(num){
+      if(this.titleArr[this.titleIndex].name=="暂无地图"){
+        return false
+      }
       this.showLoading = true
       this.titleIndex = num
       this.getRoutes(this.titleArr[this.titleIndex].pkId)

+ 43 - 5
src/views/modules/knowledge/warehouse/contentData.vue

@@ -99,7 +99,7 @@
         <div v-else class="DataBoxContent">
           <div class="listBox">
             <div class="listBoxItemContent listItemClass" v-for="(item, index) in dataList3" :key="index">
-              <pageList :item="item" type="list1" :showEdit="true" :hideLook="true"></pageList>
+              <pageList :item="item" type="list1" :showEdit="true" :showDel="true" @delRefresh="delRefreshCg" :hideLook="true"></pageList>
               <a-divider class="bottomBorder" v-if="(index!=dataList3.length-1)"/>
             </div>
           </div>
@@ -177,9 +177,6 @@ export default {
     }
   },
   created() {
-    if(this.$route.query.showMy!=undefined){
-      this.changeAction(2)
-    }
     if(this.$route.query.type!=undefined){
       this.type=this.$route.query.type
       this.categoryName=this.typeName[this.type]
@@ -208,7 +205,9 @@ export default {
     }
     this.getBaseData()
     this.getData(false)
-    
+    if(this.$route.query.showMy!=undefined){
+      this.changeAction(2)
+    }
     if (this.user.photo && this.user.photo != '') {
       this.imgUrl = '/api/api-system/system/core/sysFile/previewFile?fileId='+this.user.photo
     }
@@ -539,6 +538,39 @@ export default {
       })
     })
    },
+   // 删除刷新页面草稿
+   delRefreshCg(){
+    let param0 = {
+      "pageNo": this.pageNum3,
+      "pageSize": 10,
+      "sortField": "CREATE_TIME_",
+      "sortOrder": "desc",
+      params: {
+        "isDraft":0,
+        "createBy":this.user.userId,
+        "keyword":this.searchData.keyword
+      }
+    }
+    contentData.findAllKnowledge(param0).then((res) => {
+      res.result.data.forEach(element => {
+        element.documentName = element.attachmentName
+        element.documentRemark = element.summary
+        element.viewNum = element.views
+        element.uploadTime = element.createTime
+        element.categoryArr = []
+        this.getType(element)
+        this.getCategory(element.categoryArr,element.knowledgeCategoryAdminVo)
+      });
+      this.number3 = res.result.totalCount
+      this.number3Bas = res.result.totalCount
+      this.dataList3 = res.result.data
+      this.$nextTick(()=>{
+        if(Number(res.result.totalCount)!=0){
+          this.$refs.pageBarref3.setTotal(Number(res.result.totalCount))
+        }
+      })
+    })
+   },
    // 处理分类数据展示
    categoryData(data){
     data.forEach(element => {
@@ -592,8 +624,14 @@ export default {
         this.getType(element)
         this.getCategory(element.categoryArr,element.knowledgeCategoryAdminVo)
       });
+      
       this.number2 = res.result.totalCount
       this.number2Bas = res.result.totalCount
+      if(this.number2Bas==0){
+        if(this.$route.query.showMy!=undefined){
+          this.changeAction(0)
+        }
+      }
       this.myuploadNum = res.result.totalCount
       this.dataList2 = res.result.data
       this.$nextTick(()=>{

+ 24 - 16
src/views/modules/knowledge/warehouse/knowledgeAddUpdate.vue

@@ -80,9 +80,9 @@
 
             <img :src="wordIcon" alt="" style="width: 1.2vw;height: auto;">
             <span style="font-size: 1vw;">{{ knowledgeForm.attachmentName }}</span>
-            <rx-button style="font-size: 1vw;color: #406CC4;" class="clearBtn" :butn-icon="'none'" @click="handleShowClick">查看</rx-button>
-            <rx-button style="font-size: 1vw;color: #406CC4;" class="clearBtn" :butn-icon="'none'" @click="handleFileDelClick">删除</rx-button>
-            <rx-button style="font-size: 1vw;color: #406CC4;" class="clearBtn" :butn-icon="'none'" @click="handleFileDownloadClick">下载</rx-button>
+            <a-button style="font-size: 1vw;color: #406CC4;" class="clearBtn" :butn-icon="'none'" @click="handleShowClick">查看</a-button>
+            <a-button style="font-size: 1vw;color: #406CC4;" class="clearBtn" :butn-icon="'none'" @click="handleFileDelClick">删除</a-button>
+            <a-button style="font-size: 1vw;color: #406CC4;" class="clearBtn" :butn-icon="'none'" @click="handleFileDownloadClick">下载</a-button>
           </div>
         </a-form-model-item>
         <a-form-model-item label="阅读权限" class="knowledgeAddUpdateLabel oneline" style="width:calc( 46.04vw );" v-if="knowledgeForm.type==1" prop="actualApproverName">
@@ -573,6 +573,7 @@ export default {
     },
       // 删除文件
     handleFileDelClick() {
+      this.showOnlyOffice = false
       this.knowledgeForm.attachment = ''
       this.knowledgeForm.attachmentName = ''
     },
@@ -784,6 +785,20 @@ export default {
   height: 2.0833vw;
   line-height: 2.0833vw;
 }
+.ant-upload-drag-icon img{
+  width: 2.29166vw;
+  height: 2.29166vw;
+}
+.ant-upload-text{
+  font-size: 0.833333vw!important;
+  margin-bottom: 0.4687vw!important;
+  line-height: 1.5vw;
+}
+.uploadBox{
+  width: 26.927vw;
+  height: 11.979vw;
+  display: block;
+}
 </style>
 <style>
 .dropdownClassli{
@@ -796,22 +811,12 @@ export default {
 .dropdownClassli:last-child{
   margin-bottom: 1.04vw;
 }
-.uploadBox{
-  width: 26.927vw;
-  height: 11.979vw;
-  display: block;
-}
+
 .ant-upload-hint{
   font-size: 0.833333vw!important;
 }
-.ant-upload-text{
-  font-size: 0.833333vw!important;
-  margin-bottom: 0.4687vw!important;
-}
-.ant-upload-drag-icon img{
-  width: 2.29166vw;
-  height: 2.29166vw;
-}
+
+
 .classifyIconBox{
   color: rgba(0,0,0,.25);
   font-size: 1vw!important;
@@ -833,6 +838,9 @@ export default {
 }
 </style>
 <style scoped>
+/deep/ .ant-cascader-picker-clear{
+  width: 1.2vw;
+}
 /deep/ .ant-cascader-menus {
   left: 0!important;
 }