mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 02:52:49 +08:00
删除纯静态的业务js
This commit is contained in:
@@ -1,64 +0,0 @@
|
|||||||
define(["jquery", "easy-admin"], function ($, ea) {
|
|
||||||
|
|
||||||
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 Controller = {
|
|
||||||
|
|
||||||
index: function () {
|
|
||||||
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();
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
edit: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
define(["jquery", "easy-admin", "echarts", "echarts-theme", "miniAdmin"], function ($, ea, echarts, undefined, miniAdmin) {
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
index: 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');
|
|
||||||
})
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
welcome: 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();
|
|
||||||
},
|
|
||||||
editAdmin: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
editPassword: function () {
|
|
||||||
ua.listen();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
define(["easy-admin"], function (ea) {
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
index: function () {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
define(["jquery", "easy-admin"], function ($, ea) {
|
|
||||||
|
|
||||||
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',
|
|
||||||
};
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
|
|
||||||
index: 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();
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
edit: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
define(["jquery", "easy-admin"], function ($, ea) {
|
|
||||||
|
|
||||||
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,
|
|
||||||
};
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
|
|
||||||
index: 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();
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
edit: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
stock: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
read: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
define(["jquery", "easy-admin"], function ($, ea) {
|
|
||||||
|
|
||||||
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',
|
|
||||||
};
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
|
|
||||||
index: 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();
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
edit: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
define(["jquery", "easy-admin"], function ($, ea) {
|
|
||||||
|
|
||||||
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',
|
|
||||||
};
|
|
||||||
|
|
||||||
var authList = ua.getDataBrage('auth_list', []);
|
|
||||||
var count = ua.getDataBrage('count', 0);
|
|
||||||
var tips = ua.getDataBrage('tips', '');
|
|
||||||
var tips = ua.getDataBrage('adminCustomFlag');
|
|
||||||
|
|
||||||
console.log(authList);
|
|
||||||
console.log(count);
|
|
||||||
console.log(tips);
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
|
|
||||||
index: 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();
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
edit: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
password: function () {
|
|
||||||
ua.listen();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
define(["jquery", "easy-admin"], function ($, ea) {
|
|
||||||
|
|
||||||
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',
|
|
||||||
};
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
|
|
||||||
index: 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();
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
edit: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
authorize: 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;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
define(["jquery", "easy-admin", "vue"], function ($, ea, Vue) {
|
|
||||||
|
|
||||||
var form = layui.form;
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
index: function () {
|
|
||||||
|
|
||||||
$('.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();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,245 +0,0 @@
|
|||||||
define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], function ($, ea) {
|
|
||||||
|
|
||||||
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',
|
|
||||||
};
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
index: 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();
|
|
||||||
},
|
|
||||||
add: 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");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
edit: 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");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
define(["jquery", "easy-admin"], function ($, ea) {
|
|
||||||
|
|
||||||
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',
|
|
||||||
};
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
|
|
||||||
index: 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();
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
edit: function () {
|
|
||||||
ua.listen();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
define(["jquery", "easy-admin", "iconPickerFa", "autocomplete"], function ($, ea) {
|
|
||||||
|
|
||||||
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',
|
|
||||||
};
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
|
|
||||||
index: 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();
|
|
||||||
},
|
|
||||||
add: 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();
|
|
||||||
},
|
|
||||||
edit: 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();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
define(["jquery", "easy-admin"], function ($, ea) {
|
|
||||||
|
|
||||||
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',
|
|
||||||
};
|
|
||||||
|
|
||||||
var Controller = {
|
|
||||||
|
|
||||||
index: 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();
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
edit: function () {
|
|
||||||
ua.listen();
|
|
||||||
},
|
|
||||||
password: function () {
|
|
||||||
ua.listen();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return Controller;
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user