mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
更新文件注释
This commit is contained in:
parent
512b346daa
commit
5a8887832c
@ -1,6 +1,22 @@
|
|||||||
/* global require, layer, layui */
|
// +----------------------------------------------------------------------
|
||||||
var a = document.scripts, c = a[a.length - 1].src, baseUrl = c.substring(0, c.lastIndexOf("/") + 1);
|
// | Think.Admin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 版权所有 2016~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网站: http://think.ctolog.com
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 开源协议 ( https://mit-license.org )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | github开源项目:https://github.com/zoujingli/Think.Admin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
// 当前资源URL目录
|
||||||
|
var baseUrl = (function () {
|
||||||
|
var scripts = document.scripts, src = scripts[scripts.length - 1].src;
|
||||||
|
return src.substring(0, src.lastIndexOf("/") + 1);
|
||||||
|
})();
|
||||||
|
|
||||||
|
// RequireJs 配置参数
|
||||||
require.config({
|
require.config({
|
||||||
baseUrl: baseUrl,
|
baseUrl: baseUrl,
|
||||||
waitSeconds: 0,
|
waitSeconds: 0,
|
||||||
@ -40,6 +56,7 @@ require.config({
|
|||||||
'admin.listen': {deps: ['jquery', 'jquery.cookies', 'admin.plugs']},
|
'admin.listen': {deps: ['jquery', 'jquery.cookies', 'admin.plugs']},
|
||||||
},
|
},
|
||||||
deps: ['css!//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css'],
|
deps: ['css!//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css'],
|
||||||
|
// 开启debug模式,不缓存资源
|
||||||
urlArgs: "t=" + (new Date()).getTime()
|
urlArgs: "t=" + (new Date()).getTime()
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -47,6 +64,7 @@ window.WEB_SOCKET_SWF_LOCATION = "//cdn.bootcss.com/web-socket-js/1.0.0/WebSocke
|
|||||||
window.UEDITOR_HOME_URL = (window.ROOT_URL ? window.ROOT_URL + '/static/' : baseUrl) + '../plugs/ueditor/';
|
window.UEDITOR_HOME_URL = (window.ROOT_URL ? window.ROOT_URL + '/static/' : baseUrl) + '../plugs/ueditor/';
|
||||||
window.LAYDATE_PATH = baseUrl + '../plugs/layui/laydate/';
|
window.LAYDATE_PATH = baseUrl + '../plugs/layui/laydate/';
|
||||||
|
|
||||||
|
// UI框架初始化
|
||||||
require(['pace', 'jquery', 'layui', 'laydate', 'bootstrap', 'template', 'ueditor', 'jquery.cookies'], function () {
|
require(['pace', 'jquery', 'layui', 'laydate', 'bootstrap', 'template', 'ueditor', 'jquery.cookies'], function () {
|
||||||
layui.config({dir: baseUrl + '../plugs/layui/'});
|
layui.config({dir: baseUrl + '../plugs/layui/'});
|
||||||
layui.use(['layer', 'form', 'element'], function () {
|
layui.use(['layer', 'form', 'element'], function () {
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Think.Admin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 版权所有 2016~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网站: http://think.ctolog.com
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 开源协议 ( https://mit-license.org )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | github开源项目:https://github.com/zoujingli/Think.Admin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
define(['jquery', 'admin.plugs'], function () {
|
define(['jquery', 'admin.plugs'], function () {
|
||||||
|
|
||||||
/*! 定义当前body对象 */
|
/*! 定义当前body对象 */
|
||||||
@ -7,9 +19,11 @@ define(['jquery', 'admin.plugs'], function () {
|
|||||||
this.$body.on('click', '[data-load]', function () {
|
this.$body.on('click', '[data-load]', function () {
|
||||||
var url = $(this).attr('data-load');
|
var url = $(this).attr('data-load');
|
||||||
var tips = $(this).attr('data-tips');
|
var tips = $(this).attr('data-tips');
|
||||||
|
|
||||||
function _goLoad() {
|
function _goLoad() {
|
||||||
$.form.load(url, {}, 'GET', null, true, tips);
|
$.form.load(url, {}, 'GET', null, true, tips);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).attr('data-confirm')) {
|
if ($(this).attr('data-confirm')) {
|
||||||
return $.msg.confirm($(this).attr('data-confirm'), _goLoad);
|
return $.msg.confirm($(this).attr('data-confirm'), _goLoad);
|
||||||
}
|
}
|
||||||
@ -43,11 +57,11 @@ define(['jquery', 'admin.plugs'], function () {
|
|||||||
/*! 注册 data-update 事件行为 */
|
/*! 注册 data-update 事件行为 */
|
||||||
this.$body.on('click', '[data-update]', function () {
|
this.$body.on('click', '[data-update]', function () {
|
||||||
var id = $(this).attr('data-update') || (function () {
|
var id = $(this).attr('data-update') || (function () {
|
||||||
var data = [];
|
var data = [];
|
||||||
return $($(this).attr('data-list-target') || 'input.list-check-box').map(function () {
|
return $($(this).attr('data-list-target') || 'input.list-check-box').map(function () {
|
||||||
(this.checked) && data.push(this.value);
|
(this.checked) && data.push(this.value);
|
||||||
}), data.join(',');
|
}), data.join(',');
|
||||||
}).call(this);
|
}).call(this);
|
||||||
if (id.length < 1) {
|
if (id.length < 1) {
|
||||||
return $.msg.tips('请选择需要操作的数据!');
|
return $.msg.tips('请选择需要操作的数据!');
|
||||||
}
|
}
|
||||||
@ -125,7 +139,16 @@ define(['jquery', 'admin.plugs'], function () {
|
|||||||
$container.find('img').on('click', function () {
|
$container.find('img').on('click', function () {
|
||||||
$iframe.attr('src', src);
|
$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 () {
|
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();
|
$container.remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -160,6 +183,7 @@ define(['jquery', 'admin.plugs'], function () {
|
|||||||
$("[data-menu-box]").not($leftmenu).addClass('hide');
|
$("[data-menu-box]").not($leftmenu).addClass('hide');
|
||||||
$openNode ? $openNode.trigger('click') : $leftmenu.find('[data-open]:first').trigger('click');
|
$openNode ? $openNode.trigger('click') : $leftmenu.find('[data-open]:first').trigger('click');
|
||||||
}
|
}
|
||||||
|
|
||||||
var $menutarget = $('[data-menu-target]').on('click', function () {
|
var $menutarget = $('[data-menu-target]').on('click', function () {
|
||||||
$menutarget.not($(this).addClass('active')).removeClass('active');
|
$menutarget.not($(this).addClass('active')).removeClass('active');
|
||||||
showLeftMenu($(this).attr('data-menu-target'));
|
showLeftMenu($(this).attr('data-menu-target'));
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
/* global layer, Pace */
|
// +----------------------------------------------------------------------
|
||||||
|
// | Think.Admin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 版权所有 2016~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网站: http://think.ctolog.com
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 开源协议 ( https://mit-license.org )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | github开源项目:https://github.com/zoujingli/Think.Admin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
define(['zeroclipboard', 'jquery'], function (ZeroClipboard) {
|
define(['zeroclipboard', 'jquery'], function (ZeroClipboard) {
|
||||||
|
|
||||||
@ -150,8 +160,8 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) {
|
|||||||
msg.prototype.loading = function (msg, callback) {
|
msg.prototype.loading = function (msg, callback) {
|
||||||
this.close();
|
this.close();
|
||||||
return this.index = msg
|
return this.index = msg
|
||||||
? layer.msg(msg, {icon: 16, scrollbar: false, shade: this.shade, time: 0, end: callback})
|
? 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});
|
: layer.load(2, {time: 0, scrollbar: false, shade: this.shade, end: callback});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -720,10 +730,10 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) {
|
|||||||
var callback = $(this).attr('data-callback');
|
var callback = $(this).attr('data-callback');
|
||||||
$(this).attr('data-listen', "true").validate(function (data) {
|
$(this).attr('data-listen', "true").validate(function (data) {
|
||||||
$.form.load(this.getAttribute('action') || window.location.href, data,
|
$.form.load(this.getAttribute('action') || window.location.href, data,
|
||||||
this.getAttribute('method') || 'POST',
|
this.getAttribute('method') || 'POST',
|
||||||
window[callback || '_default_callback'] || undefined, true,
|
window[callback || '_default_callback'] || undefined, true,
|
||||||
this.getAttribute('data-tips') || undefined,
|
this.getAttribute('data-tips') || undefined,
|
||||||
this.getAttribute('data-time') || undefined);
|
this.getAttribute('data-time') || undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user