轮播图
This commit is contained in:
		| @@ -44,7 +44,7 @@ | |||||||
|     <!-- 添加的模态框 --> |     <!-- 添加的模态框 --> | ||||||
|     <ai-dialog :title="dialog.title" :visible.sync="visible" @onCancel="visible = false" @onConfirm="addConfirm" |     <ai-dialog :title="dialog.title" :visible.sync="visible" @onCancel="visible = false" @onConfirm="addConfirm" | ||||||
|                width="800px"> |                width="800px"> | ||||||
|       <el-form class="ai-form" ref="ruleForm" :model="dialogInfo" :rules="formRules" size="small" label-width="100px"> |       <el-form class="ai-form" ref="form" :model="dialogInfo" :rules="formRules" size="small" label-width="100px"> | ||||||
|         <!-- 首页封面 --> |         <!-- 首页封面 --> | ||||||
|         <el-form-item style="width: 100%;" label="首页封面" prop="imgUrl"> |         <el-form-item style="width: 100%;" label="首页封面" prop="imgUrl"> | ||||||
|           <ai-uploader v-model="dialogInfo.imgUrl" @change="change" :instance="instance" :limit="1"></ai-uploader> |           <ai-uploader v-model="dialogInfo.imgUrl" @change="change" :instance="instance" :limit="1"></ai-uploader> | ||||||
| @@ -71,27 +71,23 @@ | |||||||
|  |  | ||||||
|     <!-- 详情的模态框 --> |     <!-- 详情的模态框 --> | ||||||
|     <ai-dialog title="详情" :visible.sync="detailDialog" customFooter width="800px"> |     <ai-dialog title="详情" :visible.sync="detailDialog" customFooter width="800px"> | ||||||
|       <!--  --> |       <ai-wrapper label-width="80px" :columnsNumber="1"> | ||||||
|       <el-form ref="ruleForm" :model="dialogInfo" :rules="formRules" size="small" label-width="100px"> |         <ai-info-item label="首页封面"> | ||||||
|         <ai-wrapper label-width="80px" :columnsNumber="1"> |           <span><img :src="dialogInfo.imgUrl" alt="" style="width:100px;height:100px;"/></span> | ||||||
|           <ai-info-item label="首页封面"> |         </ai-info-item> | ||||||
|             <span><img :src="dialogInfo.imgUrl" alt="" style="width:100px;height:100px;"/></span> |         <ai-info-item label="活动名称"> | ||||||
|           </ai-info-item> |           <span>{{ dialogInfo.title }}</span> | ||||||
|           <ai-info-item label="活动名称"> |         </ai-info-item> | ||||||
|             <span>{{ dialogInfo.title }}</span> |         <ai-info-item label="链接类型"> | ||||||
|           </ai-info-item> |           <span>{{ this.dict.getLabel('bannerType', dialogInfo.type) }}</span> | ||||||
|           <ai-info-item label="链接类型"> |         </ai-info-item> | ||||||
|             <span>{{ this.dict.getLabel('bannerType', dialogInfo.type) }}</span> |         <ai-info-item label="链接"> | ||||||
|           </ai-info-item> |           <span>{{ dialogInfo.linkUrl }}</span> | ||||||
|           <ai-info-item label="链接"> |         </ai-info-item> | ||||||
|             <span>{{ dialogInfo.linkUrl }}</span> |         <ai-info-item label="位置"> | ||||||
|           </ai-info-item> |           <span>{{ this.dict.getLabel('bannerPosition', dialogInfo.position) }}</span> | ||||||
|           <ai-info-item label="位置"> |         </ai-info-item> | ||||||
|             <span>{{ this.dict.getLabel('bannerPosition', dialogInfo.position) }}</span> |       </ai-wrapper> | ||||||
|           </ai-info-item> |  | ||||||
|         </ai-wrapper> |  | ||||||
|       </el-form> |  | ||||||
|  |  | ||||||
|       <div class="dialog-footer" slot="footer"> |       <div class="dialog-footer" slot="footer"> | ||||||
|         <el-button @click="detailDialog=false">关闭</el-button> |         <el-button @click="detailDialog=false">关闭</el-button> | ||||||
|       </div> |       </div> | ||||||
| @@ -141,10 +137,10 @@ export default { | |||||||
|       }, |       }, | ||||||
|       // fileList: '', |       // fileList: '', | ||||||
|       formRules: { |       formRules: { | ||||||
|         imgUrl: [{required: true, message: '请添加图片', trigger: 'blur'}], |         imgUrl: [{required: true, message: '请添加图片', trigger: 'change'}], | ||||||
|         title: [{required: true, message: '请输入活动名称', trigger: 'blur'}], |         title: [{required: true, message: '请输入活动名称', trigger: 'blur'}], | ||||||
|         type: [{required: true, trigger: 'blur'}], |         type: [{required: true, message: '请选择链接类型', trigger: 'change'}], | ||||||
|         // linkUrl: [{ required: true, message: '请输入链接', trigger: 'blur' }] |         position: [{required: true, message: '请选择位置', trigger: 'change'}] | ||||||
|       }, |       }, | ||||||
|       colConfigs: [ |       colConfigs: [ | ||||||
|         {prop: 'imgUrl', label: '首页封面', slot: 'imgUrl'}, |         {prop: 'imgUrl', label: '首页封面', slot: 'imgUrl'}, | ||||||
| @@ -229,22 +225,23 @@ export default { | |||||||
|     }, |     }, | ||||||
|     // 确定新增 |     // 确定新增 | ||||||
|     addConfirm() { |     addConfirm() { | ||||||
|       // console.log('确定') |       this.$refs.form.validate((valid) => { | ||||||
|       this.instance |         if (valid) { | ||||||
|       .post(`/app/appbanner/addOrUpdate`, { |           this.instance.post(`/app/appbanner/addOrUpdate`, { | ||||||
|         imgUrl: this.dialogInfo.imgUrl[0].url, |             imgUrl: this.dialogInfo.imgUrl[0].url, | ||||||
|         linkUrl: this.dialogInfo.linkUrl, |             linkUrl: this.dialogInfo.linkUrl, | ||||||
|         status: this.status, |             status: this.status, | ||||||
|         title: this.dialogInfo.title, |             title: this.dialogInfo.title, | ||||||
|         type: this.dialogInfo.type, |             type: this.dialogInfo.type, | ||||||
|         id: this.dialogInfo.id, |             id: this.dialogInfo.id, | ||||||
|         position: this.dialogInfo.position |             position: this.dialogInfo.position | ||||||
|       }) |           }).then(res => { | ||||||
|       .then(res => { |             if (res?.code == 0) { | ||||||
|         if (res?.code == 0) { |               this.$message.success('新增成功') | ||||||
|           this.$message.success('新增成功') |               this.visible = false | ||||||
|           this.visible = false |               this.getList() | ||||||
|           this.getList() |             } | ||||||
|  |           }) | ||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user