From 1faa518ad8748dca4d2733f8b7b060e65be566d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com> Date: Wed, 26 Jun 2024 23:05:25 +0800 Subject: [PATCH] =?UTF-8?q?refactor(CRUD):=E7=94=9F=E6=88=90=E7=9A=84?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=BB=84=E4=BB=B6=E4=BB=A3=E7=A0=81=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=20FormItem=20=E5=B1=9E=E6=80=A7=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/crud/Crud.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/admin/controller/crud/Crud.php b/app/admin/controller/crud/Crud.php index 0bcd59b0..8cc38007 100644 --- a/app/admin/controller/crud/Crud.php +++ b/app/admin/controller/crud/Crud.php @@ -765,17 +765,15 @@ class Crud extends Backend // 不同输入框的属性处理 if ($columnDict || in_array($field['designType'], ['radio', 'checkbox', 'select', 'selects'])) { - $formField[':data'] = [ - 'content' => $columnDict, - ]; + $formField[':input-attr']['content'] = $columnDict; } elseif ($field['designType'] == 'textarea') { $formField[':input-attr']['rows'] = (int)($field['form']['rows'] ?? 3); $formField['@keyup.enter.stop'] = ''; $formField['@keyup.ctrl.enter'] = 'baTable.onSubmit(formRef)'; } elseif ($field['designType'] == 'remoteSelect' || $field['designType'] == 'remoteSelects') { - $formField[':input-attr']['pk'] = TableManager::tableName($field['form']['remote-table']) . '.' . ($field['form']['remote-pk'] ?? 'id'); - $formField[':input-attr']['field'] = $field['form']['remote-field'] ?? 'name'; - $formField[':input-attr']['remote-url'] = $this->getRemoteSelectUrl($field); + $formField[':input-attr']['pk'] = TableManager::tableName($field['form']['remote-table']) . '.' . ($field['form']['remote-pk'] ?? 'id'); + $formField[':input-attr']['field'] = $field['form']['remote-field'] ?? 'name'; + $formField[':input-attr']['remoteUrl'] = $this->getRemoteSelectUrl($field); } elseif ($field['designType'] == 'number') { $formField[':input-attr']['step'] = (int)($field['form']['step'] ?? 1); $formField['v-model.number'] = $formField['v-model'];