mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-05 19:41:44 +08:00
同步项目代码
This commit is contained in:
parent
eda0e35108
commit
57ff75994d
@ -3,8 +3,8 @@
|
||||
<div class="layui-card-body padding-left-40">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<span class="color-green font-w7 label-required-prev">数据类型</span>
|
||||
<span class="color-desc margin-left-5">Database Type</span>
|
||||
<b class="color-green label-required-prev">数据类型</b>
|
||||
<span class="color-desc margin-left-5">DataType</span>
|
||||
{if isset($vo.type)}
|
||||
<label><input readonly value="{$vo.type|default=''}" class="layui-input think-bg-gray"></label>
|
||||
{else}
|
||||
@ -37,8 +37,8 @@
|
||||
</div>
|
||||
|
||||
<label class="layui-form-item relative block">
|
||||
<span class="color-green font-w7">数据编码</span>
|
||||
<span class="color-desc margin-left-5">Database Code</span>
|
||||
<b class="color-green">数据编码</b>
|
||||
<span class="color-desc margin-left-5">DataCode</span>
|
||||
{if isset($vo.code)}
|
||||
<input readonly maxlength="50" class="layui-input think-bg-gray" name="code" value='{$vo.code|default=""}' required placeholder="请输入数据编码">
|
||||
{else}
|
||||
@ -48,15 +48,15 @@
|
||||
</label>
|
||||
|
||||
<label class="layui-form-item relative block">
|
||||
<span class="color-green font-w7">数据名称</span>
|
||||
<span class="color-desc margin-left-5">Database Name</span>
|
||||
<b class="color-green">数据名称</b>
|
||||
<span class="color-desc margin-left-5">DataName</span>
|
||||
<input maxlength="100" class="layui-input" name="name" value='{$vo.name|default=""}' required placeholder="请输入数据名称">
|
||||
<span class="help-block">请输入当前数据名称,请尽量保持名称的唯一性,数据名称尽量不要出现重复 ~</span>
|
||||
</label>
|
||||
|
||||
<label class="layui-form-item relative block">
|
||||
<span class="color-green font-w7">数据内容</span>
|
||||
<span class="color-desc margin-left-5">Database Content</span>
|
||||
<b class="color-green">数据内容</b>
|
||||
<span class="color-desc margin-left-5">DataContent</span>
|
||||
<textarea name="content" class="layui-textarea" placeholder="请输入数据内容">{$vo.content|default=''}</textarea>
|
||||
<!--<span class="help-block">访问权限名称需要保持不重复,在给用户授权时需要根据名称选择!</span>-->
|
||||
</label>
|
||||
|
@ -30,7 +30,7 @@
|
||||
<script>
|
||||
$(function () {
|
||||
// 初始化表格组件
|
||||
var $table = $('#BaseData').layTable({
|
||||
$('#BaseData').layTable({
|
||||
even: true, height: 'full',
|
||||
sort: {field: 'sort desc,id', type: 'asc'},
|
||||
where: {type: '{$type|default=""}'},
|
||||
@ -50,13 +50,12 @@
|
||||
layui.form.on('switch(StatusSwitch)', function (obj) {
|
||||
$.form.load("{:url('state')}", {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0}, 'post', function (ret) {
|
||||
if (ret.code < 1) $.msg.error(ret.info, 3, function () {
|
||||
$table.trigger('reload'); // 操作异常时重载数据
|
||||
$('#BaseData').trigger('reload'); // 操作异常时重载数据
|
||||
});
|
||||
return false;
|
||||
}, false);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<!-- 列表排序权重模板 -->
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{block name="button"}
|
||||
<!--{if auth("remove")}-->
|
||||
<button data-action='{:url("remove")}' data-rule="id#{id}" data-table-id="oplog" data-confirm="确定要删除选中的日志吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
|
||||
<button data-action='{:url("remove")}' data-rule="id#{id}" data-table-id="oplogData" data-confirm="确定要删除选中的日志吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
|
||||
<!--{/if}-->
|
||||
<!--{if auth("clear")}-->
|
||||
<button data-load='{:url("clear")}' data-confirm="确定要清空所有日志吗?" class='layui-btn layui-btn-sm layui-btn-primary'>清空日志</button>
|
||||
@ -12,14 +12,14 @@
|
||||
{block name="content"}
|
||||
<div class="think-box-shadow">
|
||||
{include file='oplog/index_search'}
|
||||
<table id="oplog" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
|
||||
<table id="oplogData" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name='script'}
|
||||
<script>
|
||||
$(function () {
|
||||
$('#oplog').layTable({
|
||||
$('#oplogData').layTable({
|
||||
even: true, height: 'full',
|
||||
sort: {field: 'id', type: 'desc'},
|
||||
cols: [[
|
||||
|
@ -82,7 +82,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'enter_time', title: '执行时间', minWidth: 175, templet: function (d) {
|
||||
field: 'loops_time', title: '执行时间', minWidth: 175, templet: function (d) {
|
||||
d.enter_time = d.enter_time || '', d.outer_time = d.outer_time || '0.0000';
|
||||
if (d.enter_time.length > 12) {
|
||||
return d.enter_time.substr(12) + '<span class="color-desc"> ( 耗时 ' + d.outer_time + ' )</span>';
|
||||
|
@ -7,11 +7,11 @@
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-xs2 text-center">
|
||||
<input type="hidden" name="headimg" value="{$vo.headimg|default=''}">
|
||||
<script>$('[name=headimg]').uploadOneImage()</script>
|
||||
<script>$('[name=headimg]').uploadOneImage();</script>
|
||||
</div>
|
||||
<div class="layui-col-xs5">
|
||||
<label class="block relative">
|
||||
<span class="color-green font-w7">登录账号</span>
|
||||
<b class="color-green">登录账号</b>
|
||||
<span class="color-desc margin-left-5">Login Username</span>
|
||||
{if isset($vo) and isset($vo.username)}
|
||||
<input disabled value='{$vo.username|default=""}' required class="layui-input think-bg-gray">
|
||||
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="layui-col-xs5">
|
||||
<label class="block relative">
|
||||
<span class="color-green font-w7">用户名称</span>
|
||||
<b class="color-green">用户名称</b>
|
||||
<span class="color-desc margin-left-5">User Nickname</span>
|
||||
<input name="nickname" value='{$vo.nickname|default=""}' required placeholder="请输入用户名称" class="layui-input">
|
||||
<span class="help-block">用于区分用户数据的用户名称,请尽量不要重复。</span>
|
||||
@ -38,26 +38,30 @@
|
||||
<legend><b class="layui-badge think-bg-violet">用户权限</b></legend>
|
||||
{if !empty($bases)}
|
||||
<div class="layui-form-item">
|
||||
<span class="color-green font-w7">角色身份</span>
|
||||
<b class="color-green">角色身份</b>
|
||||
<span class="color-desc margin-left-5">Role Identity</span>
|
||||
<select class="layui-select" lay-search name="usertype">
|
||||
<option value="">-- 选择 --</option>
|
||||
{foreach $bases as $base}{if isset($vo.usertype) and $vo.usertype eq $base.code}
|
||||
<option selected value="{$base.code}">{$base.name|default=''} ( {$base.code|default=''} )</option>
|
||||
{else}
|
||||
<option value="{$base.code}">{$base.name|default=''} ( {$base.code|default=''} )</option>
|
||||
{/if}{/foreach}
|
||||
</select>
|
||||
<div class="layui-textarea" style="min-height:auto">
|
||||
{foreach $bases as $base}
|
||||
<label class="think-checkbox">
|
||||
{if isset($vo.usertype) and $vo.usertype eq $base.code}
|
||||
<input type="radio" checked name="usertype" value="{$base.code}" lay-ignore>{$base.name}
|
||||
{else}
|
||||
<input type="radio" name="usertype" value="{$base.code}" lay-ignore>{$base.name}
|
||||
{/if}
|
||||
</label>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}{if !empty($authorizes)}
|
||||
{/if}
|
||||
{if !empty($authorizes)}
|
||||
<div class="layui-form-item">
|
||||
<span class="color-green font-w7">访问权限</span>
|
||||
<span class="color-desc margin-left-5">User Permission</span>
|
||||
<div class="layui-textarea" style="min-height:42px;line-height:28px">
|
||||
<b class="color-green">访问权限</b>
|
||||
<span class="color-desc margin-left-5">Role Permission</span>
|
||||
<div class="layui-textarea" style="min-height:auto">
|
||||
{if isset($vo.username) and $vo.username eq $superName}
|
||||
<span class="color-desc">超级用户拥所有访问权限,不需要配置权限。</span>
|
||||
{else}{foreach $authorizes as $authorize}
|
||||
<label class="think-checkbox layui-unselect margin-top-5">
|
||||
<label class="think-checkbox">
|
||||
{if in_array($authorize.id, $vo.authorize)}
|
||||
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore>{$authorize.title}
|
||||
{else}
|
||||
@ -76,28 +80,28 @@
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-xs4">
|
||||
<label class="relative block">
|
||||
<span class="color-green font-w7">联系邮箱</span><span class="color-desc margin-left-5">Contact Email</span>
|
||||
<b class="color-green">联系邮箱</b><span class="color-desc margin-left-5">Contact Email</span>
|
||||
<input name="contact_mail" pattern="^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$" value='{$vo.contact_mail|default=""}' placeholder="请输入联系电子邮箱" class="layui-input">
|
||||
<span class="color-desc">可选,请填写用户常用的电子邮箱</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="layui-col-xs4">
|
||||
<label class="relative block">
|
||||
<span class="color-green font-w7">联系手机</span><span class="color-desc margin-left-5">Contact Mobile</span>
|
||||
<b class="color-green">联系手机</b><span class="color-desc margin-left-5">Contact Mobile</span>
|
||||
<input type="tel" maxlength="11" name="contact_phone" value='{$vo.contact_phone|default=""}' pattern="^1[3-9][0-9]{9}$" placeholder="请输入用户联系手机" class="layui-input">
|
||||
<span class="color-desc">可选,请填写用户常用的联系手机号</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="layui-col-xs4">
|
||||
<label class="relative block">
|
||||
<span class="color-green font-w7">联系QQ</span><span class="color-desc margin-left-5">Contact QQ</span>
|
||||
<b class="color-green">联系QQ</b><span class="color-desc margin-left-5">Contact QQ</span>
|
||||
<input name="contact_qq" pattern="^\d{6,}$" value='{$vo.contact_qq|default=""}' placeholder="请输入常用的联系QQ" class="layui-input">
|
||||
<span class="color-desc">可选,请填写用户常用的联系QQ号</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<label class="layui-form-item block relative margin-top-10">
|
||||
<span class="color-green font-w7">用户描述</span><span class="color-desc margin-left-5">User Remark</span>
|
||||
<b class="color-green">用户描述</b><span class="color-desc margin-left-5">User Remark</span>
|
||||
<textarea placeholder="请输入用户描述" class="layui-textarea" name="describe">{$vo.describe|default=""}</textarea>
|
||||
</label>
|
||||
</fieldset>
|
||||
@ -113,6 +117,8 @@
|
||||
</form>
|
||||
|
||||
<script>
|
||||
layui.form.render();
|
||||
$('#UserForm').parent().css('overflow', 'revert');
|
||||
$(function () {
|
||||
layui.form.render();
|
||||
$('#UserForm').parent().css('overflow', 'revert');
|
||||
});
|
||||
</script>
|
@ -34,7 +34,7 @@
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
var $table = $('#UserData').layTable({
|
||||
$('#UserData').layTable({
|
||||
even: true, height: 'full',
|
||||
sort: {field: 'sort desc,id', type: 'desc'},
|
||||
where: {type: '{$type|default="index"}'},
|
||||
@ -63,7 +63,7 @@
|
||||
layui.form.on('switch(StatusSwitch)', function (obj) {
|
||||
$.form.load("{:url('state')}", {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0}, 'post', function (ret) {
|
||||
if (ret.code < 1) $.msg.error(ret.info, 3, function () {
|
||||
$table.trigger('reload'); // 操作异常时重载数据
|
||||
$('#UserData').trigger('reload'); // 操作异常时重载数据
|
||||
});
|
||||
return false;
|
||||
}, false);
|
||||
|
@ -13,10 +13,12 @@
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
/*! 数组兼容处理 */
|
||||
if (typeof Array.prototype.forEach !== 'function') {
|
||||
Array.prototype.forEach = function (callable, context) {
|
||||
typeof context === "undefined" ? context = window : null;
|
||||
for (var i in this) callable.call(context, this[i], i, this)
|
||||
if (typeof Array.prototype.some !== 'function') {
|
||||
Array.prototype.some = function (callable) {
|
||||
for (var i in this) if (callable(this[i], i, this) === true) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
if (typeof Array.prototype.every !== 'function') {
|
||||
@ -27,12 +29,10 @@ if (typeof Array.prototype.every !== 'function') {
|
||||
return true;
|
||||
};
|
||||
}
|
||||
if (typeof Array.prototype.some !== 'function') {
|
||||
Array.prototype.some = function (callable) {
|
||||
for (var i in this) if (callable(this[i], i, this) === true) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (typeof Array.prototype.forEach !== 'function') {
|
||||
Array.prototype.forEach = function (callable, context) {
|
||||
typeof context === "undefined" ? context = window : null;
|
||||
for (var i in this) callable.call(context, this[i], i, this)
|
||||
};
|
||||
}
|
||||
|
||||
@ -243,14 +243,6 @@ $(function () {
|
||||
that.reInit($(that.selecter));
|
||||
}, 500);
|
||||
};
|
||||
/*! 以 HASH 打开新网页 */
|
||||
this.href = function (url, ele) {
|
||||
if (url !== '#') {
|
||||
location.href = '#' + $.menu.parseUri(url, ele);
|
||||
} else if (ele && ele.dataset.menuNode) {
|
||||
$('[data-menu-node^="' + ele.dataset.menuNode + '-"]:first').trigger('click');
|
||||
}
|
||||
};
|
||||
/*! 异步加载的数据 */
|
||||
this.load = function (url, data, method, callable, loading, tips, time, headers) {
|
||||
// 如果主页面 loader 显示中,绝对不显示 loading 图标
|
||||
@ -287,6 +279,13 @@ $(function () {
|
||||
}
|
||||
});
|
||||
};
|
||||
/*! 以 HASH 打开新网页 */
|
||||
this.href = function (url, ele) {
|
||||
// 重置表格页数缓存
|
||||
if (ele && ele.dataset.menuNode) layui.sessionData('pages', null);
|
||||
if (url !== '#') location.hash = $.menu.parseUri(url, ele);
|
||||
else if (ele && ele.dataset.menuNode) $('[data-menu-node^="' + ele.dataset.menuNode + '-"]:first').trigger('click');
|
||||
};
|
||||
/*! 加载 HTML 到目标位置 */
|
||||
this.open = function (url, data, call, load, tips) {
|
||||
this.load(url, data, 'get', function (ret) {
|
||||
@ -393,7 +392,7 @@ $(function () {
|
||||
if (hash.length < 1) return $('[data-menu-node]:first').trigger('click');
|
||||
$.form.load(hash), that.syncOpenStatus(2);
|
||||
/*! 菜单选择切换 */
|
||||
node = that.queryNode(that.getUri());
|
||||
node = node || that.queryNode(that.getUri());
|
||||
if (/^m-/.test(node)) {
|
||||
var $all = $('a[data-menu-node]').parent(), tmp = node.split('-'), tmpNode = tmp.shift();
|
||||
while (tmp.length > 0) {
|
||||
@ -499,19 +498,21 @@ $(function () {
|
||||
that.checkInput(this);
|
||||
}).attr('novalidate', 'novalidate').attr('submit-listen', 'validate.submit');
|
||||
/*! 绑定提交事件 */
|
||||
that.form.data('validate', this).bind("submit", function (event) {
|
||||
that.form.data('validate', this).bind("submit", function (evt) {
|
||||
evt.button = that.form.find('button[type=submit],button:not([type=button])');
|
||||
/* 检查所有表单元素是否通过H5的规则验证 */
|
||||
if (that.checkAllInput() && typeof callable === 'function') {
|
||||
if (typeof CKEDITOR === 'object' && typeof CKEDITOR.instances === 'object') {
|
||||
for (var i in CKEDITOR.instances) CKEDITOR.instances[i].updateElement();
|
||||
}
|
||||
/* 触发表单提交后,锁定三秒不能再次提交表单 */
|
||||
if (that.form.attr('submit-locked')) return false; else that.form.attr('submit-locked', 1);
|
||||
if (that.form.attr('submit-locked')) return false;
|
||||
that.form.attr('submit-locked', 1), evt.button.addClass('submit-button-loading');
|
||||
callable.call(this, that.form.formToJson()), setTimeout(function () {
|
||||
that.form.removeAttr('submit-locked');
|
||||
}, 3000)
|
||||
that.form.removeAttr('submit-locked'), evt.button.removeClass('submit-button-loading');
|
||||
}, 3000);
|
||||
}
|
||||
return event.preventDefault(), false;
|
||||
return evt.preventDefault(), false;
|
||||
}).find('[data-form-loaded]').map(function () {
|
||||
$(this).html(this.dataset.formLoaded || this.innerHTML);
|
||||
$(this).removeAttr('data-form-loaded').removeClass('layui-disabled');
|
||||
@ -566,7 +567,7 @@ $(function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
/*! 全局文件上传入口 */
|
||||
/*! 全局文件上传 */
|
||||
$.fn.uploadFile = function (callable) {
|
||||
return this.each(function () {
|
||||
if ($(this).data('inited')) return false;
|
||||
@ -603,11 +604,11 @@ $(function () {
|
||||
|
||||
function showImageContainer(srcs) {
|
||||
$(srcs).each(function (idx, src, $image) {
|
||||
$image = $('<div class="uploadimage uploadimagemtl transition"><a class="layui-icon"></a><a class="layui-icon">ဆ</a><a class="layui-icon"></a></div>');
|
||||
$image = $('<div class="uploadimage uploadimagemtl transition"><div><a class="layui-icon"></a><a class="layui-icon">ဆ</a><a class="layui-icon"></a></div></div>');
|
||||
$image.attr('data-tips-image', encodeURI(src)).css('backgroundImage', 'url(' + encodeURI(src) + ')').on('click', 'a', function (event, index, prevs, $item) {
|
||||
event.stopPropagation(), $item = $(this).parent(), index = $(this).index(), prevs = $bt.prevAll('div.uploadimage').length;
|
||||
if (index === 0 && $item.index() !== prevs) $item.next().after($item);
|
||||
else if (index === 2 && $item.index() > 1) $item.prev().before($item);
|
||||
event.stopPropagation(), $item = $(this).parent().parent(), index = $(this).index(), prevs = $bt.prevAll('div.uploadimage').length;
|
||||
if (index === 2 && $item.index() !== prevs) $item.next().after($item);
|
||||
else if (index === 0 && $item.index() > 1) $item.prev().before($item);
|
||||
else if (index === 1) $item.remove();
|
||||
imgs = [], $bt.prevAll('.uploadimage').map(function () {
|
||||
imgs.push($(this).attr('data-tips-image'));
|
||||
@ -673,18 +674,20 @@ $(function () {
|
||||
// 插件初始化参数
|
||||
var opt = params || {}, data = opt.where || {}, sort = opt.initSort || opt.sort || {};
|
||||
opt.id = elem.id, opt.elem = elem, opt.url = params.url || elem.dataset.url || location.href;
|
||||
opt.page = params.page !== false ? (params.page || true) : false, opt.autoSort = params.autoSort === true;
|
||||
opt.loading = params.loading === true, opt.limit = params.limit || 20, opt.cols = params.cols || [[]];
|
||||
opt.page = params.page !== false ? (params.page || true) : false, opt.limit = params.limit || 20;
|
||||
opt.loading = params.loading === true, opt.autoSort = params.autoSort === true, opt.cols = params.cols || [[]];
|
||||
// 默认动态设置页数, 动态设置最大高度
|
||||
if (opt.page === true) opt.page = {curr: layui.sessionData('pages')[opt.id] || 1}
|
||||
if (opt.height === 'full') opt.height = $(window).height() - $(elem).removeClass('layui-hide').offset().top - 35;
|
||||
// 动态计算最大页数
|
||||
opt.done = function () {
|
||||
var tableView = $(elem).next();
|
||||
tableView.find('[data-load]:not([data-table-id])').attr('data-table-id', elem.id);
|
||||
tableView.find('[data-action]:not([data-table-id])').attr('data-table-id', elem.id);
|
||||
layui.sessionData('pages', {key: elem.id, value: this.page.curr || 1}), (this.loading = true);
|
||||
this.elem.next().find('[data-load],[data-action]').not('[data-table-id]').attr('data-table-id', elem.id);
|
||||
}, opt.parseData = function (res) {
|
||||
var maxPage = Math.ceil(res.count / this.limit), curPage = layui.sessionData('pages')[opt.id] || 1;
|
||||
if (curPage > maxPage) this.elem.trigger('reload', {page: {curr: maxPage}});
|
||||
};
|
||||
// 动态设置最大高度
|
||||
if (opt.height === 'full') {
|
||||
opt.height = $(window).height() - $(elem).removeClass('layui-hide').offset().top - 35;
|
||||
}
|
||||
// 实例并绑定对象
|
||||
// 实例并绑定的对象
|
||||
$(this).data('this', layui.table.render(bindData(opt)));
|
||||
// 绑定实例重载事件
|
||||
$(this).bind('reload', function (evt, opts) {
|
||||
@ -861,70 +864,6 @@ $(function () {
|
||||
$textarea.remove();
|
||||
})(this.dataset.copy, $('<textarea style="position:fixed;top:-500px"></textarea>'));
|
||||
});
|
||||
|
||||
/*! 注册 data-tips-text 事件行为 */
|
||||
onEvent('mouseenter', '[data-tips-text]', function () {
|
||||
var opts = {tips: [$(this).attr('data-tips-type') || 3, '#78BA32'], time: 0}, that = this;
|
||||
$(this).attr('index', layer.tips($(this).attr('data-tips-text') || this.innerText, this, opts));
|
||||
$(this).off('mouseleave').on('mouseleave', function () {
|
||||
setTimeout(function () {
|
||||
layer.close($(that).attr('index'));
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
|
||||
/*! 注册 data-tips-image 事件行为 */
|
||||
onEvent('click', '[data-tips-image]', function () {
|
||||
$.previewImage(this.dataset.tipsImage || this.dataset.lazySrc || this.src, this.dataset.with);
|
||||
});
|
||||
/*! 注册 data-tips-image Hover 事件 */
|
||||
onEvent('mouseenter', '[data-tips-image][data-tips-hover]', function () {
|
||||
var img = new Image(), that = this;
|
||||
img.referrerPolicy = 'no-referrer', img.style.maxWidth = '260px', img.style.maxHeight = '260px';
|
||||
img.src = this.dataset.tipsImage || this.dataset.lazySrc || this.src, img.onload = function () {
|
||||
$(that).attr('index', layer.tips(img.outerHTML, that, {time: 0, skin: 'layui-layer-image', anim: 5, isOutAnim: false, scrollbar: false}));
|
||||
};
|
||||
$(this).off('mouseleave').on('mouseleave', function () {
|
||||
setTimeout(function () {
|
||||
layer.close($(that).attr('index'));
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
|
||||
$.previewImage = function (src, area) {
|
||||
var img = new Image(), defer = $.Deferred(), loaded = $.msg.loading();
|
||||
img.style.background = '#FFF', img.referrerPolicy = 'no-referrer';
|
||||
img.style.height = 'auto', img.style.width = area || '480px', img.style.display = 'none';
|
||||
document.body.appendChild(img), img.onerror = function () {
|
||||
$.msg.close(loaded), defer.reject();
|
||||
}, img.onload = function () {
|
||||
layer.open({
|
||||
type: 1, title: false, shadeClose: true, content: $(img), success: function ($elem, idx) {
|
||||
$.msg.close(loaded), defer.notify($elem, idx);
|
||||
}, area: area || '480px', skin: 'layui-layer-nobg', closeBtn: 1, end: function () {
|
||||
document.body.removeChild(img), defer.resolve()
|
||||
}
|
||||
});
|
||||
};
|
||||
return (img.src = src), defer.resolve();
|
||||
};
|
||||
|
||||
/*! 注册 data-phone-view 事件行为 */
|
||||
onEvent('click', '[data-phone-view]', function () {
|
||||
$.previewPhonePage(this.dataset.phoneView || this.href);
|
||||
});
|
||||
$.previewPhonePage = function (href, title, template) {
|
||||
template = '<div><div class="mobile-preview pull-left"><div class="mobile-header">_TITLE_</div><div class="mobile-body"><iframe id="phone-preview" src="_URL_" frameborder="0" marginheight="0" marginwidth="0"></iframe></div></div></div>';
|
||||
layer.style(layer.open({type: true, scrollbar: false, area: ['320px', '600px'], title: false, closeBtn: true, shadeClose: false, skin: 'layui-layer-nobg', content: $(template.replace('_TITLE_', title || '公众号').replace('_URL_', href)).html()}), {boxShadow: 'none'});
|
||||
};
|
||||
|
||||
/*! 表单编辑返回操作 */
|
||||
onEvent('click', '[data-history-back]', function () {
|
||||
$.msg.confirm(this.dataset.historyBack || '确定要返回吗?', function () {
|
||||
history.back();
|
||||
})
|
||||
});
|
||||
|
||||
/*! 异步任务状态监听与展示 */
|
||||
onEvent('click', '[data-queue]', function (e) {
|
||||
(function (confirm, callable) {
|
||||
@ -1001,6 +940,68 @@ $(function () {
|
||||
})(code)
|
||||
};
|
||||
|
||||
/*! 注册 data-tips-text 事件行为 */
|
||||
onEvent('mouseenter', '[data-tips-text]', function () {
|
||||
var opts = {tips: [$(this).attr('data-tips-type') || 3, '#78BA32'], time: 0}, that = this;
|
||||
$(this).attr('index', layer.tips($(this).attr('data-tips-text') || this.innerText, this, opts));
|
||||
$(this).off('mouseleave').on('mouseleave', function () {
|
||||
setTimeout(function () {
|
||||
layer.close($(that).attr('index'));
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
|
||||
/*! 注册 data-tips-image 事件行为 */
|
||||
onEvent('click', '[data-tips-image]', function () {
|
||||
$.previewImage(this.dataset.tipsImage || this.dataset.lazySrc || this.src, this.dataset.with);
|
||||
});
|
||||
/*! 注册 data-tips-image Hover 事件 */
|
||||
onEvent('mouseenter', '[data-tips-image][data-tips-hover]', function () {
|
||||
var img = new Image(), that = this;
|
||||
img.referrerPolicy = 'no-referrer', img.style.maxWidth = '260px', img.style.maxHeight = '260px';
|
||||
img.src = this.dataset.tipsImage || this.dataset.lazySrc || this.src, img.onload = function () {
|
||||
$(that).attr('index', layer.tips(img.outerHTML, that, {time: 0, skin: 'layui-layer-image', anim: 5, isOutAnim: false, scrollbar: false}));
|
||||
};
|
||||
$(this).off('mouseleave').on('mouseleave', function () {
|
||||
setTimeout(function () {
|
||||
layer.close($(that).attr('index'));
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
$.previewImage = function (src, area) {
|
||||
var img = new Image(), defer = $.Deferred(), loaded = $.msg.loading();
|
||||
img.style.background = '#FFF', img.referrerPolicy = 'no-referrer';
|
||||
img.style.height = 'auto', img.style.width = area || '480px', img.style.display = 'none';
|
||||
document.body.appendChild(img), img.onerror = function () {
|
||||
$.msg.close(loaded), defer.reject();
|
||||
}, img.onload = function () {
|
||||
layer.open({
|
||||
type: 1, title: false, shadeClose: true, content: $(img), success: function ($elem, idx) {
|
||||
$.msg.close(loaded), defer.notify($elem, idx);
|
||||
}, area: area || '480px', skin: 'layui-layer-nobg', closeBtn: 1, end: function () {
|
||||
document.body.removeChild(img), defer.resolve()
|
||||
}
|
||||
});
|
||||
};
|
||||
return (img.src = src), defer.resolve();
|
||||
};
|
||||
|
||||
/*! 注册 data-phone-view 事件行为 */
|
||||
onEvent('click', '[data-phone-view]', function () {
|
||||
$.previewPhonePage(this.dataset.phoneView || this.href);
|
||||
});
|
||||
$.previewPhonePage = function (href, title, template) {
|
||||
template = '<div><div class="mobile-preview pull-left"><div class="mobile-header">_TITLE_</div><div class="mobile-body"><iframe id="phone-preview" src="_URL_" frameborder="0" marginheight="0" marginwidth="0"></iframe></div></div></div>';
|
||||
layer.style(layer.open({type: true, scrollbar: false, area: ['320px', '600px'], title: false, closeBtn: true, shadeClose: false, skin: 'layui-layer-nobg', content: $(template.replace('_TITLE_', title || '公众号').replace('_URL_', href)).html()}), {boxShadow: 'none'});
|
||||
};
|
||||
|
||||
/*! 表单编辑返回操作 */
|
||||
onEvent('click', '[data-history-back]', function () {
|
||||
$.msg.confirm(this.dataset.historyBack || '确定要返回吗?', function () {
|
||||
history.back();
|
||||
})
|
||||
});
|
||||
|
||||
/*! 延时关闭加载动画 */
|
||||
window.addEventListener('load', function () {
|
||||
setTimeout(function () {
|
||||
|
@ -17,14 +17,15 @@
|
||||
@BoxBorderColor: #EEE;
|
||||
@BoxBorderRadius: 5px;
|
||||
|
||||
// 输入框边线颜色
|
||||
// 输入边线颜色
|
||||
@RadioBorderNormalColor: #CCC;
|
||||
@InputBorderNormalColor: #EEE;
|
||||
@InputBorderActiveColor: #DDD;
|
||||
|
||||
// 基础阴影样式配置
|
||||
@ShadowMaxOuter: 0 1px 6px 0 rgba(0, 0, 0, .16);
|
||||
@ShadowMaxInset: 0 1px 20px 0 rgba(0, 0, 0, .15) inset;
|
||||
// 基础阴影配置
|
||||
@ShadowMinOuter: 0 0 4px 0 rgba(0, 0, 0, .16);
|
||||
@ShadowMaxOuter: 0 0 6px 0 rgba(0, 0, 0, .16);
|
||||
@ShadowMaxInset: 0 1px 20px 0 rgba(0, 0, 0, .16) inset;
|
||||
@ShadowDownInset: 0 1px 6px 0 rgba(0, 0, 0, .16) inset;
|
||||
|
||||
// 导航条颜色配置
|
||||
@ -37,9 +38,9 @@
|
||||
// 导航条按钮颜色
|
||||
@TopHeaderHeight: 50px;
|
||||
@TopHeaderNavHoverTextColor: #000;
|
||||
@TopHeaderNavHoverBackColor: rgba(0, 0, 0, 0.05);
|
||||
@TopHeaderNavHoverBackColor: rgba(0, 0, 0, .05);
|
||||
@TopHeaderNavActiveTextColor: #000;
|
||||
@TopHeaderNavActiveBackColor: rgba(0, 0, 0, 0.1);
|
||||
@TopHeaderNavActiveBackColor: rgba(0, 0, 0, .10);
|
||||
|
||||
// 左侧菜单布局颜色
|
||||
@LeftMainBackColor: #393D49 !important;
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -195,10 +195,12 @@
|
||||
width: 76px;
|
||||
height: 76px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
border: 1px dashed #e2e2e2;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
margin-right: 10px;
|
||||
border-radius: 3px;
|
||||
box-shadow: @ShadowMinOuter;
|
||||
background: url('../img/upimg.png') no-repeat center center;
|
||||
background-size: cover;
|
||||
|
||||
@ -220,25 +222,43 @@
|
||||
}
|
||||
|
||||
.uploadimagemtl {
|
||||
margin-right: 8px;
|
||||
|
||||
a {
|
||||
float: right;
|
||||
color: #EEE;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: 4px 4px 0 0;
|
||||
> div {
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
display: none;
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
text-align: right;
|
||||
|
||||
a {
|
||||
color: #EEE;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: inline-block;
|
||||
margin-left: 1px;
|
||||
box-shadow: @ShadowMinOuter;
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
|
||||
&:first-child {
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-top-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover a {
|
||||
&:hover > div {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
|
||||
&:hover {
|
||||
a:hover {
|
||||
color: #FFF;
|
||||
text-decoration: none
|
||||
}
|
||||
@ -248,10 +268,9 @@
|
||||
.upload-image-smbox,
|
||||
.upload-image-mdbox,
|
||||
.upload-image-lgbox {
|
||||
a {
|
||||
.uploadimage a {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 1px 1px 0 0;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
@ -267,8 +286,39 @@
|
||||
}
|
||||
|
||||
.upload-image-lgbox .uploadimage {
|
||||
width: 260px;
|
||||
height: 260px;
|
||||
width: 240px;
|
||||
height: 240px;
|
||||
}
|
||||
|
||||
.submit-button-loading {
|
||||
cursor: default;
|
||||
position: relative;
|
||||
transform: scale(1);
|
||||
text-align: center;
|
||||
|
||||
&::after {
|
||||
left: 0;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
|
||||
content: "\e63d";
|
||||
font-family: layui-icon !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
animation-name: layui-rotate;
|
||||
-webkit-animation-name: layui-rotate;
|
||||
-webkit-animation-duration: 1s;
|
||||
|
||||
animation-duration: 1s;
|
||||
animation-timing-function: linear;
|
||||
-webkit-animation-timing-function: linear;
|
||||
|
||||
animation-iteration-count: infinite;
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
}
|
||||
}
|
||||
|
||||
.portal-block-container {
|
||||
|
@ -39,9 +39,19 @@
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
&-sm {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
&-md {
|
||||
width: 55px;
|
||||
height: 55px;
|
||||
width: 58px;
|
||||
height: 58px;
|
||||
}
|
||||
|
||||
&-lg {
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
}
|
||||
|
||||
> img {
|
||||
@ -530,12 +540,12 @@ fieldset {
|
||||
}
|
||||
|
||||
.mobile-footer {
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: 0;
|
||||
border: 1px solid #ccc;
|
||||
position: absolute;
|
||||
border: 1px solid #ccc;
|
||||
padding-left: 43px;
|
||||
background: url(../img/wechat/mobile_foot.png) no-repeat 0 0;
|
||||
list-style-type: none;
|
||||
|
@ -261,7 +261,6 @@
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
> .layui-card-table {
|
||||
padding: 15px;
|
||||
box-sizing: border-box;
|
||||
|
Loading…
x
Reference in New Issue
Block a user