活动管理
This commit is contained in:
@@ -1,26 +1,32 @@
|
||||
<template>
|
||||
<ai-detail class="content-add">
|
||||
<template slot="title">
|
||||
<ai-title :title="params.id ? '编辑风险区域' : '添加风险区域'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
<ai-title :title="params.id ? '编辑活动' : '添加活动'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
</ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="基本信息">
|
||||
<template #content>
|
||||
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
|
||||
<el-form-item prop="areaId" style="width: 100%;" label="选择地区" :rules="[{required: true, message: '请选择地区', trigger: 'change'}]">
|
||||
<ai-area-select clearable @fullname="v => form.areaName = v" always-show :instance="instance" v-model="form.areaId"></ai-area-select>
|
||||
<el-form-item prop="title" style="width: 100%;" label="标题" :rules="[{required: true, message: '请输入活动标题', trigger: 'change'}]">
|
||||
<el-input size="small" placeholder="请输入活动标题" v-model="form.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="address" style="width: 100%;" label="详细地址">
|
||||
<el-input size="small" type="textarea" :rows="5" placeholder="请输入详细地址" v-model="form.address"></el-input>
|
||||
<el-form-item label="内容" prop="content" style="width: 100%;" :rules="[{required: true, message: '请输入内容', trigger: 'change'}]">
|
||||
<ai-editor v-model="form.content" :instance="instance"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="风险等级" style="width: 100%;" prop="level" :rules="[{required: true, message: '请选择风险等级', trigger: 'change'}]">
|
||||
<ai-select
|
||||
v-model="form.level"
|
||||
clearable
|
||||
placeholder="请选择风险等级"
|
||||
:selectList="dict.getDict('epidemicDangerousAreaLevel')">
|
||||
</ai-select>
|
||||
<el-form-item label="附件" prop="files" style="width: 100%;">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
v-model="form.files"
|
||||
fileType="file"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
<el-form-item prop="beginTime" style="width: 100%;" label="开始时间">
|
||||
<el-date-picker type="datetime" size="small" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择开始时间" v-model="form.beginTime"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="address" style="width: 100%;" label="结束时间">
|
||||
<el-date-picker type="datetime" size="small" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择结束时间" v-model="form.endTime"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
@@ -41,17 +47,17 @@
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
params: Object,
|
||||
moduleName: String
|
||||
params: Object
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
info: {},
|
||||
form: {
|
||||
level: '',
|
||||
areaId: '',
|
||||
areaName: '',
|
||||
address: ''
|
||||
title: '',
|
||||
content: '',
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
files: []
|
||||
},
|
||||
id: ''
|
||||
}
|
||||
@@ -62,17 +68,15 @@
|
||||
},
|
||||
|
||||
created () {
|
||||
this.dict.load('epidemicDangerousAreaLevel').then(() => {
|
||||
if (this.params && this.params.id) {
|
||||
this.id = this.params.id
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
})
|
||||
if (this.params && this.params.id) {
|
||||
this.id = this.params.id
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getInfo (id) {
|
||||
this.instance.post(`/app/appepidemicpreventionriskarea/queryDetailById?id=${id}`).then(res => {
|
||||
this.instance.post(`/app/appactivityinfo/queryDetailById?id=${id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data
|
||||
}
|
||||
@@ -82,7 +86,7 @@
|
||||
confirm () {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post(`/app/appepidemicpreventionriskarea/addOrUpdate`, {
|
||||
this.instance.post(`/app/appactivityinfo/addOrUpdate`, {
|
||||
...this.form
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
@@ -107,52 +111,4 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content-add {
|
||||
.video {
|
||||
width: 640px;
|
||||
height: 360px;
|
||||
border-radius: 4px;
|
||||
border: 1px dashed #D0D4DC;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.icon {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
span:nth-child(2) {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
font-size: 40px;
|
||||
color: #2266FF;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
line-height: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.video-com {
|
||||
width: 640px;
|
||||
height: 360px;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 2px;
|
||||
border: 1px solid #D0D4DC;
|
||||
margin-top: -40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user