From 68fee5803f5ace8e930ccf5e650708bfcd1b0d70 Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Wed, 9 Nov 2016 15:16:16 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E4=BF=AE=E5=A4=8D=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E7=9A=84bug=EF=BC=8C=E4=BC=98=E5=8C=96table?= =?UTF-8?q?=E7=9A=84=E7=94=9F=E6=88=90=EF=BC=8C=E4=BC=98=E5=8C=96refresh?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Base.php | 2 +- application/admin/controller/Menu.php | 111 +++- application/admin/view/public/base.html | 9 +- public/admin/static/js/template.js | 146 +++--- public/admin/static/js/template/table.js | 2 + .../{fastclick => fastClick}/fastclick.js | 0 .../{fastclick => fastClick}/fastclick.min.js | 0 .../plugin/slimScroll/jquery.slimscroll.js | 474 ++++++++++++++++++ .../slimScroll/jquery.slimscroll.min.js | 16 + 9 files changed, 683 insertions(+), 77 deletions(-) rename public/admin/static/plugin/{fastclick => fastClick}/fastclick.js (100%) rename public/admin/static/plugin/{fastclick => fastClick}/fastclick.min.js (100%) create mode 100644 public/admin/static/plugin/slimScroll/jquery.slimscroll.js create mode 100644 public/admin/static/plugin/slimScroll/jquery.slimscroll.min.js diff --git a/application/admin/controller/Base.php b/application/admin/controller/Base.php index de47b64..e993653 100644 --- a/application/admin/controller/Base.php +++ b/application/admin/controller/Base.php @@ -66,7 +66,7 @@ class Base extends Controller { if( $sidOld != $sidNow ){ $this->error("您的账号在别的地方登录了,请重新登录!", url('User/login')); }else{ -// cache($this->uid, $sidNow, config('online_time')); + cache($this->uid, $sidNow, config('online_time')); // $this->userInfo = User::get([ $this->primaryKey => $this->uid ]); // if( $this->userInfo['updateTime'] === 0 ){ // $this->error('初次登录请重置用户密码!', url('User/changePassWord')); diff --git a/application/admin/controller/Menu.php b/application/admin/controller/Menu.php index 947b059..13f66cf 100644 --- a/application/admin/controller/Menu.php +++ b/application/admin/controller/Menu.php @@ -115,14 +115,111 @@ class Menu extends Base { } public function add(){ - $form = [ - 'formAttr' => [ - 'action' => '', - 'id' => '', + if( $this->request->isPost() ){ - ], - ]; - $this->result($form, ReturnCode::GET_TEMPLATE_SUCCESS); + }else{ + $form = [ + 'tempType' => 'add', + 'formAttr' => [ + 'target' => '', + 'formId' => '', + 'backUrl' => '', + ], + 'formList' => [ + [ + 'module' => 'text', + 'description' => '', + 'info' => '菜单名称:', + 'attr' => [ + 'name' => 'name', + 'value' => '', + 'placeholder' => '' + ] + ], + [ + 'module' => 'select', + 'description' => '', + 'info' => '父级菜单:', + 'attr' => [ + 'name' => 'fid', + 'value' => '', + 'options' => [] + ] + ], + [ + 'module' => 'select', + 'description' => '', + 'info' => '菜单等级:', + 'attr' => [ + 'name' => 'level', + 'value' => '', + 'options' => [] + ] + ], + [ + 'module' => 'radio', + 'description' => '', + 'info' => '菜单类型:', + 'attr' => [ + 'name' => 'type', + 'value' => '', + 'options' => [] + ] + ], + [ + 'module' => 'radio', + 'description' => '', + 'info' => '是否显示:「该配置只对模块类功能生效」', + 'attr' => [ + 'name' => 'hide', + 'value' => '', + 'options' => [] + ] + ], + [ + 'module' => 'radio', + 'description' => '', + 'info' => '是否推荐:「该配置只对模块类功能生效」', + 'attr' => [ + 'name' => 'recommend', + 'value' => '', + 'options' => [] + ] + ], + [ + 'module' => 'text', + 'description' => '', + 'info' => '菜单图标:「该配置只对模块类功能生效」', + 'attr' => [ + 'name' => 'icon', + 'value' => '', + 'placeholder' => '' + ] + ], + [ + 'module' => 'text', + 'description' => '', + 'info' => '菜单URL:「该配置只对无模块类功能子菜单的菜单生效」[具体格式为:控制器/方法名]', + 'attr' => [ + 'name' => 'url', + 'value' => '', + 'placeholder' => '' + ] + ], + [ + 'module' => 'text', + 'description' => '', + 'info' => '排序:「数字越小顺序越靠前」', + 'attr' => [ + 'name' => 'order', + 'value' => '', + 'placeholder' => '' + ] + ] + ] + ]; + $this->result($form, ReturnCode::GET_TEMPLATE_SUCCESS); + } } public function edit(){ diff --git a/application/admin/view/public/base.html b/application/admin/view/public/base.html index 8a36048..09d30f8 100644 --- a/application/admin/view/public/base.html +++ b/application/admin/view/public/base.html @@ -331,7 +331,7 @@