diff --git a/.example.env b/.example.env
index 714ec06..1b2c691 100644
--- a/.example.env
+++ b/.example.env
@@ -50,4 +50,7 @@ OSS_STATIC_PREFIX=static_ulthon_admin
DEFAULT_AUTH_CHECK=false
# 严格要求部分事件的返回数据,不符则抛出异常
-STRICT_EVENT=true
\ No newline at end of file
+STRICT_EVENT=true
+
+# 严格要求每个页面都建立js文件
+STRICT_VIEW_JS=true
\ No newline at end of file
diff --git a/app/admin/service/curd/BuildCurdService.php b/app/admin/service/curd/BuildCurdService.php
index 657f66c..8234e98 100644
--- a/app/admin/service/curd/BuildCurdService.php
+++ b/app/admin/service/curd/BuildCurdService.php
@@ -1473,11 +1473,11 @@ class BuildCurdService
$var_name = $this->getFieldVarName($field);
if ($val['formType'] == 'image') {
- $templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ea.table.image}";
+ $templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ua.table.image}";
} elseif ($val['formType'] == 'images') {
continue;
} elseif ($val['formType'] == 'file') {
- $templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ea.table.url}";
+ $templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ua.table.url}";
} elseif ($val['formType'] == 'files') {
continue;
} elseif ($val['formType'] == 'editor') {
@@ -1486,18 +1486,18 @@ class BuildCurdService
continue;
} elseif (in_array($field, $this->switchFields)) {
if (isset($val['define']) && !empty($val['define'])) {
- $templateValue = "{field: '{$field}', search: 'select', selectList: ea.getDataBrage('{$var_name}'), title: '{$val['comment']}', templet: ea.table.switch}";
+ $templateValue = "{field: '{$field}', search: 'select', selectList: ua.getDataBrage('{$var_name}'), title: '{$val['comment']}', templet: ua.table.switch}";
} else {
- $templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ea.table.switch}";
+ $templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ua.table.switch}";
}
} elseif (in_array($val['formType'], ['select', 'checkbox', 'radio', 'switch'])) {
if (isset($val['define']) && !empty($val['define'])) {
- $templateValue = "{field: '{$field}', search: 'select', selectList: ea.getDataBrage('{$var_name}'), title: '{$val['comment']}'}";
+ $templateValue = "{field: '{$field}', search: 'select', selectList: ua.getDataBrage('{$var_name}'), title: '{$val['comment']}'}";
} else {
$templateValue = "{field: '{$field}', title: '{$val['comment']}'}";
}
} elseif (in_array($field, ['remark'])) {
- $templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ea.table.text}";
+ $templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ua.table.text}";
} elseif (in_array($field, $this->sortFields)) {
$templateValue = "{field: '{$field}', title: '{$val['comment']}', edit: 'text'}";
} else {
@@ -1512,11 +1512,11 @@ class BuildCurdService
$table = Str::camel($table);
foreach ($tableVal['tableColumns'] as $field => $val) {
if ($val['formType'] == 'image') {
- $templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ea.table.image}";
+ $templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ua.table.image}";
} elseif ($val['formType'] == 'images') {
continue;
} elseif ($val['formType'] == 'file') {
- $templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ea.table.url}";
+ $templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ua.table.url}";
} elseif ($val['formType'] == 'files') {
continue;
} elseif ($val['formType'] == 'editor') {
@@ -1526,9 +1526,9 @@ class BuildCurdService
} elseif ($val['formType'] == 'select') {
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}'}";
} elseif (in_array($field, ['remark'])) {
- $templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ea.table.text}";
+ $templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ua.table.text}";
} elseif (in_array($field, $this->switchFields)) {
- $templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ea.table.switch}";
+ $templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ua.table.switch}";
} elseif (in_array($field, $this->sortFields)) {
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', edit: 'text'}";
} else {
@@ -1539,7 +1539,7 @@ class BuildCurdService
}
}
- $indexCols .= $this->formatColsRow("{width: 250, title: '操作', templet: ea.table.tool , fixed:'right'},\r");
+ $indexCols .= $this->formatColsRow("{width: 250, title: '操作', templet: ua.table.tool , fixed:'right'},\r");
$jsValue = $this->replaceTemplate(
$this->getTemplate("static{$this->DS}js"),
diff --git a/app/admin/service/curd/templates/static/js.code b/app/admin/service/curd/templates/static/js.code
index 588bd38..3347cfa 100644
--- a/app/admin/service/curd/templates/static/js.code
+++ b/app/admin/service/curd/templates/static/js.code
@@ -14,20 +14,20 @@ define(["jquery", "easy-admin"], function ($, ea) {
var Controller = {
index: function () {
- ea.table.render({
+ ua.table.render({
init: init,
cols: [[
{{indexCols}}
]],
});
- ea.listen();
+ ua.listen();
},
add: function () {
- ea.listen();
+ ua.listen();
},
edit: function () {
- ea.listen();
+ ua.listen();
},
};
return Controller;
diff --git a/app/admin/view/common/_require.html b/app/admin/view/common/_require.html
new file mode 100644
index 0000000..4602d9c
--- /dev/null
+++ b/app/admin/view/common/_require.html
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/admin/view/debug/log/_common.js b/app/admin/view/debug/log/_common.js
new file mode 100644
index 0000000..e69de29
diff --git a/app/admin/view/debug/log/add.html b/app/admin/view/debug/log/add.html
deleted file mode 100644
index 8143510..0000000
--- a/app/admin/view/debug/log/add.html
+++ /dev/null
@@ -1,53 +0,0 @@
-
\ No newline at end of file
diff --git a/app/admin/view/debug/log/edit.html b/app/admin/view/debug/log/edit.html
deleted file mode 100644
index f7186b8..0000000
--- a/app/admin/view/debug/log/edit.html
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/app/admin/view/debug/log/index.js b/app/admin/view/debug/log/index.js
new file mode 100644
index 0000000..dad2182
--- /dev/null
+++ b/app/admin/view/debug/log/index.js
@@ -0,0 +1,51 @@
+$(function () {
+ var init = {
+ table_elem: '#currentTable',
+ table_render_id: 'currentTableRenderId',
+ index_url: 'debug.log/index',
+ add_url: 'debug.log/add',
+ edit_url: 'debug.log/edit',
+ delete_url: 'debug.log/delete',
+ export_url: 'debug.log/export',
+ modify_url: 'debug.log/modify',
+ };
+
+ var uidList = [];
+ ua.table.render({
+ init: init,
+ size: 'sm',
+ limit: 50,
+ cols: [[
+ { type: 'checkbox' },
+ { field: 'id', title: 'id', search: 'number_limit' },
+ { field: 'id', title: 'id模糊匹配', trueHide: true, fieldAlias: '[id]like' },
+ { field: 'id', title: '最大id', trueHide: true, fieldAlias: '[id]max', searchOp: 'max' },
+ {
+ field: 'uid', title: 'uid', minWidth: 120,
+ },
+ { field: 'level', title: 'level', minWidth: 70 },
+ {
+ field: 'content', title: '日志内容', minWidth: 450, align: 'left', templet: function (data) {
+
+ if (uidList.indexOf(data.uid) < 0) {
+ uidList.push(data.uid);
+ }
+ var currentUidIndex = uidList.indexOf(data.uid);
+
+ var className = 'log-group log-group-' + (currentUidIndex % 2);
+ return '' + data.content + '
';
+ }
+ },
+ { field: 'create_time', title: '记录时间', minWidth: 160, search: 'time_limit' },
+ { field: 'app_name', title: 'app_name' },
+ { field: 'controller_name', title: 'controller_name', },
+ { field: 'action_name', title: 'action_name' },
+ ]],
+ toolbar: [
+ 'refresh',
+ 'export'
+ ]
+ });
+
+ ua.listen();
+});
\ No newline at end of file
diff --git a/app/admin/view/index/_common.js b/app/admin/view/index/_common.js
new file mode 100644
index 0000000..e69de29
diff --git a/app/admin/view/index/edit_admin.js b/app/admin/view/index/edit_admin.js
new file mode 100644
index 0000000..4d2e0be
--- /dev/null
+++ b/app/admin/view/index/edit_admin.js
@@ -0,0 +1,3 @@
+$(function () {
+ ua.listen();
+});
\ No newline at end of file
diff --git a/app/admin/view/index/edit_password.js b/app/admin/view/index/edit_password.js
new file mode 100644
index 0000000..4d2e0be
--- /dev/null
+++ b/app/admin/view/index/edit_password.js
@@ -0,0 +1,3 @@
+$(function () {
+ ua.listen();
+});
\ No newline at end of file
diff --git a/app/admin/view/index/index.html b/app/admin/view/index/index.html
index da7c110..f2e3b4a 100644
--- a/app/admin/view/index/index.html
+++ b/app/admin/view/index/index.html
@@ -111,4 +111,4 @@
-
diff --git a/app/admin/view/login/_common.js b/app/admin/view/login/_common.js
new file mode 100644
index 0000000..e69de29
diff --git a/app/admin/view/login/ext/demo.html b/app/admin/view/login/ext/demo.html
index 3e5db1a..ac8246e 100644
--- a/app/admin/view/login/ext/demo.html
+++ b/app/admin/view/login/ext/demo.html
@@ -1,4 +1,4 @@
-演示账号快速登录
+演示账号一键填写
";
+ }
+
/**
* 解析和获取模板内容 用于输出.
* @param string $template
@@ -150,7 +174,17 @@ class AdminController extends BaseController
{
$this->assign('data_brage', json_encode($this->dataBrage));
- return $this->app->view->fetch($template, $vars);
+ $vars['content_js'] = $this->fetchJS();
+
+ $content_main = View::layout($this->layout)
+ ->config([
+ 'view_suffix' => 'html',
+ ])->fetch($template, $vars);
+
+ $html = '';
+ $html .= $content_main;
+
+ return $html;
}
/**
diff --git a/app/common/provider/View.php b/app/common/provider/View.php
index 965ac90..cbcd3f3 100644
--- a/app/common/provider/View.php
+++ b/app/common/provider/View.php
@@ -36,4 +36,16 @@ class View extends ThinkView
return $this;
}
+
+ /**
+ * 配置模板引擎.
+ * @param array $config 参数
+ * @return $this
+ */
+ public function config(array $config)
+ {
+ $this->driver()->config($config);
+
+ return $this;
+ }
}
diff --git a/app/common/tools/PathTools.php b/app/common/tools/PathTools.php
index b8fa6ce..db146fc 100644
--- a/app/common/tools/PathTools.php
+++ b/app/common/tools/PathTools.php
@@ -7,7 +7,7 @@ use think\facade\App;
class PathTools
{
/**
- * 系统生成的文件,这些文件应当是可以任意删除的
+ * 系统生成的文件,这些文件应当是可以任意删除的.
*
* @param string $file_name
* @return string
@@ -49,6 +49,29 @@ class PathTools
if (!is_dir($dir_name)) {
mkdir($dir_name, 0777, true);
}
+
return $file_path;
}
+
+ public static function mapDir($dir, $callback = null)
+ {
+ $result = [];
+ $cdir = scandir($dir);
+ foreach ($cdir as $key => $value) {
+ if (!in_array($value, ['.', '..'])) {
+ $current_path = $dir . DS . $value;
+ if (is_dir($current_path)) {
+ $result[$value] = self::mapDir($current_path, $callback);
+ } else {
+ if (is_callable($callback)) {
+ $result[$value] = $callback($current_path, $value, $dir);
+ } else {
+ $result[$value] = $current_path;
+ }
+ }
+ }
+ }
+
+ return $result;
+ }
}
diff --git a/config/view.php b/config/view.php
index e97254f..7b0099b 100644
--- a/config/view.php
+++ b/config/view.php
@@ -1,4 +1,5 @@
'Think',
+ 'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
- 'auto_rule' => 1,
+ 'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'view',
// 模板后缀
- 'view_suffix' => 'html',
+ 'view_suffix' => 'html',
// 模板文件名分隔符
- 'view_depr' => DIRECTORY_SEPARATOR,
+ 'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
- 'tpl_begin' => '{',
+ 'tpl_begin' => '{',
// 模板引擎普通标签结束标记
- 'tpl_end' => '}',
+ 'tpl_end' => '}',
// 标签库标签开始标记
- 'taglib_begin' => '{',
+ 'taglib_begin' => '{',
// 标签库标签结束标记
- 'taglib_end' => '}',
+ 'taglib_end' => '}',
// 模板缓存
'display_cache' => true,
// 字符替换
'tpl_replace_string' => [
'__STATIC__' => Env::get('adminsystem.static_path', '/static'),
- '__JS__' => '/static/javascript',
+ '__JS__' => '/static/javascript',
],
- 'default_filter' => 'ua_htmlentities', // 默认过滤方法 用于普通标签输出
+ 'default_filter' => 'ua_htmlentities', // 默认过滤方法 用于普通标签输出
];
diff --git a/public/static/admin/js/debug/log.js b/public/static/admin/js/debug/log.js
index 74b1737..6ec3cee 100644
--- a/public/static/admin/js/debug/log.js
+++ b/public/static/admin/js/debug/log.js
@@ -15,7 +15,7 @@ define(["jquery", "easy-admin"], function ($, ea) {
index: function () {
var uidList = [];
- ea.table.render({
+ ua.table.render({
init: init,
size: 'sm',
limit: 50,
@@ -51,13 +51,13 @@ define(["jquery", "easy-admin"], function ($, ea) {
]
});
- ea.listen();
+ ua.listen();
},
add: function () {
- ea.listen();
+ ua.listen();
},
edit: function () {
- ea.listen();
+ ua.listen();
},
};
return Controller;
diff --git a/public/static/admin/js/index.js b/public/static/admin/js/index.js
index e7997e1..1323f93 100644
--- a/public/static/admin/js/index.js
+++ b/public/static/admin/js/index.js
@@ -3,8 +3,8 @@ define(["jquery", "easy-admin", "echarts", "echarts-theme", "miniAdmin"], functi
var Controller = {
index: function () {
var options = {
- iniUrl: ea.url('ajax/initAdmin'), // 初始化接口
- clearUrl: ea.url("ajax/clearCache"), // 缓存清理接口
+ iniUrl: ua.url('ajax/initAdmin'), // 初始化接口
+ clearUrl: ua.url("ajax/clearCache"), // 缓存清理接口
urlHashLocation: true, // 是否打开hash定位
bgColorDefault: false, // 主题默认配置
multiModule: true, // 是否开启多模块
@@ -16,12 +16,12 @@ define(["jquery", "easy-admin", "echarts", "echarts-theme", "miniAdmin"], functi
miniAdmin.render(options);
$('.login-out').on("click", function () {
- ea.request.get({
+ ua.request.get({
url: 'login/out',
prefix: true,
}, function (res) {
- ea.msg.success(res.msg, function () {
- window.location = ea.url('login/index');
+ ua.msg.success(res.msg, function () {
+ window.location = ua.url('login/index');
})
});
});
@@ -108,13 +108,13 @@ define(["jquery", "easy-admin", "echarts", "echarts-theme", "miniAdmin"], functi
clearInterval(checkChartVisibleTimer)
}
}, 3000);
- ea.listen();
+ ua.listen();
},
editAdmin: function () {
- ea.listen();
+ ua.listen();
},
editPassword: function () {
- ea.listen();
+ ua.listen();
}
};
return Controller;
diff --git a/public/static/admin/js/login.js b/public/static/admin/js/login.js
index dcaf4b5..5ce51fe 100644
--- a/public/static/admin/js/login.js
+++ b/public/static/admin/js/login.js
@@ -3,49 +3,7 @@ define(["easy-admin"], function (ea) {
var Controller = {
index: function () {
- if (top.location !== self.location) {
- top.location = self.location;
- }
-
- $('.bind-password').on('click', function () {
- if ($(this).hasClass('icon-5')) {
- $(this).removeClass('icon-5');
- $("input[name='password']").attr('type', 'password');
- } else {
- $(this).addClass('icon-5');
- $("input[name='password']").attr('type', 'text');
- }
- });
-
- $('.icon-nocheck').on('click', function () {
- if ($(this).hasClass('icon-check')) {
- $(this).removeClass('icon-check');
- } else {
- $(this).addClass('icon-check');
- }
- });
-
- $('.login-tip').on('click', function () {
- $('.icon-nocheck').click();
- });
-
- ea.listen(function (data) {
- data['keep_login'] = $('.icon-nocheck').hasClass('icon-check') ? 1 : 0;
- return data;
- }, function (res) {
- ea.msg.success(res.msg, function () {
- window.location = ea.url('index');
- })
- }, function (res) {
- ea.msg.error(res.msg, function () {
- $('#refreshCaptcha').trigger("click");
- });
- });
-
-
- $('.forget-password').click(function () {
- layer.msg('可以使用重置密码命令设置:
php think admin:resetPassword
参考文档')
- })
+
},
};
diff --git a/public/static/admin/js/mall/cate.js b/public/static/admin/js/mall/cate.js
index ea73205..d73e2fd 100644
--- a/public/static/admin/js/mall/cate.js
+++ b/public/static/admin/js/mall/cate.js
@@ -14,28 +14,28 @@ define(["jquery", "easy-admin"], function ($, ea) {
var Controller = {
index: function () {
- ea.table.render({
+ ua.table.render({
init: init,
cols: [[
{type: "checkbox"},
{field: 'id', width: 80, title: 'ID'},
{field: 'sort', width: 80, title: '排序', edit: 'text'},
{field: 'title', minWidth: 80, title: '分类名称'},
- {field: 'image', minWidth: 80, title: '分类图片', search: false, templet: ea.table.image},
+ {field: 'image', minWidth: 80, title: '分类图片', search: false, templet: ua.table.image},
{field: 'remark', minWidth: 80, title: '备注信息'},
- {field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ea.table.switch},
+ {field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ua.table.switch},
{field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
- {width: 250, title: '操作', templet: ea.table.tool}
+ {width: 250, title: '操作', templet: ua.table.tool}
]],
});
- ea.listen();
+ ua.listen();
},
add: function () {
- ea.listen();
+ ua.listen();
},
edit: function () {
- ea.listen();
+ ua.listen();
},
};
return Controller;
diff --git a/public/static/admin/js/mall/goods.js b/public/static/admin/js/mall/goods.js
index ffb1c3a..f9a2465 100644
--- a/public/static/admin/js/mall/goods.js
+++ b/public/static/admin/js/mall/goods.js
@@ -17,21 +17,21 @@ define(["jquery", "easy-admin"], function ($, ea) {
var Controller = {
index: function () {
- ea.table.render({
+ ua.table.render({
init: init,
totalRow: true,
cols: [[
{ type: "checkbox" },
{ field: 'id', width: 80, title: 'ID', totalRowText: '合计:' },
{ field: 'sort', width: 80, title: '排序', edit: 'text' },
- { field: 'cate_id', minWidth: 80, title: '商品分类', selectList: ea.getDataBrage('select_list_cate'), selectValue: 'id', selectLabel: 'title', defaultSearchValue: ea.getQueryVariable('cate_id', '') },
- { field: 'cate.image', minWidth: 80, title: '分类图片', search: false, templet: ea.table.image },
+ { field: 'cate_id', minWidth: 80, title: '商品分类', selectList: ua.getDataBrage('select_list_cate'), selectValue: 'id', selectLabel: 'title', defaultSearchValue: ua.getQueryVariable('cate_id', '') },
+ { field: 'cate.image', minWidth: 80, title: '分类图片', search: false, templet: ua.table.image },
{ field: 'title', minWidth: 80, title: '商品名称', },
- { field: 'logo', minWidth: 80, title: '商品图片', search: false, templet: ea.table.image },
- { field: 'market_price', width: 100, title: '市场价', templet: ea.table.price },
+ { field: 'logo', minWidth: 80, title: '商品图片', search: false, templet: ua.table.image },
+ { field: 'market_price', width: 100, title: '市场价', templet: ua.table.price },
{
- field: 'discount_price', width: 120, title: '折扣价', templet: ea.table.price, totalRow: true,
- templet: ea.table.copyText,
+ field: 'discount_price', width: 120, title: '折扣价', templet: ua.table.price, totalRow: true,
+ templet: ua.table.copyText,
valueParser(value) {
return '¥' + value
},
@@ -53,12 +53,12 @@ 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 },
+ { field: 'status', title: '状态', width: 85, selectList: { 0: '禁用', 1: '启用' }, templet: ua.table.switch },
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
{
width: 250,
title: '操作',
- templet: ea.table.tool,
+ templet: ua.table.tool,
fixed: 'right',
operat: [
'edit',
@@ -81,19 +81,19 @@ define(["jquery", "easy-admin"], function ($, ea) {
]],
});
- ea.listen();
+ ua.listen();
},
add: function () {
- ea.listen();
+ ua.listen();
},
edit: function () {
- ea.listen();
+ ua.listen();
},
stock: function () {
- ea.listen();
+ ua.listen();
},
read: function () {
- ea.listen();
+ ua.listen();
},
};
return Controller;
diff --git a/public/static/admin/js/mall/tag.js b/public/static/admin/js/mall/tag.js
index 6924560..ea4a250 100644
--- a/public/static/admin/js/mall/tag.js
+++ b/public/static/admin/js/mall/tag.js
@@ -14,23 +14,23 @@ define(["jquery", "easy-admin"], function ($, ea) {
var Controller = {
index: function () {
- ea.table.render({
+ ua.table.render({
init: init,
cols: [[
{type: 'checkbox'},
{field: 'id', title: 'id'},
{field: 'title', title: '名称'},
- {width: 250, title: '操作', templet: ea.table.tool},
+ {width: 250, title: '操作', templet: ua.table.tool},
]],
});
- ea.listen();
+ ua.listen();
},
add: function () {
- ea.listen();
+ ua.listen();
},
edit: function () {
- ea.listen();
+ ua.listen();
},
};
return Controller;
diff --git a/public/static/admin/js/system/admin.js b/public/static/admin/js/system/admin.js
index 6070808..ccee7b9 100644
--- a/public/static/admin/js/system/admin.js
+++ b/public/static/admin/js/system/admin.js
@@ -12,10 +12,10 @@ define(["jquery", "easy-admin"], function ($, ea) {
password_url: 'system.admin/password',
};
- var authList = ea.getDataBrage('auth_list', []);
- var count = ea.getDataBrage('count', 0);
- var tips = ea.getDataBrage('tips', '');
- var tips = ea.getDataBrage('adminCustomFlag');
+ var authList = ua.getDataBrage('auth_list', []);
+ var count = ua.getDataBrage('count', 0);
+ var tips = ua.getDataBrage('tips', '');
+ var tips = ua.getDataBrage('adminCustomFlag');
console.log(authList);
console.log(count);
@@ -25,24 +25,24 @@ define(["jquery", "easy-admin"], function ($, ea) {
index: function () {
- ea.table.render({
+ ua.table.render({
init: init,
cols: [[
{ type: "checkbox" },
{ field: 'id', width: 80, title: 'ID' },
{ field: 'sort', width: 80, title: '排序', edit: 'text' },
{ field: 'username', minWidth: 80, title: '登录账户' },
- { field: 'head_img', minWidth: 80, title: '头像', search: false, templet: ea.table.image },
+ { field: 'head_img', minWidth: 80, title: '头像', search: false, templet: ua.table.image },
{ field: 'phone', minWidth: 80, title: '手机' },
{ field: 'login_num', minWidth: 80, title: '登录次数' },
{ field: 'remark', minWidth: 80, title: '备注信息', defaultValue: '无' },
- { field: 'status', title: '状态', width: 85, search: 'select', selectList: { 0: '禁用', 1: '启用' }, templet: ea.table.switch },
+ { field: 'status', title: '状态', width: 85, search: 'select', selectList: { 0: '禁用', 1: '启用' }, templet: ua.table.switch },
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
{
width: 250,
title: '操作',
fixed: 'right',
- templet: ea.table.tool,
+ templet: ua.table.tool,
operat: [
'edit',
[{
@@ -59,16 +59,16 @@ define(["jquery", "easy-admin"], function ($, ea) {
]],
});
- ea.listen();
+ ua.listen();
},
add: function () {
- ea.listen();
+ ua.listen();
},
edit: function () {
- ea.listen();
+ ua.listen();
},
password: function () {
- ea.listen();
+ ua.listen();
}
};
return Controller;
diff --git a/public/static/admin/js/system/auth.js b/public/static/admin/js/system/auth.js
index e8aa2fe..04d7f96 100644
--- a/public/static/admin/js/system/auth.js
+++ b/public/static/admin/js/system/auth.js
@@ -15,7 +15,7 @@ define(["jquery", "easy-admin"], function ($, ea) {
var Controller = {
index: function () {
- ea.table.render({
+ ua.table.render({
init: init,
cols: [[
{type: "checkbox"},
@@ -23,12 +23,12 @@ define(["jquery", "easy-admin"], function ($, ea) {
{field: 'sort', width: 80, title: '排序', edit: 'text'},
{field: 'title', minWidth: 80, title: '权限名称'},
{field: 'remark', minWidth: 80, title: '备注信息'},
- {field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ea.table.switch},
+ {field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ua.table.switch},
{field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
{
width: 250,
title: '操作',
- templet: ea.table.tool,
+ templet: ua.table.tool,
operat: [
'edit',
[{
@@ -44,18 +44,18 @@ define(["jquery", "easy-admin"], function ($, ea) {
]],
});
- ea.listen();
+ ua.listen();
},
add: function () {
- ea.listen();
+ ua.listen();
},
edit: function () {
- ea.listen();
+ ua.listen();
},
authorize: function () {
var tree = layui.tree;
- ea.request.get(
+ ua.request.get(
{
url: window.location.href,
}, function (res) {
@@ -69,7 +69,7 @@ define(["jquery", "easy-admin"], function ($, ea) {
}
);
- ea.listen(function (data) {
+ ua.listen(function (data) {
var checkedData = tree.getChecked('nodeDataId');
var ids = [];
$.each(checkedData, function (i, v) {
diff --git a/public/static/admin/js/system/config.js b/public/static/admin/js/system/config.js
index 7929936..c6329c8 100644
--- a/public/static/admin/js/system/config.js
+++ b/public/static/admin/js/system/config.js
@@ -13,7 +13,7 @@ define(["jquery", "easy-admin", "vue"], function ($, ea, Vue) {
$('.show-type-item.' + this.value).show();
});
- ea.listen();
+ ua.listen();
}
};
return Controller;
diff --git a/public/static/admin/js/system/menu.js b/public/static/admin/js/system/menu.js
index a89e211..3b7de2b 100644
--- a/public/static/admin/js/system/menu.js
+++ b/public/static/admin/js/system/menu.js
@@ -26,18 +26,18 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
homdPid: 99999999,
treeIdName: 'id',
treePidName: 'pid',
- url: ea.url(init.index_url),
+ url: ua.url(init.index_url),
elem: init.table_elem,
id: init.table_render_id,
toolbar: '#toolbar',
page: false,
skin: 'line',
- // @todo 不直接使用ea.table.render(); 进行表格初始化, 需要使用 ea.table.formatCols(); 方法格式化`cols`列数据
- cols: ea.table.formatCols([[
+ // @todo 不直接使用ua.table.render(); 进行表格初始化, 需要使用 ua.table.formatCols(); 方法格式化`cols`列数据
+ cols: ua.table.formatCols([[
{ type: 'checkbox' },
{ field: 'title', sort: false, width: 250, title: '菜单名称', align: 'left' },
- { field: 'icon', sort: false, width: 80, title: '图标', templet: ea.table.icon },
+ { field: 'icon', sort: false, width: 80, title: '图标', templet: ua.table.icon },
{ field: 'href', sort: false, minWidth: 120, title: '菜单链接' },
{
field: 'is_home', sort: false,
@@ -54,13 +54,13 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
}
}
},
- { field: 'status', sort: false, title: '状态', width: 85, templet: ea.table.switch },
+ { field: 'status', sort: false, title: '状态', width: 85, templet: ua.table.switch },
{ field: 'sort', sort: false, width: 80, title: '排序', edit: 'text' },
{
width: 220,
title: '操作',
fixed: 'right',
- templet: ea.table.tool,
+ templet: ua.table.tool,
operat: [
[{
text: '添加下级',
@@ -94,7 +94,7 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
data: ['id', 'title'],
_if(data) {
- if (data.pid == ea.getDataBrage('menu_home_pid')) {
+ if (data.pid == ua.getDataBrage('menu_home_pid')) {
return false
}
@@ -126,15 +126,15 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
$('body').on('click', '[data-treetable-delete-item]', function () {
var id = $(this).data('id');
var url = $(this).attr('data-url');
- url = url != undefined ? ea.url(url) : window.location.href;
- ea.msg.confirm('确定删除?', function () {
- ea.request.post({
+ url = url != undefined ? ua.url(url) : window.location.href;
+ ua.msg.confirm('确定删除?', function () {
+ ua.request.post({
url: url,
data: {
id: id
},
}, function (res) {
- ea.msg.success(res.msg, function () {
+ ua.msg.success(res.msg, function () {
renderTable();
});
});
@@ -146,25 +146,25 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
var tableId = $(this).attr('data-treetable-delete'),
url = $(this).attr('data-url');
tableId = tableId || init.table_render_id;
- url = url != undefined ? ea.url(url) : window.location.href;
+ url = url != undefined ? ua.url(url) : window.location.href;
var checkStatus = table.checkStatus(tableId),
data = checkStatus.data;
if (data.length <= 0) {
- ea.msg.error('请勾选需要删除的数据');
+ ua.msg.error('请勾选需要删除的数据');
return false;
}
var ids = [];
$.each(data, function (i, v) {
ids.push(v.id);
});
- ea.msg.confirm('确定删除?', function () {
- ea.request.post({
+ ua.msg.confirm('确定删除?', function () {
+ ua.request.post({
url: url,
data: {
id: ids
},
}, function (res) {
- ea.msg.success(res.msg, function () {
+ ua.msg.success(res.msg, function () {
renderTable();
});
});
@@ -172,11 +172,11 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
return false;
});
- ea.table.listenSwitch({ filter: 'status', url: init.modify_url });
+ ua.table.listenSwitch({ filter: 'status', url: init.modify_url });
- ea.table.listenEdit(init, 'currentTable', init.table_render_id, false);
+ ua.table.listenEdit(init, 'currentTable', init.table_render_id, false);
- ea.listen();
+ ua.listen();
},
add: function () {
iconPickerFa.render({
@@ -192,17 +192,17 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
});
autocomplete.render({
elem: $('#href')[0],
- url: ea.url('system.menu/getMenuTips'),
+ url: ua.url('system.menu/getMenuTips'),
template_val: '{{-d.node}}',
template_txt: '{{-d.node}} {{-d.title}}',
onselect: function (resp) {
}
});
- ea.listen(function (data) {
+ ua.listen(function (data) {
return data;
}, function (res) {
- ea.msg.success(res.msg, function () {
+ ua.msg.success(res.msg, function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
parent.$('[data-treetable-refresh]').trigger("click");
@@ -223,17 +223,17 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
});
autocomplete.render({
elem: $('#href')[0],
- url: ea.url('system.menu/getMenuTips'),
+ url: ua.url('system.menu/getMenuTips'),
template_val: '{{-d.node}}',
template_txt: '{{-d.node}} {{-d.title}}',
onselect: function (resp) {
}
});
- ea.listen(function (data) {
+ ua.listen(function (data) {
return data;
}, function (res) {
- ea.msg.success(res.msg, function () {
+ ua.msg.success(res.msg, function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
parent.$('[data-treetable-refresh]').trigger("click");
diff --git a/public/static/admin/js/system/node.js b/public/static/admin/js/system/node.js
index 2da0d40..529d02d 100644
--- a/public/static/admin/js/system/node.js
+++ b/public/static/admin/js/system/node.js
@@ -13,7 +13,7 @@ define(["jquery", "easy-admin"], function ($, ea) {
var Controller = {
index: function () {
- ea.table.render({
+ ua.table.render({
init: init,
search: false,
page: false,
@@ -52,17 +52,17 @@ define(["jquery", "easy-admin"], function ($, ea) {
{ field: 'node', sort: false, minWidth: 200, align: 'left', title: '系统节点' },
{ field: 'title', sort: false, minWidth: 80, title: '节点名称 *', edit: 'text' },
{ field: 'update_time', sort: false, minWidth: 80, title: '更新时间', search: 'range' },
- { field: 'is_auth', sort: false, title: '节点控制', width: 85, search: 'select', selectList: { 0: '禁用', 1: '启用' }, templet: ea.table.switch },
+ { field: 'is_auth', sort: false, title: '节点控制', width: 85, search: 'select', selectList: { 0: '禁用', 1: '启用' }, templet: ua.table.switch },
]],
});
- ea.listen();
+ ua.listen();
},
add: function () {
- ea.listen();
+ ua.listen();
},
edit: function () {
- ea.listen();
+ ua.listen();
}
};
return Controller;
diff --git a/public/static/admin/js/system/quick.js b/public/static/admin/js/system/quick.js
index 8afbd3a..b6134e9 100644
--- a/public/static/admin/js/system/quick.js
+++ b/public/static/admin/js/system/quick.js
@@ -17,23 +17,23 @@ define(["jquery", "easy-admin", "iconPickerFa", "autocomplete"], function ($, ea
var Controller = {
index: function () {
- ea.table.render({
+ ua.table.render({
init: init,
cols: [[
{type: "checkbox"},
{field: 'id', width: 80, title: 'ID'},
{field: 'sort', width: 80, title: '排序', edit: 'text'},
{field: 'title', minWidth: 80, title: '权限名称'},
- {field: 'icon', width: 80, title: '图标', templet: ea.table.icon},
+ {field: 'icon', width: 80, title: '图标', templet: ua.table.icon},
{field: 'href', minWidth: 120, title: '快捷链接'},
{field: 'remark', minWidth: 80, title: '备注信息'},
- {field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ea.table.switch},
+ {field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ua.table.switch},
{field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
- {width: 250, title: '操作', templet: ea.table.tool, operat: ['edit', 'delete']}
+ {width: 250, title: '操作', templet: ua.table.tool, operat: ['edit', 'delete']}
]],
});
- ea.listen();
+ ua.listen();
},
add: function () {
iconPickerFa.render({
@@ -49,14 +49,14 @@ define(["jquery", "easy-admin", "iconPickerFa", "autocomplete"], function ($, ea
});
autocomplete.render({
elem: $('#href')[0],
- url: ea.url('system.menu/getMenuTips'),
+ url: ua.url('system.menu/getMenuTips'),
template_val: '{{d.node}}',
template_txt: '{{d.node}} {{d.title}}',
onselect: function (resp) {
}
});
- ea.listen();
+ ua.listen();
},
edit: function () {
iconPickerFa.render({
@@ -72,14 +72,14 @@ define(["jquery", "easy-admin", "iconPickerFa", "autocomplete"], function ($, ea
});
autocomplete.render({
elem: $('#href')[0],
- url: ea.url('system.menu/getMenuTips'),
+ url: ua.url('system.menu/getMenuTips'),
template_val: '{{d.node}}',
template_txt: '{{d.node}} {{d.title}}',
onselect: function (resp) {
}
});
- ea.listen();
+ ua.listen();
},
};
return Controller;
diff --git a/public/static/admin/js/system/uploadfile.js b/public/static/admin/js/system/uploadfile.js
index dcd8a5a..9c7193f 100644
--- a/public/static/admin/js/system/uploadfile.js
+++ b/public/static/admin/js/system/uploadfile.js
@@ -14,15 +14,15 @@ define(["jquery", "easy-admin"], function ($, ea) {
var Controller = {
index: function () {
- ea.table.render({
+ ua.table.render({
init: init,
cols: [[
{ type: "checkbox" },
{ field: 'id', width: 80, title: 'ID' },
{ field: 'upload_type', minWidth: 80, title: '存储位置', search: 'select', selectList: { 'local': '本地', 'alioss': '阿里云', 'qnoss': '七牛云', ',txcos': '腾讯云' } },
- { field: 'url', minWidth: 80, search: false, title: '文件预览', templet: ea.table.filePreview },
+ { field: 'url', minWidth: 80, search: false, title: '文件预览', templet: ua.table.filePreview },
{
- field: 'url', minWidth: 120, title: '保存地址', templet: ea.table.url, urlNameField: function (data) {
+ field: 'url', minWidth: 120, title: '保存地址', templet: ua.table.url, urlNameField: function (data) {
return data.url;
}
},
@@ -31,8 +31,8 @@ define(["jquery", "easy-admin"], function ($, ea) {
{ field: 'file_ext', minWidth: 80, title: '文件后缀' },
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
{
- width: 250, title: '操作', templet: ea.table.tool, operat: ['delete'], fixed: 'right', hide: function () {
- var selectMode = ea.getQueryVariable("select_mode");
+ width: 250, title: '操作', templet: ua.table.tool, operat: ['delete'], fixed: 'right', hide: function () {
+ var selectMode = ua.getQueryVariable("select_mode");
console.log(selectMode);
if (selectMode == 'radio' || selectMode == 'checkbox') {
@@ -44,16 +44,16 @@ define(["jquery", "easy-admin"], function ($, ea) {
]],
});
- ea.listen();
+ ua.listen();
},
add: function () {
- ea.listen();
+ ua.listen();
},
edit: function () {
- ea.listen();
+ ua.listen();
},
password: function () {
- ea.listen();
+ ua.listen();
}
};
return Controller;
diff --git a/public/static/plugs/lay-module/layuimini/miniAdmin.js b/public/static/plugs/lay-module/layuimini/miniAdmin.js
index 44c19bd..2f8f67f 100644
--- a/public/static/plugs/lay-module/layuimini/miniAdmin.js
+++ b/public/static/plugs/lay-module/layuimini/miniAdmin.js
@@ -1,16 +1,11 @@
-/**
- * date:2020/02/27
- * author:Mr.Chung
- * version:2.0
- * description:layuimini 主体框架扩展
- */
-
-
-define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, miniTheme, miniTab) {
+(function () {
var $ = layui.$,
layer = layui.layer,
- element = layui.element;
+ element = layui.element
+ miniMenu = window.miniMenu
+ miniTheme = window.miniTheme
+ miniTab = window.miniTab;
if (!/http(s*):\/\//.test(location.href)) {
var tips = "请先将项目部署至web容器(Apache/Tomcat/Nginx/IIS/等),否则部分数据将无法显示";
@@ -108,7 +103,7 @@ define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, mi
* @param clearUrl
*/
renderClear: function (clearUrl) {
- $('.layuimini-clear').attr('data-href',clearUrl);
+ $('.layuimini-clear').attr('data-href', clearUrl);
},
/**
@@ -175,7 +170,7 @@ define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, mi
el.msExitFullscreen();
} else if (el.oRequestFullscreen) {
el.oCancelFullScreen();
- }else if (el.mozCancelFullScreen) {
+ } else if (el.mozCancelFullScreen) {
el.mozCancelFullScreen();
} else if (el.webkitCancelFullScreen) {
el.webkitCancelFullScreen();
@@ -211,7 +206,7 @@ define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, mi
* @returns {*}
*/
success: function (title) {
- return layer.msg(title, {icon: 1, shade: this.shade, scrollbar: false, time: 2000, shadeClose: true});
+ return layer.msg(title, { icon: 1, shade: this.shade, scrollbar: false, time: 2000, shadeClose: true });
},
/**
@@ -220,7 +215,7 @@ define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, mi
* @returns {*}
*/
error: function (title) {
- return layer.msg(title, {icon: 2, shade: this.shade, scrollbar: false, time: 3000, shadeClose: true});
+ return layer.msg(title, { icon: 2, shade: this.shade, scrollbar: false, time: 3000, shadeClose: true });
},
/**
@@ -251,7 +246,7 @@ define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, mi
* 清理
*/
$('body').on('click', '[data-clear]', function () {
- var loading = layer.load(0, {shade: false, time: 2 * 1000});
+ var loading = layer.load(0, { shade: false, time: 2 * 1000 });
sessionStorage.clear();
// 判断是否清理服务端
@@ -293,14 +288,14 @@ define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, mi
tips = $(this).prop("innerHTML"),
isShow = $('.layuimini-tool i').attr('data-side-fold');
if (isShow == 0 && tips) {
- tips = "" ;
+ tips = "";
window.openTips = layer.tips(tips, $(this), {
tips: [2, '#2f4056'],
time: 300000,
- skin:"popup-tips",
- success:function (el) {
- var left = $(el).position().left - 10 ;
- $(el).css({ left:left });
+ skin: "popup-tips",
+ success: function (el) {
+ var left = $(el).position().left - 10;
+ $(el).css({ left: left });
element.render();
}
});
@@ -350,5 +345,5 @@ define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, mi
- return miniAdmin;
-});
\ No newline at end of file
+ window.miniAdmin = miniAdmin;
+})()
\ No newline at end of file
diff --git a/public/static/plugs/lay-module/layuimini/miniMenu.js b/public/static/plugs/lay-module/layuimini/miniMenu.js
index 40bbdd4..6e6ea9b 100644
--- a/public/static/plugs/lay-module/layuimini/miniMenu.js
+++ b/public/static/plugs/lay-module/layuimini/miniMenu.js
@@ -1,12 +1,6 @@
-/**
- * date:2020/02/27
- * author:Mr.Chung
- * version:2.0
- * description:layuimini 菜单框架扩展
- */
-define(["jquery"], function ($) {
+(function () {
var element = layui.element,
- laytpl = layui.laytpl,
+ laytpl = layui.laytpl,
layer = layui.layer;
var miniMenu = {
@@ -39,9 +33,9 @@ define(["jquery"], function ($) {
var leftMenuHtml = '',
childOpenClass = '',
leftMenuCheckDefault = 'layui-this';
- var me = this ;
+ var me = this;
if (menuChildOpen) childOpenClass = ' layui-nav-itemed';
- leftMenuHtml = this.renderLeftMenu(menuList,{ childOpenClass:childOpenClass }) ;
+ leftMenuHtml = this.renderLeftMenu(menuList, { childOpenClass: childOpenClass });
$('.layui-layout-body').addClass('layuimini-single-module'); //单模块标识
$('.layuimini-header-menu').remove();
$('.layuimini-menu-left').html(leftMenuHtml);
@@ -52,63 +46,63 @@ define(["jquery"], function ($) {
/**
* 渲染一级菜单
*/
- compileMenu: function(menu,isSub){
- var menuHtml = '' ;
- if(isSub){
- menuHtml = ''
+ compileMenu: function (menu, isSub) {
+ var menuHtml = '';
+ if (isSub) {
+ menuHtml = '';
}
return laytpl(menuHtml).render(menu);
},
- compileMenuContainer :function(menu,isSub){
- var wrapperHtml = '' ;
- if(isSub){
- wrapperHtml = '{{-d.children}}
' ;
+ compileMenuContainer: function (menu, isSub) {
+ var wrapperHtml = '';
+ if (isSub) {
+ wrapperHtml = '{{-d.children}}
';
}
- if(!menu.children){
+ if (!menu.children) {
return "";
}
return laytpl(wrapperHtml).render(menu);
},
- each:function(list,callback){
+ each: function (list, callback) {
var _list = [];
- for(var i = 0 ,length = list.length ; i