mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 10:32:48 +08:00
将js代码架构改为app下渲染;
This commit is contained in:
@@ -1473,11 +1473,11 @@ class BuildCurdService
|
||||
$var_name = $this->getFieldVarName($field);
|
||||
|
||||
if ($val['formType'] == 'image') {
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ea.table.image}";
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ua.table.image}";
|
||||
} elseif ($val['formType'] == 'images') {
|
||||
continue;
|
||||
} elseif ($val['formType'] == 'file') {
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ea.table.url}";
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ua.table.url}";
|
||||
} elseif ($val['formType'] == 'files') {
|
||||
continue;
|
||||
} elseif ($val['formType'] == 'editor') {
|
||||
@@ -1486,18 +1486,18 @@ class BuildCurdService
|
||||
continue;
|
||||
} elseif (in_array($field, $this->switchFields)) {
|
||||
if (isset($val['define']) && !empty($val['define'])) {
|
||||
$templateValue = "{field: '{$field}', search: 'select', selectList: ea.getDataBrage('{$var_name}'), title: '{$val['comment']}', templet: ea.table.switch}";
|
||||
$templateValue = "{field: '{$field}', search: 'select', selectList: ua.getDataBrage('{$var_name}'), title: '{$val['comment']}', templet: ua.table.switch}";
|
||||
} else {
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ea.table.switch}";
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ua.table.switch}";
|
||||
}
|
||||
} elseif (in_array($val['formType'], ['select', 'checkbox', 'radio', 'switch'])) {
|
||||
if (isset($val['define']) && !empty($val['define'])) {
|
||||
$templateValue = "{field: '{$field}', search: 'select', selectList: ea.getDataBrage('{$var_name}'), title: '{$val['comment']}'}";
|
||||
$templateValue = "{field: '{$field}', search: 'select', selectList: ua.getDataBrage('{$var_name}'), title: '{$val['comment']}'}";
|
||||
} else {
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}'}";
|
||||
}
|
||||
} elseif (in_array($field, ['remark'])) {
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ea.table.text}";
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', templet: ua.table.text}";
|
||||
} elseif (in_array($field, $this->sortFields)) {
|
||||
$templateValue = "{field: '{$field}', title: '{$val['comment']}', edit: 'text'}";
|
||||
} else {
|
||||
@@ -1512,11 +1512,11 @@ class BuildCurdService
|
||||
$table = Str::camel($table);
|
||||
foreach ($tableVal['tableColumns'] as $field => $val) {
|
||||
if ($val['formType'] == 'image') {
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ea.table.image}";
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ua.table.image}";
|
||||
} elseif ($val['formType'] == 'images') {
|
||||
continue;
|
||||
} elseif ($val['formType'] == 'file') {
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ea.table.url}";
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ua.table.url}";
|
||||
} elseif ($val['formType'] == 'files') {
|
||||
continue;
|
||||
} elseif ($val['formType'] == 'editor') {
|
||||
@@ -1526,9 +1526,9 @@ class BuildCurdService
|
||||
} elseif ($val['formType'] == 'select') {
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}'}";
|
||||
} elseif (in_array($field, ['remark'])) {
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ea.table.text}";
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ua.table.text}";
|
||||
} elseif (in_array($field, $this->switchFields)) {
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ea.table.switch}";
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', templet: ua.table.switch}";
|
||||
} elseif (in_array($field, $this->sortFields)) {
|
||||
$templateValue = "{field: '{$table}.{$field}', title: '{$val['comment']}', edit: 'text'}";
|
||||
} else {
|
||||
@@ -1539,7 +1539,7 @@ class BuildCurdService
|
||||
}
|
||||
}
|
||||
|
||||
$indexCols .= $this->formatColsRow("{width: 250, title: '操作', templet: ea.table.tool , fixed:'right'},\r");
|
||||
$indexCols .= $this->formatColsRow("{width: 250, title: '操作', templet: ua.table.tool , fixed:'right'},\r");
|
||||
|
||||
$jsValue = $this->replaceTemplate(
|
||||
$this->getTemplate("static{$this->DS}js"),
|
||||
|
||||
@@ -14,20 +14,20 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
||||
var Controller = {
|
||||
|
||||
index: function () {
|
||||
ea.table.render({
|
||||
ua.table.render({
|
||||
init: init,
|
||||
cols: [[
|
||||
{{indexCols}}
|
||||
]],
|
||||
});
|
||||
|
||||
ea.listen();
|
||||
ua.listen();
|
||||
},
|
||||
add: function () {
|
||||
ea.listen();
|
||||
ua.listen();
|
||||
},
|
||||
edit: function () {
|
||||
ea.listen();
|
||||
ua.listen();
|
||||
},
|
||||
};
|
||||
return Controller;
|
||||
|
||||
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();
|
||||
});
|
||||
@@ -111,4 +111,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
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 http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<!--[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?v={$version}" media="all">
|
||||
|
||||
<link rel="stylesheet" href="__STATIC__/common/css/theme/index.css?v={$version}">
|
||||
|
||||
{include file='common/_require'/}
|
||||
<script>
|
||||
window.CONFIG = {
|
||||
ADMIN: "{$adminModuleName|default='admin'}",
|
||||
@@ -25,11 +18,15 @@
|
||||
VERSION: "{$version|default='1.0.0'}",
|
||||
CSRF_TOKEN: "{:token()}",
|
||||
};
|
||||
|
||||
var PATH_CONFIG = {
|
||||
iconLess: "__STATIC__/plugs/font-awesome-4.7.0/less/variables.less",
|
||||
};
|
||||
window.PATH_CONFIG = PATH_CONFIG;
|
||||
</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>
|
||||
<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>
|
||||
|
||||
{$content_js|raw}
|
||||
|
||||
</head>
|
||||
|
||||
<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>
|
||||
$('#demo-login-btn').click(function() {
|
||||
$('[name="username"]').val('admin')
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<div class="layui-form-item" style="text-align:center; width:100%;height:100%;margin:0px;">
|
||||
<button class="login-btn" lay-submit>立即登录</button>
|
||||
</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">
|
||||
{:event_view_content("AdminLoginType")}
|
||||
</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-main">
|
||||
<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">
|
||||
<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">
|
||||
</table>
|
||||
</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();
|
||||
});
|
||||
Reference in New Issue
Block a user