Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

liu.shiyi 1 yıl önce
ebeveyn
işleme
9087318352

+ 20 - 1
data-room-ui/packages/BasicComponents/Input/index.vue

@@ -15,6 +15,7 @@
       class="input"
       :placeholder="config.customize.placeholderStyle.placeholder"
       :style="{ backgroundColor: config.customize.backgroundStyle.backgroundColor }"
+      @input="handleInput"
     >
       <i
         v-if="config.customize.icon.position === 'left' && config.customize.icon.name"
@@ -48,7 +49,9 @@ export default {
     }
   },
   data () {
-    return { }
+    return {
+      timer: null
+    }
   },
   watch: {
     'config.customize': {
@@ -61,6 +64,10 @@ export default {
   mounted () {
     this.chartInit()
   },
+  beforeDestroy () {
+    // 销毁时清除定时器
+    clearTimeout(this.timer)
+  },
   methods: {
     changeStyle (config, isUpdateTheme) {
       config = { ...this.config, ...config }
@@ -86,6 +93,18 @@ export default {
           this.changeActiveItemConfig(config)
         }
       }
+    },
+    handleInput (val) {
+      // 提供一个防抖的方法
+      this.debounce(() => {
+        this.linkage({ [this.config.code]: val })
+      })
+    },
+    debounce (fn, delay = 500) {
+      clearTimeout(this.timer)
+      this.timer = setTimeout(() => {
+        fn()
+      }, delay)
     }
   }
 }

+ 6 - 5
data-room-ui/packages/BasicComponents/Input/settingConfig.js

@@ -1,12 +1,13 @@
 
-import { commonConfig } from 'data-room-ui/js/config'
+import { commonConfig, displayOption } from 'data-room-ui/js/config'
 
 export const settingConfig = {
+  title: '输入框',
   displayOption: {
-    dataAllocation: {
-      // 是否存在数据配置
-      enable: false
-    }
+    ...displayOption,
+    dataAllocation: { enable: true },
+    dataSourceType: { enable: false },
+    params: { enable: false }
   }
 }
 const customConfig = {

+ 2 - 15
data-room-ui/packages/BigScreenDesign/RightSetting/ComponentRelation/RelationSetting.vue

@@ -45,23 +45,10 @@
           </template>
         </el-table-column>
         <el-table-column
-          label="操作符"
+          label="映射规则"
           align="center"
         >
-          <template #default="scope">
-            <el-select
-              v-model="configMapConfig.maps[scope.$index].queryRule"
-              popper-class="bs-el-select"
-              class="bs-el-select"
-            >
-              <el-option
-                v-for="operator in operatorList"
-                :key="operator.value"
-                :label="operator.label"
-                :value="operator.value"
-              />
-            </el-select>
-          </template>
+          <span>等于</span>
         </el-table-column>
         <el-table-column
           label="目标组件接收参数"

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

@@ -674,7 +674,7 @@ export default {
         value: field.name || field.fieldName
       })) || []
 
-      if (this.config.type === 'timePicker') {
+      if (['input', 'timePicker', 'dateTimePicker'].includes(this.config.type)) {
         modifiedList.push({ label: '当前组件值', value: this.config.code })
       }
       return modifiedList

+ 1 - 1
data-room-ui/packages/js/config/basicComponentsConfig.js

@@ -26,7 +26,7 @@ const typeList = [
   'screenScrollBoard',
   'video',
   'input',
-  'button',
+  // 'button',
   'marquee',
   'chartTab',
   'themeSwitcher',

+ 3 - 1
data-room-ui/packages/js/mixins/commonMixins.js

@@ -185,7 +185,9 @@ export default {
         }).catch(err => {
           console.info(err)
         }).finally(() => {
-          config.loading = false
+          if (config) {
+            config.loading = false
+          }
           resolve(config)
         })
       })

+ 12 - 12
data-room-ui/packages/js/utils/getComponentConfig.js

@@ -188,18 +188,18 @@ export default function getComponentConfig (type) {
         y: 0,
         type
       }
-    case 'button':
-      return {
-        name: '按钮',
-        title: '按钮',
-        icon: Icon.getNameList()[14],
-        className: 'com.gccloud.dataroom.core.module.chart.components.ScreenButtonChart',
-        w: 80,
-        h: 40,
-        x: 0,
-        y: 0,
-        type
-      }
+    // case 'button':
+    //   return {
+    //     name: '按钮',
+    //     title: '按钮',
+    //     icon: Icon.getNameList()[14],
+    //     className: 'com.gccloud.dataroom.core.module.chart.components.ScreenButtonChart',
+    //     w: 80,
+    //     h: 40,
+    //     x: 0,
+    //     y: 0,
+    //     type
+    //   }
     case 'marquee':
       return {
         name: '跑马灯',