Browse Source

修改bug

Zhang Li, BBF-411-2(Neusoft) 2 years ago
parent
commit
3e07b7c56e

+ 7 - 1
src/views/modules/knowledge/album/albumClassifyList.vue

@@ -242,9 +242,15 @@ export default {
       this.classForm = Object.assign({},this.$options.data().classForm)
     },
     handleJumpKnowledgeManage(record) {
+      let pkIds
+      if(record.parent == 0) {
+        pkIds = [ record.pkId ]
+      } else {
+        pkIds = [ record.parent, record.pkId ]
+      }
       this.$router.push({
         path: '/knowledge/albumList',
-        query: {pkId: record.pkId}
+        query: {pkIds: JSON.stringify(pkIds)}
       })
     },
      // 重新加载表格

+ 3 - 4
src/views/modules/knowledge/album/albumInfo.vue

@@ -120,7 +120,7 @@
                     </div>
                     <div>
                       <span>{{ item.createTime  }}</span>
-                      <a-button type="link" @click="handleRemarkDelClick(index,item.pkId)">删除</a-button>  
+                      <a-button v-if="actionFlag.indexOf('edit') > -1" type="link" @click="handleRemarkDelClick(index,item.pkId)">删除</a-button>  
                     </div>
                   </div>
                   <!-- body -->
@@ -135,7 +135,7 @@
                       </div>
                       <div>
                         <span>{{ iten.createTime }}</span>
-                        <a-button type="link" @click="handleReplyDelClick(index,indey,iten.pkId)">删除</a-button>  
+                        <a-button v-if="actionFlag.indexOf('edit') > -1" type="link" @click="handleReplyDelClick(index,indey,iten.pkId)">删除</a-button>  
                       </div>
                     </div>
                   </template>
@@ -425,7 +425,6 @@ export default {
         }
       }
       console.log(this.collapseCheckKey)
-      // 暂时还没写
       api.queryComment(query).then(res => {
         if(res.code == 200) {
           let key = parseInt(this.collapseCheckKey.slice(-1)[0]) - 1
@@ -669,7 +668,7 @@ export default {
   padding-left: 0;
 }
 /deep/ .ant-tabs-ink-bar {
-  bottom: 3px;
+  bottom: 2px;
   height: 1.5px;
 }
 /deep/ .ant-collapse {

+ 5 - 4
src/views/modules/knowledge/album/albumList.vue

@@ -238,10 +238,11 @@ export default {
     }
   },
   created() {
-    let albumClassifyId = this.$route.query.pkId
-    if(albumClassifyId) {
-      this.queryParam.categoryId = albumClassifyId
-      this.categoryIds = [ albumClassifyId ]
+    let albumClassifyId = JSON.parse(this.$route.query.pkIds)
+    if(albumClassifyId && albumClassifyId.length) {
+      this.queryParam.categoryId = albumClassifyId.slice(-1)[0]
+      console.log(this.queryParam.categoryId)
+      this.categoryIds = albumClassifyId
     }
     this.init()
   },

+ 1 - 1
src/views/modules/knowledge/album/commentAuditList.vue

@@ -201,7 +201,7 @@ export default {
           scopedSlots: {customRender: 'content'}
         },
         {
-          title: '专名称',
+          title: '专名称',
           dataIndex: 'albumName',
           align: 'center',
           width: 150,

+ 86 - 64
src/views/modules/knowledge/map/addUpdateMap.vue

@@ -123,9 +123,11 @@
                 <a-tabs v-model="tabsKeys" size="large" :animated="false">
                   <a-tab-pane v-for="(item,index) in tabRouteList" :key="index + 1 + ''">
                     <span slot="tab">
-                      <span style="margin:0 12px 0 20px;">{{ item.name }}</span>
-                      <a-icon type="form" :style="{ color: '#000' }" @click.stop="handleEditTabClick(item,index)"/>
-                      <a-icon type="close" :style="{ color: '#000' }" @click.stop="handleDelTabClick(index)"/>
+                      <div style="margin: 0 15px">
+                        <span style="margin:0 12px 0 0;">{{ item.name }}</span>
+                        <a-icon type="form" :style="{ color: '#000' }" @click.stop="handleEditTabClick(item,index)"/>
+                        <a-icon type="close" :style="{ color: '#000' }" style="margin-right:0;" @click.stop="handleDelTabClick(index)"/>
+                      </div>
                     </span>
                     <a-button type="dashed" style="width: 100%;color: #aaa;" @click.stop="addLearnInfo"><a-icon type="plus" style="margin-right: 8px;color: #aaa;" />新增学习内容</a-button>
                     <pageList :contents="item.contents" @delItem="handleDelItemClick" @actionItem="handleActionItemClick" @setAddMapData="setAddMapData"></pageList>
@@ -183,10 +185,10 @@
               </a-select>
             </a-form-model-item>
             <a-form-model-item label="系统名称" prop="outerSystemName" v-show="learnForm.type==1">
-              <a-input v-model="learnForm.outerSystemName" placeholder="请输入" />
+              <a-input v-model="learnForm.outerSystemName" :maxLength="20" placeholder="请输入" />
             </a-form-model-item>
             <a-form-model-item label="内容名称" prop="outerContentName" v-show="learnForm.type==1">
-              <a-input v-model="learnForm.outerContentName" placeholder="请输入" />
+              <a-input v-model="learnForm.outerContentName" :maxLength="100" placeholder="请输入" />
             </a-form-model-item>
             <a-form-model-item label="访问地址" prop="outerAccessUrl" v-show="learnForm.type==1">
               <a-input v-model="learnForm.outerAccessUrl" placeholder="请输入一个网址" />
@@ -370,18 +372,6 @@ export default {
     }
   },
   methods: {
-    transCheckedTarget(arg) {
-      this.choosePeople = arg
-    },
-    // 每页条数
-    handleShowSizeChange(current, pageSize) {
-      this.pageParam.pageNo = current
-      this.pageParam.pageSize = pageSize;
-    },
-    // 跳转
-    onChange(pageNumber) {
-      this.pageParam.pageNo = pageNumber
-    },
     load(pkId = false) {
       // 获取所属组织
       OsGroupApi.getAllOsGroupList({dimId:1}).then(res => {
@@ -408,53 +398,69 @@ export default {
       api.dic({alias: 'KNOWLEDGE_MAP'}).then(res => {
         this.mapTypeList = res.data
         if(pkId) {
-          api.info({pkId:pkId}).then(res => {
-            let info = res.data
-            this.mapForm.type = this.mapTypeList.find(item => item.name == info.typeName).value
-            this.mapForm.name = info.name
-            this.mapForm.groupId = info.groupId.split(',')
-            this.mapForm.groupSummary = info.groupSummary
-            this.mapForm.groupPurview = info.groupPurview.toString()
-            if(info.routes && info.routes.length) {
-              let disposeRoutes = info.routes 
-              disposeRoutes.forEach(item => {
-                if(!item.contents) {
-                  item.contents = []
-                }
-              })
-              this.tabRouteList = disposeRoutes
-            } else {
-              this.tabRouteList = []
-            }
-            if(this.mapForm.groupPurview == 2) {
-              let queryParam = {
-                pageNo: 1,
-                pageSize: 9999,
-                params: {
-                  pkId: pkId
-                },
-                sortField: '',
-                sortOrder: 'asc'
-              }
-              api.purview(queryParam).then(res => {
-                this.userList = res.result.data
-              })
-            }
-          })
-        }
-        if(this.$route.query.timeStamp) {
           this.timeStamp = this.$route.query.timeStamp
           if(SessionCache.getCache(this.timeStamp)) {
-            let info = SessionCache.getCache(this.timeStamp)
-            this.mapForm.type = info.type ? this.mapTypeList.find(item => item.value == info.type).value : undefined
-            this.mapForm.name = info.name
-            this.mapForm.groupId = info.groupId ? info.groupId.split(',') : []
-            this.mapForm.groupSummary = info.groupSummary
-            this.mapForm.groupPurview = info.groupPurview && info.groupPurview.toString()
-            if(this.mapForm.groupPurview == 2) {
-              this.userList = info.purviewUsers
+              let info = SessionCache.getCache(this.timeStamp)
+              this.mapForm.type = info.type ? this.mapTypeList.find(item => item.value == info.type).value : undefined
+              this.mapForm.name = info.name
+              this.mapForm.groupId = info.groupId ? info.groupId.split(',') : []
+              this.mapForm.groupSummary = info.groupSummary
+              this.mapForm.groupPurview = info.groupPurview && info.groupPurview.toString()
+              if(this.mapForm.groupPurview == 2) {
+                this.userList = info.purviewUsers
+              }
+              this.tabRouteList = info.routes
+          } else {
+            api.info({pkId:pkId}).then(res => {
+              let info = res.data
+              this.mapForm.type = this.mapTypeList.find(item => item.name == info.typeName).value
+              this.mapForm.name = info.name
+              this.mapForm.groupId = info.groupId.split(',')
+              this.mapForm.groupSummary = info.groupSummary
+              this.mapForm.groupPurview = info.groupPurview.toString()
+              if(info.routes && info.routes.length) {
+                let disposeRoutes = info.routes 
+                disposeRoutes.forEach(item => {
+                  if(!item.contents) {
+                    item.contents = []
+                  }
+                })
+                this.tabRouteList = disposeRoutes
+              } else {
+                this.tabRouteList = []
+              }
+              if(this.mapForm.groupPurview == 2) {
+                let queryParam = {
+                  pageNo: 1,
+                  pageSize: 9999,
+                  params: {
+                    pkId: pkId
+                  },
+                  sortField: '',
+                  sortOrder: 'asc'
+                }
+                api.purview(queryParam).then(res => {
+                  this.userList = res.result.data
+                })
+              }
+            })
+          }
+
+        } else {
+          if(this.$route.query.timeStamp) {
+            this.timeStamp = this.$route.query.timeStamp
+            if(SessionCache.getCache(this.timeStamp)) {
+              let info = SessionCache.getCache(this.timeStamp)
+              this.mapForm.type = info.type ? this.mapTypeList.find(item => item.value == info.type).value : undefined
+              this.mapForm.name = info.name
+              this.mapForm.groupId = info.groupId ? info.groupId.split(',') : []
+              this.mapForm.groupSummary = info.groupSummary
+              this.mapForm.groupPurview = info.groupPurview && info.groupPurview.toString()
+              if(this.mapForm.groupPurview == 2) {
+                this.userList = info.purviewUsers
+              }
+              this.tabRouteList = info.routes
             }
-            this.tabRouteList = info.routes
           }
         }
       })
@@ -472,7 +478,7 @@ export default {
     },
     // 组织切换
     handleTreeChange(value) {
-      this.mapForm.groupPurview = ''
+      this.mapForm.groupPurview = '1'
       this.userList = []
     },  
     // 选中节点
@@ -570,7 +576,6 @@ export default {
           ...this.routeForm,
         })
       } else {
-        console.log(this.routeForm)
         // 找到tabRouteList中大于等于routeForm.sort的索引
         let itemIndex = this.tabRouteList.findIndex(item => item.sort >= this.routeForm.sort)
         if(itemIndex == -1) {
@@ -677,7 +682,6 @@ export default {
     },
     // 选中知识
     async handleKnowledgeChange(value) {
-      console.log(value)
       let res = await api.knowledgeSnapshot({'pkId': value})
       this.knowledgeInfo = res.data
     },
@@ -692,6 +696,7 @@ export default {
               //   this.$message.error('已添加相同的学习内容')
               //   return
               // }
+              // 外部系统
               let systemInfo = tabs.filter(item => item.outerSystemName == this.learnForm.outerSystemName)
               if(systemInfo.some(item => item.outerContentName == this.learnForm.outerContentName)) {
                 this.$message.error('已添加相同的学习内容')
@@ -702,6 +707,11 @@ export default {
                 ...this.learnForm
               })
             } else {
+              // 站内知识
+              if(tabs.some(item => item.knowledgeId == this.learnForm.knowledgeId)) {
+                this.$message.error('已添加相同的学习内容')
+                return
+              }
               this.saveLoading = true
               tabs.unshift({
                 ...this.learnForm,
@@ -793,6 +803,18 @@ export default {
       }
       SessionCache.setCache(this.timeStamp,data)
     },
+    transCheckedTarget(arg) {
+      this.choosePeople = arg
+    },
+    // 每页条数
+    handleShowSizeChange(current, pageSize) {
+      this.pageParam.pageNo = current
+      this.pageParam.pageSize = pageSize;
+    },
+    // 跳转
+    onChange(pageNumber) {
+      this.pageParam.pageNo = pageNumber
+    },
     //加载左树下的子节点
     onLoadGroupTree(treeNode) {
       if (treeNode.dataRef.children) {

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

@@ -3,7 +3,7 @@
     <div v-for="(item, index) in contents" :key="index">
       <div class="inside">
         <template v-if="item.type == 1">
-          <div>{{ item.outerContentName }}</div>
+          <div v-html="item.outerContentName ? (item.outerContentName.replaceAll('\n\r','</br>').replaceAll('\r\n','</br>').replaceAll('\n','</br>').replaceAll('\r','</br>').replaceAll('\\n','</br>')) : ''"></div>
         </template>
         <template v-else>
           <div>{{ item.titles }}</div>
@@ -73,8 +73,6 @@ export default {
       default: () => []
     }
   },
-  created() {
-  },
   computed: {
     ...mapState({
         user: (state) => state.appSetting.user,

+ 1 - 1
src/views/modules/knowledge/map/mapList.vue

@@ -222,7 +222,7 @@ export default {
     handleJumpUpdateClick(record) {
       this.$router.push({
         path: '/knowledge/addUpdateMap',
-        query: {pkId: record.pkId}
+        query: {pkId: record.pkId, timeStamp: new Date().getTime()}
       })
     },
     //加载左树下的子节点