乡村相册
This commit is contained in:
@@ -8,22 +8,21 @@
|
||||
<ai-card title="基本信息">
|
||||
<template #content>
|
||||
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
|
||||
<el-form-item label="相册名称" style="width: 100%;" prop="title" :rules="[{required: true, message: '请输入标题', trigger: 'blur'}]">
|
||||
<el-input type="input" size="small" v-model="form.title" clearable placeholder="请输入..." maxlength="30" show-word-limit></el-input>
|
||||
<el-form-item label="相册主题" style="width: 100%;" prop="type" :rules="[{required: true, message: '请输入标题', trigger: 'blur'}]">
|
||||
<ai-select
|
||||
v-model="form.type"
|
||||
placeholder="请选择相册主题"
|
||||
:selectList="dict.getDict('villagePictureAlbumType')">
|
||||
</ai-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="areaId" style="width: 100%;" label="发布地区" :rules="[{required: true, message: '请选择地区', trigger: 'change'}]">
|
||||
<ai-area-select clearable always-show :instance="instance" v-model="form.areaId" :disabled-level="disabledLevel"></ai-area-select>
|
||||
<ai-area-select @fullname="v => form.areaName = v" clearable always-show :instance="instance" v-model="form.areaId" :disabled-level="disabledLevel"></ai-area-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="相册主题" style="width: 100%;" prop="title" :rules="[{required: true, message: '请输入标题', trigger: 'blur'}]">
|
||||
<el-input type="input" size="small" v-model="form.title" clearable placeholder="请输入..." maxlength="30" show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片" style="width: 100%;" prop="thumbUrl">
|
||||
<el-form-item label="图片" style="width: 100%;" prop="urlList">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
isShowTip
|
||||
v-model="form.thumbUrl"
|
||||
:limit="20"
|
||||
:cropOps="cropOps">
|
||||
v-model="form.urlList"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -52,13 +51,9 @@
|
||||
return {
|
||||
info: {},
|
||||
form: {
|
||||
title: '',
|
||||
content: '',
|
||||
areaName: '',
|
||||
areaId: '',
|
||||
createUnitName: '',
|
||||
createUserName: '',
|
||||
status: '',
|
||||
thumbUrl: []
|
||||
urlList: []
|
||||
},
|
||||
cropOps: {
|
||||
width: "336px",
|
||||
@@ -75,6 +70,7 @@
|
||||
created () {
|
||||
this.form.areaId = this.user.info.areaId
|
||||
this.disabledLevel = this.user.info.areaList.length
|
||||
this.dict.load(['villagePictureAlbumType'])
|
||||
if (this.params && this.params.id) {
|
||||
this.id = this.params.id
|
||||
this.getInfo(this.params.id)
|
||||
@@ -86,7 +82,6 @@
|
||||
this.instance.post(`/app/appcountrysidetourism/queryDetailById?id=${id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data
|
||||
this.form.thumbUrl = res.data.thumbUrl ? JSON.parse(res.data.thumbUrl) : []
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -94,13 +89,10 @@
|
||||
confirm () {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post(`/app/appcountrysidetourism/addOrUpdate`, {
|
||||
this.instance.post(`/app/appvillagepicturealbum/addPictures`, {
|
||||
...this.form,
|
||||
type: 0,
|
||||
createUserName: this.user.info.name,
|
||||
thumbUrl: this.form.thumbUrl.length ? JSON.stringify([{
|
||||
url: this.form.thumbUrl[0].url
|
||||
}]) : ''
|
||||
id: this.params.id,
|
||||
urlList: this.form.urlList.map(v => v.url)
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('提交成功')
|
||||
|
||||
Reference in New Issue
Block a user