diff --git a/app/AdminAgent/Forms/IndustryProductBuy.php b/app/AdminAgent/Forms/IndustryProductBuy.php index b1d9257..0defa0d 100644 --- a/app/AdminAgent/Forms/IndustryProductBuy.php +++ b/app/AdminAgent/Forms/IndustryProductBuy.php @@ -185,13 +185,15 @@ class IndustryProductBuy extends Form $this->{$v['type']}('info.' . $v['field'])->options(array_combine($v['options'], $v['options']))->required((bool)$v['required']); } else if ($v['type'] == 'image') { $this->multipleImage('info.' . $v['field'])->uniqueName()->saveFullUrl()->required((bool)$v['required']); + } else if ($v['type'] == 'datetime') { + $this->datetime('info.' . $v['field'])->format($v['format'] ?? 'YYYY-MM-DD HH:mm')->required((bool)$v['required']); } else { $this->{$v['type']}('info.' . $v['field'])->required((bool)$v['required']); } } } - $this->html(Alert::make(null, '产品信息')->info())->width(12); + $this->html(Alert::make(null, '产品信息确认')->info())->width(12); $this->text('', '购买产品')->default($industry->title)->disable(); $this->text('', '单价')->default($industry->price)->disable(); $this->text('', '库存')->default($industry->stock)->disable(); diff --git a/app/AdminSupplier/Controllers/DiyFormController.php b/app/AdminSupplier/Controllers/DiyFormController.php index 4502d45..782a7d6 100644 --- a/app/AdminSupplier/Controllers/DiyFormController.php +++ b/app/AdminSupplier/Controllers/DiyFormController.php @@ -100,6 +100,11 @@ class DiyFormController extends AdminController ->options(admin_trans('diy-form.options')) ->when(['radio', 'checkbox'], function (Form\NestedForm $form) { $form->list('options', '选项列表'); + }) + ->when('datetime', function (Form\NestedForm $form) { + $form->text('format', '格式') + ->default('YYYY-MM-DD HH:mm') + ->help('默认格式:YYYY-MM-DD HH:mm。YYYY:年,MM:月,DD:日,HH:时,mm:分'); }); $form->number('sort', '排序') ->help('数字越小越靠前') diff --git a/resources/lang/zh_CN/diy-form.php b/resources/lang/zh_CN/diy-form.php index 66c0687..7b5443f 100644 --- a/resources/lang/zh_CN/diy-form.php +++ b/resources/lang/zh_CN/diy-form.php @@ -17,5 +17,6 @@ return [ 'radio' => '单选框', 'checkbox' => '多选框', 'image' => '图片上传', + 'datetime' => '日期时间', ], ];