|
@@ -237,7 +237,7 @@
|
|
<span>{{item.Title}}</span>
|
|
<span>{{item.Title}}</span>
|
|
</div>
|
|
</div>
|
|
<div class="item-opt">
|
|
<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) }}
|
|
{{ getListMenuOptText(optItem.label) }}
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</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_preview')
|
|
if(e==='下载') return this.$t('Slides.list_ppt_item_download')
|
|
if(e==='下载') return this.$t('Slides.list_ppt_item_download')
|
|
if(e==='编辑') return this.$t('Slides.list_ppt_item_edit')
|
|
if(e==='编辑') return this.$t('Slides.list_ppt_item_edit')
|
|
-
|
|
|
|
},
|
|
},
|
|
//ppt详情操作栏
|
|
//ppt详情操作栏
|
|
getContentMenuOptText(e){
|
|
getContentMenuOptText(e){
|
|
@@ -599,7 +598,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//设置列表的操作按钮
|
|
//设置列表的操作按钮
|
|
- setListTool(){
|
|
|
|
|
|
+ setListTool(itemData){
|
|
let list = []
|
|
let list = []
|
|
const {checkPermissionBtn,pptPermission} = this.permissionBtn
|
|
const {checkPermissionBtn,pptPermission} = this.permissionBtn
|
|
const authMap = {
|
|
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}`,
|
|
edit:`/ppteditor?id=${PptId}`,
|
|
publish:`/pptpublish?id=${PptId}`,
|
|
publish:`/pptpublish?id=${PptId}`,
|
|
present:`/pptpresent?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]){
|
|
if(urlMap[item.key]){
|
|
window.open(urlMap[item.key],'_blank')
|
|
window.open(urlMap[item.key],'_blank')
|
|
return
|
|
return
|
|
@@ -849,6 +865,14 @@ export default {
|
|
this.$message.warning(this.$t('Slides.no_duplicated_edit_msg') )
|
|
this.$message.warning(this.$t('Slides.no_duplicated_edit_msg') )
|
|
return
|
|
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})
|
|
const res = await pptInterface.pptEditLock({PptId:Number(this.pptItem.PptId),Status:1})
|
|
if(res.Ret!==200) return
|
|
if(res.Ret!==200) return
|