zhangli 2 vuotta sitten
vanhempi
commit
5cd2435686

+ 0 - 1
src/layouts/MainLayout.vue

@@ -124,7 +124,6 @@
                   'knowledgeAddUpdate',
                   'auditProcessMaintain',
                   'mapList',
-                  'addUpdateMap',
                   'albumInfo',
                   'albumAuditList',
                   'commentAuditList',

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

@@ -177,7 +177,6 @@ import orgPeople from './components/orgPeople'
 import albumCatalog from './components/albumCatalog.vue'
 import api from '@/api/knowledge/album/albumInfo'
 import albumAuditApi from '@/api/knowledge/album/albumAudit'
-
 export default {
   name: 'albumInfo',
   components: {
@@ -398,7 +397,7 @@ export default {
     handleCheckClick() {
       this.handleCheckClick = false
       this.auditForm.pkIds = [ this.pkId ]
-      api.albumAuditApi(this.auditForm).then(res => {
+      albumAuditApi.approve(this.auditForm).then(res => {
         if(res.code) {
           setTimeout(() => 
             {
@@ -457,6 +456,7 @@ export default {
     },
     // 保存
     handleSaveClick() {
+      this.saveLoading = true
       let query = {
         pkId: this.pkId,
         versionId: this.versionId,
@@ -464,7 +464,14 @@ export default {
         yelps: this.yelps
       }
       api.removeKnowledgeAndYelp(query).then(res => {
-        console.log(res)
+        if(res.code == 200) {
+          setTimeout(() => 
+            {
+              this.$router.back()
+              this.saveLoading = false
+            }
+          ,1000)
+        }
       })
     }
   }

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

@@ -203,7 +203,7 @@ export default {
       this.handleSaveClick = false
       this.auditForm.pkIds = [ this.pkId ]
       commentAuditApi.approve(this.auditForm).then(res => {
-        if(res.code) {
+        if(res.code == 200) {
           setTimeout(() => 
             {
               this.$router.back()

+ 50 - 15
src/views/modules/knowledge/map/addUpdateMap.vue

@@ -98,7 +98,7 @@
                   <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)"/>
+                      <a-icon type="form" :style="{ color: '#000' }" @click.stop="handleEditTabClick(item,index)"/>
                       <a-icon type="close" :style="{ color: '#000' }" @click.stop="handleDelTabClick(index)"/>
                     </span>
                     <a-button type="dashed" style="width: 100%;" @click.stop="addLearnInfo"><a-icon type="plus" />新增学习内容</a-button>
@@ -136,7 +136,7 @@
             <a-input v-model="routeForm.name" :maxLength="10" placeholder="请输入路径名称(10个汉字以内)"/>
           </a-form-model-item>
           <a-form-model-item label="路径排序">
-            <a-input v-model="routeForm.sort" :min="1" />
+            <a-input-number :disabled="showRouteTitle == '编辑学习路径'" v-model="routeForm.sort" :min="1" />
           </a-form-model-item>
         </a-form-model>
       </a-modal>  
@@ -289,6 +289,7 @@ export default {
       tabsKeys: '1',
       tabRouteList:[],
       showRouteTitle:'',
+      chooseRouteIndex: 0,
       showRouteFlag: false,
       routeForm:{
         name:'',
@@ -324,13 +325,13 @@ export default {
     }
   },
   created() {
-    this.mapForm = Object.assign({},this.$options.data().mapForm)
     let pkId = this.$route.query.pkId
     if(pkId) {
       this.pkId = pkId
       this.load(pkId);
+    } else {
+      this.load();
     }
-    this.load();
   },
   methods: {
     load(pkId = false) {
@@ -366,7 +367,7 @@ export default {
             this.mapForm.groupId = info.groupId.split(',')
             this.mapForm.groupSummary = info.groupSummary
             this.mapForm.groupPurview = info.groupPurview.toString()
-            if(info.routes.length) {
+            if(info.routes && info.routes.length) {
               let disposeRoutes = info.routes 
               disposeRoutes.forEach(item => {
                 if(!item.contents) {
@@ -377,7 +378,6 @@ export default {
             } else {
               this.tabRouteList = []
             }
-            console.log(this.tabRouteList)
             if(this.mapForm.groupPurview == 2) {
               let queryParam = {
                 pageNo: 1,
@@ -445,7 +445,14 @@ export default {
         item.createTime = getTimeNow()
       })
       this.showUserFlag = false
-      this.userList = [...res]
+      if(this.pkId) {
+        this.userList = [ ...this.userList, ...res ]
+        const map = new Map()
+        let filterList = this.userList.filter(el => !map.has(el.userId) && map.set(el.userId,true))
+        this.userList = filterList
+      } else {
+        this.userList = [ ...res ]
+      }
     },
     // 移除指定员工
     handleRemoveUserClick(record){
@@ -472,17 +479,45 @@ export default {
     handleSaveRouteOk() {
       if(!this.routeForm.name) {
         this.$message.error('请输入路径名称')
+        return
       }
-      this.tabRouteList.push({
-        ...this.routeForm,
-        contents: []
-      })
-      this.tabRouteList = this.tabRouteList.sort((a,b)=>{ return a.sort-b.sort})
+      if(this.tabRouteList.some(item => item.name == this.routeForm.name)) {
+        this.$message.error('路径名已存在')
+        return
+      }
+
+      if(this.showRouteTitle == '编辑学习路径') {
+        this.tabRouteList.splice(this.chooseRouteIndex,1,{
+          ...this.routeForm,
+        })
+      } else {
+        // 找到tabRouteList中大于等于routeForm.sort的索引
+        let itemIndex = this.tabRouteList.findIndex(item => item.sort >= this.routeForm.sort)
+        if(itemIndex == -1) {
+          this.tabRouteList.push({
+            ...this.routeForm,
+            contents: []
+          })
+        } else {
+          this.tabRouteList.splice(itemIndex,0,{
+            ...this.routeForm,
+            contents: []
+          })
+        }
+      }
+  
+      //  直接push后排序
+      // this.tabRouteList.push({
+      //   ...this.routeForm,
+      //   contents: []
+      // })
+      // this.tabRouteList = this.tabRouteList.sort((a,b)=>{ return a.sort-b.sort})
       this.showRouteFlag = false
     },
     // 编辑学习路径
-    handleEditTabClick(item){
-      this.routeForm = item
+    handleEditTabClick(item,index){
+      this.chooseRouteIndex = index
+      this.routeForm = JSON.parse(JSON.stringify(item))
       this.showRouteTitle = '编辑学习路径'
       this.showRouteFlag = true
     },
@@ -571,7 +606,7 @@ export default {
       this.$refs.learnRef.validate(valid => {
           if(valid) {
             setTimeout(() => {
-                if(this.learnForm.type == 1) {
+              if(this.learnForm.type == 1) {
                 this.tabRouteList[parseInt(this.tabsKeys)-1].contents.push({
                   ...this.learnForm
                 })

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

@@ -137,7 +137,8 @@ export default {
       if(item.type == 1) {
          window.open(item.outerAccessUrl)
       } else {
-        this.jump(item.knowledgeId)
+        // this.jump(item.knowledgeId)
+        window.open(`knowledgeAddUpdate?pkId=${item.knowledgeId}&show=true`)
       }
     },
     jump(pkId){

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

@@ -5,7 +5,8 @@
         <div slot="toolheader" border="false" foldbtn="false">
           <breadcrumb firstLevel="地图管理" lastLevel="地图列表" />
           <div class="mainContent">
-            <div class="body" :style="{'padding-right': $store.state.appSetting.collapsed ? '0px' : '20px' }">
+            <div class="body" style="padding-right:20px;
+            ">
               <div class="content">
                 <a-form ref="searchForm" layout="inline" style="display:flex;">
                   <div style="width:80%;display:flex;flex-wrap:wrap;">

+ 2 - 2
vue.config.js

@@ -156,10 +156,10 @@ const vueConfig = {
     proxy: {
         '/api-knowledge': {
             // target: 'http://10.5.100.64:5208',
-             target: 'http://10.5.100.230:9009',//服务器
+            target: 'http://10.5.100.230:9009',//服务器
             // target: 'http://www.hkcqjy.com.cn:8088',
             // target: 'http://192.168.0.185:7206',    // 张哲
-            //target: 'http://192.168.0.205:7206',//柳哥
+            // target: 'http://192.168.0.205:7206',//柳哥
             // target: 'http://10.5.0.233:9900',
             // target: 'http://10.5.100.64:9900',
             pathRewrite: { '^/api': '' },