瀏覽代碼

Merge branch 'master' of http://8.136.199.33:3000/eta_front/eta_front

jwyu 1 年之前
父節點
當前提交
ffbf5f4cd5

+ 6 - 0
src/views/mychart_manage/components/chartDetailDia.vue

@@ -224,6 +224,7 @@
                             type="number"
                             type="number"
                             placeholder="上限"
                             placeholder="上限"
                             v-model="chartLimit.max"
                             v-model="chartLimit.max"
+                            :disabled="!isAllowEditLimit"
                             @change="changeLimit"
                             @change="changeLimit"
                         />
                         />
                         <el-input
                         <el-input
@@ -232,6 +233,7 @@
                             type="number"
                             type="number"
                             placeholder="下限"
                             placeholder="下限"
                             v-model="chartLimit.min"
                             v-model="chartLimit.min"
+                            :disabled="!isAllowEditLimit"
                             @change="changeLimit"
                             @change="changeLimit"
                         />
                         />
                     </div>
                     </div>
@@ -242,6 +244,7 @@
                             type="number"
                             type="number"
                             placeholder="上限"
                             placeholder="上限"
                             v-model="chartLimit.rightMax"
                             v-model="chartLimit.rightMax"
+                            :disabled="!isAllowEditLimit"
                             @change="changeLimit"
                             @change="changeLimit"
                         />
                         />
                         <el-input
                         <el-input
@@ -250,6 +253,7 @@
                             type="number"
                             type="number"
                             placeholder="下限"
                             placeholder="下限"
                             v-model="chartLimit.rightMin"
                             v-model="chartLimit.rightMin"
+                            :disabled="!isAllowEditLimit"
                             @change="changeLimit"
                             @change="changeLimit"
                         />
                         />
                     </div>
                     </div>
@@ -261,6 +265,7 @@
                             type="number"
                             type="number"
                             placeholder="上限"
                             placeholder="上限"
                             v-model="chartLimit.rightTwoMax"
                             v-model="chartLimit.rightTwoMax"
+                            :disabled="!isAllowEditLimit"
                             @change="changeLimit"
                             @change="changeLimit"
                         />
                         />
                         <el-input
                         <el-input
@@ -269,6 +274,7 @@
                             type="number"
                             type="number"
                             placeholder="下限"
                             placeholder="下限"
                             v-model="chartLimit.rightTwoMin"
                             v-model="chartLimit.rightTwoMin"
+                            :disabled="!isAllowEditLimit"
                             @change="changeLimit"
                             @change="changeLimit"
                         />
                         />
                     </div>
                     </div>

+ 3 - 0
src/views/ppt_manage/mixins/pptEditorMixins.js

@@ -17,6 +17,9 @@ export default{
       copyPagesMap:{},//选中的ppt页Id
       copyPagesMap:{},//选中的ppt页Id
       savePagesArr:[],//存储上一次选中的ppt页
       savePagesArr:[],//存储上一次选中的ppt页
       CoverContent:'',//自定义封面页内容
       CoverContent:'',//自定义封面页内容
+      showLastSaveTime:false,//是否展示自动保存时间
+      lastSaveTime:'',//自动保存时间
+      isSaved:false,//是否已点击了保存/发布
     }
     }
   },
   },
   directives: {
   directives: {

+ 1 - 1
src/views/ppt_manage/newVersion/components/formatEl/SheetEl.vue

@@ -77,4 +77,4 @@ export default {
 			}
 			}
   }
   }
 }
 }
-</style>
+</style>

+ 20 - 8
src/views/ppt_manage/newVersion/pptEditor.vue

@@ -109,6 +109,9 @@
             </template>
             </template>
         </div>
         </div>
         <div class="ppt-tool flex-column">
         <div class="ppt-tool flex-column">
+            <div class="save-hint" v-show="showLastSaveTime" 
+                style="color: #666; margin-bottom: 15px"
+            >最近保存时间:{{lastSaveTime}}</div>
             <div class="tool-btn">
             <div class="tool-btn">
                 <el-button v-permission="permissionBtn.pptPermission.ppt_publish"
                 <el-button v-permission="permissionBtn.pptPermission.ppt_publish"
                  type="primary" @click="handlePublish">{{$t('Slides.go_to_publish')}}</el-button>
                  type="primary" @click="handlePublish">{{$t('Slides.go_to_publish')}}</el-button>
@@ -278,6 +281,7 @@
 <script>
 <script>
 import {countComponentName,checkClipboardItems,createRandomCode,checkPPTpageElemant,getChartInfo} from './utils/untils';
 import {countComponentName,checkClipboardItems,createRandomCode,checkPPTpageElemant,getChartInfo} from './utils/untils';
 import {modelInfo,defaultPosition} from './utils/config'
 import {modelInfo,defaultPosition} from './utils/config'
+import http from '@/api/http.js';
 import { dataBaseInterface ,sandInterface } from "@/api/api.js";
 import { dataBaseInterface ,sandInterface } from "@/api/api.js";
 import futuresInterface from '@/api/modules/futuresBaseApi';
 import futuresInterface from '@/api/modules/futuresBaseApi';
 import chartRelevanceApi from '@/api/modules/chartRelevanceApi';
 import chartRelevanceApi from '@/api/modules/chartRelevanceApi';
@@ -996,7 +1000,7 @@ export default {
         this.$refs[`pptPage_${this.currentIndex}`][0].initPositionInfo()
         this.$refs[`pptPage_${this.currentIndex}`][0].initPositionInfo()
     },
     },
     //手动保存PPT
     //手动保存PPT
-    handleSave(type){
+    async handleSave(type){
      /*  const {result,hintText} = this.checkPPT()
      /*  const {result,hintText} = this.checkPPT()
       if(!result){
       if(!result){
         this.$message.warning(hintText)
         this.$message.warning(hintText)
@@ -1022,19 +1026,21 @@ export default {
         ImgUrl:BackgroundImg,
         ImgUrl:BackgroundImg,
         TemplateType:BackIndex+1
         TemplateType:BackIndex+1
       }
       }
+      this.isSaved = true
       if(this.$route.query.id||this.pptId){
       if(this.$route.query.id||this.pptId){
-        this.editPPT(FirstPage,Content,type)
+        await this.editPPT(FirstPage,Content,type)
       }else{
       }else{
-        this.addPPT(FirstPage,Content)
+        await this.addPPT(FirstPage,Content)
       }
       }
     },
     },
-    addPPT(FirstPage,Content){
-      pptInterface.addppt({
+    async addPPT(FirstPage,Content){
+      await pptInterface.addppt({
         FirstPage:FirstPage,
         FirstPage:FirstPage,
         Content:Content,
         Content:Content,
         GroupId:this.catalogId,
         GroupId:this.catalogId,
         CoverContent:this.CoverContent
         CoverContent:this.CoverContent
       }).then(res=>{
       }).then(res=>{
+        this.isSaved = false
         if(res.Ret===200){
         if(res.Ret===200){
           this.$message.success(this.$t('MsgPrompt.add_msg'))
           this.$message.success(this.$t('MsgPrompt.add_msg'))
           //this.$router.push({path:'/pptlist'})
           //this.$router.push({path:'/pptlist'})
@@ -1046,15 +1052,16 @@ export default {
         }
         }
       })
       })
     },
     },
-    editPPT(FirstPage,Content,type){
+    async editPPT(FirstPage,Content,type){
       //console.log(type)
       //console.log(type)
       const ppt_id = this.$route.query.id||this.pptId
       const ppt_id = this.$route.query.id||this.pptId
-      pptInterface.editppt({
+      await pptInterface.editppt({
         PptId:parseInt(ppt_id),
         PptId:parseInt(ppt_id),
         FirstPage:FirstPage,
         FirstPage:FirstPage,
         Content:Content,
         Content:Content,
         CoverContent:this.CoverContent
         CoverContent:this.CoverContent
       }).then(res=>{
       }).then(res=>{
+        this.isSaved = false
         if(res.Ret===200){
         if(res.Ret===200){
           if(type==='save'){
           if(type==='save'){
             this.$message.success(this.$t('MsgPrompt.edit_msg'))
             this.$message.success(this.$t('MsgPrompt.edit_msg'))
@@ -1093,7 +1100,11 @@ export default {
           FirstPage:FirstPage,
           FirstPage:FirstPage,
           Content:Content,
           Content:Content,
           CoverContent:this.CoverContent
           CoverContent:this.CoverContent
-        }).then((res)=>{})
+        }).then((res)=>{
+            if(res.Ret!==200) return 
+            this.showLastSaveTime = true
+            this.lastSaveTime = http.dateFormatter(new Date(), true);
+        })
       },10000)
       },10000)
     },
     },
     //保存时的校验规则:封面信息,至少一页
     //保存时的校验规则:封面信息,至少一页
@@ -1143,6 +1154,7 @@ export default {
           return
           return
         }
         }
       }
       }
+      //ETA1.7.5更改发布逻辑,点击发布时,自动执行保存操作,若可保存,则跳转发布页
       await this.handleSave('pub')
       await this.handleSave('pub')
       //ppt4.0后,合并后的PPT可能会超出页数or图表限制,在这里做个校验
       //ppt4.0后,合并后的PPT可能会超出页数or图表限制,在这里做个校验
       if(this.pageList.length>this.maxPageNum){
       if(this.pageList.length>this.maxPageNum){

+ 20 - 8
src/views/ppt_manage/newVersion/pptEnEditor.vue

@@ -106,6 +106,9 @@
             </template>
             </template>
         </div>
         </div>
         <div class="ppt-tool flex-column">
         <div class="ppt-tool flex-column">
+            <div class="save-hint" v-show="showLastSaveTime" 
+                style="color: #666; margin-bottom: 15px"
+            >最近保存时间:{{lastSaveTime}}</div>
             <div class="tool-btn">
             <div class="tool-btn">
                 <el-button v-permission="permissionBtn.enPPTPermission.pptEn_publish"
                 <el-button v-permission="permissionBtn.enPPTPermission.pptEn_publish"
                  type="primary" @click="handlePublish">{{$t('Slides.go_to_publish')}}</el-button>
                  type="primary" @click="handlePublish">{{$t('Slides.go_to_publish')}}</el-button>
@@ -290,6 +293,7 @@
 <script>
 <script>
 import {countComponentName,checkClipboardItems,createRandomCode,checkPPTpageElemant,getChartInfo} from './utils/untils';
 import {countComponentName,checkClipboardItems,createRandomCode,checkPPTpageElemant,getChartInfo} from './utils/untils';
 import {modelInfo,defaultPosition} from './utils/config'
 import {modelInfo,defaultPosition} from './utils/config'
+import http from '@/api/http.js';
 import { dataBaseInterface ,sandInterface } from "@/api/api.js";
 import { dataBaseInterface ,sandInterface } from "@/api/api.js";
 import futuresInterface from '@/api/modules/futuresBaseApi';
 import futuresInterface from '@/api/modules/futuresBaseApi';
 import chartRelevanceApi from '@/api/modules/chartRelevanceApi';
 import chartRelevanceApi from '@/api/modules/chartRelevanceApi';
@@ -999,7 +1003,7 @@ export default {
         this.$refs[`pptPage_${this.currentIndex}`][0].initPositionInfo()
         this.$refs[`pptPage_${this.currentIndex}`][0].initPositionInfo()
     },
     },
     //手动保存PPT
     //手动保存PPT
-    handleSave(type){
+    async handleSave(type){
       //保存走save_checkPPT,发布走checkPPT
       //保存走save_checkPPT,发布走checkPPT
       let checkResult = null
       let checkResult = null
       if(type==='save'){
       if(type==='save'){
@@ -1018,19 +1022,21 @@ export default {
         ImgUrl:BackgroundImg,
         ImgUrl:BackgroundImg,
         TemplateType:BackIndex+1
         TemplateType:BackIndex+1
       }
       }
+      this.isSaved = true
       if(this.$route.query.id||this.pptId){
       if(this.$route.query.id||this.pptId){
-        this.editPPT(FirstPage,Content,type)
+        await this.editPPT(FirstPage,Content,type)
       }else{
       }else{
-        this.addPPT(FirstPage,Content)
+        await this.addPPT(FirstPage,Content)
       }
       }
     },
     },
-    addPPT(FirstPage,Content){
-      pptEnInterface.addppt({
+    async addPPT(FirstPage,Content){
+      await pptEnInterface.addppt({
         FirstPage:FirstPage,
         FirstPage:FirstPage,
         Content:Content,
         Content:Content,
         GroupId:this.catalogId,
         GroupId:this.catalogId,
         CoverContent:this.CoverContent
         CoverContent:this.CoverContent
       }).then(res=>{
       }).then(res=>{
+        this.isSaved = false
         if(res.Ret===200){
         if(res.Ret===200){
           this.$message.success(this.$t('MsgPrompt.add_msg'))
           this.$message.success(this.$t('MsgPrompt.add_msg'))
           this.isSave = true
           this.isSave = true
@@ -1041,14 +1047,15 @@ export default {
         }
         }
       })
       })
     },
     },
-    editPPT(FirstPage,Content,type){
+    async editPPT(FirstPage,Content,type){
       const ppt_id = this.$route.query.id||this.pptId
       const ppt_id = this.$route.query.id||this.pptId
-      pptEnInterface.editppt({
+      await pptEnInterface.editppt({
         PptId:parseInt(ppt_id),
         PptId:parseInt(ppt_id),
         FirstPage:FirstPage,
         FirstPage:FirstPage,
         Content:Content,
         Content:Content,
         CoverContent:this.CoverContent
         CoverContent:this.CoverContent
       }).then(res=>{
       }).then(res=>{
+        this.isSaved = false
         if(res.Ret===200){
         if(res.Ret===200){
           if(type==='save'){
           if(type==='save'){
             this.$message.success(this.$t('MsgPrompt.edit_msg'))
             this.$message.success(this.$t('MsgPrompt.edit_msg'))
@@ -1080,7 +1087,11 @@ export default {
           FirstPage:FirstPage,
           FirstPage:FirstPage,
           Content:Content,
           Content:Content,
           CoverContent:this.CoverContent
           CoverContent:this.CoverContent
-        }).then((res)=>{})
+        }).then((res)=>{
+            if(res.Ret!==200) return 
+            this.showLastSaveTime = true
+            this.lastSaveTime = http.dateFormatter(new Date(), true);
+        })
       },10000)
       },10000)
     },
     },
     //保存时的校验规则:封面信息,至少一页
     //保存时的校验规则:封面信息,至少一页
@@ -1129,6 +1140,7 @@ export default {
           return
           return
         }
         }
       }
       }
+      //ETA1.7.5更改发布逻辑,点击发布时,自动执行保存操作,若可保存,则跳转发布页
       await this.handleSave('pub')
       await this.handleSave('pub')
       //ppt4.0后,合并后的PPT可能会超出页数or图表限制,在这里做个校验
       //ppt4.0后,合并后的PPT可能会超出页数or图表限制,在这里做个校验
       if(this.pageList.length>this.maxPageNum){
       if(this.pageList.length>this.maxPageNum){