Browse Source

Merge branch 'custom' of http://8.136.199.33:3000/eta_front/eta_front into custom

Karsa 3 months ago
parent
commit
f50203e613

+ 29 - 5
src/views/ppt_manage/newVersion/pptCatalog.vue

@@ -237,7 +237,7 @@
                         <span>{{item.Title}}</span>
                 </div>
                 <div class="item-opt">
-                    <span v-for="optItem in setListTool()" :key="optItem.key" @click.stop="handleListToolClick(optItem,item)">
+                    <span v-for="optItem in setListTool(item)" :key="optItem.key" @click.stop="handleListToolClick(optItem,item)">
                         {{ getListMenuOptText(optItem.label) }}
                     </span>
                 </div>
@@ -469,7 +469,6 @@ export default {
         if(e==='演示') return this.$t('Slides.list_ppt_item_preview')
         if(e==='下载') return this.$t('Slides.list_ppt_item_download')
         if(e==='编辑') return this.$t('Slides.list_ppt_item_edit')
-
     },
     //ppt详情操作栏
     getContentMenuOptText(e){
@@ -599,7 +598,7 @@ export default {
       }
     },
     //设置列表的操作按钮
-    setListTool(){
+    setListTool(itemData){
       let list = []
       const {checkPermissionBtn,pptPermission} = this.permissionBtn
       const authMap = {
@@ -818,12 +817,29 @@ export default {
       })
     },
     //点击列表操作栏事件处理
-    handleListToolClick(item,{PptId,PptxUrl,Title}){
-        const urlMap = {
+    async handleListToolClick(item,{PptId,PptxUrl,Title,Editor}){
+      if(item.key==='edit'&&Editor.IsEditing&&Editor.AdminId!==Number(localStorage.getItem('AdminId'))){
+        this.$message.warning(`${Editor.Editor}${this.$t('Slides.editing_progress_msg') }...`)
+        return
+      }
+      const urlMap = {
         edit:`/ppteditor?id=${PptId}`,
         publish:`/pptpublish?id=${PptId}`,
         present:`/pptpresent?id=${PptId}`
       }
+      if(item.key==='edit'){
+        //判断能否编辑
+        const editRes=await pptInterface.pptEditLock({PptId:Number(PptId),Status:0})
+        if(editRes.Ret!==200) return
+        if(editRes.Data&&editRes.Data.IsEditing&&editRes.Data.AdminId!==Number(localStorage.getItem('AdminId'))){
+          Editor=editRes.Data
+          this.$message.warning(`${editRes.Data.Editor}${this.$t('Slides.editing_progress_msg') }...`)
+          return
+        }
+        //调接口加锁然后跳转
+        const res = await pptInterface.pptEditLock({PptId:Number(PptId),Status:1})
+        if(res.Ret!==200) return
+      }
       if(urlMap[item.key]){
         window.open(urlMap[item.key],'_blank')
         return 
@@ -849,6 +865,14 @@ export default {
                     this.$message.warning(this.$t('Slides.no_duplicated_edit_msg') )
                     return
                 }
+                //判断能否编辑
+                const editRes=await pptInterface.pptEditLock({PptId:Number(this.pptItem.PptId),Status:0})
+                if(editRes.Ret!==200) return
+                if(editRes.Data&&editRes.Data.IsEditing&&editRes.Data.AdminId!==Number(localStorage.getItem('AdminId'))){
+                  this.setToolList({Editor:{...editRes.Data}})
+                  this.$message.warning(`${editRes.Data.Editor}${this.$t('Slides.editing_progress_msg') }...`)
+                  return
+                }
                 //调接口加锁然后跳转
                 const res = await pptInterface.pptEditLock({PptId:Number(this.pptItem.PptId),Status:1})
                 if(res.Ret!==200) return

+ 31 - 4
src/views/ppt_manage/newVersion/pptEnCatalog.vue

@@ -232,7 +232,7 @@
                         <span>{{item.Title}}</span>
                 </div>
                 <div class="item-opt">
-                    <span v-for="optItem in setListTool()" :key="optItem.key" @click.stop="handleListToolClick(optItem,item)">
+                    <span v-for="optItem in setListTool(item)" :key="optItem.key" @click.stop="handleListToolClick(optItem,item)">
                         {{ getListMenuOptText(optItem.label) }}
                     </span>
                 </div>
@@ -571,7 +571,7 @@ export default {
       }
     },
     //设置列表的操作按钮
-    setListTool(){
+    setListTool(itemData){
       let list = []
       const {checkPermissionBtn,pptPermission} = this.permissionBtn
       const authMap = {
@@ -782,12 +782,31 @@ export default {
       })
     },
     //点击列表操作栏事件处理
-    handleListToolClick(item,{PptId,PptxUrl,Title}){
-        const urlMap = {
+    async handleListToolClick(item,{PptId,PptxUrl,Title,Editor}){
+      if(item.key==='edit'&&Editor.IsEditing&&Editor.AdminId!==Number(localStorage.getItem('AdminId'))){
+        this.$message.warning(`${Editor.Editor}${this.$t('Slides.editing_progress_msg') }...`)
+        return
+      }
+      const urlMap = {
         edit:`/ppteneditor?id=${PptId}`,
         publish:`/pptenpublish?id=${PptId}`,
         present:`/pptenpresent?id=${PptId}`
       }
+      if(item.key==='edit'){
+         //判断能否编辑
+        const editRes=await pptEnInterface.pptEditLock({PptId:Number(PptId),Status:0})
+        if(editRes.Ret!==200) return
+        if(editRes.Data&&editRes.Data.IsEditing&&editRes.Data.AdminId!==Number(localStorage.getItem('AdminId'))){
+          Editor=editRes.Data
+          this.$message.warning(`${editRes.Data.Editor}${this.$t('Slides.editing_progress_msg') }...`)
+          return
+        }
+        //调接口加锁然后跳转
+        const res = await pptEnInterface.pptEditLock({PptId:Number(PptId),Status:1})
+        if(res.Ret!==200) return
+      }
+      
+
       if(urlMap[item.key]){
         window.open(urlMap[item.key],'_blank')
         return 
@@ -812,6 +831,14 @@ export default {
                     this.$message.warning(this.$t('Slides.no_duplicated_edit_msg') )
                     return
                 }
+                //判断能否编辑
+                const editRes=await pptEnInterface.pptEditLock({PptId:Number(this.pptItem.PptId),Status:0})
+                if(editRes.Ret!==200) return
+                if(editRes.Data&&editRes.Data.IsEditing&&editRes.Data.AdminId!==Number(localStorage.getItem('AdminId'))){
+                  this.setToolList({Editor:{...editRes.Data}})
+                  this.$message.warning(`${editRes.Data.Editor}${this.$t('Slides.editing_progress_msg') }...`)
+                  return
+                }
                 //调接口加锁然后跳转
                 const res = await pptEnInterface.pptEditLock({PptId:Number(this.pptItem.PptId),Status:1})
                 if(res.Ret!==200) return