|
@@ -1992,10 +1992,12 @@ var projectObj = {
|
|
|
let max = 0;
|
|
|
let total = 0;
|
|
|
let counter = 0;
|
|
|
+ let notNumber = false; //如果有非数字,则不显示
|
|
|
for (let col = selectedArea.col; col < (selectedArea.colCount + selectedArea.col); col++) {
|
|
|
for (let row = selectedArea.row; row < (selectedArea.rowCount + selectedArea.row); row++) {
|
|
|
const value = sheet.getCell(row, col).text();
|
|
|
if (!regular.test(value)) {
|
|
|
+ if(value) notNumber = true;
|
|
|
continue;
|
|
|
}
|
|
|
counter++;
|
|
@@ -2007,8 +2009,8 @@ var projectObj = {
|
|
|
total += parseFloat(value);
|
|
|
}
|
|
|
}
|
|
|
- // 如果不为0则悬浮显示
|
|
|
- if (total > 0 && counter > 1) {
|
|
|
+ //选中的都是数字, 如果不为0则悬浮显示
|
|
|
+ if (notNumber === false && total > 0 && counter > 1) {
|
|
|
const div = $('<div id="total-tips"><p>合计: <input type="text" id="total" readonly="readonly" style="border: none;"/></p><p><a href="javascript:void(0);">复制</a></p></div>');
|
|
|
div.css({
|
|
|
position: "absolute",
|