From 9f32bd5b0217473d0b0eb819b7a49d64bbcd3db6 Mon Sep 17 00:00:00 2001 From: liweilong <515897141@qq.com> Date: 星期三, 02 十二月 2020 15:49:27 +0800 Subject: [PATCH] 优化轮播图管理 --- src/pages/system/banner.vue | 66 ++++++++++++++++++++++++++++----- 1 files changed, 56 insertions(+), 10 deletions(-) diff --git a/src/pages/system/banner.vue b/src/pages/system/banner.vue index b60e9fd..7e06244 100644 --- a/src/pages/system/banner.vue +++ b/src/pages/system/banner.vue @@ -54,11 +54,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 +78,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 +124,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 +147,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 +185,6 @@ methods: { // 鍒濆鍖� init() { - // this.id = this.$route.query.id || '' this.getList() }, @@ -166,7 +206,7 @@ delUploadImg(file, fileList) { this.dialogData.uploadImgs = fileList }, - // 鎵ц涓婁紶鍟嗗搧鍥� + // 鎵ц涓婁紶鍥� runUploadImg(suc_cb) { if (this.checkNeedUpload(this.dialogData.uploadImgs)) { this.$refs.refUploadImg.submit() @@ -174,7 +214,7 @@ suc_cb && suc_cb() } }, - // 涓婁紶鍟嗗搧鍥� + // 涓婁紶鍥� uploadImg(res) { console.log(res) const file = res.file @@ -317,8 +357,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