From 3ca1b14fc6db3e845a8109730d82a337143b567e Mon Sep 17 00:00:00 2001
From: liweilong <515897141@qq.com>
Date: 星期三, 02 十二月 2020 15:55:05 +0800
Subject: [PATCH] 轮播图

---
 src/pages/system/banner.vue |   77 ++++++++++++++++++++++++++++++++------
 1 files changed, 64 insertions(+), 13 deletions(-)

diff --git a/src/pages/system/banner.vue b/src/pages/system/banner.vue
index b60e9fd..f22319e 100644
--- a/src/pages/system/banner.vue
+++ b/src/pages/system/banner.vue
@@ -1,4 +1,4 @@
-// 璁惧绠$悊
+// 杞挱鍥剧鐞�
 <template>
   <div class="app-container">
     <!-- 鎿嶄綔鍖� 鈫撯啌鈫撯啌鈫撯啌鈫撯啌鈫撯啌 -->
@@ -22,8 +22,13 @@
           <el-image :src="scope.row.imgUrl" style="width:80px;height:80px" fit="contain" :preview-src-list="[scope.row.imgUrl]" />
         </template>
       </el-table-column>
-      <el-table-column prop="orderNum" label="鎺掑簭鍙�" align="center" min-width="120" />
-      <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" align="center" />
+      <el-table-column prop="jumpType" label="璺宠浆绫诲瀷" align="center" min-width="120">
+        <template slot-scope="scope">
+          {{ ['涓嶈烦杞�','灏忕▼搴忛〉闈�','H5椤甸潰','鍏朵粬灏忕▼搴�'][scope.row.jumpType] }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="orderNum" label="鎺掑簭鍙�" align="center" />
+      <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" align="center" min-width="120" />
       <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" min-width="100">
         <template slot-scope="scope">
           <el-button
@@ -54,11 +59,11 @@
 
     <!-- 鏂板&缂栬緫 -->
     <el-dialog :title="dialogData.type=='add'?'鏂板杞挱鍥�':'缂栬緫杞挱鍥�'" width="500px" :visible.sync="isShowDialog" append-to-body :before-close="hideDialog">
-      <el-form :ref="formName" :model="dialogData" label-width="100px" :rules="rules" size="small">
-        <el-form-item label="鎺掑簭鍙�" prop="orderNum">
+      <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-form-item>
-        <el-form-item ref="uploadFormItem" label="杞挱鍥�" prop="uploadImgs">
+        <el-form-item ref="uploadFormItem" label="杞挱鍥撅細" prop="uploadImgs">
           <!-- 涓婁紶鍥剧墖缁勪欢(鍗曞浘) -->
           <el-upload
             ref="refUploadImg"
@@ -78,6 +83,35 @@
             <i class="el-icon-plus" />
           </el-upload>
         </el-form-item>
+        <el-form-item label="璺宠浆绫诲瀷锛�" prop="jumpType">
+          <el-select
+            v-model="dialogData.jumpType"
+            clearable
+            placeholder="璇烽�夋嫨璺宠浆绫诲瀷"
+            class="com-edit-input"
+          >
+            <el-option v-for="item in jumpTypeOpt" :key="item.value" :label="item.label" :value="item.value" />
+          </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-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-form-item>
+        <el-form-item v-if="dialogData.jumpType===3" label="灏忕▼搴忕増鏈細" prop="envVersion">
+          <el-select
+            v-model="dialogData.envVersion"
+            clearable
+            placeholder="璇烽�夋嫨灏忕▼搴忕増鏈�"
+            class="com-edit-input"
+          >
+            <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-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="hideDialog">鍙栨秷</el-button>
@@ -95,10 +129,10 @@
 <script>
 
 import mixin_Upload from '@/mixins/upload.js'
-
+import mixin_bannerOpts from '@/mixins/bannerOpts.js' // 閫氱敤杞挱鍥句笅鎷夐�夐」
 export default {
   name: 'Equipment',
-  mixins: [mixin_Upload],
+  mixins: [mixin_Upload, mixin_bannerOpts],
   data() {
     return {
       list: [], // 璁惧鍒楄〃
@@ -118,7 +152,19 @@
           { required: true, message: '鎺掑簭鍙蜂笉鑳戒负绌�', trigger: 'change' }
         ],
         uploadImgs: [
-          { required: true, message: '璇烽�夋嫨杞挱鍥剧墖', trigger: 'change' }
+          { required: true, message: '杞挱鍥剧墖涓嶈兘涓虹┖', trigger: 'change' }
+        ],
+        jumpType: [
+          { required: true, message: '璺宠浆绫诲瀷涓嶈兘涓虹┖', trigger: 'change' }
+        ],
+        jumpUrl: [
+          { required: true, message: '璺宠浆閾炬帴涓嶈兘涓虹┖', trigger: 'change' }
+        ],
+        jumpMpId: [
+          { required: true, message: '璺宠浆灏忕▼搴廰ppId涓嶈兘涓虹┖', trigger: 'change' }
+        ],
+        envVersion: [
+          { required: true, message: '璺宠浆灏忕▼搴忕増鏈笉鑳戒负绌�', trigger: 'change' }
         ]
       },
 
@@ -144,7 +190,6 @@
   methods: {
     // 鍒濆鍖�
     init() {
-      // this.id = this.$route.query.id || ''
       this.getList()
     },
 
@@ -166,7 +211,7 @@
     delUploadImg(file, fileList) {
       this.dialogData.uploadImgs = fileList
     },
-    // 鎵ц涓婁紶鍟嗗搧鍥�
+    // 鎵ц涓婁紶鍥�
     runUploadImg(suc_cb) {
       if (this.checkNeedUpload(this.dialogData.uploadImgs)) {
         this.$refs.refUploadImg.submit()
@@ -174,7 +219,7 @@
         suc_cb && suc_cb()
       }
     },
-    // 涓婁紶鍟嗗搧鍥�
+    // 涓婁紶鍥�
     uploadImg(res) {
       console.log(res)
       const file = res.file
@@ -317,8 +362,14 @@
       const dialogData = this.dialogData
       const params = {
         orderNum: dialogData.orderNum,
-        imgUrl: dialogData.imgUrl
+        imgUrl: dialogData.imgUrl,
+        jumpType: dialogData.jumpType
       }
+      if (dialogData.jumpUrl) params.jumpUrl = dialogData.jumpUrl
+      if (dialogData.jumpMpId) params.jumpMpId = dialogData.jumpMpId
+      if (dialogData.envVersion) params.envVersion = dialogData.envVersion
+      if (dialogData.extraData) params.extraData = dialogData.extraData
+
       if (dialogData.type === 'edit') {
         params.id = dialogData.id
       }

--
Gitblit v1.8.0