modified 扩充数据的class支持

This commit is contained in:
zhaoxiang 2016-11-09 23:59:01 +08:00
parent b19f11264a
commit a3ccc69e18
2 changed files with 8 additions and 3 deletions

View File

@ -82,6 +82,7 @@ class Menu extends Base {
'info' => '', 'info' => '',
'href' => url('Menu/add'), 'href' => url('Menu/add'),
'param'=> [$this->primaryKey], 'param'=> [$this->primaryKey],
'class' => 'refresh'
] ]
], ],
'hide' => [ 'hide' => [
@ -133,6 +134,7 @@ class Menu extends Base {
} }
}else{ }else{
$data = \app\admin\model\Menu::where([])->column('name',$this->primaryKey); $data = \app\admin\model\Menu::where([])->column('name',$this->primaryKey);
$defaultFather = $this->request->get($this->primaryKey);
$form = [ $form = [
'tempType' => 'add', 'tempType' => 'add',
'formAttr' => [ 'formAttr' => [
@ -157,7 +159,7 @@ class Menu extends Base {
'info' => '父级菜单:', 'info' => '父级菜单:',
'attr' => [ 'attr' => [
'name' => 'fid', 'name' => 'fid',
'value' => '', 'value' => $defaultFather,
'options' => $data 'options' => $data
] ]
], ],

View File

@ -81,7 +81,7 @@
}else{ }else{
if( tableObj.typeRule[fieldName] ){ if( tableObj.typeRule[fieldName] ){
var rule = tableObj.typeRule[fieldName]; var rule = tableObj.typeRule[fieldName];
var styleList ,detailInfo; var styleList ,detailInfo, classAttr = '';
switch (rule.module){ switch (rule.module){
case 'label': case 'label':
if( rule.rule[dataValue[fieldName]] ){ if( rule.rule[dataValue[fieldName]] ){
@ -96,7 +96,10 @@
styleList = rule.rule; styleList = rule.rule;
detailInfo = prepareInfo( styleList, dataValue, fieldName); detailInfo = prepareInfo( styleList, dataValue, fieldName);
paramStr = prepareParamStr( styleList, dataValue ); paramStr = prepareParamStr( styleList, dataValue );
dataListHtml += '<td><a url="'+styleList['href']+'" data="'+paramStr+'">' + detailInfo + '</a></td>'; if( styleList['class'] ){
classAttr = 'class="'+ styleList['class'] +'"';
}
dataListHtml += '<td><a '+ classAttr +' url="'+styleList['href']+'" data="'+paramStr+'">' + detailInfo + '</a></td>';
break; break;
case 'date': case 'date':
dataListHtml += '<td>' + $.formatDate(dataValue[fieldName]) + '</td>'; dataListHtml += '<td>' + $.formatDate(dataValue[fieldName]) + '</td>';