From 4806de8de501c08bde6e69be1779b3327ecf2364 Mon Sep 17 00:00:00 2001 From: wpxp123456 <2677556700@qq.com> Date: Thu, 24 Sep 2020 17:32:18 +0800 Subject: [PATCH] fix(bug): bug bug --- src/controllers/dataVerificationCtrl.js | 14 +++++++------- src/global/draw.js | 6 +++--- src/global/getdata.js | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/controllers/dataVerificationCtrl.js b/src/controllers/dataVerificationCtrl.js index 37c2688aa..dc3d798d5 100644 --- a/src/controllers/dataVerificationCtrl.js +++ b/src/controllers/dataVerificationCtrl.js @@ -573,7 +573,7 @@ const dataVerificationCtrl = { } else if(type == 'number' || type == 'number_integer' || type == 'number_decimal'){ type2 = $("#luckysheet-dataVerification-dialog #data-verification-number-select").val(); - value1 = $("#luckysheet-dataVerification-dialog .show-box-item-number .data-verification-value1").val().trim(); + value1 = $("#luckysheet-dataVerification-dialog .show-box-item-number .input:visible .data-verification-value1").val().trim(); if(!isRealNum(value1)){ tooltip.info('', dvText.tooltipInfo3); @@ -581,7 +581,7 @@ const dataVerificationCtrl = { } if(type2 == 'bw' || type2 == 'nb'){ - value2 = $("#luckysheet-dataVerification-dialog .show-box-item-number .data-verification-value2").val().trim(); + value2 = $("#luckysheet-dataVerification-dialog .show-box-item-number .input:visible .data-verification-value2").val().trim(); if(!isRealNum(value2)){ tooltip.info('', dvText.tooltipInfo3); @@ -605,7 +605,7 @@ const dataVerificationCtrl = { } else if(type == 'text_length'){ type2 = $("#luckysheet-dataVerification-dialog #data-verification-textLength-select").val(); - value1 = $("#luckysheet-dataVerification-dialog .show-box-item-textLength .data-verification-value1").val().trim(); + value1 = $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input:visible .data-verification-value1").val().trim(); if(!isRealNum(value1)){ tooltip.info('', dvText.tooltipInfo3); @@ -613,7 +613,7 @@ const dataVerificationCtrl = { } if(type2 == 'bw' || type2 == 'nb'){ - value2 = $("#luckysheet-dataVerification-dialog .show-box-item-textLength .data-verification-value2").val().trim(); + value2 = $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input:visible .data-verification-value2").val().trim(); if(!isRealNum(value2)){ tooltip.info('', dvText.tooltipInfo3); @@ -628,7 +628,7 @@ const dataVerificationCtrl = { } else if(type == 'date'){ type2 = $("#luckysheet-dataVerification-dialog #data-verification-date-select").val(); - value1 = $("#luckysheet-dataVerification-dialog .show-box-item-date .data-verification-value1").val().trim(); + value1 = $("#luckysheet-dataVerification-dialog .show-box-item-date .input:visible .data-verification-value1").val().trim(); if(!isdatetime(value1)){ tooltip.info('', dvText.tooltipInfo6); @@ -636,7 +636,7 @@ const dataVerificationCtrl = { } if(type2 == 'bw' || type2 == 'nb'){ - value2 = $("#luckysheet-dataVerification-dialog .show-box-item-date .data-verification-value2").val().trim(); + value2 = $("#luckysheet-dataVerification-dialog .show-box-item-date .input:visible .data-verification-value2").val().trim(); if(!isdatetime(value2)){ tooltip.info('', dvText.tooltipInfo6); @@ -1034,7 +1034,7 @@ const dataVerificationCtrl = { } //数据验证未通过 - let cellValue = getcellvalue(r, c, null, 'm'); + let cellValue = getcellvalue(r, c, null); if(cellValue == null || cellValue == ""){ return; diff --git a/src/global/draw.js b/src/global/draw.js index 55443d9b0..ed1f0a1a1 100644 --- a/src/global/draw.js +++ b/src/global/draw.js @@ -1222,10 +1222,10 @@ let cellRender = function(r, c, start_r, start_c, end_r, end_c, value, luckyshee ]; luckysheetTableContent.fillRect(cellsize[0], cellsize[1], cellsize[2], cellsize[3]); + //数据验证(单元格左上角红色小三角标示) let dataVerification = dataVerificationCtrl.dataVerification; - - if(dataVerification != null && dataVerification[r + '_' + c] != null && !dataVerificationCtrl.validateCellData(value, dataVerification[r + '_' + c])){ - //单元格左上角红色小三角标示 + let cellValue = getcellvalue(r, c, null); + if(dataVerification != null && dataVerification[r + '_' + c] != null && !dataVerificationCtrl.validateCellData(cellValue, dataVerification[r + '_' + c])){ let dv_w = 5 * Store.zoomRatio, dv_h = 5 * Store.zoomRatio; //红色小三角宽高 luckysheetTableContent.beginPath(); diff --git a/src/global/getdata.js b/src/global/getdata.js index 9c1029d15..941eb90f3 100644 --- a/src/global/getdata.js +++ b/src/global/getdata.js @@ -162,7 +162,7 @@ export function getcellvalue(r, c, data, type) { else if(type == "f") { retv = d_value["v"]; } - else if(d_value && d_value.ct && d_value.ct.fa == 'yyyy-MM-dd') { + else if(d_value && d_value.ct && d_value.ct.t == 'd') { retv = d_value.m; } }