Authored by wangtao

操作日志/页面提示信息

... ... @@ -265,7 +265,8 @@ layui.define(['laytpl', 'layer'], function (exports) {
if (that.render.isError) {
return view.error('请求视图文件异常,状态:' + e.status);
}
// render中报错,防止出现死循环
that.render.isError = true;
if (e.status === 404) {
if (!localStorage.getItem('access_token')) {
layer.msg("登录凭证失效,请重新登录验证!", {
... ... @@ -280,7 +281,7 @@ layui.define(['laytpl', 'layer'], function (exports) {
that.render('template/tips/error');
}
that.render.isError = true;
}
});
return that;
... ...
... ... @@ -24,6 +24,14 @@ layui.define(['element', 'admin', 'view'], function (exports) {
* hash变更
*/
hashChane: function () {
var that = this;
window.onload = function (){
// 绑定事件
that.bindElemClickEvent();
}
// debugger
var hash = window.top.location.hash;
sessionStorage.setItem("pagePath", hash);
... ... @@ -82,14 +90,6 @@ layui.define(['element', 'admin', 'view'], function (exports) {
},
ajaxSetupInit: function () {
let that = this;
setTimeout(function () {
// 绑定菜单点击事件
that.bindMenuClickEvent();
// 绑定元素点击事件
that.bindElemClickEvent();
console.log("日志事件注册完成!")
}, 500)
// sessionStorage.setItem("batchNo", "");
// sessionStorage.setItem("groupId", "");
... ... @@ -145,13 +145,13 @@ layui.define(['element', 'admin', 'view'], function (exports) {
var that = this;
// 绑定菜单事件
// setTimeout(function () {
// // 绑定菜单点击事件
// that.bindMenuClickEvent();
// // 绑定元素点击事件
// that.bindElemClickEvent();
setTimeout(function () {
// 绑定菜单点击事件
that.bindMenuClickEvent();
// 绑定元素点击事件
that.bindElemClickEvent();
// console.log("日志事件注册完成!")
// }, 500)
}, 500)
//lsq给带有title的元素绑定点击事件复制元素内容 2022-09-05
that.copyTitle();
... ... @@ -290,6 +290,10 @@ layui.define(['element', 'admin', 'view'], function (exports) {
}
//菜单点击传入属性lay-href的值,普通元素传入当前页面路由
if (flg) {
// 清空按钮名称
sessionStorage.setItem("buttonPath", "");
sessionStorage.setItem("buttonName", "");
//that.sendAjaxData(layHref, text)
sessionStorage.setItem("menuName", text);
sessionStorage.setItem("menuPath", layHref);
... ... @@ -312,7 +316,6 @@ layui.define(['element', 'admin', 'view'], function (exports) {
*/
clickEventHandle(thisObj, key) {
let that = this;
// debugger
sessionStorage.setItem("groupId",window.generateUUID().replace(/-/g, ""));
let layHref = thisObj.attr('lay-href') ? thisObj.attr('lay-href') : '';
... ... @@ -357,12 +360,12 @@ layui.define(['element', 'admin', 'view'], function (exports) {
// }))
// }
setTimeout(function (){
console.log(`${item}元素点击事件绑定完成!`)
// console.log(`${item}元素点击事件绑定完成!`)
$(item).unbind('click.handle').on('click.handle', (function (e) {
e.preventDefault();
that.clickEventHandle($(this), item)
}))
},300)
},500)
})
},
/**
... ... @@ -425,7 +428,7 @@ layui.define(['element', 'admin', 'view'], function (exports) {
if (val.indexOf('el::') != -1) {
let elName = val.replace('el::', '');
bindContextEvent(elName, 0);
console.log(`${elName}元素右键提示绑定完成!`)
// console.log(`${elName}元素右键提示绑定完成!`)
}
})
}, 300)
... ...