Explorar o código

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

MaiXinRong hai 1 ano
pai
achega
9845ff122a
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/public/js/material.js

+ 2 - 2
app/public/js/material.js

@@ -584,7 +584,7 @@ $(document).ready(() => {
                     return;
                     return;
                 }
                 }
                 // 未改变值则不提交
                 // 未改变值则不提交
-                let validText = is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : null);
+                let validText = col.type === 'Number' && is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : null);
                 const orgValue = select[col.field];
                 const orgValue = select[col.field];
                 if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
                 if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
@@ -744,7 +744,7 @@ $(document).ready(() => {
                     if (!colSetting) continue;
                     if (!colSetting) continue;
 
 
                     let validText = info.sheet.getText(curRow, curCol);
                     let validText = info.sheet.getText(curRow, curCol);
-                    validText = is_numeric(validText) ? parseFloat(validText) : (validText ? trimInvalidChar(validText) : null);
+                    validText = colSetting.type === 'Number' && is_numeric(validText) ? parseFloat(validText) : (validText ? trimInvalidChar(validText) : null);
                     const orgValue = sortData[curRow][colSetting.field];
                     const orgValue = sortData[curRow][colSetting.field];
                     if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
                     if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
                         sameCol++;
                         sameCol++;