mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-09 19:42:47 +08:00
将js代码架构改为app下渲染;
This commit is contained in:
@@ -51,3 +51,6 @@ DEFAULT_AUTH_CHECK=false
|
|||||||
|
|
||||||
# 严格要求部分事件的返回数据,不符则抛出异常
|
# 严格要求部分事件的返回数据,不符则抛出异常
|
||||||
STRICT_EVENT=true
|
STRICT_EVENT=true
|
||||||
|
|
||||||
|
# 严格要求每个页面都建立js文件
|
||||||
|
STRICT_VIEW_JS=true
|
||||||
@@ -1473,11 +1473,11 @@ class BuildCurdService
|
|||||||
$var_name = $this->getFieldVarName($field);
|
$var_name = $this->getFieldVarName($field);
|
||||||
|
|
||||||
if ($val['formType'] == 'image') {
|
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') {
|
} elseif ($val['formType'] == 'images') {
|
||||||
continue;
|
continue;
|
||||||
} elseif ($val['formType'] == 'file') {
|
} 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') {
|
} elseif ($val['formType'] == 'files') {
|
||||||
continue;
|
continue;
|
||||||
} elseif ($val['formType'] == 'editor') {
|
} elseif ($val['formType'] == 'editor') {
|
||||||
@@ -1486,18 +1486,18 @@ class BuildCurdService
|
|||||||
continue;
|
continue;
|
||||||
} elseif (in_array($field, $this->switchFields)) {
|
} elseif (in_array($field, $this->switchFields)) {
|
||||||
if (isset($val['define']) && !empty($val['define'])) {
|
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 {
|
} 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'])) {
|
} elseif (in_array($val['formType'], ['select', 'checkbox', 'radio', 'switch'])) {
|
||||||
if (isset($val['define']) && !empty($val['define'])) {
|
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 {
|
} else {
|
||||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}'}";
|
$templateValue = "{field: '{$field}', title: '{$val['comment']}'}";
|
||||||
}
|
}
|
||||||
} elseif (in_array($field, ['remark'])) {
|
} 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)) {
|
} elseif (in_array($field, $this->sortFields)) {
|
||||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', edit: 'text'}";
|
$templateValue = "{field: '{$field}', title: '{$val['comment']}', edit: 'text'}";
|
||||||
} else {
|
} else {
|
||||||
@@ -1512,11 +1512,11 @@ class BuildCurdService
|
|||||||
$table = Str::camel($table);
|
$table = Str::camel($table);
|
||||||
foreach ($tableVal['tableColumns'] as $field => $val) {
|
foreach ($tableVal['tableColumns'] as $field => $val) {
|
||||||
if ($val['formType'] == 'image') {
|
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') {
|
} elseif ($val['formType'] == 'images') {
|
||||||
continue;
|
continue;
|
||||||
} elseif ($val['formType'] == 'file') {
|
} 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') {
|
} elseif ($val['formType'] == 'files') {
|
||||||
continue;
|
continue;
|
||||||
} elseif ($val['formType'] == 'editor') {
|
} elseif ($val['formType'] == 'editor') {
|
||||||
@@ -1526,9 +1526,9 @@ class BuildCurdService
|
|||||||
} elseif ($val['formType'] == 'select') {
|
} elseif ($val['formType'] == 'select') {
|
||||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}'}";
|
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}'}";
|
||||||
} elseif (in_array($field, ['remark'])) {
|
} 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)) {
|
} 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)) {
|
} elseif (in_array($field, $this->sortFields)) {
|
||||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', edit: 'text'}";
|
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', edit: 'text'}";
|
||||||
} else {
|
} 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(
|
$jsValue = $this->replaceTemplate(
|
||||||
$this->getTemplate("static{$this->DS}js"),
|
$this->getTemplate("static{$this->DS}js"),
|
||||||
|
|||||||
@@ -14,20 +14,20 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
cols: [[
|
cols: [[
|
||||||
{{indexCols}}
|
{{indexCols}}
|
||||||
]],
|
]],
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
add: function () {
|
add: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
33
app/admin/view/common/_require.html
Normal file
33
app/admin/view/common/_require.html
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
||||||
|
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="__STATIC__/admin/css/public.css" media="all">
|
||||||
|
<link rel="stylesheet" href="__STATIC__/common/css/theme/index.css">
|
||||||
|
|
||||||
|
<!-- 基础js -->
|
||||||
|
<script src="__STATIC__/plugs/jquery-3.4.1/jquery-3.4.1.min.js"></script>
|
||||||
|
<script src="__STATIC__/common/js/app.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/layui-v2.8.16/layui.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
<!-- 其他js -->
|
||||||
|
<script src="__STATIC__/plugs/jq-module/jquery.particleground.min.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/echarts/echarts.min.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/echarts/echarts-theme.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/layuimini/miniMenu.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/layuimini/miniTab.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/layuimini/miniTheme.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/layuimini/miniAdmin.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/treetable-lay/treetable.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/tableData/tableData.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/tagInput/tagInput.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/propertyInput/propertyInput.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/iconPicker/iconPickerFa.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/lay-module/autocomplete/autocomplete.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/vue-2.6.10/vue.min.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/ckeditor4/ckeditor.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/jq-module/city-picker/js/city-picker.data.min.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/jq-module/city-picker/js/city-picker.min.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/clipboard.js/clipboard.min.js"></script>
|
||||||
|
<script src="__STATIC__/plugs/ulthon-admin/ulthon-admin.js"></script>
|
||||||
0
app/admin/view/debug/log/_common.js
Normal file
0
app/admin/view/debug/log/_common.js
Normal file
@@ -1,53 +0,0 @@
|
|||||||
<div class="layuimini-container">
|
|
||||||
<form id="app-form" class="layui-form layuimini-form">
|
|
||||||
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">uid</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="uid" class="layui-input" lay-verify="required" placeholder="请输入uid" value="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">level</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="level" class="layui-input" lay-verify="required" placeholder="请输入level" value="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item layui-form-text">
|
|
||||||
<label class="layui-form-label">日志内容</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<textarea name="content" class="layui-textarea" lay-verify="required" placeholder="请输入日志内容"></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">create_time_title</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="create_time_title" class="layui-input" lay-verify="required" placeholder="请输入create_time_title" value="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">app_name</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="app_name" class="layui-input" lay-verify="required" placeholder="请输入app_name" value="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">controller_name</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="controller_name" class="layui-input" lay-verify="required" placeholder="请输入controller_name" value="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">action_name</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="action_name" class="layui-input" lay-verify="required" placeholder="请输入action_name" value="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="hr-line"></div>
|
|
||||||
<div class="layui-form-item text-center">
|
|
||||||
<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
|
|
||||||
<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
<div class="layuimini-container">
|
|
||||||
<form id="app-form" class="layui-form layuimini-form">
|
|
||||||
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">uid</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="uid" class="layui-input" lay-verify="required" placeholder="请输入uid" value="{$row.uid|default=''}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">level</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="level" class="layui-input" lay-verify="required" placeholder="请输入level" value="{$row.level|default=''}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item layui-form-text">
|
|
||||||
<label class="layui-form-label">日志内容</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<textarea name="content" class="layui-textarea" lay-verify="required" placeholder="请输入日志内容">{$row.content|raw|default=''}</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">create_time_title</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="create_time_title" class="layui-input" lay-verify="required" placeholder="请输入create_time_title" value="{$row.create_time_title|default=''}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">app_name</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="app_name" class="layui-input" lay-verify="required" placeholder="请输入app_name" value="{$row.app_name|default=''}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">controller_name</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="controller_name" class="layui-input" lay-verify="required" placeholder="请输入controller_name" value="{$row.controller_name|default=''}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item">
|
|
||||||
<label class="layui-form-label">action_name</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<input type="text" name="action_name" class="layui-input" lay-verify="required" placeholder="请输入action_name" value="{$row.action_name|default=''}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="hr-line"></div>
|
|
||||||
<div class="layui-form-item text-center">
|
|
||||||
<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
|
|
||||||
<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
51
app/admin/view/debug/log/index.js
Normal file
51
app/admin/view/debug/log/index.js
Normal file
@@ -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 '<div class="' + className + '">' + data.content + '</div>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 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();
|
||||||
|
});
|
||||||
0
app/admin/view/index/_common.js
Normal file
0
app/admin/view/index/_common.js
Normal file
3
app/admin/view/index/edit_admin.js
Normal file
3
app/admin/view/index/edit_admin.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
3
app/admin/view/index/edit_password.js
Normal file
3
app/admin/view/index/edit_password.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
25
app/admin/view/index/index.js
Normal file
25
app/admin/view/index/index.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
$(function () {
|
||||||
|
var options = {
|
||||||
|
iniUrl: ua.url('ajax/initAdmin'), // 初始化接口
|
||||||
|
clearUrl: ua.url("ajax/clearCache"), // 缓存清理接口
|
||||||
|
urlHashLocation: true, // 是否打开hash定位
|
||||||
|
bgColorDefault: false, // 主题默认配置
|
||||||
|
multiModule: true, // 是否开启多模块
|
||||||
|
menuChildOpen: false, // 是否默认展开菜单
|
||||||
|
loadingTime: 0, // 初始化加载时间
|
||||||
|
pageAnim: true, // iframe窗口动画
|
||||||
|
maxTabNum: 20, // 最大的tab打开数量
|
||||||
|
};
|
||||||
|
miniAdmin.render(options);
|
||||||
|
|
||||||
|
$('.login-out').on("click", function () {
|
||||||
|
ua.request.get({
|
||||||
|
url: 'login/out',
|
||||||
|
prefix: true,
|
||||||
|
}, function (res) {
|
||||||
|
ua.msg.success(res.msg, function () {
|
||||||
|
window.location = ua.url('login/index');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
83
app/admin/view/index/welcome.js
Normal file
83
app/admin/view/index/welcome.js
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
$(function () {
|
||||||
|
/**
|
||||||
|
* 报表功能
|
||||||
|
*/
|
||||||
|
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
|
||||||
|
var optionRecords = {
|
||||||
|
title: {
|
||||||
|
text: '访问统计'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: '3%',
|
||||||
|
right: '4%',
|
||||||
|
bottom: '3%',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
boundaryGap: false,
|
||||||
|
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value'
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '邮件营销',
|
||||||
|
type: 'line',
|
||||||
|
stack: '总量',
|
||||||
|
data: [120, 132, 101, 134, 90, 230, 210]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '联盟广告',
|
||||||
|
type: 'line',
|
||||||
|
stack: '总量',
|
||||||
|
data: [220, 182, 191, 234, 290, 330, 310]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '视频广告',
|
||||||
|
type: 'line',
|
||||||
|
stack: '总量',
|
||||||
|
data: [150, 232, 201, 154, 190, 330, 410]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '直接访问',
|
||||||
|
type: 'line',
|
||||||
|
stack: '总量',
|
||||||
|
data: [320, 332, 301, 334, 390, 330, 320]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '搜索引擎',
|
||||||
|
type: 'line',
|
||||||
|
stack: '总量',
|
||||||
|
data: [820, 932, 901, 934, 1290, 1330, 1320]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var checkChartVisibleTimer = setInterval(() => {
|
||||||
|
var isChartVisible = $('#echarts-records').is(':visible');
|
||||||
|
if (isChartVisible) {
|
||||||
|
echartsRecords.setOption(optionRecords);
|
||||||
|
echartsRecords.resize();
|
||||||
|
window.addEventListener("resize", function () {
|
||||||
|
echartsRecords.resize();
|
||||||
|
});
|
||||||
|
|
||||||
|
clearInterval(checkChartVisibleTimer);
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
@@ -7,14 +7,7 @@
|
|||||||
<meta name="renderer" content="webkit">
|
<meta name="renderer" content="webkit">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
<!--[if lt IE 9]>
|
{include file='common/_require'/}
|
||||||
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
|
||||||
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
<link rel="stylesheet" href="__STATIC__/admin/css/public.css?v={$version}" media="all">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="__STATIC__/common/css/theme/index.css?v={$version}">
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.CONFIG = {
|
window.CONFIG = {
|
||||||
ADMIN: "{$adminModuleName|default='admin'}",
|
ADMIN: "{$adminModuleName|default='admin'}",
|
||||||
@@ -25,11 +18,15 @@
|
|||||||
VERSION: "{$version|default='1.0.0'}",
|
VERSION: "{$version|default='1.0.0'}",
|
||||||
CSRF_TOKEN: "{:token()}",
|
CSRF_TOKEN: "{:token()}",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var PATH_CONFIG = {
|
||||||
|
iconLess: "__STATIC__/plugs/font-awesome-4.7.0/less/variables.less",
|
||||||
|
};
|
||||||
|
window.PATH_CONFIG = PATH_CONFIG;
|
||||||
</script>
|
</script>
|
||||||
<script src="__STATIC__/common/js/app.js"></script>
|
|
||||||
<script src="__STATIC__/plugs/layui-v2.8.16/layui.js?v={$version}" charset="utf-8"></script>
|
{$content_js|raw}
|
||||||
<script src="__STATIC__/plugs/require-2.3.6/require.js?v={$version}" charset="utf-8"></script>
|
|
||||||
<script src="__STATIC__/config-admin.js?v={$version}" charset="utf-8"></script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
0
app/admin/view/login/_common.js
Normal file
0
app/admin/view/login/_common.js
Normal file
@@ -1,4 +1,4 @@
|
|||||||
<div class="layui-btn layui-btn-xs" id="demo-login-btn">演示账号快速登录</div>
|
<div class="layui-btn layui-btn-xs" id="demo-login-btn">演示账号一键填写</div>
|
||||||
<script>
|
<script>
|
||||||
$('#demo-login-btn').click(function() {
|
$('#demo-login-btn').click(function() {
|
||||||
$('[name="username"]').val('admin')
|
$('[name="username"]').val('admin')
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="layui-form-item" style="text-align:center; width:100%;height:100%;margin:0px;">
|
<div class="layui-form-item" style="text-align:center; width:100%;height:100%;margin:0px;">
|
||||||
<button class="login-btn" lay-submit>立即登录</button>
|
<button class="login-btn" lay-submit>立即登录</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item" style="padding: 10px;">
|
<div class="layui-form-item" style="padding: 10px;text-align: right;">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
{:event_view_content("AdminLoginType")}
|
{:event_view_content("AdminLoginType")}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
45
app/admin/view/login/index.js
Normal file
45
app/admin/view/login/index.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
$(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();
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen(function (data) {
|
||||||
|
data['keep_login'] = $('.icon-nocheck').hasClass('icon-check') ? 1 : 0;
|
||||||
|
return data;
|
||||||
|
}, function (res) {
|
||||||
|
ua.msg.success(res.msg, function () {
|
||||||
|
window.location = ua.url('index');
|
||||||
|
});
|
||||||
|
}, function (res) {
|
||||||
|
ua.msg.error(res.msg, function () {
|
||||||
|
$('#refreshCaptcha').trigger("click");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('.forget-password').click(function () {
|
||||||
|
layer.msg('可以使用重置密码命令设置:<br/>php think admin:resetPassword<br><a target="_blank" href="http://doc.ulthon.com/home/read/ulthon_admin/reset_password/15/16.html"> 参考文档</a>');
|
||||||
|
});
|
||||||
|
});
|
||||||
10
app/admin/view/mall/cate/_common.js
Normal file
10
app/admin/view/mall/cate/_common.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
var init = {
|
||||||
|
table_elem: '#currentTable',
|
||||||
|
table_render_id: 'currentTableRenderId',
|
||||||
|
index_url: 'mall.cate/index',
|
||||||
|
add_url: 'mall.cate/add',
|
||||||
|
edit_url: 'mall.cate/edit',
|
||||||
|
delete_url: 'mall.cate/delete',
|
||||||
|
export_url: 'mall.cate/export',
|
||||||
|
modify_url: 'mall.cate/modify',
|
||||||
|
};
|
||||||
3
app/admin/view/mall/cate/add.js
Normal file
3
app/admin/view/mall/cate/add.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function(){
|
||||||
|
ua.listen();
|
||||||
|
})
|
||||||
3
app/admin/view/mall/cate/edit.js
Normal file
3
app/admin/view/mall/cate/edit.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
20
app/admin/view/mall/cate/index.js
Normal file
20
app/admin/view/mall/cate/index.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
$(function () {
|
||||||
|
|
||||||
|
|
||||||
|
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: ua.table.image },
|
||||||
|
{ field: 'remark', minWidth: 80, title: '备注信息' },
|
||||||
|
{ 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: ua.table.tool }
|
||||||
|
]],
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
13
app/admin/view/mall/goods/_common.js
Normal file
13
app/admin/view/mall/goods/_common.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
var init = {
|
||||||
|
table_elem: '#currentTable',
|
||||||
|
table_render_id: 'currentTableRenderId',
|
||||||
|
index_url: 'mall.goods/index',
|
||||||
|
add_url: 'mall.goods/add',
|
||||||
|
edit_url: 'mall.goods/edit',
|
||||||
|
delete_url: 'mall.goods/delete',
|
||||||
|
export_url: 'mall.goods/export',
|
||||||
|
modify_url: 'mall.goods/modify',
|
||||||
|
stock_url: 'mall.goods/stock',
|
||||||
|
read_url: 'mall.goods/read',
|
||||||
|
formFullScreen: true,
|
||||||
|
};
|
||||||
3
app/admin/view/mall/goods/add.js
Normal file
3
app/admin/view/mall/goods/add.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function(){
|
||||||
|
ua.listen();
|
||||||
|
})
|
||||||
3
app/admin/view/mall/goods/edit.js
Normal file
3
app/admin/view/mall/goods/edit.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
69
app/admin/view/mall/goods/index.js
Normal file
69
app/admin/view/mall/goods/index.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
$(function () {
|
||||||
|
|
||||||
|
|
||||||
|
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: 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: ua.table.image },
|
||||||
|
{ field: 'market_price', width: 100, title: '市场价', templet: ua.table.price },
|
||||||
|
{
|
||||||
|
field: 'discount_price', width: 120, title: '折扣价', templet: ua.table.price, totalRow: true,
|
||||||
|
templet: ua.table.copyText,
|
||||||
|
valueParser(value) {
|
||||||
|
return '¥' + value;
|
||||||
|
},
|
||||||
|
copyText(value, data) {
|
||||||
|
return data.discount_price;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ field: 'total_stock', width: 100, title: '库存统计', totalRow: '{{= parseInt(d.TOTAL_NUMS) }} 个' },
|
||||||
|
{
|
||||||
|
field: 'stock',
|
||||||
|
width: 100,
|
||||||
|
title: '剩余库存',
|
||||||
|
valueParser(value, data) {
|
||||||
|
if (value >= 20) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return value + '(缺货)';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ field: 'virtual_sales', width: 100, title: '虚拟销量' },
|
||||||
|
{ field: 'sales', width: 80, title: '销量' },
|
||||||
|
{ field: 'status', title: '状态', width: 85, selectList: { 0: '禁用', 1: '启用' }, templet: ua.table.switch },
|
||||||
|
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
|
||||||
|
{
|
||||||
|
width: 250,
|
||||||
|
title: '操作',
|
||||||
|
templet: ua.table.tool,
|
||||||
|
fixed: 'right',
|
||||||
|
operat: [
|
||||||
|
'edit',
|
||||||
|
[{
|
||||||
|
text: '入库',
|
||||||
|
url: init.stock_url,
|
||||||
|
method: 'open',
|
||||||
|
auth: 'stock',
|
||||||
|
class: 'layui-btn layui-btn-xs layui-btn-normal',
|
||||||
|
}, {
|
||||||
|
text: '详情',
|
||||||
|
url: init.read_url,
|
||||||
|
method: 'open',
|
||||||
|
auth: 'edit',
|
||||||
|
extend: 'data-full="true"',
|
||||||
|
class: 'layui-btn layui-btn-xs layui-btn-primary',
|
||||||
|
},],
|
||||||
|
'delete']
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
3
app/admin/view/mall/goods/read.js
Normal file
3
app/admin/view/mall/goods/read.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
3
app/admin/view/mall/goods/stock.js
Normal file
3
app/admin/view/mall/goods/stock.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
10
app/admin/view/mall/tag/_common.js
Normal file
10
app/admin/view/mall/tag/_common.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
var init = {
|
||||||
|
table_elem: '#currentTable',
|
||||||
|
table_render_id: 'currentTableRenderId',
|
||||||
|
index_url: 'mall.tag/index',
|
||||||
|
add_url: 'mall.tag/add',
|
||||||
|
edit_url: 'mall.tag/edit',
|
||||||
|
delete_url: 'mall.tag/delete',
|
||||||
|
export_url: 'mall.tag/export',
|
||||||
|
modify_url: 'mall.tag/modify',
|
||||||
|
};
|
||||||
3
app/admin/view/mall/tag/add.js
Normal file
3
app/admin/view/mall/tag/add.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
3
app/admin/view/mall/tag/edit.js
Normal file
3
app/admin/view/mall/tag/edit.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
13
app/admin/view/mall/tag/index.js
Normal file
13
app/admin/view/mall/tag/index.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.table.render({
|
||||||
|
init: init,
|
||||||
|
cols: [[
|
||||||
|
{ type: 'checkbox' },
|
||||||
|
{ field: 'id', title: 'id' },
|
||||||
|
{ field: 'title', title: '名称' },
|
||||||
|
{ width: 250, title: '操作', templet: ua.table.tool },
|
||||||
|
]],
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
11
app/admin/view/system/admin/_common.js
Normal file
11
app/admin/view/system/admin/_common.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
var init = {
|
||||||
|
table_elem: '#currentTable',
|
||||||
|
table_render_id: 'currentTableRenderId',
|
||||||
|
index_url: 'system.admin/index',
|
||||||
|
add_url: 'system.admin/add',
|
||||||
|
edit_url: 'system.admin/edit',
|
||||||
|
delete_url: 'system.admin/delete',
|
||||||
|
modify_url: 'system.admin/modify',
|
||||||
|
export_url: 'system.admin/export',
|
||||||
|
password_url: 'system.admin/password',
|
||||||
|
};
|
||||||
3
app/admin/view/system/admin/add.js
Normal file
3
app/admin/view/system/admin/add.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
3
app/admin/view/system/admin/edit.js
Normal file
3
app/admin/view/system/admin/edit.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
@@ -1,12 +1,6 @@
|
|||||||
<div class="layuimini-container">
|
<div class="layuimini-container">
|
||||||
<div class="layuimini-main">
|
<div class="layuimini-main">
|
||||||
<table id="currentTable" class="layui-table layui-hide"
|
<table id="currentTable" class="layui-table layui-hide" data-auth-add="{:auth('system.admin/add')}" data-auth-edit="{:auth('system.admin/edit')}" data-auth-delete="{:auth('system.admin/delete')}" data-auth-password="{:auth('system.admin/password')}" data-auth-modify="{:auth('system.admin/modify')}" lay-filter="currentTable">
|
||||||
data-auth-add="{:auth('system.admin/add')}"
|
|
||||||
data-auth-edit="{:auth('system.admin/edit')}"
|
|
||||||
data-auth-delete="{:auth('system.admin/delete')}"
|
|
||||||
data-auth-password="{:auth('system.admin/password')}"
|
|
||||||
data-auth-modify="{:auth('system.admin/modify')}"
|
|
||||||
lay-filter="currentTable">
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
38
app/admin/view/system/admin/index.js
Normal file
38
app/admin/view/system/admin/index.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
$(function () {
|
||||||
|
|
||||||
|
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: 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: ua.table.switch },
|
||||||
|
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
|
||||||
|
{
|
||||||
|
width: 250,
|
||||||
|
title: '操作',
|
||||||
|
fixed: 'right',
|
||||||
|
templet: ua.table.tool,
|
||||||
|
operat: [
|
||||||
|
'edit',
|
||||||
|
[{
|
||||||
|
text: '设置密码',
|
||||||
|
titleField: 'username',
|
||||||
|
url: init.password_url,
|
||||||
|
method: 'open',
|
||||||
|
auth: 'password',
|
||||||
|
class: 'layui-btn layui-btn-normal layui-btn-xs',
|
||||||
|
}],
|
||||||
|
'delete'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
3
app/admin/view/system/admin/password.js
Normal file
3
app/admin/view/system/admin/password.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
11
app/admin/view/system/auth/_common.js
Normal file
11
app/admin/view/system/auth/_common.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
var init = {
|
||||||
|
table_elem: '#currentTable',
|
||||||
|
table_render_id: 'currentTableRenderId',
|
||||||
|
index_url: 'system.auth/index',
|
||||||
|
add_url: 'system.auth/add',
|
||||||
|
edit_url: 'system.auth/edit',
|
||||||
|
delete_url: 'system.auth/delete',
|
||||||
|
export_url: 'system.auth/export',
|
||||||
|
modify_url: 'system.auth/modify',
|
||||||
|
authorize_url: 'system.auth/authorize',
|
||||||
|
};
|
||||||
3
app/admin/view/system/auth/add.js
Normal file
3
app/admin/view/system/auth/add.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
32
app/admin/view/system/auth/authorize.js
Normal file
32
app/admin/view/system/auth/authorize.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
$(function () {
|
||||||
|
var tree = layui.tree;
|
||||||
|
|
||||||
|
ua.request.get(
|
||||||
|
{
|
||||||
|
url: window.location.href,
|
||||||
|
}, function (res) {
|
||||||
|
res.data = res.data || [];
|
||||||
|
tree.render({
|
||||||
|
elem: '#node_ids',
|
||||||
|
data: res.data,
|
||||||
|
showCheckbox: true,
|
||||||
|
id: 'nodeDataId',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
ua.listen(function (data) {
|
||||||
|
var checkedData = tree.getChecked('nodeDataId');
|
||||||
|
var ids = [];
|
||||||
|
$.each(checkedData, function (i, v) {
|
||||||
|
ids.push(v.id);
|
||||||
|
if (v.children !== undefined && v.children.length > 0) {
|
||||||
|
$.each(v.children, function (ii, vv) {
|
||||||
|
ids.push(vv.id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
data.node = JSON.stringify(ids);
|
||||||
|
return data;
|
||||||
|
});
|
||||||
|
});
|
||||||
3
app/admin/view/system/auth/edit.js
Normal file
3
app/admin/view/system/auth/edit.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$(function () {
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
33
app/admin/view/system/auth/index.js
Normal file
33
app/admin/view/system/auth/index.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
$(function () {
|
||||||
|
|
||||||
|
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: 'remark', minWidth: 80, title: '备注信息' },
|
||||||
|
{ 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: ua.table.tool,
|
||||||
|
operat: [
|
||||||
|
'edit',
|
||||||
|
[{
|
||||||
|
text: '授权',
|
||||||
|
url: init.authorize_url,
|
||||||
|
method: 'open',
|
||||||
|
auth: 'authorize',
|
||||||
|
class: 'layui-btn layui-btn-normal layui-btn-xs',
|
||||||
|
}],
|
||||||
|
'delete'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
0
app/admin/view/system/config/_common.js
Normal file
0
app/admin/view/system/config/_common.js
Normal file
12
app/admin/view/system/config/index.js
Normal file
12
app/admin/view/system/config/index.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
$(function () {
|
||||||
|
var form = layui.form;
|
||||||
|
$('.show-type-item').hide();
|
||||||
|
$('.show-type-item.' + upload_type).show();
|
||||||
|
form.on("radio(upload_type)", function (data) {
|
||||||
|
|
||||||
|
$('.show-type-item').hide();
|
||||||
|
$('.show-type-item.' + this.value).show();
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
14
app/admin/view/system/menu/_common.js
Normal file
14
app/admin/view/system/menu/_common.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
var table = layui.table,
|
||||||
|
treetable = layui.treetable,
|
||||||
|
iconPickerFa = layui.iconPickerFa,
|
||||||
|
autocomplete = layui.autocomplete;
|
||||||
|
|
||||||
|
var init = {
|
||||||
|
table_elem: '#currentTable',
|
||||||
|
table_render_id: 'currentTableRenderId',
|
||||||
|
index_url: 'system.menu/index',
|
||||||
|
add_url: 'system.menu/add',
|
||||||
|
delete_url: 'system.menu/delete',
|
||||||
|
edit_url: 'system.menu/edit',
|
||||||
|
modify_url: 'system.menu/modify',
|
||||||
|
};
|
||||||
31
app/admin/view/system/menu/add.js
Normal file
31
app/admin/view/system/menu/add.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
$(function () {
|
||||||
|
iconPickerFa.render({
|
||||||
|
elem: '#icon',
|
||||||
|
url: PATH_CONFIG.iconLess,
|
||||||
|
limit: 12,
|
||||||
|
click: function (data) {
|
||||||
|
$('#icon').val('fa ' + data.icon);
|
||||||
|
},
|
||||||
|
success: function (d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
autocomplete.render({
|
||||||
|
elem: $('#href')[0],
|
||||||
|
url: ua.url('system.menu/getMenuTips'),
|
||||||
|
template_val: '{{-d.node}}',
|
||||||
|
template_txt: '{{-d.node}} <span class=\'layui-badge layui-bg-gray\'>{{-d.title}}</span>',
|
||||||
|
onselect: function (resp) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen(function (data) {
|
||||||
|
return data;
|
||||||
|
}, function (res) {
|
||||||
|
ua.msg.success(res.msg, function () {
|
||||||
|
var index = parent.layer.getFrameIndex(window.name);
|
||||||
|
parent.layer.close(index);
|
||||||
|
parent.$('[data-treetable-refresh]').trigger("click");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
31
app/admin/view/system/menu/edit.js
Normal file
31
app/admin/view/system/menu/edit.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
$(function () {
|
||||||
|
iconPickerFa.render({
|
||||||
|
elem: '#icon',
|
||||||
|
url: PATH_CONFIG.iconLess,
|
||||||
|
limit: 12,
|
||||||
|
click: function (data) {
|
||||||
|
$('#icon').val('fa ' + data.icon);
|
||||||
|
},
|
||||||
|
success: function (d) {
|
||||||
|
console.log(d);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
autocomplete.render({
|
||||||
|
elem: $('#href')[0],
|
||||||
|
url: ua.url('system.menu/getMenuTips'),
|
||||||
|
template_val: '{{-d.node}}',
|
||||||
|
template_txt: '{{-d.node}} <span class=\'layui-badge layui-bg-gray\'>{{-d.title}}</span>',
|
||||||
|
onselect: function (resp) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen(function (data) {
|
||||||
|
return data;
|
||||||
|
}, function (res) {
|
||||||
|
ua.msg.success(res.msg, function () {
|
||||||
|
var index = parent.layer.getFrameIndex(window.name);
|
||||||
|
parent.layer.close(index);
|
||||||
|
parent.$('[data-treetable-refresh]').trigger("click");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
162
app/admin/view/system/menu/index.js
Normal file
162
app/admin/view/system/menu/index.js
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
$(function () {
|
||||||
|
|
||||||
|
var renderTable = function () {
|
||||||
|
layer.load(2);
|
||||||
|
treetable.render({
|
||||||
|
treeColIndex: 1,
|
||||||
|
treeSpid: 0,
|
||||||
|
homdPid: 99999999,
|
||||||
|
treeIdName: 'id',
|
||||||
|
treePidName: 'pid',
|
||||||
|
url: ua.url(init.index_url),
|
||||||
|
elem: init.table_elem,
|
||||||
|
id: init.table_render_id,
|
||||||
|
toolbar: '#toolbar',
|
||||||
|
page: false,
|
||||||
|
skin: 'line',
|
||||||
|
|
||||||
|
// @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: ua.table.icon },
|
||||||
|
{ field: 'href', sort: false, minWidth: 120, title: '菜单链接' },
|
||||||
|
{
|
||||||
|
field: 'is_home', sort: false,
|
||||||
|
width: 80,
|
||||||
|
title: '类型',
|
||||||
|
templet: function (d) {
|
||||||
|
if (d.pid === 99999999) {
|
||||||
|
return '<span class="layui-badge layui-bg-blue">首页</span>';
|
||||||
|
}
|
||||||
|
if (d.pid === 0) {
|
||||||
|
return '<span class="layui-badge layui-bg-gray">模块</span>';
|
||||||
|
} else {
|
||||||
|
return '<span class="layui-badge-rim">菜单</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 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: ua.table.tool,
|
||||||
|
operat: [
|
||||||
|
[{
|
||||||
|
text: '添加下级',
|
||||||
|
url: init.add_url,
|
||||||
|
method: 'open',
|
||||||
|
auth: 'add',
|
||||||
|
class: 'layui-btn layui-btn-xs layui-btn-normal',
|
||||||
|
extend: 'data-full="true"',
|
||||||
|
_if: function (data) {
|
||||||
|
if (data.pid == 99999999) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}, {
|
||||||
|
text: '编辑',
|
||||||
|
url: init.edit_url,
|
||||||
|
method: 'open',
|
||||||
|
auth: 'edit',
|
||||||
|
class: 'layui-btn layui-btn-xs layui-btn-success',
|
||||||
|
extend: 'data-full="true"',
|
||||||
|
_if: 'status'
|
||||||
|
}, {
|
||||||
|
text: '删除',
|
||||||
|
method: 'none',
|
||||||
|
auth: 'delete',
|
||||||
|
class: 'layui-btn layui-btn-xs layui-btn-danger',
|
||||||
|
extend: 'data-treetable-delete-item="1" data-url="' + init.delete_url + '"',
|
||||||
|
data: ['id', 'title'],
|
||||||
|
_if(data) {
|
||||||
|
|
||||||
|
if (data.pid == ua.getDataBrage('menu_home_pid')) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},],
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]], init),
|
||||||
|
done: function () {
|
||||||
|
layer.closeAll('loading');
|
||||||
|
|
||||||
|
$(".layui-table-main tr").each(function (index, val) {
|
||||||
|
$(".layui-table-fixed").each(function () {
|
||||||
|
$($(this).find(".layui-table-body tbody tr")[index]).height($(val).height());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
renderTable();
|
||||||
|
|
||||||
|
$('body').on('click', '[data-treetable-refresh]', function () {
|
||||||
|
renderTable();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on('click', '[data-treetable-delete-item]', function () {
|
||||||
|
var id = $(this).data('id');
|
||||||
|
var url = $(this).attr('data-url');
|
||||||
|
url = url != undefined ? ua.url(url) : window.location.href;
|
||||||
|
ua.msg.confirm('确定删除?', function () {
|
||||||
|
ua.request.post({
|
||||||
|
url: url,
|
||||||
|
data: {
|
||||||
|
id: id
|
||||||
|
},
|
||||||
|
}, function (res) {
|
||||||
|
ua.msg.success(res.msg, function () {
|
||||||
|
renderTable();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
})
|
||||||
|
|
||||||
|
$('body').on('click', '[data-treetable-delete]', function () {
|
||||||
|
var tableId = $(this).attr('data-treetable-delete'),
|
||||||
|
url = $(this).attr('data-url');
|
||||||
|
tableId = tableId || init.table_render_id;
|
||||||
|
url = url != undefined ? ua.url(url) : window.location.href;
|
||||||
|
var checkStatus = table.checkStatus(tableId),
|
||||||
|
data = checkStatus.data;
|
||||||
|
if (data.length <= 0) {
|
||||||
|
ua.msg.error('请勾选需要删除的数据');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var ids = [];
|
||||||
|
$.each(data, function (i, v) {
|
||||||
|
ids.push(v.id);
|
||||||
|
});
|
||||||
|
ua.msg.confirm('确定删除?', function () {
|
||||||
|
ua.request.post({
|
||||||
|
url: url,
|
||||||
|
data: {
|
||||||
|
id: ids
|
||||||
|
},
|
||||||
|
}, function (res) {
|
||||||
|
ua.msg.success(res.msg, function () {
|
||||||
|
renderTable();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.table.listenSwitch({ filter: 'status', url: init.modify_url });
|
||||||
|
|
||||||
|
ua.table.listenEdit(init, 'currentTable', init.table_render_id, false);
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
9
app/admin/view/system/node/_common.js
Normal file
9
app/admin/view/system/node/_common.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
var init = {
|
||||||
|
table_elem: '#currentTable',
|
||||||
|
table_render_id: 'currentTableRenderId',
|
||||||
|
index_url: 'system.node/index',
|
||||||
|
add_url: 'system.node/add',
|
||||||
|
edit_url: 'system.node/edit',
|
||||||
|
delete_url: 'system.node/delete',
|
||||||
|
modify_url: 'system.node/modify',
|
||||||
|
};
|
||||||
47
app/admin/view/system/node/index.js
Normal file
47
app/admin/view/system/node/index.js
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
$(function () {
|
||||||
|
|
||||||
|
ua.table.render({
|
||||||
|
init: init,
|
||||||
|
search: false,
|
||||||
|
page: false,
|
||||||
|
toolbar: ['refresh',
|
||||||
|
[{
|
||||||
|
text: '更新节点',
|
||||||
|
title: '确定更新新节点?',
|
||||||
|
url: 'system.node/refreshNode?force=0',
|
||||||
|
method: 'request',
|
||||||
|
auth: 'refresh',
|
||||||
|
class: 'layui-btn layui-btn-success layui-btn-sm',
|
||||||
|
icon: 'fa fa-hourglass',
|
||||||
|
extend: 'data-table="' + init.table_render_id + '"',
|
||||||
|
}, {
|
||||||
|
text: '强制更新节点',
|
||||||
|
title: '该操作会覆盖已存在的节点信息。<br>确定强制更新节点?',
|
||||||
|
url: 'system.node/refreshNode?force=1',
|
||||||
|
method: 'request',
|
||||||
|
auth: 'refresh',
|
||||||
|
class: 'layui-btn layui-btn-sm layui-btn-normal',
|
||||||
|
icon: 'fa fa-hourglass',
|
||||||
|
extend: 'data-table="' + init.table_render_id + '"',
|
||||||
|
}, {
|
||||||
|
|
||||||
|
text: '清除失效节点',
|
||||||
|
title: '确定清除失效节点?',
|
||||||
|
url: 'system.node/clearNode',
|
||||||
|
method: 'request',
|
||||||
|
auth: 'clear',
|
||||||
|
class: 'layui-btn layui-btn-sm layui-btn-danger',
|
||||||
|
icon: 'fa fa-trash-o',
|
||||||
|
extend: 'data-table="' + init.table_render_id + '"',
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
cols: [[
|
||||||
|
{ field: 'node', sort: false, minWidth: 200, align: 'left', title: '系统节点' },
|
||||||
|
{ field: 'title', sort: false, minWidth: 80, title: '节点名称 <i class="table-edit-tips color-red">*</i>', 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: ua.table.switch },
|
||||||
|
]],
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
13
app/admin/view/system/quick/_common.js
Normal file
13
app/admin/view/system/quick/_common.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
var iconPickerFa = layui.iconPickerFa,
|
||||||
|
autocomplete = layui.autocomplete;
|
||||||
|
|
||||||
|
var init = {
|
||||||
|
table_elem: '#currentTable',
|
||||||
|
table_render_id: 'currentTableRenderId',
|
||||||
|
index_url: 'system.quick/index',
|
||||||
|
add_url: 'system.quick/add',
|
||||||
|
edit_url: 'system.quick/edit',
|
||||||
|
delete_url: 'system.quick/delete',
|
||||||
|
export_url: 'system.quick/export',
|
||||||
|
modify_url: 'system.quick/modify',
|
||||||
|
};
|
||||||
23
app/admin/view/system/quick/add.js
Normal file
23
app/admin/view/system/quick/add.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
$(function () {
|
||||||
|
iconPickerFa.render({
|
||||||
|
elem: '#icon',
|
||||||
|
url: PATH_CONFIG.iconLess,
|
||||||
|
limit: 12,
|
||||||
|
click: function (data) {
|
||||||
|
$('#icon').val('fa ' + data.icon);
|
||||||
|
},
|
||||||
|
success: function (d) {
|
||||||
|
console.log(d);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
autocomplete.render({
|
||||||
|
elem: $('#href')[0],
|
||||||
|
url: ua.url('system.menu/getMenuTips'),
|
||||||
|
template_val: '{{d.node}}',
|
||||||
|
template_txt: '{{d.node}} <span class=\'layui-badge layui-bg-gray\'>{{d.title}}</span>',
|
||||||
|
onselect: function (resp) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
23
app/admin/view/system/quick/edit.js
Normal file
23
app/admin/view/system/quick/edit.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
$(function () {
|
||||||
|
iconPickerFa.render({
|
||||||
|
elem: '#icon',
|
||||||
|
url: PATH_CONFIG.iconLess,
|
||||||
|
limit: 12,
|
||||||
|
click: function (data) {
|
||||||
|
$('#icon').val('fa ' + data.icon);
|
||||||
|
},
|
||||||
|
success: function (d) {
|
||||||
|
console.log(d);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
autocomplete.render({
|
||||||
|
elem: $('#href')[0],
|
||||||
|
url: ua.url('system.menu/getMenuTips'),
|
||||||
|
template_val: '{{d.node}}',
|
||||||
|
template_txt: '{{d.node}} <span class=\'layui-badge layui-bg-gray\'>{{d.title}}</span>',
|
||||||
|
onselect: function (resp) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
20
app/admin/view/system/quick/index.js
Normal file
20
app/admin/view/system/quick/index.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
$(function () {
|
||||||
|
|
||||||
|
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: ua.table.icon},
|
||||||
|
{field: 'href', minWidth: 120, title: '快捷链接'},
|
||||||
|
{field: 'remark', minWidth: 80, title: '备注信息'},
|
||||||
|
{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: ua.table.tool, operat: ['edit', 'delete']}
|
||||||
|
]],
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
10
app/admin/view/system/uploadfile/_common.js
Normal file
10
app/admin/view/system/uploadfile/_common.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
var init = {
|
||||||
|
table_elem: '#currentTable',
|
||||||
|
table_render_id: 'currentTableRenderId',
|
||||||
|
index_url: 'system.uploadfile/index',
|
||||||
|
add_url: 'system.uploadfile/add',
|
||||||
|
edit_url: 'system.uploadfile/edit',
|
||||||
|
delete_url: 'system.uploadfile/delete',
|
||||||
|
modify_url: 'system.uploadfile/modify',
|
||||||
|
export_url: 'system.uploadfile/export',
|
||||||
|
};
|
||||||
4
app/admin/view/system/uploadfile/add.js
Normal file
4
app/admin/view/system/uploadfile/add.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
$(function () {
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
34
app/admin/view/system/uploadfile/index.js
Normal file
34
app/admin/view/system/uploadfile/index.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
$(function () {
|
||||||
|
|
||||||
|
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: ua.table.filePreview },
|
||||||
|
{
|
||||||
|
field: 'url', minWidth: 120, title: '保存地址', templet: ua.table.url, urlNameField: function (data) {
|
||||||
|
return data.url;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ field: 'original_name', minWidth: 80, title: '文件原名' },
|
||||||
|
{ field: 'mime_type', minWidth: 80, title: 'mime类型' },
|
||||||
|
{ field: 'file_ext', minWidth: 80, title: '文件后缀' },
|
||||||
|
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
|
||||||
|
{
|
||||||
|
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') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
});
|
||||||
|
|
||||||
|
ua.listen();
|
||||||
|
});
|
||||||
@@ -9,6 +9,7 @@ use app\common\service\AuthService;
|
|||||||
use think\facade\Env;
|
use think\facade\Env;
|
||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
use think\Model;
|
use think\Model;
|
||||||
|
use think\template\exception\TemplateNotFoundException;
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,6 +141,29 @@ class AdminController extends BaseController
|
|||||||
return $this->app->view->assign($name, $value);
|
return $this->app->view->assign($name, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function fetchJS()
|
||||||
|
{
|
||||||
|
$content_js = '';
|
||||||
|
|
||||||
|
try {
|
||||||
|
$content_js .= View::layout(false)
|
||||||
|
->config([
|
||||||
|
'view_suffix' => 'js',
|
||||||
|
])->fetch('_common');
|
||||||
|
|
||||||
|
$content_js .= View::layout(false)
|
||||||
|
->config([
|
||||||
|
'view_suffix' => 'js',
|
||||||
|
])->fetch();
|
||||||
|
} catch (TemplateNotFoundException $th) {
|
||||||
|
if (Env::get('adminsystem.strict_view_js', true)) {
|
||||||
|
throw $th;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "<script>{$content_js}</script>";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析和获取模板内容 用于输出.
|
* 解析和获取模板内容 用于输出.
|
||||||
* @param string $template
|
* @param string $template
|
||||||
@@ -150,7 +174,17 @@ class AdminController extends BaseController
|
|||||||
{
|
{
|
||||||
$this->assign('data_brage', json_encode($this->dataBrage));
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,4 +36,16 @@ class View extends ThinkView
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置模板引擎.
|
||||||
|
* @param array $config 参数
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function config(array $config)
|
||||||
|
{
|
||||||
|
$this->driver()->config($config);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use think\facade\App;
|
|||||||
class PathTools
|
class PathTools
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 系统生成的文件,这些文件应当是可以任意删除的
|
* 系统生成的文件,这些文件应当是可以任意删除的.
|
||||||
*
|
*
|
||||||
* @param string $file_name
|
* @param string $file_name
|
||||||
* @return string
|
* @return string
|
||||||
@@ -49,6 +49,29 @@ class PathTools
|
|||||||
if (!is_dir($dir_name)) {
|
if (!is_dir($dir_name)) {
|
||||||
mkdir($dir_name, 0777, true);
|
mkdir($dir_name, 0777, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $file_path;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 模板设置
|
// | 模板设置
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
var uidList = [];
|
var uidList = [];
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
limit: 50,
|
limit: 50,
|
||||||
@@ -51,13 +51,13 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
add: function () {
|
add: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ define(["jquery", "easy-admin", "echarts", "echarts-theme", "miniAdmin"], functi
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
index: function () {
|
index: function () {
|
||||||
var options = {
|
var options = {
|
||||||
iniUrl: ea.url('ajax/initAdmin'), // 初始化接口
|
iniUrl: ua.url('ajax/initAdmin'), // 初始化接口
|
||||||
clearUrl: ea.url("ajax/clearCache"), // 缓存清理接口
|
clearUrl: ua.url("ajax/clearCache"), // 缓存清理接口
|
||||||
urlHashLocation: true, // 是否打开hash定位
|
urlHashLocation: true, // 是否打开hash定位
|
||||||
bgColorDefault: false, // 主题默认配置
|
bgColorDefault: false, // 主题默认配置
|
||||||
multiModule: true, // 是否开启多模块
|
multiModule: true, // 是否开启多模块
|
||||||
@@ -16,12 +16,12 @@ define(["jquery", "easy-admin", "echarts", "echarts-theme", "miniAdmin"], functi
|
|||||||
miniAdmin.render(options);
|
miniAdmin.render(options);
|
||||||
|
|
||||||
$('.login-out').on("click", function () {
|
$('.login-out').on("click", function () {
|
||||||
ea.request.get({
|
ua.request.get({
|
||||||
url: 'login/out',
|
url: 'login/out',
|
||||||
prefix: true,
|
prefix: true,
|
||||||
}, function (res) {
|
}, function (res) {
|
||||||
ea.msg.success(res.msg, function () {
|
ua.msg.success(res.msg, function () {
|
||||||
window.location = ea.url('login/index');
|
window.location = ua.url('login/index');
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -108,13 +108,13 @@ define(["jquery", "easy-admin", "echarts", "echarts-theme", "miniAdmin"], functi
|
|||||||
clearInterval(checkChartVisibleTimer)
|
clearInterval(checkChartVisibleTimer)
|
||||||
}
|
}
|
||||||
}, 3000);
|
}, 3000);
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
editAdmin: function () {
|
editAdmin: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
editPassword: function () {
|
editPassword: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -3,49 +3,7 @@ define(["easy-admin"], function (ea) {
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
index: function () {
|
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('可以使用重置密码命令设置:<br/>php think admin:resetPassword<br><a target="_blank" href="http://doc.ulthon.com/home/read/ulthon_admin/reset_password/15/16.html"> 参考文档</a>')
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,28 +14,28 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
cols: [[
|
cols: [[
|
||||||
{type: "checkbox"},
|
{type: "checkbox"},
|
||||||
{field: 'id', width: 80, title: 'ID'},
|
{field: 'id', width: 80, title: 'ID'},
|
||||||
{field: 'sort', width: 80, title: '排序', edit: 'text'},
|
{field: 'sort', width: 80, title: '排序', edit: 'text'},
|
||||||
{field: 'title', minWidth: 80, title: '分类名称'},
|
{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: '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'},
|
{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 () {
|
add: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -17,21 +17,21 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
totalRow: true,
|
totalRow: true,
|
||||||
cols: [[
|
cols: [[
|
||||||
{ type: "checkbox" },
|
{ type: "checkbox" },
|
||||||
{ field: 'id', width: 80, title: 'ID', totalRowText: '合计:' },
|
{ field: 'id', width: 80, title: 'ID', totalRowText: '合计:' },
|
||||||
{ field: 'sort', width: 80, title: '排序', edit: 'text' },
|
{ 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_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: ea.table.image },
|
{ field: 'cate.image', minWidth: 80, title: '分类图片', search: false, templet: ua.table.image },
|
||||||
{ field: 'title', minWidth: 80, title: '商品名称', },
|
{ field: 'title', minWidth: 80, title: '商品名称', },
|
||||||
{ field: 'logo', minWidth: 80, title: '商品图片', search: false, templet: ea.table.image },
|
{ field: 'logo', minWidth: 80, title: '商品图片', search: false, templet: ua.table.image },
|
||||||
{ field: 'market_price', width: 100, title: '市场价', templet: ea.table.price },
|
{ field: 'market_price', width: 100, title: '市场价', templet: ua.table.price },
|
||||||
{
|
{
|
||||||
field: 'discount_price', width: 120, title: '折扣价', templet: ea.table.price, totalRow: true,
|
field: 'discount_price', width: 120, title: '折扣价', templet: ua.table.price, totalRow: true,
|
||||||
templet: ea.table.copyText,
|
templet: ua.table.copyText,
|
||||||
valueParser(value) {
|
valueParser(value) {
|
||||||
return '¥' + value
|
return '¥' + value
|
||||||
},
|
},
|
||||||
@@ -53,12 +53,12 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
},
|
},
|
||||||
{ field: 'virtual_sales', width: 100, title: '虚拟销量' },
|
{ field: 'virtual_sales', width: 100, title: '虚拟销量' },
|
||||||
{ field: 'sales', width: 80, 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' },
|
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
|
||||||
{
|
{
|
||||||
width: 250,
|
width: 250,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
templet: ea.table.tool,
|
templet: ua.table.tool,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
operat: [
|
operat: [
|
||||||
'edit',
|
'edit',
|
||||||
@@ -81,19 +81,19 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
]],
|
]],
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
add: function () {
|
add: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
stock: function () {
|
stock: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
read: function () {
|
read: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -14,23 +14,23 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
cols: [[
|
cols: [[
|
||||||
{type: 'checkbox'},
|
{type: 'checkbox'},
|
||||||
{field: 'id', title: 'id'},
|
{field: 'id', title: 'id'},
|
||||||
{field: 'title', title: '名称'},
|
{field: 'title', title: '名称'},
|
||||||
{width: 250, title: '操作', templet: ea.table.tool},
|
{width: 250, title: '操作', templet: ua.table.tool},
|
||||||
]],
|
]],
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
add: function () {
|
add: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
password_url: 'system.admin/password',
|
password_url: 'system.admin/password',
|
||||||
};
|
};
|
||||||
|
|
||||||
var authList = ea.getDataBrage('auth_list', []);
|
var authList = ua.getDataBrage('auth_list', []);
|
||||||
var count = ea.getDataBrage('count', 0);
|
var count = ua.getDataBrage('count', 0);
|
||||||
var tips = ea.getDataBrage('tips', '');
|
var tips = ua.getDataBrage('tips', '');
|
||||||
var tips = ea.getDataBrage('adminCustomFlag');
|
var tips = ua.getDataBrage('adminCustomFlag');
|
||||||
|
|
||||||
console.log(authList);
|
console.log(authList);
|
||||||
console.log(count);
|
console.log(count);
|
||||||
@@ -25,24 +25,24 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
|
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
cols: [[
|
cols: [[
|
||||||
{ type: "checkbox" },
|
{ type: "checkbox" },
|
||||||
{ field: 'id', width: 80, title: 'ID' },
|
{ field: 'id', width: 80, title: 'ID' },
|
||||||
{ field: 'sort', width: 80, title: '排序', edit: 'text' },
|
{ field: 'sort', width: 80, title: '排序', edit: 'text' },
|
||||||
{ field: 'username', minWidth: 80, title: '登录账户' },
|
{ 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: 'phone', minWidth: 80, title: '手机' },
|
||||||
{ field: 'login_num', minWidth: 80, title: '登录次数' },
|
{ field: 'login_num', minWidth: 80, title: '登录次数' },
|
||||||
{ field: 'remark', minWidth: 80, title: '备注信息', defaultValue: '无' },
|
{ 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' },
|
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
|
||||||
{
|
{
|
||||||
width: 250,
|
width: 250,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
templet: ea.table.tool,
|
templet: ua.table.tool,
|
||||||
operat: [
|
operat: [
|
||||||
'edit',
|
'edit',
|
||||||
[{
|
[{
|
||||||
@@ -59,16 +59,16 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
]],
|
]],
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
add: function () {
|
add: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
password: function () {
|
password: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
cols: [[
|
cols: [[
|
||||||
{type: "checkbox"},
|
{type: "checkbox"},
|
||||||
@@ -23,12 +23,12 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
{field: 'sort', width: 80, title: '排序', edit: 'text'},
|
{field: 'sort', width: 80, title: '排序', edit: 'text'},
|
||||||
{field: 'title', minWidth: 80, title: '权限名称'},
|
{field: 'title', minWidth: 80, title: '权限名称'},
|
||||||
{field: 'remark', 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'},
|
{field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
|
||||||
{
|
{
|
||||||
width: 250,
|
width: 250,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
templet: ea.table.tool,
|
templet: ua.table.tool,
|
||||||
operat: [
|
operat: [
|
||||||
'edit',
|
'edit',
|
||||||
[{
|
[{
|
||||||
@@ -44,18 +44,18 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
]],
|
]],
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
add: function () {
|
add: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
authorize: function () {
|
authorize: function () {
|
||||||
var tree = layui.tree;
|
var tree = layui.tree;
|
||||||
|
|
||||||
ea.request.get(
|
ua.request.get(
|
||||||
{
|
{
|
||||||
url: window.location.href,
|
url: window.location.href,
|
||||||
}, function (res) {
|
}, 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 checkedData = tree.getChecked('nodeDataId');
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$.each(checkedData, function (i, v) {
|
$.each(checkedData, function (i, v) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ define(["jquery", "easy-admin", "vue"], function ($, ea, Vue) {
|
|||||||
$('.show-type-item.' + this.value).show();
|
$('.show-type-item.' + this.value).show();
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -26,18 +26,18 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
|||||||
homdPid: 99999999,
|
homdPid: 99999999,
|
||||||
treeIdName: 'id',
|
treeIdName: 'id',
|
||||||
treePidName: 'pid',
|
treePidName: 'pid',
|
||||||
url: ea.url(init.index_url),
|
url: ua.url(init.index_url),
|
||||||
elem: init.table_elem,
|
elem: init.table_elem,
|
||||||
id: init.table_render_id,
|
id: init.table_render_id,
|
||||||
toolbar: '#toolbar',
|
toolbar: '#toolbar',
|
||||||
page: false,
|
page: false,
|
||||||
skin: 'line',
|
skin: 'line',
|
||||||
|
|
||||||
// @todo 不直接使用ea.table.render(); 进行表格初始化, 需要使用 ea.table.formatCols(); 方法格式化`cols`列数据
|
// @todo 不直接使用ua.table.render(); 进行表格初始化, 需要使用 ua.table.formatCols(); 方法格式化`cols`列数据
|
||||||
cols: ea.table.formatCols([[
|
cols: ua.table.formatCols([[
|
||||||
{ type: 'checkbox' },
|
{ type: 'checkbox' },
|
||||||
{ field: 'title', sort: false, width: 250, title: '菜单名称', align: 'left' },
|
{ 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: 'href', sort: false, minWidth: 120, title: '菜单链接' },
|
||||||
{
|
{
|
||||||
field: 'is_home', sort: false,
|
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' },
|
{ field: 'sort', sort: false, width: 80, title: '排序', edit: 'text' },
|
||||||
{
|
{
|
||||||
width: 220,
|
width: 220,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
templet: ea.table.tool,
|
templet: ua.table.tool,
|
||||||
operat: [
|
operat: [
|
||||||
[{
|
[{
|
||||||
text: '添加下级',
|
text: '添加下级',
|
||||||
@@ -94,7 +94,7 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
|||||||
data: ['id', 'title'],
|
data: ['id', 'title'],
|
||||||
_if(data) {
|
_if(data) {
|
||||||
|
|
||||||
if (data.pid == ea.getDataBrage('menu_home_pid')) {
|
if (data.pid == ua.getDataBrage('menu_home_pid')) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,15 +126,15 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
|||||||
$('body').on('click', '[data-treetable-delete-item]', function () {
|
$('body').on('click', '[data-treetable-delete-item]', function () {
|
||||||
var id = $(this).data('id');
|
var id = $(this).data('id');
|
||||||
var url = $(this).attr('data-url');
|
var url = $(this).attr('data-url');
|
||||||
url = url != undefined ? ea.url(url) : window.location.href;
|
url = url != undefined ? ua.url(url) : window.location.href;
|
||||||
ea.msg.confirm('确定删除?', function () {
|
ua.msg.confirm('确定删除?', function () {
|
||||||
ea.request.post({
|
ua.request.post({
|
||||||
url: url,
|
url: url,
|
||||||
data: {
|
data: {
|
||||||
id: id
|
id: id
|
||||||
},
|
},
|
||||||
}, function (res) {
|
}, function (res) {
|
||||||
ea.msg.success(res.msg, function () {
|
ua.msg.success(res.msg, function () {
|
||||||
renderTable();
|
renderTable();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -146,25 +146,25 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
|||||||
var tableId = $(this).attr('data-treetable-delete'),
|
var tableId = $(this).attr('data-treetable-delete'),
|
||||||
url = $(this).attr('data-url');
|
url = $(this).attr('data-url');
|
||||||
tableId = tableId || init.table_render_id;
|
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),
|
var checkStatus = table.checkStatus(tableId),
|
||||||
data = checkStatus.data;
|
data = checkStatus.data;
|
||||||
if (data.length <= 0) {
|
if (data.length <= 0) {
|
||||||
ea.msg.error('请勾选需要删除的数据');
|
ua.msg.error('请勾选需要删除的数据');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$.each(data, function (i, v) {
|
$.each(data, function (i, v) {
|
||||||
ids.push(v.id);
|
ids.push(v.id);
|
||||||
});
|
});
|
||||||
ea.msg.confirm('确定删除?', function () {
|
ua.msg.confirm('确定删除?', function () {
|
||||||
ea.request.post({
|
ua.request.post({
|
||||||
url: url,
|
url: url,
|
||||||
data: {
|
data: {
|
||||||
id: ids
|
id: ids
|
||||||
},
|
},
|
||||||
}, function (res) {
|
}, function (res) {
|
||||||
ea.msg.success(res.msg, function () {
|
ua.msg.success(res.msg, function () {
|
||||||
renderTable();
|
renderTable();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -172,11 +172,11 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
|||||||
return false;
|
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 () {
|
add: function () {
|
||||||
iconPickerFa.render({
|
iconPickerFa.render({
|
||||||
@@ -192,17 +192,17 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
|||||||
});
|
});
|
||||||
autocomplete.render({
|
autocomplete.render({
|
||||||
elem: $('#href')[0],
|
elem: $('#href')[0],
|
||||||
url: ea.url('system.menu/getMenuTips'),
|
url: ua.url('system.menu/getMenuTips'),
|
||||||
template_val: '{{-d.node}}',
|
template_val: '{{-d.node}}',
|
||||||
template_txt: '{{-d.node}} <span class=\'layui-badge layui-bg-gray\'>{{-d.title}}</span>',
|
template_txt: '{{-d.node}} <span class=\'layui-badge layui-bg-gray\'>{{-d.title}}</span>',
|
||||||
onselect: function (resp) {
|
onselect: function (resp) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen(function (data) {
|
ua.listen(function (data) {
|
||||||
return data;
|
return data;
|
||||||
}, function (res) {
|
}, function (res) {
|
||||||
ea.msg.success(res.msg, function () {
|
ua.msg.success(res.msg, function () {
|
||||||
var index = parent.layer.getFrameIndex(window.name);
|
var index = parent.layer.getFrameIndex(window.name);
|
||||||
parent.layer.close(index);
|
parent.layer.close(index);
|
||||||
parent.$('[data-treetable-refresh]').trigger("click");
|
parent.$('[data-treetable-refresh]').trigger("click");
|
||||||
@@ -223,17 +223,17 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
|||||||
});
|
});
|
||||||
autocomplete.render({
|
autocomplete.render({
|
||||||
elem: $('#href')[0],
|
elem: $('#href')[0],
|
||||||
url: ea.url('system.menu/getMenuTips'),
|
url: ua.url('system.menu/getMenuTips'),
|
||||||
template_val: '{{-d.node}}',
|
template_val: '{{-d.node}}',
|
||||||
template_txt: '{{-d.node}} <span class=\'layui-badge layui-bg-gray\'>{{-d.title}}</span>',
|
template_txt: '{{-d.node}} <span class=\'layui-badge layui-bg-gray\'>{{-d.title}}</span>',
|
||||||
onselect: function (resp) {
|
onselect: function (resp) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen(function (data) {
|
ua.listen(function (data) {
|
||||||
return data;
|
return data;
|
||||||
}, function (res) {
|
}, function (res) {
|
||||||
ea.msg.success(res.msg, function () {
|
ua.msg.success(res.msg, function () {
|
||||||
var index = parent.layer.getFrameIndex(window.name);
|
var index = parent.layer.getFrameIndex(window.name);
|
||||||
parent.layer.close(index);
|
parent.layer.close(index);
|
||||||
parent.$('[data-treetable-refresh]').trigger("click");
|
parent.$('[data-treetable-refresh]').trigger("click");
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
search: false,
|
search: false,
|
||||||
page: false,
|
page: false,
|
||||||
@@ -52,17 +52,17 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
{ field: 'node', sort: false, minWidth: 200, align: 'left', title: '系统节点' },
|
{ field: 'node', sort: false, minWidth: 200, align: 'left', title: '系统节点' },
|
||||||
{ field: 'title', sort: false, minWidth: 80, title: '节点名称 <i class="table-edit-tips color-red">*</i>', edit: 'text' },
|
{ field: 'title', sort: false, minWidth: 80, title: '节点名称 <i class="table-edit-tips color-red">*</i>', edit: 'text' },
|
||||||
{ field: 'update_time', sort: false, minWidth: 80, title: '更新时间', search: 'range' },
|
{ 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 () {
|
add: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -17,23 +17,23 @@ define(["jquery", "easy-admin", "iconPickerFa", "autocomplete"], function ($, ea
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
cols: [[
|
cols: [[
|
||||||
{type: "checkbox"},
|
{type: "checkbox"},
|
||||||
{field: 'id', width: 80, title: 'ID'},
|
{field: 'id', width: 80, title: 'ID'},
|
||||||
{field: 'sort', width: 80, title: '排序', edit: 'text'},
|
{field: 'sort', width: 80, title: '排序', edit: 'text'},
|
||||||
{field: 'title', minWidth: 80, title: '权限名称'},
|
{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: 'href', minWidth: 120, title: '快捷链接'},
|
||||||
{field: 'remark', 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'},
|
{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 () {
|
add: function () {
|
||||||
iconPickerFa.render({
|
iconPickerFa.render({
|
||||||
@@ -49,14 +49,14 @@ define(["jquery", "easy-admin", "iconPickerFa", "autocomplete"], function ($, ea
|
|||||||
});
|
});
|
||||||
autocomplete.render({
|
autocomplete.render({
|
||||||
elem: $('#href')[0],
|
elem: $('#href')[0],
|
||||||
url: ea.url('system.menu/getMenuTips'),
|
url: ua.url('system.menu/getMenuTips'),
|
||||||
template_val: '{{d.node}}',
|
template_val: '{{d.node}}',
|
||||||
template_txt: '{{d.node}} <span class=\'layui-badge layui-bg-gray\'>{{d.title}}</span>',
|
template_txt: '{{d.node}} <span class=\'layui-badge layui-bg-gray\'>{{d.title}}</span>',
|
||||||
onselect: function (resp) {
|
onselect: function (resp) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
iconPickerFa.render({
|
iconPickerFa.render({
|
||||||
@@ -72,14 +72,14 @@ define(["jquery", "easy-admin", "iconPickerFa", "autocomplete"], function ($, ea
|
|||||||
});
|
});
|
||||||
autocomplete.render({
|
autocomplete.render({
|
||||||
elem: $('#href')[0],
|
elem: $('#href')[0],
|
||||||
url: ea.url('system.menu/getMenuTips'),
|
url: ua.url('system.menu/getMenuTips'),
|
||||||
template_val: '{{d.node}}',
|
template_val: '{{d.node}}',
|
||||||
template_txt: '{{d.node}} <span class=\'layui-badge layui-bg-gray\'>{{d.title}}</span>',
|
template_txt: '{{d.node}} <span class=\'layui-badge layui-bg-gray\'>{{d.title}}</span>',
|
||||||
onselect: function (resp) {
|
onselect: function (resp) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -14,15 +14,15 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
var Controller = {
|
var Controller = {
|
||||||
|
|
||||||
index: function () {
|
index: function () {
|
||||||
ea.table.render({
|
ua.table.render({
|
||||||
init: init,
|
init: init,
|
||||||
cols: [[
|
cols: [[
|
||||||
{ type: "checkbox" },
|
{ type: "checkbox" },
|
||||||
{ field: 'id', width: 80, title: 'ID' },
|
{ field: 'id', width: 80, title: 'ID' },
|
||||||
{ field: 'upload_type', minWidth: 80, title: '存储位置', search: 'select', selectList: { 'local': '本地', 'alioss': '阿里云', 'qnoss': '七牛云', ',txcos': '腾讯云' } },
|
{ 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;
|
return data.url;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -31,8 +31,8 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
{ field: 'file_ext', minWidth: 80, title: '文件后缀' },
|
{ field: 'file_ext', minWidth: 80, title: '文件后缀' },
|
||||||
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
|
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
|
||||||
{
|
{
|
||||||
width: 250, title: '操作', templet: ea.table.tool, operat: ['delete'], fixed: 'right', hide: function () {
|
width: 250, title: '操作', templet: ua.table.tool, operat: ['delete'], fixed: 'right', hide: function () {
|
||||||
var selectMode = ea.getQueryVariable("select_mode");
|
var selectMode = ua.getQueryVariable("select_mode");
|
||||||
|
|
||||||
console.log(selectMode);
|
console.log(selectMode);
|
||||||
if (selectMode == 'radio' || selectMode == 'checkbox') {
|
if (selectMode == 'radio' || selectMode == 'checkbox') {
|
||||||
@@ -44,16 +44,16 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
]],
|
]],
|
||||||
});
|
});
|
||||||
|
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
add: function () {
|
add: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
},
|
},
|
||||||
password: function () {
|
password: function () {
|
||||||
ea.listen();
|
ua.listen();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return Controller;
|
return Controller;
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
/**
|
(function () {
|
||||||
* date:2020/02/27
|
|
||||||
* author:Mr.Chung
|
|
||||||
* version:2.0
|
|
||||||
* description:layuimini 主体框架扩展
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, miniTheme, miniTab) {
|
|
||||||
|
|
||||||
var $ = layui.$,
|
var $ = layui.$,
|
||||||
layer = layui.layer,
|
layer = layui.layer,
|
||||||
element = layui.element;
|
element = layui.element
|
||||||
|
miniMenu = window.miniMenu
|
||||||
|
miniTheme = window.miniTheme
|
||||||
|
miniTab = window.miniTab;
|
||||||
|
|
||||||
if (!/http(s*):\/\//.test(location.href)) {
|
if (!/http(s*):\/\//.test(location.href)) {
|
||||||
var tips = "请先将项目部署至web容器(Apache/Tomcat/Nginx/IIS/等),否则部分数据将无法显示";
|
var tips = "请先将项目部署至web容器(Apache/Tomcat/Nginx/IIS/等),否则部分数据将无法显示";
|
||||||
@@ -350,5 +345,5 @@ define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, mi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
return miniAdmin;
|
window.miniAdmin = miniAdmin;
|
||||||
});
|
})()
|
||||||
@@ -1,10 +1,4 @@
|
|||||||
/**
|
(function () {
|
||||||
* date:2020/02/27
|
|
||||||
* author:Mr.Chung
|
|
||||||
* version:2.0
|
|
||||||
* description:layuimini 菜单框架扩展
|
|
||||||
*/
|
|
||||||
define(["jquery"], function ($) {
|
|
||||||
var element = layui.element,
|
var element = layui.element,
|
||||||
laytpl = layui.laytpl,
|
laytpl = layui.laytpl,
|
||||||
layer = layui.layer;
|
layer = layui.layer;
|
||||||
@@ -55,7 +49,7 @@ define(["jquery"], function ($) {
|
|||||||
compileMenu: function (menu, isSub) {
|
compileMenu: function (menu, isSub) {
|
||||||
var menuHtml = '<li {{#if( d.menu){ }} data-menu="{{-d.menu}}" {{#}}} class="layui-nav-item menu-li {{-d.childOpenClass}} {{-d.className}}" {{#if( d.id){ }} id="{{-d.id}}" {{#}}}> <a {{#if( d.href){ }} layuimini-href="{{-d.href}}" {{#}}} {{#if( d.target){ }} target="{{-d.target}}" {{#}}} href="javascript:;">{{#if( d.icon){ }} <i class="{{-d.icon}}"></i> {{#}}} <span class="layui-left-nav">{{-d.title}}</span></a> {{# if(d.children){}} {{-d.children}} {{#}}} </li>';
|
var menuHtml = '<li {{#if( d.menu){ }} data-menu="{{-d.menu}}" {{#}}} class="layui-nav-item menu-li {{-d.childOpenClass}} {{-d.className}}" {{#if( d.id){ }} id="{{-d.id}}" {{#}}}> <a {{#if( d.href){ }} layuimini-href="{{-d.href}}" {{#}}} {{#if( d.target){ }} target="{{-d.target}}" {{#}}} href="javascript:;">{{#if( d.icon){ }} <i class="{{-d.icon}}"></i> {{#}}} <span class="layui-left-nav">{{-d.title}}</span></a> {{# if(d.children){}} {{-d.children}} {{#}}} </li>';
|
||||||
if (isSub) {
|
if (isSub) {
|
||||||
menuHtml = '<dd class="menu-dd {{-d.childOpenClass}} {{- d.className }}"> <a href="javascript:;" {{#if( d.menu){ }} data-menu="{{-d.menu}}" {{#}}} {{#if( d.id){ }} id="{{-d.id}}" {{#}}} {{#if(( !d.child || !d.child.length ) && d.href){ }} layuimini-href="{{-d.href}}" {{#}}} {{#if( d.target){ }} target="{{-d.target}}" {{#}}}> {{#if( d.icon){ }} <i class="{{-d.icon}}"></i> {{#}}} <span class="layui-left-nav"> {{-d.title}}</span></a> {{# if(d.children){}} {{-d.children}} {{#}}}</dd>'
|
menuHtml = '<dd class="menu-dd {{-d.childOpenClass}} {{- d.className }}"> <a href="javascript:;" {{#if( d.menu){ }} data-menu="{{-d.menu}}" {{#}}} {{#if( d.id){ }} id="{{-d.id}}" {{#}}} {{#if(( !d.child || !d.child.length ) && d.href){ }} layuimini-href="{{-d.href}}" {{#}}} {{#if( d.target){ }} target="{{-d.target}}" {{#}}}> {{#if( d.icon){ }} <i class="{{-d.icon}}"></i> {{#}}} <span class="layui-left-nav"> {{-d.title}}</span></a> {{# if(d.children){}} {{-d.children}} {{#}}}</dd>';
|
||||||
}
|
}
|
||||||
return laytpl(menuHtml).render(menu);
|
return laytpl(menuHtml).render(menu);
|
||||||
},
|
},
|
||||||
@@ -85,10 +79,10 @@ define(["jquery"], function ($) {
|
|||||||
menu.children = me.renderChildrenMenu(menu.child, { childOpenClass: options.childOpenClass || '' });
|
menu.children = me.renderChildrenMenu(menu.child, { childOpenClass: options.childOpenClass || '' });
|
||||||
}
|
}
|
||||||
menu.className = "";
|
menu.className = "";
|
||||||
menu.childOpenClass = options.childOpenClass || ''
|
menu.childOpenClass = options.childOpenClass || '';
|
||||||
return me.compileMenu(menu,true)
|
return me.compileMenu(menu, true);
|
||||||
}).join("");
|
}).join("");
|
||||||
return me.compileMenuContainer({ children:html },true)
|
return me.compileMenuContainer({ children: html }, true);
|
||||||
},
|
},
|
||||||
renderLeftMenu: function (leftMenus, options) {
|
renderLeftMenu: function (leftMenus, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
@@ -245,5 +239,5 @@ define(["jquery"], function ($) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return miniMenu;
|
window.miniMenu = miniMenu;
|
||||||
});
|
})();
|
||||||
@@ -1,16 +1,8 @@
|
|||||||
/**
|
(function () {
|
||||||
* date:2020/02/27
|
var element = layui.element;
|
||||||
* author:Mr.Chung
|
|
||||||
* version:2.0
|
|
||||||
* description:layuimini tab框架扩展
|
|
||||||
*/
|
|
||||||
define(["jquery"], function ($) {
|
|
||||||
var element = layui.element,
|
|
||||||
$ = layui.$;
|
$ = layui.$;
|
||||||
|
|
||||||
|
|
||||||
var miniTab = {
|
var miniTab = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化tab
|
* 初始化tab
|
||||||
* @param options
|
* @param options
|
||||||
@@ -22,8 +14,7 @@ define(["jquery"], function ($) {
|
|||||||
options.maxTabNum = options.maxTabNum || 20;
|
options.maxTabNum = options.maxTabNum || 20;
|
||||||
options.menuList = options.menuList || []; // todo 后期菜单想改为不操作dom, 而是直接操作初始化传过来的数据
|
options.menuList = options.menuList || []; // todo 后期菜单想改为不操作dom, 而是直接操作初始化传过来的数据
|
||||||
options.homeInfo = options.homeInfo || {};
|
options.homeInfo = options.homeInfo || {};
|
||||||
options.listenSwichCallback = options.listenSwichCallback || function () {
|
options.listenSwichCallback = options.listenSwichCallback || function () { };
|
||||||
};
|
|
||||||
miniTab.listen(options);
|
miniTab.listen(options);
|
||||||
miniTab.listenRoll();
|
miniTab.listenRoll();
|
||||||
miniTab.listenSwitch(options);
|
miniTab.listenSwitch(options);
|
||||||
@@ -44,22 +35,27 @@ define(["jquery"], function ($) {
|
|||||||
options.title = options.title || null;
|
options.title = options.title || null;
|
||||||
options.isIframe = options.isIframe || false;
|
options.isIframe = options.isIframe || false;
|
||||||
options.maxTabNum = options.maxTabNum || 20;
|
options.maxTabNum = options.maxTabNum || 20;
|
||||||
if ($(".layuimini-tab .layui-tab-title li").length >= options.maxTabNum) {
|
if ($('.layuimini-tab .layui-tab-title li').length >= options.maxTabNum) {
|
||||||
layer.msg('Tab窗口已达到限定数量,请先关闭部分Tab');
|
layer.msg('Tab窗口已达到限定数量,请先关闭部分Tab');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var ele = element;
|
var ele = element;
|
||||||
if (options.isIframe) ele = parent.layui.element;
|
if (options.isIframe) ele = parent.layui.element;
|
||||||
ele.tabAdd('layuiminiTab', {
|
ele.tabAdd('layuiminiTab', {
|
||||||
title: '<span class="layuimini-tab-active"></span><span>' + options.title + '</span><i class="layui-icon layui-unselect layui-tab-close">ဆ</i>' //用于演示
|
title:
|
||||||
, content: '<iframe width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" src="' + options.href + '"></iframe>'
|
'<span class="layuimini-tab-active"></span><span>' +
|
||||||
, id: options.tabId
|
options.title +
|
||||||
|
'</span><i class="layui-icon layui-unselect layui-tab-close">ဆ</i>', //用于演示
|
||||||
|
content:
|
||||||
|
'<iframe width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" src="' +
|
||||||
|
options.href +
|
||||||
|
'"></iframe>',
|
||||||
|
id: options.tabId,
|
||||||
});
|
});
|
||||||
$('.layuimini-menu-left').attr('layuimini-tab-tag', 'add');
|
$('.layuimini-menu-left').attr('layuimini-tab-tag', 'add');
|
||||||
sessionStorage.setItem('layuiminimenu_' + options.tabId, options.title);
|
sessionStorage.setItem('layuiminimenu_' + options.tabId, options.title);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 切换选项卡
|
* 切换选项卡
|
||||||
* @param tabId
|
* @param tabId
|
||||||
@@ -75,7 +71,7 @@ define(["jquery"], function ($) {
|
|||||||
*/
|
*/
|
||||||
delete: function (tabId, isParent) {
|
delete: function (tabId, isParent) {
|
||||||
// todo 未知BUG,不知道是不是layui问题,必须先删除元素
|
// todo 未知BUG,不知道是不是layui问题,必须先删除元素
|
||||||
$(".layuimini-tab .layui-tab-title .layui-unselect.layui-tab-bar").remove();
|
$('.layuimini-tab .layui-tab-title .layui-unselect.layui-tab-bar').remove();
|
||||||
|
|
||||||
if (isParent === true) {
|
if (isParent === true) {
|
||||||
parent.layui.element.tabDelete('layuiminiTab', tabId);
|
parent.layui.element.tabDelete('layuiminiTab', tabId);
|
||||||
@@ -109,7 +105,7 @@ define(["jquery"], function ($) {
|
|||||||
* 在iframe层关闭当前tab方法
|
* 在iframe层关闭当前tab方法
|
||||||
*/
|
*/
|
||||||
deleteCurrentByIframe: function () {
|
deleteCurrentByIframe: function () {
|
||||||
var ele = $(".layuimini-tab .layui-tab-title li.layui-this", parent.document);
|
var ele = $('.layuimini-tab .layui-tab-title li.layui-this', parent.document);
|
||||||
if (ele.length > 0) {
|
if (ele.length > 0) {
|
||||||
var layId = $(ele[0]).attr('lay-id');
|
var layId = $(ele[0]).attr('lay-id');
|
||||||
miniTab.delete(layId, true);
|
miniTab.delete(layId, true);
|
||||||
@@ -123,14 +119,14 @@ define(["jquery"], function ($) {
|
|||||||
// 判断选项卡上是否有
|
// 判断选项卡上是否有
|
||||||
var checkTab = false;
|
var checkTab = false;
|
||||||
if (isIframe === undefined || isIframe === false) {
|
if (isIframe === undefined || isIframe === false) {
|
||||||
$(".layui-tab-title li").each(function () {
|
$('.layui-tab-title li').each(function () {
|
||||||
var checkTabId = $(this).attr('lay-id');
|
var checkTabId = $(this).attr('lay-id');
|
||||||
if (checkTabId != null && checkTabId === tabId) {
|
if (checkTabId != null && checkTabId === tabId) {
|
||||||
checkTab = true;
|
checkTab = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
parent.layui.$(".layui-tab-title li").each(function () {
|
parent.layui.$('.layui-tab-title li').each(function () {
|
||||||
var checkTabId = $(this).attr('lay-id');
|
var checkTabId = $(this).attr('lay-id');
|
||||||
if (checkTabId != null && checkTabId === tabId) {
|
if (checkTabId != null && checkTabId === tabId) {
|
||||||
checkTab = true;
|
checkTab = true;
|
||||||
@@ -147,7 +143,12 @@ define(["jquery"], function ($) {
|
|||||||
*/
|
*/
|
||||||
openTabRignMenu: function (tabId, left) {
|
openTabRignMenu: function (tabId, left) {
|
||||||
miniTab.closeTabRignMenu();
|
miniTab.closeTabRignMenu();
|
||||||
var menuHtml = '<div class="layui-unselect layui-form-select layui-form-selected layuimini-tab-mousedown layui-show" data-tab-id="' + tabId + '" style="left: ' + left + 'px!important">\n' +
|
var menuHtml =
|
||||||
|
'<div class="layui-unselect layui-form-select layui-form-selected layuimini-tab-mousedown layui-show" data-tab-id="' +
|
||||||
|
tabId +
|
||||||
|
'" style="left: ' +
|
||||||
|
left +
|
||||||
|
'px!important">\n' +
|
||||||
'<dl>\n' +
|
'<dl>\n' +
|
||||||
'<dd><a href="javascript:;" layuimini-tab-menu-close="current">关 闭 当 前</a></dd>\n' +
|
'<dd><a href="javascript:;" layuimini-tab-menu-close="current">关 闭 当 前</a></dd>\n' +
|
||||||
'<dd><a href="javascript:;" layuimini-tab-menu-close="other">关 闭 其 他</a></dd>\n' +
|
'<dd><a href="javascript:;" layuimini-tab-menu-close="other">关 闭 其 他</a></dd>\n' +
|
||||||
@@ -209,16 +210,16 @@ define(["jquery"], function ($) {
|
|||||||
title = $(this).text(),
|
title = $(this).text(),
|
||||||
target = $(this).attr('target');
|
target = $(this).attr('target');
|
||||||
|
|
||||||
var el = $("[layuimini-href='" + href + "']", ".layuimini-menu-left");
|
var el = $("[layuimini-href='" + href + "']", '.layuimini-menu-left');
|
||||||
layer.close(window.openTips);
|
layer.close(window.openTips);
|
||||||
if (el.length) {
|
if (el.length) {
|
||||||
$(el).closest(".layui-nav-tree").find(".layui-this").removeClass("layui-this");
|
$(el).closest('.layui-nav-tree').find('.layui-this').removeClass('layui-this');
|
||||||
$(el).parent().addClass("layui-this");
|
$(el).parent().addClass('layui-this');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target === '_blank') {
|
if (target === '_blank') {
|
||||||
layer.close(loading);
|
layer.close(loading);
|
||||||
window.open(href, "_blank");
|
window.open(href, '_blank');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +249,7 @@ define(["jquery"], function ($) {
|
|||||||
target = $(this).attr('target');
|
target = $(this).attr('target');
|
||||||
if (target === '_blank') {
|
if (target === '_blank') {
|
||||||
parent.layer.close(loading);
|
parent.layer.close(loading);
|
||||||
window.open(href, "_blank");
|
window.open(href, '_blank');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (tabId === null || tabId === undefined) tabId = new Date().getTime();
|
if (tabId === null || tabId === undefined) tabId = new Date().getTime();
|
||||||
@@ -285,7 +286,7 @@ define(["jquery"], function ($) {
|
|||||||
$('body').on('click', '[layuimini-tab-close]', function () {
|
$('body').on('click', '[layuimini-tab-close]', function () {
|
||||||
var loading = layer.load(0, { shade: false, time: 2 * 1000 });
|
var loading = layer.load(0, { shade: false, time: 2 * 1000 });
|
||||||
var closeType = $(this).attr('layuimini-tab-close');
|
var closeType = $(this).attr('layuimini-tab-close');
|
||||||
$(".layuimini-tab .layui-tab-title li").each(function () {
|
$('.layuimini-tab .layui-tab-title li').each(function () {
|
||||||
var tabId = $(this).attr('lay-id');
|
var tabId = $(this).attr('lay-id');
|
||||||
var id = $(this).attr('id');
|
var id = $(this).attr('id');
|
||||||
var isCurrent = $(this).hasClass('layui-this');
|
var isCurrent = $(this).hasClass('layui-this');
|
||||||
@@ -307,7 +308,9 @@ define(["jquery"], function ($) {
|
|||||||
/**
|
/**
|
||||||
* 禁用网页右键
|
* 禁用网页右键
|
||||||
*/
|
*/
|
||||||
$(".layuimini-tab .layui-tab-title").unbind("mousedown").bind("contextmenu", function (e) {
|
$('.layuimini-tab .layui-tab-title')
|
||||||
|
.unbind('mousedown')
|
||||||
|
.bind('contextmenu', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -316,7 +319,7 @@ define(["jquery"], function ($) {
|
|||||||
* 注册鼠标右键
|
* 注册鼠标右键
|
||||||
*/
|
*/
|
||||||
$('body').on('mousedown', '.layuimini-tab .layui-tab-title li', function (e) {
|
$('body').on('mousedown', '.layuimini-tab .layui-tab-title li', function (e) {
|
||||||
var left = $(this).offset().left - $('.layuimini-tab ').offset().left + ($(this).width() / 2),
|
var left = $(this).offset().left - $('.layuimini-tab ').offset().left + $(this).width() / 2,
|
||||||
tabId = $(this).attr('lay-id');
|
tabId = $(this).attr('lay-id');
|
||||||
if (e.which === 3) {
|
if (e.which === 3) {
|
||||||
miniTab.openTabRignMenu(tabId, left);
|
miniTab.openTabRignMenu(tabId, left);
|
||||||
@@ -337,7 +340,7 @@ define(["jquery"], function ($) {
|
|||||||
var loading = layer.load(0, { shade: false, time: 2 * 1000 });
|
var loading = layer.load(0, { shade: false, time: 2 * 1000 });
|
||||||
var closeType = $(this).attr('layuimini-tab-menu-close'),
|
var closeType = $(this).attr('layuimini-tab-menu-close'),
|
||||||
currentTabId = $('.layuimini-tab-mousedown').attr('data-tab-id');
|
currentTabId = $('.layuimini-tab-mousedown').attr('data-tab-id');
|
||||||
$(".layuimini-tab .layui-tab-title li").each(function () {
|
$('.layuimini-tab .layui-tab-title li').each(function () {
|
||||||
var tabId = $(this).attr('lay-id');
|
var tabId = $(this).attr('lay-id');
|
||||||
var id = $(this).attr('id');
|
var id = $(this).attr('id');
|
||||||
if (id !== 'layuiminiHomeTabId') {
|
if (id !== 'layuiminiHomeTabId') {
|
||||||
@@ -365,9 +368,7 @@ define(["jquery"], function ($) {
|
|||||||
options.filter = options.filter || null;
|
options.filter = options.filter || null;
|
||||||
options.multiModule = options.multiModule || false;
|
options.multiModule = options.multiModule || false;
|
||||||
options.urlHashLocation = options.urlHashLocation || false;
|
options.urlHashLocation = options.urlHashLocation || false;
|
||||||
options.listenSwichCallback = options.listenSwichCallback || function () {
|
options.listenSwichCallback = options.listenSwichCallback || function () { };
|
||||||
|
|
||||||
};
|
|
||||||
element.on('tab(' + options.filter + ')', function (data) {
|
element.on('tab(' + options.filter + ')', function (data) {
|
||||||
var tabId = $(this).attr('lay-id');
|
var tabId = $(this).attr('lay-id');
|
||||||
if (options.urlHashLocation) {
|
if (options.urlHashLocation) {
|
||||||
@@ -378,9 +379,9 @@ define(["jquery"], function ($) {
|
|||||||
}
|
}
|
||||||
// 判断是否为新增窗口
|
// 判断是否为新增窗口
|
||||||
if ($('.layuimini-menu-left').attr('layuimini-tab-tag') === 'add') {
|
if ($('.layuimini-menu-left').attr('layuimini-tab-tag') === 'add') {
|
||||||
$('.layuimini-menu-left').attr('layuimini-tab-tag', 'no')
|
$('.layuimini-menu-left').attr('layuimini-tab-tag', 'no');
|
||||||
} else {
|
} else {
|
||||||
$("[layuimini-href]").parent().removeClass('layui-this');
|
$('[layuimini-href]').parent().removeClass('layui-this');
|
||||||
if (options.multiModule) {
|
if (options.multiModule) {
|
||||||
miniTab.listenSwitchMultiModule(tabId);
|
miniTab.listenSwitchMultiModule(tabId);
|
||||||
} else {
|
} else {
|
||||||
@@ -425,9 +426,9 @@ define(["jquery"], function ($) {
|
|||||||
|
|
||||||
// 判断是否为快捷菜单
|
// 判断是否为快捷菜单
|
||||||
var isSearchMenu = false;
|
var isSearchMenu = false;
|
||||||
$("[layuimini-content-href]").each(function () {
|
$('[layuimini-content-href]').each(function () {
|
||||||
if ($(this).attr("layuimini-content-href") === tabId) {
|
if ($(this).attr('layuimini-content-href') === tabId) {
|
||||||
var title = $(this).attr("data-title");
|
var title = $(this).attr('data-title');
|
||||||
miniTab.create({
|
miniTab.create({
|
||||||
tabId: tabId,
|
tabId: tabId,
|
||||||
href: tabId,
|
href: tabId,
|
||||||
@@ -444,7 +445,10 @@ define(["jquery"], function ($) {
|
|||||||
if (isSearchMenu) return false;
|
if (isSearchMenu) return false;
|
||||||
|
|
||||||
// 既不是右侧菜单、快捷菜单,就直接打开
|
// 既不是右侧菜单、快捷菜单,就直接打开
|
||||||
var title = sessionStorage.getItem('layuiminimenu_' + tabId) === null ? tabId : sessionStorage.getItem('layuiminimenu_' + tabId);
|
var title =
|
||||||
|
sessionStorage.getItem('layuiminimenu_' + tabId) === null
|
||||||
|
? tabId
|
||||||
|
: sessionStorage.getItem('layuiminimenu_' + tabId);
|
||||||
miniTab.create({
|
miniTab.create({
|
||||||
tabId: tabId,
|
tabId: tabId,
|
||||||
href: tabId,
|
href: tabId,
|
||||||
@@ -460,11 +464,11 @@ define(["jquery"], function ($) {
|
|||||||
* 监听滚动
|
* 监听滚动
|
||||||
*/
|
*/
|
||||||
listenRoll: function () {
|
listenRoll: function () {
|
||||||
$(".layuimini-tab-roll-left").click(function () {
|
$('.layuimini-tab-roll-left').click(function () {
|
||||||
miniTab.rollClick("left");
|
miniTab.rollClick('left');
|
||||||
});
|
});
|
||||||
$(".layuimini-tab-roll-right").click(function () {
|
$('.layuimini-tab-roll-right').click(function () {
|
||||||
miniTab.rollClick("right");
|
miniTab.rollClick('right');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -473,21 +477,21 @@ define(["jquery"], function ($) {
|
|||||||
* @param tabId
|
* @param tabId
|
||||||
*/
|
*/
|
||||||
listenSwitchSingleModule: function (tabId) {
|
listenSwitchSingleModule: function (tabId) {
|
||||||
$("[layuimini-href]").each(function () {
|
$('[layuimini-href]').each(function () {
|
||||||
if ($(this).attr("layuimini-href") === tabId) {
|
if ($(this).attr('layuimini-href') === tabId) {
|
||||||
// 自动展开菜单栏
|
// 自动展开菜单栏
|
||||||
var addMenuClass = function ($element, type) {
|
var addMenuClass = function ($element, type) {
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
$element.addClass('layui-this');
|
$element.addClass('layui-this');
|
||||||
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-this')) {
|
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-this')) {
|
||||||
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
|
$('.layuimini-header-menu li').attr('class', 'layui-nav-item');
|
||||||
} else {
|
} else {
|
||||||
addMenuClass($element.parent().parent(), 2);
|
addMenuClass($element.parent().parent(), 2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$element.addClass('layui-nav-itemed');
|
$element.addClass('layui-nav-itemed');
|
||||||
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-nav-itemed')) {
|
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-nav-itemed')) {
|
||||||
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
|
$('.layuimini-header-menu li').attr('class', 'layui-nav-item');
|
||||||
} else {
|
} else {
|
||||||
addMenuClass($element.parent().parent(), 2);
|
addMenuClass($element.parent().parent(), 2);
|
||||||
}
|
}
|
||||||
@@ -504,19 +508,21 @@ define(["jquery"], function ($) {
|
|||||||
* @param tabId
|
* @param tabId
|
||||||
*/
|
*/
|
||||||
listenSwitchMultiModule: function (tabId) {
|
listenSwitchMultiModule: function (tabId) {
|
||||||
$("[layuimini-href]").each(function () {
|
$('[layuimini-href]').each(function () {
|
||||||
if ($(this).attr("layuimini-href") === tabId) {
|
if ($(this).attr('layuimini-href') === tabId) {
|
||||||
|
|
||||||
// 自动展开菜单栏
|
// 自动展开菜单栏
|
||||||
var addMenuClass = function ($element, type) {
|
var addMenuClass = function ($element, type) {
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
$element.addClass('layui-this');
|
$element.addClass('layui-this');
|
||||||
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-this')) {
|
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-this')) {
|
||||||
var moduleId = $element.parent().attr('id');
|
var moduleId = $element.parent().attr('id');
|
||||||
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
|
$('.layuimini-header-menu li').attr('class', 'layui-nav-item');
|
||||||
$("#" + moduleId + "HeaderId").addClass("layui-this");
|
$('#' + moduleId + 'HeaderId').addClass('layui-this');
|
||||||
$(".layuimini-menu-left .layui-nav.layui-nav-tree").attr('class', 'layui-nav layui-nav-tree layui-hide');
|
$('.layuimini-menu-left .layui-nav.layui-nav-tree').attr(
|
||||||
$("#" + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
|
'class',
|
||||||
|
'layui-nav layui-nav-tree layui-hide',
|
||||||
|
);
|
||||||
|
$('#' + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
|
||||||
} else {
|
} else {
|
||||||
addMenuClass($element.parent().parent(), 2);
|
addMenuClass($element.parent().parent(), 2);
|
||||||
}
|
}
|
||||||
@@ -524,10 +530,13 @@ define(["jquery"], function ($) {
|
|||||||
$element.addClass('layui-nav-itemed');
|
$element.addClass('layui-nav-itemed');
|
||||||
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-nav-itemed')) {
|
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-nav-itemed')) {
|
||||||
var moduleId = $element.parent().attr('id');
|
var moduleId = $element.parent().attr('id');
|
||||||
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
|
$('.layuimini-header-menu li').attr('class', 'layui-nav-item');
|
||||||
$("#" + moduleId + "HeaderId").addClass("layui-this");
|
$('#' + moduleId + 'HeaderId').addClass('layui-this');
|
||||||
$(".layuimini-menu-left .layui-nav.layui-nav-tree").attr('class', 'layui-nav layui-nav-tree layui-hide');
|
$('.layuimini-menu-left .layui-nav.layui-nav-tree').attr(
|
||||||
$("#" + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
|
'class',
|
||||||
|
'layui-nav layui-nav-tree layui-hide',
|
||||||
|
);
|
||||||
|
$('#' + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
|
||||||
} else {
|
} else {
|
||||||
addMenuClass($element.parent().parent(), 2);
|
addMenuClass($element.parent().parent(), 2);
|
||||||
}
|
}
|
||||||
@@ -545,16 +554,19 @@ define(["jquery"], function ($) {
|
|||||||
rollPosition: function () {
|
rollPosition: function () {
|
||||||
var $tabTitle = $('.layuimini-tab .layui-tab-title');
|
var $tabTitle = $('.layuimini-tab .layui-tab-title');
|
||||||
var autoLeft = 0;
|
var autoLeft = 0;
|
||||||
$tabTitle.children("li").each(function () {
|
$tabTitle.children('li').each(function () {
|
||||||
if ($(this).hasClass('layui-this')) {
|
if ($(this).hasClass('layui-this')) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
autoLeft += $(this).outerWidth();
|
autoLeft += $(this).outerWidth();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$tabTitle.animate({
|
$tabTitle.animate(
|
||||||
scrollLeft: autoLeft - $tabTitle.width() / 3
|
{
|
||||||
}, 200);
|
scrollLeft: autoLeft - $tabTitle.width() / 3,
|
||||||
|
},
|
||||||
|
200,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -565,17 +577,22 @@ define(["jquery"], function ($) {
|
|||||||
var $tabTitle = $('.layuimini-tab .layui-tab-title');
|
var $tabTitle = $('.layuimini-tab .layui-tab-title');
|
||||||
var left = $tabTitle.scrollLeft();
|
var left = $tabTitle.scrollLeft();
|
||||||
if ('left' === direction) {
|
if ('left' === direction) {
|
||||||
$tabTitle.animate({
|
$tabTitle.animate(
|
||||||
scrollLeft: left - 450
|
{
|
||||||
}, 200);
|
scrollLeft: left - 450,
|
||||||
|
},
|
||||||
|
200,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$tabTitle.animate({
|
$tabTitle.animate(
|
||||||
scrollLeft: left + 450
|
{
|
||||||
}, 200);
|
scrollLeft: left + 450,
|
||||||
|
},
|
||||||
|
200,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return miniTab;
|
window.miniTab = miniTab;
|
||||||
});
|
})();
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
/**
|
(function () {
|
||||||
* date:2020/02/28
|
|
||||||
* author:Mr.Chung
|
|
||||||
* version:2.0
|
|
||||||
* description:layuimini tab框架扩展
|
|
||||||
*/
|
|
||||||
define(["jquery"], function ($) {
|
|
||||||
var $ = layui.$,
|
var $ = layui.$,
|
||||||
layer = layui.layer;
|
layer = layui.layer;
|
||||||
|
|
||||||
@@ -606,6 +600,5 @@ define(["jquery"], function ($) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return miniTheme;
|
window.miniTheme = miniTheme;
|
||||||
})
|
})();
|
||||||
;
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
/**
|
|
||||||
* date:2020/03/01
|
|
||||||
* author:Mr.Chung
|
|
||||||
* version:2.0
|
|
||||||
* description:layuimini 统计框架扩展
|
|
||||||
*/
|
|
||||||
define(["jquery"], function ($) {
|
|
||||||
var $ = layui.$;
|
|
||||||
|
|
||||||
var miniTongji = {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 初始化
|
|
||||||
* @param options
|
|
||||||
*/
|
|
||||||
render: function (options) {
|
|
||||||
options.specific = options.specific || false;
|
|
||||||
options.domains = options.domains || [];
|
|
||||||
var domain = window.location.hostname;
|
|
||||||
if (options.specific === false || (options.specific === true && options.domains.indexOf(domain) >=0)) {
|
|
||||||
miniTongji.listen();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 监听统计代码
|
|
||||||
*/
|
|
||||||
listen: function () {
|
|
||||||
var _hmt = _hmt || [];
|
|
||||||
(function () {
|
|
||||||
var hm = document.createElement("script");
|
|
||||||
hm.src = "https://hm.baidu.com/hm.js?d97abf6d61c21d773f97835defbdef4e";
|
|
||||||
var s = document.getElementsByTagName("script")[0];
|
|
||||||
s.parentNode.insertBefore(hm, s);
|
|
||||||
})();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return miniTongji;
|
|
||||||
});
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
define(['jquery', 'vue'], function ($, Vue) {
|
(function () {
|
||||||
const propertyInputCss = '/static/plugs/lay-module/propertyInput/propertyInput.css';
|
const propertyInputCss = '/static/plugs/lay-module/propertyInput/propertyInput.css';
|
||||||
const propertyInputHtml = '/static/plugs/lay-module/propertyInput/propertyInput.html';
|
const propertyInputHtml = '/static/plugs/lay-module/propertyInput/propertyInput.html';
|
||||||
|
|
||||||
var propertyInput = function () {
|
var propertyInput = function () {
|
||||||
|
$(function () {
|
||||||
var cssElement = document.createElement('link');
|
var cssElement = document.createElement('link');
|
||||||
|
|
||||||
cssElement.setAttribute('rel', 'stylesheet');
|
cssElement.setAttribute('rel', 'stylesheet');
|
||||||
@@ -10,6 +11,7 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
cssElement.setAttribute('href', propertyInputCss);
|
cssElement.setAttribute('href', propertyInputCss);
|
||||||
|
|
||||||
document.body.appendChild(cssElement);
|
document.body.appendChild(cssElement);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
var propertyInputTemplate = '';
|
var propertyInputTemplate = '';
|
||||||
|
|
||||||
@@ -29,11 +31,11 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
var defaultOption = {
|
var defaultOption = {
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
required: ''
|
required: ''
|
||||||
}
|
};
|
||||||
|
|
||||||
var options = $.extend(defaultOption, data);
|
var options = $.extend(defaultOption, data);
|
||||||
|
|
||||||
options.value = $.trim(options.value)
|
options.value = $.trim(options.value);
|
||||||
|
|
||||||
|
|
||||||
app = new Vue({
|
app = new Vue({
|
||||||
@@ -48,7 +50,7 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
value: ''
|
value: ''
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
listItem: {
|
listItem: {
|
||||||
@@ -81,13 +83,13 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
removeItem(item, index) {
|
removeItem(item, index) {
|
||||||
this.listTag.splice(index, 1)
|
this.listTag.splice(index, 1);
|
||||||
},
|
},
|
||||||
onAddItem() {
|
onAddItem() {
|
||||||
this.listItem.push({
|
this.listItem.push({
|
||||||
name: '',
|
name: '',
|
||||||
value: ''
|
value: ''
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
onItemNameChange(item, index, event) {
|
onItemNameChange(item, index, event) {
|
||||||
this.listItem[index].name = event.target.value;
|
this.listItem[index].name = event.target.value;
|
||||||
@@ -99,17 +101,17 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
onItemMoveUp(item, index) {
|
onItemMoveUp(item, index) {
|
||||||
var arr = this.listItem;
|
var arr = this.listItem;
|
||||||
if (index != 0) {
|
if (index != 0) {
|
||||||
arr[index] = arr.splice(index - 1, 1, arr[index])[0]
|
arr[index] = arr.splice(index - 1, 1, arr[index])[0];
|
||||||
} else {
|
} else {
|
||||||
arr.push(arr.shift())
|
arr.push(arr.shift());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onItemMoveDown(item, index) {
|
onItemMoveDown(item, index) {
|
||||||
var arr = this.listItem;
|
var arr = this.listItem;
|
||||||
if (index != arr.length - 1) {
|
if (index != arr.length - 1) {
|
||||||
arr[index] = arr.splice(index + 1, 1, arr[index])[0]
|
arr[index] = arr.splice(index + 1, 1, arr[index])[0];
|
||||||
} else {
|
} else {
|
||||||
arr.unshift(arr.splice(index, 1)[0])
|
arr.unshift(arr.splice(index, 1)[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -120,16 +122,16 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
name: '',
|
name: '',
|
||||||
value: ''
|
value: ''
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
} else {
|
} else {
|
||||||
this.listItem.splice(index, 1)
|
this.listItem.splice(index, 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
}
|
};
|
||||||
|
|
||||||
return new propertyInput();
|
window.propertyInput = new propertyInput();
|
||||||
})
|
})();
|
||||||
@@ -1,15 +1,14 @@
|
|||||||
define(['jquery', 'vue'], function ($, Vue) {
|
(function () {
|
||||||
const tableDataCss = '/static/plugs/lay-module/tableData/tableData.css';
|
const tableDataCss = '/static/plugs/lay-module/tableData/tableData.css';
|
||||||
const tableDataHtml = '/static/plugs/lay-module/tableData/tableData.html';
|
const tableDataHtml = '/static/plugs/lay-module/tableData/tableData.html';
|
||||||
|
|
||||||
var tableData = function () {
|
var tableData = function () {
|
||||||
|
$(function () {
|
||||||
var cssElement = document.createElement('link');
|
var cssElement = document.createElement('link');
|
||||||
|
|
||||||
cssElement.setAttribute('rel', 'stylesheet');
|
cssElement.setAttribute('rel', 'stylesheet');
|
||||||
|
|
||||||
cssElement.setAttribute('href', tableDataCss);
|
cssElement.setAttribute('href', tableDataCss);
|
||||||
|
|
||||||
document.body.appendChild(cssElement);
|
document.body.appendChild(cssElement);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
var tableDataTemplate = '';
|
var tableDataTemplate = '';
|
||||||
|
|
||||||
@@ -42,19 +41,19 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
height: clientHeight,
|
height: clientHeight,
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
selectConfirmCallback: 'onTableDataConfirm',
|
selectConfirmCallback: 'onTableDataConfirm',
|
||||||
}
|
};
|
||||||
|
|
||||||
var options = $.extend(defaultOption, data);
|
var options = $.extend(defaultOption, data);
|
||||||
|
|
||||||
var valueField = options.valueField;
|
var valueField = options.valueField;
|
||||||
|
|
||||||
if (options.index.indexOf('?') > -1) {
|
if (options.index.indexOf('?') > -1) {
|
||||||
options.index += '&'
|
options.index += '&';
|
||||||
} else {
|
} else {
|
||||||
options.index += '?'
|
options.index += '?';
|
||||||
}
|
}
|
||||||
|
|
||||||
options.index += 'select_mode=' + options.selectType
|
options.index += 'select_mode=' + options.selectType;
|
||||||
|
|
||||||
app = new Vue({
|
app = new Vue({
|
||||||
el: elem,
|
el: elem,
|
||||||
@@ -63,14 +62,14 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
setting: options,
|
setting: options,
|
||||||
listSelected: [],
|
listSelected: [],
|
||||||
value: ''
|
value: ''
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
listSelected(value) {
|
listSelected(value) {
|
||||||
|
|
||||||
var valueList = value.map(itemValue => itemValue[valueField])
|
var valueList = value.map(itemValue => itemValue[valueField]);
|
||||||
|
|
||||||
this.value = valueList.join(',')
|
this.value = valueList.join(',');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -87,9 +86,9 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
op: JSON.stringify({ [options.valueField]: 'in' }),
|
op: JSON.stringify({ [options.valueField]: 'in' }),
|
||||||
group: options.valueField
|
group: options.valueField
|
||||||
}, (result) => {
|
}, (result) => {
|
||||||
loading.hide()
|
loading.hide();
|
||||||
this.listSelected = result.data;
|
this.listSelected = result.data;
|
||||||
})
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -124,17 +123,17 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
this.listSelected = [];
|
this.listSelected = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
var itemFind = this.listSelected.find(itemSelect => itemSelect[valueField] == dataItem[valueField])
|
var itemFind = this.listSelected.find(itemSelect => itemSelect[valueField] == dataItem[valueField]);
|
||||||
|
|
||||||
if (itemFind == undefined) {
|
if (itemFind == undefined) {
|
||||||
this.listSelected.push(dataItem)
|
this.listSelected.push(dataItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
}
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
end: function () {
|
end: function () {
|
||||||
@@ -148,10 +147,10 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
this.listSelected.splice(index, 1);
|
this.listSelected.splice(index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
}
|
};
|
||||||
|
|
||||||
return new tableData();
|
window.tableData = new tableData();
|
||||||
})
|
})();
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
define(['jquery', 'vue'], function ($, Vue) {
|
(function () {
|
||||||
const tagInputCss = '/static/plugs/lay-module/tagInput/tagInput.css';
|
const tagInputCss = '/static/plugs/lay-module/tagInput/tagInput.css';
|
||||||
const tagInputHtml = '/static/plugs/lay-module/tagInput/tagInput.html';
|
const tagInputHtml = '/static/plugs/lay-module/tagInput/tagInput.html';
|
||||||
|
|
||||||
var tagInput = function () {
|
var tagInput = function () {
|
||||||
|
$(function () {
|
||||||
var cssElement = document.createElement('link');
|
var cssElement = document.createElement('link');
|
||||||
|
|
||||||
cssElement.setAttribute('rel', 'stylesheet');
|
cssElement.setAttribute('rel', 'stylesheet');
|
||||||
@@ -10,6 +11,7 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
cssElement.setAttribute('href', tagInputCss);
|
cssElement.setAttribute('href', tagInputCss);
|
||||||
|
|
||||||
document.body.appendChild(cssElement);
|
document.body.appendChild(cssElement);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
var tagInputTemplate = '';
|
var tagInputTemplate = '';
|
||||||
|
|
||||||
@@ -29,7 +31,7 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
var defaultOption = {
|
var defaultOption = {
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
required: ''
|
required: ''
|
||||||
}
|
};
|
||||||
|
|
||||||
var options = $.extend(defaultOption, data);
|
var options = $.extend(defaultOption, data);
|
||||||
|
|
||||||
@@ -45,21 +47,21 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
inputWidth: 100,
|
inputWidth: 100,
|
||||||
inputValuePreview: '',
|
inputValuePreview: '',
|
||||||
listTag: []
|
listTag: []
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
inputValue(value) {
|
inputValue(value) {
|
||||||
|
|
||||||
this.inputValuePreview = value;
|
this.inputValuePreview = value;
|
||||||
this.updateInputWidth()
|
this.updateInputWidth();
|
||||||
},
|
},
|
||||||
listTag(value) {
|
listTag(value) {
|
||||||
this.value = value.join(',')
|
this.value = value.join(',');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (options.value.length > 0) {
|
if (options.value.length > 0) {
|
||||||
this.listTag = options.value.split(',')
|
this.listTag = options.value.split(',');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,12 +82,12 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.listTag.push(this.inputValue)
|
this.listTag.push(this.inputValue);
|
||||||
this.inputValue = '';
|
this.inputValue = '';
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
onContainerClick() {
|
onContainerClick() {
|
||||||
$(this.$refs['tagInputMain']).focus()
|
$(this.$refs['tagInputMain']).focus();
|
||||||
},
|
},
|
||||||
onInputChange(e) {
|
onInputChange(e) {
|
||||||
|
|
||||||
@@ -102,13 +104,13 @@ define(['jquery', 'vue'], function ($, Vue) {
|
|||||||
this.inputWidth = width + 60;
|
this.inputWidth = width + 60;
|
||||||
},
|
},
|
||||||
removeItem(item, index) {
|
removeItem(item, index) {
|
||||||
this.listTag.splice(index, 1)
|
this.listTag.splice(index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
}
|
};
|
||||||
|
|
||||||
return new tagInput();
|
window.tagInput = new tagInput();
|
||||||
})
|
})();
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput', 'propertyInput', 'miniTab', 'clipboardjs'], function ($, undefined, miniTheme, tableData, citypicker, tagInput, propertyInput, miniTab, ClipboardJS) {
|
(function () {
|
||||||
|
|
||||||
window.onInitElemStyle = function () {
|
window.onInitElemStyle = function () {
|
||||||
miniTheme.renderElemStyle()
|
miniTheme.renderElemStyle();
|
||||||
|
|
||||||
$('iframe').each(function (index, iframe) {
|
$('iframe').each(function (index, iframe) {
|
||||||
|
|
||||||
if (typeof iframe.contentWindow.onInitElemStyle == "function") {
|
if (typeof iframe.contentWindow.onInitElemStyle == "function") {
|
||||||
iframe.contentWindow.onInitElemStyle();
|
iframe.contentWindow.onInitElemStyle();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
};
|
||||||
window.onInitElemStyle();
|
window.onInitElemStyle();
|
||||||
|
|
||||||
var lastTableWhere = {};
|
var lastTableWhere = {};
|
||||||
@@ -60,7 +60,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
// visio扩展名数组
|
// visio扩展名数组
|
||||||
'visio': ['vsd', 'vsdx'],
|
'visio': ['vsd', 'vsdx'],
|
||||||
'file': []
|
'file': []
|
||||||
}
|
};
|
||||||
|
|
||||||
var allExtGroup = [];
|
var allExtGroup = [];
|
||||||
|
|
||||||
@@ -68,14 +68,14 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if (Object.hasOwnProperty.call(extGroup, extGroupName)) {
|
if (Object.hasOwnProperty.call(extGroup, extGroupName)) {
|
||||||
const extGroupList = extGroup[extGroupName];
|
const extGroupList = extGroup[extGroupName];
|
||||||
|
|
||||||
allExtGroup = allExtGroup.concat(extGroupList)
|
allExtGroup = allExtGroup.concat(extGroupList);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
init.upload_exts += allExtGroup.join('|')
|
init.upload_exts += allExtGroup.join('|');
|
||||||
|
|
||||||
extGroup['office'] = [].concat(extGroup['word'], extGroup['excel'], extGroup['ppt'], extGroup['pdf'])
|
extGroup['office'] = [].concat(extGroup['word'], extGroup['excel'], extGroup['ppt'], extGroup['pdf']);
|
||||||
extGroup['media'] = [].concat(extGroup['image'], extGroup['music'], extGroup['video'])
|
extGroup['media'] = [].concat(extGroup['image'], extGroup['music'], extGroup['video']);
|
||||||
|
|
||||||
var admin = {
|
var admin = {
|
||||||
config: {
|
config: {
|
||||||
@@ -143,7 +143,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if (option.prefix == true) {
|
if (option.prefix == true) {
|
||||||
option.url = admin.url(option.url);
|
option.url = admin.url(option.url);
|
||||||
}
|
}
|
||||||
loading.show()
|
loading.show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: option.url,
|
url: option.url,
|
||||||
type: type,
|
type: type,
|
||||||
@@ -202,7 +202,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
success: function (msg, callback) {
|
success: function (msg, callback) {
|
||||||
if (callback === undefined) {
|
if (callback === undefined) {
|
||||||
callback = function () {
|
callback = function () {
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
var index = layer.msg(msg, { icon: 1, shade: admin.config.shade, scrollbar: false, time: 800, shadeClose: true }, callback);
|
var index = layer.msg(msg, { icon: 1, shade: admin.config.shade, scrollbar: false, time: 800, shadeClose: true }, callback);
|
||||||
return index;
|
return index;
|
||||||
@@ -211,7 +211,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
error: function (msg, callback) {
|
error: function (msg, callback) {
|
||||||
if (callback === undefined) {
|
if (callback === undefined) {
|
||||||
callback = function () {
|
callback = function () {
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
var index = layer.msg(msg, { icon: 2, shade: admin.config.shade, scrollbar: false, time: 3000, shadeClose: true }, callback);
|
var index = layer.msg(msg, { icon: 2, shade: admin.config.shade, scrollbar: false, time: 3000, shadeClose: true }, callback);
|
||||||
return index;
|
return index;
|
||||||
@@ -272,10 +272,10 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
layEvent: 'TABLE_SEARCH',
|
layEvent: 'TABLE_SEARCH',
|
||||||
icon: 'layui-icon-search',
|
icon: 'layui-icon-search',
|
||||||
extend: 'data-table-id="' + options.id + '"'
|
extend: 'data-table-id="' + options.id + '"'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
if (options.defaultToolbar === undefined) {
|
if (options.defaultToolbar === undefined) {
|
||||||
options.defaultToolbar = defaultToolbar
|
options.defaultToolbar = defaultToolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
var table2card = function () {
|
var table2card = function () {
|
||||||
@@ -289,20 +289,20 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if ($(cell).hasClass('laytable-cell-checkbox')) {
|
if ($(cell).hasClass('laytable-cell-checkbox')) {
|
||||||
colsHeader.push('选择');
|
colsHeader.push('选择');
|
||||||
} else {
|
} else {
|
||||||
colsHeader.push($(cell).find('span').first().text())
|
colsHeader.push($(cell).find('span').first().text());
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
domTable.find('.layui-table-main').find('tr').each(function (index, domTr) {
|
domTable.find('.layui-table-main').find('tr').each(function (index, domTr) {
|
||||||
|
|
||||||
$(domTr).find('td').each(function (indexTd, domTd) {
|
$(domTr).find('td').each(function (indexTd, domTd) {
|
||||||
|
|
||||||
$('<div class="data-item">' + colsHeader[indexTd] + '</div>').insertBefore($(domTd).find('.layui-table-cell'))
|
$('<div class="data-item">' + colsHeader[indexTd] + '</div>').insertBefore($(domTd).find('.layui-table-cell'));
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
var tableFixedAutoHeight = function () {
|
var tableFixedAutoHeight = function () {
|
||||||
$(".layui-table-main tr").each(function (index, val) {
|
$(".layui-table-main tr").each(function (index, val) {
|
||||||
@@ -310,20 +310,20 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
$($(this).find(".layui-table-body tbody tr")[index]).height($(val).height());
|
$($(this).find(".layui-table-body tbody tr")[index]).height($(val).height());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
var optionDone = function () { }
|
var optionDone = function () { };
|
||||||
if (options.done != undefined) {
|
if (options.done != undefined) {
|
||||||
optionDone = options.done;
|
optionDone = options.done;
|
||||||
}
|
}
|
||||||
options.done = function () {
|
options.done = function () {
|
||||||
optionDone()
|
optionDone();
|
||||||
table2card()
|
table2card();
|
||||||
tableFixedAutoHeight()
|
tableFixedAutoHeight();
|
||||||
|
|
||||||
// 监听表格内的复制组件
|
// 监听表格内的复制组件
|
||||||
admin.api.copyText('[lay-id=' + options.id + ']');
|
admin.api.copyText('[lay-id=' + options.id + ']');
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
selectMode = admin.getQueryVariable("select_mode");
|
selectMode = admin.getQueryVariable("select_mode");
|
||||||
@@ -343,7 +343,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
|
|
||||||
options.page = {
|
options.page = {
|
||||||
layout: ['first', 'prev', 'page', 'next', 'last', 'count']
|
layout: ['first', 'prev', 'page', 'next', 'last', 'count']
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
} else if (options.cols[0][0].type != 'checkbox') {
|
} else if (options.cols[0][0].type != 'checkbox') {
|
||||||
options.cols[0].unshift({
|
options.cols[0].unshift({
|
||||||
type: 'checkbox'
|
type: 'checkbox'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
} else if (selectMode == 'radio') {
|
} else if (selectMode == 'radio') {
|
||||||
if (options.cols[0][0].type == 'checkbox') {
|
if (options.cols[0][0].type == 'checkbox') {
|
||||||
@@ -362,7 +362,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
} else if (options.cols[0][0].type != 'radio') {
|
} else if (options.cols[0][0].type != 'radio') {
|
||||||
options.cols[0].unshift({
|
options.cols[0].unshift({
|
||||||
type: 'radio'
|
type: 'radio'
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -384,13 +384,13 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if (selectMode == 'checkbox' || selectMode == 'radio') {
|
if (selectMode == 'checkbox' || selectMode == 'radio') {
|
||||||
options.toolbar.unshift('selectConfirm');
|
options.toolbar.unshift('selectConfirm');
|
||||||
|
|
||||||
options.height = 'full-85'
|
options.height = 'full-85';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.init.formFullScreen == true) {
|
if (options.init.formFullScreen == true) {
|
||||||
options.init.formFullScreen = 'true'
|
options.init.formFullScreen = 'true';
|
||||||
} else {
|
} else {
|
||||||
options.init.formFullScreen = 'false'
|
options.init.formFullScreen = 'false';
|
||||||
}
|
}
|
||||||
|
|
||||||
options.toolbar = admin.table.renderToolbar(options.toolbar, options.elem, options.id, options.init);
|
options.toolbar = admin.table.renderToolbar(options.toolbar, options.elem, options.id, options.init);
|
||||||
@@ -402,7 +402,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
options.cols = admin.table.renderTrueHide(options.cols, options);
|
options.cols = admin.table.renderTrueHide(options.cols, options);
|
||||||
|
|
||||||
|
|
||||||
var parseData = function (res) { return res }
|
var parseData = function (res) { return res; };
|
||||||
|
|
||||||
if (typeof options.parseData === 'function') {
|
if (typeof options.parseData === 'function') {
|
||||||
parseData = options.parseData;
|
parseData = options.parseData;
|
||||||
@@ -428,9 +428,9 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res = parseData(res)
|
res = parseData(res);
|
||||||
return res;
|
return res;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// 初始化表格
|
// 初始化表格
|
||||||
@@ -452,7 +452,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
admin.table.listenExport(options);
|
admin.table.listenExport(options);
|
||||||
|
|
||||||
// 监听表格选择器
|
// 监听表格选择器
|
||||||
admin.table.listenTableSelectConfirm(options)
|
admin.table.listenTableSelectConfirm(options);
|
||||||
|
|
||||||
return newTable;
|
return newTable;
|
||||||
},
|
},
|
||||||
@@ -523,7 +523,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
|
|
||||||
var fieldPlusArr = d.fieldAlias.replace('[').split(']');
|
var fieldPlusArr = d.fieldAlias.replace('[').split(']');
|
||||||
|
|
||||||
d.elemIdName = fieldPlusArr.join('-')
|
d.elemIdName = fieldPlusArr.join('-');
|
||||||
}
|
}
|
||||||
|
|
||||||
d.elemIdName = d.elemIdName.replace('.', '-');
|
d.elemIdName = d.elemIdName.replace('.', '-');
|
||||||
@@ -543,7 +543,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
var formSearchHideClass = '';
|
var formSearchHideClass = '';
|
||||||
|
|
||||||
if (d.searchHide) {
|
if (d.searchHide) {
|
||||||
formSearchHideClass = ' search-hide-item'
|
formSearchHideClass = ' search-hide-item';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d.field !== false && d.search !== false) {
|
if (d.field !== false && d.search !== false) {
|
||||||
@@ -653,7 +653,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
options.where = {
|
options.where = {
|
||||||
filter: JSON.stringify(formatFilter),
|
filter: JSON.stringify(formatFilter),
|
||||||
op: JSON.stringify(formatOp)
|
op: JSON.stringify(formatOp)
|
||||||
}
|
};
|
||||||
|
|
||||||
lastTableWhere[tableId] = options.where;
|
lastTableWhere[tableId] = options.where;
|
||||||
|
|
||||||
@@ -689,7 +689,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
for (k in item) {
|
for (k in item) {
|
||||||
var v = item[k];
|
var v = item[k];
|
||||||
if (v.auth == undefined) {
|
if (v.auth == undefined) {
|
||||||
v.auth = 'add'
|
v.auth = 'add';
|
||||||
}
|
}
|
||||||
if (admin.checkAuth(v.auth, elem)) {
|
if (admin.checkAuth(v.auth, elem)) {
|
||||||
check = true;
|
check = true;
|
||||||
@@ -699,7 +699,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!check) {
|
if (!check) {
|
||||||
data[dk].pop()
|
data[dk].pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -715,7 +715,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
col.forEach(colItem => {
|
col.forEach(colItem => {
|
||||||
var trueHide = false;
|
var trueHide = false;
|
||||||
if (typeof colItem.trueHide == 'function') {
|
if (typeof colItem.trueHide == 'function') {
|
||||||
trueHide = colItem.trueHide(colItem, col, options)
|
trueHide = colItem.trueHide(colItem, col, options);
|
||||||
} else if (typeof colItem.trueHide == 'string') {
|
} else if (typeof colItem.trueHide == 'string') {
|
||||||
trueHide = !admin.checkAuth(colItem.trueHide, options.elem);
|
trueHide = !admin.checkAuth(colItem.trueHide, options.elem);
|
||||||
} else {
|
} else {
|
||||||
@@ -723,11 +723,11 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!trueHide) {
|
if (!trueHide) {
|
||||||
newCol.push(colItem)
|
newCol.push(colItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
newData.push(newCol)
|
newData.push(newCol);
|
||||||
}
|
}
|
||||||
|
|
||||||
return newData;
|
return newData;
|
||||||
@@ -782,18 +782,18 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
|
|
||||||
if (typeof operat.titleField == 'function') {
|
if (typeof operat.titleField == 'function') {
|
||||||
console.log(operat.titleField(data, operat));
|
console.log(operat.titleField(data, operat));
|
||||||
titleEndfix = operat.titleField(data, operat)
|
titleEndfix = operat.titleField(data, operat);
|
||||||
|
|
||||||
} else if (data[operat.titleField]) {
|
} else if (data[operat.titleField]) {
|
||||||
titleEndfix = '-' + data[operat.titleField];
|
titleEndfix = '-' + data[operat.titleField];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof operat.text == 'function') {
|
if (typeof operat.text == 'function') {
|
||||||
operat.text = operat.text(data, operat)
|
operat.text = operat.text(data, operat);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof operat.title == 'function') {
|
if (typeof operat.title == 'function') {
|
||||||
operat.title = operat.title(data, operat)
|
operat.title = operat.title(data, operat);
|
||||||
}
|
}
|
||||||
|
|
||||||
var formatOperat = operat;
|
var formatOperat = operat;
|
||||||
@@ -813,7 +813,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
|
|
||||||
formatOperat.dataBind = ' ';
|
formatOperat.dataBind = ' ';
|
||||||
operat.data.forEach((item, index) => {
|
operat.data.forEach((item, index) => {
|
||||||
formatOperat.dataBind += 'data-' + item + '="' + data[item] + '" '
|
formatOperat.dataBind += 'data-' + item + '="' + data[item] + '" ';
|
||||||
});
|
});
|
||||||
|
|
||||||
html = '<a ' + formatOperat.class + formatOperat.method + formatOperat.extend + formatOperat.dataBind + '>' + formatOperat.icon + formatOperat.text + '</a>';
|
html = '<a ' + formatOperat.class + formatOperat.method + formatOperat.extend + formatOperat.dataBind + '>' + formatOperat.icon + formatOperat.text + '</a>';
|
||||||
@@ -836,11 +836,11 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if (val['width'] == undefined && val['minWidth'] == undefined) {
|
if (val['width'] == undefined && val['minWidth'] == undefined) {
|
||||||
var width = null;
|
var width = null;
|
||||||
if (val.title) {
|
if (val.title) {
|
||||||
width = val.title.length * 15 + 55
|
width = val.title.length * 15 + 55;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width != null) {
|
if (width != null) {
|
||||||
cols[i][index]['minWidth'] = width
|
cols[i][index]['minWidth'] = width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -953,11 +953,11 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
endVal.endTemplet = endVal.templet;
|
endVal.endTemplet = endVal.templet;
|
||||||
endVal.templet = function (data) {
|
endVal.templet = function (data) {
|
||||||
if (!data.LAY_COL) {
|
if (!data.LAY_COL) {
|
||||||
data.LAY_COL = this
|
data.LAY_COL = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.endTemplet(data)
|
return this.endTemplet(data);
|
||||||
}
|
};
|
||||||
|
|
||||||
cols[i][index] = endVal;
|
cols[i][index] = endVal;
|
||||||
|
|
||||||
@@ -1023,7 +1023,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
operat.text = operat.text || operat.title;
|
operat.text = operat.text || operat.title;
|
||||||
operat.extend = operat.extend || '';
|
operat.extend = operat.extend || '';
|
||||||
|
|
||||||
operat._if = operat._if || function () { return true };
|
operat._if = operat._if || function () { return true; };
|
||||||
|
|
||||||
if (typeof operat._if == 'function') {
|
if (typeof operat._if == 'function') {
|
||||||
if (operat._if(data, operat) !== true) {
|
if (operat._if(data, operat) !== true) {
|
||||||
@@ -1032,7 +1032,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
} else if (typeof operat._if == 'string') {
|
} else if (typeof operat._if == 'string') {
|
||||||
var ifValue = admin.table.returnColumnValue(data, operat._if, false);
|
var ifValue = admin.table.returnColumnValue(data, operat._if, false);
|
||||||
if (!ifValue) {
|
if (!ifValue) {
|
||||||
return ''
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1056,17 +1056,17 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
var fieldParam = operat.field(data, operat);
|
var fieldParam = operat.field(data, operat);
|
||||||
|
|
||||||
if (typeof fieldParam == 'string') {
|
if (typeof fieldParam == 'string') {
|
||||||
operat.url = fieldParam
|
operat.url = fieldParam;
|
||||||
} else {
|
} else {
|
||||||
var querys = '';
|
var querys = '';
|
||||||
if (operat.url.indexOf("?") !== -1) {
|
if (operat.url.indexOf("?") !== -1) {
|
||||||
if (operat.url.indexOf("?") !== operat.url.length - 1) {
|
if (operat.url.indexOf("?") !== operat.url.length - 1) {
|
||||||
querys = '&'
|
querys = '&';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
querys = '?'
|
querys = '?';
|
||||||
}
|
}
|
||||||
operat.url += querys + $.param(fieldParam)
|
operat.url += querys + $.param(fieldParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1101,7 +1101,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
|
|
||||||
var groupName = admin.getExtGroupName(data.file_ext);
|
var groupName = admin.getExtGroupName(data.file_ext);
|
||||||
|
|
||||||
return '<a href="' + value + '"><img style="height:40px;width:40px" src="/static/admin/images/upload-icons/' + groupName + '.png" /></a>'
|
return '<a href="' + value + '"><img style="height:40px;width:40px" src="/static/admin/images/upload-icons/' + groupName + '.png" /></a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -1133,7 +1133,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
var value = admin.table.returnColumnValue(data);
|
var value = admin.table.returnColumnValue(data);
|
||||||
|
|
||||||
if (admin.empty(value)) {
|
if (admin.empty(value)) {
|
||||||
return ''
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
var urlName = value;
|
var urlName = value;
|
||||||
@@ -1143,9 +1143,9 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
var urlNameFieldType = typeof urlNameField;
|
var urlNameFieldType = typeof urlNameField;
|
||||||
|
|
||||||
if (urlNameFieldType == 'string') {
|
if (urlNameFieldType == 'string') {
|
||||||
urlName = data[urlNameField]
|
urlName = data[urlNameField];
|
||||||
} else if (urlNameFieldType == 'function') {
|
} else if (urlNameFieldType == 'function') {
|
||||||
urlName = urlNameField(data)
|
urlName = urlNameField(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -1202,8 +1202,8 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
},
|
},
|
||||||
bytes: (data) => {
|
bytes: (data) => {
|
||||||
var size = admin.table.returnColumnValue(data);
|
var size = admin.table.returnColumnValue(data);
|
||||||
sizeReadable = admin.bytes(size)
|
sizeReadable = admin.bytes(size);
|
||||||
return sizeReadable
|
return sizeReadable;
|
||||||
},
|
},
|
||||||
copyText(data) {
|
copyText(data) {
|
||||||
var option = data.LAY_COL;
|
var option = data.LAY_COL;
|
||||||
@@ -1248,7 +1248,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if (val !== '') {
|
if (val !== '') {
|
||||||
formatFilter[key] = val;
|
formatFilter[key] = val;
|
||||||
|
|
||||||
var elemId = admin.table.renderSearchFormItemElementId(key)
|
var elemId = admin.table.renderSearchFormItemElementId(key);
|
||||||
|
|
||||||
var op = $('#c-' + elemId).attr('data-search-op');
|
var op = $('#c-' + elemId).attr('data-search-op');
|
||||||
op = op || '%*%';
|
op = op || '%*%';
|
||||||
@@ -1259,8 +1259,8 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
var where = {
|
var where = {
|
||||||
filter: JSON.stringify(formatFilter),
|
filter: JSON.stringify(formatFilter),
|
||||||
op: JSON.stringify(formatOp)
|
op: JSON.stringify(formatOp)
|
||||||
}
|
};
|
||||||
lastTableWhere[tableId] = where
|
lastTableWhere[tableId] = where;
|
||||||
table.reloadData(tableId, {
|
table.reloadData(tableId, {
|
||||||
page: {
|
page: {
|
||||||
curr: 1
|
curr: 1
|
||||||
@@ -1313,7 +1313,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
|
|
||||||
var lastWhere = lastTableWhere[option.id] ?? {};
|
var lastWhere = lastTableWhere[option.id] ?? {};
|
||||||
|
|
||||||
lastWhere.sort = {}
|
lastWhere.sort = {};
|
||||||
lastWhere.sort[obj.field] = obj.type;
|
lastWhere.sort[obj.field] = obj.type;
|
||||||
|
|
||||||
table.reloadData(option.id, {
|
table.reloadData(option.id, {
|
||||||
@@ -1383,7 +1383,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
}
|
}
|
||||||
|
|
||||||
parent.window[selectConfirmCallback](checkStatus.data);
|
parent.window[selectConfirmCallback](checkStatus.data);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
listenExport: function (options) {
|
listenExport: function (options) {
|
||||||
|
|
||||||
@@ -1407,7 +1407,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
|
|
||||||
switch (col.fieldFormat) {
|
switch (col.fieldFormat) {
|
||||||
case 'image':
|
case 'image':
|
||||||
imageFields.push(col.field)
|
imageFields.push(col.field);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'select':
|
case 'select':
|
||||||
@@ -1417,7 +1417,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
break;
|
break;
|
||||||
case 'date':
|
case 'date':
|
||||||
|
|
||||||
dateFields.push(col.field)
|
dateFields.push(col.field);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1445,7 +1445,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if (val !== '') {
|
if (val !== '') {
|
||||||
formatFilter[key] = val;
|
formatFilter[key] = val;
|
||||||
|
|
||||||
var elemId = admin.table.renderSearchFormItemElementId(key)
|
var elemId = admin.table.renderSearchFormItemElementId(key);
|
||||||
|
|
||||||
var op = $('#c-' + elemId).attr('data-search-op');
|
var op = $('#c-' + elemId).attr('data-search-op');
|
||||||
op = op || '%*%';
|
op = op || '%*%';
|
||||||
@@ -1460,7 +1460,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
image_fields: JSON.stringify(imageFields),
|
image_fields: JSON.stringify(imageFields),
|
||||||
select_fields: JSON.stringify(selectFields),
|
select_fields: JSON.stringify(selectFields),
|
||||||
date_fields: JSON.stringify(dateFields),
|
date_fields: JSON.stringify(dateFields),
|
||||||
}
|
};
|
||||||
|
|
||||||
var query = $.param(searchQuery);
|
var query = $.param(searchQuery);
|
||||||
|
|
||||||
@@ -1470,11 +1470,11 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if (toUrl.indexOf('?') < 0) {
|
if (toUrl.indexOf('?') < 0) {
|
||||||
toUrl += '?';
|
toUrl += '?';
|
||||||
} else {
|
} else {
|
||||||
toUrl += '&'
|
toUrl += '&';
|
||||||
}
|
}
|
||||||
toUrl += query;
|
toUrl += query;
|
||||||
|
|
||||||
window.open(toUrl)
|
window.open(toUrl);
|
||||||
|
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
});
|
});
|
||||||
@@ -1538,7 +1538,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
end: function () {
|
end: function () {
|
||||||
index = null
|
index = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (admin.checkMobile() || width === undefined || height === undefined) {
|
if (admin.checkMobile() || width === undefined || height === undefined) {
|
||||||
@@ -1547,7 +1547,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if (isResize) {
|
if (isResize) {
|
||||||
$(window).on("resize", function () {
|
$(window).on("resize", function () {
|
||||||
index && layer.full(index);
|
index && layer.full(index);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
listen: function (preposeCallback, ok, no, ex) {
|
listen: function (preposeCallback, ok, no, ex) {
|
||||||
@@ -1785,7 +1785,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -1827,8 +1827,8 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
api: {
|
api: {
|
||||||
button: function () {
|
button: function () {
|
||||||
$('button[target="_blank"]').click(function () {
|
$('button[target="_blank"]').click(function () {
|
||||||
window.open(admin.url($(this).attr('href')))
|
window.open(admin.url($(this).attr('href')));
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
form: function (url, data, ok, no, ex, refreshTable) {
|
form: function (url, data, ok, no, ex, refreshTable) {
|
||||||
if (refreshTable === undefined) {
|
if (refreshTable === undefined) {
|
||||||
@@ -1881,7 +1881,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
// var options = {
|
// var options = {
|
||||||
// url :'system.menu/index?id=1'
|
// url :'system.menu/index?id=1'
|
||||||
// }
|
// }
|
||||||
// ea.api.reloadTable('currentTableRenderId',options)
|
// ua.api.reloadTable('currentTableRenderId',options)
|
||||||
reloadTable: function (tableName, options, mode) {
|
reloadTable: function (tableName, options, mode) {
|
||||||
tableName = tableName || 'currentTableRenderId';
|
tableName = tableName || 'currentTableRenderId';
|
||||||
if (mode == 'table') {
|
if (mode == 'table') {
|
||||||
@@ -1936,7 +1936,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
// 自动添加layui事件过滤器
|
// 自动添加layui事件过滤器
|
||||||
if (filter === undefined || filter === '') {
|
if (filter === undefined || filter === '') {
|
||||||
filter = 'save_form_' + (i + 1);
|
filter = 'save_form_' + (i + 1);
|
||||||
$(this).attr('lay-filter', filter)
|
$(this).attr('lay-filter', filter);
|
||||||
}
|
}
|
||||||
if (url === undefined || url === '' || url === null) {
|
if (url === undefined || url === '' || url === null) {
|
||||||
url = window.location.href;
|
url = window.location.href;
|
||||||
@@ -1946,9 +1946,9 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
form.on('submit(' + filter + ')', function (data) {
|
form.on('submit(' + filter + ')', function (data) {
|
||||||
var dataField = data.field;
|
var dataField = data.field;
|
||||||
|
|
||||||
dataField = admin.api.formSubmitEditor(dataField, v)
|
dataField = admin.api.formSubmitEditor(dataField, v);
|
||||||
|
|
||||||
dataField = admin.api.formSubmitCity(dataField, v)
|
dataField = admin.api.formSubmitCity(dataField, v);
|
||||||
|
|
||||||
if (typeof preposeCallback === 'function') {
|
if (typeof preposeCallback === 'function') {
|
||||||
dataField = preposeCallback(dataField);
|
dataField = preposeCallback(dataField);
|
||||||
@@ -1963,7 +1963,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
},
|
},
|
||||||
formSubmitEditor(dataField, form) {
|
formSubmitEditor(dataField, form) {
|
||||||
// 富文本数据处理
|
// 富文本数据处理
|
||||||
var editorList = $(form).closest('.layui-form').find('.editor')
|
var editorList = $(form).closest('.layui-form').find('.editor');
|
||||||
if (editorList.length > 0) {
|
if (editorList.length > 0) {
|
||||||
$.each(editorList, function (i, v) {
|
$.each(editorList, function (i, v) {
|
||||||
var name = $(this).attr("name");
|
var name = $(this).attr("name");
|
||||||
@@ -2005,9 +2005,9 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
formatTargetList[targetType] = 0;
|
formatTargetList[targetType] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
});
|
||||||
|
|
||||||
var codeArr = code.split('/')
|
var codeArr = code.split('/');
|
||||||
var textArr = text.split('/');
|
var textArr = text.split('/');
|
||||||
|
|
||||||
if (formatTargetList['name'] == 1) {
|
if (formatTargetList['name'] == 1) {
|
||||||
@@ -2035,9 +2035,9 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
dataField[fieldName + '_code_district'] = codeArr[2] || '';
|
dataField[fieldName + '_code_district'] = codeArr[2] || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
return dataField
|
return dataField;
|
||||||
},
|
},
|
||||||
upload: function () {
|
upload: function () {
|
||||||
var uploadList = document.querySelectorAll("[data-upload]");
|
var uploadList = document.querySelectorAll("[data-upload]");
|
||||||
@@ -2125,8 +2125,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
|
|
||||||
if (extGroup.image.indexOf(ext) != -1) {
|
if (extGroup.image.indexOf(ext) != -1) {
|
||||||
// 是图片
|
// 是图片
|
||||||
liHtml += '<li><a title="点击预览"><img src="' + v + '" data-images onerror="this.src=\'' + BASE_URL + 'admin/images/upload-icons/' + uploadIcon + '.png\';this.onerror=null"></a><small class="uploads-delete-tip bg-red badge" data-upload-delete="' + uploadName + '" data-upload-filename-field="' + uploadFilenameField + '" data-upload-url="' + v + '" data-upload-sign="' + uploadSign + '">×</small></li>\n';
|
liHtml += '<li><a title="点击预览"><img src="' + v + '" data-images onerror="this.src=\'/admin/images/upload-icons/' + uploadIcon + '.png\';this.onerror=null"></a><small class="uploads-delete-tip bg-red badge" data-upload-delete="' + uploadName + '" data-upload-filename-field="' + uploadFilenameField + '" data-upload-url="' + v + '" data-upload-sign="' + uploadSign + '">×</small></li>\n';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 不是图片
|
// 不是图片
|
||||||
// 遍历extGroup数组找到扩展名所在的索引
|
// 遍历extGroup数组找到扩展名所在的索引
|
||||||
@@ -2166,14 +2165,14 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
var currentUrlList = currentUrl.split(sign);
|
var currentUrlList = currentUrl.split(sign);
|
||||||
var deleteIndex = currentUrlList.indexOf(deleteUrl);
|
var deleteIndex = currentUrlList.indexOf(deleteUrl);
|
||||||
|
|
||||||
currentUrlList.splice(deleteIndex, 1)
|
currentUrlList.splice(deleteIndex, 1);
|
||||||
$(elem).val(currentUrlList.join(sign));
|
$(elem).val(currentUrlList.join(sign));
|
||||||
$(elem).trigger("input");
|
$(elem).trigger("input");
|
||||||
|
|
||||||
if (currentFilename) {
|
if (currentFilename) {
|
||||||
|
|
||||||
var currentFilenameList = currentFilename.split(sign);
|
var currentFilenameList = currentFilename.split(sign);
|
||||||
currentFilenameList.splice(deleteIndex, 1)
|
currentFilenameList.splice(deleteIndex, 1);
|
||||||
|
|
||||||
$(elemFilenameField).val(currentFilenameList.join(sign));
|
$(elemFilenameField).val(currentFilenameList.join(sign));
|
||||||
}
|
}
|
||||||
@@ -2193,7 +2192,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
|
|
||||||
if (uploadFilenameField) {
|
if (uploadFilenameField) {
|
||||||
var elemFilenameField = "input[name='" + uploadFilenameField + "']";
|
var elemFilenameField = "input[name='" + uploadFilenameField + "']";
|
||||||
var elemFilename = $(elemFilenameField)
|
var elemFilename = $(elemFilenameField);
|
||||||
}
|
}
|
||||||
|
|
||||||
var selectCheck = uploadNumber === 'one' ? 'radio' : 'checkbox';
|
var selectCheck = uploadNumber === 'one' ? 'radio' : 'checkbox';
|
||||||
@@ -2227,16 +2226,16 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
var currentFilename = $(elemFilename).val();
|
var currentFilename = $(elemFilename).val();
|
||||||
var filenameArray = currentFilename.split(uploadSign);
|
var filenameArray = currentFilename.split(uploadSign);
|
||||||
if (currentFilename.length == 0 || selectCheck == 'radio') {
|
if (currentFilename.length == 0 || selectCheck == 'radio') {
|
||||||
filenameArray = []
|
filenameArray = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$.each(data, function (index, val) {
|
$.each(data, function (index, val) {
|
||||||
if (urlArray.indexOf(val.url) == -1) {
|
if (urlArray.indexOf(val.url) == -1) {
|
||||||
urlArray.push(val.url)
|
urlArray.push(val.url);
|
||||||
}
|
}
|
||||||
if (uploadFilenameField) {
|
if (uploadFilenameField) {
|
||||||
if (filenameArray.indexOf(val.original_name) == -1) {
|
if (filenameArray.indexOf(val.original_name) == -1) {
|
||||||
filenameArray.push(val.original_name)
|
filenameArray.push(val.original_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2253,10 +2252,10 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
$(elem).trigger("input");
|
$(elem).trigger("input");
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
admin.msg.success('选择成功');
|
admin.msg.success('选择成功');
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
})
|
});
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2291,7 +2290,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
if (typeof template != 'function') {
|
if (typeof template != 'function') {
|
||||||
template = function (data, fields) {
|
template = function (data, fields) {
|
||||||
return data[fields[1]];
|
return data[fields[1]];
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var fields = selectFields.replace(/\s/g, "").split(',');
|
var fields = selectFields.replace(/\s/g, "").split(',');
|
||||||
@@ -2356,7 +2355,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
tableData() {
|
tableData() {
|
||||||
var tableList = document.querySelectorAll('[data-toggle="table-data"]');
|
var tableList = document.querySelectorAll('[data-toggle="table-data"]');
|
||||||
$.each(tableList, function (i, v) {
|
$.each(tableList, function (i, v) {
|
||||||
var data = $(v).data()
|
var data = $(v).data();
|
||||||
tableData.render(v, data, admin);
|
tableData.render(v, data, admin);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2364,7 +2363,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
tagInput() {
|
tagInput() {
|
||||||
var list = document.querySelectorAll('[data-toggle="tag-input"]');
|
var list = document.querySelectorAll('[data-toggle="tag-input"]');
|
||||||
$.each(list, function (i, v) {
|
$.each(list, function (i, v) {
|
||||||
var data = $(v).data()
|
var data = $(v).data();
|
||||||
tagInput.render(v, data, admin);
|
tagInput.render(v, data, admin);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2372,8 +2371,8 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
propertyInput() {
|
propertyInput() {
|
||||||
var list = document.querySelectorAll('[data-toggle="property-input"]');
|
var list = document.querySelectorAll('[data-toggle="property-input"]');
|
||||||
$.each(list, function (i, v) {
|
$.each(list, function (i, v) {
|
||||||
var data = $(v).data()
|
var data = $(v).data();
|
||||||
data.value = $(v).text()
|
data.value = $(v).text();
|
||||||
|
|
||||||
propertyInput.render(v, data, admin);
|
propertyInput.render(v, data, admin);
|
||||||
});
|
});
|
||||||
@@ -2381,7 +2380,7 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
},
|
},
|
||||||
copyText(elem) {
|
copyText(elem) {
|
||||||
if (elem == undefined) {
|
if (elem == undefined) {
|
||||||
elem = 'body'
|
elem = 'body';
|
||||||
}
|
}
|
||||||
var list = $(elem).find('[data-toggle="copy-text"]');
|
var list = $(elem).find('[data-toggle="copy-text"]');
|
||||||
|
|
||||||
@@ -2395,11 +2394,11 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
var clipboard = new ClipboardJS(v);
|
var clipboard = new ClipboardJS(v);
|
||||||
|
|
||||||
clipboard.on('success', function (e) {
|
clipboard.on('success', function (e) {
|
||||||
admin.msg.success('复制成功')
|
admin.msg.success('复制成功');
|
||||||
});
|
});
|
||||||
|
|
||||||
clipboard.on('error', function (e) {
|
clipboard.on('error', function (e) {
|
||||||
admin.msg.error('复制失败')
|
admin.msg.error('复制失败');
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -2456,23 +2455,24 @@ define(["jquery", "ckeditor", 'miniTheme', 'tableData', 'citypicker', 'tagInput'
|
|||||||
for (t = 0, e = f.length; t < e; t++) if (r === f[t]) return !0;
|
for (t = 0, e = f.length; t < e; t++) if (r === f[t]) return !0;
|
||||||
if ("object" == typeof r) {
|
if ("object" == typeof r) {
|
||||||
for (n in r) if (r.hasOwnProperty(n)) return !1;
|
for (n in r) if (r.hasOwnProperty(n)) return !1;
|
||||||
return !0
|
return !0;
|
||||||
}
|
}
|
||||||
return !1
|
return !1;
|
||||||
},
|
},
|
||||||
|
|
||||||
bytes(size) {
|
bytes(size) {
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
const kb = 1024
|
const kb = 1024;
|
||||||
const unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
const unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||||
const i = Math.floor(Math.log(size) / Math.log(kb))
|
const i = Math.floor(Math.log(size) / Math.log(kb));
|
||||||
const num = (size / Math.pow(kb, i)).toPrecision(3)
|
const num = (size / Math.pow(kb, i)).toPrecision(3);
|
||||||
const u = unit[i]
|
const u = unit[i];
|
||||||
return num + u;
|
return num + u;
|
||||||
}
|
}
|
||||||
return '0B';
|
return '0B';
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return admin;
|
|
||||||
});
|
window.ulAdmin = window.ua = admin;
|
||||||
|
})();
|
||||||
Reference in New Issue
Block a user