修改关联字段编辑没有生成组件;

This commit is contained in:
2022-07-09 16:08:15 +08:00
parent 69ac76a108
commit 6a7e45bd8e

View File

@@ -1264,6 +1264,8 @@ class BuildCurdService
} elseif (in_array($field, ['remark']) || $val['formType'] == 'textarea') {
$templateFile = "view{$this->DS}module{$this->DS}textarea";
} elseif ($val['formType'] == 'relation') {
// 使用select生成
$templateFile = "view{$this->DS}module{$this->DS}select";
if (isset($val['bindRelation'])) {
@@ -1353,6 +1355,16 @@ class BuildCurdService
} elseif (in_array($field, ['remark']) || $val['formType'] == 'textarea') {
$templateFile = "view{$this->DS}module{$this->DS}textarea";
$value = '{$row.' . $field . '|raw|default=\'\'}';
} elseif ($val['formType'] == 'relation') {
// 使用select生成
$templateFile = "view{$this->DS}module{$this->DS}select";
if (isset($val['bindRelation'])) {
$define = $this->buildOptionView($val['bindRelation'], '{in name="k" value="$row.' . $field . '"}selected=""{/in}');
} elseif (isset($val['define']) && !empty($val['define'])) {
$define = $this->buildOptionView($field, '{in name="k" value="$row.' . $field . '"}selected=""{/in}');
}
} elseif ($val['formType'] == 'table') {
$templateFile = "view{$this->DS}module{$this->DS}table";
$define = $this->buildTableView($field, $val, $value);