Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70ec12f406 | ||
|
|
e15b56ecc9 | ||
|
|
af275e1c6a | ||
|
|
20d4038159 | ||
|
|
475a1ef84d | ||
|
|
9307e724a9 | ||
|
|
6616e96724 | ||
|
|
963febc15c | ||
|
|
f78edd2fd5 | ||
|
|
83aa399f95 | ||
|
|
3096aa8985 | ||
|
|
c7f7ca9af7 | ||
|
|
352484c69e |
@@ -39,7 +39,13 @@
|
||||
|
||||
> EasyAdmin8 使用 Composer 来管理项目依赖。因此,在使用 EasyAdmin8 之前,请确保你的机器已经安装了 Composer。
|
||||
|
||||
### 通过git下载安装包,composer安装依赖包
|
||||
### 通过一键安装命令
|
||||
|
||||
```
|
||||
if [ -f /usr/bin/curl ];then curl -sSO https://easyadmin8.top/auto-install-EasyAdmin8.sh;else wget -O auto-install-EasyAdmin8.sh https://easyadmin8.top/auto-install-EasyAdmin8.sh;fi;bash auto-install-EasyAdmin8.sh
|
||||
```
|
||||
|
||||
### 通过`git`下载安装包,`composer`安装依赖包
|
||||
|
||||
```
|
||||
1.下载安装包
|
||||
|
||||
@@ -48,15 +48,6 @@ class SystemLog
|
||||
if ($request->isAjax()) {
|
||||
if (in_array($method, ['post', 'put', 'delete'])) {
|
||||
|
||||
$controller = $request->controller();
|
||||
if (str_contains($controller, '.')) $controller = str_replace('.', '\\', $controller);
|
||||
$action = $request->action();
|
||||
$controllerClass = 'app\\admin\\controller\\' . $controller;
|
||||
$classObj = new ReflectionClass($controllerClass);
|
||||
$properties = $classObj->getDefaultProperties();
|
||||
$ignoreLog = $properties['ignoreLog'] ?? [];
|
||||
if (in_array($action, $ignoreLog)) return $response;
|
||||
|
||||
$title = '';
|
||||
try {
|
||||
$pathInfo = $request->pathinfo();
|
||||
@@ -68,7 +59,10 @@ class SystemLog
|
||||
if ($_name && $_controller && $_action) {
|
||||
$className = "app\admin\controller\\{$_name}\\{$_controller}";
|
||||
$reflectionClass = new \ReflectionClass($className);
|
||||
$parser = new DocParser();
|
||||
$properties = $reflectionClass->getDefaultProperties();
|
||||
$ignoreLog = $properties['ignoreLog'] ?? [];
|
||||
if (in_array($_action, $ignoreLog)) return $response;
|
||||
$parser = new DocParser();
|
||||
$parser->setIgnoreNotImportedAnnotations(true);
|
||||
$reader = new AnnotationReader($parser);
|
||||
$controllerAnnotation = $reader->getClassAnnotation($reflectionClass, ControllerAnnotation::class);
|
||||
|
||||
@@ -44,14 +44,13 @@ class SystemLogService
|
||||
$this->tablePrefix = Config::get('database.connections.mysql.prefix');
|
||||
$this->tableSuffix = date('Ym', time());
|
||||
$this->tableName = "{$this->tablePrefix}system_log_{$this->tableSuffix}";
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实例对象
|
||||
* @return SystemLogService|object
|
||||
* @return SystemLogService
|
||||
*/
|
||||
public static function instance()
|
||||
public static function instance(): SystemLogService
|
||||
{
|
||||
if (is_null(self::$instance)) {
|
||||
self::$instance = new static();
|
||||
@@ -85,15 +84,16 @@ class SystemLogService
|
||||
*/
|
||||
public function detectTable(): bool
|
||||
{
|
||||
$_key = "system_log_{$this->tableName}_table";
|
||||
// 手动删除日志表时候 记得清除缓存
|
||||
$isset = Cache::get("systemLog{$this->tableName}Table");
|
||||
$isset = Cache::get($_key);
|
||||
if ($isset) return true;
|
||||
$check = Db::query("show tables like '{$this->tableName}'");
|
||||
if (empty($check)) {
|
||||
$sql = $this->getCreateSql();
|
||||
Db::execute($sql);
|
||||
}
|
||||
Cache::set("system_log_{$this->tableName}_table", !empty($check));
|
||||
Cache::set($_key, !empty($check));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
IS_SUPER_ADMIN: "{$isSuperAdmin|default='false'}",
|
||||
VERSION: "{$version|default='1.0.0'}",
|
||||
CSRF_TOKEN: "{:token()}",
|
||||
ADMIN_UPLOAD_URL: "{$adminUploadUrl|DEFAULT=''}",
|
||||
EDITOR_TYPE: "{$adminEditor|default='ueditor'}",
|
||||
ADMIN_UPLOAD_URL: "{$adminUploadUrl|default=''}",
|
||||
IFRAME_OPEN_TOP: "{$iframeOpenTop|default=0}",
|
||||
EDITOR_TYPE: "{$adminEditor|default='wangEditor'}",
|
||||
};
|
||||
</script>
|
||||
<script src="/static/plugs/xmSelect/xm-select.js" charset="utf-8"></script>
|
||||
<script src="/static/plugs/layui-v2.x/layui.js" charset="utf-8"></script>
|
||||
<script src="/static/plugs/require-2.3.6/require.js" charset="utf-8"></script>
|
||||
<script src="/static/config-admin.js?v={$version}" charset="utf-8"></script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<form id="app-form" class="layui-form layuimini-form layui-form-pane">
|
||||
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xl5 layui-col-lg5 layui-col-md5 layui-col-sm5 layui-col-xs5">
|
||||
<div class="layui-col-xl5 layui-col-lg5 layui-col-md12 layui-col-sm12 layui-col-xs12">
|
||||
<!-- 可以使用该方式 推荐写法-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商品分类</label>
|
||||
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xl7 layui-col-lg7 layui-col-md7 layui-col-sm7 layui-col-xs7">
|
||||
<div class="layui-col-xl7 layui-col-lg7 layui-col-md12 layui-col-sm12 layui-col-xs12">
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">商品描述</label>
|
||||
<div class="layui-input-block">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<form id="app-form" class="layui-form layuimini-form layui-form-pane">
|
||||
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xl5 layui-col-lg5 layui-col-md5 layui-col-sm5 layui-col-xs5">
|
||||
<div class="layui-col-xl5 layui-col-lg5 layui-col-md12 layui-col-sm12 layui-col-xs12">
|
||||
<!-- 可以使用该方式 推荐写法-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商品分类</label>
|
||||
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xl7 layui-col-lg7 layui-col-md7 layui-col-sm7 layui-col-xs7">
|
||||
<div class="layui-col-xl7 layui-col-lg7 layui-col-md12 layui-col-sm12 layui-col-xs12">
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">商品描述</label>
|
||||
<div class="layui-input-block">
|
||||
|
||||
@@ -54,6 +54,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">新标签页窗口</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="iframe_open_top" value="0" title="不允许" {if 1!=sysConfig('site','iframe_open_top')}checked{/if}>
|
||||
<input type="radio" name="iframe_open_top" value="1" title="允许" {if 1==sysConfig('site','iframe_open_top')}checked{/if}>
|
||||
<br>
|
||||
<tip>是否允许弹框在新标签页打开。</tip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">默认编辑器</label>
|
||||
|
||||
@@ -190,6 +190,9 @@ class AdminController extends BaseController
|
||||
case '%*':
|
||||
$where[] = [$key, 'LIKE', "%{$val}"];
|
||||
break;
|
||||
case 'in':
|
||||
$where[] = [$key, 'IN', $val];
|
||||
break;
|
||||
case 'range':
|
||||
[$beginTime, $endTime] = explode(' - ', $val);
|
||||
$where[] = [$key, '>=', strtotime($beginTime)];
|
||||
@@ -240,6 +243,7 @@ class AdminController extends BaseController
|
||||
'version' => env('APP_DEBUG') ? time() : ConfigService::getVersion(),
|
||||
'adminUploadUrl' => url('ajax/upload', [], false),
|
||||
'adminEditor' => sysConfig('site', 'editor_type') ?: 'wangEditor',
|
||||
'iframeOpenTop' => sysConfig('site', 'iframe_open_top') ?: 0,
|
||||
];
|
||||
View::assign($data);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,6 @@ class Index extends BaseController
|
||||
public function index(): Redirect
|
||||
{
|
||||
// 这是项目首页 系统默认跳转后台页面
|
||||
return redirect('/' . Env::get('EASYADMIN.ADMIN', false));
|
||||
return redirect('/' . Env::get('EASYADMIN.ADMIN', 'admin'));
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,9 @@ class Install extends BaseController
|
||||
}elseif (!extension_loaded("PDO")) {
|
||||
$errorInfo = '当前未开启PDO,无法进行安装';
|
||||
}
|
||||
if (!is_file(root_path() . '.env')) {
|
||||
$errorInfo = '.env 文件不存在,请先配置 .env 文件';
|
||||
}
|
||||
if (!$request->isAjax()) {
|
||||
$currentHost = '://';
|
||||
$result = compact('errorInfo', 'currentHost', 'isInstall');
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"qiniu/php-sdk": "v7.11.0",
|
||||
"ext-mysqli": "*",
|
||||
"ext-pdo": "*",
|
||||
"wolf-leo/phplogviewer": "^0.10.0"
|
||||
"wolf-leo/phplogviewer": "^0.11.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/var-dumper": ">=4.2",
|
||||
|
||||
@@ -134,6 +134,12 @@ html.dark, body {
|
||||
color: #a29c9c;
|
||||
}
|
||||
|
||||
.layui-form-item xm-select {
|
||||
min-height: 30px !important;
|
||||
line-height: 30px !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
/** 按钮背景色 */
|
||||
.layuimini-container .layuimini-btn-primary {
|
||||
color: #fff;
|
||||
@@ -253,36 +259,10 @@ table样式
|
||||
|
||||
.layuimini-container .layui-table-tool {
|
||||
background-color: #ffffff;
|
||||
border-bottom: none !important;
|
||||
padding: 10px;
|
||||
padding-bottom: 15px !important;
|
||||
}
|
||||
|
||||
.dark .layuimini-container .layui-table-tool {
|
||||
background-color: var(--lay-color-bg-1);
|
||||
border-bottom: none !important;
|
||||
padding-bottom: 15px !important;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-view {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-box {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #e6e6e6;
|
||||
}
|
||||
|
||||
.dark .layuimini-container .layui-table-box {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #363636;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-page, .layui-table-total {
|
||||
border-width: 0px 0 0;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-box .layui-table-header th {
|
||||
font-weight: bold !important;
|
||||
color: #565656 !important;
|
||||
@@ -329,10 +309,6 @@ table样式
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
按钮
|
||||
*/
|
||||
.layuimini-container .layui-btn-success {
|
||||
color: #fff;
|
||||
background-color: #4bb368;
|
||||
@@ -360,14 +336,6 @@ table样式
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-tool-self {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-tool {
|
||||
padding: 10px 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
弹出层样式
|
||||
*/
|
||||
@@ -513,6 +481,18 @@ table样式
|
||||
.form-search .layui-input-inline input, .form-search .layui-input-inline select {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.tableSelect {
|
||||
margin: 5px !important;
|
||||
min-width: auto !important;
|
||||
left: 1px !important;
|
||||
right: 1px !important;
|
||||
}
|
||||
|
||||
.tableSelect img {
|
||||
object-fit: cover;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(["easy-admin"], function (ea) {
|
||||
define(["jquery", "easy-admin"], function ($, ea) {
|
||||
|
||||
return {
|
||||
index: function () {
|
||||
|
||||
@@ -42,6 +42,14 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
||||
{field: 'virtual_sales', width: 100, title: '虚拟销量'},
|
||||
{field: 'sales', width: 80, title: '销量'},
|
||||
{field: 'status', title: '状态', width: 85, selectList: {0: '禁用', 1: '启用'}, templet: ea.table.switch},
|
||||
// 演示多选,实际数据库并无 status2 字段,搜索后会报错
|
||||
{
|
||||
field: 'status2', title: '演示多选', width: 105, search: 'xmSelect', selectList: {1: '模拟选项1', 2: '模拟选项2', 3: '模拟选项3', 4: '模拟选项4', 5: '模拟选项5'},
|
||||
searchOp: 'in', templet: function (res) {
|
||||
// 根据自己实际项目进行输出
|
||||
return res?.status2 || '模拟数据'
|
||||
}
|
||||
},
|
||||
{field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
|
||||
{
|
||||
width: 250,
|
||||
|
||||
@@ -19,9 +19,13 @@ define(["jquery", "tableSelect"], function ($, tableSelect) {
|
||||
table_render_id: 'currentTableRenderId',
|
||||
upload_url: 'ajax/upload',
|
||||
upload_exts: 'doc|gif|ico|icon|jpg|mp3|mp4|p12|pem|png|rar',
|
||||
csrf_token: window.CONFIG.CSRF_TOKEN
|
||||
csrf_token: window.CONFIG.CSRF_TOKEN,
|
||||
wait_submit: false,
|
||||
xmSelectList: {},
|
||||
xmSelectModel: {},
|
||||
};
|
||||
|
||||
|
||||
var admin = {
|
||||
config: {
|
||||
shade: [0.02, '#000'],
|
||||
@@ -112,6 +116,7 @@ define(["jquery", "tableSelect"], function ($, tableSelect) {
|
||||
// @todo 刷新csrf-token
|
||||
let token = data.responseJSON ? data.responseJSON.__token__ : ''
|
||||
init.csrf_token = token
|
||||
init.wait_submit = false
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -367,6 +372,15 @@ define(["jquery", "tableSelect"], function ($, tableSelect) {
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
break;
|
||||
case 'xmSelect':
|
||||
formHtml += '\t<div class="layui-form-item layui-inline">\n' +
|
||||
'<label class="layui-form-label">' + d.title + '</label>\n' +
|
||||
'<div class="layui-input-inline">\n' +
|
||||
'<div id="c-' + d.fieldAlias + '" class="tableSearch-xmSelect xmSelect-' + d.fieldAlias + '" name="' + d.fieldAlias + '" data-search-op="' + d.searchOp + '"></div>\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
init.xmSelectList[d.fieldAlias] = d.selectList
|
||||
break;
|
||||
case 'range':
|
||||
d.searchOp = 'range';
|
||||
formHtml += '\t<div class="layui-form-item layui-inline">\n' +
|
||||
@@ -820,6 +834,17 @@ define(["jquery", "tableSelect"], function ($, tableSelect) {
|
||||
return value;
|
||||
},
|
||||
listenTableSearch: function (tableId) {
|
||||
if (Object.keys(init.xmSelectList).length > 0) {
|
||||
$.each(init.xmSelectList, function (index, value) {
|
||||
const keysArray = Object.keys(value).map((key) => {
|
||||
return {name: value[key], value: key}
|
||||
})
|
||||
init.xmSelectModel[index] = xmSelect.render({
|
||||
el: '.xmSelect-' + index, language: 'zn', data: keysArray, name: index,
|
||||
filterable: true, paging: true, pageSize: 10, theme: {color: '#16b777'}, toolbar: {show: true},
|
||||
})
|
||||
})
|
||||
}
|
||||
form.on('submit(' + tableId + '_filter)', function (data) {
|
||||
var dataField = data.field;
|
||||
var formatFilter = {},
|
||||
@@ -974,6 +999,14 @@ define(["jquery", "tableSelect"], function ($, tableSelect) {
|
||||
before: function () {
|
||||
},
|
||||
success: function (layero, index) {
|
||||
if (window.CONFIG.IFRAME_OPEN_TOP == '1') {
|
||||
let _winTopBtn = `
|
||||
<span class="_winTopBtn layui-btn layui-btn-primary layui-btn-xs"
|
||||
style="position: absolute;top: 14px;right: 120px;color: #fff;border-color: #fff;" onclick="window.open(location.href)">
|
||||
新标签页打开
|
||||
</span>`
|
||||
$('.layui-layer-iframe').append(_winTopBtn)
|
||||
}
|
||||
},
|
||||
end: function () {
|
||||
index = null
|
||||
@@ -1144,6 +1177,11 @@ define(["jquery", "tableSelect"], function ($, tableSelect) {
|
||||
if (tableId === undefined || tableId === '' || tableId == null) {
|
||||
tableId = init.table_render_id;
|
||||
}
|
||||
if (Object.keys(init.xmSelectModel).length > 0) {
|
||||
$.each(init.xmSelectModel, function (index, value) {
|
||||
init.xmSelectModel[index].setValue([])
|
||||
})
|
||||
}
|
||||
table.reload(tableId, {
|
||||
page: {
|
||||
curr: 1
|
||||
@@ -1365,6 +1403,10 @@ define(["jquery", "tableSelect"], function ($, tableSelect) {
|
||||
url = admin.url(url);
|
||||
}
|
||||
form.on('submit(' + filter + ')', function (data) {
|
||||
if (init.wait_submit) {
|
||||
layer.msg('你点击太快了', {icon: 16, shade: 0.3, shadeClose: false, time: 1000})
|
||||
return false
|
||||
}
|
||||
var dataField = data.field;
|
||||
var editorList = document.querySelectorAll(".editor");
|
||||
// 富文本数据处理
|
||||
@@ -1392,6 +1434,7 @@ define(["jquery", "tableSelect"], function ($, tableSelect) {
|
||||
if (typeof preposeCallback === 'function') {
|
||||
dataField = preposeCallback(dataField);
|
||||
}
|
||||
init.wait_submit = true
|
||||
admin.api.form(url, dataField, ok, no, ex, refresh);
|
||||
return false;
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2575
public/static/plugs/xmSelect/xm-select.js
Normal file
2575
public/static/plugs/xmSelect/xm-select.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user