Kaynağa Gözat

修复搜索重复问题

yezehua 6 yıl önce
ebeveyn
işleme
f0c73cc735
1 değiştirilmiş dosya ile 7 ekleme ve 9 silme
  1. 7 9
      component/guidance/person-panel.js

+ 7 - 9
component/guidance/person-panel.js

@ -1,7 +1,7 @@
Vue.component('person-panel', {
    template: '<div class="ml20 mr20"">\
					<div class="search-warp">\
						<input class="inp-search" placeholder="查找模板" v-model="filter" @input="throttledTempList()"/>\
						<input class="inp-search" placeholder="查找模板" v-model="filter" @input="debounceTempList"/>\
					</div>\
					<div ref="innerPanel" style="overflow-y: auto;">\
						<div class="list-arrow-r temp-item" v-for="(o, i) in items">\
@ -50,14 +50,12 @@ Vue.component('person-panel', {
		vm.guidanceTempList()
    },
    methods: {
    	throttledTempList: function() {
    		return _.throttle(function() {
    			var vm = this
	    		vm.pageNo = 1
	    		vm.items = []
	    		this.guidanceTempList()
    		}, 300).call(this)
    	},
    	debounceTempList: _.debounce(function() {
			var vm = this
    		vm.pageNo = 1
    		vm.items = []
    		this.guidanceTempList()
		}, 500, false),
        guidanceTempList: function() {
        	var vm = this
        	guidanceAPI.guidanceTempList( {