|
@@ -20,7 +20,7 @@
|
|
|
<el-table-column label="图标预览" width="140">
|
|
<el-table-column label="图标预览" width="140">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div class="adfac" style="height: 64px;">
|
|
<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;">
|
|
<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>
|
|
<span v-else style="font-size:12px;color:#999;">无</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -63,16 +63,6 @@
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
<el-button v-if="fileListIcon.length" type="text" size="mini" style="margin-left:8px;color:#f56c6c;" @click="removeIcon">删除</el-button>
|
|
<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>
|
|
|
- <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-form-item label="分类编码" prop="categoryNo">
|
|
|
<el-input v-model="form.categoryNo" placeholder="请输入分类编码"></el-input>
|
|
<el-input v-model="form.categoryNo" placeholder="请输入分类编码"></el-input>
|
|
|
</el-form-item> -->
|
|
</el-form-item> -->
|
|
@@ -106,14 +96,12 @@ export default {
|
|
|
buttonLoading: false,
|
|
buttonLoading: false,
|
|
|
title: '新增活动分类',
|
|
title: '新增活动分类',
|
|
|
fileListIcon: [],
|
|
fileListIcon: [],
|
|
|
- fileListBg: [],
|
|
|
|
|
form: {
|
|
form: {
|
|
|
id: '',
|
|
id: '',
|
|
|
categoryName: '',
|
|
categoryName: '',
|
|
|
categoryNo: '',
|
|
categoryNo: '',
|
|
|
enable: 1,
|
|
enable: 1,
|
|
|
- iconUrl: '',
|
|
|
|
|
- bgImageUrl: ''
|
|
|
|
|
|
|
+ iconUrl: ''
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
categoryName: [
|
|
categoryName: [
|
|
@@ -144,7 +132,6 @@ export default {
|
|
|
this.title = '新增活动分类'
|
|
this.title = '新增活动分类'
|
|
|
this.show = true
|
|
this.show = true
|
|
|
this.fileListIcon = []
|
|
this.fileListIcon = []
|
|
|
- this.fileListBg = []
|
|
|
|
|
this.form.categoryNo = 'HDFL' + (this.dataList.length + 1).toString().padStart(2, '0')
|
|
this.form.categoryNo = 'HDFL' + (this.dataList.length + 1).toString().padStart(2, '0')
|
|
|
},
|
|
},
|
|
|
handleEdit (row) {
|
|
handleEdit (row) {
|
|
@@ -152,7 +139,6 @@ export default {
|
|
|
if (res.data.code !== 0) return this.$message.error(res.data.msg)
|
|
if (res.data.code !== 0) return this.$message.error(res.data.msg)
|
|
|
this.form = { ...this.form, ...res.data.data }
|
|
this.form = { ...this.form, ...res.data.data }
|
|
|
this.fileListIcon = this.form.iconUrl ? [{ name: '', url: this.form.iconUrl }] : []
|
|
this.fileListIcon = this.form.iconUrl ? [{ name: '', url: this.form.iconUrl }] : []
|
|
|
- this.fileListBg = this.form.bgImageUrl ? [{ name: '', url: this.form.bgImageUrl }] : []
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.title = '编辑活动分类'
|
|
this.title = '编辑活动分类'
|
|
|
this.show = true
|
|
this.show = true
|
|
@@ -163,37 +149,25 @@ export default {
|
|
|
cancel () {
|
|
cancel () {
|
|
|
this.show = false
|
|
this.show = false
|
|
|
this.fileListIcon = []
|
|
this.fileListIcon = []
|
|
|
- this.fileListBg = []
|
|
|
|
|
this.form = {
|
|
this.form = {
|
|
|
id: '',
|
|
id: '',
|
|
|
categoryName: '',
|
|
categoryName: '',
|
|
|
categoryNo: '',
|
|
categoryNo: '',
|
|
|
enable: 1,
|
|
enable: 1,
|
|
|
- iconUrl: '',
|
|
|
|
|
- bgImageUrl: ''
|
|
|
|
|
|
|
+ iconUrl: ''
|
|
|
}
|
|
}
|
|
|
this.$refs.typeRef.resetFields()
|
|
this.$refs.typeRef.resetFields()
|
|
|
},
|
|
},
|
|
|
beforeUploadIcon (file) {},
|
|
beforeUploadIcon (file) {},
|
|
|
- beforeUploadBg (file) {},
|
|
|
|
|
successHandleIcon (res) {
|
|
successHandleIcon (res) {
|
|
|
if (!res || !res.data) return this.$message.error('图标上传失败')
|
|
if (!res || !res.data) return this.$message.error('图标上传失败')
|
|
|
this.form.iconUrl = res.data
|
|
this.form.iconUrl = res.data
|
|
|
this.fileListIcon = [{ name: '', url: 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 () {
|
|
removeIcon () {
|
|
|
this.form.iconUrl = ''
|
|
this.form.iconUrl = ''
|
|
|
this.fileListIcon = []
|
|
this.fileListIcon = []
|
|
|
},
|
|
},
|
|
|
- removeBg () {
|
|
|
|
|
- this.form.bgImageUrl = ''
|
|
|
|
|
- this.fileListBg = []
|
|
|
|
|
- },
|
|
|
|
|
getList () {
|
|
getList () {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
this.$http.get('/core/activity/category/page', { params: this.queryParams }).then(res => {
|
|
this.$http.get('/core/activity/category/page', { params: this.queryParams }).then(res => {
|