From a3ccc69e18ef298cb1f0b083709481ca276d1371 Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Wed, 9 Nov 2016 23:59:01 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E6=89=A9=E5=85=85=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84class=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Menu.php | 4 +++- public/admin/static/js/template/table.js | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/application/admin/controller/Menu.php b/application/admin/controller/Menu.php index 162c0d1..0345cec 100644 --- a/application/admin/controller/Menu.php +++ b/application/admin/controller/Menu.php @@ -82,6 +82,7 @@ class Menu extends Base { 'info' => '', 'href' => url('Menu/add'), 'param'=> [$this->primaryKey], + 'class' => 'refresh' ] ], 'hide' => [ @@ -133,6 +134,7 @@ class Menu extends Base { } }else{ $data = \app\admin\model\Menu::where([])->column('name',$this->primaryKey); + $defaultFather = $this->request->get($this->primaryKey); $form = [ 'tempType' => 'add', 'formAttr' => [ @@ -157,7 +159,7 @@ class Menu extends Base { 'info' => '父级菜单:', 'attr' => [ 'name' => 'fid', - 'value' => '', + 'value' => $defaultFather, 'options' => $data ] ], diff --git a/public/admin/static/js/template/table.js b/public/admin/static/js/template/table.js index f4e349d..478e956 100644 --- a/public/admin/static/js/template/table.js +++ b/public/admin/static/js/template/table.js @@ -81,7 +81,7 @@ }else{ if( tableObj.typeRule[fieldName] ){ var rule = tableObj.typeRule[fieldName]; - var styleList ,detailInfo; + var styleList ,detailInfo, classAttr = ''; switch (rule.module){ case 'label': if( rule.rule[dataValue[fieldName]] ){ @@ -96,7 +96,10 @@ styleList = rule.rule; detailInfo = prepareInfo( styleList, dataValue, fieldName); paramStr = prepareParamStr( styleList, dataValue ); - dataListHtml += '' + detailInfo + ''; + if( styleList['class'] ){ + classAttr = 'class="'+ styleList['class'] +'"'; + } + dataListHtml += '' + detailInfo + ''; break; case 'date': dataListHtml += '' + $.formatDate(dataValue[fieldName]) + '';