Browse Source

Merge branch 'dev-web-optimize' of http://git.info666.com/infrared_remote/admin_web into dev-web-optimize

wangzihao 1 year ago
parent
commit
b50a6fa987
1 changed files with 18 additions and 1 deletions
  1. 18 1
      ruoyi-ui/src/views/template/addTemplate/blocks/detailDialog.vue

+ 18 - 1
ruoyi-ui/src/views/template/addTemplate/blocks/detailDialog.vue

@@ -35,7 +35,7 @@
         <div class="box-canvs">
           <div class="box-canvs-main" :style="{ backgroundImage: `url(${fromData.backgroundPictureUrl?baseUrl+fromData.backgroundPictureUrl:''})` }">
             <grid-layout 
-              :key="pageArray.length"
+              :key="pageArray.length+'_'+layoutKey"
               :layout.sync="pageArray"
               :col-num="6"
               :row-height="30"
@@ -52,6 +52,7 @@
               <grid-item 
                 v-for="(item, index) in pageArray"
                 :key="index+'_'+item.h+'_'+item.w"
+                :is-bounded="false"
                 :x="Number(item.x)"
                 :y="Number(item.y)"
                 :w="Number(item.w)"
@@ -102,6 +103,7 @@
                 :config="btnClassConfig"
                 label-position="left"
                 :column="1"
+                @blur="handleBlur"
               />
             </el-tab-pane>
           </el-tabs>
@@ -143,6 +145,7 @@ export default {
 
   data() {
     return {
+      layoutKey:0,
       // tab
       activeName: 'second',
       cpnsList,
@@ -189,6 +192,7 @@ export default {
           label: '宽度',
           attrs: {
             placeholder: '请输入宽度',
+            type: 'number'
           }
         },
         {
@@ -197,6 +201,7 @@ export default {
           label: '高度',
           attrs: {
             placeholder: '请输入高度',
+            type: 'number'
           }
         }
       ]
@@ -277,9 +282,21 @@ export default {
     }
   },
   methods: {
+    // focus事件
+    handleBlur(item,form) {
+      console.log(form)
+      const { prop } = item
+      if (['h', 'w'].includes(prop)) {
+        form[prop] = Number(form[prop])
+        this.$nextTick(() => {
+          this.layoutKey++
+        })
+      }
+    },
     // 显示弹窗
     show() {
       this.fromDataConfig = formConfig.call(this)
+      this.currentCpn='';
       this.$refs.dialog.show();
     },
     // 初始化表单数据