@@ -37,6 +37,25 @@ protected function grid()
3737 $ grid ->model ()->where ('status ' , 1 );
3838 $ grid ->column ('id ' , __ ('ID ' ))->sortable ();
3939 $ grid ->column ('name ' , '名称 ' );
40+
41+ /*图片懒加载 zoom放大器*/
42+ Admin::script ("_component.imgDelay('.cover',{zoom:true}); " );
43+ $ grid ->column ('cover ' , '封面 ' )->display (function ($ src ) {
44+ return "<div style='width:100px;height:60px'><img data-src=' {$ src }' class='cover img img-thumbnail' style='max-width:100px;height: 100%;' /></div> " ;
45+ });
46+
47+ /*询问框弹窗*/
48+ $ grid ->column ('status ' , '审核状态 ' )->display (function ()use ($ url ) {
49+ $ dialog = (new Dialog (['url ' =>"{$ url }.verify/ {$ this ->mediaId }" ]))
50+ ->info ('确认审核? ' )
51+ ->trigger (".verify- {$ this ->mediaId }" )
52+ ->button ('失 败 ' ,['status ' =>0 ])
53+ ->button ('通 过 ' ,['status ' =>1 ]);
54+ return <<<EOF
55+ <button class='verify- {$ this ->mediaId }' class='btn btn-sm btn-default verify'>审核</button>
56+ <script> {$ dialog }</script>
57+ EOF ;
58+ });
4059 $ grid ->column ('created_at ' , __ ('创建时间 ' ))->sortable ();
4160 $ grid ->column ('updated_at ' , __ ('更新时间 ' ))->sortable ();
4261
@@ -100,7 +119,7 @@ public function edit($id, Content $content)
100119 {
101120 $ content = $ content
102121 ->body ($ this ->form ($ id )->edit ($ id ));
103- /*弹窗模式 渲染form表单模板 Plane::form*/
122+ /*弹窗模式 渲染form表单模板方法 Plane::form*/
104123 return Plane::form ($ content );
105124 }
106125
@@ -154,49 +173,53 @@ public function blank()
154173 /*wing组装器*/
155174 $ W = new Wing ();
156175 $ W ->display ('id ' )->label ('序号 ' );
157- $ W ->section (function ($ W ){
158- $ W ->select ('status0 ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '删除 ' ])->label ('状态0 ' );
159- $ W ->select ('status1 ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '删除 ' ])->direction ('up ' )->useSearch ()->label ('状态1 ' );
160- $ W ->select ('status2 ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '删除 ' ])->direction ('middle ' )->useSearch ()->label ('状态2 ' );
161- },2 );
176+ $ W ->text ('title ' )->label ('标题 ' );
162177 $ W ->textarea ('description ' )->label ('描述 ' );
163- $ W ->select ('status ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '删除 ' ])->limit (1 )->label ('状态 ' );
164- $ W ->datepicker ('time ' )->label ('时间 ' );
178+ $ W ->datepicker ('time ' )->label ('时间选择器 ' );
165179 $ W ->html ('test ' , '<p>松下紗栄子</p> ' )->label ('自定义html ' );
180+ /*section 布局*/
181+ $ W ->section (function ($ W ){
182+ /*下拉菜单 选择器*/
183+ $ W ->select ('status0 ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '暂停 ' ])->limit (1 )->label ('下拉菜单 单选limit:1 ' );
184+ $ W ->select ('status1 ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '暂停 ' ])->direction ('up ' )->useSearch ()->label ('下拉菜单-向上 ' );
185+ $ W ->select ('status2 ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '暂停 ' ])->direction ('middle ' )->useSearch ()->label ('下拉菜单-正中 ' );
186+ },2 );
187+ /*点 选择器*/
188+ $ W ->dot ('dot ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '删除 ' ])->useSearch ()->label ('点选择器 ' );
189+ $ W ->checkbox ('status2 ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '暂停 ' ])->label ('checkbox选择器 ' );
190+ /*多图上传样例*/
191+ $ images = ['/image1... ' , '/image2... ' , '/image3... ' ];
192+ $ W ->fileInput ('photo ' )
193+ ->label ('艳照 ' )
194+ ->settings ([
195+ 'uploadUrl ' => 'https://...upload.file.url... ' ,
196+ 'uploadExtraData ' => [
197+ '_token ' => csrf_token (),
198+ 'uploadAsync ' => true ,
199+ /*自定义加传参*/
200+ ],
201+ 'deleteUrl ' => 'https://...delete.file.url... ' ,
202+ 'deleteExtraData ' => [
203+ '_token ' => csrf_token (),
204+ 'uploadAsync ' => true ,
205+ /*自定义加传参*/
206+ ],
207+ 'maxFileCount ' => 10 ,
208+ 'maxFileSize ' => 800 //单图限制800kb
209+ ])
210+ ->initialPreview (['files ' => $ images , 'url ' => '/image.server... ' ]);
166211
167- $ W ->select ('switch ' ,[0 =>'左 ' ,1 =>'右 ' ])
212+ $ W ->select ('switch ' ,[0 =>'切左 ' ,1 =>'切右 ' ])
168213 ->when (0 ,function (Wing $ W ){
169214 $ W ->display ('left ' )->label ( '左 ' );
170- $ W ->dot ('dot ' , [0 => '开启 ' , 1 => '关闭 ' , 2 => '删除 ' ])->useSearch ()->label ('点组件dot示例 ' );})
171- ->when (1 ,function (Wing $ W ){
215+ })->when (1 ,function (Wing $ W ){
172216 $ W ->display ('right ' )->label ( '右 ' );
173- /*多图上传样例*/
174- $ images = ['/image1... ' , '/image2... ' , '/image3... ' ];
175- $ W ->fileInput ('photo ' )
176- ->label ('艳照 ' )
177- ->settings ([
178- 'uploadUrl ' => 'https://...upload.file.url... ' ,
179- 'uploadExtraData ' => [
180- '_token ' => csrf_token (),
181- 'uploadAsync ' => true ,
182- /*自定义加传参*/
183- ],
184- 'deleteUrl ' => 'https://...delete.file.url... ' ,
185- 'deleteExtraData ' => [
186- '_token ' => csrf_token (),
187- 'uploadAsync ' => true ,
188- /*自定义加传参*/
189- ],
190- 'maxFileCount ' => 10 ,
191- 'maxFileSize ' => 800 //单图限制800kb
192- ])
193- ->initialPreview (['files ' => $ images , 'url ' => '/image.server... ' ]);})
194- ->withoutHiddenInput ()->label ('切换 ' );
195-
217+ })->withoutHiddenInput ()->label ('切换 ' );
218+ /*级联点 选择器*/
196219 $ W ->cascadeDot ('clothes ' ,$ this ->cascadeExampleData ())->limit (3 )->useSearch ()->label ('级联选择器 ' );
197-
220+ /*级联 管理器*/
198221 $ W ->cascadeLine ('clothes_manager ' ,$ data )->label ('级联管理器 ' );
199-
222+
200223 $ W ->linear ('linear ' ,[
201224 'id ' => ['name ' => 'ID ' , 'type ' => 'text ' ],
202225 'title ' => ['name ' => '标题 ' , 'type ' => 'input ' ],
0 commit comments