王志国
4 weeks ago
11 changed files with 3121 additions and 3046 deletions
@ -1,2 +1,9 @@ |
|||||
export const overPagePrint="overPage_print" |
export const overPagePrint="overPage_print" |
||||
export const overPageTemplate="overPage_Template" |
export const overPageTemplate="overPage_Template" |
||||
|
//3分钟刷新
|
||||
|
export const planRefreshTime=3*60*1000 |
||||
|
|
||||
|
export const issueJobFilter="issue_job_filter" |
||||
|
export const repleinshJobFilter="repleinsh_job_filter" |
||||
|
export const overPackageJobFilter="over_package_job_filter" |
||||
|
export const productionReceiptJobFilter="production_receipt_job_filter" |
@ -0,0 +1,44 @@ |
|||||
|
// 防止处理多次点击
|
||||
|
function noMultipleClicks(methods, info) { |
||||
|
// methods是需要点击后需要执行的函数, info是点击需要传的参数
|
||||
|
let that = this; |
||||
|
if (that.noClick) { |
||||
|
// 第一次点击
|
||||
|
that.noClick= false; |
||||
|
if(info && info !== '') { |
||||
|
// info是执行函数需要传的参数
|
||||
|
methods(info); |
||||
|
} else { |
||||
|
methods(); |
||||
|
} |
||||
|
let timer = setTimeout(()=> { |
||||
|
that.noClick= true; |
||||
|
clearTimeout(timer) |
||||
|
}, 2000) |
||||
|
} else { |
||||
|
// 这里是重复点击的判断
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 节流函数
|
||||
|
const throttle = (fn, t,_this) => { |
||||
|
console.log('throttle') |
||||
|
return ()=> { |
||||
|
if (!_this.timer) { |
||||
|
_this.timer = setTimeout(()=>{ |
||||
|
console.log('fn') |
||||
|
//·清空定时器
|
||||
|
_this.timer = null |
||||
|
}, t) |
||||
|
fn() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//导出
|
||||
|
export default { |
||||
|
noMultipleClicks,//禁止多次点击
|
||||
|
throttle |
||||
|
} |
Loading…
Reference in new issue