Browse Source

修改bug提交代码

zhangli 2 years ago
parent
commit
e363aa1f10

+ 11 - 0
package-lock.json

@@ -11,6 +11,7 @@
       "dependencies": {
         "@antv/data-set": "^0.10.2",
         "ant-design-vue": "1.7.5-rx",
+        "awe-dnd": "^0.3.4",
         "axios": "^0.19.0",
         "baidutemplate": "^1.0.5-dev",
         "bpmn-js": "6.0.7",
@@ -6498,6 +6499,11 @@
       "dev": true,
       "license": "ISC"
     },
+    "node_modules/awe-dnd": {
+      "version": "0.3.4",
+      "resolved": "https://registry.npmmirror.com/awe-dnd/-/awe-dnd-0.3.4.tgz",
+      "integrity": "sha512-ZvwlnaUn1RFwYXQUxLZKtyKH2R+z+8an1B0cTVfDA6UP7i2JxDnxXNwecR56qhwQha39XDQDpgmqz9kQghhksQ=="
+    },
     "node_modules/aws-sign2": {
       "version": "0.7.0",
       "resolved": "http://nexus.redxun.cn:18081/repository/npm-redxun-group/aws-sign2/-/aws-sign2-0.7.0.tgz",
@@ -31073,6 +31079,11 @@
         }
       }
     },
+    "awe-dnd": {
+      "version": "0.3.4",
+      "resolved": "https://registry.npmmirror.com/awe-dnd/-/awe-dnd-0.3.4.tgz",
+      "integrity": "sha512-ZvwlnaUn1RFwYXQUxLZKtyKH2R+z+8an1B0cTVfDA6UP7i2JxDnxXNwecR56qhwQha39XDQDpgmqz9kQghhksQ=="
+    },
     "aws-sign2": {
       "version": "0.7.0",
       "resolved": "http://nexus.redxun.cn:18081/repository/npm-redxun-group/aws-sign2/-/aws-sign2-0.7.0.tgz",

+ 1 - 0
package.json

@@ -15,6 +15,7 @@
   "dependencies": {
     "@antv/data-set": "^0.10.2",
     "ant-design-vue": "1.7.5-rx",
+    "awe-dnd": "^0.3.4",
     "axios": "^0.19.0",
     "baidutemplate": "^1.0.5-dev",
     "bpmn-js": "6.0.7",

+ 2 - 0
src/main.js

@@ -19,6 +19,8 @@ import 'rx-k-form-design/static/css/common.css'
 
 import md5 from 'js-md5';
 Vue.prototype.$md5 = md5;
+import VueDND from 'awe-dnd'
+Vue.use(VueDND)
 /**
  * 引入图表
  */

+ 17 - 7
src/views/modules/knowledge/album/detail.vue

@@ -82,13 +82,19 @@
             :beforeUpload="beforeUpload"
           >
             <p class="ant-upload-drag-icon">
-              <img :src="add" alt="">
+              <img v-if="!loading" :src="add" alt="">
+              <a-icon v-else type="loading" />
             </p>
-            <p class="ant-upload-text">
+            <p class="ant-upload-text" v-if="!loading">
               点击或将文件拖拽到这里上传
               <br/>
               (仅可上传一份)
             </p>
+            <p class="ant-upload-text" v-else>
+              上传中...
+              <br/>
+              (仅可上传一份)
+            </p>
             <p class="ant-upload-hint">
               支持扩展名:.png .jpg(推荐尺寸342*226) 
             </p>
@@ -208,7 +214,7 @@
           <a-input v-model="catalogueForm.name" placeholder="请输入" />
         </a-form-item>
         <a-form-item prop="solt" style="margin-top:10px;" label="排序">
-          <a-input-number v-model="catalogueForm.solt" placeholder="请输入" />
+          <a-input-number :min="1" v-model="catalogueForm.solt" placeholder="请输入" />
         </a-form-item>
       </a-form>
     </a-modal>
@@ -290,6 +296,7 @@ export default {
   },
   data() {
     return {
+      loading:false,
       yelpContent:'',
       showDelete:true,//专辑内容是否加移除
       detailDataBase:{
@@ -695,6 +702,9 @@ export default {
     },
     //上传图片
     handleSaveClick(){
+      //const hide = this.$message.loading('验证码发送中..', 0)
+      //setTimeout(hide, 5000);
+      //return false;
       if(this.knowledgeForm.cover==''&&this.isAdd){
         this.$message.error('请上传缩略图');
         return false
@@ -722,7 +732,7 @@ export default {
         album.create(knowledgeForm).then((res) => {
           if(res.code == 200) {
             this.$message.success("保存成功!");
-            $router.back()
+            this.$router.back()
           }
         })
       }else{
@@ -731,7 +741,7 @@ export default {
         album.edit(knowledgeForm).then((res) => {
           if(res.code == 200) {
             this.$message.success("保存成功!");
-            $router.back()
+            this.$router.back()
           }
         })
       }
@@ -800,7 +810,7 @@ export default {
         "sortOrder": "asc",
         params: {
           approvalStatus: 5,
-          "categoryId":this.addDataForm.categoryId,
+          "categoryId":this.addDataForm.categoryId.length==0?'':this.addDataForm.categoryId,
           "type":this.addDataForm.type,
         }
       }
@@ -855,7 +865,7 @@ export default {
       let catalogueForm = JSON.parse(JSON.stringify(that.catalogueForm))
       for (let index = 0; index < that.albumArr.length; index++) {
         let element = that.albumArr[index]
-        if(element.solt>catalogueForm.solt){
+        if(element.solt>catalogueForm.solt||element.solt==catalogueForm.solt){
           pushEnd = true
           that.albumArr.splice(index,0,catalogueForm)
           break;

+ 1 - 2
src/views/modules/knowledge/album/index.vue

@@ -154,7 +154,6 @@ export default {
       })
     },
     closeDel(){
-      console.log(123123)
       this.delVisible = false
     },
     //删除end
@@ -177,7 +176,6 @@ export default {
       if(this.searchName!=''){
         postData.params.name = this.searchName
       }
-      console.log(postData)
       album.query(postData).then((res) => {
         this.dataList = res.result.data
         this.total = res.result.totalCount
@@ -280,6 +278,7 @@ export default {
     margin-top: 0vw;
   }
   .listBoxitem{
+    cursor: pointer;
     margin:0 auto
   }
 }

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

@@ -49,9 +49,9 @@
     <div class="listItem listContent" v-if="type=='list0'||type=='list1'">
       {{item.documentRemark}}
     </div>
-    <div class="listItem listContent" style="display:flex" v-if="type=='home'&&item.documentRemark!=''">
+    <div class="listItem listContent" style="display:flex" v-if="type=='home'&&item.documentRemark!=''&&item.documentRemark!=null">
       <div style="white-space: nowrap;">摘要:</div>
-      <div class="documentRemarkBox" v-html="item.documentRemark.replaceAll('\n\r','</br>').replaceAll('\r\n','</br>').replaceAll('\n','</br>').replaceAll('\r','</br>')"></div>
+      <div class="documentRemarkBox" v-html="item.documentRemark!=null?item.documentRemark.replaceAll('\n\r','</br>').replaceAll('\r\n','</br>').replaceAll('\n','</br>').replaceAll('\r','</br>'):''"></div>
     </div>
     <div class="listItem listContent"  v-if="type=='home'">
       位于:{{item.documentPath}}

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

@@ -114,7 +114,11 @@ export default {
   },
   methods: {
     lookDetail(data){
-      window.open('knowledgeContentInfo?pkId='+data.pkId)
+      if(data.knowledgeId){
+        window.open('knowledgeContentInfo?pkId='+data.knowledgeId)
+      }else{
+        window.open('knowledgeContentInfo?pkId='+data.pkId)
+      }
     },
     closeDel(){
       this.delVisible = false

+ 18 - 8
src/views/modules/knowledge/components/pageListMap.vue

@@ -70,6 +70,7 @@
 <script>
 import header0 from '../../../../image/header0.png'
 import header1 from '../../../../image/header1.png'
+import map from '@/api/knowledge/map'
 import {mapState} from "vuex";
 export default {
   props: {
@@ -108,16 +109,25 @@ export default {
   },
   methods: {
     lookDetail(){
-      if(this.item.type==2){
-        this.$router.push({
-          name: "knowledgeContentInfo",
-          query: {
-              pkId: this.item.pkId,
-              type:1
+      if(this.item.state==1){
+        if(this.item.type==1){
+          window.open(this.item.outerAccessUrl)
+        }else{
+          window.open('knowledgeContentInfo?pkId='+this.item.knowledgeId)
+        }
+      }else{
+        let postData = {pkId:this.item.pkId}
+        map.updateLearningState(postData).then((res) => {
+          if(res.code == 200) {
+            if(this.item.type==1){
+              window.open(this.item.outerAccessUrl)
+            }else{
+              window.open('knowledgeContentInfo?pkId='+this.item.knowledgeId)
+            }
+            this.item.state=1
+            this.$emit('refresh')
           }
         })
-      }else{
-        window.open(this.item.outerAccessUrl)
       }
     },
     download(data){

+ 14 - 4
src/views/modules/knowledge/map/index.vue

@@ -32,12 +32,12 @@
         <img v-else :src="imgArrX[item.imgNum]" class="pointBlock"/>
       </div>
       <div class="top_title_bg">
-        {{menuArr[actionMenu].name}}
+        {{menuArr.length!=0?menuArr[actionMenu].name:''}}
       </div>
       <div class="left_menu_title">
         <a-dropdown :placement="'bottomCenter'">
           <div class="titleBox">
-            <div class="titleText">{{ titleArr[titleIndex]['name'] }}</div>
+            <div class="titleText">{{ titleArr.length!=0?titleArr[titleIndex]['name']:'' }}</div>
             <div class="caretBox">
               <a-icon type="caret-up" style="font-size: 0.7vw;"/>
               <a-icon type="caret-down" style="margin-top: -0.3vw;font-size: 0.7vw;"/>
@@ -191,12 +191,23 @@ export default {
         if(res.code == 200) {
           this.titleArr = res.data
           this.titleIndex = 0
-          this.getRoutes(this.titleArr[this.titleIndex].pkId)
+          if(this.titleArr.length==0){
+            this.titleArr = [{name: "暂无地图",pkId: "0"}]
+            this.menuIndex = 0
+            this.menuDataArr = []
+            this.dataArr = []
+            this.showData()
+          }else{
+            this.getRoutes(this.titleArr[this.titleIndex].pkId)
+          }
         }
       })
     },
     //  获取知识学习路径
     getRoutes(mapId){
+      if(mapId == 0){
+        return false
+      }
       let getData = {mapId:mapId}
       map.routes(getData).then((res) => {
         if(res.code == 200) {
@@ -224,7 +235,6 @@ export default {
     //  内容展示
     showData(){
       let dataTotol = this.dataArr.length
-      console.log(dataTotol)
       this.showBoxArr = []
       this.overArr = []
       let baseNum = Math.floor(34/dataTotol)

+ 9 - 1
src/views/modules/knowledge/map/list.vue

@@ -20,7 +20,7 @@
       <div v-else class="DataBoxContent">
         <div class="listBox">
           <div class="listBoxItemContent listItemClass" v-for="(item, index) in dataList" :key="index">
-            <pageList :item="item" type="list0" :showHeader="true"></pageList>
+            <pageList :item="item" type="list0" :showHeader="true" @refresh="refresh"></pageList>
             <a-divider class="bottomBorder" v-if="(index!=dataList.length-1)"/>
           </div>
         </div>
@@ -80,6 +80,14 @@ export default {
     })
   },
   methods: {
+   refresh(){
+    let getData={'pkId':this.detailPkId}
+    map.info(getData).then((res) => {
+      if(res.code == 200) {
+        this.dataDetail = res.data
+      }
+    })
+   },
    categoryData(data){
     data.forEach(element => {
       element.label=element.name

+ 11 - 3
src/views/modules/knowledge/warehouse/knowledgeAddUpdate.vue

@@ -51,13 +51,19 @@
             :beforeUpload="beforeUpload"
           >
             <p class="ant-upload-drag-icon">
-              <img :src="add" alt="">
+              <img v-if="!loading" :src="add" alt="">
+              <a-icon v-else type="loading" />
             </p>
-            <p class="ant-upload-text">
+            <p class="ant-upload-text" v-if="!loading">
               点击或将文件拖拽到这里上传
               <br/>
               (仅可上传一份)
             </p>
+            <p class="ant-upload-text" v-else>
+              上传中...
+              <br/>
+              (仅可上传一份)
+            </p>
             <p class="ant-upload-hint">
               支持扩展名:.doc .docx .pdf .xls .xlsx .pptx
             </p>
@@ -111,6 +117,7 @@ export default {
   },
   data() {
     return {
+      loading:false,
       api,
       add,
       wordIcon,
@@ -373,6 +380,7 @@ export default {
         return
       }
       if(info.file.status === 'done') {
+        this.loading = false
         this.knowledgeForm.attachment = info.file.response.data[0].fileId
         this.knowledgeForm.attachmentName = info.file.response.data[0].fileName
       }
@@ -399,7 +407,7 @@ export default {
       this.option.isEdit = false
       this.option.lang = 'zh-CN'
       // this.option.url = 'http://10.5.100.64:9900/api-system/system/core/sysFile/previewFile?fileId=1597050108435845121'
-      this.option.url = 'http://www.hkcqjy.com.cn:8088/api/api-system/system/core/sysFile/previewFile?fileId='+ this.knowledgeForm.attachment,
+      this.option.url = 'http://10.5.100.101/api/api-system/system/core/sysFile/previewFile?fileId='+ this.knowledgeForm.attachment,
       this.option.title = this.knowledgeForm.attachmentName
       this.option.fileType = this.knowledgeForm.attachmentName.split('.').slice(-1)[0]
       this.option.isPrint = false

+ 1 - 1
src/views/modules/knowledge/warehouse/knowledgeAuditInfo.vue

@@ -140,7 +140,7 @@ export default {
       this.option.canDownload = true
       this.option.canPrint = true
       this.option.lang = 'zh-CN'
-      this.option.url = 'http://www.hkcqjy.com.cn:8088/api/api-system/system/core/sysFile/previewFile?fileId='+this.knowledgeForm.attachment
+      this.option.url = 'http://10.5.100.101/api/api-system/system/core/sysFile/previewFile?fileId='+this.knowledgeForm.attachment
       this.option.title = this.knowledgeForm.attachmentName.split(".")[0]
       this.option.fileType = this.knowledgeForm.attachmentName.split(".")[1]
       this.option.isPrint = false

+ 1 - 1
src/views/modules/knowledge/warehouse/knowledgeContentInfo.vue

@@ -89,7 +89,7 @@ export default {
       this.option.canDownload = true
       this.option.canPrint = true
       this.option.lang = 'zh-CN'
-      this.option.url = 'http://www.hkcqjy.com.cn:8088/api/api-system/system/core/sysFile/previewFile?fileId='+this.detailData.attachment
+      this.option.url = 'http://10.5.100.101/api/api-system/system/core/sysFile/previewFile?fileId='+this.detailData.attachment
       this.option.title = this.detailData.attachmentName.split(".")[0]
       this.option.fileType = this.detailData.attachmentName.split(".")[1]
       this.option.isPrint = false

+ 3 - 2
vue.config.js

@@ -169,11 +169,12 @@ const vueConfig = {
             //target: 'http://192.168.0.185:7206',//张哲
             //target: 'http://10.5.100.230:9009',//服务器
            // target: 'http://10.5.100.64:5208',
-            target: 'http://192.168.0.205:7206',//柳哥
+            //target: 'http://192.168.0.205:7206',//柳哥
+            target: 'http://www.hkcqjy.com.cn:8088',
             //target: 'http://10.5.100.230:9009',//服务器
             // target: 'http://10.5.0.233:9900',
             // target: 'http://10.5.100.64:9900',
-            pathRewrite: { '^/api': '' },
+            pathRewrite: { '^api': '' },
             ws: false,
             changeOrigin: true
         },