Browse Source

提交工具函数位置调整

wenmenghao321 1 year ago
parent
commit
0bba53b9a6

+ 23 - 23
src/web/staticres/common-module/dataExport/components/popup-data-export.js

@@ -44,7 +44,7 @@ Vue.component('popup-data-export', {
       url:this_.isWX ? '/front/dataExport/getDontPromptAgain' : '/jyapp/front/dataExport/getDontPromptAgain',
       success: function (res) { 
         if(!res){return}
-        this.isPrompt = res.isPrompt
+        this_.isPrompt = res.isPrompt
        },
       error: function (error) {
       }
@@ -96,7 +96,7 @@ Vue.component('popup-data-export', {
     next(){
       this.$emit('next',{choose:this.choose})
     },
-    setDontPrompt: this.debounce(function(){
+    setDontPrompt: debounce_(function(){
       let this_ = this
       let url_ = this.isWX ? '/front/dataExport/setDontPromptAgain' : '/jyapp/front/dataExport/setDontPromptAgain'
       if(this.choose){
@@ -136,27 +136,27 @@ Vue.component('popup-data-export', {
         }
       }
     },
-    debounce: function (func, delay, immediate){
-      var timer = null;
-      delay = delay || 200
-      return function() {
-          var context = this;
-          var args = arguments;
-          if(timer) clearTimeout(timer);
-          if(immediate){
-              var doNow = !timer;
-              timer = setTimeout(function(){
-                  timer = null;
-              },delay);
-              if(doNow){
-                  func.apply(context,args);
-              }
-          }else{
-              timer = setTimeout(function(){
-                  func.apply(context,args);
-              },delay);
+  }
+})
+function debounce_ (func, delay, immediate){
+  var timer = null;
+  delay = delay || 200
+  return function() {
+      var context = this;
+      var args = arguments;
+      if(timer) clearTimeout(timer);
+      if(immediate){
+          var doNow = !timer;
+          timer = setTimeout(function(){
+              timer = null;
+          },delay);
+          if(doNow){
+              func.apply(context,args);
           }
+      }else{
+          timer = setTimeout(function(){
+              func.apply(context,args);
+          },delay);
       }
   }
-  }
-})
+}