fix: 修复tags标签,getTableFieldsBUG
This commit is contained in:
@@ -65,13 +65,6 @@ class AdminController extends BaseController
|
||||
*/
|
||||
public $status = false;
|
||||
|
||||
/**
|
||||
* 管理员信息
|
||||
* @var array
|
||||
*/
|
||||
//public $admin = [];使用以下替代
|
||||
//request()->adminInfo['id']
|
||||
|
||||
/**
|
||||
* 获取模板
|
||||
* @access protected
|
||||
@@ -156,8 +149,8 @@ class AdminController extends BaseController
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$page = (int)input('page') ?? 1;
|
||||
$limit = (int)input('limit') ?? 18;
|
||||
$page = (int)input('page', 1);
|
||||
$limit = (int)input('limit',18);
|
||||
$where = $this->buildSelectParams();
|
||||
$count = $this->model->where($where)->count();
|
||||
$limit = is_empty($limit) ? 10 : $limit;
|
||||
|
||||
@@ -246,8 +246,8 @@ class BaseController
|
||||
*/
|
||||
protected function getTableFields($model = null)
|
||||
{
|
||||
$this->model = $model ?: $this->model;
|
||||
$tableFields = $this->model->getTableFields();
|
||||
$model = $model ?: $this->model;
|
||||
$tableFields = $model->getTableFields();
|
||||
if (!empty($tableFields) && is_array($tableFields)) {
|
||||
foreach ($tableFields as $key => $value) {
|
||||
$filter = ['update_time', 'create_time', 'delete_time'];
|
||||
|
||||
@@ -293,24 +293,17 @@ class Auth
|
||||
}
|
||||
} else {
|
||||
|
||||
if (!Event::hasListener('cmscategoryPermissions')) {
|
||||
throw new \Exception('请安装CMS插件');
|
||||
} else {
|
||||
|
||||
if (!$this->superAdmin()) {
|
||||
if (!empty($auth_nodes[$class])) {
|
||||
$list = Event::emit('cmscategoryPermissions', [
|
||||
'field' => $this->authFields,
|
||||
'nodes' => $auth_nodes[$class]
|
||||
], true);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($list)) {
|
||||
if (!$this->superAdmin()) {
|
||||
if (!empty($auth_nodes[$class])) {
|
||||
$list = Event::emit('cmscategoryPermissions', [
|
||||
'field' => $this->authFields
|
||||
'field' => $this->authFields,
|
||||
'nodes' => $auth_nodes[$class]
|
||||
], true);
|
||||
}
|
||||
} else {
|
||||
$list = Event::emit('cmscategoryPermissions', [
|
||||
'field' => $this->authFields
|
||||
], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--// 加载Markdown编辑器-->
|
||||
<link href="/static/js/markdown/cherry-markdown.css?v={:release()}" rel="stylesheet" type="text/css"/>
|
||||
<script src="/static/js/markdown/cherry-markdown.min.js?v={:release()}"></script>
|
||||
<script src="/static/js/markdown/cherry-markdown.core.js?v={:release()}"></script>
|
||||
|
||||
<!-- // 全局加载第三方JS -->
|
||||
<script src="/static/js/tinymce/tinymce.min.js?v={:release()}"></script>
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
<include file="/public/header" />
|
||||
<style>
|
||||
.layui-form-select dl{
|
||||
top: auto;
|
||||
bottom: 36px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
<!-- // 默认操作按钮 -->
|
||||
@@ -40,7 +33,7 @@
|
||||
<!-- // 默认搜索 -->
|
||||
<button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit><i class="layui-icon layui-icon-search"></i>{:__('搜索')}</button>
|
||||
<!-- // 打开添加页面 -->
|
||||
<button class="layui-btn icon-btn" lay-open="" data-title="{:__('添加')}{:__('会员')}" data-area="500px" data-url="#editforms" >
|
||||
<button class="layui-btn icon-btn" lay-open="" data-title="{:__('添加')}{:__('会员')}" data-url="#editforms" >
|
||||
<i class="layui-icon layui-icon-add-1"></i>{:__('添加')}
|
||||
</button>
|
||||
</div>
|
||||
@@ -54,7 +47,7 @@
|
||||
</div>
|
||||
|
||||
<!-- // 添加编辑数据 -->
|
||||
<script type="text/html" id="editforms" >
|
||||
<script type="text/html" id="editforms" >
|
||||
<div class="layui-fluid layui-bg-white" >
|
||||
<form class="layui-form layui-form-fixed" lay-filter="editforms" >
|
||||
<input type="text" name="id" hidden="">
|
||||
@@ -111,7 +104,7 @@
|
||||
|
||||
<!-- // 列表工具栏 -->
|
||||
<script type="text/html" id="tableBar">
|
||||
<a class="layui-table-text" data-title="{:__('编辑会员')}" data-area="500px" data-url="#editforms" lay-event="edit">{:__('编辑')}</a>
|
||||
<a class="layui-table-text" data-title="{:__('编辑会员')}" data-url="#editforms" lay-event="edit">{:__('编辑')}</a>
|
||||
<div class="layui-divider layui-divider-vertical"></div>
|
||||
<a class="layui-table-text" data-url="{:url('/system/User/del')}?id={{d.id}}" lay-event="del">{:__('删除')}</a>
|
||||
</script>
|
||||
|
||||
@@ -39,13 +39,10 @@ class Dictionary extends Model
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public static function getValueList(string $value = ''): array
|
||||
public static function getValueList(string $value = '')
|
||||
{
|
||||
$list = [];
|
||||
$data = self::where([
|
||||
'pid' => 0,
|
||||
'value' => $value
|
||||
])->find();
|
||||
$data = self::where(['pid' => 0,'value' => $value])->find();
|
||||
if (!empty($data)) {
|
||||
$list = self::where('pid', $data['id'])->select();
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ if (!function_exists('release')) {
|
||||
*/
|
||||
function release()
|
||||
{
|
||||
return getenv('APP_DEBUG') ? \system\Random::alphaNum() : config('app.version');
|
||||
return config('app.version');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1322,9 +1322,12 @@ if (!function_exists('plugin_refresh_hooks')) {
|
||||
$events[$hook][] = [$namespace, $hook];
|
||||
}
|
||||
|
||||
$taglibPath = plugin_path($name) . 'taglib.php';
|
||||
if (is_file($taglibPath)) {
|
||||
$taglib[] = 'plugin\\' . $name . '\\taglib.php';
|
||||
$taglibPath = plugin_path($name . DIRECTORY_SEPARATOR . 'taglib');
|
||||
|
||||
$tagList = glob($taglibPath . '*.php');
|
||||
foreach ($tagList as $index => $tag) {
|
||||
$tag = pathinfo($tag, PATHINFO_FILENAME);
|
||||
$taglib[] = 'plugin\\' . $name . '\\taglib\\' . $tag;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,24 +74,6 @@ a {
|
||||
display: none;
|
||||
margin-left: -15px;
|
||||
}
|
||||
/*.layui-layer-iframe .layui-layer-setwin {*/
|
||||
/* right: 25px!important;*/
|
||||
/*}*/
|
||||
|
||||
/*.layui-layer-iframe .layui-layer-setwin .layui-layer-close2 {*/
|
||||
/* position: relative;*/
|
||||
/* right: unset;*/
|
||||
/* top: unset;*/
|
||||
/* width: 15px;*/
|
||||
/* height: 15px;*/
|
||||
/* margin-left: 8px;*/
|
||||
/* background-position: 1px -40px;*/
|
||||
/* _display: none;*/
|
||||
/*}*/
|
||||
|
||||
/*.layui-layer-iframe .layui-layer-setwin .layui-layer-close2:hover {*/
|
||||
/* background-position: 1px -40px;*/
|
||||
/*}*/
|
||||
|
||||
.layui-table td, .layui-table th, .layui-table-col-set, .layui-table-fixed-r, .layui-table-grid-down, .layui-table-header, .layui-table-page, .layui-table-tips-main, .layui-table-tool, .layui-table-total, .layui-table-view, .layui-table[lay-skin=line], .layui-table[lay-skin=row] {
|
||||
border: 1px #e6e6e6;
|
||||
@@ -2204,7 +2186,7 @@ a {
|
||||
/*input标签*/
|
||||
.layui-form-label {
|
||||
padding: 6px 15px;
|
||||
white-space: nowrap;
|
||||
/*white-space: nowrap;*/
|
||||
}
|
||||
|
||||
.layui-form-pane .layui-form-label {
|
||||
@@ -2548,8 +2530,7 @@ xm-select > .xm-body .xm-tree-icon:hover {
|
||||
|
||||
#console .layui-table[lay-skin="nob"] th, .layui-table[lay-skin="nob"] td {
|
||||
white-space: nowrap;
|
||||
max-width: 50px;
|
||||
overflow: hidden;
|
||||
min-width: 50px;
|
||||
}
|
||||
|
||||
#console ul.layui-timeline {
|
||||
|
||||
@@ -692,7 +692,8 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
|
||||
|
||||
options.iframeAuto && layer.iframeAuto(index);
|
||||
if (options.type <= 1) {
|
||||
|
||||
// 禁止滚动条
|
||||
$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||
if (typeof tableThis !== 'undefined' && !options.disableform) {
|
||||
form.val(options.id, tableThis.data);
|
||||
}
|
||||
@@ -1414,12 +1415,11 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
|
||||
layui.each($('.layui-tags'), function (i, e) {
|
||||
$(e).remove();
|
||||
})
|
||||
|
||||
layui.each($('*[lay-tags]'), function (index, elem) {
|
||||
|
||||
var isTags = layui.tags.render({
|
||||
let url = $(elem).data('url') || '';
|
||||
let isTags = layui.tags.render({
|
||||
elem: elem,
|
||||
url: '/Ajax/getTags',
|
||||
url: url,
|
||||
done: function (key, all) {
|
||||
}
|
||||
});
|
||||
|
||||
@@ -138,7 +138,7 @@ layui.define(function(exports){
|
||||
$('#'+ this.config.id + ' .layui-tags-input').before(html);
|
||||
|
||||
// 限定隐藏元素
|
||||
if (this.getData().length == this.config.limit) {
|
||||
if (this.getData().length === this.config.limit) {
|
||||
$('#'+this.config.id + ' .layui-tags-input').hide();
|
||||
}
|
||||
|
||||
@@ -195,11 +195,10 @@ layui.define(function(exports){
|
||||
// 监听输入框键盘事件
|
||||
$('body').on('keyup',input,function(e) {
|
||||
|
||||
|
||||
var elem = $(this),keyCode = e.keyCode;
|
||||
if (options.url !== undefined && keyCode != 13) {
|
||||
if (options.url !== undefined && keyCode !== 13) {
|
||||
|
||||
if (elem.val() != that.TAG_NAME) {
|
||||
if (elem.val() !== that.TAG_NAME && options.url) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: options.url,
|
||||
@@ -208,7 +207,7 @@ layui.define(function(exports){
|
||||
},
|
||||
// 获取TAGS关键词
|
||||
success: function(res) {
|
||||
if (res.code == 200) {
|
||||
if (res.code === 200) {
|
||||
that.drawHtml(res.data,elem);
|
||||
}
|
||||
}
|
||||
@@ -219,16 +218,16 @@ layui.define(function(exports){
|
||||
|
||||
var self = $('.'+LAY_TAG_THIS);
|
||||
// 上键
|
||||
if (keyCode == 38) {
|
||||
if (keyCode === 38) {
|
||||
var prev = self.prev();
|
||||
if (prev.length != 0) {
|
||||
if (prev.length !== 0) {
|
||||
self.removeClass(LAY_TAG_THIS);
|
||||
prev.addClass(LAY_TAG_THIS);
|
||||
}
|
||||
} // 下键
|
||||
else if (keyCode == 40) {
|
||||
else if (keyCode === 40) {
|
||||
var next = self.next();
|
||||
if (next.length != 0) {
|
||||
if (next.length !== 0) {
|
||||
self.removeClass(LAY_TAG_THIS);
|
||||
next.addClass(LAY_TAG_THIS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user