From 903d492c4e54127e20b8501c9d777d6c7d59d65c Mon Sep 17 00:00:00 2001 From: funadmin <994927909@qq.com> Date: Sat, 8 Jul 2023 10:13:52 +0800 Subject: [PATCH] Update FormHelper.php --- src/helper/FormHelper.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/helper/FormHelper.php b/src/helper/FormHelper.php index 6071f40..03b898a 100644 --- a/src/helper/FormHelper.php +++ b/src/helper/FormHelper.php @@ -1014,16 +1014,12 @@ public function upload($name = 'avatar', $options = [], $value = '') $li = ''; $croper_container = ''; if (isset($options['cropper'])) { - $options['width'] = $options['width'] ?? '300'; - $options['height'] = $options['height'] ?? '300'; - $options['mark'] = $options['mark'] ?? '1'; - $options['area'] = $options['area'] ?? '800px'; $cops = ['name'=>$name, 'path' => $options['path'], - 'width' => $options['width'], - 'height' => $options['height'], - 'mark' => $options['mark'], - 'area' => $options['area'], + 'width' => $options['saveW'] ?? '300', + 'height' => $options['saveW'] ?? '300', + 'mark' => $options['mark'] ?? 1, + 'area' => $options['area'] ?? '800px', 'filter' => 'cropper', ]; $data_value = $this->getOptionsAttr($name,$cops); @@ -1098,17 +1094,19 @@ public function upload($name = 'avatar', $options = [], $value = '') 'chunk' => $options['chunk'] ?? false, ]; $options = array_merge($op, $options); + $label = $this->label($name,$options) ; + $verify = $options['verify']??""; + $options['verify'] = ''; $select_container = ''; if ((isset($options['select']) && $options['select']) || !isset($options['select'])) { - $options['select'] = $options['select'] ?? 'upload-select'; //可选upload-choose + $select_options = $options; + $select_options['filter'] = $options['select'] ?? 'upload-select'; //可选upload-choose $css .= 'width:53%!important;'; $select_container = <<{$this->__('Choose')} + EOF; } - $label = $this->label($name,$options) ; - $verify = $options['verify']??""; - $options['verify'] = ''; + if (!isset($options['filter'])) $options['filter'] = 'upload'; //监听 $str = <<