乡村相册

This commit is contained in:
yanran200730
2021-12-20 16:16:55 +08:00
parent b70dba7144
commit 354750e04a
3 changed files with 28 additions and 225 deletions

View File

@@ -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('提交成功')

View File

@@ -9,26 +9,17 @@
<ai-select
v-model="search.status"
@change="search.current = 1, getList()"
placeholder="项目状态"
:selectList="dict.getDict('questionnaireStatus')">
placeholder="请选择相册主题"
:selectList="dict.getDict('villagePictureAlbumType')">
</ai-select>
<ai-select
v-model="search.type"
@change="search.current = 1, getList()"
placeholder="项目类型"
:selectList="dict.getDict('questionnaireType')">
</ai-select>
</template>
<template #right>
<el-input
v-model="search.title"
<el-date-picker
v-model="search.timeTag"
type="month"
size="small"
placeholder="请输入模板名称或创建人"
clearable
@keyup.enter.native="search.current = 1, getList()"
@clear="search.current = 1, search.title = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
@change="search.current = 1, getList()"
value-format="yyyy-MM"
placeholder="请选择日期">
</el-date-picker>
</template>
</ai-search-bar>
<div v-loading="loading">
@@ -101,7 +92,8 @@
current: 1,
areaId: '',
size: 1000000,
title: ''
title: '',
timeTag: ''
},
isShowAdd: false,
form: {
@@ -120,7 +112,7 @@
created () {
this.loading = true
this.search.areaId = this.user.info.areaId
this.dict.load(['questionnaireStatus', 'questionnaireType', 'questionnaireFieldType']).then(() => {
this.dict.load(['villagePictureAlbumType']).then(() => {
this.getList()
})
},

View File

@@ -1,181 +0,0 @@
export const components = [
{
type: 'options',
tips: '(可重复添加)',
label: '选项',
children: [
{
type: 'radio',
label: '单选',
fixedLabel: '单选',
value: '',
points: '',
icon: 'iconradio',
isShowPoints: false,
required: true,
hasAnswer: false,
answer: '',
pointType: '0',
pointDict: [
{
dictName: '此题有唯一答案和分值',
dictValue: '0'
},
{
dictName: '每个选项都有对应分值',
dictValue: '1'
}
],
options: [
{
label: '选项1',
value: '',
point: '',
img: []
},
{
label: '选项2',
value: '',
point: '',
img: []
}
],
title: ''
},
{
type: 'checkbox',
label: '多选',
fixedLabel: '多选',
points: '',
icon: 'iconcheck_box',
isShowPoints: false,
required: true,
hasAnswer: false,
answer: [],
value: [],
pointType: '0',
pointDict: [
{
dictName: '此题有唯一答案和分值',
dictValue: '0'
},
{
dictName: '每个选项都有对应分值',
dictValue: '1'
},
{
dictName: '答对几项得几分,答错不得分',
dictValue: '2'
}
],
options: [
{
label: '选项1',
value: '',
point: '',
img: []
},
{
label: '选项2',
point: '',
value: '',
img: []
}
],
title: ''
},
{
type: 'select',
label: '单下拉框',
fixedLabel: '单下拉框',
value: '',
points: '',
icon: 'iconSelect',
isShowPoints: false,
required: true,
hasAnswer: false,
answer: '',
pointType: '0',
pointDict: [
{
dictName: '此题有唯一答案和分值',
dictValue: '0'
},
{
dictName: '每个选项都有对应分值',
dictValue: '1'
}
],
options: [
{
label: '选项1',
value: '',
point: '',
img: []
},
{
label: '选项2',
value: '',
point: '',
img: []
}
],
title: ''
}
]
},
{
type: 'input',
tips: '(可重复添加)',
label: '填空',
children: [
{
type: 'input',
label: '单行填空',
fixedLabel: '单行填空',
value: '',
pointType: '0',
icon: 'icontext_box',
isShowPoints: false,
points: '',
required: true,
hasAnswer: false,
placeholder: '请输入...',
answer: ''
},
{
type: 'textarea',
label: '多行填空',
fixedLabel: '多行填空',
pointType: '0',
icon: 'icontext_area',
points: '',
isShowPoints: false,
required: true,
hasAnswer: false,
answer: '',
placeholder: '请输入...',
value: ''
}
]
},
{
type: 'annex',
tips: '(可重复添加)',
label: '附件',
children: [
{
type: 'upload',
label: '上传图片',
fixedLabel: '上传图片',
value: '',
icon: 'iconpic',
isShowPoints: false,
points: '',
required: true,
hasAnswer: false,
answer: ''
}
]
}
];