...
|
...
|
@@ -78,6 +78,21 @@ layui.define(['element', 'admin'], function (exports) { |
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* ajax掉接口之前传参
|
|
|
* @author lsq
|
|
|
* @date 2022-08-18
|
|
|
* */
|
|
|
sendAjaxData(menuPath,elementName){
|
|
|
let name=encodeURIComponent(elementName);
|
|
|
$.ajaxSetup({
|
|
|
headers:{
|
|
|
menuPath:menuPath,
|
|
|
elementName:name
|
|
|
}
|
|
|
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
* 鼠标点击事件
|
|
|
*/
|
|
|
bindClickEvent(){
|
...
|
...
|
@@ -85,7 +100,7 @@ layui.define(['element', 'admin'], function (exports) { |
|
|
var eventKeys = ['a','button','[data-bizid]','.layui-table-link'];
|
|
|
// 菜单点击
|
|
|
if(!$('#LAY-system-side-menu li a').hasClass("on_fn")){
|
|
|
$('#LAY-system-side-menu li a').on('click',(function (e){
|
|
|
$('#LAY-system-side-menu li a').unbind('click.handle').on('click.handle',(function (e){
|
|
|
e.preventDefault();
|
|
|
//start lsq 元素鼠标点击事件操作 2022-08-11
|
|
|
//绑定事件时增加一个class防止多次绑定事件
|
...
|
...
|
@@ -138,6 +153,20 @@ layui.define(['element', 'admin'], function (exports) { |
|
|
}
|
|
|
that.data.handleLog.push(eleObj)
|
|
|
}
|
|
|
//菜单点击传入属性lay-href的值,普通元素传入当前页面路由
|
|
|
if(flg){
|
|
|
that.sendAjaxData(layHref,text)
|
|
|
|
|
|
}else{
|
|
|
let locationPath=location.hash;
|
|
|
let pathArr=locationPath.split("#/");
|
|
|
let path='/'
|
|
|
if(pathArr && pathArr.length>1){
|
|
|
path=pathArr[1]
|
|
|
}
|
|
|
that.sendAjaxData(path,text)
|
|
|
|
|
|
}
|
|
|
console.log(text,that.data.handleLog);
|
|
|
},
|
|
|
/**
|
...
|
...
|
@@ -179,7 +208,7 @@ layui.define(['element', 'admin'], function (exports) { |
|
|
var eventKeys = ['button','[data-bizid]','.layui-table-link'];
|
|
|
eventKeys.map(item=>{
|
|
|
if(!$(item).hasClass("on_fn")){
|
|
|
$(item).on('click',(function (e){
|
|
|
$(item).unbind('click.handle').on('click.handle',(function (e){
|
|
|
e.preventDefault();
|
|
|
that.clickEventHandle($(this))
|
|
|
}))
|
...
|
...
|
|