提交通用资源
198
public/static/admin/listen.js
Normal file
@ -0,0 +1,198 @@
|
||||
define(['jquery', 'admin.plugs'], function () {
|
||||
|
||||
/** 事件委派 */
|
||||
$('body').on('click', '[data-load]', function () {
|
||||
$.form.load($(this).attr('data-load'), {}, 'GET', null, true, $(this).attr('data-tips'));
|
||||
}).on('click', '[data-modal]', function () {
|
||||
return $.form.modal($(this).attr('data-modal'), 'open_type=modal');
|
||||
}).on('click', '[data-open]', function () {
|
||||
var url = $(this).attr('data-open');
|
||||
window.location.href = '#' + parseUri(url, this);
|
||||
}).on('click', 'a[data-page-href]', function () {
|
||||
window.location.href = '#' + parseUri(this.href, this);
|
||||
}).on('submit', 'form[data-form-href]', function () {
|
||||
var split = this.action.indexOf('?') === -1 ? '?' : '&';
|
||||
window.location.href = '#' + parseUri(this.action + split + $(this).serialize());
|
||||
}).on('click', '[data-back]', function () {
|
||||
window.history.back();
|
||||
}).on('click', '[data-reload]', function () {
|
||||
$.form.reload();
|
||||
}).on('click', '[data-check-target]', function () {
|
||||
var checked = !!this.checked;
|
||||
$($(this).attr('data-check-target')).map(function () {
|
||||
this.checked = checked;
|
||||
});
|
||||
}).on('click', '[data-update]', function () {
|
||||
var id = $(this).attr('data-update') || (function () {
|
||||
var data = [];
|
||||
return $($(this).attr('data-list-target') || 'input.list-check-box').map(function () {
|
||||
(this.checked) && data.push(this.value);
|
||||
}), data.join(',');
|
||||
}).call(this);
|
||||
if (id.length < 1) {
|
||||
return $.msg.tips('请选择需要操作的数据!');
|
||||
}
|
||||
var action = $(this).attr('data-action') || $(this).parents('[data-location]').attr('data-location');
|
||||
var value = $(this).attr('data-value') || 0, field = $(this).attr('data-field') || 'status';
|
||||
$.msg.confirm('确定要操作这些数据吗?', function () {
|
||||
$.form.load(action, {field: field, value: value, id: id}, 'POST');
|
||||
});
|
||||
}).on('click', '[data-href]', function () {
|
||||
var href = $(this).attr('data-href');
|
||||
if (href && href.indexOf('#') !== 0) {
|
||||
window.location.href = href;
|
||||
}
|
||||
}).on('click', '[data-file]', function () {
|
||||
var type = $(this).attr('data-type') || 'image'; //jpg,png
|
||||
var field = $(this).attr('data-field') || type;
|
||||
var method = $(this).attr('data-one') ? 'one' : 'index';
|
||||
var title = $(this).attr('data-title') || '文件管理';
|
||||
var uptype = $(this).attr('data-uptype') || 'qiniu';
|
||||
var url = window.APP_URL + '/plugs/file/' + method + '.html?uptype=' + uptype + '&type=' + type + '&field=' + field;
|
||||
$.form.iframe(url, title || '文件管理');
|
||||
}).on('click', '[data-iframe]', function () {
|
||||
$.form.iframe($(this).attr('data-iframe'), $(this).attr('data-title') || '窗口');
|
||||
}).on('click', '[data-icon]', function () {
|
||||
var field = $(this).attr('data-field') || 'iconv';
|
||||
var url = window.APP_URL + '/plugs/icon.html?field=' + field;
|
||||
$.form.iframe(url, '图标选择');
|
||||
}).on('click', '[data-tips-image]', function () {
|
||||
var src = this.getAttribute('data-tips-image') || this.src, img = new Image();
|
||||
var imgWidth = this.getAttribute('data-width') || '480px';
|
||||
img.onload = function () {
|
||||
layer.open({
|
||||
type: 1, area: imgWidth, title: false, closeBtn: 1, skin: 'layui-layer-nobg', shadeClose: true,
|
||||
content: $(img).appendTo('body').css({background: '#fff', width: imgWidth, height: 'auto'}),
|
||||
end: function () {
|
||||
$(img).remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
img.src = src;
|
||||
}).on('mouseenter', '[data-tips-text]', function () {
|
||||
var text = $(this).attr('data-tips-text');
|
||||
var placement = $(this).attr('data-tips-placement') || 'auto';
|
||||
$(this).tooltip({title: text, placement: placement}).tooltip('show');
|
||||
}).on('click', '[data-phone-view]', function () {
|
||||
var src = this.getAttribute('data-phone-view') || this.href;
|
||||
var $container = $('<div class="phone-container hide"><img src="http://static.cdn.cuci.cc/mobile_head.png" style="width:100%"/><div class="phone-screen"><iframe frameborder="0" marginheight="0" marginwidth="0"></iframe></div></div>').appendTo('body');
|
||||
var $iframe = $container.find('iframe').attr('src', src);
|
||||
$container.find('img').on('click', function () {
|
||||
$iframe.attr('src', src);
|
||||
});
|
||||
var index = layer.open({
|
||||
type: 1, scrollbar: false, area: ['320px', '600px'], title: false, closeBtn: 1, skin: 'layui-layer-nobg', shadeClose: true,
|
||||
content: $container.removeClass('hide'),
|
||||
end: function () {
|
||||
$container.remove();
|
||||
}
|
||||
});
|
||||
layer.style(index, {boxShadow: 'none'});
|
||||
});
|
||||
/*! 左侧菜单状态切换 */
|
||||
$('ul.sidebar-trans .nav-item a').on('click', function () {
|
||||
$(this).parents('.sidebar-nav.main-nav').addClass('open').find('ul.sidebar-trans').show();
|
||||
$('.sidebar-trans .nav-item').not($(this).parent().addClass('active')).removeClass('active');
|
||||
});
|
||||
$('body').on('click', '.framework-sidebar-full .sidebar-title', function () {
|
||||
var $trans = $(this).next('ul.sidebar-trans'), node = $trans.attr('data-menu-node') || false;
|
||||
node && $.cookie(node, $(this).parent().toggleClass('open').hasClass('open') ? 2 : 1);
|
||||
$(this).parent().hasClass('open') ? $trans.show() : $trans.hide();
|
||||
});
|
||||
$('ul.sidebar-trans').map(function () {
|
||||
var node = this.getAttribute('data-menu-node') || false;
|
||||
node && (parseInt($.cookie(node) || 2) === 2) && $(this).show().parent().addClass('open');
|
||||
});
|
||||
/*! Mini Tips 显示*/
|
||||
$('body').on('mouseenter mouseleave', '.framework-sidebar-mini .sidebar-trans .nav-item,.framework-sidebar-mini .sidebar-title', function (e) {
|
||||
$(this).tooltip({
|
||||
template: '<div class="console-sidebar-tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
||||
title: $(this).text(), placement: 'right', container: 'body'
|
||||
}).tooltip('show');
|
||||
(e.type === 'mouseleave') && $(this).tooltip('destroy');
|
||||
});
|
||||
/*! 切换左侧菜单 */
|
||||
function showLeftMenu(menuNode, $openNode) {
|
||||
var $leftmenu = $('[data-menu-box=' + menuNode + ']').removeClass('hide');
|
||||
$("[data-menu-box]").not($leftmenu).addClass('hide');
|
||||
$openNode ? $openNode.trigger('click') : $leftmenu.find('[data-open]:first').trigger('click');
|
||||
}
|
||||
var $menutarget = $('[data-menu-target]').on('click', function () {
|
||||
$menutarget.not($(this).addClass('active')).removeClass('active');
|
||||
showLeftMenu($(this).attr('data-menu-target'));
|
||||
});
|
||||
/*! 左侧菜单样式切换 */
|
||||
var $targetmenu = $('.sidebar-fold').on('click', function () {
|
||||
var $body = $('.framework-body').toggleClass('framework-sidebar-mini framework-sidebar-full');
|
||||
$.cookie('menu-style', $body.hasClass('framework-sidebar-mini') ? 'mini' : 'full');
|
||||
});
|
||||
($.cookie('menu-style') !== 'mini') && $targetmenu.trigger('click');
|
||||
|
||||
/** URL转URI */
|
||||
window.parseUri = function (uri, obj) {
|
||||
var params = {};
|
||||
if (uri.indexOf('?') !== -1) {
|
||||
var queryParams = uri.split('?')[1].split('&');
|
||||
for (var i in queryParams) {
|
||||
if (queryParams[i].indexOf('=') !== -1) {
|
||||
var hash = queryParams[i].split('=');
|
||||
try {
|
||||
params[hash[0]] = window.decodeURIComponent(window.decodeURIComponent(hash[1].replace(/%2B/ig, ' ')));
|
||||
} catch (e) {
|
||||
console.log([e, uri, queryParams, hash]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
uri = getUri(uri);
|
||||
params.spm = obj && obj.getAttribute('data-menu-node') || queryNode(uri);
|
||||
if (!params.token) {
|
||||
var token = window.location.href.replace(/.*token=(\w+).*/ig, '$1');
|
||||
(/^\w{16}$/.test(token)) && (params.token = token);
|
||||
}
|
||||
delete params[""];
|
||||
return uri + '?' + $.param(params);
|
||||
};
|
||||
/*! 通过URI查询最有可能的菜单NODE */
|
||||
function queryNode(url) {
|
||||
var $menu = $('.framework-sidebar').find('[data-menu-node][data-open*="_URL_"]'.replace('_URL_', url.replace(/\.html$/ig, '')));
|
||||
if ($menu.size()) {
|
||||
return $menu.get(0).getAttribute('data-menu-node');
|
||||
}
|
||||
return /^m\-/.test(node = location.href.replace(/.*spm=([\d\-m]+).*/ig, '$1')) ? node : '';
|
||||
}
|
||||
/*! 计算URL地址中有效的URI */
|
||||
function getUri(uri) {
|
||||
uri = uri || window.location.href;
|
||||
uri = (uri.indexOf(window.location.host) !== -1 ? uri.split(window.location.host)[1] : uri).split('?')[0];
|
||||
return (uri.indexOf('#') !== -1 ? uri.split('#')[1] : uri);
|
||||
}
|
||||
/*! URI路由处理 */
|
||||
window.onhashchange = function () {
|
||||
var hash = (window.location.hash || '').substring(1), node = hash.replace(/.*spm=([\d\-m]+).*/ig, "$1");
|
||||
if (!/^m\-[\d\-]+$/.test(node)) {
|
||||
node = queryNode(getUri()) || '';
|
||||
}
|
||||
if (hash.length < 1 || node.length < 1) {
|
||||
return $('.topbar-home-link:first').trigger('click');
|
||||
}
|
||||
/* 顶部菜单选中处理 */
|
||||
var parentNode = [node.split('-')[0], node.split('-')[1]].join('-');
|
||||
$('[data-menu-target]').not($('[data-menu-target="' + parentNode + '"]').addClass('active')).removeClass('active');
|
||||
/* 左则菜单处理 */
|
||||
var $menu = $('[data-menu-node="' + node + '"]').eq(0);
|
||||
if ($menu.size() > 0) {
|
||||
$('.framework-container').addClass('framework-sidebar-full');
|
||||
var $li = $menu.parent('li').addClass('active');
|
||||
$li.parents('.framework-sidebar').find('li.active').not($li).removeClass('active');
|
||||
$menu.parents('.sidebar-trans').removeClass('hide').show();
|
||||
$menu.parents('.main-nav').addClass('open');
|
||||
$menu.parents('[data-menu-box]').removeClass('hide').siblings('[data-menu-box]').addClass('hide');
|
||||
} else {
|
||||
$('.framework-container').removeClass('framework-sidebar-full');
|
||||
}
|
||||
/* 加载资源 */
|
||||
$.form.open(hash);
|
||||
};
|
||||
window.onhashchange.call(this);
|
||||
});
|
736
public/static/admin/plugs.js
Normal file
@ -0,0 +1,736 @@
|
||||
/* global layer, Pace */
|
||||
|
||||
define(['zeroclipboard', 'jquery', 'layui'], function (ZeroClipboard) {
|
||||
|
||||
/*!
|
||||
* jQuery placeholder, fix for IE6,7,8,9
|
||||
*/
|
||||
var JPlaceHolder = {
|
||||
_check: function () {
|
||||
return 'placeholder' in document.createElement('input');
|
||||
},
|
||||
init: function () {
|
||||
!this._check() && this.fix();
|
||||
},
|
||||
fix: function () {
|
||||
$(':input[placeholder]').map(function () {
|
||||
var self = $(this), txt = self.attr('placeholder');
|
||||
self.wrap($('<div></div>').css({position: 'relative', zoom: '1', border: 'none', background: 'none', padding: 'none', margin: 'none'}));
|
||||
var pos = self.position(), h = self.outerHeight(true), paddingleft = self.css('padding-left');
|
||||
var holder = $('<span></span>').text(txt).css({position: 'absolute', left: pos.left, top: pos.top, height: h, lineHeight: h + 'px', paddingLeft: paddingleft, color: '#aaa'}).appendTo(self.parent());
|
||||
self.on('focusin focusout change keyup', function () {
|
||||
self.val() ? holder.hide() : holder.show();
|
||||
});
|
||||
holder.click(function () {
|
||||
self.get(0).focus();
|
||||
});
|
||||
self.val() && holder.hide();
|
||||
});
|
||||
}
|
||||
};
|
||||
JPlaceHolder.init();
|
||||
|
||||
|
||||
/**
|
||||
* 定义消息处理构造方法
|
||||
* @returns {common_L11._msg}
|
||||
*/
|
||||
function msg() {
|
||||
this.version = '2.0';
|
||||
this.shade = [0.02, '#000'];
|
||||
this.closeIndexs = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭消息框
|
||||
*/
|
||||
msg.prototype.close = function () {
|
||||
if (!this.closeIndexs['_' + this.index]) {
|
||||
this.closeIndexs['_' + this.index] = true;
|
||||
return layer.close(this.index);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 弹出警告消息框
|
||||
* @param {type} msg
|
||||
* @param {type} callback
|
||||
* @returns {undefined}
|
||||
*/
|
||||
msg.prototype.alert = function (msg, callback) {
|
||||
this.close();
|
||||
return this.index = layer.alert(msg, {end: callback, scrollbar: false});
|
||||
};
|
||||
|
||||
/**
|
||||
* 确认对话框
|
||||
* @param {type} msg 提示消息内容
|
||||
* @param {type} ok 确认的回调函数
|
||||
* @param {type} no 取消的回调函数
|
||||
* @returns {undefined}
|
||||
*/
|
||||
msg.prototype.confirm = function (msg, ok, no) {
|
||||
this.close();
|
||||
return this.index = layer.confirm(msg, {btn: ['确认', '取消']}, ok, no);
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示成功类型的消息
|
||||
* @param {type} msg 消息内容
|
||||
* @param {type} time 延迟关闭时间
|
||||
* @param {type} callback 回调函数
|
||||
*/
|
||||
msg.prototype.success = function (msg, time, callback) {
|
||||
this.close();
|
||||
return this.index = layer.msg(msg, {icon: 1, shade: this.shade, scrollbar: false, end: callback, time: (time || 2) * 1000, shadeClose: true});
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示失败类型的消息
|
||||
* @param {type} msg 消息内容
|
||||
* @param {type} time 延迟关闭时间
|
||||
* @param {type} callback 回调函数
|
||||
*/
|
||||
msg.prototype.error = function (msg, time, callback) {
|
||||
this.close();
|
||||
return this.index = layer.msg(msg, {icon: 2, shade: this.shade, scrollbar: false, time: (time || 3) * 1000, end: callback, shadeClose: true});
|
||||
};
|
||||
|
||||
/**
|
||||
* 状态消息提示
|
||||
* @param {type} msg
|
||||
* @param {type} time
|
||||
* @param {type} callback
|
||||
* @returns {unresolved}
|
||||
*/
|
||||
msg.prototype.tips = function (msg, time, callback) {
|
||||
this.close();
|
||||
return this.index = layer.msg(msg, {time: (time || 3) * 1000, shade: this.shade, end: callback, shadeClose: true});
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示正在加载中的提示
|
||||
* @param {type} msg 提示内容
|
||||
* @param {type} callback 回调方法
|
||||
*/
|
||||
msg.prototype.loading = function (msg, callback) {
|
||||
this.close();
|
||||
return this.index = msg
|
||||
? layer.msg(msg, {icon: 16, scrollbar: false, shade: this.shade, time: 0, end: callback})
|
||||
: layer.load(2, {time: 0, scrollbar: false, shade: this.shade, end: callback});
|
||||
};
|
||||
|
||||
/**
|
||||
* 自动处理显示Think返回的Json数据
|
||||
* @param {type} data JSON数据对象
|
||||
* @param {type} time 延迟关闭时间
|
||||
*/
|
||||
msg.prototype.auto = function (data, time) {
|
||||
var self = this;
|
||||
if (data.code === 'SUCCESS') {
|
||||
self.success(data.info, time, function () {
|
||||
if (data.referer === 'back') {
|
||||
window.history.back();
|
||||
} else if (data.referer === 'reload') {
|
||||
$.form.reload();
|
||||
} else if (data.referer) {
|
||||
window.location.href = data.referer;
|
||||
} else {
|
||||
$.form.reload();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
self.error(data.info, 3, function () {
|
||||
if (data.referer) {
|
||||
window.location.href = data.referer;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 将消息对象挂载到Jq
|
||||
*/
|
||||
$.msg = new msg();
|
||||
|
||||
|
||||
/**
|
||||
* 表单构造函数
|
||||
* @returns {common_L11._form}
|
||||
*/
|
||||
function _form() {
|
||||
this.version = '2.0';
|
||||
this._model = null;
|
||||
this.errMsg = '{status}服务器繁忙,请稍候再试!';
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步加载的数据
|
||||
* @param {type} url 请求的地址
|
||||
* @param {json|form|$form} data 额外请求数据
|
||||
* @param {type} type 提交的类型 GET|POST
|
||||
* @param {type} callback 成功后的回调方法
|
||||
* @param {type} loading 是否显示加载层
|
||||
* @param {type} tips 提示消息
|
||||
* @param {type} time 消息提示时间
|
||||
*/
|
||||
_form.prototype.load = function (url, data, type, callback, loading, tips, time) {
|
||||
var self = this;
|
||||
if (loading !== false) {
|
||||
var index = $.msg.loading(tips);
|
||||
}
|
||||
var send_data = data;
|
||||
if (typeof data === 'object' && data.tagName === 'FORM') {
|
||||
send_data = $(data).serialize();
|
||||
}
|
||||
try {
|
||||
Pace && Pace.restart();
|
||||
} catch (e) {
|
||||
}
|
||||
require(['admin.listen'], function () {
|
||||
$.ajax({
|
||||
type: type || 'GET',
|
||||
url: parseUri(url),
|
||||
data: send_data || {},
|
||||
statusCode: {
|
||||
404: function () {
|
||||
$.msg.tips(self.errMsg.replace('{status}', 'E404 - '));
|
||||
},
|
||||
500: function () {
|
||||
$.msg.tips(self.errMsg.replace('{status}', 'E500 - '));
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
$.msg.tips(self.errMsg.replace('{status}', 'E' + textStatus + ' - '));
|
||||
},
|
||||
success: function (res) {
|
||||
if (loading !== false) {
|
||||
$.msg.close(index);
|
||||
}
|
||||
if (typeof callback === 'function' && callback.call(self, res) === false) {
|
||||
return false;
|
||||
}
|
||||
if (typeof (res) === 'object') {
|
||||
return $.msg.auto(res, time);
|
||||
}
|
||||
if (res.indexOf('A PHP Error was encountered') !== -1) {
|
||||
return $.msg.tips(self.errMsg.replace('{status}', 'E505 - '));
|
||||
}
|
||||
self.show(res);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 动态HTML事件重载
|
||||
* @param {type} $container
|
||||
* @returns {undefined}
|
||||
*/
|
||||
_form.prototype.reInit = function ($container) {
|
||||
$.validate.listen.call(this);
|
||||
$('[data-copy]').map(function () {
|
||||
var client = new ZeroClipboard(this);
|
||||
client.on("ready", function () {
|
||||
client.on("copy", function (event) {
|
||||
event.clipboardData.setData("text/plain", event.target.getAttribute('data-copy'));
|
||||
});
|
||||
client.on("aftercopy", function () {
|
||||
$.msg.tips('内容复制成功!');
|
||||
});
|
||||
});
|
||||
});
|
||||
JPlaceHolder.init();
|
||||
/* 自动给必填字符加上样式 @zoujingli @by 2016-05-11 */
|
||||
$container.find('[required]').parent().prevAll('label').addClass('label-required');
|
||||
};
|
||||
/**
|
||||
* 加载HTML到目标位置
|
||||
* @param {type} url
|
||||
* @param {type} data
|
||||
* @param {type} target
|
||||
* @param {type} callback
|
||||
* @param {type} loading
|
||||
* @param {type} tips
|
||||
* @returns {undefined}
|
||||
*/
|
||||
_form.prototype.open = function (url, data, target, callback, loading, tips) {
|
||||
data && (typeof (data) === 'object') && (data = $.param(data));
|
||||
data && (url += (url.indexOf('?') === -1 ? '?' : '&') + data);
|
||||
this.load(url, data, 'GET', function (res) {
|
||||
if (typeof (res) === 'object') {
|
||||
return $.msg.auto(res);
|
||||
}
|
||||
var $container = $('.layer-main-container').html(res);
|
||||
|
||||
function reinit() {
|
||||
/* 事件重载 */
|
||||
$.form.reInit($container);
|
||||
}
|
||||
|
||||
reinit.call(this), setTimeout(reinit, 500), setTimeout(reinit, 1000);
|
||||
return (typeof callback === 'function') && callback.call(this);
|
||||
}, loading, tips);
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载HTML到弹出层
|
||||
* @param {type} url
|
||||
* @param {type} data
|
||||
* @param {type} callback
|
||||
* @param {type} loading
|
||||
* @param {type} tips
|
||||
* @returns {undefined}
|
||||
*/
|
||||
_form.prototype.modal = function (url, data, callback, loading, tips) {
|
||||
data && (typeof (data) === 'object') && (data = $.param(data));
|
||||
data && (url += (url.indexOf('?') === -1 ? '?' : '&') + data);
|
||||
this.load(url, data, 'GET', function (res) {
|
||||
if (typeof (res) === 'object') {
|
||||
return $.msg.auto(res);
|
||||
}
|
||||
layer.open({
|
||||
area: "800px",
|
||||
content: res,
|
||||
btn: false,
|
||||
success: function (dom, index) {
|
||||
var $container = $(dom);
|
||||
/* 处理样式及返回按钮事件 */
|
||||
$container.find('.wrapper').css('minWidth', '760px').find('[data-back]').off('click').on('click', function () {
|
||||
layer.close(index);
|
||||
});
|
||||
/* 处理标题 */
|
||||
$container.find('.layui-layer-title').html($container.find('.ibox-title').hide().find('h5').html());
|
||||
/* 事件重载 */
|
||||
$.form.reInit($container);
|
||||
}
|
||||
});
|
||||
return (typeof callback === 'function') && callback.call(this);
|
||||
}, loading, tips);
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示HTML到中主内容区
|
||||
* @param {type} html
|
||||
* @returns {undefined}
|
||||
*/
|
||||
_form.prototype.show = function (html) {
|
||||
var $container = $('.layer-main-container').html(html);
|
||||
|
||||
function reinit() {
|
||||
$.validate.listen.call(this);
|
||||
$container.find('h3').addClass('animated fadeIn container-animated');
|
||||
}
|
||||
|
||||
reinit.call(this), setTimeout(reinit, 500), setTimeout(reinit, 1000);
|
||||
};
|
||||
|
||||
/**
|
||||
* 打开一个iframe窗口
|
||||
* @param {type} url
|
||||
* @returns {unresolved}
|
||||
*/
|
||||
_form.prototype.iframe = function (url, title) {
|
||||
return layer.open({title: title || '窗口', type: 2, area: ['800px', '530px'], fix: true, maxmin: false, content: url});
|
||||
};
|
||||
|
||||
/**
|
||||
* 关闭FORM框
|
||||
* @returns {undefined}
|
||||
*/
|
||||
_form.prototype.close = function () {
|
||||
return $(this._modal).modal('hide');
|
||||
};
|
||||
|
||||
/*刷新当前页面*/
|
||||
_form.prototype.reload = function () {
|
||||
window.onhashchange.call(this);
|
||||
};
|
||||
|
||||
/*!表单实例挂载*/
|
||||
$.form = new _form();
|
||||
|
||||
/**
|
||||
* 定义模块函数
|
||||
* @returns {validate_L1.validate}
|
||||
*/
|
||||
var validate = function () {
|
||||
// 模式检测
|
||||
this.isSupport = ($('<input type="email">').attr("type") === "email");
|
||||
// 表单元素
|
||||
this.inputTag = 'input,textarea,select';
|
||||
// 检测元素事件
|
||||
this.checkEvent = {change: true, blur: true, keyup: false};
|
||||
};
|
||||
|
||||
/**
|
||||
*获取表单元素的类型
|
||||
*/
|
||||
validate.prototype.getElementType = function (ele) {
|
||||
return (ele.getAttribute("type") + "").replace(/\W+$/, "").toLowerCase();
|
||||
};
|
||||
|
||||
/**
|
||||
*去除字符串两头的空格
|
||||
*/
|
||||
validate.prototype.trim = function (str) {
|
||||
return str.replace(/(^\s*)|(\s*$)/g, '');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 标签元素是否可见
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
validate.prototype.isVisible = function (ele) {
|
||||
return $(ele).is(':visible');
|
||||
};
|
||||
|
||||
/**
|
||||
* 检测属性是否有定义
|
||||
* @param {type} ele
|
||||
* @param {type} prop
|
||||
* @param {type} undefined
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
validate.prototype.hasProp = function (ele, prop, undefined) {
|
||||
if (typeof prop !== "string") {
|
||||
return false;
|
||||
}
|
||||
var attrProp = ele.getAttribute(prop);
|
||||
return (attrProp !== undefined && attrProp !== null && attrProp !== false)
|
||||
};
|
||||
|
||||
/**
|
||||
* 设置文件选择范围
|
||||
* @param {type} ele
|
||||
* @param {type} start
|
||||
* @param {type} end
|
||||
* @returns {validate_L1.validate.prototype}
|
||||
*/
|
||||
validate.prototype.selectRange = function (ele, start, end) {
|
||||
if (ele.createTextRange) {
|
||||
var range = ele.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd('character', end);
|
||||
range.moveStart('character', start);
|
||||
range.select();
|
||||
} else {
|
||||
//ele.focus();
|
||||
ele.setSelectionRange(start, end);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* 判断表单元素是否为空
|
||||
* @param {type} ele
|
||||
* @param {type} value
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
validate.prototype.isEmpty = function (ele, value) {
|
||||
value = value || ele.getAttribute('placeholder');
|
||||
var trimValue = ele.value;
|
||||
trimValue = this.trim(trimValue);
|
||||
if (trimValue === "" || trimValue === value) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* 正则验证表单元素
|
||||
* @param {type} ele
|
||||
* @param {type} regex
|
||||
* @param {type} params
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
validate.prototype.isRegex = function (ele, regex, params) {
|
||||
var self = this;
|
||||
// 原始值和处理值
|
||||
var inputValue = ele.value;
|
||||
var dealValue = inputValue;
|
||||
var type = this.getElementType(ele);
|
||||
|
||||
if (type !== "password") {
|
||||
// 密码不trim前后空格
|
||||
dealValue = this.trim(inputValue);
|
||||
if (dealValue !== inputValue) {
|
||||
if (ele.tagName.toLowerCase() !== "textarea") {
|
||||
ele.value = dealValue;
|
||||
} else {
|
||||
ele.innerHTML = dealValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取正则表达式,pattern属性获取优先,然后通过type类型匹配。注意,不处理为空的情况
|
||||
regex = regex || ele.getAttribute('pattern');
|
||||
if (dealValue === "" || !regex) {
|
||||
return true;
|
||||
}
|
||||
// multiple多数据的处理
|
||||
var isMultiple = this.hasProp(ele, 'multiple'), newRegExp = new RegExp(regex, params || 'i');
|
||||
// number类型下multiple是无效的
|
||||
if (isMultiple && !/^number|range$/i.test(type)) {
|
||||
var isAllPass = true;
|
||||
var dealValues = dealValue.split(",");
|
||||
for (var i in dealValues) {
|
||||
var partValue = self.trim(dealValues[i]);
|
||||
if (isAllPass && !newRegExp.test(partValue)) {
|
||||
isAllPass = false;
|
||||
}
|
||||
}
|
||||
return isAllPass;
|
||||
} else {
|
||||
return newRegExp.test(dealValue);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 检侧所的表单元素
|
||||
*/
|
||||
validate.prototype.isAllpass = function (elements, options) {
|
||||
if (!elements) {
|
||||
return true;
|
||||
}
|
||||
var params = options || {};
|
||||
var allpass = true;
|
||||
var self = this;
|
||||
if (elements.size && elements.size() === 1 && elements.get(0).tagName.toLowerCase() === "form") {
|
||||
elements = $(elements).find(self.inputTag);
|
||||
} else if (elements.tagName && elements.tagName.toLowerCase() === "form") {
|
||||
elements = $(elements).find(self.inputTag);
|
||||
}
|
||||
elements.each(function () {
|
||||
if (self.checkInput(this, params) === false) {
|
||||
$(this).focus();
|
||||
allpass = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return allpass;
|
||||
};
|
||||
|
||||
/**
|
||||
* 验证标志
|
||||
*/
|
||||
validate.prototype.remind = function (input, type, tag) {
|
||||
var text = '';
|
||||
// 如果元素完全显示
|
||||
if (this.isVisible(input)) {
|
||||
if (type === "radio" || type === "checkbox") {
|
||||
this.errorPlacement(input, this.getErrMsg(input));
|
||||
} else if (tag === "select" || tag === "empty") {
|
||||
// 下拉值为空或文本框文本域等为空
|
||||
this.errorPlacement(input, (tag === "empty" && text) ? "您尚未输入" + text : this.getErrMsg(input));
|
||||
} else if (/^range|number$/i.test(type) && Number(input.value)) {
|
||||
// 整数值与数值的特殊提示
|
||||
this.errorPlacement(input, "值无效");
|
||||
} else {
|
||||
// 文本框文本域格式不准确
|
||||
var finalText = this.getErrMsg(input);
|
||||
if (text) {
|
||||
finalText = "您输入的" + text + "格式不准确";
|
||||
}
|
||||
this.errorPlacement(input, finalText);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* 检测表单单元
|
||||
*/
|
||||
validate.prototype.checkInput = function (input, options) {
|
||||
var type = this.getElementType(input);
|
||||
var tag = input.tagName.toLowerCase();
|
||||
var isRequired = this.hasProp(input, "required");
|
||||
var isNone = this.hasProp(input, 'data-auto-none');
|
||||
//无需要验证
|
||||
if (isNone || input.disabled || type === 'submit' || type === 'reset' || type === 'file' || type === 'image' || !this.isVisible(input)) {
|
||||
return;
|
||||
}
|
||||
var allpass = true;
|
||||
// 需要验证的有
|
||||
if (type === "radio" && isRequired) {
|
||||
var eleRadios = input.name ? $("input[type='radio'][name='" + input.name + "']") : $(input);
|
||||
var radiopass = false;
|
||||
eleRadios.each(function () {
|
||||
if (radiopass === false && $(this).is("[checked]")) {
|
||||
radiopass = true;
|
||||
}
|
||||
});
|
||||
if (radiopass === false) {
|
||||
allpass = this.remind(eleRadios.get(0), type, tag);
|
||||
} else {
|
||||
this.successPlacement(input);
|
||||
}
|
||||
} else if (type === "checkbox" && isRequired && !$(input).is("[checked]")) {
|
||||
allpass = this.remind(input, type, tag);
|
||||
} else if (tag === "select" && isRequired && !input.value) {
|
||||
allpass = this.remind(input, type, tag);
|
||||
} else if ((isRequired && this.isEmpty(input)) || !(allpass = this.isRegex(input))) {
|
||||
allpass ? this.remind(input, type, "empty") : this.remind(input, type, tag);
|
||||
allpass = false;
|
||||
} else {
|
||||
this.successPlacement(input);
|
||||
}
|
||||
return allpass;
|
||||
};
|
||||
|
||||
/**
|
||||
*获取错误提示的内容
|
||||
*/
|
||||
validate.prototype.getErrMsg = function (ele) {
|
||||
return ele.getAttribute('title') || '';
|
||||
};
|
||||
|
||||
/**
|
||||
* 错误消息显示
|
||||
* @param {type} ele
|
||||
* @param {type} content
|
||||
* @param {type} options
|
||||
* @returns {undefined}
|
||||
*/
|
||||
validate.prototype.errorPlacement = function (ele, content) {
|
||||
$(ele).addClass('validate-error');
|
||||
this.insertErrorEle(ele);
|
||||
$($(ele).data('input-info')).addClass('fadeInRight animated').css({width: 'auto'}).html(content);
|
||||
};
|
||||
|
||||
/**
|
||||
* 错误消息消除
|
||||
*/
|
||||
validate.prototype.successPlacement = function (ele) {
|
||||
$(ele).removeClass('validate-error');
|
||||
this.insertErrorEle(ele);
|
||||
$($(ele).data('input-info')).removeClass('fadeInRight').css({width: '30px'}).html('');
|
||||
};
|
||||
|
||||
/**
|
||||
* 错误消息标签插入
|
||||
* @param {type} ele
|
||||
* @returns {undefined}
|
||||
*/
|
||||
validate.prototype.insertErrorEle = function (ele) {
|
||||
var $html = $('<span style="-webkit-animation-duration:.2s;animation-duration:.2s;padding-right:20px;color:#a94442;position:absolute;right:0;font-size:12px;z-index:2;display:block;width:34px;text-align:center;pointer-events:none"></span>');
|
||||
$html.css({top: $(ele).position().top + 'px', paddingTop: $(ele).css('paddingTop'), paddingBottom: $(ele).css('paddingBottom'), lineHeight: $(ele).css('lineHeight')});
|
||||
$(ele).data('input-info') || $(ele).data('input-info', $html.insertAfter(ele));
|
||||
};
|
||||
|
||||
/**
|
||||
* 表单验证入口
|
||||
* @param {type} callback
|
||||
* @param {type} options
|
||||
* @returns {$|Function|Zepto}
|
||||
*/
|
||||
validate.prototype.check = function (form, callback, options) {
|
||||
var self = this;
|
||||
var defaults = {
|
||||
// 取消浏览器默认的HTML验证
|
||||
novalidate: true,
|
||||
// 禁用submit按钮可用
|
||||
submitEnabled: true,
|
||||
// 额外的其他验证
|
||||
validate: function () {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
var params = $.extend({}, defaults, options || {});
|
||||
if (this.isSupport) {
|
||||
if (params.novalidate) {
|
||||
$(form).attr("novalidate", "novalidate");
|
||||
} else {
|
||||
params.hasTypeNormally = true;
|
||||
}
|
||||
}
|
||||
|
||||
// disabled的submit按钮还原
|
||||
if (params.submitEnabled) {
|
||||
$(form).find("[disabled]").each(function () {
|
||||
if (/^image|submit$/.test(this.type)) {
|
||||
$(this).removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//元素动态监听
|
||||
$(form).find(self.inputTag).map(function () {
|
||||
var func = function () {
|
||||
self.checkInput(this);
|
||||
};
|
||||
for (var i in self.checkEvent) {
|
||||
if (self.checkEvent[i] === true) {
|
||||
$(this).off(i, func).on(i, func);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(form).bind("submit", function (event) {
|
||||
var elements = $(this).find(self.inputTag);
|
||||
if (self.isAllpass(elements, params) && params.validate() && $.isFunction(callback)) {
|
||||
var sdata = {};
|
||||
var data = $(form).serializeArray();
|
||||
for (var i in data) {
|
||||
var key = data[i].name, value = data[i].value;
|
||||
if (sdata.hasOwnProperty(key)) {
|
||||
if (typeof sdata[key] === 'object') {
|
||||
sdata[key].push(value);
|
||||
} else {
|
||||
sdata[key] = [sdata[key], value];
|
||||
}
|
||||
} else {
|
||||
sdata[key] = value;
|
||||
}
|
||||
}
|
||||
callback.call(this, sdata);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
return $(form).data('validate', this);
|
||||
};
|
||||
|
||||
/**
|
||||
* 注册对象到Jq
|
||||
* @param {type} form
|
||||
* @param {type} callback
|
||||
* @param {type} options
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$.validate = function (form, callback, options) {
|
||||
return (new validate()).check(form, callback, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* 注册对象到JqFn
|
||||
* @param {type} callback
|
||||
* @param {type} options
|
||||
* @returns {jquery.validate_L1.$|Function|Zepto|$}
|
||||
*/
|
||||
|
||||
$.fn.validate = function (callback, options) {
|
||||
return (new validate()).check(this, callback, options);
|
||||
};
|
||||
|
||||
$.validate.listen = function () {
|
||||
$('form[data-auto]').map(function () {
|
||||
if ($(this).attr('data-listen') === 'true') {
|
||||
return;
|
||||
}
|
||||
var callback = $(this).attr('data-callback');
|
||||
$(this).attr('data-listen', "true").validate(function (data) {
|
||||
$.form.load(this.getAttribute('action') || window.location.href, data,
|
||||
this.getAttribute('method') || 'POST',
|
||||
window[callback || '_default_callback'] || undefined, true,
|
||||
this.getAttribute('data-tips') || undefined,
|
||||
this.getAttribute('data-time') || undefined);
|
||||
});
|
||||
});
|
||||
};
|
||||
if ($.form && typeof $.form.load === 'function') {
|
||||
$.validate.listen.call(this);
|
||||
}
|
||||
|
||||
return $;
|
||||
});
|
53
public/static/app.js
Normal file
@ -0,0 +1,53 @@
|
||||
/* global require, layer, layui */
|
||||
var a = document.scripts, c = a[a.length - 1].src, baseUrl = c.substring(0, c.lastIndexOf("/") + 1);
|
||||
|
||||
require.config({
|
||||
baseUrl: baseUrl,
|
||||
waitSeconds: 0,
|
||||
map: {'*': {css: '//cdn.bootcss.com/require-css/0.1.8/css.min.js'}},
|
||||
paths: {
|
||||
'pace': ['//cdn.bootcss.com/pace/1.0.2/pace.min', '../plugs/jquery/pace.min'],
|
||||
'echarts': ['//cdn.bootcss.com/echarts/3.2.3/echarts.min'],
|
||||
'base64': ['//cdn.bootcss.com/Base64/1.0.0/base64.min'],
|
||||
'json': ['//cdn.bootcss.com/json2/20150503/json2.min'],
|
||||
'socket': ['//cdn.bootcss.com/web-socket-js/1.0.0/web_socket.min'],
|
||||
'jquery': ['//cdn.bootcss.com/jquery/1.12.4/jquery.min', '../plugs/jquery/jquery.min'],
|
||||
'jquery.icheck': ['//cdn.bootcss.com/iCheck/1.0.2/icheck.min'],
|
||||
'jquery.cookies': ['//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie', '../plugs/jquery/jquery.cookie'],
|
||||
'bootstrap': ['//cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min', '../plugs/bootstrap/script/bootstrap.min'],
|
||||
'bootstrap.multiselect': ['//cdn.bootcss.com/bootstrap-multiselect/0.9.13/js/bootstrap-multiselect.min', '../plugs/multiselect/bootstrap-multiselect'],
|
||||
'pcasunzips': ['../plugs/jquery/pcasunzips'],
|
||||
'layui': ['../plugs/layui/layui'],
|
||||
'laydate': ['../plugs/layui/laydate/laydate'],
|
||||
'template': ['../plugs/template/template'],
|
||||
'ueditor': ['../plugs/ueditor/ueditor'],
|
||||
'zeroclipboard': ['//cdn.bootcss.com/zeroclipboard/2.2.0/ZeroClipboard.min'],
|
||||
'admin.plugs': ['admin/plugs'],
|
||||
'admin.listen': ['admin/listen']
|
||||
},
|
||||
shim: {
|
||||
'laydate': {deps: ['jquery']},
|
||||
'layui': {deps: ['jquery', 'css!' + baseUrl + '../plugs/layui/css/layui.css']},
|
||||
'socket': {deps: ['//cdn.bootcss.com/swfobject/2.2/swfobject.min.js']},
|
||||
'bootstrap': {deps: ['jquery']},
|
||||
'bootstrap.multiselect': {deps: ['jquery', 'bootstrap', 'css!//cdn.bootcss.com/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css']},
|
||||
'jquery.icheck': {deps: ['jquery', 'bootstrap', 'css!//cdn.bootcss.com/iCheck/1.0.2/skins/square/blue.css']},
|
||||
'jquery.cookies': {deps: ['jquery']},
|
||||
'admin.plugs': {deps: ['jquery', 'layui']},
|
||||
'admin.listen': {deps: ['jquery', 'jquery.cookies', 'admin.plugs']},
|
||||
},
|
||||
deps: ['css!//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css'],
|
||||
// urlArgs: "t=" + (new Date()).getTime()
|
||||
});
|
||||
|
||||
window.WEB_SOCKET_SWF_LOCATION = "//cdn.bootcss.com/web-socket-js/1.0.0/WebSocketMain.swf";
|
||||
window.UEDITOR_HOME_URL = (window.ROOT_URL ? window.ROOT_URL + '/static/' : baseUrl) + '../plugs/ueditor/';
|
||||
window.LAYDATE_PATH = baseUrl + '../plugs/layui/laydate/';
|
||||
|
||||
require(['pace', 'jquery', 'layui', 'laydate', 'bootstrap', 'template', 'ueditor', 'jquery.cookies'], function () {
|
||||
layui.config({dir: baseUrl + '../plugs/layui/'});
|
||||
layui.use(['layer'], function () {
|
||||
window.layer = layui.layer;
|
||||
require(['admin.listen']);
|
||||
});
|
||||
});
|
48
public/static/chat.js
Normal file
@ -0,0 +1,48 @@
|
||||
|
||||
require(['socket', 'layui', 'json'], function () {
|
||||
layui.config({dir: baseUrl + 'plugs/layui/'});
|
||||
WEB_SOCKET_DEBUG = true;
|
||||
WEB_SOCKET_SWF_LOCATION = "//cdn.bootcss.com/web-socket-js/1.0.0/WebSocketMain.swf";
|
||||
var userinfo = {
|
||||
};
|
||||
var socket;
|
||||
function connect_socket() {
|
||||
socket = new WebSocket('ws://basic.demo.cuci.cc:8888');
|
||||
socket.onopen = function () {
|
||||
socket.send(JSON.stringify({type: 'init'}));
|
||||
};
|
||||
socket.onmessage = function (e) {
|
||||
var msg = JSON.parse(e.data);
|
||||
switch (msg.type) {
|
||||
case 'push':
|
||||
for (var i in msg.data) {
|
||||
if (userinfo['id'] !== msg.data[i].id)
|
||||
{
|
||||
console.log(msg.data[i]);
|
||||
layui.layim.getMessage(msg.data[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
socket.onclose = connect_socket;
|
||||
}
|
||||
connect_socket.call(this);
|
||||
layui.use('layim', function (layim) {
|
||||
//基础配置
|
||||
layim.config({
|
||||
init: {
|
||||
url: 'http://basic.demo.cuci.cc/socket/init.html'
|
||||
}
|
||||
, find: ''
|
||||
, copyright: true
|
||||
});
|
||||
//监听发送消息
|
||||
layim.on('sendMessage', function (data) {
|
||||
socket.send(JSON.stringify({type: 'msg', data: data}));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
2848
public/static/theme/default/css/animate.css
vendored
Normal file
247
public/static/theme/default/css/console.css
Normal file
@ -0,0 +1,247 @@
|
||||
@charset "UTF-8";
|
||||
/**
|
||||
* 楚才团队后台框架
|
||||
*/
|
||||
|
||||
|
||||
/** 设置选择文字及背景颜色 */
|
||||
::selection{background-color:#ec494e;color:#FFF}
|
||||
::-moz-selection{background-color:#ec494e;color:#FFF}
|
||||
|
||||
/* radio 样式定制 */
|
||||
.cuci-radio {width: 18px;height: 18px;position: relative;margin: 0px 5px!important;background: #ffffff;border: solid 1px #dddddd;border-radius: 50%;display: table;float: left;-webkit-appearance: none;transition: background-color ease 0.1s;}
|
||||
.cuci-radio:after {pointer-events: none;}
|
||||
.cuci-radio:checked {background-color: #3498db;border: solid 1px #3498db;text-align: center;}
|
||||
.cuci-radio:focus{outline:none!important}
|
||||
.cuci-radio:checked:before {position: absolute;left: 1px;top: 1px;font-size: 14px;display: table;font: normal normal normal 14px/1 FontAwesome;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;content: "\f00c";color: #ffffff;}
|
||||
.cuci-radio:disabled{ background-color: #d9d9d9;border: solid 1px #d9d9d9;}
|
||||
|
||||
/* 延时动画 */
|
||||
.transition-min{-webkit-transition: all .2s linear;-moz-transition: all .2s linear;-o-transition: all .2s linear;transition: all .2s linear;}
|
||||
|
||||
body{min-width:1024px}
|
||||
[data-tips-image]{cursor:pointer!important;cursor:-webkit-zoom-in!important;cursor:-moz-zoom-in!important;cursor:zoom-in!important;}
|
||||
select.form-control.input-sm{padding:0 0 0 10px}
|
||||
.form-control.input-sm{line-height:1em}
|
||||
.pointer{cursor:pointer}
|
||||
.wrapper {padding:10px 15px;min-width:900px}
|
||||
.framework-sidebar-mini .wrapper{min-width:950px}
|
||||
.help-block{margin-bottom:0}
|
||||
.text-center{text-align:center}
|
||||
.block{display:block}
|
||||
.gray-bg {background-color:#f3f3f4}
|
||||
.full-height {height:100% !important}
|
||||
.full-width {width:100% !important}
|
||||
.nowrap{white-space:nowrap!important}
|
||||
td .text-explode:first-child{opacity:0;display:none}
|
||||
.text-explode {color: #CCC !important;font-weight: normal !important;margin: 0px 4px !important;}
|
||||
|
||||
|
||||
/** 列表搜索区 */
|
||||
.form-search .row{margin-left:-5px;margin-right:-5px}
|
||||
.form-search .col-xs-4{width:220px!important;padding-left:5px;padding-right:5px}
|
||||
.form-search .col-xs-3{width:200px!important;padding-left:5px;padding-right:5px}
|
||||
.form-search .col-xs-2{width:180px!important;padding-left:5px;padding-right:5px}
|
||||
.form-search .col-xs-1{width:65px!important;padding-left:5px;padding-right:5px}
|
||||
.input-focus{background:none!important;padding:3px 5px!important}
|
||||
|
||||
/** 表单Input错误提示 */
|
||||
.error-input-right{-webkit-animation-duration:.2s;animation-duration:.2s;padding-right:5px}
|
||||
.label-required:after{content:'*';color:red;position:absolute;margin-left:4px;font-weight:bold;line-height:1.8em}
|
||||
|
||||
/** 列表图片图标样式 */
|
||||
.list-table-image{width:22px;cursor:pointer}
|
||||
/** 列表排序样式 */
|
||||
.list-table-sort-td {width:60px!important;text-align:center}
|
||||
.list-table-sort-td input{width:50px;text-align:center;font-size:12px;line-height:14px;padding:2px}
|
||||
.list-table-sort-td button{width:50px;text-align:center;font-size:12px;color:#333}
|
||||
/** 列表选择框 */
|
||||
.list-table-check-td {width:30px!important;text-align:center;padding:0}
|
||||
.list-table-check-td input{margin:0;vertical-align:middle}
|
||||
|
||||
/** 表格样式 */
|
||||
.table{background: #FFF;font-size: 12px;border-top: 1px solid #e1e6eb;border: 1px solid #e1e6eb;}
|
||||
.table-center{text-align:center}
|
||||
.table-center td,.table-center th{text-align:center}
|
||||
.table-bordered {border:1px solid #EBEBEB}
|
||||
.table-bordered > thead > tr > td {background-color:#F5F5F6;border-bottom-width:1px}
|
||||
.table-bordered > thead > tr > th,.table-bordered > tbody > tr > th.table-bordered > thead > tr > td,.table-bordered > tbody > tr > td {border:1px solid #e7e7e7}
|
||||
.table > thead > tr > th {border-bottom:1px solid #DDDDDD;vertical-align:bottom;font-weight:normal;color:#999;background-color:#F5F6FA}
|
||||
.table > thead > tr > th,.table > tbody > tr > th,.table > thead > tr > td,.table > tbody > tr > td {border-top:1px solid #e7eaec;line-height:1.42857;padding:8px;vertical-align:middle}
|
||||
.form-control {background-color:#FFFFFF;background-image:none;border:1px solid #e5e6e7;border-radius:1px;color:inherit;display:block;padding:6px 12px;transition:border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;width:100%;font-size:14px;box-shadow:none}
|
||||
.form-control:focus{outline:none;box-shadow:none}
|
||||
|
||||
.hr-line-dashed {border-top:1px dashed #e7eaec;color:#ffffff;background-color:#ffffff;height:1px;margin:20px 0}
|
||||
.hr-line-solid {border-bottom:1px solid #e7eaec;background-color:rgba(0, 0, 0, 0);border-style:solid !important;margin-top:15px;margin-bottom:15px}
|
||||
|
||||
/** 按钮定义 */
|
||||
.btn{outline:none!important}
|
||||
.btn-primary {background-color:#1ab394;border-color:#1ab394;color:#FFFFFF}
|
||||
.btn-primary:hover,.btn-primary:focus,.btn-primary:active{background-image:none!important;background-color:#18a689!important;border-color:#18a689!important;color:#FFFFFF!important;box-shadow:none!important}
|
||||
.btn-primary.disabled,.btn-primary.disabled:hover,.btn-primary.disabled:focus,.btn-primary.disabled:active{background-color:#1dc5a3;border-color:#1dc5a3}
|
||||
.btn-white {color:inherit;background:white;border:1px solid #e7eaec}
|
||||
.btn-white:hover,.btn-white:focus,.btn-white:active{color:inherit;border:1px solid #d2d2d2}
|
||||
.btn-white.disabled,.btn-white.disabled:hover,.btn-white.disabled:focus,.btn-white.disabled.active{color:#cacaca}
|
||||
|
||||
/** 内容盒子 */
|
||||
.ibox {clear:both;margin-bottom:25px;margin-top:0;padding:0}
|
||||
.ibox:after,.ibox:before {display:table}
|
||||
.ibox-title {border-bottom:1px solid #e7eaec;color:inherit;margin-bottom:0;padding:0px 15px 0px 15px;min-height:48px}
|
||||
.ibox-content {background-color:#ffffff;color:inherit;padding:15px}
|
||||
.ibox-footer {color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#ffffff;padding:10px 15px}
|
||||
.ibox-title h5 {display:inline-block;font-size:14px;margin:16px 0px;font-weight:500;text-indent:8px;text-overflow:ellipsis;border-left:2px solid #88B7E0}ss/** 分页样式 */
|
||||
|
||||
/** 分页样式 */
|
||||
.pagination > li > a{background-color:#FFFFFF!important;border:1px solid #DDDDDD!important;color:inherit!important;float:left;line-height:1.42857;margin-left:-1px;padding:4px 10px;position:relative;text-decoration:none}
|
||||
.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,
|
||||
.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{background-color:#f4f4f4!important;color:inherit!important;border-color:#DDDDDD!important;cursor:default;z-index:2}
|
||||
|
||||
/** 页面加载进度 */
|
||||
.pace {-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}
|
||||
.pace-inactive {display:none;}
|
||||
.pace .pace-progress {background:#22df80;position:fixed;z-index:2000; top:0;right:100%;width:100%;height:2px;}
|
||||
|
||||
/** 手机盒子 */
|
||||
.phone-container {background: #2c3e50;border-radius: 30px;left: 0;margin: 0 auto 0;padding: 70px 18px 68px 18px;position: absolute;right: 0;width:300px;}
|
||||
.phone-container:before {background: #1f2b38;border-radius: 20px;content: '';height: 8px;left: 0;margin: -35px auto;position: absolute;right: 0;width: 45px;}
|
||||
.phone-container:after {background: #1f2b38;border-radius: 20px;content: "";display: block;height: 42px;left: 0;margin: 12px auto;position: absolute;right: 0;width: 42px;}
|
||||
.phone-screen {background: #d6e6e9;height: 408px;overflow: hidden;padding: 0;position: relative;}
|
||||
.phone-screen iframe{width:100%;height:100%;background:#fff}
|
||||
|
||||
/** 微信菜单 */
|
||||
.mobile-preview{position:relative;width:317px;height:580px;background:transparent url("../img/wechat/mobile_head.png") no-repeat 0 0;background-position:0 0;border:1px solid #e7e7eb}
|
||||
.mobile-preview .mobile-header{color:#fff;text-align:center;padding-top:30px;font-size:15px;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;margin:0 30px}
|
||||
.mobile-footer{list-style-type:none;margin:0;position:absolute;bottom:0;left:0;right:0;border-top:1px solid #e7e7eb;background:transparent url("../img/wechat/mobile_foot.png") no-repeat 0 0;background-position:0 0;background-repeat:no-repeat;padding-left:43px}
|
||||
.mobile-footer li{width:33.33%;line-height:50px;position:relative;float:left;text-align:center}
|
||||
.mobile-footer li a{display:block;border:1px solid rgba(255,255,255,0);border-left:1px solid #e7e7eb;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;color:#616161;text-decoration:none}
|
||||
.mobile-footer li a.active{background-color:#fff;border:1px solid #44b549!important}
|
||||
.mobile-footer .icon-add{background:url("../img/wechat/index.png") 0 0 no-repeat;width:14px;height:14px;vertical-align:middle;display:inline-block;margin-top:-2px;border-bottom:none!important}
|
||||
.mobile-footer .icon-sub{background:url("../img/wechat/index.png") 0 -48px no-repeat;width:7px;height:7px;vertical-align:middle;display:inline-block;margin-right:2px;margin-top:-2px}
|
||||
.mobile-footer .sub-menu {position:absolute;border-radius:3px;border:1px solid #d0d0d0;display:block;bottom:60px;width:100%;background-color:#fafafa}
|
||||
.mobile-footer .sub-menu ul,
|
||||
.mobile-footer .sub-menu li{padding:0;display:block;width:100%;float:none;z-index:11}
|
||||
.mobile-footer .sub-menu li a{border:1px solid rgba(255,255,255,0)}
|
||||
.mobile-footer .sub-menu li a.bottom-border{border-bottom:1px solid #e7e7eb}
|
||||
.mobile-footer .arrow {position:absolute;left:50%;margin-left:-6px}
|
||||
.mobile-footer .arrow_in,.mobile-footer .arrow_out {z-index:10;width:0;height:0;display:inline-block;border-width:6px;border-style:dashed;border-color:transparent;border-bottom-width:0;border-top-style:solid}
|
||||
.mobile-footer .arrow_in{bottom:-5px;border-top-color:#fafafa}
|
||||
.mobile-footer .arrow_out {bottom:-6px;border-top-color:#d0d0d0}
|
||||
|
||||
/** 登录页面样式 */
|
||||
.login-container{min-width:560px;position:absolute;left:0;top:0;display:table;-webkit-transform:translateZ(0);background:#e9e9e9 url(../img/login_bg.jpg) no-repeat center !important;background-size:100% auto}
|
||||
.login-container input{padding-left:33px}
|
||||
.login-container .logo img{margin-bottom:48px;max-width: 200px;}
|
||||
.login-container .layer-box{height:100%;vertical-align:middle;display:table-cell;-webkit-animation-duration:.5s;animation-duration:.5s}
|
||||
.login-container .layer-content{box-shadow:0px 0px 10px #ccc;width:490px;background-color:#f7f7f7;padding:98px 98px 160px 98px;margin:-80px auto auto auto}
|
||||
.login-container .input-icon{position:absolute;top:0;left:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}
|
||||
.login-container .copyright{position:absolute;left:0;bottom:30px;width:100%}
|
||||
.login-container .wrapper{min-width:0!important}
|
||||
.login-container .verify-label span.input{position:relative;float:left}
|
||||
.login-container .verify-label input{width:208px;display:inline-block;}
|
||||
.login-container .verify-label img{height:34px;width:80px;border:1px solid #e5e6e7;float:right}
|
||||
.login-container .login-btn{margin-top:15px;}
|
||||
|
||||
/** 后台框架结构 */
|
||||
html{overflow:auto;overflow-y:scroll!important}body{font-size:12px}
|
||||
body,h1,h2,h3,h4,h5,h6{font-family:"Helvetica Neue","Luxi Sans","DejaVu Sans",Tahoma,"Hiragino Sans GB",STHeiti,"Microsoft YaHei"}
|
||||
a{color:#06C;cursor:pointer}a:hover{color:#039}label{font-size:100%;font-weight:500}input::-ms-clear{display:none}
|
||||
.framework-topbar{position:fixed;width:100%;height:50px;background:#09C;z-index:101;}
|
||||
.framework-body{position:absolute;width:100%;top:50px;bottom:0px;background-color:#000;z-index:100}
|
||||
.framework-container{width:auto;position:absolute;top:0px;left:0px;bottom:0px;right:0px;background:#FFF}
|
||||
.framework-container-body{position:absolute;width:auto;top:0px;bottom:0px;left:0px;right:0px;overflow:hidden;overflow-y:auto}
|
||||
|
||||
/** 顶部菜单 */
|
||||
.console-topbar{position:relative;z-index:100;clear:both;height:50px;background:#09C;font-size:12px;min-width:990px;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;}
|
||||
.console-topbar a{text-decoration:none}
|
||||
.console-topbar a:focus{outline:none}
|
||||
.console-topbar .icon-arrow-down{display:inline-block;width:18px;text-align:center;vertical-align:middle}
|
||||
.console-topbar .dropdown .dropdown-menu{z-index:1;font-size:12px;border-radius:0;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}
|
||||
.console-topbar .dropdown .dropdown-menu a{padding:0}
|
||||
.console-topbar .dropdown.open .icon-arrow-down{vertical-align:text-top;transform:rotate(180deg);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg)}
|
||||
.console-topbar .topbar-wrap,
|
||||
.console-topbar .topbar-logo,
|
||||
.console-topbar .topbar-home-link,
|
||||
.console-topbar .topbar-nav,
|
||||
.console-topbar .topbar-info{height:100%}
|
||||
.console-topbar .topbar-left{float:left}
|
||||
.console-topbar .topbar-right{float:right}
|
||||
.console-topbar .topbar-clearfix:before,
|
||||
.console-topbar .topbar-clearfix:after{display:table;content:" "}
|
||||
.console-topbar .topbar-clearfix:after{clear:both}
|
||||
.console-topbar .topbar-head{background:#008fbf;height:50px;position:relative;z-index:3}
|
||||
.console-topbar .topbar-nav{position:relative;z-index:2;background:#09C}
|
||||
.console-topbar .topbar-logo{display:block;background:#0087b4;min-width:220px;font-size:18px;color:#FFF;text-align:center;line-height:50px}
|
||||
.console-topbar .topbar-logo span{line-height:50px;padding-left:20px;padding-right:20px}
|
||||
.console-topbar .topbar-home-link{padding:0 20px;margin-right:1px;background:#09c}
|
||||
.console-topbar .topbar-btn{color:#fff;font-size:14px;line-height:50px}
|
||||
.console-topbar .topbar-btn.active,
|
||||
.console-topbar .topbar-btn:hover{background:#008fbf}
|
||||
.console-topbar .topbar-info{background:#008fbf;position:absolute;z-index:1;top:0;right:0}
|
||||
.console-topbar .topbar-info .topbar-btn{padding:0 10px;height:50px;display:block;z-index:2;background:#09c;}
|
||||
.console-topbar .topbar-info .topbar-btn:hover,
|
||||
.console-topbar .topbar-info .topbar-btn.topbar-btn-dark{background:#008fbf}
|
||||
.console-topbar .topbar-info .topbar-btn.open{position:relative}
|
||||
.console-topbar .topbar-info .dropdown{min-width:80px}
|
||||
.console-topbar .topbar-info .dropdown .dropdown-menu{width:100%;min-width:0;margin:0;border:none;padding:0}
|
||||
.console-topbar .topbar-info .dropdown.open .topbar-btn{color:#333;background:#fff;border-bottom:1px solid #eaedf1;position:relative}
|
||||
.console-topbar .topbar-info .topbar-info-btn{height:40px;border-bottom:1px solid #eaedf1}
|
||||
.console-topbar .topbar-info .topbar-info-btn a{line-height:39px;text-align:center;padding-left:10px;padding-right:10px;margin:0}
|
||||
.console-topbar .topbar-info-item{display:inline-block;margin-left:1px}
|
||||
.console-topbar .topbar-info-item.open .glyphicon-menu-up{transform:rotate(180deg);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg)}
|
||||
|
||||
/** 左侧菜单 **/
|
||||
.framework-sidebar{width:0px;display:none;position:fixed;top:50px;bottom:0px;background-color:#293038;z-index:102;overflow-x:hidden;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;}
|
||||
.framework-sidebar .sidebar-content{width:230px;height:100%;overflow:auto;overflow-x:hidden}
|
||||
.framework-sidebar .sidebar-fold{height:30px;width:220px;background:#394555;color:#aeb9c2;text-align:center;line-height:30px !important;font-size:12px;user-select:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none}
|
||||
.framework-sidebar .sidebar-fold:hover{background:#37424f;color:#fff}
|
||||
.framework-sidebar .sidebar-nav{width:220px}
|
||||
|
||||
.framework-sidebar .sidebar-nav ul{margin:0px;padding:0px;list-style:none;overflow:hidden;text-indent:1.2em}
|
||||
.framework-sidebar .sidebar-nav li a{display:block;width:100%;height:40px;line-height:40px;overflow:hidden}
|
||||
.framework-sidebar .sidebar-nav li a:hover{background:#37424f}
|
||||
.framework-sidebar .sidebar-nav li a:hover .nav-icon,
|
||||
.framework-sidebar .sidebar-nav li a:hover .nav-title{color:#fff}
|
||||
.framework-sidebar .sidebar-nav .nav-item{position:relative}
|
||||
.framework-sidebar .sidebar-nav .sidebar-title{height:40px;background:#37424f;border-bottom:1px solid #414d5c;color:#fff;line-height:40px;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none}
|
||||
.framework-sidebar .sidebar-nav .sidebar-title:hover{background:#414d5c;}
|
||||
.framework-sidebar .sidebar-nav .sidebar-title-icon{display:inline-block;margin:0 8px 0 20px;vertical-align:middle}
|
||||
.framework-sidebar .sidebar-manage{vertical-align:middle;position:absolute;height:40px;width:40px;right:0}
|
||||
.framework-sidebar .sidebar-manage a{display:block;width:100%;height:100%;text-align:center;line-height:40px;font-size:14px;color:#a0abb3;text-decoration:none}
|
||||
.framework-sidebar .sidebar-nav.open .sidebar-title{background: #22282e;border-bottom:1px solid #22282e}
|
||||
.framework-sidebar .sidebar-nav.open .sidebar-title-icon{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg)}
|
||||
.framework-sidebar .sidebar-nav .nav-icon{width:50px;text-align:center;font-size:16px;float:left;color:#aeb9c2}
|
||||
.framework-sidebar .sidebar-nav .nav-title{float:left;overflow:hidden;color:#fff;white-space:nowrap;text-overflow:ellipsis;display:block;width:130px}
|
||||
.framework-sidebar .sidebar-nav li.active a{background:#0099cc}
|
||||
.framework-sidebar .sidebar-nav li.active a .nav-title{color:#fff}
|
||||
.framework-sidebar .sidebar-nav li.active a .nav-icon{color:#fff}
|
||||
.framework-sidebar .sidebar-nav .manage-nav{height:30px;overflow:hidden}
|
||||
.framework-sidebar .sidebar-nav .manage-nav:hover .nav-icon{color:#fff}
|
||||
.framework-sidebar .sidebar-nav .manage-nav a{display:block;height:100%}
|
||||
.framework-sidebar .sidebar-nav .manage-nav .nav-icon{height:100%;line-height:30px;font-size:16px}
|
||||
.framework-sidebar .sidebar-nav .manage-nav .nav-title{margin-top:14px;background:#293038;height:1px;width:120px}
|
||||
.framework-sidebar-mini .framework-sidebar{width:50px;display:block}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-content{width:70px}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-fold{width:50px}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-nav{width:50px}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-nav ul{text-indent:0;display:block!important}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-nav .nav-item a:hover+.nav-tooltip{display:block}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-nav .nav-title{display:none}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-nav .sidebar-title-icon{margin:0 8px 0 20px}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-nav .sidebar-title-icon{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg)}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-fold span{transform:rotate(-270deg);-webkit-transform:rotate(-270deg);-moz-transform:rotate(-270deg);-ms-transform:rotate(-270deg);-o-transform:rotate(-270deg)}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-title{background: #22282e;border-bottom:1px solid #22282e}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-title .sidebar-title-text{display:none}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-title-inner:hover+.nav-tooltip{display:block}
|
||||
.framework-sidebar-mini .framework-sidebar .sidebar-manage{display:none}
|
||||
.framework-sidebar-full .framework-sidebar{width:220px;display:block}
|
||||
.framework-sidebar-full .framework-sidebar .sidebar-nav .nav-icon{width:50px}
|
||||
.framework-sidebar-mini .framework-container{left:50px}
|
||||
.framework-sidebar-full .framework-container{left:220px}
|
||||
|
||||
/** 菜单Tips样式 */
|
||||
.console-sidebar-tooltip{position:absolute;z-index:1030;display:block;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}
|
||||
.console-sidebar-tooltip .tooltip-inner{max-width:200px;padding:12px 8px;color:#ffffff;text-align:center;text-decoration:none;border-radius:0 0;background-color:#425160}
|
||||
.console-sidebar-tooltip .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}
|
||||
.console-sidebar-tooltip.right{padding:0 5px;margin-left:3px}
|
||||
.console-sidebar-tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#425160;border-width:5px 5px 5px 0}
|
||||
.console-sidebar-tooltip.in{opacity:0.9;filter:alpha(opacity=90)}
|
BIN
public/static/theme/default/img/404_icon.png
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
public/static/theme/default/img/505_icon.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
public/static/theme/default/img/cuci.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
public/static/theme/default/img/cuci_favicon.ico
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
public/static/theme/default/img/login_bg.jpg
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
public/static/theme/default/img/paper.jpg
Normal file
After Width: | Height: | Size: 309 B |
BIN
public/static/theme/default/img/wechat/index.png
Normal file
After Width: | Height: | Size: 231 B |
BIN
public/static/theme/default/img/wechat/mobile_foot.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
public/static/theme/default/img/wechat/mobile_head.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
public/static/theme/default/img/wechat/qrc_payed.jpg
Normal file
After Width: | Height: | Size: 27 KiB |