* Refactor demand: Can create products during distribution.

This commit is contained in:
hufangzhou
2024-05-20 14:35:51 +08:00
parent a183d6ff6b
commit 7b6fd45cbf
2 changed files with 12 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
.productBox {position: relative; padding-top: 5px;}
.productBox .linkProduct, .productsBox .addProductBox .form-group{padding-left: 0px;}
.productBox .distributeProduct, .productsBox .addProductBox .form-group{padding-left: 0px;}
.productBox .roadmapBox{padding-right: 0px;}
.productBox .c-actions {position: absolute; width: 100px; right: -100px;}
.productBox .c-actions.first-action {bottom: calc(calc(100% - 64px) / 2);}
+11 -4
View File
@@ -32,7 +32,6 @@ class productRoadmapBox extends wg
setClass('productsBox'),
on::click('.productsBox .addLine', 'window.addNewLine'),
on::click('.productsBox .removeLine', 'window.removeLine'),
//on::change('.productsBox [name^=product]', 'window.loadBranches'),
$productsBox
);
}
@@ -56,14 +55,16 @@ class productRoadmapBox extends wg
formGroup
(
set::width('1/2'),
setClass('linkProduct'),
setClass('distributeProduct'),
set::required(true),
$index == 0 ? set::label($lang->demand->distributeProduct) : null,
count($products) ? null : set::checkbox(array('text' => $lang->demand->addProduct, 'name' => 'addProduct', 'checked' => false)),
on::change('[name=addProduct]', 'addProduct'),
inputGroup
(
div
(
setClass('grow'),
setClass('grow linkProduct'),
picker
(
set::name("product[$index]"),
@@ -72,6 +73,12 @@ class productRoadmapBox extends wg
set::last($productID),
on::change('loadProductBranches(e.target)'),
$hasBranch ? set::lastBranch($branches ? 0 : implode(',', $branches)) : null,
),
input
(
setClass('hidden'),
set::disabled(true),
set::name("productName")
)
),
div
@@ -114,7 +121,7 @@ class productRoadmapBox extends wg
),
div
(
setClass('ml-px addRoadmap btn btn-default' . (count($roadmaps) ? ' hidden' : '')),
setClass('ml-px addRoadmap btn btn-default' . ((count($roadmaps) || empty($products)) ? ' hidden' : '')),
checkbox
(
set::name("addRoadmap[$index]"),