From a4bb6e0c3e8128e956bc99959e1759cdeb5aac65 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Mon, 22 Aug 2022 04:06:20 +0000 Subject: [PATCH] * Batch edit append ignore prompt. --- module/project/js/common.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/module/project/js/common.js b/module/project/js/common.js index c3bdce25e0..11c6b4e011 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -1,7 +1,8 @@ window.ignoreTips = { - 'beyondBudgetTip' : false, - 'dateTip' : false + 'beyondBudgetTip' : false, + 'dateTip' : false, }; +var batchEditDateTips = new Array(); /** * Access rights are equal to private, and the white list settings are displayed. @@ -366,13 +367,15 @@ function budgetOverrunTips() /** *The date is out of the range of the parent project set, and a prompt is given. * - * @param int $currentID + * @param string $currentID * @access public * @return void */ -function outOfDateTip(currentID = 0) +function outOfDateTip(currentID = '') { if(window.ignoreTips['dateTip']) return; + if(batchEditDateTips.includes(Number(currentID))) return; + var end = currentID ? $('#ends\\[' + currentID + '\\]').val() : $('#end').val(); var begin = currentID ? $('#begins\\[' + currentID + '\\]').val() : $('#begin').val(); if($('#dateTip.text-remind').length > 0) $('#dateTip').parent().parent().remove(); @@ -413,6 +416,7 @@ function outOfDateTip(currentID = 0) if(currentID) { $("#projects\\[" + currentID + "\\]").after("" + ignore + "

"); + $('#dateTip'+ currentID).parent().css('line-height', '0') } else { @@ -427,14 +431,16 @@ function outOfDateTip(currentID = 0) * Make this prompt no longer appear. * * @param string $obj + * @param string $currentID * @access public * @return void */ -function ignoreTip(obj,currentID = 0) +function ignoreTip(obj, currentID) { var parentID = obj.parentNode.id; currentID ? $('#dateTip' + currentID).parent().parent().remove() : $('#' + parentID).parent().parent().remove(); - if(parentID == 'dateTip' || parentID == 'dateTip' + currentID) window.ignoreTips['dateTip'] = true; + if(parentID == 'dateTip') window.ignoreTips['dateTip'] = true; + if(parentID == 'dateTip' + currentID) batchEditDateTips.push(currentID); if(parentID == 'beyondBudgetTip') window.ignoreTips['beyondBudgetTip'] = true; }