diff --git a/lib/zin/wg/productsbox/js/v1.js b/lib/zin/wg/productsbox/js/v1.js index 0544e608bc..84e1ca2724 100644 --- a/lib/zin/wg/productsbox/js/v1.js +++ b/lib/zin/wg/productsbox/js/v1.js @@ -241,13 +241,16 @@ window.updateItems = function() productItems[allItems[i].value].i = i; } - $(".productsBox [name^='products']").each(function() + if($('.productsBox .linkProduct').length > 0) { - const $product = $(this).zui('picker'); - const productID = $(this).val(); - let currentProductItems = JSON.parse(JSON.stringify(allItems)); - if(productID != 0) currentProductItems[productItems[productID].i].disabled = false; + $(".productsBox [name^='products']").each(function() + { + const $product = $(this).zui('picker'); + const productID = $(this).val(); + let currentProductItems = JSON.parse(JSON.stringify(allItems)); + if(productID != 0) currentProductItems[productItems[productID].i].disabled = false; - $product.render({items: currentProductItems}); - }); + $product.render({items: currentProductItems}); + }); + } } diff --git a/lib/zin/wg/productsbox/v1.php b/lib/zin/wg/productsbox/v1.php index 55de643092..1946dee40f 100644 --- a/lib/zin/wg/productsbox/v1.php +++ b/lib/zin/wg/productsbox/v1.php @@ -19,7 +19,7 @@ class productsBox extends wg 'linkedProducts?: array', // 关联的产品。 'linkedBranches?: array', // 关联的分支。 'currentProduct?: int=0', // 来源产品ID。 - 'currentPlan?: int=0', // 来源计划。 + 'currentPlan?: array|int=0', // 来源计划。 'currentRoadmap?: int=0', // 来源路标。 'productPlans?: array=array()', // 同来源计划所属产品的计划列表。 'project?: object', // 关联的项目。 @@ -187,12 +187,10 @@ class productsBox extends wg set::className('productBox noProductBox'), formGroup ( - set::width('1/2'), set::label($lang->execution->linkPlan), set::className('planBox'), picker ( - set::className('pr-2.5'), set::name("plans[{$planProductID}][]"), set::items(!empty($productPlans) ? $productPlans : array()), set::value($currentPlan), diff --git a/module/execution/control.php b/module/execution/control.php index bba635d556..07fc3abb8e 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1276,6 +1276,12 @@ class execution extends control unset($parentStageList[0]); } + if(empty($project->hasProduct)) + { + $linkedProduct = current($linkedObjects->linkedProducts); + $linkedPlans = !empty($linkedProduct->plans) ? array_values($linkedProduct->plans) : array(); + } + $this->view->title = $this->lang->execution->edit . $this->lang->hyphen . $execution->name; $this->view->executions = $executions; $this->view->execution = $execution; @@ -1296,7 +1302,7 @@ class execution extends control $this->view->unmodifiableBranches = $linkedObjects->unmodifiableBranches; $this->view->productPlans = $linkedObjects->productPlans; $this->view->productPlan = $linkedObjects->productPlan; - $this->view->currentPlan = $linkedObjects->currentPlan; + $this->view->currentPlan = empty($project->hasProduct) ? $linkedPlans : $linkedObjects->currentPlan; $this->view->branchGroups = $this->execution->getBranchByProduct(array_keys($linkedObjects->linkedProducts), $execution->project, 'noclosed', $linkedObjects->linkedBranchList); $this->view->teamMembers = $this->execution->getTeamMembers($executionID); $this->view->allProjects = $this->project->getPairsByModel($project->model, 'noclosed|multiple', $project->id); diff --git a/module/execution/css/create.ui.css b/module/execution/css/create.ui.css index 57f695aef0..517776751b 100644 --- a/module/execution/css/create.ui.css +++ b/module/execution/css/create.ui.css @@ -8,3 +8,5 @@ #copyExecutions .btn.primary-outline:after {position: absolute; content: '\e92f'; font-family: ZentaoIcon; font-size: 20px; right: 10px;} #copyExecutions .btn.primary-outline span{color: rgba(var(--color-fore-rgb),var(--tw-text-opacity));} #copyExecutions .execution-block span {width: calc(100% - 45px); overflow: hidden;} + +#form-execution-create [data-name='dateRange'] > .input-group {display: block;} diff --git a/module/execution/css/edit.ui.css b/module/execution/css/edit.ui.css index d19ff7b5c8..0939330a97 100644 --- a/module/execution/css/edit.ui.css +++ b/module/execution/css/edit.ui.css @@ -1,3 +1,5 @@ .editPanel {max-width: 1200px !important;} .items-center {align-items: center !important;} #lifeTimeTips {padding-left: 1rem; align-items: center;} + +.form [data-name='planDate'] > .input-group {display: block;} diff --git a/module/execution/ui/create.field.php b/module/execution/ui/create.field.php index 7420ee3217..8feb53c8a8 100644 --- a/module/execution/ui/create.field.php +++ b/module/execution/ui/create.field.php @@ -102,7 +102,7 @@ $fields->field('percent') $fields->field('productsBox') ->id('productsBox') - ->width('full') + ->width(!empty($project->hasProduct) ? 'full' : '1/2') ->control(array ( 'control' => 'productsBox', diff --git a/module/execution/ui/edit.field.php b/module/execution/ui/edit.field.php index f0da9e4d5c..b1ce336f5a 100644 --- a/module/execution/ui/edit.field.php +++ b/module/execution/ui/edit.field.php @@ -12,7 +12,6 @@ $linkedPlans = data('product.plans'); $linkedProducts = data('linkedProducts'); $branchGroups = data('branchGroups'); $productPlans = data('productPlans'); -$hidden = empty($project->hasProduct) ? 'hidden' : ''; if($project) { @@ -143,8 +142,7 @@ if($hasPercent && $project && $project->model != 'ipd') $fields->field('productsBox') ->id('productsBox') - ->width('full') - ->className($hidden) + ->width(!empty($project->hasProduct) ? 'full' : '1/2') ->control(array( 'control' => 'productsBox', 'productItems' => data('allProducts'), @@ -225,4 +223,4 @@ $fields->field('acl') 'userValue' => data('execution.whitelist') )); -if($project->model == 'ipd') $fields->field('attribute')->hidden(); \ No newline at end of file +if($project->model == 'ipd') $fields->field('attribute')->hidden();