Forráskód Böngészése

refactor: 移除活动分类管理页面的蒙层背景图上传

配合后端删除 ht_activity_category.bg_image_url,PC 后台活动分类
管理页面同步移除蒙层上传、预览、相关 state 和方法。
Developer 3 napja
szülő
commit
bcd9e18437
1 módosított fájl, 3 hozzáadás és 29 törlés
  1. 3 29
      src/views/modules/activity/classify.vue

+ 3 - 29
src/views/modules/activity/classify.vue

@@ -20,7 +20,7 @@
             <el-table-column label="图标预览" width="140">
               <template #default="scope">
                 <div class="adfac" style="height: 64px;">
-                  <div class="classify-icon-preview" :style="scope.row.bgImageUrl?{backgroundImage:`url(${scope.row.bgImageUrl})`,backgroundSize:'100% 100%'}:{}">
+                  <div class="classify-icon-preview">
                     <img v-if="scope.row.iconUrl" :src="scope.row.iconUrl" style="width:32px;height:32px;">
                     <span v-else style="font-size:12px;color:#999;">无</span>
                   </div>
@@ -63,16 +63,6 @@
             </el-upload>
             <el-button v-if="fileListIcon.length" type="text" size="mini" style="margin-left:8px;color:#f56c6c;" @click="removeIcon">删除</el-button>
           </el-form-item>
-          <el-form-item label="蒙层背景" prop="bgImageUrl">
-            <el-upload :action="url" :show-file-list="false" :on-success="successHandleBg" :before-upload="beforeUploadBg" accept="image/*" class="classify-uploader">
-              <div v-if="fileListBg.length" class="classify-upload-preview">
-                <img :src="fileListBg[0].url" style="width:120px;height:120px;display:block;border-radius:50%;">
-              </div>
-              <i v-else class="el-icon-plus classify-uploader-icon"></i>
-              <div slot="tip" class="el-upload__tip">建议尺寸 240×240 圆形蒙层素材</div>
-            </el-upload>
-            <el-button v-if="fileListBg.length" type="text" size="mini" style="margin-left:8px;color:#f56c6c;" @click="removeBg">删除</el-button>
-          </el-form-item>
           <!-- <el-form-item label="分类编码" prop="categoryNo">
             <el-input v-model="form.categoryNo" placeholder="请输入分类编码"></el-input>
           </el-form-item> -->
@@ -106,14 +96,12 @@ export default {
       buttonLoading: false,
       title: '新增活动分类',
       fileListIcon: [],
-      fileListBg: [],
       form: {
         id: '',
         categoryName: '',
         categoryNo: '',
         enable: 1,
-        iconUrl: '',
-        bgImageUrl: ''
+        iconUrl: ''
       },
       rules: {
         categoryName: [
@@ -144,7 +132,6 @@ export default {
       this.title = '新增活动分类'
       this.show = true
       this.fileListIcon = []
-      this.fileListBg = []
       this.form.categoryNo = 'HDFL' + (this.dataList.length + 1).toString().padStart(2, '0')
     },
     handleEdit (row) {
@@ -152,7 +139,6 @@ export default {
         if (res.data.code !== 0) return this.$message.error(res.data.msg)
         this.form = { ...this.form, ...res.data.data }
         this.fileListIcon = this.form.iconUrl ? [{ name: '', url: this.form.iconUrl }] : []
-        this.fileListBg = this.form.bgImageUrl ? [{ name: '', url: this.form.bgImageUrl }] : []
         this.$nextTick(() => {
           this.title = '编辑活动分类'
           this.show = true
@@ -163,37 +149,25 @@ export default {
     cancel () {
       this.show = false
       this.fileListIcon = []
-      this.fileListBg = []
       this.form = {
         id: '',
         categoryName: '',
         categoryNo: '',
         enable: 1,
-        iconUrl: '',
-        bgImageUrl: ''
+        iconUrl: ''
       }
       this.$refs.typeRef.resetFields()
     },
     beforeUploadIcon (file) {},
-    beforeUploadBg (file) {},
     successHandleIcon (res) {
       if (!res || !res.data) return this.$message.error('图标上传失败')
       this.form.iconUrl = res.data
       this.fileListIcon = [{ name: '', url: res.data }]
     },
-    successHandleBg (res) {
-      if (!res || !res.data) return this.$message.error('背景图上传失败')
-      this.form.bgImageUrl = res.data
-      this.fileListBg = [{ name: '', url: res.data }]
-    },
     removeIcon () {
       this.form.iconUrl = ''
       this.fileListIcon = []
     },
-    removeBg () {
-      this.form.bgImageUrl = ''
-      this.fileListBg = []
-    },
     getList () {
       this.loading = true
       this.$http.get('/core/activity/category/page', { params: this.queryParams }).then(res => {