6ec243d6
wuxw
v1.9 点击提交后,成功提示没有...
|
1
|
<template>
|
5760f7b9
wuxw
小区下的功能修改完成
|
2
|
<el-card class="add-publicity-container">
|
0fb08017
wuxw
物品放行功能测试完成
|
3
|
<div slot="header" class="flex justify-between">
|
5760f7b9
wuxw
小区下的功能修改完成
|
4
|
<span>{{ $t('addCommunityPublicity.title') }}</span>
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
5
|
<el-button style="float: right; padding: 3px 0" type="text" @click="goBack">
|
5760f7b9
wuxw
小区下的功能修改完成
|
6
7
8
9
10
11
12
|
<i class="el-icon-close"></i>{{ $t('addCommunityPublicity.back') }}
</el-button>
</div>
<el-form ref="form" :model="formData" label-width="120px">
<el-row :gutter="20">
<el-col :span="12">
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
13
|
<el-form-item :label="$t('addCommunityPublicity.pubTitle')" prop="title"
|
5760f7b9
wuxw
小区下的功能修改完成
|
14
|
:rules="[{ required: true, message: $t('addCommunityPublicity.requiredTitle'), trigger: 'blur' }]">
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
15
|
<el-input v-model="formData.title" :placeholder="$t('addCommunityPublicity.requiredTitle')" clearable>
|
5760f7b9
wuxw
小区下的功能修改完成
|
16
17
18
19
|
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
20
|
<el-form-item :label="$t('addCommunityPublicity.pubType')" prop="pubType"
|
5760f7b9
wuxw
小区下的功能修改完成
|
21
|
:rules="[{ required: true, message: $t('addCommunityPublicity.requiredType'), trigger: 'change' }]">
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
22
|
<el-select v-model="formData.pubType" :placeholder="$t('addCommunityPublicity.requiredType')"
|
5760f7b9
wuxw
小区下的功能修改完成
|
23
|
style="width: 100%">
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
24
|
<el-option v-for="item in pubTypes" :key="item.statusCd" :label="item.name" :value="item.statusCd">
|
5760f7b9
wuxw
小区下的功能修改完成
|
25
26
27
28
29
30
|
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
31
|
<el-form-item :label="$t('addCommunityPublicity.headerPhoto')" prop="headerImg"
|
5760f7b9
wuxw
小区下的功能修改完成
|
32
|
:rules="[{ required: true, message: $t('addCommunityPublicity.requiredHeaderPhoto'), trigger: 'change' }]">
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
33
|
<upload-image-url ref="uploadImage" :image-count="1" @notifyUploadCoverImage="handleImageUpload">
|
5760f7b9
wuxw
小区下的功能修改完成
|
34
35
36
|
</upload-image-url>
</el-form-item>
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
37
|
<el-form-item :label="$t('addCommunityPublicity.activityContent')" prop="context"
|
5760f7b9
wuxw
小区下的功能修改完成
|
38
|
:rules="[{ required: true, message: $t('addCommunityPublicity.requiredContent'), trigger: 'blur' }]">
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
39
|
<rich-text-editor v-model="formData.context" :height="300"
|
5760f7b9
wuxw
小区下的功能修改完成
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
:placeholder="$t('addCommunityPublicity.requiredContent')">
</rich-text-editor>
</el-form-item>
<el-form-item class="text-right">
<el-button @click="goBack">{{ $t('addCommunityPublicity.back') }}</el-button>
<el-button type="primary" @click="submitForm">{{ $t('addCommunityPublicity.submit') }}</el-button>
</el-form-item>
</el-form>
</el-card>
</template>
<script>
import UploadImageUrl from '@/components/upload/UploadImageUrl'
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
54
55
|
import { saveCommunityPublicity } from '@/api/community/addCommunityPublicityApi'
import { getCommunityId, getDict } from '@/api/community/communityApi'
|
5760f7b9
wuxw
小区下的功能修改完成
|
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
import richTextEditor from '@/components/editor/RichTextEditor'
export default {
name: 'AddCommunityPublicity',
components: {
UploadImageUrl,
richTextEditor
},
data() {
return {
formData: {
title: '',
pubType: '',
headerImg: '',
context: ''
},
pubTypes: []
}
},
created() {
this.getPublicityTypes()
},
methods: {
async getPublicityTypes() {
try {
const data = await getDict('community_publicity', 'pub_type')
this.pubTypes = data
} catch (error) {
console.error('Failed to get publicity types:', error)
this.$message.error(this.$t('addCommunityPublicity.fetchTypesFailed'))
}
},
handleImageUpload(images) {
if (images.length > 0) {
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
90
|
this.formData.headerImg = images[0] || images[0]
|
5760f7b9
wuxw
小区下的功能修改完成
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
} else {
this.formData.headerImg = ''
}
},
submitForm() {
this.$refs.form.validate(valid => {
if (valid) {
this.savePublicity()
} else {
return false
}
})
},
async savePublicity() {
try {
this.formData.communityId = getCommunityId()
const response = await saveCommunityPublicity(this.formData)
if (response.code === 0) {
|
6ec243d6
wuxw
v1.9 点击提交后,成功提示没有...
|
109
|
this.$message.success(this.$t('common.operationSuccess'))
|
5760f7b9
wuxw
小区下的功能修改完成
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
this.goBack()
} else {
this.$message.error(response.msg || this.$t('addCommunityPublicity.saveFailed'))
}
} catch (error) {
console.error('Save publicity error:', error)
this.$message.error(this.$t('addCommunityPublicity.saveFailed'))
}
},
goBack() {
this.$router.go(-1)
}
}
}
</script>
<style scoped>
.add-publicity-container {
margin: 20px;
}
|
911b5549
wuxw
修改平凉客户 反馈的bug 修复
|
130
|
|
5760f7b9
wuxw
小区下的功能修改完成
|
131
132
133
134
|
.text-right {
text-align: right;
}
</style>
|