Bläddra i källkod

fix:优化外链刷新机制,添加防抖功能

liu.tao3 1 år sedan
förälder
incheckning
fe859245db
1 ändrade filer med 13 tillägg och 1 borttagningar
  1. 13 1
      data-room-ui/packages/BigScreenDesign/RightSetting/index.vue

+ 13 - 1
data-room-ui/packages/BigScreenDesign/RightSetting/index.vue

@@ -131,10 +131,22 @@ export default {
     ...mapMutations('bigScreen', [
       'saveTimeLine'
     ]),
+    debounce (delay,obj) {
+      if (this.timeout) {
+        clearTimeout(this.timeout)
+      }
+      this.timeout = setTimeout(() => {
+        this.$emit('updateSetting', { ...obj })
+      }, delay)
+    },
     handleConfigChange (val, oldValue, type) {
       if (!_.isEqual(val, oldValue)) {
         if (type === 'configStyle') {
-          this.$emit('updateSetting', { ...val, type: this.config.type, code: this.config.code })
+          if(this.config.type==='iframeChart'){
+            this.debounce(500,{ ...val, type: this.config.type, code: this.config.code })
+          }else{
+            this.$emit('updateSetting', { ...val, type: this.config.type, code: this.config.code })
+          }
         } else {
           this.$emit('updateDataSetting', this.config)
         }