From e1e7e01e40f3de2bd40d2de974a876f4f29abda2 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期二, 22 七月 2025 14:54:50 +0800
Subject: [PATCH] 三保变更

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

diff --git a/src/components/table2excel/table2excel.js b/src/components/table2excel/table2excel.js
index 4891d2b..9fdec8d 100644
--- a/src/components/table2excel/table2excel.js
+++ b/src/components/table2excel/table2excel.js
@@ -93,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>";
             }

--
Gitblit v1.9.3