3 Commits 0d1a1f388c ... 51c7b04ebc

Author SHA1 Message Date
  shanbinzhang 51c7b04ebc Merge branch 'debug' of http://8.136.199.33:3000/eta_gn_front/eta_front into debug 1 day ago
  shanbinzhang 2aa5d6282f Merge branch 'gn2.1' into debug 1 day ago
  shanbinzhang b6eef4b698 fix 1 day ago

+ 39 - 16
src/views/ppt_manage/newVersion/pptCatalog.vue

@@ -64,9 +64,13 @@
     <div class="detail-wrap ppt-page-wrap" id="right">
       <div class="detail-list" v-if="model==='list'">
         <div class="total">
-          {{$i18n.locale == 'zh' ? `共${catalogPPTList.length}个PPT`:`Numbers of PPTs:${catalogPPTList.length} `}}
+          共{{ total }}个PPT
         </div>
-        <div class="ppt-list">
+        <div 
+          class="ppt-list" 
+          @scroll="handleLoadPpt"
+          ref="pptListRef"
+        >
           <draggable
             class="drag-cont"
             v-model="catalogPPTList"
@@ -92,7 +96,7 @@
                 </div>
                 <div class="item-foot" style="margin-bottom:0;">
                   <el-tooltip :content="$t('Slides.update_time')" placement='top' :enterable="false">
-                    <span class="item-update-item">{{$moment(item.PptModifyTime).format('YYYY-MM-DD HH:mm:ss')}}</span>
+                    <span class="item-update-item">{{$moment(item.ModifyTime).format('YYYY-MM-DD HH:mm:ss')}}</span>
                   </el-tooltip>
                   <span>{{ $i18n.locale == 'zh'?`${item.PptPage}页`:`P${item.PptPage}` }}</span>
                 </div>
@@ -239,6 +243,7 @@ export default {
       total: 0,
       pageSize: 50,
       pageNo: 1,
+      haveMore:true,
 
       //添加ppt弹窗
       isAddPptBaseShow:false
@@ -296,6 +301,23 @@ export default {
       return statusMap.get(state)||""
     },
 
+    //加载ppt列表
+    handleLoadPpt: _.throttle(function() {
+			let scrollTop = this.$refs.pptListRef.scrollTop;
+			let clientHeight = this.$refs.pptListRef.clientHeight;
+			let scrollHeight = this.$refs.pptListRef.scrollHeight;
+			if(scrollTop===0) return
+			if(scrollTop + clientHeight >= scrollHeight-10 && this.haveMore){
+				this.pageNo++;
+        this.changeModel('list',{})
+			}
+		},200),
+
+    initListStatus() {
+      this.pageNo = 1;
+      this.$refs.pptListRef&&(this.$refs.pptListRef.scrollTop = 0);
+    },
+
     //关闭弹窗
     closeDialog(name){
       this[name] = false
@@ -323,14 +345,18 @@ export default {
           PageSize: this.pageSize,
           CurrentIndex: this.pageNo,
           Source: this.panelSource,
-          ClassifyId: item.Id,
+          ClassifyId: this.selectNode?this.selectNode.Id:0,
           Keyword: ''
         })
           
         if(res.Ret!==200) return
-        this.catalogPPTList = res.Data.List.map(item=>{
-          item.nodeKeyId = 'ppt'+item.PptId //避免和目录id重复的情况
-          return item
+        this.total = res.Data.Paging.Totals;
+        this.haveMore = res.Data.Paging.Pages > this.pageNo;
+        let list = this.pageNo === 1 ? res.Data.List : [...this.catalogPPTList,...res.Data.List];
+
+        this.catalogPPTList = list.map(_=>{
+          _.nodeKeyId = 'ppt'+_.PptId //避免和目录id重复的情况
+          return _
         })
       }
     },
@@ -379,7 +405,8 @@ export default {
         this.changeModel('ppt',data,false)
       }else{
         this.selectNode = data
-        this.changeModel('list',data)
+        this.initListStatus()
+        this.changeModel('list',{})
       }
     },
 
@@ -400,8 +427,9 @@ export default {
           if(res.Ret===200){
             this.$message.success(this.$t('MsgPrompt.delete_msg'));
             this.getCatalogsList()
-            this.$refs.publicTree.setCurrentKey(data.catalogId)
+            this.$refs.publicTree.setCurrentKey(data.nodeKeyId)
             
+            this.initListStatus()
             this.changeModel('list',{})
 
           }
@@ -634,13 +662,6 @@ export default {
       const res = await pptInterface.getCatalogsListV2({Source: this.panelSource})
       if(res.Ret===200){
         this.classifyList = changeCatalogArr(res.Data||[])
-        this.$nextTick(()=>{
-          if(this.selectNode&&this.selectNode.GroupId){
-            this.changeModel('list',this.selectNode)
-          }else if(!this.selectNode){
-            this.changeModel('list',{})
-          }
-        })
       }
     },
 
@@ -659,11 +680,13 @@ export default {
       this.publicExpandKeys = [];
       this.searchTitle = '';
       this.getCatalogsList()
+      this.changeModel('list',{})
     },
 
   },
   mounted(){
     this.getCatalogsList()
+    this.changeModel('list',{})
   }
 };
 </script>

+ 6 - 0
src/views/ppt_manage/newVersion/pptEditor.vue

@@ -1141,6 +1141,9 @@ export default {
     },
     //保存时的校验规则:封面信息,至少一页
     save_checkPPT(){
+      if(!this.firstPage.BackgroundImg){
+        return {result:false,hintText:'请选择封面页!'}
+      }
       if(!this.firstPage.Title){
         return {result:false,hintText:this.$t('Slides.please_input_cover_title')+'!'}
       }
@@ -1151,6 +1154,9 @@ export default {
     },
     //发布时的校验规则:封面信息,每一页标题及内容
     checkPPT(){
+      if(!this.firstPage.BackgroundImg){
+        return {result:false,hintText:'请选择封面页!'}
+      }
       //检验首页
       if(!this.firstPage.Title){
         return {result:false,hintText:this.$t('Slides.please_input_cover_title')+'!'}

+ 1 - 1
src/views/ppt_manage/newVersion/pptPublish.vue

@@ -386,7 +386,7 @@ export default {
               h:offsetY===0?height:(realSize.height/imgData2Obj.imgHeight*percentHeight)+'%',
               size:{type:"contain"}
             })
-          }else if(sheetData){
+          }else if(sheetData.list){
             slide.addTable(sheetData.list,{
               x:x,y:y,w:width,h:height,border:{type:'solid',pt:1}
             })