mirror of https://gitee.com/karson/fastadmin.git
优化插件配置分组
parent
8b55020b3a
commit
2401cd3ba1
|
|
@ -8,12 +8,16 @@ return [
|
||||||
'title' => '用户名',
|
'title' => '用户名',
|
||||||
//类型
|
//类型
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
|
//分组
|
||||||
|
'group' => '',
|
||||||
|
//动态显示
|
||||||
|
'visible' => '',
|
||||||
//数据字典
|
//数据字典
|
||||||
'content' => [
|
'content' => [
|
||||||
],
|
],
|
||||||
//值
|
//值
|
||||||
'value' => '',
|
'value' => '',
|
||||||
//验证规则
|
//验证规则
|
||||||
'rule' => 'required',
|
'rule' => 'required',
|
||||||
//错误消息
|
//错误消息
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,13 @@ class Addon extends Backend
|
||||||
$tips = [];
|
$tips = [];
|
||||||
$groupList = [];
|
$groupList = [];
|
||||||
foreach ($config as $index => &$item) {
|
foreach ($config as $index => &$item) {
|
||||||
|
//如果有设置分组
|
||||||
|
if (isset($item['group']) && $item['group']) {
|
||||||
|
if (!in_array($item['group'], $groupList)) {
|
||||||
|
$groupList["custom" . (count($groupList) + 1)] = $item['group'];
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($item['name'] == '__tips__') {
|
if ($item['name'] == '__tips__') {
|
||||||
$groupList = $item['content'] ? $item['content'] : [];
|
|
||||||
$tips = $item;
|
$tips = $item;
|
||||||
unset($config[$index]);
|
unset($config[$index]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="panel panel-default panel-intro">
|
<div class="panel panel-default panel-intro">
|
||||||
{if $groupList}
|
{if count($groupList)>1}
|
||||||
<div class="panel-heading">
|
<div class="panel-heading mb-3">
|
||||||
<ul class="nav nav-tabs nav-group">
|
<ul class="nav nav-tabs nav-group">
|
||||||
<li class="active"><a href="#all" data-toggle="tab">全部</a></li>
|
<li class="active"><a href="#all" data-toggle="tab">全部</a></li>
|
||||||
{foreach name="groupList" id="tab"}
|
{foreach name="groupList" id="tab"}
|
||||||
|
|
@ -20,15 +20,15 @@
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="panel-body {if !$groupList}no-padding{/if}">
|
<div class="panel-body no-padding">
|
||||||
<div id="myTabContent" class="tab-content">
|
<div id="myTabContent" class="tab-content">
|
||||||
{foreach name="groupList" id="group" key="groupName"}
|
{foreach name="groupList" id="group" key="groupName"}
|
||||||
<div class="tab-pane fade active in" id="tab-{$groupName}">
|
<div class="tab-pane fade active in" id="tab-{$groupName}">
|
||||||
|
|
||||||
<table class="table table-striped table-config">
|
<table class="table table-striped table-config mb-0">
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach name="$addon.config" id="item"}
|
{foreach name="$addon.config" id="item"}
|
||||||
{if ((!isset($item['group']) || $item['group']=='') && $groupName=='other') || (isset($item['group']) && $item['group']==$groupName)}
|
{if ((!isset($item['group']) || $item['group']=='') && $groupName=='other') || (isset($item['group']) && $item['group']==$group)}
|
||||||
<tr data-favisible="{$item.visible|default=''|htmlentities}" data-name="{$item.name}" class="{if $item.visible??''}hidden{/if}">
|
<tr data-favisible="{$item.visible|default=''|htmlentities}" data-name="{$item.name}" class="{if $item.visible??''}hidden{/if}">
|
||||||
<td width="15%">{$item.title}</td>
|
<td width="15%">{$item.title}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue