* [refac bug #56645] Add required tag for flow child data.

This commit is contained in:
wangyidong
2024-11-01 14:30:59 +08:00
committed by 谢杞钰
parent ba178991ca
commit 440c070f1c
+3 -2
View File
@@ -37,13 +37,14 @@ class flowSubTable extends wg
$field = (object)$field;
if(!$field->show) continue;
$items[] = [
$required = ($notEmptyRule && (strpos(",{$field->layoutRules},", ",{$notEmptyRule->id},") !== false) || strpos(",{$field->rules},", ",{$notEmptyRule->id},") !== false) || !empty($field->required);
$items[] = [
'name' => "children[sub_{$module}][{$field->field}]", // 子表的字段可以重名,所以需要加上 module
'label' => $field->name,
'control' => $common->flow->buildFormControl($field, 'batch'),
'items' => array_filter($field->options),
'width' => $field->width == 'auto' ? '160px' : $field->width,
'required' => $notEmptyRule && strpos(",{$field->layoutRules},", ",{$notEmptyRule->id},") !== false,
'required' => $required,
'ditto' => in_array($field->control, $dittoControl),
'defaultDitto' => $dataList ? 'off' : 'on'
];