* [refac bug #61502] render attribute field for ipd.

This commit is contained in:
wangyidong
2025-04-16 10:13:42 +08:00
committed by 刘刚
parent ee13faa824
commit 01e122f8ae
2 changed files with 23 additions and 13 deletions
+22 -13
View File
@@ -1,26 +1,35 @@
window.renderRowData = function($row, index, row)
{
if((row.type == 'stage' || row.attribute != '') && stageList[row.attribute])
let options = {};
options.required = true;
if(row.type == 'stage' || row.attribute != '')
{
let itemList = [];
let projectModel = 'stage';
if(stageList[row.attribute] !== undefined) itemList = stageList;
if(ipdTypeList[row.attribute] !== undefined)
{
itemList = ipdTypeList;
projectModel = 'ipd';
}
const parentType = row.grade > 1 && parents[row.parent] ? parents[row.parent].attribute : '';
/* If is stage, modify lifetime to attribute. */
let stageItems = [];
for(let key in stageList) stageItems.push({value: key, text: stageList[key]});
for(let key in itemList) stageItems.push({value: key, text: itemList[key]});
$row.find('[data-name="lifetime"]').find('.picker-box').on('inited', function(e, info)
if(stageItems.length > 0)
{
let $attribute = info[0];
$attribute.render({items: stageItems, required: true, name: 'attribute[' + row.id + ']', disabled: row.grade > 1 && parentType != 'mix'});
$row.attr('data-parent', row.parent);
});
options.items = stageItems;
options.name = 'attribute[' + row.id + ']';
options.disabled = row.grade > 1 && parentType != 'mix';
if(projectModel == 'ipd') options.disabled = true;
}
$row.attr('data-parent', row.parent);
}
$row.find('[data-name="lifetime"]').find('.picker-box').on('inited', function(e, info)
{
let $lifetime = info[0];
$lifetime.render({required: true});
});
$row.find('[data-name="lifetime"]').find('.picker-box').on('inited', function(e, info) { info[0].render(options); });
$row.find('[data-name="project"]').attr('data-lastselected', row.project).attr('data-execution', row.id);
}
+1
View File
@@ -15,6 +15,7 @@ $showMethod = $app->tab == 'project' && isset($project) && ($project->model == '
jsVar('weekend', $config->execution->weekend);
jsVar('stageList', $lang->stage->typeList);
jsVar('ipdTypeList', $lang->stage->ipdTypeList);
jsVar('confirmSync', $lang->execution->confirmSync);
jsVar('noticeChangeAttr', $lang->programplan->noticeChangeAttr);
jsVar('parents', $parents);