* [perf story #72338] Adjust for programplan create for waterfullplus.

This commit is contained in:
wangyidong
2025-04-14 10:41:30 +08:00
committed by 刘刚
parent 6a33748f41
commit eb7f7f2362
4 changed files with 30 additions and 2 deletions
+1 -1
View File
@@ -8,12 +8,12 @@ $config->programplan->form->create = array();
$config->programplan->form->create['enabled'] = array('label' => $lang->programplan->enabled, 'type' => 'string', 'control' => array('control' => 'switcher', 'checked' => true), 'options' => $lang->programplan->enabledList);
$config->programplan->form->create['id'] = array('label' => '', 'type' => 'int', 'control' => 'text', 'required' => false, 'default' => 0);
$config->programplan->form->create['order'] = array('label' => '', 'type' => 'int', 'control' => 'text', 'required' => false, 'default' => 0);
$config->programplan->form->create['type'] = array('label' => $lang->execution->method, 'type' => 'string', 'control' => 'picker', 'required' => true, 'default' => 'stage', 'options' => $lang->execution->typeList);
$config->programplan->form->create['name'] = array('label' => $lang->nameAB, 'type' => 'string', 'control' => 'text', 'required' => true, 'default' => '', 'base' => true, 'filter' => 'trim');
$config->programplan->form->create['code'] = array('label' => $lang->code, 'type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim');
$config->programplan->form->create['PM'] = array('label' => $lang->programplan->PMAB, 'type' => 'string', 'control' => 'picker', 'required' => false, 'default' => '', 'options' => '');
if(!empty($config->setPercent)) $config->programplan->form->create['percent'] = array('label' => $lang->programplan->percent, 'type' => 'float', 'control' => 'text', 'required' => false, 'default' => 0);
$config->programplan->form->create['attribute'] = array('label' => $lang->programplan->attribute, 'type' => 'string', 'control' => 'picker', 'required' => false, 'default' => 0, 'options' => $lang->stage->typeList);
$config->programplan->form->create['type'] = array('label' => $lang->execution->method, 'type' => 'string', 'control' => 'picker', 'required' => true, 'default' => 'stage', 'options' => $lang->execution->typeList);
$config->programplan->form->create['point'] = array('label' => $lang->programplan->point, 'type' => 'array', 'control' => 'picker', 'required' => false, 'default' => '', 'options' => array(''), 'multiple' => true);
$config->programplan->form->create['parallel'] = array('label' => '', 'type' => 'int', 'control' => 'hidden', 'required' => false, 'default' => 0);
$config->programplan->form->create['acl'] = array('label' => $lang->programplan->acl, 'type' => 'string', 'control' => 'picker', 'required' => false, 'default' => 'open', 'options' => $lang->execution->aclList);
+26
View File
@@ -83,6 +83,20 @@ window.handleRenderRow = function($row, index, data)
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(typeof data != 'undefined' && typeof data.type != 'undefined' && data.type != 'stage')
{
$row.find('input[data-name="percent"]').prop('disabled', true);
$row.find('[data-name="ACTIONS"]').find('[data-type="addSub"]').addClass('disabled').prop('disabled', true);
}
if(project.model == 'waterfallplus' && level == 0)
{
$row.find('[data-name="type"]').find('.picker-box').on('inited', function(e, info)
{
let $type = info[0];
$type.render({disabled: true});
});
}
if(project.model == 'ipd' && planID == '0' && data)
{
@@ -371,3 +385,15 @@ window.changeAttribute = function(obj)
$tr = $nextTr;
}
};
window.changeType = function(obj)
{
if(project.model != 'waterfallplus') return;
const type = obj.value;
const $target = $(obj);
let $row = $target.closest('tr');
$row.find('input[data-name="percent"]').prop('disabled', type != 'stage');
$row.find('[data-name="ACTIONS"]').find('[data-type="addSub"]').toggleClass('disabled', type != 'stage').prop('disabled', type != 'stage');
};
+1
View File
@@ -318,5 +318,6 @@ formBatchPanel
$app->session->projectPlanList ? set::actions(array('submit', array('text' => $lang->cancel, 'url' => $app->session->projectPlanList))) : null,
on::change('[name^="enabled"]', 'changeEnabled(e.target)'),
on::change('[name^="attribute"]', 'changeAttribute(e.target)'),
on::change('[name^="type"]', 'changeType(e.target)'),
($project->model == 'ipd' && !$planID) ? set::maxRows(count($fnGenerateDefaultData())) : null,
);
+2 -1
View File
@@ -336,7 +336,8 @@ class programplanZen extends programplan
if($field) $visibleFields[$field] = '';
}
if($viewData->project->model == 'ipd' && $viewData->executionType == 'stage' && !$viewData->planID) $createRequiredFields = 'enabled,point,' . trim($createRequiredFields, ',');
if($viewData->project->model == 'waterfallplus' && $viewData->executionType == 'stage') $createRequiredFields = 'type,' . trim($createRequiredFields, ',');
if($viewData->project->model == 'ipd' && $viewData->executionType == 'stage' && !$viewData->planID) $createRequiredFields = 'enabled,point,type' . trim($createRequiredFields, ',');
foreach(explode(',', $createRequiredFields) as $field)
{
if($field)