From 8f1df61c8902a35e41205d7cbd9d0763619e6d46 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期五, 22 八月 2025 16:36:47 +0800 Subject: [PATCH] mdc首页设备管理部分功能调整 --- src/components/table2excel/table2excel.js | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/table2excel/table2excel.js b/src/components/table2excel/table2excel.js index 4891d2b..c377223 100644 --- a/src/components/table2excel/table2excel.js +++ b/src/components/table2excel/table2excel.js @@ -82,6 +82,8 @@ compStyle = getComputedStyle(q); additionalStyles += (compStyle && compStyle.backgroundColor ? "background-color: " + compStyle.backgroundColor + ";" : ""); additionalStyles += (compStyle && compStyle.color ? "color: " + compStyle.color + ";" : ""); + additionalStyles += (compStyle && compStyle.height ? "height: " + compStyle.height + ";" : ""); + additionalStyles += (compStyle && compStyle.wordWrap ? "word-wrap: " + compStyle.wordWrap + ";" : ""); } var rc = { @@ -93,15 +95,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