Pārlūkot izejas kodu

need: ppt下载表格文字位置同步

shanbinzhang 2 mēneši atpakaļ
vecāks
revīzija
3e6fd38803
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 7 0
      src/views/ppt_manage/newVersion/utils/untils.js

+ 7 - 0
src/views/ppt_manage/newVersion/utils/untils.js

@@ -638,6 +638,11 @@ export const getShapeOptions = (el,position,scale)=>{
 export const getTableData = (data)=>{
   //data:[{m:'表格数据',mc:{rs:2,cs:1}}] -> [{text:'表格数据',options:{rowspan:2,colspan:1}}]
   const tableData = []
+  let alignMap = {
+    0: 'center',
+    1: 'left',
+    2: 'right'
+  }
   for(let i=0;i<data.length;i++){
     const row = data[i]
     const _row =[]
@@ -658,6 +663,8 @@ export const getTableData = (data)=>{
           : '',
         bold: cell.bl ? true : false,
         italic: cell.it ? true : false,
+        align: alignMap[cell.HorizontalType] || alignMap[cell.ht] || 'center',
+        valign: 'center'
       }
         _row.push({
           text:cell.m,