style: 优化css样式,全局使用show.xx消息提示
This commit is contained in:
@@ -129,10 +129,11 @@
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-upload-logo">
|
||||
<dl>
|
||||
<dt> <img class="logo" src="{$config.site_logo}" alt="{:__('站点LOGO')}">
|
||||
<dt>
|
||||
<img class="logo" src="{$config.site_logo|default='/static/images/loading/loading-form.gif'}"
|
||||
alt="{:__('站点LOGO')}">
|
||||
</dt>
|
||||
<dd class="layui-badge"
|
||||
onclick="javascript:layer.msg('好像没写代码!','error')">{:__('删除')}</dd>
|
||||
<dd class="layui-badge" id="delLogo">{:__('删除')}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1805,32 +1806,34 @@
|
||||
<include file="/public/footer" />
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'admin'], function () {
|
||||
layui.use(['jquery'], function () {
|
||||
let $ = layui.jquery;
|
||||
|
||||
var form = layui.form;
|
||||
var admin = layui.admin;
|
||||
var jquery = layui.jquery;
|
||||
$('#delLogo').click(function() {
|
||||
$('input.logo').val('');
|
||||
$('img.logo').attr('src', '/static/images/loading/loading-form.gif');
|
||||
});
|
||||
|
||||
// 增加变量
|
||||
jquery('.layui-variable-add').on('click', function () {
|
||||
var html = '<tr>';
|
||||
$('.layui-variable-add').on('click', function () {
|
||||
let html = '<tr>';
|
||||
html += '<td><input type="text" class="layui-input layui-variable-key" lay-verify="required" ><\/td>';
|
||||
html += '<td><input type="text" class="layui-input layui-variable-value"><\/td>';
|
||||
html += '<td><button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon layui-icon-delete"><\/i><\/button><\/td>';
|
||||
html += '<\/tr>';
|
||||
jquery('#layui-variable-content').append(html);
|
||||
$('#layui-variable-content').append(html);
|
||||
})
|
||||
|
||||
// 改变表单值
|
||||
jquery('body').on('change', '.layui-variable-key', function () {
|
||||
var that = jquery(this),
|
||||
$('body').on('change', '.layui-variable-key', function () {
|
||||
let that = $(this),
|
||||
name = 'variable[' + that.val() + ']';
|
||||
jquery(that).parents('tr').find('.layui-variable-value').attr('name', name);
|
||||
$(that).parents('tr').find('.layui-variable-value').attr('name', name);
|
||||
})
|
||||
|
||||
// 删除自定义变量
|
||||
jquery('body').on('click', '#layui-variable-content .layui-btn', function () {
|
||||
jquery(this).parents('tr').remove();
|
||||
$('body').on('click', '#layui-variable-content .layui-btn', function () {
|
||||
$(this).parents('tr').remove();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -33,22 +33,22 @@
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-admin-workplace">
|
||||
<div class="workplace-header">
|
||||
<span><i class="layui-icon layui-icon-list"></i>文章数</span>
|
||||
<span><i class="layui-icon layui-icon-list"></i>通知</span>
|
||||
</div>
|
||||
<div class="workplace-content">{$workplace.article|default=26}</div>
|
||||
<div class="workplace-content">{$workplace.notice|default=26}</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-admin-workplace">
|
||||
<div class="workplace-header">
|
||||
<span><i class="layui-icon layui-icon-date date"></i>待审核</span>
|
||||
<span><i class="layui-icon layui-icon-date date"></i>待办项</span>
|
||||
</div>
|
||||
<div class="workplace-content">{$workplace.check|default="12/56"}</div>
|
||||
<div class="workplace-content">{$todoList}/{$workplace.todo}</div>
|
||||
</div>
|
||||
<div class="layui-admin-workplace">
|
||||
<div class="workplace-header">
|
||||
<span><i class="layui-icon layui-icon-notice notice"></i>评论数</span>
|
||||
<span><i class="layui-icon layui-icon-notice notice"></i>消息</span>
|
||||
</div>
|
||||
<div class="workplace-content">{$workplace.comment|default="2,352"}</div>
|
||||
<div class="workplace-content">{$workplace.message|default="2,352"}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,7 +99,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs6 layui-col-sm6">
|
||||
<div class="layui-card smallblock" sa-event="tabs" data-url="{:url('/index/analysis')}"
|
||||
<div class="layui-card smallblock" sa-event="tabs" data-url="{:url('/Index/analysis')}"
|
||||
data-title="{:__('分析页')}">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-small-block">
|
||||
@@ -114,7 +114,7 @@
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-row layui-col-space10" style="margin-bottom: 5px;">
|
||||
<div class="layui-col-xs6 layui-col-sm6">
|
||||
<div class="layui-card smallblock" sa-event="tabs" data-url="{:url('/index/monitor')}"
|
||||
<div class="layui-card smallblock" sa-event="tabs" data-url="{:url('/Index/monitor')}"
|
||||
data-title="{:__('监控页')}">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-small-block">
|
||||
@@ -151,7 +151,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs6 layui-col-sm6">
|
||||
<div class="layui-card smallblock" sa-event="tabs" data-url="{:url('/index/baseCfg')}"
|
||||
<div class="layui-card smallblock" sa-event="tabs" data-url="{:url('/Index/baseCfg')}"
|
||||
data-title="{:__('基本设置')}">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-small-block">
|
||||
@@ -290,7 +290,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="layui-hide" id="ID-treeTable-demo"></table>
|
||||
</div>
|
||||
<script src="__STATICADMIN__module/echarts/echarts.js"></script>
|
||||
<script src="__STATICADMIN__module/echarts/echarts-wordcloud.js"></script>
|
||||
@@ -299,35 +298,10 @@
|
||||
<include file="/public/footer"/>
|
||||
|
||||
<script>
|
||||
layui.use(['jquery','layer','treeTable'], function () {
|
||||
layui.use(['jquery','show'], function () {
|
||||
|
||||
let $ = layui.jquery;
|
||||
let layer = layui.layer;
|
||||
let treeTable = layui.treeTable;
|
||||
|
||||
var inst = treeTable.render({
|
||||
elem: '#ID-treeTable-demo',
|
||||
url: '/static/demo-1.json?page=1&limit=10', // 此处为静态模拟数据,实际使用时需换成真实接口
|
||||
tree: {
|
||||
customName: {
|
||||
icon: 'icon2',
|
||||
name: 'title'
|
||||
},
|
||||
},
|
||||
maxHeight: '501px',
|
||||
toolbar: '#TPL-treeTable-demo',
|
||||
cols: [[
|
||||
{type: 'checkbox', fixed: 'left'},
|
||||
{field: 'id', title: 'ID', width: 80, sort: true, fixed: 'left'},
|
||||
{field: 'name', title: '用户名', width: 180, fixed: 'left'},
|
||||
{field: 'experience', title: '积分', width: 90, sort: true},
|
||||
{field: 'sex', title: '性别', width: 80, sort: true},
|
||||
{field: 'score', title: '评分', width: 80, sort: true},
|
||||
{field: 'city', title: '城市'},
|
||||
{ fixed: "right", title: "操作", width: 181, align: "center", toolbar: "#TPL-treeTable-demo-tools"}
|
||||
]],
|
||||
page: true
|
||||
});
|
||||
let show = layui.show;
|
||||
|
||||
/**
|
||||
* 用户统计报表
|
||||
@@ -354,7 +328,7 @@
|
||||
$(that).addClass('active');
|
||||
}
|
||||
else {
|
||||
layer.info(res.msg);
|
||||
show.info(res.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -28,14 +28,15 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
let _global_ = {
|
||||
let app_Config = {
|
||||
app: "{$app|default='admin.php'}",
|
||||
controller: "{$controller|default='index'}",
|
||||
action: "{$action|default='index'}",
|
||||
api: "{:config('app.api_url')}"
|
||||
api: "{:config('app.api_url')}",
|
||||
version: "{:config('app.version')}",
|
||||
};
|
||||
|
||||
let _upload_chunkSize = {:saenv('upload_chunk_size')};
|
||||
let upload_chunkSize = {:saenv('upload_chunk_size')};
|
||||
</script>
|
||||
<body class="layui-layout-body">
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
|
||||
@@ -192,10 +192,11 @@
|
||||
<script src="__STATICADMIN__js/common.js?v={:release()}"></script>
|
||||
<script>
|
||||
window.sessionStorage.clear();
|
||||
layui.use(['layer','form'],function() {
|
||||
layui.use(['layer','form','show'],function() {
|
||||
var $ = layui.jquery,
|
||||
layer = layui.layer,
|
||||
form = layui.form,
|
||||
show = layui.show,
|
||||
captchaUrl = '{:captcha_src()}';
|
||||
|
||||
// 登录操作
|
||||
@@ -223,11 +224,11 @@
|
||||
email = $('input[name="email"]').val();
|
||||
|
||||
if (pass !== repass) {
|
||||
layer.msg("{:__('两次输入密码不同')}",'error');
|
||||
show.error('两次输入密码不同');
|
||||
return false;
|
||||
}
|
||||
|
||||
layer.msg("{:__('数据提交中...')}",'warning');
|
||||
show.info('数据提交中...');
|
||||
that.prop('disabled', true);
|
||||
$_ajax(that,{name: name, pwd: pass, email:email,captcha: captcha});
|
||||
return false;
|
||||
@@ -310,7 +311,7 @@
|
||||
valicode = $('input[name="valicode"]').val();
|
||||
|
||||
if (pass != repass) {
|
||||
layer.msg("{:__('两次输入密码不同')}",'error')
|
||||
show.error('两次输入密码不同');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -319,12 +320,12 @@
|
||||
url: "{:url('/login/setpwd')}",
|
||||
data: {name:name,pass:pass,valicode:valicode},
|
||||
success: function (res) {
|
||||
if(res.code == 200){
|
||||
if(res.code === 200){
|
||||
layer.msg(res.msg,function(){
|
||||
location.reload();
|
||||
});
|
||||
}else {
|
||||
layer.error(res.msg);
|
||||
show.error(res.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -352,7 +353,7 @@
|
||||
}
|
||||
|
||||
}else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
that.prop('disabled', false);
|
||||
$("#captchaImg,#captchaImg2,#captchaImg3").attr('src',captchaUrl+'?rand='+Math.random()).parents('.layui-form-item').show();
|
||||
return false;
|
||||
|
||||
@@ -17,14 +17,15 @@
|
||||
<![endif]-->
|
||||
</head>
|
||||
<script>
|
||||
var _global_ = {
|
||||
let app_Config = {
|
||||
app: "{$app|default='/admin'}",
|
||||
controller: "{$controller|default='index'}",
|
||||
action: "{$action|default='index'}",
|
||||
api: "{:config('app.api_url')}"
|
||||
version: "{:config('app.version')}",
|
||||
api: "{:config('app.api_url')}",
|
||||
};
|
||||
|
||||
var _upload_chunkSize = {:saenv('upload_chunk_size')};
|
||||
let upload_chunkSize = {:saenv('upload_chunk_size')};
|
||||
</script>
|
||||
|
||||
<body>
|
||||
@@ -297,7 +297,7 @@
|
||||
layer.msg("{:__('上传成功')}");
|
||||
})
|
||||
} else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@
|
||||
elem += '</span>';
|
||||
$('.layui-badge-list').append(elem);
|
||||
} else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -365,7 +365,7 @@
|
||||
if (res.code === 200) {
|
||||
that.parent('span').remove();
|
||||
} else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
_pageUrl = _form.attr("action") || pageThat.data('url');
|
||||
pageThat.attr("disabled",true);
|
||||
if (typeof(_pageUrl) === 'undefined') {
|
||||
layer.msg('缺少URL属性','error');
|
||||
layer.msg('缺少URL属性');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
// 关闭当前窗口
|
||||
layer.close(colletction.index);
|
||||
}else{
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
_pageUrl = _form.attr("action") || pageThat.data('url');
|
||||
pageThat.attr("disabled",true);
|
||||
if (typeof(_pageUrl) === 'undefined') {
|
||||
layer.msg('缺少URL属性','error');
|
||||
layer.msg('缺少URL属性');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
// 关闭当前窗口
|
||||
layer.close(colletction.index);
|
||||
}else{
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
|
||||
<!-- // 列表编辑框 -->
|
||||
<script type="text/html" id="tableBar">
|
||||
<if (check_admin_auth(url("/system/admin/edit")))>
|
||||
<if (has_admin_auth(url("/system/admin/edit")))>
|
||||
<a class="layui-table-text" data-title="{:__('编辑')} {{d.name}}" callback="edits" data-url="#adminforms" data-area="690px,500px" lay-event="edit" >{:__('编辑')}</a>
|
||||
<div class="layui-divider layui-divider-vertical"></div>
|
||||
</if>
|
||||
@@ -343,7 +343,7 @@
|
||||
pageThat.attr("disabled",true);
|
||||
}
|
||||
else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
|
||||
}, 'json');
|
||||
@@ -373,8 +373,6 @@
|
||||
showCheckbox: true,
|
||||
})
|
||||
|
||||
// tree.setChecked('authTree', tableThis.data[event].length ? tableThis.data[event].map(Number): []);
|
||||
|
||||
// 监听权限提交
|
||||
form.on("submit(submitPage)", function (post) {
|
||||
|
||||
@@ -396,7 +394,7 @@
|
||||
layer.close(colletction.index);
|
||||
clickthis.attr("disabled", true);
|
||||
} else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
lay-filter="treeSearch" lay-submit><i class="layui-icon layui-icon-search"></i>{:__('搜索')}
|
||||
</button>
|
||||
<!-- // 打开添加页面 -->
|
||||
<button class="layui-btn icon-btn" lay-open="" data-title="{:__('添加菜单')}"
|
||||
callback="add" data-disable="true" data-area="680px,380px" data-url="#editforms" >
|
||||
<button class="layui-btn icon-btn" lay-open="" data-title="{:__('添加菜单')}" data-area="700px,410px" data-url="{:url('/system/AdminRules/add')}" >
|
||||
<i class="layui-icon layui-icon-add-1"></i>{:__('添加')}
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-primary icon-btn" id="expandAll" ><i class="layui-icon layui-icon-templeate-1"></i>{:__('展开全部')}</button>
|
||||
@@ -38,103 +37,33 @@
|
||||
<!-- // 创建数据表实例 -->
|
||||
<table class="layui-hide" id="lay-tableList" lay-filter="lay-tableList"></table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- // 添加编辑数据 -->
|
||||
<script type="text/html" id="editforms" >
|
||||
<div class="layui-fluid layui-bg-white">
|
||||
<form class="layui-form" lay-filter="editforms" >
|
||||
<input type="text" name="id" hidden="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{:__('上级菜单')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<div id="treeNode" name="pid" lay-filter="treeNode" ></div>
|
||||
</div>
|
||||
<label class="layui-form-label"><font color="red">* </font>{:__('权限标识')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="alias" placeholder="{:__('system:Target:index')}" type="text" disabled class="layui-input alias layui-disabled" lay-verify="required" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color: red; ">* </span>{:__('菜单名称')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="title" placeholder="{:__('请输入菜单名称')}" type="text" class="layui-input" lay-verify="required" />
|
||||
</div>
|
||||
<label class="layui-form-label">{:__('排序号')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="sort" placeholder="{:__('默认自动生成')}" type="number" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{:__('菜单图标')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="icon" placeholder="{:__('请选择菜单图标')}" id="iconPicker" type="text" class="layui-input" />
|
||||
</div>
|
||||
<label class="layui-form-label">{:__('菜单类型')}</label>
|
||||
<div class="layui-input-inline" style="white-space: nowrap;">
|
||||
<input name="type" type="radio" value="0" title="{:__('菜单')}" lay-tips="* 菜单默认就是路由地址!" />
|
||||
<input name="type" type="radio" value="1" title="{:__('按钮')}" lay-tips="* 按钮不会当作菜单显示!" checked />
|
||||
<input name="type" type="radio" value="2" title="{:__('接口')}" lay-tips="* 接口用户上传等API场景!"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color: red; ">* </span>{:__('路由地址')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="router" placeholder="{:__('/system/Target/index')}" type="text" class="layui-input router" lay-verify="required" />
|
||||
</div>
|
||||
<label class="layui-form-label"><span style="color: red; ">* </span>{:__('是否鉴权')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="auth" type="radio" value="1" title="{:__('开启')}" checked/>
|
||||
<input name="auth" type="radio" value="0" title="{:__('关闭')}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color: red; ">* </span>{:__('正则模式')}</label>
|
||||
<div class="layui-input-inline" style="width: 500px">
|
||||
<input name="condition" placeholder="{:__('请输入正则表达式,适合通配符校验')}" type="text" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-footer layui-form-item layui-center " >
|
||||
<button class="layui-btn layui-btn-primary" type="button" sa-event="closePageDialog" >{:__('取消')}</button>
|
||||
<button class="layui-btn" lay-add="{:url('/system/AdminRules/add')}" lay-edit="{:url('/system/AdminRules/edit')}" lay-filter="submitPage" lay-submit>{:__('提交')}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- // 列表工具栏 -->
|
||||
<script type="text/html" id="tableBar">
|
||||
<!-- 注意,添加的回调函数里面 增加了data-disable="true"属性,也就是不会执行form.val方法 -->
|
||||
<a class="layui-table-text" data-title="{:__('添加菜单')}" data-url="#editforms"
|
||||
data-area="668px,380px" callback="add" data-disable="true" lay-event="add" >{:__('添加')}</a>
|
||||
<a class="layui-table-text" lay-open data-title="{:__('添加菜单')}" data-url="{:url('/system/AdminRules/add')}?pid={{d.id}}"
|
||||
data-area="700px,410px" >{:__('添加')}</a>
|
||||
<div class="layui-divider layui-divider-vertical"></div>
|
||||
<a class="layui-table-text" data-title="{:__('编辑菜单')}" data-area="668px,380px" data-url="#editforms" lay-event="edit" callback="edit" >{:__('编辑')}</a>
|
||||
<a class="layui-table-text" lay-open data-title="{:__('编辑菜单')}" data-url="{:url('/system/AdminRules/edit')}?id={{d.id}}"
|
||||
data-area="700px,410px" >{:__('编辑')}</a>
|
||||
<div class="layui-divider layui-divider-vertical"></div>
|
||||
<a class="layui-table-text" data-url="{:url('/system/AdminRules/del')}?id={{d.id}}" lay-event="del" >{:__('删除')}</a>
|
||||
</script>
|
||||
<script src="__STATICADMIN__module/xmselect/xmselect.js?v={:release()}"></script>
|
||||
|
||||
<include file="/public/footer" />
|
||||
|
||||
<script>
|
||||
layui.use(['admin','form','treeTable','iconPicker'], function () {
|
||||
layui.use(['form','treeTable'], function () {
|
||||
|
||||
var jquery = layui.jquery;
|
||||
var admin = layui.admin;
|
||||
var form = layui.form;
|
||||
var table = layui.table;
|
||||
var treeTable = layui.treeTable;
|
||||
var iconPicker = layui.iconPicker;
|
||||
var tableURL = "{:url('/system/AdminRules/index')}";
|
||||
let $ = layui.jquery;
|
||||
let form = layui.form;
|
||||
let treeTable = layui.treeTable;
|
||||
let tableURL = "{:url('/system/AdminRules/index')}";
|
||||
|
||||
// 渲染初始化表格
|
||||
var renderTable = function (tableURL) {
|
||||
let renderTable = function (tableURL) {
|
||||
treeTable.render({
|
||||
id: 'lay-tableList',
|
||||
elem: '#lay-tableList',
|
||||
url: tableURL,
|
||||
tree: {
|
||||
@@ -156,13 +85,13 @@
|
||||
{field: 'router', title: '{:__("路由地址")}'},
|
||||
{field: 'alias', title: '{:__("权限标识")}'},
|
||||
{field: 'auth', width: 80,title: '{:__("鉴权")}',templet: function(d) {
|
||||
var strs = ['<font color="red">{:__("否")}</font>', '<span>{:__("是")}</span>'];
|
||||
let strs = ['<font color="red">{:__("否")}</font>', '<span>{:__("是")}</span>'];
|
||||
return strs[d.auth];
|
||||
}, align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'type',title: '{:__("类型")}', width: 80, templet: function (d) {
|
||||
var strs = ['<span class="layui-badge layui-bg-blue">{:__("菜单")}</span>',
|
||||
let strs = ['<span class="layui-badge layui-bg-blue">{:__("菜单")}</span>',
|
||||
'<span class="layui-badge layui-bg-gray">{:__("按钮")}</span>',
|
||||
'<span class="layui-badge layui-bg-cyan">{:__("接口")}</span>',
|
||||
'<span class="layui-badge">{:__("系统")}</span>'
|
||||
@@ -180,9 +109,9 @@
|
||||
// 监听搜索 serialize
|
||||
form.on('submit(treeSearch)',function(data) {
|
||||
|
||||
var whereURL = '',
|
||||
let whereURL = '',
|
||||
field = data.field;
|
||||
for (var key in field ) {
|
||||
for (let key in field ) {
|
||||
whereURL += key + '=' + field[key];
|
||||
whereURL += '&';
|
||||
}
|
||||
@@ -193,177 +122,19 @@
|
||||
renderTable(whereURL);
|
||||
})
|
||||
|
||||
/*
|
||||
* 编辑回调函数示例
|
||||
* 这个是默认编辑框的回调函数
|
||||
* 默认返回当前点击元素对象、数据合集、配置项
|
||||
*/
|
||||
admin.callback.edit = function(clickthis,colletction,config) {
|
||||
|
||||
// 渲染选择器
|
||||
draSelect(colletction.tableThis);
|
||||
|
||||
// 渲染图标
|
||||
draIcon();
|
||||
|
||||
// 监听改变
|
||||
inputchange();
|
||||
|
||||
// 监听提交
|
||||
listenPost(colletction);
|
||||
}
|
||||
|
||||
/*
|
||||
* 添加的回调函数
|
||||
*/
|
||||
admin.callback.add = function(clickthis,colletction,config) {
|
||||
|
||||
// 渲染选择器
|
||||
draSelect(colletction.tableThis);
|
||||
|
||||
// 渲染图标
|
||||
draIcon();
|
||||
|
||||
// 监听改变
|
||||
inputchange();
|
||||
|
||||
// 监听提交
|
||||
listenPost(colletction);
|
||||
}
|
||||
|
||||
// 渲染权限select元素
|
||||
var draSelect = function(tableThis, subadd) {
|
||||
|
||||
var checkedId = [];
|
||||
if (typeof(tableThis) !== "undefined") {
|
||||
|
||||
if (tableThis.event === 'add') {
|
||||
checkedId.push(tableThis.data.id);
|
||||
} else {
|
||||
// 这里需要自己判断pid是否等于0,否则会报错!
|
||||
if (tableThis.data.pid !== 0) {
|
||||
checkedId.push(tableThis.data.pid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var select = xmSelect.render({
|
||||
el: '#treeNode',
|
||||
tips: '请选择上级菜单',
|
||||
name: 'pid',
|
||||
height: 'auto',
|
||||
data: table.cache['lay-tableList'],
|
||||
radio: true,
|
||||
clickClose: true,
|
||||
initValue: checkedId,
|
||||
prop: {
|
||||
value: 'id',
|
||||
name:'title'
|
||||
},
|
||||
tree: {
|
||||
show: true,
|
||||
strict: false,
|
||||
showLine: false,
|
||||
clickExpand: false,
|
||||
},
|
||||
model: {
|
||||
icon: 'hidden',
|
||||
label: {
|
||||
type: 'text'
|
||||
}
|
||||
},
|
||||
theme: {
|
||||
color: '#1890FF'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 渲染图标元素
|
||||
var draIcon = function() {
|
||||
|
||||
iconPicker.render({
|
||||
elem: '#iconPicker',
|
||||
type: 'fontClass',
|
||||
search: true,
|
||||
cellWidth: "19%",
|
||||
page: true,
|
||||
limit: 12,
|
||||
click: function(data) { // 点击回调
|
||||
jquery('#iconPicker').val(data.icon);
|
||||
},
|
||||
success: function(d) { // 渲染成功后的回调
|
||||
//console.log(d);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 监听input表单
|
||||
var inputchange = function() {
|
||||
jquery('.router').bind('input propertychange change',function(data){
|
||||
let router = jquery('.router').val();
|
||||
let first = router.substr(0, 1);
|
||||
if (first !== '/') {
|
||||
jquery('.router').val('/');
|
||||
return layui.layer.error('路由必须以/符号开始');
|
||||
}
|
||||
router = router.substring(1);
|
||||
jquery('.alias').val(router.replaceAll('/',':'));
|
||||
})
|
||||
}
|
||||
|
||||
// 监听提交
|
||||
var listenPost = function(colletction) {
|
||||
|
||||
var tableThis = colletction.tableThis;
|
||||
form.on("submit(submitPage)",function(post){
|
||||
|
||||
var pageThat = jquery(this);
|
||||
pageThat.attr("disabled",true);
|
||||
// 获取提交地址
|
||||
var _pageUrl;
|
||||
if (typeof (tableThis) !== 'undefined') {
|
||||
_pageUrl = tableThis.event === 'edit' ? pageThat.attr('lay-edit') : pageThat.attr('lay-add');
|
||||
} else {
|
||||
_pageUrl = pageThat.attr('lay-add');
|
||||
}
|
||||
|
||||
if (typeof(_pageUrl) === 'undefined') {
|
||||
layer.msg('按钮缺少 url 属性','info');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 开始POST提交数据
|
||||
jquery.post(_pageUrl,
|
||||
post.field, function(res){
|
||||
if (res.code === 200) {
|
||||
layer.msg(res.msg);
|
||||
treeTable.reloadData('lay-tableList');
|
||||
// 调用接口更新菜单
|
||||
top.layui.admin.reloadLayout();
|
||||
|
||||
// 关闭当前窗口
|
||||
layer.close(colletction.index);
|
||||
}else {
|
||||
layer.error(res.msg);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
||||
// 展开所有
|
||||
jquery('#expandAll').click(function(){
|
||||
$('#expandAll').click(function(){
|
||||
treeTable.expandAll('lay-tableList', true);
|
||||
})
|
||||
|
||||
// 折叠所有
|
||||
jquery('#foldAll').click(function () {
|
||||
$('#foldAll').click(function () {
|
||||
treeTable.expandAll('lay-tableList',false);
|
||||
});
|
||||
|
||||
// 执行初始化
|
||||
renderTable(tableURL);
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
164
app/admin/view/system/admin/rules_edit.html
Normal file
164
app/admin/view/system/admin/rules_edit.html
Normal file
@@ -0,0 +1,164 @@
|
||||
<include file="/public/header"/>
|
||||
<div class="layui-fluid">
|
||||
<form class="layui-form layui-form-fixed">
|
||||
<input type="text" name="id" value="{$data.id|default=0}" hidden="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{:__('上级菜单')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<div id="treeNode" name="pid" lay-filter="treeNode" data-pid="{$data.pid|default=0}"></div>
|
||||
</div>
|
||||
<label class="layui-form-label">{:__('排序号')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="sort" placeholder="{:__('默认自动生成')}" type="number" value="{$data.sort}" class="layui-input"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color: red; ">* </span>{:__('菜单名称')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="title" placeholder="{:__('请输入菜单名称')}" type="text" class="layui-input"
|
||||
value="{$data.title}"
|
||||
lay-verify="required"/>
|
||||
</div>
|
||||
<label class="layui-form-label">{:__('菜单图标')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="icon" placeholder="{:__('请选择菜单图标')}" id="iconPicker" type="text"
|
||||
value="{$data.icon}"
|
||||
class="layui-input"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<label class="layui-form-label"><span style="color: red; ">* </span>{:__('路由地址')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="router" placeholder="{:__('/system/Target/index')}" type="text" class="layui-input router"
|
||||
value="{$data.router}"
|
||||
lay-verify="required"/>
|
||||
</div>
|
||||
<label class="layui-form-label"><font color="red">* </font>{:__('菜单类型')}</label>
|
||||
<div class="layui-input-inline" style="white-space: nowrap;">
|
||||
<input name="type" type="radio" value="0" title="{:__('菜单')}"
|
||||
<if condition="$data.type eq 0">checked</if>
|
||||
lay-tips="* 菜单默认就是路由地址!"/>
|
||||
<input name="type" type="radio" value="1" title="{:__('按钮')}"
|
||||
<if condition="$data.type eq 1">checked</if>
|
||||
lay-tips="* 按钮不会当作菜单显示!" >
|
||||
<input name="type" type="radio" value="2" title="{:__('接口')}"
|
||||
<if condition="$data.type eq 2">checked</if>
|
||||
lay-tips="* 接口用户上传等API场景!"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<label class="layui-form-label">{:__('权限标识')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="alias" placeholder="{:__('system:Target:index')}" type="text" disabled
|
||||
value="{$data.alias}"
|
||||
class="layui-input alias layui-disabled" lay-verify="required"/>
|
||||
</div>
|
||||
<label class="layui-form-label"><span style="color: red; ">* </span>{:__('是否鉴权')}</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="auth" type="radio" value="1" title="{:__('开启')}"
|
||||
<if condition="$data.auth eq 1">checked</if> />
|
||||
<input name="auth" type="radio" value="0" title="{:__('关闭')}"
|
||||
<if condition="$data.auth eq 0">checked</if> />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color: red; ">* </span>{:__('正则模式')}</label>
|
||||
<div class="layui-input-inline" style="width: 500px">
|
||||
<input name="condition" placeholder="{:__('请输入正则表达式,适合通配符校验')}" type="text"
|
||||
value="{$data.condition}"
|
||||
class="layui-input"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-footer layui-form-item layui-center ">
|
||||
<button class="layui-btn layui-btn-primary" type="button" sa-event="closePageDialog">{:__('取消')}</button>
|
||||
<button class="layui-btn" lay-filter="submit" lay-submit >{:__('提交')}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script src="__STATICADMIN__module/xmselect/xmselect.js?v={:release()}"></script>
|
||||
<include file="/public/footer"/>
|
||||
|
||||
<script>
|
||||
layui.use(['jquery', 'iconPicker','form'],function() {
|
||||
let $ = layui.jquery;
|
||||
let show = layui.show;
|
||||
let form = layui.form;
|
||||
let iconPicker = layui.iconPicker;
|
||||
let data = {$rules|raw};
|
||||
|
||||
// 提交参数
|
||||
form.on("submit(submit)",function(data){
|
||||
$.post("{:Url('/system/AdminRules/')}"+app_Config.action,data.field,function(res){
|
||||
if(res.code === 200){
|
||||
show.msg(res.msg);
|
||||
parent.layui.table.reloadData('lay-tableList');
|
||||
parent.layer.closeAll();
|
||||
// 调用接口更新菜单
|
||||
top.layui.admin.reloadLayout();
|
||||
}else{
|
||||
show.error(res.msg);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
|
||||
xmSelect.render({
|
||||
el: '#treeNode',
|
||||
tips: '请选择上级菜单',
|
||||
name: 'pid',
|
||||
height: '260px',
|
||||
data: data,
|
||||
radio: true,
|
||||
clickClose: true,
|
||||
initValue:[$('#treeNode').data('pid')],
|
||||
prop: {
|
||||
value: 'id',
|
||||
name:'title'
|
||||
},
|
||||
tree: {
|
||||
show: true,
|
||||
strict: false,
|
||||
showLine: false,
|
||||
clickExpand: false,
|
||||
},
|
||||
model: {
|
||||
icon: 'hidden',
|
||||
label: {
|
||||
type: 'text'
|
||||
}
|
||||
},
|
||||
theme: {
|
||||
color: '#1890FF'
|
||||
}
|
||||
})
|
||||
|
||||
iconPicker.render({
|
||||
elem: '#iconPicker',
|
||||
type: 'fontClass',
|
||||
search: true,
|
||||
cellWidth: "19%",
|
||||
page: true,
|
||||
limit: 12,
|
||||
// 点击回调
|
||||
click: function(data) { // 点击回调
|
||||
$('#iconPicker').val(data.icon);
|
||||
},
|
||||
success: function(d) { // 渲染成功后的回调
|
||||
}
|
||||
});
|
||||
|
||||
$('.router').bind('input change',function(data){
|
||||
let router = $('.router').val();
|
||||
router = router.substring(1);
|
||||
$('.alias').val(router.replaceAll('/',':'));
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@@ -197,7 +197,7 @@
|
||||
let layout = admin.getStorage('layout')
|
||||
if (layout === 'top' || layout === 'hybrid') {
|
||||
$(".moreLabel").prop("checked", true);
|
||||
layer.msg('当前菜单布局不支持该操作!','error');
|
||||
layer.msg('当前菜单布局不支持该操作!');
|
||||
form.render();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
if (res.code === 200) {
|
||||
layer.msg(res.msg);
|
||||
} else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -249,7 +249,7 @@
|
||||
layer.msg(res.msg);
|
||||
$('.layui-instant-list-item').removeClass('active_0').addClass('active_1');
|
||||
} else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -45,55 +45,3 @@
|
||||
</script>
|
||||
|
||||
<include file="/public/footer" />
|
||||
|
||||
<script>
|
||||
layui.use(['layer','fileManager','jquery'], function () {
|
||||
|
||||
let $ = layui.jquery;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 选择文件
|
||||
*/
|
||||
/*table.on('tool(lay-tableList)', function (obj) {
|
||||
|
||||
let field = $('#choose_filed').val() || undefined;
|
||||
let type = $('#choose_type').val() || undefined;
|
||||
if (!field) {
|
||||
return layer.info('图片信息不存在');
|
||||
}
|
||||
|
||||
|
||||
if (type === 'images') {
|
||||
let o = parent.layui.$('img.' + field);
|
||||
o.prop('src', obj.data.url);
|
||||
o.parent('div').removeClass('layui-hide');
|
||||
parent.layui.$(o).parents('.layui-upload-drag').find('p,i,hr').addClass('layui-hide');
|
||||
parent.layui.$('input.' + field).val(obj.data.url);
|
||||
} else if (type === 'multiple') {
|
||||
let boxList = parent.layui.$('[lay-choose="' + field + '"]').parents('.layui-imagesbox').find('.layui-input-inline');
|
||||
let length = boxList.length;
|
||||
|
||||
$(boxList).each(function (i, item) {
|
||||
$(item).find('input.layui-hide').prop('name', field + '[' + i + '][src]');
|
||||
$(item).find('input.layui-input').prop('name', field + '[' + i + '][title]');
|
||||
})
|
||||
|
||||
let html = '<div class="layui-input-inline layui-uplpad-image">';
|
||||
html += '<img src="' + obj.data.url + '" >';
|
||||
html += '<input type="text" name="' + field + '[' + (length - 1) + '][src]" class="layui-hide" value="' + obj.data.url + '">';
|
||||
html += '<input type="text" name="' + field + '[' + (length - 1) + '][title]" class="layui-input" placeholder="图片简介">';
|
||||
html += '<span class="layui-badge layui-badge-red" onclick="layui.$(this).parent().remove();">删除</span></div>';
|
||||
let elem = parent.layui.$('[lay-upload="' + field + '"]');
|
||||
parent.layui.$(elem).parent().before(html);
|
||||
parent.layui.$(elem).parents('form').find('input#' + field + '_clear').remove();
|
||||
} else {
|
||||
parent.layui.$('input.' + field).val(obj.data.url);
|
||||
}
|
||||
parent.layer.closeAll();
|
||||
});
|
||||
*/
|
||||
|
||||
})
|
||||
</script>
|
||||
@@ -228,7 +228,7 @@
|
||||
|
||||
|
||||
if (typeof(_pageUrl) === 'undefined') {
|
||||
layer.msg('按钮缺少 url 属性','info');
|
||||
layer.msg('按钮缺少 url 属性');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
layer.close(colletction.index);
|
||||
}
|
||||
else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
pageThat.attr("disabled",true);
|
||||
}
|
||||
else {
|
||||
layer.error(res.msg,'error');
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
|
||||
}, 'json');
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
<div class="layui-card-header layadmin-card-header-auto ">
|
||||
<blockquote class="layui-elem-quote pluginCenter"> 插件管理:
|
||||
<span style="margin-left: 12px">在线安装、卸载、禁用、启用、配置、升级插件,插件升级前请做好备份并确保服务器读写权限正确</span>
|
||||
<span class="fr"><i class="layui-icon fa-user" onclick="layui.plugin.clearLogin();"
|
||||
title="退出登录"></i></span>
|
||||
<span class="fr"><i class="layui-icon fa-sign-out" onclick="layui.plugin.clearLogin();" title="退出登录"></i></span>
|
||||
</blockquote>
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item">
|
||||
@@ -92,10 +91,11 @@
|
||||
<a class="layui-table-text uninstall" style="color:red"
|
||||
data-url="{:url('/system/plugin/uninstall')}?name={{d.name}}">{:__('卸载')}</a>
|
||||
{{# } else { }}
|
||||
<a class="layui-table-text install" data-url="{:url('/system/plugin/install')}?name={{d.name}}">{:__('安装')}</a>
|
||||
{{# if(d.demourl) { }}
|
||||
<a class="layui-table-text install" data-url="{:url('/system/plugin/install')}?name={{d.name}}">
|
||||
{:__('安装')} <i class="layui-icon layui-icon-down layui-hide"></i></a>
|
||||
{{# if(d.demo_url) { }}
|
||||
<div class="layui-divider layui-divider-vertical"></div>
|
||||
<a class="layui-table-text" target="_blank" href="{{d.demourl}}">{:__('演示')}</a>
|
||||
<a class="layui-table-text" target="_blank" href="{{d.demo_url}}">{:__('演示')}</a>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</script>
|
||||
@@ -104,11 +104,10 @@
|
||||
<script>
|
||||
layui.use(['admin', 'table', 'plugin', 'dropdown', 'jquery'], function () {
|
||||
|
||||
let plugin = layui.plugin;
|
||||
let $ = layui.jquery;
|
||||
let plugin = layui.plugin;
|
||||
let table = layui.table;
|
||||
let dropdown = layui.dropdown;
|
||||
window.framework = "{:config('app.version')}";
|
||||
window.plugins = {$plugin|raw};
|
||||
/*
|
||||
* 初始化表格
|
||||
@@ -136,7 +135,7 @@
|
||||
},
|
||||
{
|
||||
field: 'title', align: 'left', width: 200, templet: function (d) {
|
||||
let html = '<a target="_blank" href="' + d.readurl + '">' + d.title + '</a>';
|
||||
let html = '<a target="_blank" href="' + d.read_url + '">' + d.title + '</a>';
|
||||
if (d.album) {
|
||||
html += '<i class="layui-icon layui-icon-picture"></i>';
|
||||
}
|
||||
@@ -189,38 +188,59 @@
|
||||
, done: function (res, curr, count) {
|
||||
|
||||
let data = res.data;
|
||||
for (const dataKey in data) {
|
||||
let dropArray = [];
|
||||
let item = plugins[data[dataKey].name];
|
||||
if (typeof item == 'undefined') {
|
||||
for (const index in data) {
|
||||
let value = data[index];
|
||||
let item = plugins[value.name];
|
||||
let dropList = [];
|
||||
let versionList = value.versions;
|
||||
if (typeof item == 'undefined' && versionList.length) {
|
||||
if (versionList.length === 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let verInfo = data[dataKey].verInfo;
|
||||
for (const verInfoKey in verInfo) {
|
||||
let v1 = item.version.replaceAll('.', '');
|
||||
let v2 = verInfo[verInfoKey].version.replaceAll('.', '');
|
||||
if (v2 > v1) {
|
||||
dropArray.push({
|
||||
name: data[dataKey].name,
|
||||
title: verInfo[verInfoKey].version,
|
||||
v: verInfo[verInfoKey].version,
|
||||
pluginName: data[dataKey].title,
|
||||
for (const key in versionList) {
|
||||
dropList.push({
|
||||
name: value.name,
|
||||
title: versionList[key].version,
|
||||
version: versionList[key].version
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (dropArray.length >= 1) {
|
||||
let elem = $('tr[data-index="' + index + '"]').find('.install');
|
||||
$(elem).find('i').removeClass('layui-hide');
|
||||
dropdown.render({
|
||||
elem: $('tr[data-index="' + dataKey + '"]').find('.upgrade')
|
||||
elem: elem
|
||||
, trigger: 'hover'
|
||||
, align: 'center'
|
||||
, data: dropArray
|
||||
, data: dropList
|
||||
, className: 'install-version'
|
||||
, click: function (data) {
|
||||
plugin.upgrade(data);
|
||||
plugin.install(data.name, data.version);
|
||||
}
|
||||
, className: 'upgrade-version'
|
||||
});
|
||||
} else {
|
||||
for (const key in versionList) {
|
||||
let v1 = item.version.replaceAll('.', '');
|
||||
let v2 = versionList[key].version.replaceAll('.', '');
|
||||
if (v2 > v1) {
|
||||
dropList.push({
|
||||
name: value.name,
|
||||
pluginName: value.title,
|
||||
title: versionList[key].version,
|
||||
version: versionList[key].version
|
||||
});
|
||||
}
|
||||
}
|
||||
if (dropList.length) {
|
||||
dropdown.render({
|
||||
elem: $('tr[data-index="' + index + '"]').find('.upgrade')
|
||||
, trigger: 'hover'
|
||||
, align: 'center'
|
||||
, data: dropList
|
||||
, className: 'upgrade-version'
|
||||
, click: function (data) {
|
||||
plugin.upgrade(data); // 传递给升级按钮即可
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,20 +104,20 @@
|
||||
|
||||
<!-- // 列表工具栏 -->
|
||||
<script type="text/html" id="tableBar">
|
||||
<a class="layui-table-text" data-title="{:__('编辑会员')}" data-url="#editforms" lay-event="edit">{:__('编辑')}</a>
|
||||
<a class="layui-table-text" data-title="{:__('编辑会员')}" lay-auth data-url="#editforms" lay-event="edit">{:__('编辑')}</a>
|
||||
<div class="layui-divider layui-divider-vertical"></div>
|
||||
<a class="layui-table-text" data-url="{:url('/system/User/del')}?id={{d.id}}" lay-event="del">{:__('删除')}</a>
|
||||
</script>
|
||||
|
||||
<include file="/public/footer" />
|
||||
<script>
|
||||
layui.use(['table'], function () {
|
||||
layui.use(['table', 'show', 'notice'], function () {
|
||||
|
||||
var table = layui.table;
|
||||
let table = layui.table;
|
||||
/*
|
||||
* 初始化表格
|
||||
*/
|
||||
var isTable = table.render({
|
||||
let isTable = table.render({
|
||||
elem: "#lay-tableList"
|
||||
,url: "{:url('/system/User/index')}"
|
||||
,page: true
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
layer.msg(res.msg);
|
||||
admin.event.closeDialog();
|
||||
}else {
|
||||
layer.error(res.msg);
|
||||
layui.show.error(res.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</div>
|
||||
|
||||
<div class="vip-name">
|
||||
<span>{$user.nickname} <i class="layui-icon fa-edit" lay-open data-title="修改昵称" data-url="#nickname" data-area="398px,230px"></i></span>
|
||||
<span>{$user.nickname} <i class="layui-icon layui-icon-survey" lay-open data-title="修改昵称" data-url="#nickname" data-area="398px,230px"></i></span>
|
||||
<span>UID: {$user.id|supplement_id}</span>
|
||||
<span><a>已加入第 {$user.create_time|distance_day} 天</a></span>
|
||||
</div>
|
||||
@@ -73,7 +73,7 @@
|
||||
<div class="layui-col-md3">
|
||||
<div class="contract-title">手机</div>
|
||||
<div class="contract-detail">+86 {$user.mobile|default='未绑定'}
|
||||
<i class="layui-icon fa-edit" title="编辑" lay-open data-title="修改手机"
|
||||
<i class="layui-icon layui-icon-survey" title="编辑" lay-open data-title="修改手机"
|
||||
data-url="/index/user/changeMobile" data-area="500px,300px"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,7 +86,7 @@
|
||||
<div class="layui-col-md3">
|
||||
<div class="contract-title">办公室邮箱</div>
|
||||
<div class="contract-detail">{$user.email|default='member@domain.com'}
|
||||
<i class="layui-icon fa-edit" title="编辑" lay-open data-title="修改邮箱"
|
||||
<i class="layui-icon layui-icon-survey" title="编辑" lay-open data-title="修改邮箱"
|
||||
data-url="/index/user/changeEmail" data-area="500px,300px"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -153,17 +153,17 @@
|
||||
<div class="layui-card-body layui-row layui-col-space10" style="max-height: 146px;overflow: auto">
|
||||
<div class="layui-col-md4">
|
||||
<div class="speed-entry-item" data-url="/index/user/profile">
|
||||
<i class="layui-icon fa-user"></i> 我的主页
|
||||
<i class="layui-icon layui-icon-home"></i> 我的主页
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="speed-entry-item" data-url="/index/user/message">
|
||||
<i class="layui-icon fa-comment"></i> 站内消息
|
||||
<i class="layui-icon layui-icon-notice"></i> 站内消息
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="speed-entry-item" data-url="/index/user/security">
|
||||
<i class="layui-icon fa-get-pocket"></i> 安全中心
|
||||
<i class="layui-icon layui-icon-auz"></i> 安全中心
|
||||
</div>
|
||||
</div>
|
||||
{:get_plugin_menu_entry('tabs')}
|
||||
@@ -191,7 +191,6 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">🏷️ 新闻公告</div>
|
||||
<ul id="newsList" class="news-list">
|
||||
{$newsHtml|raw}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
@@ -276,17 +275,14 @@
|
||||
|
||||
<script>
|
||||
layui.use(['jquery', 'upload','carousel'], function () {
|
||||
var $ = layui.jquery;
|
||||
var upload = layui.upload;
|
||||
var carousel = layui.carousel;
|
||||
let $ = layui.jquery;
|
||||
let upload = layui.upload;
|
||||
let carousel = layui.carousel;
|
||||
|
||||
// API请求热门插件
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: 'https://api.swiftadmin.net/plugin/recommend',
|
||||
data: {type: 'hot'},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
$.get( 'https://api.swiftadmin.net/ajax/recommend',{
|
||||
type: 'hot'
|
||||
}, function (res) {
|
||||
if (res.code === 200) {
|
||||
$('#appPluginList').html(res.data);
|
||||
}
|
||||
@@ -296,8 +292,17 @@
|
||||
,interval: 3000
|
||||
,anim: 'fade'
|
||||
});
|
||||
},
|
||||
error: function () {}
|
||||
})
|
||||
|
||||
// 请求新闻
|
||||
$.get('https://api.swiftadmin.net/ajax/article', function (res) {
|
||||
if (res.code === 200) {
|
||||
let html = '';
|
||||
$.each(res.data, function (i, item) {
|
||||
html += '<li><a href="' + item.read_url + '" target="_blank">📢 ' + item.title + '</a></li>';
|
||||
})
|
||||
$('#newsList').html(html);
|
||||
}
|
||||
})
|
||||
|
||||
$('.speed-entry-item').click(function (e) {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
margin-top: 23px;
|
||||
}
|
||||
|
||||
.fa-wechat, .fa-mobile-phone {
|
||||
.layui-icon-login-wechat, .layui-icon-cellphone {
|
||||
font-size: 4em;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
<div class="alert-warn">
|
||||
<span>
|
||||
<i class="layui-icon fa-info-circle"></i>
|
||||
<i class="layui-icon layui-icon-vercode"></i>
|
||||
根据《中华人民共和国网络安全法》等网络安全相关法律法规规定,及按网监,公安等有关监管单位要求,互联网计算资源用户须完成用户实名认证才能使用。
|
||||
请您认真填写相关实名认证信息,完成实名认证申请。
|
||||
</span>
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
<div class="layui-col-md4 choose-item " lay-open data-title="实名认证" data-url="#author" data-area="520px,390px">
|
||||
<div class="layui-col-md2">
|
||||
<div class="svg"><i class="layui-icon fa-mobile-phone"></i></div>
|
||||
<div class="svg"><i class="layui-icon layui-icon-cellphone"></i></div>
|
||||
</div>
|
||||
<div class="layui-col-md10">
|
||||
<span class="subtitle">手机号码 验证实名</span>
|
||||
@@ -106,9 +106,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-md4 choose-item" onclick="layui.layer.msg('暂未支持','info')">
|
||||
<div class="layui-col-md4 choose-item" onclick="layui.layer.msg('暂未支持')">
|
||||
<div class="layui-col-md2">
|
||||
<div class="svg"><i class="layui-icon fa-wechat"></i></div>
|
||||
<div class="svg"><i class="layui-icon layui-icon-login-wechat"></i></div>
|
||||
</div>
|
||||
<div class="layui-col-md10">
|
||||
<span class="subtitle">微信人脸 识别认证</span>
|
||||
|
||||
@@ -13,7 +13,11 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">原密码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="oldpwd" name="oldpwd" class="layui-input" >
|
||||
<empty name="$user['pwd']">
|
||||
<input type="text" id="oldpwd" name="oldpwd" class="layui-input layui-disabled" placeholder="您的原密码为空(可不填)" disabled>
|
||||
<else/>
|
||||
<input type="text" id="oldpwd" name="oldpwd" class="layui-input" placeholder="请输入原密码">
|
||||
</empty>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
@@ -66,7 +70,7 @@
|
||||
parent.location.reload();
|
||||
}
|
||||
else {
|
||||
top.layer.msg(res.msg,'error');
|
||||
top.layer.msg(res.msg,{icon:2});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
$('#uCode').click(function (e) {
|
||||
let name = $('#name').val();
|
||||
if (name === '') {
|
||||
layer.msg('请输入邮箱或手机号', 'info');
|
||||
layer.msg('请输入邮箱或手机号', {icon: 5});
|
||||
return false;
|
||||
}
|
||||
let regUrl = '/api/ajax/smsSend';
|
||||
@@ -74,9 +74,9 @@
|
||||
success: function (res) {
|
||||
|
||||
if (res.code === 200) {
|
||||
layer.msg(res.msg, 'success');
|
||||
layer.msg(res.msg);
|
||||
} else {
|
||||
layer.msg(res.msg, 'error');
|
||||
layer.msg(res.msg, {icon: 5});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<link rel="stylesheet" href="/static/js/layui/css/layui.css">
|
||||
<!-- // 加载font-awesome图标 -->
|
||||
<link href="/static/js/layui/css/font-awesome.css?v={:config('app.version')}" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" href="/static/css/center.css?v={:release()}">
|
||||
<script src="/static/js/layui/layui.js"></script>
|
||||
<script src="/static/js/center.js?v={:release()}"></script>
|
||||
|
||||
@@ -10,19 +10,22 @@
|
||||
<div class="layui-header">
|
||||
<div class="layui-logo layui-side-body layui-hide-xs layui-bg-black">
|
||||
<!--// 可以增加LOGO-->
|
||||
<img src="/static/system/images/logo.png" style="margin-bottom: 8px;margin-right: 10px" alt="logo" width="22" height="22" >
|
||||
<span class="logo-text">会员中心</span>
|
||||
<img src="/static/system/images/logo.png" style="margin-bottom: 8px;" alt="logo" width="22" height="22" >
|
||||
<span class="logo-text">用户后台管理</span>
|
||||
</div>
|
||||
<ul class="layui-nav layui-layout-left">
|
||||
<li id="shrink" class="layui-nav-item layui-show-xs-inline-block" >
|
||||
<i class="layui-icon layui-icon-shrink-right"></i>
|
||||
</li>
|
||||
<li id="refresh" class="layui-nav-item" >
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
|
||||
<li class="layui-nav-item" lay-unselect="">
|
||||
<a href="/" title="主页">
|
||||
<i class="layui-icon fa-home"></i>
|
||||
<i class="layui-icon layui-icon-home"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -30,9 +33,9 @@
|
||||
<a href="javascript:;" id="notice">
|
||||
<div id="unread" data-count="{$unread|default='0'}"></div>
|
||||
<empty name="$unread">
|
||||
<i class="layui-icon fa-bell-o"></i>
|
||||
<i class="layui-icon layui-icon-notice"></i>
|
||||
<else/>
|
||||
<i class="layui-icon fa-bell"></i>
|
||||
<i class="layui-icon layui-icon-notice"></i>
|
||||
<span class="layui-badge-dot"></span>
|
||||
</empty>
|
||||
</a>
|
||||
@@ -68,14 +71,6 @@
|
||||
let $ = layui.jquery;
|
||||
let upload = layui.upload;
|
||||
|
||||
// 默认展现首个菜单栏
|
||||
$('.layui-nav-tree .layui-nav-item').each(function (k,e) {
|
||||
if ($(e).find('dl.layui-nav-child').length) {
|
||||
$(e).addClass('layui-nav-itemed');
|
||||
return false;
|
||||
}
|
||||
})
|
||||
|
||||
// 点击切换页面地址
|
||||
$('body').on('click', '.layui-nav-tree a', function () {
|
||||
let href = $(this).attr('lay-href');
|
||||
@@ -85,25 +80,6 @@
|
||||
}
|
||||
})
|
||||
|
||||
// 上传头像
|
||||
upload.render({
|
||||
elem: '.layui-user-avatar'
|
||||
,url: '/index/user/avatars'
|
||||
,method: 'post'
|
||||
,accept: 'file'
|
||||
,before: function(res) {
|
||||
layer.msg('上传中');
|
||||
},done: function(res, index, upload) {
|
||||
// 上传成功
|
||||
if (res.code === 200) {
|
||||
layer.msg(res.msg);
|
||||
$('#imgHead img').attr('src',res.url);
|
||||
} else {
|
||||
layer.msg(res.msg,'error');
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
let leftAnimate = function (action = true) {
|
||||
if (action) {
|
||||
$('.layui-side').animate({width: '0px'});
|
||||
@@ -135,9 +111,11 @@
|
||||
let skin = layui.data('skin').theme || undefined;
|
||||
if (skin === 'layui-bg-white') {
|
||||
$('.layui-side-body').removeClass('layui-bg-black').addClass(skin);
|
||||
$('#skin').removeClass('fa-moon-o').addClass('fa-sun-o');
|
||||
}
|
||||
|
||||
$('#refresh').click(function (e) {
|
||||
$('#iframe').attr('src',$('#iframe').attr('src'));
|
||||
})
|
||||
bellMessage($('#unread').data('count'));
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<input type="password" id="pwd" name="pwd" lay-verify="required" data-title="密码"
|
||||
maxlength="32"
|
||||
placeholder="{:__('密码')}" class="inputStyle" value="">
|
||||
<span class="fr-icon visiblePwd"><i class="layui-icon fa-eye-slash"></i></span>
|
||||
<span class="fr-icon visiblePwd"><i class="layui-icon layui-icon-eye-invisible"></i></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -124,9 +124,9 @@
|
||||
<div class="fr">
|
||||
<a class="link" href="#" target="_top">
|
||||
<span>
|
||||
<i class="layui-icon fa-apple"></i>
|
||||
<i class="layui-icon fa-android"></i>
|
||||
<i class="layui-icon fa-windows"></i>
|
||||
<i class="layui-icon layui-icon-ios"></i>
|
||||
<i class="layui-icon layui-icon-android"></i>
|
||||
<i class="layui-icon layui-icon-windows"></i>
|
||||
<span class="tit">下载 APP</span>
|
||||
</span>
|
||||
</a>
|
||||
@@ -156,7 +156,7 @@
|
||||
let name = $(item).attr('name');
|
||||
let title = $(item).data('title');
|
||||
if (!value) {
|
||||
layer.msg(title + '不能为空', 'info');
|
||||
layer.msg(title + '不能为空', {icon: 5});
|
||||
$(item).focus();
|
||||
return false;
|
||||
}
|
||||
@@ -172,7 +172,9 @@
|
||||
window.location.href = '/index/user/index';
|
||||
}, 1000);
|
||||
} else {
|
||||
layer.msg(res.msg, 'error')
|
||||
layui.notice.error({
|
||||
message: res.msg
|
||||
});
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
@@ -183,10 +185,10 @@
|
||||
let type = $('#pwd').attr('type');
|
||||
if (type === 'password') {
|
||||
$('#pwd').attr('type', 'text');
|
||||
$(this).find('i.layui-icon').addClass('fa-eye').removeClass('fa-eye-slash');
|
||||
$(this).find('i.layui-icon').addClass('layui-icon-eye').removeClass('layui-icon-eye-invisible');
|
||||
} else {
|
||||
$('#pwd').attr('type', 'password');
|
||||
$(this).find('i.layui-icon').addClass('fa-eye-slash').removeClass('fa-eye');
|
||||
$(this).find('i.layui-icon').addClass('layui-icon-eye-invisible').removeClass('layui-icon-eye');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -203,7 +205,9 @@
|
||||
!queryTicket && queryRequest(res.data.ticket);
|
||||
$('#scanCover').attr('src', res.data.qrcode || '/static/images/qrcode.png');
|
||||
} else {
|
||||
layer.msg(res.msg, 'info');
|
||||
layui.notice.error({
|
||||
message: res.msg
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</style>
|
||||
<div id="content">
|
||||
<div class="layui-row" >
|
||||
<div id="cardInfo" class="layui-card"> <i class="layui-icon fa-bullhorn"></i> 短消息是本站系统给您发送的提醒消息,请务必阅读。如因自身未阅读导致出现的相关问题后果自负!</div>
|
||||
<div id="cardInfo" class="layui-card"> <i class="layui-icon layui-icon-speaker"></i> 短消息是本站系统给您发送的提醒消息,请务必阅读。如因自身未阅读导致出现的相关问题后果自负!</div>
|
||||
<div class="layui-card" style="padding-top: 10px">
|
||||
<!-- // 默认操作按钮 -->
|
||||
<div class="layui-card-header layadmin-card-header-auto ">
|
||||
@@ -53,11 +53,6 @@
|
||||
title += ' layui-table-text-red';
|
||||
}
|
||||
title += '" lay-open data-title="查看消息" data-url="/index/user/viewMessage?id=' + e.id + '" data-area="600px, 390px" >';
|
||||
if (e.status === 0) {
|
||||
title += '<i class="layui-icon fa-envelope"></i> ';
|
||||
} else {
|
||||
title += '<i class="layui-icon fa-envelope-o"></i> ';
|
||||
}
|
||||
title += e.title;
|
||||
title += '</a>';
|
||||
return title;
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
let unread = $('#unread').data('count');
|
||||
if (!unread) {
|
||||
top.layui.$('#notice').find('.layui-badge-dot').hide();
|
||||
top.layui.$('#notice').find('.fa-bell').removeClass('fa-bell').addClass('fa-bell-o');
|
||||
}
|
||||
|
||||
// 更新消息数量
|
||||
|
||||
@@ -1,29 +1,15 @@
|
||||
<layout name="layout:layout"/>
|
||||
<!-- 内容主体区域 -->
|
||||
<style>
|
||||
|
||||
.red {
|
||||
color: red;
|
||||
.red{color:red}
|
||||
.mt30{margin-top:30px}
|
||||
.layui-form{padding-top:10px}
|
||||
.layui-form-item{padding:8px 0}
|
||||
.layui-form-item:nth-child(odd){background-color:#f8f8f8}
|
||||
.layui-form-item .layui-input-inline{width:25% !important}
|
||||
@media screen and (min-width:1024px){.layui-input-inline{min-width:260px!important}
|
||||
.address{min-width:639px!important}
|
||||
}
|
||||
.mt30 {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.layui-form {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1024px) {
|
||||
|
||||
.layui-input-inline {
|
||||
min-width: 260px!important;
|
||||
}
|
||||
|
||||
.address {
|
||||
min-width: 639px!important;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="content">
|
||||
<div class="layui-row">
|
||||
@@ -130,7 +116,7 @@
|
||||
$('.avatar').attr('src', res.url + '?' + parseInt(100 * Math.random()));
|
||||
return layer.msg(res.msg);
|
||||
}
|
||||
layer.msg(res.msg, 'error');
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -147,7 +133,7 @@
|
||||
top.layer.msg(res.msg);
|
||||
}
|
||||
else {
|
||||
top.layer.msg(res.msg,'error');
|
||||
top.layer.msg(res.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div id="content" class="userLogin layui-fluid">
|
||||
|
||||
<div class="form-header">
|
||||
<i class="layui-icon fa-user-plus"></i>
|
||||
<i class="layui-icon layui-icon-username"></i>
|
||||
<h6>用户注册</h6>
|
||||
</div>
|
||||
<div class="formLogin active">
|
||||
@@ -32,13 +32,13 @@
|
||||
<div class="layui-form-item item-input">
|
||||
<input type="password" id="pwd" name="pwd" lay-verify="required" data-title="密码" maxlength="32"
|
||||
placeholder="{:__('请输入密码')}" class="inputStyle" value="">
|
||||
<span class="fr-icon visiblePwd"><i class="layui-icon fa-eye-slash"></i></span>
|
||||
<span class="fr-icon visiblePwd"><i class="layui-icon layui-icon-eye-invisible"></i></span>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item item-input">
|
||||
<input type="password" id="pwd2" lay-verify="required" data-title="密码" maxlength="32"
|
||||
placeholder="{:__('请输入确认密码')}" class="inputStyle" value="">
|
||||
<span class="fr-icon visiblePwd"><i class="layui-icon fa-eye-slash"></i></span>
|
||||
<span class="fr-icon visiblePwd"><i class="layui-icon layui-icon-eye-invisible"></i></span>
|
||||
</div>
|
||||
<eq name="style" value="mobile">
|
||||
<div class="layui-form-item item-input">
|
||||
@@ -84,9 +84,9 @@
|
||||
<div class="fr">
|
||||
<a class="link" href="#" target="_top">
|
||||
<span>
|
||||
<i class="layui-icon fa-apple"></i>
|
||||
<i class="layui-icon fa-android"></i>
|
||||
<i class="layui-icon fa-windows"></i>
|
||||
<i class="layui-icon layui-icon-ios"></i>
|
||||
<i class="layui-icon layui-icon-android"></i>
|
||||
<i class="layui-icon layui-icon-windows"></i>
|
||||
<span class="tit">下载 APP</span>
|
||||
</span>
|
||||
</a>
|
||||
@@ -114,13 +114,12 @@
|
||||
let type = $(elem).attr('type');
|
||||
if (type === 'password') {
|
||||
$(elem).attr('type','text');
|
||||
$(this).find('i.layui-icon').addClass('fa-eye').removeClass('fa-eye-slash');
|
||||
$(this).find('i.layui-icon').addClass('layui-icon-eye').removeClass('layui-icon-eye-invisible');
|
||||
} else {
|
||||
$(elem).attr('type','password');
|
||||
$(this).find('i.layui-icon').addClass('fa-eye-slash').removeClass('fa-eye');
|
||||
$(this).find('i.layui-icon').addClass('layui-icon-eye-invisible').removeClass('layui-icon-eye');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
@@ -54,7 +54,7 @@
|
||||
<div class="settings-tier">
|
||||
<div class="settings-detail fl">
|
||||
<span class="setting-status">
|
||||
<i class="layui-icon fa-check"></i>
|
||||
<i class="layui-icon layui-icon-ok-circle"></i>
|
||||
</span>
|
||||
<span class="setting-name">修改密码</span>
|
||||
<span class="setting-intro">安全性高的密码可以使账户更安全;互联网账号存在被盗风险,建议您定期更换密码</span>
|
||||
@@ -68,9 +68,9 @@
|
||||
<div class="settings-detail fl">
|
||||
<span class="setting-status">
|
||||
<empty name="$user['mobile']">
|
||||
<i class="layui-icon fa-warning"></i>
|
||||
<i class="layui-icon layui-icon-question"></i>
|
||||
<else/>
|
||||
<i class="layui-icon fa-check"></i>
|
||||
<i class="layui-icon layui-icon-ok-circle"></i>
|
||||
</empty>
|
||||
</span>
|
||||
<span class="setting-name">手机绑定</span>
|
||||
@@ -92,9 +92,9 @@
|
||||
<div class="settings-detail fl">
|
||||
<span class="setting-status">
|
||||
<empty name="$user['email']">
|
||||
<i class="layui-icon fa-warning"></i>
|
||||
<i class="layui-icon layui-icon-question"></i>
|
||||
<else/>
|
||||
<i class="layui-icon fa-check"></i>
|
||||
<i class="layui-icon layui-icon-ok-circle"></i>
|
||||
</empty>
|
||||
</span>
|
||||
<span class="setting-name">邮箱绑定 </span>
|
||||
@@ -116,9 +116,9 @@
|
||||
<div class="settings-detail fl">
|
||||
<span class="setting-status">
|
||||
<empty name="$user['answer']">
|
||||
<i class="layui-icon fa-warning"></i>
|
||||
<i class="layui-icon layui-icon-question"></i>
|
||||
<else/>
|
||||
<i class="layui-icon fa-check"></i>
|
||||
<i class="layui-icon layui-icon-ok-circle"></i>
|
||||
</empty>
|
||||
</span>
|
||||
<span class="setting-name">密保问题 </span>
|
||||
@@ -133,7 +133,7 @@
|
||||
<div class="settings-tier">
|
||||
<div class="settings-detail fl">
|
||||
<span class="setting-status">
|
||||
<i class="layui-icon fa-wechat"></i>
|
||||
<i class="layui-icon layui-icon-login-wechat"></i>
|
||||
</span>
|
||||
<span class="setting-name">微信绑定</span>
|
||||
<span class="setting-intro">暂未绑定。 绑定认证后可用于快捷登录、接收微信通知</span>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--// 初始化菜单-->
|
||||
<ul class="layui-nav layui-nav-tree" lay-filter="master">
|
||||
|
||||
<li class="layui-nav-item">
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a class="#" href="javascript:;">Dashboard</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd class="layui-this"><a lay-href="/index/user/center">控制台</a></dd>
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
location.href = res.url;
|
||||
}
|
||||
else {
|
||||
layer.msg(res.msg,'error');
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
location.href = res.url;
|
||||
}
|
||||
else {
|
||||
layer.msg(res.msg,'error');
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
},'json');
|
||||
return false;
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
jquery('.layui-complete').show();
|
||||
jquery.get('/install/index/clear',{},function(res){});
|
||||
} else {
|
||||
layer.msg(res.msg,'error');
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
@@ -108,16 +108,20 @@ b.msg {
|
||||
background: 0!important;
|
||||
}
|
||||
|
||||
.layui-layout-admin .layui-header {
|
||||
.layui-header {
|
||||
background-color: #fff!important;
|
||||
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 15%);
|
||||
}
|
||||
|
||||
.layui-layout-admin .layui-header .layui-nav-item a {
|
||||
.layui-header .layui-layout-left .layui-nav-item {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.layui-header .layui-nav-item a {
|
||||
color: #0C1021!important;
|
||||
}
|
||||
|
||||
.layui-layout-admin .layui-logo {
|
||||
.layui-header .layui-logo {
|
||||
box-shadow: 0 0px 2px 0 rgb(0 0 0 / 15%);
|
||||
}
|
||||
|
||||
@@ -126,7 +130,7 @@ b.msg {
|
||||
}
|
||||
|
||||
.logo-text {
|
||||
font-size: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.layui-btn-primary {
|
||||
@@ -340,7 +344,7 @@ a[lay-event="del"] {
|
||||
background: #3464FF !important;
|
||||
}
|
||||
|
||||
.layui-layout-admin .layui-layout-left a.flexible-btn {
|
||||
.layui-layout-left a.flexible-btn {
|
||||
float: left;
|
||||
margin: 18px 13px 0 0;
|
||||
color: rgba(255, 255, 255, .6);
|
||||
@@ -522,16 +526,16 @@ a[lay-event="del"] {
|
||||
}
|
||||
|
||||
#content .setting-status i.layui-icon {
|
||||
font-size: 30px;
|
||||
margin-left: 20px;
|
||||
font-size: 16px;
|
||||
margin-left: 10px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#content .setting-status i.fa-check {
|
||||
#content .setting-status i.layui-icon-ok-circle {
|
||||
color: #0b8235;
|
||||
}
|
||||
|
||||
#content .setting-status i.fa-warning {
|
||||
#content .setting-status i.layui-icon-question {
|
||||
color: #ffa200;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* CommonJS For Home - v1.0.0 - 2022-10-10
|
||||
* center For Home - v1.0.0 - 2022-10-10
|
||||
* https://github.com/meystack/swiftadmin
|
||||
* Copyright (c) meystack
|
||||
* Licensed Apache2.0
|
||||
@@ -27,7 +27,6 @@ layui.use(['jquery', 'form', 'upload', 'table', 'dropdown'], function () {
|
||||
}], ready: function (elemPanel, elem) {
|
||||
}
|
||||
, click: function (data, index) {
|
||||
console.log(data, index);
|
||||
let elem = $('.layui-nav-tree li [lay-href="/user/message"]');
|
||||
$(elem).parents('.layui-nav-item').addClass('layui-nav-itemed');
|
||||
$(elem).trigger('click');
|
||||
@@ -107,6 +106,9 @@ layui.use(['jquery', 'form', 'upload', 'table', 'dropdown'], function () {
|
||||
|
||||
// 开启节流
|
||||
that.attr("disabled", true);
|
||||
setTimeout(function () {
|
||||
that.attr("disabled", false);
|
||||
}, 2000);
|
||||
$.post(_url,
|
||||
data.field, function (res) {
|
||||
if (res.code === 200) {
|
||||
@@ -133,7 +135,7 @@ layui.use(['jquery', 'form', 'upload', 'table', 'dropdown'], function () {
|
||||
Home.event.closeDialog(that);
|
||||
}
|
||||
} else {
|
||||
top.layui.layer.msg(res.msg, 'error');
|
||||
top.layui.layer.msg(res.msg, {icon: 5});
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -144,9 +146,7 @@ layui.use(['jquery', 'form', 'upload', 'table', 'dropdown'], function () {
|
||||
if (typeof res.data.__token__ !== 'undefined') {
|
||||
$('input#__token__').val(res.data.__token__);
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
that.attr("disabled", false);
|
||||
} catch (e) {}
|
||||
}, 'json');
|
||||
|
||||
return false;
|
||||
@@ -232,7 +232,7 @@ layui.use(['jquery', 'form', 'upload', 'table', 'dropdown'], function () {
|
||||
uploadFiles[type](res, name);
|
||||
} else {
|
||||
// 错误消息
|
||||
layer.error(res.msg);
|
||||
layer.msg(res.msg, {icon: 5});
|
||||
}
|
||||
that.prop("disabled", false);
|
||||
}
|
||||
@@ -312,7 +312,7 @@ layui.use(['jquery', 'form', 'upload', 'table', 'dropdown'], function () {
|
||||
}
|
||||
layer.msg(res.msg);
|
||||
} else {
|
||||
layer.msg(res.msg, 'error');
|
||||
layer.msg(res.msg, {icon: 5});
|
||||
}
|
||||
that.attr('disabled', false);
|
||||
}, 'json');
|
||||
@@ -340,7 +340,7 @@ layui.use(['jquery', 'form', 'upload', 'table', 'dropdown'], function () {
|
||||
}
|
||||
|
||||
if (list.data.length === 0) {
|
||||
layer.msg('请勾选数据', 'error');
|
||||
layer.msg('请勾选数据');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ layui.use(['jquery', 'form', 'upload', 'table', 'dropdown'], function () {
|
||||
layer.msg(res.msg);
|
||||
table.reload(tableId);
|
||||
} else {
|
||||
layer.msg(res.msg, 'error');
|
||||
layer.msg(res.msg, {icon: 5});
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -468,11 +468,11 @@ layui.use(['jquery', 'form', 'upload', 'table', 'dropdown'], function () {
|
||||
}
|
||||
|
||||
} else {
|
||||
layer.msg(res.msg, 'error');
|
||||
layer.msg(res.msg, {icon: 5});
|
||||
}
|
||||
},
|
||||
error: function (res) {
|
||||
layer.msg('Access methods failure', 'error');
|
||||
layer.msg('Access methods failure', {icon: 5});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -33,11 +33,6 @@ p.layui-clear {
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.layui-imagesbox {
|
||||
width: 810px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.layui-imagesbox input {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -8,7 +8,7 @@
|
||||
// | Author: meystack <coolsec@foxmail.com> Apache 2.0 License Code
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'table', 'slider', 'upload', 'laydate', 'dropdown', 'colorpicker', 'cascader', 'content', 'tags'], function (exports) {
|
||||
layui.define(['jquery', 'i18n', 'element', 'show','layer', 'form', 'rate', 'table', 'slider', 'cascader', 'content','dropdown','upload'], function (exports) {
|
||||
|
||||
"use strict";
|
||||
let $ = layui.jquery;
|
||||
@@ -19,22 +19,25 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
let table = layui.table;
|
||||
let slider = layui.slider;
|
||||
let element = layui.element;
|
||||
let laydate = layui.laydate;
|
||||
let cascader = layui.cascader;
|
||||
let upload = layui.upload;
|
||||
let notice = layui.notice;
|
||||
let content = layui.content;
|
||||
let colorpicker = layui.colorpicker;
|
||||
let upload = layui.upload;
|
||||
let dropdown = layui.dropdown;
|
||||
|
||||
// 自定义消息通知
|
||||
let show = layui.show;
|
||||
window.top.show = show;
|
||||
|
||||
|
||||
// 系统常量
|
||||
let TABFILTER = 'swiftadmin-tabs', BODY = '.layui-body', LAYOUTBODY = ".layui-layout-body",
|
||||
LAYOUTADMIN = ".layui-layout-admin"
|
||||
, TABS = BODY + ">.layui-tab", FLEXIBLEID = "flexible", MENUFILTER = "lay-side-menu",
|
||||
LAYTOPMENU = "lay-top-menu", LAYSIDESHRINK = "layadmin-side-shrink"
|
||||
LAYSIDESHRINK = "layadmin-side-shrink"
|
||||
, LAYSIDESPREAD = "layadmin-side-spread-sm", ICONSHRINKRIGHT = "layui-icon-shrink-right",
|
||||
ICONSPREADLEFT = "layui-icon-spread-left", STR_EMPTY = ''
|
||||
, BODYSHADE = "<div class=\"layadmin-body-shade\" sa-event=\"shade\"><\/div>",
|
||||
BODYSHADECLASS = ".layadmin-body-shade", LAYERCONTENT = ".layui-layer-content";
|
||||
BODYSHADECLASS = ".layadmin-body-shade";
|
||||
|
||||
// 对象初始化
|
||||
let admin = {
|
||||
@@ -376,6 +379,17 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
app.removeClass(LAYSIDESPREAD)
|
||||
$(LAYOUTADMIN).removeClass(BODYSHADE);
|
||||
}
|
||||
},
|
||||
// 节流函数
|
||||
throttle: function(obj, time = 2000) {
|
||||
try {
|
||||
$(obj).attr('disabled', true);
|
||||
setTimeout(function () {
|
||||
$(obj).attr('disabled', false);
|
||||
}, time);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -407,7 +421,6 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
admin.event.flowOpen({
|
||||
id: "layer-msg",
|
||||
type: 2,
|
||||
// title: "🔔 消息提醒",
|
||||
area: ["336px", "390px"],
|
||||
content: n
|
||||
}, that)
|
||||
@@ -423,8 +436,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
content: n
|
||||
})
|
||||
},
|
||||
clear: function () {
|
||||
}
|
||||
clear: function () {}
|
||||
, logout: function (res) {
|
||||
var href = $(this).data("url");
|
||||
layui.layer.confirm("确定要退出登录吗?", {
|
||||
@@ -434,11 +446,8 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
})
|
||||
}
|
||||
, flowOpen: function (n, that) {
|
||||
|
||||
if (typeof that === "undefined") {
|
||||
notice.info({
|
||||
message: i18n.prop('未定义')
|
||||
})
|
||||
show.info(i18n.prop('未定义'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -462,7 +471,6 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
n.resize = n.resize !== undefined ? n.resize : false;
|
||||
n.shade = n.shade !== undefined ? n.shade : 0.1;
|
||||
var top = client.height,
|
||||
padding = (that.innerWidth() - that.width()) / 2, // 不用计算 padding
|
||||
left = client.left + (client.width / 2) - (elemWidth / 2);
|
||||
if (!n.offset) {
|
||||
n.offset = [top, left];
|
||||
@@ -562,9 +570,8 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
let TabLists = admin.getConfig("TabLists");
|
||||
for (const tabListsKey in TabLists) {
|
||||
let el = TabLists[tabListsKey];
|
||||
console.log(el)
|
||||
if (el.home && id === el.id) {
|
||||
layer.info(i18n.prop('请不要关闭主页'));
|
||||
show.info(i18n.prop('请不要关闭主页'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -609,7 +616,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
admin.event.closeDialog(this);
|
||||
}
|
||||
, ajax: function (url, data, async = false) {
|
||||
var result = [];
|
||||
let result = [];
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
@@ -619,7 +626,6 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
result = res;
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
return typeof (result) !== "object" ? JSON.parse(result) : result;
|
||||
} catch (error) {
|
||||
@@ -630,7 +636,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
, open: function (clickObject, tableThis, mergeOptions) {
|
||||
|
||||
var options = {
|
||||
url: admin._validauthURL(clickObject),
|
||||
url: clickObject.data('url') || undefined,
|
||||
type: clickObject.data('type') || 2,
|
||||
area: clickObject.data('area') || "auto",
|
||||
title: clickObject.data('title') || false,
|
||||
@@ -724,11 +730,10 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
}
|
||||
|
||||
if (typeof postUrl == 'undefined') {
|
||||
postUrl = _global_.app + '/' + _global_.controller + '/' + action;
|
||||
postUrl = app_Config.app + '/' + app_Config.controller + '/' + action;
|
||||
}
|
||||
|
||||
othat.attr("disabled", true);
|
||||
|
||||
admin.throttle(othat, 2000);
|
||||
$.ajax({
|
||||
url: postUrl,
|
||||
type: 'post',
|
||||
@@ -766,20 +771,16 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
* 如果使用第三方组件在table显示或元素为DIY数据结构
|
||||
* 则在这里可能会出现错误,这里不做处理,如果有需求可自行在页面实现数据回显到table行的逻辑
|
||||
*/
|
||||
layer.info(error);
|
||||
show.info(error);
|
||||
}
|
||||
layer.msg(res.msg);
|
||||
show.msg(res.msg);
|
||||
admin.event.closeDialog(othat);
|
||||
} else {
|
||||
layer.error(res.msg)
|
||||
show.error(res.msg)
|
||||
}
|
||||
|
||||
othat.attr("disabled", false);
|
||||
},
|
||||
error: function (res) {
|
||||
notice.error({
|
||||
message: i18n.prop('访问方法失败')
|
||||
})
|
||||
show.error(i18n.prop('访问方法失败'));
|
||||
return false;
|
||||
}
|
||||
})
|
||||
@@ -793,7 +794,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
, request: function (clickObject, reqData, callback, merge) {
|
||||
|
||||
let options = {
|
||||
url: admin._validauthURL(clickObject),
|
||||
url: clickObject.data('url'),
|
||||
type: clickObject.data('type') || 'post',
|
||||
dataType: clickObject.data('dataType') || 'json',
|
||||
timeout: clickObject.data('timeout') || '6000',
|
||||
@@ -805,6 +806,11 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
async: clickObject.data('async') || true // 默认异步调用
|
||||
}
|
||||
|
||||
if (!options.url) {
|
||||
show.info(i18n.prop('请求地址不能为空!'));
|
||||
return false;
|
||||
}
|
||||
|
||||
let reqSend = function (options) {
|
||||
if (typeof merge !== 'undefined') {
|
||||
options = $.extend({}, options, merge);
|
||||
@@ -863,20 +869,18 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
admin.event.closeDialog(clickObject);
|
||||
}
|
||||
|
||||
top.layer.msg(res.msg);
|
||||
top.show.msg(res.msg);
|
||||
} else {
|
||||
if (typeof callback !== 'undefined'
|
||||
&& typeof callback.error === 'function') {
|
||||
return callback.error(res);
|
||||
}
|
||||
|
||||
top.layer.error(res.msg);
|
||||
top.show.error(res.msg);
|
||||
}
|
||||
},
|
||||
error: function (res) {
|
||||
notice.error({
|
||||
message: i18n.prop('访问方法失败')
|
||||
})
|
||||
show.error(i18n.prop('访问方法失败'));
|
||||
return false;
|
||||
}
|
||||
})
|
||||
@@ -918,53 +922,41 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
if (typeof eval(funcObj) === "function") {
|
||||
return eval(funcObj)(clickThis, collection);
|
||||
} else {
|
||||
notice.error({
|
||||
message: i18n.prop('回调函数错误')
|
||||
})
|
||||
show.error(i18n.prop('回调函数错误'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 鉴权函数
|
||||
* @param {*} othis
|
||||
*
|
||||
* @param that
|
||||
* @returns {boolean}
|
||||
*/
|
||||
admin._validauthURL = function (othis) {
|
||||
admin.hasPermission = function (that) {
|
||||
|
||||
var curl = $(othis).attr('data-url');
|
||||
if (typeof curl == 'undefined') {
|
||||
notice.info({
|
||||
message: i18n.prop('URL未定义')
|
||||
})
|
||||
let url = $(that).data('url');
|
||||
if (typeof url == 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (curl.indexOf(_global_.app) !== -1) {
|
||||
var route = curl.replace('.html', '');
|
||||
route = route.substring(1);
|
||||
var main = route.substring(0, route.indexOf('/'));
|
||||
if (route.indexOf('.php') !== -1) {
|
||||
main = route.replace(main, '').substring(1);
|
||||
main = main.substring(0, main.indexOf('/'));
|
||||
let router = admin.getConfig('router');
|
||||
if (typeof router == 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 查找方法
|
||||
var action = route.substring(route.indexOf(main) + main.length + 1);
|
||||
if (action.indexOf('/') !== -1) {
|
||||
action = action.substring(0, action.indexOf('/'))
|
||||
} else if (action.indexOf('?') !== -1) {
|
||||
action = action.substring(0, action.indexOf('?'))
|
||||
// noinspection JSUnresolvedVariable
|
||||
if (url.substr(0, 1) === '#' || router.supersAdmin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
route = main + ':' + action;
|
||||
url = url.split('?')[0];
|
||||
let status, recursive = function (elem) {
|
||||
for (let i in elem) {
|
||||
var n = elem[i];
|
||||
|
||||
if (route === n.alias) {
|
||||
let n = elem[i];
|
||||
if (url.toLowerCase() === n.router.toLowerCase()) {
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (typeof n.children !== undefined) {
|
||||
recursive(n.children);
|
||||
}
|
||||
@@ -972,25 +964,26 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
|
||||
return status ? status : false;
|
||||
}
|
||||
// noinspection JSUnresolvedVariable
|
||||
return recursive(router.authorities);
|
||||
}
|
||||
|
||||
let router = admin.getConfig('router');
|
||||
try {
|
||||
if (typeof router.supersAdmin !== undefined) {
|
||||
if (router.supersAdmin === false
|
||||
&& curl.indexOf('://') === -1 && !recursive(router.authorities)) {
|
||||
notice.error({
|
||||
message: i18n.prop('无权操作')
|
||||
/**
|
||||
* lay-auth校验权限
|
||||
*/
|
||||
$(document).ready(function () {
|
||||
$('*[lay-auth]').each(function (key, item) {
|
||||
if (!admin.hasPermission(item)) {
|
||||
let $this = $(this);
|
||||
let type = $this.attr('lay-auth') || 'hide';
|
||||
let next = $this.next();
|
||||
if (next.hasClass('layui-divider')) {
|
||||
type === 'hide' ? next.hide() : next.remove();
|
||||
}
|
||||
type === 'hide' ? $this.hide() : $this.remove();
|
||||
}
|
||||
})
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return curl;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 全局渲染组件
|
||||
@@ -1010,7 +1003,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
max = $(obj).data('maxvalue') || '2222-12-31',
|
||||
min = $(obj).data('minvalue') || '1930-01-01';
|
||||
|
||||
laydate.render({
|
||||
layui.laydate.render({
|
||||
elem: this
|
||||
, type: t
|
||||
, range: r
|
||||
@@ -1131,7 +1124,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
picker.each(function (index, elem) {
|
||||
var name = $(elem).attr("lay-colorpicker");
|
||||
var color = $('.' + name).val() || $(name).data('value');
|
||||
colorpicker.render({
|
||||
layui.colorpicker.render({
|
||||
elem: this
|
||||
, color: color
|
||||
, predefine: true
|
||||
@@ -1148,14 +1141,15 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
|
||||
var that = $(this),
|
||||
name = $(elem).attr('lay-upload') || undefined,
|
||||
url = $(elem).data('url') || _global_.app + '/Ajax/upload',
|
||||
url = $(elem).data('url') || app_Config.app + '/Ajax/upload',
|
||||
type = $(elem).data('type') || 'normal',
|
||||
size = $(elem).data('size') || 102400,
|
||||
accept = $(elem).data('accept') || 'images',
|
||||
accept = $(elem).data('accept') || 'images/file/video/audio',
|
||||
chunk = $(elem).data('chunk') || false,
|
||||
multiple = $(elem).data('multiple') || false,
|
||||
chunkSize = typeof _upload_chunkSize != 'undefined' ? _upload_chunkSize : '2097152',
|
||||
chunkSize = typeof upload_chunkSize != 'undefined' ? upload_chunkSize : '2097152',
|
||||
callback = $(elem).attr('callback') || undefined,
|
||||
postChunkId = undefined,
|
||||
blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
|
||||
|
||||
let uploadFiles = {
|
||||
@@ -1187,13 +1181,13 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
}
|
||||
}
|
||||
|
||||
layui.upload.render({
|
||||
upload.render({
|
||||
elem: elem
|
||||
, url: url
|
||||
, method: 'post'
|
||||
, size: size
|
||||
, auto: false
|
||||
, accept: 'file'
|
||||
, accept: accept
|
||||
, multiple: multiple
|
||||
, choose: function (obj) {
|
||||
|
||||
@@ -1203,7 +1197,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
let file = files[index];
|
||||
if ((file.size / 1024) > size) {
|
||||
delete files[index];
|
||||
layer.error('文件大小超过限制,最大不超过' + size + 'KB');
|
||||
show.error('文件大小超过限制,最大不超过' + size + 'KB');
|
||||
return false;
|
||||
}
|
||||
// 使用data-chunk="close"关闭分片上传
|
||||
@@ -1224,6 +1218,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
index: index
|
||||
};
|
||||
|
||||
postChunkId = chunkId;
|
||||
var chunkList = layui.data(chunkId).chunkList;
|
||||
if (typeof chunkList == 'undefined') {
|
||||
chunkList = [];
|
||||
@@ -1257,7 +1252,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
|
||||
if (progress === 'undefined') {
|
||||
layui.data(chunkId, null);
|
||||
return layer.error('数据读取异常');
|
||||
return show.error('数据读取异常');
|
||||
}
|
||||
that.data = chunkList[progress].data;
|
||||
var start = progress * chunkSize;
|
||||
@@ -1278,7 +1273,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
|
||||
if (res.code !== 200) {
|
||||
layer.closeAll();
|
||||
return layer.error(res.msg);
|
||||
return show.error(res.msg);
|
||||
}
|
||||
|
||||
var index = res.index,
|
||||
@@ -1343,11 +1338,12 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
if (typeof callback != 'undefined') {
|
||||
return admin.callbackfunc(this.item, {res: res, index: indexObj, file: fileObj});
|
||||
} else if (res.code === 200) {
|
||||
layer.msg(res.msg);
|
||||
show.msg(res.msg);
|
||||
// 执行默认上传成功回调
|
||||
uploadFiles[type](res, name);
|
||||
} else {
|
||||
layer.error(res.msg);
|
||||
show.error(res.msg);
|
||||
layui.data(postChunkId, null);
|
||||
that.prop("disabled", false);
|
||||
}
|
||||
}
|
||||
@@ -1376,7 +1372,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
if (listData.code === 200) {
|
||||
option_data = listData.data;
|
||||
} else {
|
||||
layer.msg('字段 ' + name + ' 获取数据失败,网址返回错误信息 ' + listData.msg, {
|
||||
show.msg('字段 ' + name + ' 获取数据失败,网址返回错误信息 ' + listData.msg, {
|
||||
icon: 3,
|
||||
time: 5000
|
||||
})
|
||||
@@ -1560,7 +1556,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
, callback = {
|
||||
error: function (res) {
|
||||
$(obj.elem).prop('checked', !obj.elem.checked);
|
||||
layer.error(res.msg);
|
||||
show.error(res.msg);
|
||||
form.render('checkbox');
|
||||
}
|
||||
}
|
||||
@@ -1588,9 +1584,9 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
|
||||
if (_url === false || _url === '') {
|
||||
try {
|
||||
let app = _global_.app;
|
||||
let action = _global_.action;
|
||||
let controller = _global_.controller;
|
||||
let app = app_Config.app;
|
||||
let action = app_Config.action;
|
||||
let controller = app_Config.controller;
|
||||
_url = app + '/' + controller + '/' + action;
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
@@ -1598,19 +1594,16 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
}
|
||||
|
||||
if (typeof _url === 'undefined') {
|
||||
notice.error({
|
||||
message: i18n.prop('远程URL未定义')
|
||||
})
|
||||
show.error(i18n.prop('远程URL未定义'));
|
||||
return false;
|
||||
}
|
||||
|
||||
admin.throttle(that, 3000);
|
||||
let _parent = that.data('reload') || false;
|
||||
|
||||
that.attr("disabled", true);
|
||||
$.post(_url, data.field, function (res) {
|
||||
|
||||
if (res.code === 200) {
|
||||
top.layer.msg(res.msg);
|
||||
top.show.msg(res.msg);
|
||||
if (_close === undefined) {
|
||||
admin.event.closeDialog(that);
|
||||
}
|
||||
@@ -1622,7 +1615,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
}
|
||||
}
|
||||
} else {
|
||||
top.layer.error(res.msg);
|
||||
top.show.error(res.msg);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -1630,7 +1623,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
$('input#__token__').val(res.data.__token__);
|
||||
}
|
||||
} catch (e) {}
|
||||
that.attr("disabled", false);
|
||||
|
||||
}, 'json');
|
||||
return false;
|
||||
});
|
||||
@@ -1668,10 +1661,10 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
table.reloadData("lay-tableList");
|
||||
}
|
||||
|
||||
layer.msg(res.msg);
|
||||
show.msg(res.msg);
|
||||
},
|
||||
error: function (res) {
|
||||
layer.error(res.msg);
|
||||
show.error(res.msg);
|
||||
}
|
||||
}
|
||||
, othis = $(this)
|
||||
@@ -1807,9 +1800,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
, tips = '确定要批量操作';
|
||||
|
||||
if (tableId === null || tableId === undefined) {
|
||||
notice.error({
|
||||
message: i18n.prop('表格ID未定义')
|
||||
})
|
||||
show.error(i18n.prop('表格ID未定义'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1819,9 +1810,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
}
|
||||
|
||||
if (list.data.length === 0) {
|
||||
notice.info({
|
||||
message: i18n.prop('请勾选数据')
|
||||
})
|
||||
show.info(i18n.prop('请勾选数据'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1848,26 +1837,6 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
admin.event.open($(this), undefined, {});
|
||||
})
|
||||
|
||||
/**
|
||||
* 监听全局属性鉴权
|
||||
*/
|
||||
$(document).on('click', "*[lay-noauth]", function () {
|
||||
|
||||
var event = $(this).attr('lay-event');
|
||||
var router = admin.getConfig('router');
|
||||
try {
|
||||
if (typeof router.supersAdmin !== undefined) {
|
||||
if (router.supersAdmin === false && event === undefined) {
|
||||
notice.error({
|
||||
message: i18n.prop('无权操作')
|
||||
})
|
||||
throw '没有权限';
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* 监听ajax属性操作
|
||||
*/
|
||||
@@ -1914,7 +1883,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
type: 2,
|
||||
title: i18n.prop('文件选择'),
|
||||
area: ['62%', '65%'],
|
||||
content: _global_.app + '/system/Attachment/index?choose=true',
|
||||
content: app_Config.app + '/system/Attachment/index?choose=true',
|
||||
success: function (layero, index) {
|
||||
let body = layer.getChildFrame('body', index),
|
||||
html = '<input hidden id="_fileFiled" value="' + field + '" >';
|
||||
@@ -1926,7 +1895,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
})
|
||||
|
||||
// 清理系统缓存
|
||||
layui.dropdown.render({
|
||||
dropdown.render({
|
||||
elem: '#clearCache'
|
||||
, data: [{
|
||||
title: '一键清理缓存'
|
||||
@@ -2220,9 +2189,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
var options = this.options;
|
||||
|
||||
if (!res.url) {
|
||||
notice.error({
|
||||
message: i18n.prop('菜单的地址不能为空')
|
||||
})
|
||||
show.error(i18n.prop('菜单的地址不能为空'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2232,7 +2199,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
|
||||
if (options.moreLabel) {
|
||||
if ((options.TabLists.length + 1) >= options.maxTabNum) {
|
||||
layer.msg(i18n.prop('最大打开20个标签页'));
|
||||
show.msg(i18n.prop('最大打开20个标签页'));
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -2408,7 +2375,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
let that = $(this);
|
||||
let id = $(this).attr("lay-id");
|
||||
|
||||
layui.dropdown.render({
|
||||
dropdown.render({
|
||||
elem: that
|
||||
, trigger: 'contextmenu'
|
||||
, style: 'width: 110px;text-align:center;'
|
||||
@@ -2537,7 +2504,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form','notice', 'rate', 'ta
|
||||
})
|
||||
},
|
||||
};
|
||||
|
||||
// noinspection JSUnresolvedVariable
|
||||
BodyLayout[options.layout](router.authorities);
|
||||
var allowclose = '<div class="layui-tab" lay-allowClose="true" lay-filter="swiftadmin-tabs">';
|
||||
allowclose += ' <ul class="layui-tab-title"></ul>';
|
||||
|
||||
Reference in New Issue
Block a user