Bläddra i källkod

Merge branch 'gn2.6' into debug

ldong 3 månader sedan
förälder
incheckning
ae6ff67a28

+ 21 - 0
src/api/modules/smartReport.js

@@ -82,12 +82,33 @@ const apiSmartReport={
     imgReourceList:params=>{
         return http.get('/smart_report/resource/list',params)
     },
+    
 
     //新增资源库图片
     imgReourceAdd:params=>{
         return http.post('/smart_report/resource/add',params)
     },
 
+    //根据条件查询ppt图片素材
+    pptMaterialList:params=>{
+        return http.get('/image_conf/get/image/material',params)
+    },
+
+    //新增图片素材
+    pptAddMaterial:params=>{
+        return http.post('/image_conf/add/image/material',params)
+    },
+
+    //删除图片素材
+    pptDeleteMaterial:params=>{
+        return http.post('/image_conf/delete/image/material',params)
+    },
+
+    //修改图片素材
+    pptEditMaterial:params=>{
+        return http.post('/image_conf/edit/image/material',params)
+    },
+
     // //资源库图片重命名
     // imgReourceRename:params=>{
     //     return http.post('/smart_report/resource/rename',params)

+ 1 - 1
src/lang/modules/EtaBase/En.js

@@ -221,7 +221,7 @@ export default {
     <div>4. Here is a runnable code example (the code to fetch index data needs to be replaced according to the system query):</div>
     <br />
     <div># Fetching Index Data Code:</div>
-    <div>sql1 = f'""'SELECT data_time,\`value\` FROM edb_data_ths WHERE edb_code = 'S004414853' ;'""'</div>
+    <div>sql1 = f'""'SELECT data_time,\"value\" FROM edb_data_ths WHERE edb_code = 'S004414853' ;'""'</div>
     <div>raw = pandas_fetch_all(sql1, db)</div>
     <div># Index Calculation Method Code:</div>
     <div>raw['value'] = raw['value'] + 1</div>

+ 1 - 1
src/lang/modules/EtaBase/Zh.js

@@ -222,7 +222,7 @@ export default {
     <div>4、以下是可运行的代码示例(其中调取指标数据代码需根据系统查询替换):</div>
     <br />
     <div>#调取指标数据代码:</div>
-    <div>sql1 = f'""'SELECT data_time,\`value\` FROM edb_data_ths WHERE edb_code = 'S004414853' ;'""'</div>
+    <div>sql1 = f'""'SELECT data_time,\"value\" FROM edb_data_ths WHERE edb_code = 'S004414853' ;'""'</div>
     <div>raw = pandas_fetch_all(sql1, db)</div>
     <div>#指标计算方式代码:</div>
     <div>raw['value'] = raw['value'] + 1</div>

+ 8 - 0
src/lang/modules/Slides/pptPresent.js

@@ -11,6 +11,10 @@ export const presentEn = {
   return_to_list: "Return to list",
   default_publish: " Publish",
   select_cover_page: "Select cover page",
+  select_ground_page: "Replace background image",
+  select_back_page: "Replace the back cover image",
+  more_cover_page: "More templates for cover images",
+  more_templates:'More templates',
   operating_instructions: "Operating instructions",
   click_to_input_title: "Click to input title",
   update_chart_btn: "Update chart",
@@ -116,6 +120,10 @@ export const presentZh = {
   return_to_list: "返回列表",
   default_publish: "(默认)发布",
   select_cover_page: "选择封面页",
+  select_ground_page: "更换背景图",
+  select_back_page: "更换封底图",
+  more_cover_page: "封面图更多模板",
+  more_templates: "更多模板",
   operating_instructions: "操作说明",
   click_to_input_title: "单击输入标题",
   update_chart_btn: "更新图表",

+ 14 - 2
src/lang/modules/systemManage/BaseConfig.js

@@ -57,6 +57,10 @@ export const BaseConfigEn = {
     resource_placeholder03:'Please upload Image',
     resource_type01:'Header',
     resource_type02:'Footer',
+    ppt_type01:'Cover Image',
+    ppt_type02:'Background Image',
+    ppt_type03:'Back Cover Image',
+    ppt_btn02:'Edit Image',
     resource_btn01:'Upload Image',
     resource_btn02:'Rename',
     resource_btn03:'Deselect/Deselect All',
@@ -73,13 +77,15 @@ export const BaseConfigEn = {
     edit_layout:"Edit Layout",
     completed_step:"Completed Step",
     text_style:"Text Style",
-    smart_layout_resource_library:"Intelligent Research Report Template Library",
+    smart_layout_resource_library:"Intelligent Research Report Layout",
+    ppt_resource_library:"PPT Material Library",
     style_font_w_normal:'normal',
     style_font_w_bold:'body',
     style_text_align_left:'left',
     style_text_align_center:'center',
     style_text_align_right:'right',
     upload_suggest:'Supports formats like jpg, jpeg, png, etc. It is recommended to upload headers of 800*200 and footers of 800*80',
+    upload_ppt_suggest:'Supports formats like jpg, jpeg, png, etc.',
     resource_del_msg:'Are you sure to delete the selected image?',
 
     tip_msg01:'Save successful, please check the corresponding page/project later',
@@ -162,6 +168,10 @@ export const BaseConfigZh = {
     resource_placeholder03:'请上传图片',
     resource_type01:'版头',
     resource_type02:'版尾',
+    ppt_type01:'封面图',
+    ppt_type02:'背景图',
+    ppt_type03:'封底图',
+    ppt_btn02:'编辑图片',
     resource_btn01:'上传图片',
     resource_btn02:'重命名',
     resource_btn03:'取消选择',
@@ -178,7 +188,8 @@ export const BaseConfigZh = {
     edit_layout:"编辑版图",
     completed_step:"已完成步骤",
     text_style:"文字样式",
-    smart_layout_resource_library:"智能研报版图资源库",
+    smart_layout_resource_library:"智能研报版图",
+    ppt_resource_library:"PPT素材库",
     // 样式
     style_font_w_normal:'常规体',
     style_font_w_bold:'加粗体',
@@ -186,6 +197,7 @@ export const BaseConfigZh = {
     style_text_align_center:'居中',
     style_text_align_right:'居右',
     upload_suggest:'支持jpg、jpeg、png等格式,建议上传版头800*200,版尾800*80',
+    upload_ppt_suggest:'支持jpg、jpeg、png等格式',
     resource_del_msg:'是否确认删除选中图片?',
 
     tip_msg01:'保存成功,请稍后到对应页面/项目查看',

+ 13 - 4
src/views/chartRelevance_manage/components/saveChartSetting.vue

@@ -15,7 +15,7 @@
                 label-width="100px"
                 ref="settingForm">
                 <el-form-item label="图表名称">
-                    <el-input v-model="settingData.chartName"></el-input>
+                    <el-input style="width: 250px;" v-model="settingData.chartName"></el-input>
                 </el-form-item>
                 <el-form-item label="图例名称" style="margin-bottom: 0;">
                 </el-form-item>
@@ -27,13 +27,15 @@
                                 size="mini"
                                 show-alpha
                                 :predefine="predefineColors"/>
-                            <el-input v-model="data.Name"></el-input>
+                            <el-input style="width: 250px;" v-model="data.Name"></el-input>
                         </div>
                     </div>
                 </el-form-item>
                 <el-form-item label="数据来源">
-                    <el-input v-model="settingData.SourcesFrom.text"></el-input>
-                    <el-switch v-model="settingData.SourcesFrom.isShow"></el-switch>
+                    <div class="flex-align">
+                        <el-input :autosize="{ minRows: 2, maxRows: 4}" style="width: 250px;margin-right: 5px;" type="textarea" maxlength="50" show-word-limit v-model="settingData.SourcesFrom.text"></el-input>
+                        <el-switch v-model="settingData.SourcesFrom.isShow"></el-switch>
+                    </div>
                 </el-form-item>
             </el-form>
         </div>
@@ -107,5 +109,12 @@ export default {
         text-align:center;
         margin:30px 0 20px 0;
     }
+    .flex-align{
+        display: flex;
+        align-items: center;
+        .el-textarea .el-input__count{
+            background: transparent;
+        }
+    }
 }
 </style>

+ 18 - 12
src/views/dataEntry_manage/addChart.vue

@@ -549,7 +549,17 @@
 						</div>
 
 						<div class="chart-bottom-insruction-info">
-
+							
+							<!-- 图表说明 -->
+							<div 
+								class="chart-instruction" 
+								v-if="chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow"
+								v-text="JSON.parse(chartInfo.Instructions).text"
+								:style="`
+									color: ${JSON.parse(chartInfo.Instructions).color};
+									fontSize: ${ JSON.parse(chartInfo.Instructions).fontSize }px
+								`"
+							></div>
 							<div class="chart-source">
 								<span
 									v-if="chartInfo.SourcesFrom"
@@ -599,17 +609,6 @@
 								<el-radio-button label="公历">{{$t('Chart.calendar_gre')}}</el-radio-button>
 								<el-radio-button label="农历">{{$t('Chart.calendar_lunar_text')}}</el-radio-button>
 							</el-radio-group>
-
-							<!-- 图表说明 -->
-							<div 
-								class="chart-instruction" 
-								v-if="chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow"
-								v-text="JSON.parse(chartInfo.Instructions).text"
-								:style="`
-									color: ${JSON.parse(chartInfo.Instructions).color};
-									fontSize: ${ JSON.parse(chartInfo.Instructions).fontSize }px
-								`"
-							></div>
 						</div>
 
 
@@ -1342,6 +1341,13 @@ export default {
 			}
 		}
 	}
+	.chart-bottom-insruction-info{
+		display:block;
+		.chart-instruction{
+			margin-bottom:16px;
+			width:auto;
+		}
+	}
 }
 </style>
 <style lang="scss">

+ 18 - 10
src/views/dataEntry_manage/chartSetting.vue

@@ -510,6 +510,17 @@
                       ><!-- 作者 -->{{$t('Chart.Detail.author')}}:{{ chartInfo.SysUserRealName || '' }}</span
                     >
 
+                    <!-- 图表说明 -->
+                    <div 
+                        class="chart-instruction" 
+                        v-if="chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow"
+                        v-text="JSON.parse(chartInfo.Instructions).text"
+                        :style="`
+                          color: ${JSON.parse(chartInfo.Instructions).color};
+                          fontSize: ${ JSON.parse(chartInfo.Instructions).fontSize }px
+                        `"
+                      ></div>
+
                     <div class="chart-bottom-insruction-info">
 
                       <div class="chart-source" >
@@ -533,16 +544,6 @@
                         <el-radio-button label="农历">{{$t('Chart.calendar_lunar_text')}}</el-radio-button>
                       </el-radio-group>
 
-                      <!-- 图表说明 -->
-                      <div 
-                        class="chart-instruction" 
-                        v-if="chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow"
-                        v-text="JSON.parse(chartInfo.Instructions).text"
-                        :style="`
-                          color: ${JSON.parse(chartInfo.Instructions).color};
-                          fontSize: ${ JSON.parse(chartInfo.Instructions).fontSize }px
-                        `"
-                      ></div>
                     </div>
                     
                   </div>
@@ -3128,6 +3129,13 @@ export default {
       z-index: -100;
     }
   }
+  .chart-bottom-insruction-info{
+		display:block;
+		.chart-instruction{
+			margin-bottom:16px;
+			width:auto;
+		}
+	}
 
 }
 </style>

+ 10 - 2
src/views/dataEntry_manage/components/chartSourceEditDialog.vue

@@ -19,6 +19,10 @@
       >
         <el-form-item :label="$t('Edb.Detail.source')">
           <el-input
+            :autosize="{ minRows: 2, maxRows: 4}"
+            type="textarea"
+            maxlength="50"
+            show-word-limit
             v-model="chartSourceForm.text"
             :placeholder="$t('Chart.InputHolderAll.input_content')"
           />
@@ -100,6 +104,10 @@ export default {
   },
 }
 </script>
-<style scoped lang='scss'>
-
+<style lang='scss'>
+.marker-edit-dialog{
+  .el-textarea .el-input__count{
+    background: transparent;
+  }
+}
 </style>

+ 7 - 0
src/views/dataEntry_manage/components/markersSection.vue

@@ -202,6 +202,10 @@
         >
           <el-form-item :label="$t('Chart.Detail.chart_intru')">
             <el-input
+              :autosize="{ minRows: 2, maxRows: 5}"
+              type="textarea"
+              maxlength="100"
+              show-word-limit
               v-model="chartInductionDiaForm.text"
               :placeholder="$t('Chart.InputHolderAll.input_content')"
             />
@@ -541,5 +545,8 @@ export default {
       align-items: center;
     }
   }
+  .marker-edit-dialog .el-textarea .el-input__count{
+    background: transparent;
+  }
 }
 </style>

+ 18 - 10
src/views/dataEntry_manage/editChart.vue

@@ -556,6 +556,17 @@
 
 						<div class="chart-bottom-insruction-info">
 
+							<!-- 图表说明 -->
+							<div 
+								class="chart-instruction" 
+								v-if="chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow"
+								v-text="JSON.parse(chartInfo.Instructions).text"
+								:style="`
+									color: ${JSON.parse(chartInfo.Instructions).color};
+									fontSize: ${ JSON.parse(chartInfo.Instructions).fontSize }px
+								`"
+							></div>
+
 							<div class="chart-source">
 									<span
 										v-if="chartInfo.SourcesFrom"
@@ -603,16 +614,6 @@
 								<el-radio-button label="农历">{{$t('Chart.calendar_lunar_text')}}</el-radio-button>
 							</el-radio-group>
 
-							<!-- 图表说明 -->
-							<div 
-								class="chart-instruction" 
-								v-if="chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow"
-								v-text="JSON.parse(chartInfo.Instructions).text"
-								:style="`
-									color: ${JSON.parse(chartInfo.Instructions).color};
-									fontSize: ${ JSON.parse(chartInfo.Instructions).fontSize }px
-								`"
-							></div>
 						</div>
 
 						<span class="chart-author"><!-- 作者 -->{{$t('Chart.Detail.author')}}:{{ chartInfo.SysUserRealName }}</span>
@@ -1471,6 +1472,13 @@ export default {
 			}
 		}
 	}
+	.chart-bottom-insruction-info{
+		display:block;
+		.chart-instruction{
+			margin-bottom:16px;
+			width:auto;
+		}
+	}
 }
 </style>
 <style lang="scss">

+ 12 - 2
src/views/ppt_manage/mixins/pptMixins.js

@@ -182,7 +182,7 @@ export default {
                EnPptCoverImgs,EnPptBackgroundImg,EnPptBottomImg,PptCompanyNameEn,PptTeamNameEn,PptFontColorEn,EnPptSheetSize
               } = res.Data
         if(this.currentLang==='en'){
-            this.pptCoverList = EnPptCoverImgs.split(',')
+            // this.pptCoverList = EnPptCoverImgs.split(',')
             this.pptBgImage = EnPptBackgroundImg
             this.pptBackImage = EnPptBottomImg
             this.pptCoverCompenyName = PptCompanyNameEn
@@ -190,7 +190,7 @@ export default {
             this.pptCoverTextColor = PptFontColorEn
             this.pptSheetSize = EnPptSheetSize
         }else{
-            this.pptCoverList = CnPptCoverImgs.split(',')
+            // this.pptCoverList = CnPptCoverImgs.split(',')
             this.pptBgImage = CnPptBackgroundImg
             this.pptBackImage = CnPptBottomImg
             this.pptCoverCompenyName = PptCompanyName
@@ -210,6 +210,11 @@ export default {
             Title,
             ReportType,
             BackgroundImg,
+            CurrentBackgroundImg,
+            BackCoverImg,
+            BackCoverImgId,
+            BackgroundImgId,
+            CurrentBackgroundImgId,
             PptDate,
             TemplateType,
             ReportId,
@@ -244,7 +249,12 @@ export default {
                 ReportType,
                 BackgroundImg,
                 PptDate: pptDate,
+                CurrentBackgroundImg,
+                BackCoverImg,
                 TemplateType,
+                BackCoverImgId,
+                BackgroundImgId,
+                CurrentBackgroundImgId,
             },
             ReportId,
             ModifyTime,

+ 21 - 2
src/views/ppt_manage/newVersion/components/catalog/mergePPTDialog.vue

@@ -209,7 +209,7 @@ export default {
         this.init()
         this.getCatalogsList('init')
         this.getPPtList()
-        this.getBaseConfig()
+        // this.getBaseConfig()
       }
       if(!newValue){
         if(this.saveLoading){
@@ -301,6 +301,15 @@ export default {
 
       if(res_font.Ret===200){
         content_font = JSON.parse(res_font.Data.Content)
+        this.pptInfo={
+          ...this.pptInfo,
+          ImgUrl:res_font.Data.BackgroundImg,
+          BackgroundImgId:res_font.Data.BackgroundImgId,
+          BackCoverImg:res_font.Data.BackCoverImg,
+          BackCoverImgId:res_font.Data.BackCoverImgId,
+          CurrentBackgroundImg:res_font.Data.CurrentBackgroundImg,
+          CurrentBackgroundImgId:res_font.Data.CurrentBackgroundImgId
+        }
       } 
       const res_back = await pptInterface.getpptDetail({
         PptId:this.choosedIdArr[1]
@@ -324,12 +333,22 @@ export default {
         ImgUrl,
         BackIndex,
         TemplateType, 
+        CurrentBackgroundImgId,
+        CurrentBackgroundImg,
+        BackCoverImg,
+        BackCoverImgId,
+        BackgroundImgId
       } = this.pptInfo
-
+      console.log(this.pptInfo)
       const res = await pptInterface.addpptV2({
           FirstPage:{
             Title,
             ImgUrl,
+            CurrentBackgroundImgId,
+            CurrentBackgroundImg,
+            BackCoverImg,
+            BackCoverImgId,
+            BackgroundImgId,
             BackIndex,
             TemplateType 
           },

+ 21 - 6
src/views/ppt_manage/newVersion/components/editor/ChooseCoverNew.vue

@@ -13,7 +13,7 @@
             <div class="edit-cover-wrap" @mousedown.stop="clickOutside">
                 <div class="cover">
                     <!-- 封面图 -->
-                    <div class="editor-area" :style="`background-image:url(${pptCoverList[choosedIndex]});`">
+                    <div class="editor-area" :style="`background-image:url(${pptCoverList[choosedIndex].Url});`">
                         <!-- 封面内文本元素 -->
                         <TextEl v-for="el in coverElList" :key="el.id"
                             :element-info="el"
@@ -39,6 +39,7 @@
                         <div class="cover-text-toolbar" @mousedown.stop></div>
                     </div>
                     <div class="dialog-btn">
+                        <el-button @click="chooseCoverImg">{{$t('Slides.more_templates')}}</el-button>
                         <el-button @click="changeBg">{{$t('Slides.change_the_template_cover')}}</el-button>
                         <el-button @click="saveCover">{{$t('Dialog.confirm_save_btn')}}</el-button>
                     </div>
@@ -97,15 +98,24 @@ export default {
             if(newVal){
                 this.setCoverInfo()
             }
-        }
+        },
     },
     methods: {
+        showDialog(){
+            this.changeActEl({})
+            this.setCoverInfo()
+        },
         setCoverInfo() {
             this.pageData.Title = this.firstPage.Title||''
-            this.searchIndex = this.pptCoverList.findIndex(i=>i===this.firstPage.BackgroundImg)
+            this.searchIndex = this.pptCoverList.findIndex(i=>i.Url===this.firstPage.BackgroundImg)
             //如果基本配置-封面图,没有当前ppt的封面图,则默认第一个
             if(this.searchIndex===-1){
-                this.pageData.BackgroundImg = this.pptCoverList[0]
+                this.pageData.BackgroundImg = this.pptCoverList[0].Url
+                this.pageData.BackgroundImgId = this.pptCoverList[0].ImageConfId
+            }else{
+                this.pageData.BackgroundImg = this.pptCoverList[this.searchIndex].Url
+                this.pageData.BackgroundImgId = this.pptCoverList[this.searchIndex].ImageConfId
+                this.choosedIndex=this.searchIndex
             }
             //如果封面页内容不是合法的json,置空
             try{
@@ -163,7 +173,7 @@ export default {
             const url = canvas.toDataURL("image/png")
             this.checkImg(url)
             //转换完成后,将背景图设置回来
-            cover.style.backgroundImage = `url(${this.pptCoverList[this.choosedIndex]})`
+            cover.style.backgroundImage = `url(${this.pptCoverList[this.choosedIndex].Url})`
             return url
         },
             //测试用
@@ -179,13 +189,18 @@ export default {
         clickOutside(){
             this.changeActEl({})
         },
+        //选择更多封面图
+        chooseCoverImg(){
+            this.$emit('chooseMoreCover')  
+        },
         changeBg(){
             if(this.choosedIndex<this.pptCoverList.length-1){
                 this.choosedIndex++
             }else{
                 this.choosedIndex=0
             }
-            this.pageData.BackgroundImg = this.pptCoverList[this.choosedIndex]
+            this.pageData.BackgroundImg = this.pptCoverList[this.choosedIndex].Url
+            this.pageData.BackgroundImgId = this.pptCoverList[this.choosedIndex].ImageConfId
         },
         addTextEl(options={}){
             let el = _.cloneDeep(BaseTextShape)

+ 44 - 18
src/views/ppt_manage/newVersion/components/formatEl/ChartEl.vue

@@ -41,25 +41,28 @@
   <!-- 底部来源,图表说明 -->
   <div class="chart-bottom-insruction-info"
   v-if="((chartSourcesFrom&&chartSourcesFrom.isShow) || (chartInstructions&&chartInstructions.isShow)) &&!this.$parent.isHintShow(position)">
-
-    <div class="chart-source text_oneLine" v-if="chartSourcesFrom&&chartSourcesFrom.isShow">
-        <span
-          :style="`
-          color: ${ chartSourcesFrom.color };
-          fontSize: ${ chartSourcesFrom.fontSize }px;
-        `"
-        >{{$t('Slides.source_info')}}:{{ chartSourcesFrom.text}}</span>
-    </div>
+    <el-tooltip  v-if="showSource()" popper-class="tooltip-width" :offset="50" effect="dark" :content="chartSourcesFrom.text" placement="top-start">
+      <div class="chart-source text_oneLine" :class="{'show-width':!showInstruction()}">
+          <span
+            :style="`
+            color: ${ chartSourcesFrom.color };
+            fontSize: ${ chartSourcesFrom.fontSize }px;
+          `"
+          >{{$t('Slides.source_info')}}:{{ chartSourcesFrom.text}}</span>
+      </div>
+    </el-tooltip>
     <!-- 图表说明 -->
-    <div 
-      class="chart-instruction text_oneLine"
-      v-if="chartInstructions&&chartInstructions.isShow&&chartInstructions.text.length"
-      v-text="chartInstructions.text"
-      :style="`
-        color: ${chartInstructions.color};
-        fontSize: ${ chartInstructions.fontSize }px
-      `"
-    ></div>
+    <el-tooltip  v-if="showInstruction()" popper-class="tooltip-width" :offset="-40" effect="dark" :content="chartInstructions.text" placement="top-end">
+      <div 
+        class="chart-instruction text_oneLine"
+        :class="{'show-width':!showSource()}"
+        v-text="chartInstructions.text"
+        :style="`
+          color: ${chartInstructions.color};
+          fontSize: ${ chartInstructions.fontSize }px
+        `"
+      ></div>
+    </el-tooltip>
   </div>
  
 </div>
@@ -97,6 +100,12 @@ export default {
     };
   },
   methods:{
+    showSource(){
+      return this.chartSourcesFrom&&this.chartSourcesFrom.isShow
+    },
+    showInstruction(){
+      return this.chartInstructions&&this.chartInstructions.isShow&&this.chartInstructions.text.length
+    },
     copyChartName(position){
         console.log(this.chartInfoMap[this.item.chartId])
       this.$parent.copyChartName(position)
@@ -138,4 +147,21 @@ export default {
   align-items: center;
   justify-content: space-between;
 }
+.chart-source{
+  width: 35%;
+  flex: none;
+}
+.chart-instruction{
+  width: 60%;
+  text-align: right;
+}
+.show-width{
+  width:100%;
+}
 </style>
+
+<style lang="scss">
+.tooltip-width {
+  max-width: 300px;
+}
+</style>

+ 4 - 0
src/views/ppt_manage/newVersion/components/formatPage/FormatFourteen.vue

@@ -103,6 +103,10 @@ export default {
   }
   .fourteen-right {
     width: 60%;
+    .editor-wrap {
+        width: 96%;
+        height: 90%;
+    }
   }
 }
 </style>

+ 241 - 0
src/views/ppt_manage/newVersion/components/selectImage.vue

@@ -0,0 +1,241 @@
+<template>
+    <div class="select-image">
+        <el-dialog :visible.sync="showDialog" :title="titleObj[imgType]" :close-on-click-modal="false"
+            :modal-append-to-body="false" @close="cancelHandle" custom-class="select-image-dialog" center width="820px"
+            v-dialogDrag>
+            <el-input v-model="keyword"
+                :placeholder="$t('OnlineExcelPage.please_input') + inputName[imgType] + $t('ETable.BalanceSheetTable.name')"
+                clearable style="width:200px;" @input="handleSearch"></el-input>
+            <div class="image-list">
+                <div class="image-item" v-for="item in list" :key="item.ImageConfId">
+                    <div class="img-box">
+                        <div class="opt-box">
+                            <div class="item full-fix" @click="handleShowImgFull(item)">
+                                <img src="~@/assets/img/icons/fullsreen.png" alt="">
+                            </div>
+                            <div class="radio-fix">
+                                <el-radio size="medium" v-model="momentChooseId" @change="changeRadio"
+                                    :label="item.ImageConfId"></el-radio>
+                            </div>
+                        </div>
+                        <img class="img" :src="item.Url" alt="">
+                    </div>
+                    <p class="name">{{ item.ImgName || item.ImageName }}</p>
+                </div>
+            </div>
+            <el-pagination style="margin-top: 20px;text-align:center" @current-change="handleCurrentChange"
+                :current-page="page" :page-size="pageSize" layout="total, prev, pager, next, jumper" :total="total">
+            </el-pagination>
+            <div style="text-align: center;padding: 30px 0;margin-top: 60px;">
+                <el-button style="width:120px;" @click="cancelHandle()">{{ $t('Dialog.cancel_btn') }}</el-button>
+                <el-button type="primary" style="margin-left:20px;width:120px;" @click="handleSave">{{
+                    $t('Dialog.confirm_save_btn') }}</el-button>
+            </div>
+            <el-image-viewer :zIndex="9999" v-if="showPptViewer"
+                :on-close="() => { this.picShowList = []; this.showPptViewer = false }" :url-list="picShowList" />
+        </el-dialog>
+    </div>
+</template>
+<script>
+import ElImageViewer from 'element-ui/packages/image/src/image-viewer';
+import { apiSmartReport } from '@/api/modules/smartReport'
+export default {
+    components: { ElImageViewer },
+    props: {
+    },
+    data() {
+        return {
+            momentChooseId: '',
+            momentChooseUrl: '',
+            total: 0,
+            list: [],
+            pageSize: 8,
+            page: 1,
+            keyword: '',
+            showPptViewer: false,
+            picShowList: [],
+            imgType: 1,
+            showDialog: false,
+            inputName: {
+                1: this.$t('SystemManage.BaseConfig.ppt_type01'),
+                2: this.$t('SystemManage.BaseConfig.ppt_type02'),
+                3: this.$t('SystemManage.BaseConfig.ppt_type03')
+            },
+            titleObj: {
+                1: this.$t('Slides.more_cover_page'),
+                2: this.$t('Slides.select_ground_page'),
+                3: this.$t('Slides.select_back_page')
+            }
+        }
+    },
+    mounted() {
+    },
+    methods: {
+        handleShowImgFull(e){
+            console.log(e);
+            this.picShowList=[e.Url]
+            this.showPptViewer=true
+        },
+        handleCurrentChange(val) {
+            this.page = val
+            this.getImgList()
+        },
+        // 保存
+        handleSave() {
+            const obj = {
+                url: this.momentChooseUrl,
+                type: this.imgType,
+                id: this.momentChooseId
+            }
+            this.cancelHandle()
+            this.$emit('saveChoose', obj)
+        },
+        // 选择图片
+        changeRadio(val) {
+            const index = this.list.findIndex(el => el.ImageConfId == val)
+            if (index > -1) {
+                this.momentChooseUrl = this.list[index].Url
+            }
+        },
+        //资源库列表
+        getImgList() {
+            apiSmartReport.pptMaterialList({
+                CurrentIndex: this.page,
+                PageSize: this.pageSize,
+                ImageType: this.imgType,
+                ImageName: this.keyword,
+                ConfType: 1
+            }).then(res => {
+                this.list = res.Data ? res.Data.List : []
+                this.total = res.Data ? res.Data.Paging.Totals : 0
+                if (!this.momentChooseId) {
+                    if (this.list.length) {
+                        this.momentChooseId = this.list[0].ImageConfId
+                        this.momentChooseUrl = this.list[0].Url
+                    }
+                }
+            })
+        },
+        // 搜索图片
+        handleSearch() {
+            this.page = 1
+            this.getImgList()
+        },
+        // 打开弹框
+        showHandle(type, id, url) {
+            this.showDialog = true
+            this.momentChoose = ''
+            this.momentChooseUrl = ''
+            this.imgType = type
+            this.keyword = ''
+            this.momentChooseId = id
+            this.momentChooseUrl = url
+            this.handleSearch()
+        },
+        // 关闭弹窗
+        cancelHandle() {
+            this.showDialog = false
+        }
+    }
+}
+</script>
+
+<style lang="scss">
+.select-image-dialog {
+    .el-dialog__body {
+        padding: 40px 60px !important;
+    }
+
+    .image-list {
+        margin-top: 20px;
+        display: flex;
+        flex-wrap: wrap;
+        gap: 20px;
+
+        .image-item {
+            width: 160px;
+
+            .img-box {
+                position: relative;
+                cursor: pointer;
+                width: 160px;
+
+                .img {
+                    display: block;
+                    width: 100%;
+                    height: 160px;
+                    background-color: var(--gary-gy-3-disabled, #EBEFF6);
+                    object-fit: contain !important;
+                    box-sizing: border-box;
+
+                    &:hover {
+                        border: 1px solid #3375e1;
+                    }
+                }
+
+                .opt-box {
+                    display: none;
+                    position: absolute;
+                    z-index: 5;
+                    width: 100%;
+                    height: 100%;
+
+                    .item {
+                        width: 24px;
+                        height: 24px;
+                        display: flex;
+                        align-items: center;
+                        justify-content: center;
+                        background-color: #fff;
+                        border-radius: 50%;
+                        margin-left: 10px;
+
+                        img {
+                            width: 16px;
+                            height: 16px;
+                        }
+                    }
+
+                    .full-fix {
+                        position: absolute;
+                        top: 12px;
+                        right: 12px;
+                    }
+
+                    .radio-fix {
+                        position: absolute;
+                        top: 12px;
+                        left: 12px;
+                    }
+                }
+
+                &:hover {
+                    .opt-box {
+                        display: flex;
+                    }
+
+                    .select-box {
+                        display: block;
+                    }
+                }
+            }
+
+            .name {
+                padding-top: 5px;
+                display: -webkit-box;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                -webkit-line-clamp: 2;
+                line-break: anywhere;
+                -webkit-box-orient: vertical;
+            }
+        }
+    }
+
+    .el-radio {
+        .el-radio__label {
+            display: none;
+        }
+    }
+}
+</style>

+ 0 - 8
src/views/ppt_manage/newVersion/css/format.scss

@@ -358,14 +358,6 @@ $marginTop:14%;
         .chart-bottom-insruction-info,.chart-source{
             top:90%;
         }
-
-        // 板式14文本框加高
-        &.fourteen-right {
-          .editor-wrap {
-              width: 90%;
-              height: 90%;
-          }
-        }
     }
 
     //版式8 9 13

+ 86 - 27
src/views/ppt_manage/newVersion/pptEditor.vue

@@ -1,11 +1,15 @@
 <template>
   <div class="page-wrap">
     <div class="index-wrap ppt-page-wrap flex-column">
-        <div class="cover-wrap" @click="openChooseCover">
-            <div class="cover" :style="`background: no-repeat center/cover url(${firstPage.BackgroundImg||''});background-color:#F2F6FA;background-size:100% 100%;`">
+        <div class="cover-wrap">
+            <div class="flex-align">
+              <p class="hint-text" @click="openSelectImage(2,firstPage.CurrentBackgroundImgId,firstPage.CurrentBackgroundImg)">{{$t('Slides.select_ground_page')}}</p>
+              <p class="hint-text" style="margin-left:37px" @click="openSelectImage(3,firstPage.BackCoverImgId,firstPage.BackCoverImg)">{{$t('Slides.select_back_page')}}</p>
+            </div>
+            <div class="flex-align" style="margin:8px 0"><p class="hint-text"  @click="openChooseCover">{{$t('Slides.select_cover_page')}}</p></div>
+            <div class="cover" @click="openChooseCover" :style="`background: no-repeat center/cover url(${firstPage.BackgroundImg||''});background-color:#F2F6FA;background-size:100% 100%;`">
                 <img src="~@/assets/img/ppt_m/add_first.png" />
             </div>
-            <p class="hint-text">{{$t('Slides.select_cover_page')}}</p>
         </div>
         <div class="hint-box"><div class="hint"  @click="showHint"><span class="el-icon-info" style="margin-right:5px;"></span>{{$t('Slides.operating_instructions')}}</div></div>
         <div style="display:flex;justify-content: space-between;">
@@ -282,7 +286,9 @@
     </div>
 
     <!-- 选择封面弹窗 -->
-    <ChooseCoverNew 
+    <ChooseCoverNew
+        ref="ChooseCoverNewRef"
+        v-if="isShowChooseCover" 
         :isShowChooseCover="isShowChooseCover"
         :firstPage="firstPage"
         :pptCoverList="pptCoverList"
@@ -290,6 +296,7 @@
         :CoverContent="CoverContent"
         @saveCover="saveCover2"
         @close="isShowChooseCover=false"
+        @chooseMoreCover="openSelectImage(1,firstPage.BackgroundImgId,firstPage.BackgroundImg)"
     />
     <!-- 批量删除弹窗 -->
     <delete-page-dialog 
@@ -321,6 +328,7 @@
       @cancel="addMyChartShow = false"
       @addSuccess="addChartToGallery"
     />
+    <selectImage @saveChoose='saveChooseImage' ref="selectImageRef"/>
   </div>
 </template>
 
@@ -356,6 +364,8 @@ import ContextMenu from './components/ContextMenu.vue';
 import InsertSemantics from './components/editor/InsertSemantics.vue';
 import ChooseCoverNew from './components/editor/ChooseCoverNew.vue';
 import TitleEditorTool from './components/editor/TitleEditorTool';
+import selectImage from './components/selectImage.vue';
+import { apiSmartReport } from '@/api/modules/smartReport'
 export default {
   mixins:[pptmixin,//ppt页面共同逻辑
           mixins,//图表加载逻辑
@@ -365,7 +375,7 @@ export default {
   components: {
     IndexItem, ChooseCover, AddFormat, ShapePreview,
     LayerEditTool, DeletePageDialog, ChangeFormatDialog, InsertPageDialog, addMyClassifyDia, InsertCharts, ContextMenu, InsertSemantics,
-    ChooseCoverNew,TitleEditorTool
+    ChooseCoverNew,TitleEditorTool,selectImage
 },
   data() {
     return {
@@ -508,7 +518,7 @@ export default {
         i.isUpdating = false
       })
       this.dataLoading.close();
-      $('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
+      // $('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
       //开启自动保存
       this.autoSave()
     },
@@ -526,6 +536,9 @@ export default {
           this.ReportId=ReportId
           this.CoverContent = this.result.CoverContent
           this.titleSetting = TitleSetting||null
+          if(this.firstPage.CurrentBackgroundImg){
+            $('.ppt-item').css('background-image',`url(${this.firstPage.CurrentBackgroundImg})`);
+          }
           /* //开启自动保存
           this.autoSave() */
         }else{
@@ -539,9 +552,54 @@ export default {
       }
       this.currentIndex = 0
     },
+    // 选择图片保存
+    saveChooseImage(item){
+        console.log(item)
+        const key={
+            1:'BackgroundImg',
+            2:'CurrentBackgroundImg',
+            3:'BackCoverImg'
+        }
+        const idKey={
+            1:'BackgroundImgId',
+            2:'CurrentBackgroundImgId',
+            3:'BackCoverImgId'
+        }
+        if(item.type==1){
+            const searchIndex = this.pptCoverList.findIndex(i=>i.Url===item.url)
+            //如果基本配置-封面图,没有当前ppt的封面图,则默认第一个
+            if(searchIndex>-1){
+                this.$refs.ChooseCoverNewRef.pageData.BackgroundImg = item.url
+                this.$refs.ChooseCoverNewRef.pageData.BackgroundImgId = item.id
+                this.$refs.ChooseCoverNewRef.choosedIndex=searchIndex
+            }
+        }else{
+          this.$set(this.firstPage,key[item.type],item.url)
+          this.$set(this.firstPage,idKey[item.type],item.id)
+          if(item.type==2){
+              $('.ppt-item').css('background-image',`url(${item.url})`);
+          }
+        }
+    },
+    // 打开选择背景图、封底图、封面图
+    openSelectImage(type,id,url){
+        this.$refs.selectImageRef.showHandle(type,id,url)
+    },
     //打开选择封面页弹窗
     openChooseCover(){
-        this.isShowChooseCover = true
+        apiSmartReport.pptMaterialList({
+            CurrentIndex: 1,
+            PageSize: 1000,
+            ImageType: 1,
+            ImageName: '',
+            ConfType: 1
+        }).then(res => {
+            this.pptCoverList=res.Data ? res.Data.List : []
+            this.isShowChooseCover = true
+            this.$nextTick(()=>{
+              this.$refs.ChooseCoverNewRef.showDialog()
+            })
+        })
     },
     //关闭选择封面页弹窗
     closeChooseCover(){
@@ -1052,9 +1110,9 @@ export default {
         return checkResult
       }
       let Content = JSON.stringify(this.pageList)
-      const {Title,ReportType,PptDate,BackgroundImg,BackIndex} = this.firstPage
+      const {Title,ReportType,PptDate,BackgroundImg,BackIndex,CurrentBackgroundImg,BackCoverImg, BackCoverImgId,BackgroundImgId,CurrentBackgroundImgId} = this.firstPage
       const FirstPage = {
-        Title,ReportType,PptDate,BackIndex,
+        Title,ReportType,PptDate,BackIndex,BackCoverImg,CurrentBackgroundImg,BackCoverImgId,BackgroundImgId,CurrentBackgroundImgId,
         ImgUrl:BackgroundImg,
         TemplateType:BackIndex+1
       }
@@ -1113,9 +1171,9 @@ export default {
         //如果当前在刷新图表,则不进行自动保存
         if(this.refreshBtnLoading) return
         const ppt_id = this.$route.query.id||this.pptId
-        const {Title,ReportType,PptDate,BackgroundImg,BackIndex} = this.firstPage
+        const {Title,ReportType,PptDate,BackgroundImg,BackIndex,CurrentBackgroundImg,BackCoverImg,BackCoverImgId,BackgroundImgId,CurrentBackgroundImgId} = this.firstPage
         const FirstPage = {
-          Title,ReportType,PptDate,BackIndex,
+          Title,ReportType,PptDate,BackIndex,CurrentBackgroundImg,BackCoverImg,CurrentBackgroundImg,BackCoverImgId,BackgroundImgId,CurrentBackgroundImgId,
           ImgUrl:BackgroundImg,
           TemplateType:BackIndex+1
         }
@@ -1198,21 +1256,18 @@ export default {
       this.oldNum = value;
     },
     dragend() {
-        if (this.oldNum != this.newNum) {
-            let oldIndex = this.pageList.indexOf(this.oldNum);
-            let newIndex = this.pageList.indexOf(this.newNum);
-            let newItems = [...this.pageList];
-            // 删除老的节点
-            newItems.splice(oldIndex, 1); 
-            // 在列表中目标位置增加新的节点
-            newItems.splice(newIndex, 0, this.oldNum);
-            this.pageList = [...newItems];
-            this.$message.success(this.$t('Slides.move_success_msg') )
-            //如果拖动的是当前选中的item,就定位到该item
-            if(this.oldNum.id===this.currentItem.id){
-              this.changeCurrentItem(this.currentItem)
-            }
+        let oldIndex = this.pageList.findIndex(_ => _.id ===this.oldNum.id);
+        let newIndex = this.pageList.findIndex(_ => _.id ===this.newNum.id);
+        // console.log(oldIndex,newIndex)
+
+        let tempOption = _.cloneDeep(this.pageList[newIndex])
+        if(oldIndex !== newIndex) {
+          this.$set(this.pageList, newIndex, this.pageList[oldIndex])
+          this.$set(this.pageList, oldIndex, tempOption)
+          this.$message.success(this.$t('Slides.move_success_msg') )
         }
+        
+        this.currentIndex = this.pageList.findIndex(_ => _.id ===this.currentItem.id);
     },
     dragenter(e,value) {
       e.preventDefault()
@@ -1327,7 +1382,7 @@ export default {
   },
   updated(){
     $('.ppt-item').css('height',$('.ppt-item').width()*0.7);
-    $('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
+    $('.ppt-item').css('background-image',`url(${this.firstPage.CurrentBackgroundImg})`);
     window.onresize = ()=>{
       $('.ppt-item').css('height',$('.ppt-item').width()*0.7);
     }
@@ -1435,7 +1490,7 @@ $titleColor:#333333;
                 .ppt-item {
                     //padding 两边 40 减掉边框两边 8 max-width:100% - 32px
                     width:calc(100% - 64px);
-                    background: url('~@/assets/img/pptnextimg.png') no-repeat top;
+                    background: transparent;
                     background-size: 100% 100%;
                     /* margin-bottom: 30px; */
                     position: relative;
@@ -1613,5 +1668,9 @@ $titleColor:#333333;
             }
        }
     }
+    .flex-align{
+      display:flex;
+      align-items: center;
+    }
 }
 </style>

+ 7 - 7
src/views/ppt_manage/newVersion/pptPresent.vue

@@ -45,7 +45,7 @@
             </div>
             <!-- 封底 -->
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
-              <img :src="pptBackImage" class="pptbg" style="width:100%;height:100%;object-fit: fill !important;"/>
+              <img :src="coverInfo.page.BackCoverImg" class="pptbg" style="width:100%;height:100%;object-fit: fill !important;"/>
             </div>
             <!-- PPT内容 -->
               <div class="ppt-item" v-else>
@@ -113,7 +113,7 @@
             </div>
             <!-- 封底 -->
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
-              <img :src="pptBackImage" class="pptbg" style="width:100%;height:100%;object-fit: fill !important;"/>
+              <img :src="coverInfo.page.BackCoverImg" class="pptbg" style="width:100%;height:100%;object-fit: fill !important;"/>
             </div>
             <!-- PPT内容 -->
               <div class="ppt-item" v-else>
@@ -251,7 +251,7 @@ export default {
         return this.LayoutType===2?2:3
     },
     isShowBack(){
-        return Boolean(this.pptBackImage)
+        return Boolean(this.coverInfo.page.BackCoverImg)
     },
     pptSlidePages(){
       let str = this.$i18n.locale == 'zh'? 
@@ -291,7 +291,7 @@ export default {
           $('.editor-content').css('transform',`scale(${this.contentScale})`)
         }
         this.changeLayersSize()
-        $('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
+        $('.ppt-item').css('background-image',`url(${this.coverInfo.page.CurrentBackgroundImg})`);
       })
     },
     async init(){
@@ -323,7 +323,7 @@ export default {
         this.sheetListHandle(sheetElements);
       }
       this.currentKey = 1
-      this.pptBgImage&&$('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
+      this.coverInfo.page.CurrentBackgroundImg&&$('.ppt-item').css('background-image',`url(${this.coverInfo.page.CurrentBackgroundImg})`);
       this.dataLoading.close();
     },
     //根据id获取ppt数据
@@ -575,7 +575,7 @@ export default {
           $('.fullscreen .ppt-wrap').css('width','1100px')
           $('.ppt-item').css('transform',`scale(1)`)
           this.changeCurrentItem(this.currentItem)
-          $('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
+          $('.ppt-item').css('background-image',`url(${this.coverInfo.page.CurrentBackgroundImg})`);
         })
       }else{
         this.$nextTick(()=>{
@@ -875,7 +875,7 @@ $titleColor:#333333;
     .ppt-item{
       width: 100%;
       height: 100%;
-      background: url('~@/assets/img/pptnextimg.png') no-repeat top;
+      background: transparent;
       background-size: 100% 100%;
       position:relative;
       border: 4px solid transparent;

+ 8 - 7
src/views/ppt_manage/newVersion/pptPublish.vue

@@ -58,8 +58,8 @@
             </component>
           </div>
           <!-- 封底 -->
-          <div class="ppt-item" id="back" v-if="pptBackImage.length" style="background-size:20%;">
-            <img :src="pptBackImage" class="pptbg" style="width:100%;height:100%;object-fit: fill !important;"/>
+          <div class="ppt-item" id="back" v-if="coverInfo.page&&coverInfo.page.BackCoverImg" style="background-size:20%;">
+            <img :src="coverInfo.page.BackCoverImg" class="pptbg" style="width:100%;height:100%;object-fit: fill !important;"/>
           </div>
         </div>
       </template>
@@ -223,7 +223,7 @@ export default {
         this.$store.commit('SET_CHART_INFO_MAP',chartInfoMap)
 
         this.dataLoading.close();
-        $('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
+        $('.ppt-item').css('background-image',`url(${this.coverInfo.page.CurrentBackgroundImg})`);
       }
     },
     async getpptData(){
@@ -232,6 +232,7 @@ export default {
         await this.getpptDataById(id)
         const {status} = this.result
         if(status===200){
+          console.log(this.result)
           const {content,FirstPage,ReportId} = this.result
           this.pageList = content
           this.coverInfo.page = FirstPage
@@ -290,8 +291,8 @@ export default {
       //开始计时
       const start = Date.now()
       const SlideMaster = _.cloneDeep(pptSlideMaster) 
-      SlideMaster.objects[1] = {image: {x:0,y:0,w:10,h:7,path: this.isTestLocal?require('@/assets/img/pptnextimg.png'):this.pptBgImage}}
-      let pptx = pptConfigInit(new pptxgen(),this.LayoutType,'ch',SlideMaster,this.isTestLocal?require('@/assets/img/pptnextimg.png'):this.pptBgImage)
+      SlideMaster.objects[1] = {image: {x:0,y:0,w:10,h:7,path: this.isTestLocal?require('@/assets/img/pptnextimg.png'):this.coverInfo.page.CurrentBackgroundImg}}
+      let pptx = pptConfigInit(new pptxgen(),this.LayoutType,'ch',SlideMaster,this.isTestLocal?require('@/assets/img/pptnextimg.png'):this.coverInfo.page.CurrentBackgroundImg)
       //添加封面
       let cover = pptx.addSlide()
       let coverId = 'cover'
@@ -431,7 +432,7 @@ export default {
         }
       }
       //添加封底 如果有
-      if(this.pptBackImage.length){
+      if(this.coverInfo.page&&this.coverInfo.page.BackCoverImg){
         let back = pptx.addSlide()
         let backId = 'back'
         let backImg = $(`#${backId} img`)[0].src
@@ -745,7 +746,7 @@ $titleColor:#333333;
       /* height: 628.594px; */
       background-color: pink;
       margin-bottom: 20px;
-      background: url('~@/assets/img/pptnextimg.png') no-repeat top;
+      background: transparent;
       background-size: 100% 100%;
       position:relative;
       border: 4px solid transparent;

+ 1 - 1
src/views/ppt_manage/newVersion/utils/untils.js

@@ -362,7 +362,7 @@ export const getTextContentSize = (model,position)=>{
         14: {
           1:[1,0.4,1,0.9],
           2:[1,0.4,1,0.9],
-          3:[1,0.6,1,0.9]
+          3:[1,0.6,1,0.96]
         }
     }
     const modelMapHeight = {

+ 214 - 48
src/views/system_manage/components/smartReportImgSet.vue

@@ -2,11 +2,12 @@
     <div class="smart-report-img-set-page">
         <div class="top-wrap">
             <el-input v-model="keyword" :placeholder="$t('SystemManage.BaseConfig.resource_placeholder01')" clearable style="width:200px;margin-right:20px" @input="handleSearch"></el-input>
-            <el-select :placeholder="$t('SystemManage.BaseConfig.resource_placeholder02')" v-model="type" clearable style="width:200px" @change="handleSearch">
-                <el-option :label="$t('SystemManage.BaseConfig.resource_type01')" :value="1"></el-option>
-                <el-option :label="$t('SystemManage.BaseConfig.resource_type02')" :value="2"></el-option>
+            <el-select  :placeholder="$t('SystemManage.BaseConfig.resource_placeholder02')" v-model="type" clearable style="width:200px" @change="handleSearch">
+                <el-option :label="libraryType==2?$t('SystemManage.BaseConfig.ppt_type01'):$t('SystemManage.BaseConfig.resource_type01')" :value="1"></el-option>
+                <el-option :label="libraryType==2?$t('SystemManage.BaseConfig.ppt_type02'):$t('SystemManage.BaseConfig.resource_type02')" :value="2"></el-option>
+                <el-option v-if="libraryType==2" :label="$t('SystemManage.BaseConfig.ppt_type03')" :value="3"></el-option>
             </el-select>
-            <el-button type="primary" style="float:right" @click="handleShowUploadPop" v-permission="permissionBtn.baseConfigPermission.etaBaseConfig_source_upload">{{$t('SystemManage.BaseConfig.resource_btn04')}}</el-button>
+            <el-button type="primary" style="float:right" @click="handleShowUploadPop" v-permission="permissionBtn.baseConfigPermission.etaBaseConfig_source_upload">{{libraryType==1?$t('SystemManage.BaseConfig.resource_btn04'):$t('SystemManage.BaseConfig.resource_btn01')}}</el-button>
         </div>
 
         <div class="select-status-box" v-if="selectIds.length>0">
@@ -22,8 +23,8 @@
 
 
         <ul class="img-list-wrap">
-            <li class="img-item" v-for="item in list" :key="item.ResourceId">
-                <div :class="['select-box',selectIds.includes(item.ResourceId)?'select-box-active':'']" @click="handleSelectItem(item)"></div>
+            <li class="img-item" v-for="item in list" :key="item.ResourceId || item.ImageConfId">
+                <div :class="['select-box',selectIds.includes(item.ResourceId || item.ImageConfId)?'select-box-active':'']" @click="handleSelectItem(item)"></div>
                 <div class="opt-box">
                     <div class="item" @click="handleShowImgFull(item)">
                         <img src="~@/assets/img/icons/fullsreen.png" alt="">
@@ -38,8 +39,8 @@
                     </el-dropdown-menu>
                     </el-dropdown>
                 </div>
-                <img class="img" :src="item.ImgUrl" alt="">
-                <p class="name">{{item.ImgName}}</p>
+                <img class="img" :src="item.ImgUrl || item.Url" alt="">
+                <p class="name">{{item.ImgName || item.ImageName}}</p>
             </li>
         </ul>
         <tableNoData :text="$t('Table.prompt_slogan')" v-if="list.length===0"/>
@@ -165,7 +166,74 @@
             </el-form>
             
         </el-dialog>
-        <el-image-viewer 
+
+        <!-- ppt上传图片弹窗 -->
+        <el-dialog
+            :visible.sync="uploadImgPpt"
+            :title="ruleForm.ImageConfId?$t('SystemManage.BaseConfig.ppt_btn02'):$t('SystemManage.BaseConfig.resource_btn01')"
+            :close-on-click-modal="false"
+            :append-to-body="true"
+            @close="cancelPpt"
+            custom-class="classify-dialog"
+            center
+            width="550px"
+            v-dialogDrag
+        >
+            <el-form 
+                :model="ruleForm" 
+                :rules="formRules" 
+                ref="ruleForms" 
+                label-width="120px" 
+                class="upload-img-form"
+            >   
+                <el-form-item :label="$t('SystemManage.BaseConfig.resource_label01')" prop="ImageName">
+                    <el-input v-model="ruleForm.ImageName" :placeholder="$t('SystemManage.BaseConfig.resource_placeholder01')"></el-input>
+                </el-form-item>
+                <el-form-item :label="$t('SystemManage.BaseConfig.resource_label02')" prop="ImageType">
+                    <el-radio-group v-model="ruleForm.ImageType">
+                        <el-radio :label="1">{{$t('SystemManage.BaseConfig.ppt_type01')}}</el-radio>
+                        <el-radio :label="2">{{$t('SystemManage.BaseConfig.ppt_type02')}}</el-radio>
+                        <el-radio :label="3">{{$t('SystemManage.BaseConfig.ppt_type03')}}</el-radio>
+                    </el-radio-group>
+                </el-form-item>
+                <el-form-item 
+                    :label="$t('SystemManage.BaseConfig.resource_btn01')" 
+                    prop="Url"
+                >
+                    <el-upload 
+                        action="" 
+                        accept="image/*" 
+                        :http-request="handleUploadImg" 
+                        :show-file-list="false"
+                    >
+                        <div class="upload-box">
+                            <template v-if="!ruleForm.Url">
+                                <i class="el-icon-plus" style="font-size: 24px;"></i>
+                            </template>
+                            <template v-else>
+                                <img class="upload-img" :src="ruleForm.Url" alt="">
+                                <div class="upload-mask">
+                                    <i class="el-icon-zoom-in" @click.stop="handleShowImgPpt()"></i>
+                                    <i class="el-icon-delete" @click.stop="ruleForm.Url=''"></i>
+                                </div>
+                            </template>
+                        </div>
+                    </el-upload>
+                    <p>{{$t('SystemManage.BaseConfig.upload_ppt_suggest')}}</p>
+                </el-form-item>
+                <div style="text-align: center;padding: 30px 0;margin-top: 60px;">
+                    <el-button style="width:120px;" @click="cancelPpt()" >{{$t('Dialog.cancel_btn')}}</el-button>
+                    <el-button type="primary" style="margin-left:20px;width:120px;" @click="handlePptSave">{{$t('Dialog.confirm_save_btn')}}</el-button>
+                </div>
+            </el-form>
+            <el-image-viewer
+                :zIndex="9999"
+                v-if="showPptViewer" 
+                :on-close="()=>{this.picShowList=[];this.showPptViewer = false}" 
+                :url-list="picShowList" 
+            />
+        </el-dialog>
+        <el-image-viewer
             v-if="showViewer" 
             :on-close="()=>{this.picShowList=[];this.showViewer = false}" 
             :url-list="picShowList" 
@@ -181,6 +249,24 @@ import draggable from 'vuedraggable'
 import VueDragResize from 'vue-drag-resize'
 export default {
     components:{ElImageViewer,draggable,VueDragResize},
+    props:{
+        libraryType:{
+            type:Number,
+            default:1
+        }
+    },
+    watch:{
+        libraryType:{
+            handler(newval){
+                this.page = 1;
+                this.keyword=''
+                this.type=''
+                this.list=[]
+                this.getImgList()
+            },
+            deep:true
+        }
+    },
     data() {
         return {
             keyword:'',
@@ -191,6 +277,7 @@ export default {
             total:0,
 
             uploadImgPop:false,
+            uploadImgPpt:false,
             formData:{
                 id:0,
                 name:'',
@@ -198,10 +285,19 @@ export default {
                 imgUrl:'',
                 layout:''
             },
+            ruleForm:{
+                ImageName:'',
+                Url:"",
+                ConfType:1,
+                ImageType:''
+            },
             formRules:{
                 name:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder01')||'请输入图片名称', trigger: 'blur' }],
                 type:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder02')||'请选择图片类型', trigger: 'change' }],
-                imgUrl:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder03')||'请上传图片', trigger: 'change' }]
+                imgUrl:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder03')||'请上传图片', trigger: 'change' }],
+                ImageName:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder01')||'请输入图片名称', trigger: 'blur' }],
+                ImageType:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder02')||'请选择图片类型', trigger: 'change' }],
+                Url:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder03')||'请上传图片', trigger: 'change' }]
             },
             step:1,
             steps:[this.$t('SystemManage.BaseConfig.select_layout'),this.$t('SystemManage.BaseConfig.edit_layout')],
@@ -236,6 +332,7 @@ export default {
                             {value:'center',label:this.$t('SystemManage.BaseConfig.style_text_align_center')},
                             {value:'right',label:this.$t('SystemManage.BaseConfig.style_text_align_right')}],
             showViewer:false,
+            showPptViewer:false,
             picShowList:[],
             rigtMenuHideTimer:null,
             delIds:[],//要删除的id集合
@@ -253,19 +350,22 @@ export default {
     },
     methods: {
         handleSelectItem(e){
-            const index=this.selectIds.indexOf(e.ResourceId)
+            const key=this.libraryType==1?'ResourceId':'ImageConfId'
+            console.log(e[key])
+            const index=this.selectIds.indexOf(e[key])
             if(index>-1){
                 this.selectIds.splice(index,1)
             }else{
-                this.selectIds.push(e.ResourceId)
+                this.selectIds.push(e[key])
             }
 
             this.checkAll=this.selectIds.length===this.list.length?true:false
             this.isIndeterminate=this.selectIds.length>0&&this.selectIds.length<this.list.length
         },
         handleCheckAllChange(val){
+            const key=this.libraryType==1?'ResourceId':'ImageConfId'
             if(val){
-                this.selectIds=this.list.map(item=>item.ResourceId)
+                this.selectIds=this.list.map(item=>item[key])
             }else{
                 this.selectIds=[]
             }
@@ -285,16 +385,26 @@ export default {
             this.isIndeterminate=false
             this.checkAll=false
             this.delIds=[]
-            
-            const res=await apiSmartReport.imgReourceList({
-                CurrentIndex:this.page,
-                PageSize:this.pageSize,
-                Type:this.type,
-                Keyword:this.keyword
-            })
-            if(res.Ret===200){
-                this.list=res.Data.List||[]
-                this.total=res.Data.Paging.Totals
+            let res='' 
+            if(this.libraryType==1){
+                res=await apiSmartReport.imgReourceList({
+                    CurrentIndex:this.page,
+                    PageSize:this.pageSize,
+                    Type:this.type,
+                    Keyword:this.keyword
+                })
+            }else{
+                res=await apiSmartReport.pptMaterialList({
+                    CurrentIndex:this.page,
+                    PageSize:this.pageSize,
+                    ImageType:this.type?this.type:null,
+                    ImageName:this.keyword,
+                    ConfType:1
+                })
+            }
+            if(res&&res.Ret===200){
+                this.list=res.Data?res.Data.List:[]
+                this.total=res.Data?res.Data.Paging.Totals:0
             }
         },
 
@@ -310,8 +420,13 @@ export default {
             form.append('file',file.file);
             bannerupload(form).then(res=>{
                 // console.log(res);
-                if(res.Ret!==200) return 
-                this.formData.imgUrl=res.Data.ResourceUrl
+                if(res.Ret!==200) return
+                if(this.libraryType==1){
+                    this.formData.imgUrl=res.Data.ResourceUrl
+                }else{
+                    this.ruleForm.Url=res.Data.ResourceUrl
+                    this.$refs.ruleForms.clearValidate('Url');
+                }
             })
         
         },
@@ -375,6 +490,33 @@ export default {
         handleCloseImgUpload(){
             this.uploadImgPop=false
         },
+        handlePptSave(){
+            this.$refs.ruleForms.validate(async (valid)=>{
+                if(valid){
+                    const params={
+                        ...this.ruleForm
+                    }
+                    let res=''
+                    if(this.ruleForm.ImageConfId){
+
+                    }else{
+                        res=await apiSmartReport.pptAddMaterial([params])
+                    }
+                    if(res&&res.Ret===200){
+                        this.$message.success(this.ruleForm.ImageConfId?this.$t('MsgPrompt.edit_msg'):this.$t('MsgPrompt.add_msg'))
+                        this.cancelPpt()
+                        this.page=1
+                        this.getImgList()
+                    }
+                }
+            })   
+        },
+        cancelPpt(){
+            this.$nextTick(()=>{
+                this.$refs.ruleForms.clearValidate()
+            })
+            this.uploadImgPpt=false
+        },
         cancelHandle(){
             this.step=1
             this.formData.id=0
@@ -400,34 +542,54 @@ export default {
                 this.$refs.ruleForm.clearValidate()
             })
         },
+        handleShowImgPpt(){
+            this.showPptViewer=true
+            this.picShowList=[this.ruleForm.Url]
+        },
         handleShowImgFull(e){
             console.log(e);
-            this.picShowList=[e.ImgUrl]
+            this.picShowList=[this.libraryType==1?e.ImgUrl:e.Url]
             this.showViewer=true
         },
 
         handleClickOpt(e){
             if(e.type==='del'){
-                this.delIds=[e.data.ResourceId]
+                this.delIds=[this.libraryType==1?e.data.ResourceId:e.data.ImageConfId]
                 this.handleImgDel()
             }
             if(e.type==='edit'){
-                this.formData.id=e.data.ResourceId
-                this.formData.name=e.data.ImgName
-                this.formData.type=e.data.Type
-                this.formData.imgUrl=e.data.ImgUrl
-                this.formData.layout=e.data.Style
+                if(this.libraryType==1){
+                    this.formData.id=e.data.ResourceId
+                    this.formData.name=e.data.ImgName
+                    this.formData.type=e.data.Type
+                    this.formData.imgUrl=e.data.ImgUrl
+                    this.formData.layout=e.data.Style
 
-                this.uploadImgPop=true
+                    this.uploadImgPop=true
+                }else{
+                    this.ruleForm=JSON.parse(JSON.stringify(e.data))
+
+                    this.uploadImgPpt=true
+                }
             }
         },
         handleShowUploadPop(){
-            this.formData.id=0
-            this.formData.name=''
-            this.formData.type=''
-            this.formData.imgUrl=''
-            this.formData.layout=''
-            this.uploadImgPop=true
+            if(this.libraryType==1){
+                this.formData.id=0
+                this.formData.name=''
+                this.formData.type=''
+                this.formData.imgUrl=''
+                this.formData.layout=''
+                this.uploadImgPop=true
+            }else{
+                this.ruleForm={
+                    ImageName:'',
+                    Url:"",
+                    ConfType:1,
+                    ImageType:''
+                }
+                this.uploadImgPpt=true
+            }
         },
 
         handleBatchDel(){
@@ -438,14 +600,18 @@ export default {
         handleImgDel(){
             this.$confirm(this.$t('SystemManage.BaseConfig.resource_del_msg'),this.$t('Confirm.prompt'),{
                 type: 'warning'
-            }).then(()=>{
-                apiSmartReport.imgReourceDel({ResourceIds:this.delIds.join(',')}).then(res=>{
-                    if(res.Ret===200){
-                        this.$message.success(this.$t('MsgPrompt.delete_msg'))
-                        this.page=1
-                        this.getImgList()
-                    }
-                })
+            }).then(async ()=>{
+                let res=''
+                if(this.libraryType==1){
+                    res=await apiSmartReport.imgReourceDel({ResourceIds:this.delIds.join(',')})
+                }else{
+                    res=await apiSmartReport.pptDeleteMaterial(this.delIds.map(el=>{return {ImageConfId:el}}))
+                }
+                if(res&&res.Ret===200){
+                    this.$message.success(this.$t('MsgPrompt.delete_msg'))
+                    this.page=1
+                    this.getImgList()
+                }
             })
         },
         // 切换步骤
@@ -563,7 +729,7 @@ export default {
     display: none;
 }
 .smart-report-img-set-page{
-    padding: 30px;
+    padding:11px 30px 30px;
     padding-bottom: 100px;
     .select-status-box{
         background-color: #F8F8F8;

+ 8 - 4
src/views/system_manage/etaBaseConfig.vue

@@ -304,7 +304,7 @@
                     <div v-if="isShowPPT&&pptLang === 'cn'" class="ppt-form-item-wrap">
                         
                         
-                        <el-form-item :label="$t('SystemManage.BaseConfig.ppt_type01')" prop="CnPptCoverImgs" style="min-width:400px;">
+                        <!-- <el-form-item :label="$t('SystemManage.BaseConfig.ppt_type01')" prop="CnPptCoverImgs" style="min-width:400px;">
                             <div class="input-line" style="display:flex;">
                                 <ImgUpload 
                                     :imgUrl="formData.CnPptCoverImgs.length===3?formData.CnPptCoverImgs[2]:''"
@@ -342,7 +342,7 @@
                             <ConfigAnnotation picName="pptBackPic" @showImage="previewImage"
                                 :picHintText="$t('SystemManage.BaseConfig.ppt_tip03')"
                                 :buttonText="$t('SystemManage.BaseConfig.view_example_text')"/>
-                        </el-form-item>
+                        </el-form-item> -->
                         <el-form-item label="PPT表格" prop="CnPptSheetSize">
                             <template slot="label">
                                 <span>
@@ -428,9 +428,12 @@
         
         </template>
         <template v-if="sectionType==2&&isShowSource">
-            <div class="smart-report-title">{{$t('SystemManage.BaseConfig.smart_layout_resource_library')}}</div>
+            <el-radio-group v-model="libraryType" style="margin:16px 0 0 30px;">
+                <el-radio-button label="1">{{$t('SystemManage.BaseConfig.smart_layout_resource_library')}}</el-radio-button>
+                <el-radio-button label="2">{{$t('SystemManage.BaseConfig.ppt_resource_library')}}</el-radio-button>
+            </el-radio-group>
             <!-- 资源库 -->
-            <smartReportImgSet />
+            <smartReportImgSet :libraryType="libraryType" />
         </template>
 
 
@@ -462,6 +465,7 @@ export default {
         }
         return {
             /* base config */
+            libraryType:'1',
             checkList:[],//水印应用
             Iflytek:false,//是否启用科大讯飞服务
             approve:false,//是否开启研报审批