widget/Container.php
public static function perfect(Field $field, Form $form, $index = '@@index@@')
    {
        $fields = $form->getFields();
        foreach ($fields as $name => $child) {
            if ($field->dataValDisabled) {
                $child->dataValDisabled = true;
            }
            //当个
            if ($field->mode == 'single') {
                $child->boxId = $field->boxId . '_' . $child->boxId;
                $child->boxName = $field->boxName . '[' . $child->boxName . ']';
                //如果存在拆分的时候
                if ($child->names && is_array($child->names)) {
                    $names = $child->names;
                    foreach ($names as $nKey => $nItem) {
                        if (is_array($nItem) && $nItem['field']) {
                            $nItem['field'] = $field->boxName . '[' . $nItem['field'] . ']';
                        } elseif (is_string($nItem)) {
                            $nItem = $field->boxName . '[' . $nItem . ']';
                        }
                        $names[$nKey] = $nItem;
                    }
                    $child->names = $names;
                }
                //修正动态数据
                if (!empty($child->dynamic)) {
                    $form->createDynamic($child);
                    $dataDynamic = $child->dataDynamic;
                    foreach ($dataDynamic as &$item) {
                        foreach (['show', 'hide', 'off', 'on'] as $key) {
                            if (isset($item[$key])) {
                                if (is_string($item[$key])) {
                                    $item[$key] = explode(',', $item[$key]);
                                }
                                if (is_array($item[$key])) {
                                    foreach ($item[$key] as $idx => $xit) {
                                        $item[$key][$idx] = $field->boxId . '_' . $xit;
                                    }
                                }
                            }
                        }
                    }
                    $child->dataDynamic = $dataDynamic;
                }

            } //多组
            else if ($field->mode == 'multiple') {
                $child->boxId = $field->boxId . '_' . $index . '_' . $child->boxId;
                $child->boxName = $field->boxName . '[' . $index . '][' . $child->boxName . ']';
                //如果存在拆分的时候
                if ($child->names && is_array($child->names)) {
                    $names = $child->names;
                    foreach ($names as $nKey => $nItem) {
                        if (is_array($nItem) && $nItem['field']) {
                            $nItem['field'] = $field->boxName . '[' . $index . '][' . $nItem['field'] . ']';
                        } elseif (is_string($nItem)) {
                            $nItem = $field->boxName . '[' . $index . '][' . $nItem . ']';
                        }
                        $names[$nKey] = $nItem;
                    }
                    $child->names = $names;
                }
                if (!empty($child->dynamic)) {
                    $form->createDynamic($child);
                    $dataDynamic = $child->dataDynamic;
                    foreach ($dataDynamic as &$item) {
                        foreach (['show', 'hide', 'off', 'on'] as $key) {
                            if (isset($item[$key])) {
                                if (is_string($item[$key])) {
                                    $item[$key] = explode(',', $item[$key]);
                                }
                                if (is_array($item[$key])) {
                                    foreach ($item[$key] as $idx => $xit) {
                                        $item[$key][$idx] = $field->boxId . '_' . $index . '_' . $xit;
                                    }
                                }
                            }
                        }
                    }
                    $child->dataDynamic = $dataDynamic;
                }
            }
            $child->dataValOutput = '#' . $field->boxId . '-validation';
        }
    }
public static function perfect(Field $field, Form $form, $index = '@@index@@')
    {
        $fields = $form->getFields();
        foreach ($fields as $name => $child) {
            if ($field->dataValDisabled) {
                $child->dataValDisabled = true;
            }
            //当个
            if ($field->mode == 'single') {
                $child->boxId = $field->boxId . '_' . $child->boxId;
                $child->boxName = $field->boxName . '[' . $child->boxName . ']';
                //如果存在拆分的时候
                if ($child->names && is_array($child->names)) {
                    $names = $child->names;
                    foreach ($names as $nKey => $nItem) {
                        if (is_array($nItem) && $nItem['field']) {
                            $nItem['field'] = $field->boxName . '[' . $nItem['field'] . ']';
                        } elseif (is_string($nItem)) {
                            $nItem = $field->boxName . '[' . $nItem . ']';
                        }
                        $names[$nKey] = $nItem;
                    }
                    $child->names = $names;
                }
                //修正动态数据
                if (!empty($child->dynamic)) {
                    $form->createDynamic($child);
                    $dataDynamic = $child->dataDynamic;
                    foreach ($dataDynamic as &$item) {
                        foreach (['show', 'hide', 'off', 'on'] as $key) {
                            if (isset($item[$key])) {
                                if (is_string($item[$key])) {
                                    $item[$key] = explode(',', $item[$key]);
                                }
                                if (is_array($item[$key])) {
                                    foreach ($item[$key] as $idx => $xit) {
                                        $item[$key][$idx] = $field->boxId . '_' . $xit;
                                    }
                                }
                            }
                        }
                    }
                    $child->dataDynamic = $dataDynamic;
                }

            } //多组
            else if ($field->mode == 'multiple') {
                $child->boxId = $field->boxId . '_' . $index . '_' . $child->boxId;
                $child->boxName = $field->boxName . '[' . $index . '][' . $child->boxName . ']';
                //如果存在拆分的时候
                if ($child->names && is_array($child->names)) {
                    $names = $child->names;
                    foreach ($names as $nKey => $nItem) {
                        if (is_array($nItem) && $nItem['field']) {
                            $nItem['field'] = $field->boxName . '[' . $index . '][' . $nItem['field'] . ']';
                        } elseif (is_string($nItem)) {
                            $nItem = $field->boxName . '[' . $index . '][' . $nItem . ']';
                        }
                        $names[$nKey] = $nItem;
                    }
                    $child->names = $names;
                }
                if (!empty($child->dynamic)) {
                    $form->createDynamic($child);
                    $dataDynamic = $child->dataDynamic;
                    foreach ($dataDynamic as &$item) {
                        foreach (['show', 'hide', 'off', 'on'] as $key) {
                            if (isset($item[$key])) {
                                if (is_string($item[$key])) {
                                    $item[$key] = explode(',', $item[$key]);
                                }
                                if (is_array($item[$key])) {
                                    foreach ($item[$key] as $idx => $xit) {
                                        $item[$key][$idx] = $field->boxId . '_' . $index . '_' . $xit;
                                    }
                                }
                            }
                        }
                    }
                    $child->dataDynamic = $dataDynamic;
                }
            }
            $child->dataValOutput = '#' . $field->boxId . '-validation';
        }
    }
完善字段信息
@param Field $field
@param Form $form
@param string $index