From 868080e8b11f7e80c9d29fabec1a178069e0cfac Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 9 Apr 2025 15:39:35 +0800 Subject: [PATCH] * [perf story #72430] Hide delete btn when data is exist. --- module/programplan/js/create.ui.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/module/programplan/js/create.ui.js b/module/programplan/js/create.ui.js index 0a2fce60dd..73b8cb35ae 100644 --- a/module/programplan/js/create.ui.js +++ b/module/programplan/js/create.ui.js @@ -81,7 +81,7 @@ window.handleRenderRow = function($row, index, data) $row.find(nestedTextSelector).attr('title', text).text(text).append(``); $row.find('.form-batch-col-actions').addClass('is-pinned'); - if(typeof data != 'undefined' && typeof data.id != 'undefined') $row.find('[data-name="ACTIONS"]').find('[data-type="delete"]').addClass('hidden'); + if(typeof data != 'undefined' && typeof data.id != 'undefined') $row.find('[data-name="ACTIONS"]').find('[data-type="delete"]').addClass('hidden'); //隐藏已有数据的删除按钮。 if($row.find('input[data-name="milestone"]:checked').length == 0) $row.find('input[data-name="milestone"]').eq(1).prop('checked', true); if(project.model == 'ipd' && planID == '0') @@ -114,9 +114,6 @@ window.handleRenderRow = function($row, index, data) $picker.render(options); }); - $('thead [data-name="ACTIONS"]').css('display', 'none'); - $row.find('[data-name="ACTIONS"]').css('display', 'none'); - if(data.hasOwnProperty('status') && data.status != 'wait') { $row.find('[data-name=enabled] input').attr('disabled', 'disabled'); @@ -156,16 +153,13 @@ window.handleRenderRow = function($row, index, data) }); } - if(data != undefined) + if(data != undefined && data.hasOwnProperty('type')) { - if(data.hasOwnProperty('type')) + $row.find('[data-name="type"]').find('.picker-box').on('inited', function(e, info) { - $row.find('[data-name="type"]').find('.picker-box').on('inited', function(e, info) - { - let $type = info[0]; - $type.render({disabled: true}); - }); - } + let $type = info[0]; + $type.render({disabled: true}); + }); } if(data != undefined && data.disabled)