Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(bug): bug
Browse files Browse the repository at this point in the history
bug
  • Loading branch information
wpxp123456 committed Sep 24, 2020
1 parent 6f7ca26 commit 4806de8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/controllers/dataVerificationCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,15 +573,15 @@ 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('<i class="fa fa-exclamation-triangle"></i>', dvText.tooltipInfo3);
return;
}

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('<i class="fa fa-exclamation-triangle"></i>', dvText.tooltipInfo3);
Expand All @@ -605,15 +605,15 @@ 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('<i class="fa fa-exclamation-triangle"></i>', dvText.tooltipInfo3);
return;
}

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('<i class="fa fa-exclamation-triangle"></i>', dvText.tooltipInfo3);
Expand All @@ -628,15 +628,15 @@ 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('<i class="fa fa-exclamation-triangle"></i>', dvText.tooltipInfo6);
return;
}

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('<i class="fa fa-exclamation-triangle"></i>', dvText.tooltipInfo6);
Expand Down Expand Up @@ -1034,7 +1034,7 @@ const dataVerificationCtrl = {
}

//数据验证未通过
let cellValue = getcellvalue(r, c, null, 'm');
let cellValue = getcellvalue(r, c, null);

if(cellValue == null || cellValue == ""){
return;
Expand Down
6 changes: 3 additions & 3 deletions src/global/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/global/getdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 4806de8

Please sign in to comment.