Commit 04fa10e1 authored by zhangderong's avatar zhangderong

节流

parent a9cbc267
......@@ -373,6 +373,7 @@ import qs from 'qs'
import {
sapi
} from '../../config'
import{_debounce,_throttle} from '../../service/util.js'
import localStorage from '../../service/localstorage.service'
import Router from 'vue-router';
import ckeditor from '../../components/ckeditor'
......@@ -1331,21 +1332,30 @@ import ckeditor from '../../components/ckeditor'
this.uploadFileList=[]
this.SouSuo(this.pageT)
},
getEditorValue(value){
this.emailContent=value
this.sad = value
// if(this.sad==''){this.$Notice.error({
// title: '提示',
// desc: '正文不能为空'
// });
// }
// if(this.emailContent==''){
// this.isDisable=false
// getEditorValue(value){
// this.emailContent=value
// this.sad = value
// // if(this.sad==''){this.$Notice.error({
// // title: '提示',
// // desc: '正文不能为空'
// // });
// // }
// // if(this.emailContent==''){
// // this.isDisable=false
// }else{
// this.isDisable=true
// }
},
// // }else{
// // this.isDisable=true
// // }
// },
getEditorValue: _debounce(() => {
this.emailContent=this.sad
this.sad = value
if(this.emailContent==''){
this.isDisable=false
}else{
this.isDisable=true
}
}),
delateFile(index){
this.fileList.splice(index,1)
this.uploadFileList.splice(index,1)
......
......@@ -365,6 +365,7 @@ import {adoptOneSeeResumeList, serchList,downloadone,sousuoList,seedetail,PASS,O
import {
sapi
} from '../../config'
import{_debounce,_throttle} from '../../service/util.js'
import ckeditor from '../../components/ckeditor'
import localStorage from '../../service/localstorage.service'
export default {
......@@ -1224,19 +1225,28 @@ export default {
this.uploadFileList=[]
this.SouSuo(this.pageT)
},
getEditorValue(value){
this.emailContent=value
// getEditorValue(value){
// this.emailContent=value
// this.sad = value
// // if(this.emailContent==''){
// // this.isDisable=false
// // this.$Notice.error({
// // title: '提示',
// // desc: '请填写完整的信息'
// // });
// // }else{
// // this.isDisable=true
// // }
// },
getEditorValue: _debounce(() => {
this.emailContent=this.sad
this.sad = value
// if(this.emailContent==''){
// this.isDisable=false
// this.$Notice.error({
// title: '提示',
// desc: '请填写完整的信息'
// });
// }else{
// this.isDisable=true
// }
},
if(this.emailContent==''){
this.isDisable=false
}else{
this.isDisable=true
}
}),
delateFile(index){
this.fileList.splice(index,1)
this.uploadFileList.splice(index,1)
......
export function _debounce (fn, delay) {
let timer = null
delay = delay || 200
return function () {
let args = arguments
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(function () {
timer = null
fn.apply(this, args)
}.bind(this), delay)
}
}
export function _throttle (fn, interval) {
let last = null
let timer = null
interval = interval || 200
return function () {
let self = this
let args = arguments
let now = +new Date()
if (last && now - last < interval) {
clearTimeout(timer)
timer = setTimeout(function () {
last = now
fn.apply(self, args)
}, interval)
} else {
last = now
fn.apply(self, args)
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment