From cf8a751fa16e30b13080bf0e7af2ff6c9df693a8 Mon Sep 17 00:00:00 2001
From: children117cl <278950112@qq.com>
Date: 星期三, 14 四月 2021 11:28:05 +0800
Subject: [PATCH] banner设置跳转类型为不跳转时,清空其余跳转字段

---
 src/pages/system/banner.vue |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/pages/system/banner.vue b/src/pages/system/banner.vue
index ff35688..7f2f5f7 100644
--- a/src/pages/system/banner.vue
+++ b/src/pages/system/banner.vue
@@ -58,10 +58,10 @@
     />
 
     <!-- 鏂板&缂栬緫 -->
-    <el-dialog :title="dialogData.type=='add'?'鏂板杞挱鍥�':'缂栬緫杞挱鍥�'" width="500px" :visible.sync="isShowDialog" append-to-body :before-close="hideDialog">
+    <el-dialog v-el-drag-dialog :title="dialogData.type=='add'?'鏂板杞挱鍥�':'缂栬緫杞挱鍥�'" width="500px" :visible.sync="isShowDialog" append-to-body :before-close="hideDialog" :close-on-click-modal="false">
       <el-form :ref="formName" :model="dialogData" label-width="120px" :rules="rules" size="small">
         <el-form-item label="鎺掑簭鍙凤細" prop="orderNum">
-          <el-input v-model="dialogData.orderNum" placeholder="璇疯緭鍏ユ帓搴忓彿" />
+          <el-input v-model="dialogData.orderNum" placeholder="璇疯緭鍏ユ帓搴忓彿" maxlength="10" />
         </el-form-item>
         <el-form-item ref="uploadFormItem" label="杞挱鍥撅細" prop="uploadImgs">
           <!-- 涓婁紶鍥剧墖缁勪欢(澶氬浘) -->
@@ -82,10 +82,10 @@
           </el-select>
         </el-form-item>
         <el-form-item v-if="dialogData.jumpType" label="璺宠浆閾炬帴锛�" prop="jumpUrl">
-          <el-input v-model="dialogData.jumpUrl" placeholder="璇疯緭鍏ヨ烦杞摼鎺�" class="com-edit-input" />
+          <el-input v-model="dialogData.jumpUrl" placeholder="璇疯緭鍏ヨ烦杞摼鎺�" class="com-edit-input" maxlength="100" />
         </el-form-item>
         <el-form-item v-if="dialogData.jumpType===3" label="appId锛�" prop="jumpMpId">
-          <el-input v-model="dialogData.jumpMpId" placeholder="璇疯緭鍏ュ皬绋嬪簭appId" class="com-edit-input" />
+          <el-input v-model="dialogData.jumpMpId" placeholder="璇疯緭鍏ュ皬绋嬪簭appId" class="com-edit-input" maxlength="50" />
         </el-form-item>
         <el-form-item v-if="dialogData.jumpType===3" label="灏忕▼搴忕増鏈細" prop="envVersion">
           <el-select
@@ -93,12 +93,13 @@
             clearable
             placeholder="璇烽�夋嫨灏忕▼搴忕増鏈�"
             class="com-edit-input"
+            @change="handleJumpTypeChange"
           >
             <el-option v-for="item in envVersionOpt" :key="item.value" :label="item.label" :value="item.value" />
           </el-select>
         </el-form-item>
         <el-form-item v-if="dialogData.jumpType===3" label="棰濆鏁版嵁锛�" prop="extraData">
-          <el-input v-model="dialogData.extraData" placeholder="璇疯緭鍏ュ皬绋嬪簭棰濆鏁版嵁" class="com-edit-input" />
+          <el-input v-model="dialogData.extraData" placeholder="璇疯緭鍏ュ皬绋嬪簭棰濆鏁版嵁" class="com-edit-input" maxlength="50" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -247,6 +248,15 @@
     handleEdit(item) {
       this.showDialog('edit', item)
     },
+    // 璺宠浆绫诲瀷涓恒�愪笉璺宠浆銆戞椂锛屾竻绌哄叾浣欒烦杞瓧娈�
+    handleJumpTypeChange() {
+      if (this.dialogData.jumpType === 0) {
+        this.dialogData.jumpUrl = ''
+        this.dialogData.jumpMpId = ''
+        this.dialogData.envVersion = ''
+        this.dialogData.extraData = ''
+      }
+    },
     // 鏄剧ず寮规
     showDialog(type, item) {
       let dialogData = {}

--
Gitblit v1.8.0