Sfoglia il codice sorgente

Merge branch 'requirement_367' into debug

cldu 1 settimana fa
parent
commit
dac26b5646
3 ha cambiato i file con 21 aggiunte e 16 eliminazioni
  1. 4 0
      .env.productionsw
  2. 1 0
      package.json
  3. 16 16
      src/components/sheet.vue

+ 4 - 0
.env.productionsw

@@ -0,0 +1,4 @@
+VITE_BASEURL = '/ybchart/v1'
+VITE_HZYB_BASEURL = 'https://yanbao.hzinsights.com/api'
+# 路由根地址
+VITE_APP_BASE_URL="/ybchart/"

+ 1 - 0
package.json

@@ -6,6 +6,7 @@
     "build": " vite build --mode production",
     "build.test": "vite build --mode test",
     "build.nh": "vite build --mode nh",
+    "build.sw": "vite build --mode productionsw",
     "serve": "vite preview"
   },
   "dependencies": {

+ 16 - 16
src/components/sheet.vue

@@ -45,7 +45,17 @@ const HtObj=ref({
   2:'right'
 })
 
-const handleFF = (ff) => {
+const handleCellStyle = (cell) : string => {
+    return `
+      color: ${cell.fc};
+      font-weight: ${cell.bl ? 'bold' : 'normal'};
+      font-style: ${cell.it ? 'italic' : 'normal'};
+      text-align: ${HtObj.value[cell.HorizontalType]};
+      font-family: ${handleFF(cell.ff)};
+    `
+};
+
+const handleFF = (ff:string|number) : string => {
   return ff ? (typeof ff == 'number' ? SheetFFType[ff] :  ff) : ''
 }
 
@@ -78,30 +88,20 @@ initTableCellsWid('init',props.sceneConfig)
           :colspan="cell.mc.cs||1"
           :rowspan="cell.mc.rs||1"
           :style="`
-            color: ${cell.fc};
-            font-weight: ${cell.bl ? 'bold' : 'normal'};
-            font-style: ${cell.it ? 'italic' : 'normal'};
+            width:${index==0?getSize(cell_index,'width'):'auto'};
             background: ${cell.bg};
-            text-align: ${HtObj[cell.HorizontalType]};
-            font-size: ${cell.fs||props.config.FontSize||12}px;
-            width:${getSize(cell_index,'width')};
-            ${cell.ct.s ? '' : `font-family: ${handleFF(cell.ff)};`}
+            font-size: ${props.config.FontSize||cell.fs||12}px;
+            ${!cell.ct.s ? handleCellStyle(cell) : ''}
           `"
           @mousemove="e =>isCanDrag && handleMouseMove(e,index,cell_index)"
           @mousedown="e =>isCanDrag && handleMouseDown(e,index,cell_index)"
         >
           <!-- 单元格拆分 -->
-          <div class="split-word" v-if="cell.ct.s">
+          <div class="split-word" v-if="cell.ct.s" :style="`text-align: ${HtObj[cell.HorizontalType]};`">
             <span 
               v-for="(word,word_index) in cell.ct.s" 
               :key="`${index}_${cell_index}_${word_index}`"
-              :style="`
-                color: ${word.fc};
-                font-weight: ${word.bl ? 'bold' : 'normal'};
-                font-style: ${word.it ? 'italic' : 'normal'};
-                text-decoration:${word.un?'underline':word.cl?'line-through':'normal'};
-                font-family: ${handleFF(word.ff)};
-              `"
+              :style="handleCellStyle(word)"
             >{{word.v}}</span>
           </div>
           <div v-else