From 4ef0342708910d02453fdcfae2148eadbf6d7004 Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期三, 05 六月 2024 11:34:21 +0800
Subject: [PATCH] 1、设备综合效率分析页面表格列属性ellipsis开启后内容若超出盒子宽度则出现与表头错位现象,而无法实现ellipsis开启后内容超出单元格则省略功能,现采取增加列宽度方式且关闭ellipsis属性功能方法解决问题 2、设备综合效率分析页面调整计算表格垂直滚动条方法以试图解决项目服务器上无法正常显示水平滚动条问题

---
 src/components/table2excel/table2excel.js |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/components/table2excel/table2excel.js b/src/components/table2excel/table2excel.js
index 0767353..9fdec8d 100644
--- a/src/components/table2excel/table2excel.js
+++ b/src/components/table2excel/table2excel.js
@@ -3,7 +3,6 @@
 import jQuery from 'jquery'
 (function ( $, window, document, undefined ) {
   var pluginName = "table2excel",
-
     defaults = {
       exclude: ".noExl",
       name: "Table2Excel",
@@ -94,15 +93,21 @@
             if( rc.flag.length > 0 ) {
               tempRows += "<td> </td>"; // exclude it!!
             } else {
-              tempRows += "<td";
+              // 鍖归厤鏍煎紡涓�'yyyy-mm'鐨勬棩鏈熷瓧绗︿覆鏁版嵁锛岃嫢鏈夊叾浠栭渶姹傚悗鏈熷啀澧炲姞
+              var regexPattern = /^\d{4}-\d{2}$/;
+              if($(q).html().match(regexPattern)){
+                tempRows += "<td style=\"mso-number-format:'yyyy-mm';\"";
+              }else{
+                tempRows += "<td";
+                if(additionalStyles){
+                  tempRows += " style='" + additionalStyles + "'";
+                }
+              }
               if( rc.rows > 0) {
                 tempRows += " rowspan='" + rc.rows + "' ";
               }
               if( rc.cols > 0) {
                 tempRows += " colspan='" + rc.cols + "' ";
-              }
-              if(additionalStyles){
-                tempRows += " style='" + additionalStyles + "'";
               }
               tempRows += ">" + $(q).html() + "</td>";
             }
@@ -253,7 +258,6 @@
         $.data( e, "plugin_" + pluginName, new Plugin( this, options ) );
       }
     });
-
     // chain jQuery functions
     return e;
   };

--
Gitblit v1.9.3