Commit 70492aa4f5f508ae2e370ab9382d471f6ea01541
1 parent
c9bc8893
通知发送
Showing
17 changed files
with
1563 additions
and
8 deletions
src/api/oa/activitiesManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 3 | + | |
| 4 | +// 获取活动列表 | |
| 5 | +export function listActivities(params) { | |
| 6 | + return new Promise((resolve, reject) => { | |
| 7 | + request({ | |
| 8 | + url: '/activities.listActivitiess', | |
| 9 | + method: 'get', | |
| 10 | + params: { | |
| 11 | + ...params, | |
| 12 | + communityId: getCommunityId() | |
| 13 | + } | |
| 14 | + }).then(response => { | |
| 15 | + const res = response.data | |
| 16 | + resolve({ | |
| 17 | + data: res.activitiess, | |
| 18 | + total: res.total | |
| 19 | + }) | |
| 20 | + }).catch(error => { | |
| 21 | + reject(error) | |
| 22 | + }) | |
| 23 | + }) | |
| 24 | +} | |
| 25 | + | |
| 26 | +// 获取活动详情 | |
| 27 | +export function getActivitiesDetail(params) { | |
| 28 | + return new Promise((resolve, reject) => { | |
| 29 | + request({ | |
| 30 | + url: '/activities.listActivitiess', | |
| 31 | + method: 'get', | |
| 32 | + params: { | |
| 33 | + ...params, | |
| 34 | + communityId: getCommunityId() | |
| 35 | + } | |
| 36 | + }).then(response => { | |
| 37 | + const res = response.data | |
| 38 | + resolve(res) | |
| 39 | + }).catch(error => { | |
| 40 | + reject(error) | |
| 41 | + }) | |
| 42 | + }) | |
| 43 | +} | |
| 44 | + | |
| 45 | +// 添加活动 | |
| 46 | +export function saveActivities(data) { | |
| 47 | + return new Promise((resolve, reject) => { | |
| 48 | + request({ | |
| 49 | + url: '/activities.saveActivities', | |
| 50 | + method: 'post', | |
| 51 | + data: { | |
| 52 | + ...data, | |
| 53 | + communityId: getCommunityId() | |
| 54 | + } | |
| 55 | + }).then(response => { | |
| 56 | + const res = response.data | |
| 57 | + resolve(res) | |
| 58 | + }).catch(error => { | |
| 59 | + reject(error) | |
| 60 | + }) | |
| 61 | + }) | |
| 62 | +} | |
| 63 | + | |
| 64 | +// 更新活动 | |
| 65 | +export function updateActivities(data) { | |
| 66 | + return new Promise((resolve, reject) => { | |
| 67 | + request({ | |
| 68 | + url: '/activities.updateActivities', | |
| 69 | + method: 'post', | |
| 70 | + data: { | |
| 71 | + ...data, | |
| 72 | + communityId: getCommunityId() | |
| 73 | + } | |
| 74 | + }).then(response => { | |
| 75 | + const res = response.data | |
| 76 | + resolve(res) | |
| 77 | + }).catch(error => { | |
| 78 | + reject(error) | |
| 79 | + }) | |
| 80 | + }) | |
| 81 | +} | |
| 82 | + | |
| 83 | +// 删除活动 | |
| 84 | +export function deleteActivities(params) { | |
| 85 | + return new Promise((resolve, reject) => { | |
| 86 | + request({ | |
| 87 | + url: '/activities.deleteActivities', | |
| 88 | + method: 'post', | |
| 89 | + data: { | |
| 90 | + ...params, | |
| 91 | + communityId: getCommunityId() | |
| 92 | + } | |
| 93 | + }).then(response => { | |
| 94 | + const res = response.data | |
| 95 | + resolve(res) | |
| 96 | + }).catch(error => { | |
| 97 | + reject(error) | |
| 98 | + }) | |
| 99 | + }) | |
| 100 | +} | |
| 101 | + | |
| 102 | +// 获取活动类型列表 | |
| 103 | +export function listActivitiesType(params) { | |
| 104 | + return new Promise((resolve, reject) => { | |
| 105 | + request({ | |
| 106 | + url: '/activitiesType/queryActivitiesType', | |
| 107 | + method: 'get', | |
| 108 | + params: { | |
| 109 | + ...params, | |
| 110 | + communityId: getCommunityId() | |
| 111 | + } | |
| 112 | + }).then(response => { | |
| 113 | + const res = response.data | |
| 114 | + resolve({ | |
| 115 | + data: res.data | |
| 116 | + }) | |
| 117 | + }).catch(error => { | |
| 118 | + reject(error) | |
| 119 | + }) | |
| 120 | + }) | |
| 121 | +} | |
| 122 | + | |
| 123 | +// 上传图片 | |
| 124 | +export function uploadImage(data) { | |
| 125 | + return new Promise((resolve, reject) => { | |
| 126 | + request({ | |
| 127 | + url: '/uploadFile/uploadImage', | |
| 128 | + method: 'post', | |
| 129 | + data, | |
| 130 | + headers: { | |
| 131 | + 'Content-Type': 'multipart/form-data' | |
| 132 | + } | |
| 133 | + }).then(response => { | |
| 134 | + const res = response.data | |
| 135 | + resolve(res) | |
| 136 | + }).catch(error => { | |
| 137 | + reject(error) | |
| 138 | + }) | |
| 139 | + }) | |
| 140 | +} | |
| 0 | 141 | \ No newline at end of file | ... | ... |
src/api/oa/activitiesTypeManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 3 | + | |
| 4 | +// 查询活动类型列表 | |
| 5 | +export function queryActivitiesType(params) { | |
| 6 | + return new Promise((resolve, reject) => { | |
| 7 | + request({ | |
| 8 | + url: '/activitiesType/queryActivitiesType', | |
| 9 | + method: 'get', | |
| 10 | + params: { | |
| 11 | + ...params, | |
| 12 | + communityId: getCommunityId() | |
| 13 | + } | |
| 14 | + }).then(response => { | |
| 15 | + const res = response.data | |
| 16 | + resolve(res) | |
| 17 | + }).catch(error => { | |
| 18 | + reject(error) | |
| 19 | + }) | |
| 20 | + }) | |
| 21 | +} | |
| 22 | + | |
| 23 | +// 添加活动类型 | |
| 24 | +export function saveActivitiesType(data) { | |
| 25 | + return new Promise((resolve, reject) => { | |
| 26 | + request({ | |
| 27 | + url: '/activitiesType/saveActivitiesType', | |
| 28 | + method: 'post', | |
| 29 | + data: { | |
| 30 | + ...data, | |
| 31 | + communityId: getCommunityId() | |
| 32 | + } | |
| 33 | + }).then(response => { | |
| 34 | + const res = response.data | |
| 35 | + resolve(res) | |
| 36 | + }).catch(error => { | |
| 37 | + reject(error) | |
| 38 | + }) | |
| 39 | + }) | |
| 40 | +} | |
| 41 | + | |
| 42 | +// 更新活动类型 | |
| 43 | +export function updateActivitiesType(data) { | |
| 44 | + return new Promise((resolve, reject) => { | |
| 45 | + request({ | |
| 46 | + url: '/activitiesType/updateActivitiesType', | |
| 47 | + method: 'post', | |
| 48 | + data: { | |
| 49 | + ...data, | |
| 50 | + communityId: getCommunityId() | |
| 51 | + } | |
| 52 | + }).then(response => { | |
| 53 | + const res = response.data | |
| 54 | + resolve(res) | |
| 55 | + }).catch(error => { | |
| 56 | + reject(error) | |
| 57 | + }) | |
| 58 | + }) | |
| 59 | +} | |
| 60 | + | |
| 61 | +// 删除活动类型 | |
| 62 | +export function deleteActivitiesType(data) { | |
| 63 | + return new Promise((resolve, reject) => { | |
| 64 | + request({ | |
| 65 | + url: '/activitiesType/deleteActivitiesType', | |
| 66 | + method: 'post', | |
| 67 | + data: { | |
| 68 | + ...data, | |
| 69 | + communityId: getCommunityId() | |
| 70 | + } | |
| 71 | + }).then(response => { | |
| 72 | + const res = response.data | |
| 73 | + resolve(res) | |
| 74 | + }).catch(error => { | |
| 75 | + reject(error) | |
| 76 | + }) | |
| 77 | + }) | |
| 78 | +} | |
| 0 | 79 | \ No newline at end of file | ... | ... |
src/components/admin/AddAdvert.vue
| ... | ... | @@ -12,33 +12,36 @@ |
| 12 | 12 | </el-form-item> |
| 13 | 13 | |
| 14 | 14 | <el-form-item :label="$t('advertManage.add.locationTypeCd')" prop="locationTypeCd"> |
| 15 | - <el-select v-model="form.locationTypeCd" :placeholder="$t('advertManage.add.locationPlaceholder')" style="width: 100%;"> | |
| 15 | + <el-select v-model="form.locationTypeCd" :placeholder="$t('advertManage.add.locationPlaceholder')" | |
| 16 | + style="width: 100%;"> | |
| 16 | 17 | <el-option v-for="item in locationOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| 17 | 18 | </el-select> |
| 18 | 19 | </el-form-item> |
| 19 | 20 | |
| 20 | 21 | <el-form-item :label="$t('advertManage.add.advertType')" prop="advertType"> |
| 21 | - <el-select v-model="form.advertType" :placeholder="$t('advertManage.add.advertTypePlaceholder')" style="width: 100%;"> | |
| 22 | + <el-select v-model="form.advertType" :placeholder="$t('advertManage.add.advertTypePlaceholder')" | |
| 23 | + style="width: 100%;"> | |
| 22 | 24 | <el-option v-for="item in advertTypeOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| 23 | 25 | </el-select> |
| 24 | 26 | </el-form-item> |
| 25 | 27 | |
| 26 | 28 | <el-form-item :label="$t('advertManage.add.pageUrl')"> |
| 27 | - <el-input v-model="form.pageUrl" :placeholder="$t('advertManage.add.pageUrlPlaceholder')" style="width: 100%;"/> | |
| 29 | + <el-input v-model="form.pageUrl" :placeholder="$t('advertManage.add.pageUrlPlaceholder')" style="width: 100%;" /> | |
| 28 | 30 | </el-form-item> |
| 29 | 31 | |
| 30 | 32 | <el-form-item :label="$t('advertManage.add.seq')" prop="seq"> |
| 31 | - <el-input v-model="form.seq" :placeholder="$t('advertManage.add.seqPlaceholder')" style="width: 100%;"/> | |
| 33 | + <el-input v-model="form.seq" :placeholder="$t('advertManage.add.seqPlaceholder')" style="width: 100%;" /> | |
| 32 | 34 | </el-form-item> |
| 33 | 35 | |
| 34 | 36 | <el-form-item :label="$t('advertManage.add.startTime')" prop="startTime"> |
| 35 | 37 | <el-date-picker v-model="form.startTime" type="datetime" |
| 36 | - :placeholder="$t('advertManage.add.startTimePlaceholder')" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;"/> | |
| 38 | + :placeholder="$t('advertManage.add.startTimePlaceholder')" value-format="yyyy-MM-dd HH:mm:ss" | |
| 39 | + style="width: 100%;" /> | |
| 37 | 40 | </el-form-item> |
| 38 | 41 | |
| 39 | 42 | <el-form-item :label="$t('advertManage.add.endTime')" prop="endTime"> |
| 40 | - <el-date-picker v-model="form.endTime" type="datetime" :placeholder="$t('advertManage.add.endTimePlaceholder')" style="width: 100%;" | |
| 41 | - value-format="yyyy-MM-dd HH:mm:ss" /> | |
| 43 | + <el-date-picker v-model="form.endTime" type="datetime" :placeholder="$t('advertManage.add.endTimePlaceholder')" | |
| 44 | + style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" /> | |
| 42 | 45 | </el-form-item> |
| 43 | 46 | |
| 44 | 47 | <el-form-item :label="$t('advertManage.add.viewType')" prop="viewType"> |
| ... | ... | @@ -83,7 +86,7 @@ export default { |
| 83 | 86 | viewType: '8888', |
| 84 | 87 | adTypeCd: '20000', |
| 85 | 88 | locationObjId: '-1', |
| 86 | - vedioName:'', | |
| 89 | + vedioName: '', | |
| 87 | 90 | photos: [] |
| 88 | 91 | }, |
| 89 | 92 | rules: { | ... | ... |
src/components/oa/addActivitiesType.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('activitiesTypeManage.add.title')" :visible.sync="visible" width="50%" @close="handleClose"> | |
| 3 | + <el-form ref="form" :model="formData" :rules="rules" label-width="120px"> | |
| 4 | + <el-form-item :label="$t('activitiesTypeManage.add.typeName')" prop="typeName"> | |
| 5 | + <el-input v-model="formData.typeName" :placeholder="$t('activitiesTypeManage.add.typeNamePlaceholder')" /> | |
| 6 | + </el-form-item> | |
| 7 | + <el-form-item :label="$t('activitiesTypeManage.add.typeDesc')" prop="typeDesc"> | |
| 8 | + <el-input v-model="formData.typeDesc" :placeholder="$t('activitiesTypeManage.add.typeDescPlaceholder')" /> | |
| 9 | + </el-form-item> | |
| 10 | + <el-form-item :label="$t('activitiesTypeManage.add.seq')" prop="seq"> | |
| 11 | + <el-input v-model="formData.seq" :placeholder="$t('activitiesTypeManage.add.seqPlaceholder')" /> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item :label="$t('activitiesTypeManage.add.defaultShow')" prop="defaultShow"> | |
| 14 | + <el-select v-model="formData.defaultShow" :placeholder="$t('activitiesTypeManage.add.defaultShowPlaceholder')" | |
| 15 | + style="width:100%"> | |
| 16 | + <el-option :label="$t('common.yes')" value="Y" /> | |
| 17 | + <el-option :label="$t('common.no')" value="N" /> | |
| 18 | + </el-select> | |
| 19 | + </el-form-item> | |
| 20 | + </el-form> | |
| 21 | + <span slot="footer" class="dialog-footer"> | |
| 22 | + <el-button @click="visible = false"> | |
| 23 | + {{ $t('common.cancel') }} | |
| 24 | + </el-button> | |
| 25 | + <el-button type="primary" @click="handleSubmit"> | |
| 26 | + {{ $t('common.confirm') }} | |
| 27 | + </el-button> | |
| 28 | + </span> | |
| 29 | + </el-dialog> | |
| 30 | +</template> | |
| 31 | + | |
| 32 | +<script> | |
| 33 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 34 | +import { saveActivitiesType } from '@/api/oa/activitiesTypeManageApi' | |
| 35 | + | |
| 36 | +export default { | |
| 37 | + name: 'AddActivitiesType', | |
| 38 | + data() { | |
| 39 | + return { | |
| 40 | + visible: false, | |
| 41 | + formData: { | |
| 42 | + typeName: '', | |
| 43 | + typeDesc: '', | |
| 44 | + seq: '', | |
| 45 | + defaultShow: '', | |
| 46 | + communityId: '' | |
| 47 | + }, | |
| 48 | + rules: { | |
| 49 | + typeName: [ | |
| 50 | + { required: true, message: this.$t('activitiesTypeManage.validate.typeNameRequired'), trigger: 'blur' }, | |
| 51 | + { max: 100, message: this.$t('activitiesTypeManage.validate.typeNameMaxLength'), trigger: 'blur' } | |
| 52 | + ], | |
| 53 | + typeDesc: [ | |
| 54 | + { max: 500, message: this.$t('activitiesTypeManage.validate.typeDescMaxLength'), trigger: 'blur' } | |
| 55 | + ], | |
| 56 | + seq: [ | |
| 57 | + { required: true, message: this.$t('activitiesTypeManage.validate.seqRequired'), trigger: 'blur' }, | |
| 58 | + ], | |
| 59 | + defaultShow: [ | |
| 60 | + { required: true, message: this.$t('activitiesTypeManage.validate.defaultShowRequired'), trigger: 'change' } | |
| 61 | + ] | |
| 62 | + } | |
| 63 | + } | |
| 64 | + }, | |
| 65 | + methods: { | |
| 66 | + open() { | |
| 67 | + this.visible = true | |
| 68 | + this.formData.communityId = getCommunityId() | |
| 69 | + this.$nextTick(() => { | |
| 70 | + this.$refs.form && this.$refs.form.resetFields() | |
| 71 | + }) | |
| 72 | + }, | |
| 73 | + handleClose() { | |
| 74 | + this.$refs.form.resetFields() | |
| 75 | + }, | |
| 76 | + handleSubmit() { | |
| 77 | + this.$refs.form.validate(async valid => { | |
| 78 | + if (valid) { | |
| 79 | + try { | |
| 80 | + await saveActivitiesType({ | |
| 81 | + ...this.formData, | |
| 82 | + seq: Number(this.formData.seq) | |
| 83 | + }) | |
| 84 | + this.$message.success(this.$t('activitiesTypeManage.add.success')) | |
| 85 | + this.visible = false | |
| 86 | + this.$emit('success') | |
| 87 | + } catch (error) { | |
| 88 | + this.$message.error(this.$t('activitiesTypeManage.add.error')) | |
| 89 | + } | |
| 90 | + } | |
| 91 | + }) | |
| 92 | + } | |
| 93 | + } | |
| 94 | +} | |
| 95 | +</script> | |
| 0 | 96 | \ No newline at end of file | ... | ... |
src/components/oa/addActivitiesView.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('activitiesManage.add.title')" :visible.sync="dialogVisible" width="70%" @close="handleClose"> | |
| 3 | + <el-form ref="form" :model="form" label-width="120px" :rules="rules"> | |
| 4 | + <el-form-item :label="$t('activitiesManage.add.title')" prop="title"> | |
| 5 | + <el-input v-model="form.title" :placeholder="$t('activitiesManage.add.titlePlaceholder')" /> | |
| 6 | + </el-form-item> | |
| 7 | + <el-form-item :label="$t('activitiesManage.add.typeCd')" prop="typeCd"> | |
| 8 | + <el-select v-model="form.typeCd" :placeholder="$t('activitiesManage.add.typeCdPlaceholder')" style="width:100%"> | |
| 9 | + <el-option v-for="item in typeCds" :key="item.typeCd" :label="item.typeName" :value="item.typeCd" /> | |
| 10 | + </el-select> | |
| 11 | + </el-form-item> | |
| 12 | + <el-form-item :label="$t('activitiesManage.add.isMoreCommunity')"> | |
| 13 | + <el-select v-model="form.isMoreCommunity" :placeholder="$t('activitiesManage.add.isMoreCommunityPlaceholder')" | |
| 14 | + style="width:100%"> | |
| 15 | + <el-option :label="$t('common.yes')" value="Y" /> | |
| 16 | + <el-option :label="$t('common.no')" value="N" /> | |
| 17 | + </el-select> | |
| 18 | + </el-form-item> | |
| 19 | + <el-form-item :label="$t('activitiesManage.add.headerImg')" prop="headerImg"> | |
| 20 | + <upload-image-url ref="uploadImage" :limit="1" @notifyUploadCoverImage="handleImageChange" /> | |
| 21 | + | |
| 22 | + </el-form-item> | |
| 23 | + <el-form-item :label="$t('activitiesManage.add.startTime')" prop="startTime"> | |
| 24 | + <el-date-picker v-model="form.startTime" type="datetime" | |
| 25 | + :placeholder="$t('activitiesManage.add.startTimePlaceholder')" style="width:100%" | |
| 26 | + value-format="yyyy-MM-dd HH:mm:ss" /> | |
| 27 | + </el-form-item> | |
| 28 | + <el-form-item :label="$t('activitiesManage.add.endTime')" prop="endTime"> | |
| 29 | + <el-date-picker v-model="form.endTime" type="datetime" | |
| 30 | + :placeholder="$t('activitiesManage.add.endTimePlaceholder')" style="width:100%" | |
| 31 | + value-format="yyyy-MM-dd HH:mm:ss" /> | |
| 32 | + </el-form-item> | |
| 33 | + <el-form-item :label="$t('activitiesManage.add.context')" prop="context"> | |
| 34 | + <rich-text-editor ref="richTextEditor" v-model="form.context" /> | |
| 35 | + </el-form-item> | |
| 36 | + </el-form> | |
| 37 | + <span slot="footer" class="dialog-footer"> | |
| 38 | + <el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button> | |
| 39 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.submit') }}</el-button> | |
| 40 | + </span> | |
| 41 | + </el-dialog> | |
| 42 | +</template> | |
| 43 | + | |
| 44 | +<script> | |
| 45 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 46 | +import { saveActivities, listActivitiesType } from '@/api/oa/activitiesManageApi' | |
| 47 | +import UploadImageUrl from '@/components/upload/UploadImageUrl' | |
| 48 | +import RichTextEditor from "@/components/editor/RichTextEditor"; | |
| 49 | + | |
| 50 | +export default { | |
| 51 | + name: 'AddActivitiesView', | |
| 52 | + components: { | |
| 53 | + UploadImageUrl, | |
| 54 | + RichTextEditor | |
| 55 | + }, | |
| 56 | + data() { | |
| 57 | + return { | |
| 58 | + dialogVisible: false, | |
| 59 | + form: { | |
| 60 | + title: '', | |
| 61 | + typeCd: '', | |
| 62 | + headerImg: '', | |
| 63 | + context: '', | |
| 64 | + startTime: '', | |
| 65 | + endTime: '', | |
| 66 | + isMoreCommunity: '', | |
| 67 | + communityId: '' | |
| 68 | + }, | |
| 69 | + typeCds: [], | |
| 70 | + rules: { | |
| 71 | + title: [ | |
| 72 | + { required: true, message: this.$t('activitiesManage.validate.titleRequired'), trigger: 'blur' }, | |
| 73 | + { max: 200, message: this.$t('activitiesManage.validate.titleMaxLength'), trigger: 'blur' } | |
| 74 | + ], | |
| 75 | + typeCd: [ | |
| 76 | + { required: true, message: this.$t('activitiesManage.validate.typeCdRequired'), trigger: 'change' } | |
| 77 | + ], | |
| 78 | + headerImg: [ | |
| 79 | + { required: true, message: this.$t('activitiesManage.validate.headerImgRequired'), trigger: 'change' } | |
| 80 | + ], | |
| 81 | + context: [ | |
| 82 | + { required: true, message: this.$t('activitiesManage.validate.contextRequired'), trigger: 'blur' } | |
| 83 | + ], | |
| 84 | + startTime: [ | |
| 85 | + { required: true, message: this.$t('activitiesManage.validate.startTimeRequired'), trigger: 'change' } | |
| 86 | + ], | |
| 87 | + endTime: [ | |
| 88 | + { required: true, message: this.$t('activitiesManage.validate.endTimeRequired'), trigger: 'change' } | |
| 89 | + ] | |
| 90 | + } | |
| 91 | + } | |
| 92 | + }, | |
| 93 | + methods: { | |
| 94 | + open() { | |
| 95 | + this.dialogVisible = true | |
| 96 | + this.$nextTick(() => { | |
| 97 | + this.$refs.form && this.$refs.form.resetFields() | |
| 98 | + this.$refs.uploadImage && this.$refs.uploadImage.clearImages() | |
| 99 | + this.loadActivitiesType() | |
| 100 | + }) | |
| 101 | + }, | |
| 102 | + async loadActivitiesType() { | |
| 103 | + try { | |
| 104 | + const params = { | |
| 105 | + page: 1, | |
| 106 | + row: 50, | |
| 107 | + communityId: getCommunityId() | |
| 108 | + } | |
| 109 | + const { data } = await listActivitiesType(params) | |
| 110 | + this.typeCds = data | |
| 111 | + } catch (error) { | |
| 112 | + console.error('获取活动类型失败:', error) | |
| 113 | + } | |
| 114 | + }, | |
| 115 | + handleImageChange(images) { | |
| 116 | + this.form.headerImg = images.length > 0 ? images[0] : '' | |
| 117 | + }, | |
| 118 | + async handleSubmit() { | |
| 119 | + this.$refs.form.validate(async valid => { | |
| 120 | + if (valid) { | |
| 121 | + try { | |
| 122 | + this.form.communityId = getCommunityId() | |
| 123 | + await saveActivities(this.form) | |
| 124 | + this.$message.success(this.$t('common.saveSuccess')) | |
| 125 | + this.dialogVisible = false | |
| 126 | + this.$emit('success') | |
| 127 | + } catch (error) { | |
| 128 | + console.error('保存活动失败:', error) | |
| 129 | + } | |
| 130 | + } | |
| 131 | + }) | |
| 132 | + }, | |
| 133 | + handleClose() { | |
| 134 | + if (this.$refs.richTextEditor) { | |
| 135 | + this.$refs.richTextEditor.clear(); | |
| 136 | + } | |
| 137 | + this.$refs.form.resetFields() | |
| 138 | + } | |
| 139 | + } | |
| 140 | +} | |
| 141 | +</script> | |
| 0 | 142 | \ No newline at end of file | ... | ... |
src/components/oa/deleteActivities.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('activitiesManage.delete.title')" | |
| 4 | + :visible.sync="dialogVisible" | |
| 5 | + width="30%" | |
| 6 | + @close="handleClose" | |
| 7 | + > | |
| 8 | + <div class="delete-content"> | |
| 9 | + <i class="el-icon-warning warning-icon"></i> | |
| 10 | + <span>{{ $t('activitiesManage.delete.confirmText') }}</span> | |
| 11 | + </div> | |
| 12 | + <span slot="footer" class="dialog-footer"> | |
| 13 | + <el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button> | |
| 14 | + <el-button type="primary" @click="handleConfirm">{{ $t('common.confirm') }}</el-button> | |
| 15 | + </span> | |
| 16 | + </el-dialog> | |
| 17 | +</template> | |
| 18 | + | |
| 19 | +<script> | |
| 20 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 21 | +import { deleteActivities } from '@/api/oa/activitiesManageApi' | |
| 22 | + | |
| 23 | +export default { | |
| 24 | + name: 'DeleteActivities', | |
| 25 | + data() { | |
| 26 | + return { | |
| 27 | + dialogVisible: false, | |
| 28 | + activitiesId: '' | |
| 29 | + } | |
| 30 | + }, | |
| 31 | + methods: { | |
| 32 | + open(row) { | |
| 33 | + this.activitiesId = row.activitiesId | |
| 34 | + this.dialogVisible = true | |
| 35 | + }, | |
| 36 | + async handleConfirm() { | |
| 37 | + try { | |
| 38 | + const params = { | |
| 39 | + activitiesId: this.activitiesId, | |
| 40 | + communityId: getCommunityId() | |
| 41 | + } | |
| 42 | + await deleteActivities(params) | |
| 43 | + this.$message.success(this.$t('common.deleteSuccess')) | |
| 44 | + this.dialogVisible = false | |
| 45 | + this.$emit('success') | |
| 46 | + } catch (error) { | |
| 47 | + console.error('删除活动失败:', error) | |
| 48 | + this.$message.error(this.$t('common.deleteFailed')) | |
| 49 | + } | |
| 50 | + }, | |
| 51 | + handleClose() { | |
| 52 | + this.activitiesId = '' | |
| 53 | + } | |
| 54 | + } | |
| 55 | +} | |
| 56 | +</script> | |
| 57 | + | |
| 58 | +<style lang="scss" scoped> | |
| 59 | +.delete-content { | |
| 60 | + display: flex; | |
| 61 | + align-items: center; | |
| 62 | + justify-content: center; | |
| 63 | + padding: 20px 0; | |
| 64 | + font-size: 16px; | |
| 65 | + | |
| 66 | + .warning-icon { | |
| 67 | + color: #E6A23C; | |
| 68 | + font-size: 24px; | |
| 69 | + margin-right: 10px; | |
| 70 | + } | |
| 71 | +} | |
| 72 | + | |
| 73 | +.dialog-footer { | |
| 74 | + text-align: right; | |
| 75 | +} | |
| 76 | +</style> | |
| 0 | 77 | \ No newline at end of file | ... | ... |
src/components/oa/deleteActivitiesType.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('activitiesTypeManage.delete.title')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="30%" | |
| 6 | + @close="handleClose" | |
| 7 | + > | |
| 8 | + <div class="delete-content"> | |
| 9 | + <i class="el-icon-warning" style="color:#E6A23C;font-size:24px;"></i> | |
| 10 | + <span style="margin-left:10px;">{{ $t('activitiesTypeManage.delete.confirm') }}</span> | |
| 11 | + </div> | |
| 12 | + <span slot="footer" class="dialog-footer"> | |
| 13 | + <el-button @click="visible = false"> | |
| 14 | + {{ $t('common.cancel') }} | |
| 15 | + </el-button> | |
| 16 | + <el-button type="primary" @click="handleConfirm"> | |
| 17 | + {{ $t('common.confirm') }} | |
| 18 | + </el-button> | |
| 19 | + </span> | |
| 20 | + </el-dialog> | |
| 21 | +</template> | |
| 22 | + | |
| 23 | +<script> | |
| 24 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 25 | +import { deleteActivitiesType } from '@/api/oa/activitiesTypeManageApi' | |
| 26 | + | |
| 27 | +export default { | |
| 28 | + name: 'DeleteActivitiesType', | |
| 29 | + data() { | |
| 30 | + return { | |
| 31 | + visible: false, | |
| 32 | + deleteData: { | |
| 33 | + typeCd: '', | |
| 34 | + communityId: '' | |
| 35 | + } | |
| 36 | + } | |
| 37 | + }, | |
| 38 | + methods: { | |
| 39 | + open(row) { | |
| 40 | + this.visible = true | |
| 41 | + this.deleteData = { | |
| 42 | + typeCd: row.typeCd, | |
| 43 | + communityId: getCommunityId() | |
| 44 | + } | |
| 45 | + }, | |
| 46 | + handleClose() { | |
| 47 | + this.deleteData = { | |
| 48 | + typeCd: '', | |
| 49 | + communityId: '' | |
| 50 | + } | |
| 51 | + }, | |
| 52 | + async handleConfirm() { | |
| 53 | + try { | |
| 54 | + await deleteActivitiesType(this.deleteData) | |
| 55 | + this.$message.success(this.$t('activitiesTypeManage.delete.success')) | |
| 56 | + this.visible = false | |
| 57 | + this.$emit('success') | |
| 58 | + } catch (error) { | |
| 59 | + this.$message.error(this.$t('activitiesTypeManage.delete.error')) | |
| 60 | + } | |
| 61 | + } | |
| 62 | + } | |
| 63 | +} | |
| 64 | +</script> | |
| 65 | + | |
| 66 | +<style scoped> | |
| 67 | +.delete-content { | |
| 68 | + display: flex; | |
| 69 | + align-items: center; | |
| 70 | + justify-content: center; | |
| 71 | + padding: 20px 0; | |
| 72 | +} | |
| 73 | +</style> | |
| 0 | 74 | \ No newline at end of file | ... | ... |
src/components/oa/editActivitiesType.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('activitiesTypeManage.edit.title')" :visible.sync="visible" width="50%" @close="handleClose"> | |
| 3 | + <el-form ref="form" :model="formData" :rules="rules" label-width="120px"> | |
| 4 | + <el-form-item :label="$t('activitiesTypeManage.edit.typeCd')" prop="typeCd"> | |
| 5 | + <el-input v-model="formData.typeCd" disabled /> | |
| 6 | + </el-form-item> | |
| 7 | + <el-form-item :label="$t('activitiesTypeManage.edit.typeName')" prop="typeName"> | |
| 8 | + <el-input v-model="formData.typeName" :placeholder="$t('activitiesTypeManage.edit.typeNamePlaceholder')" /> | |
| 9 | + </el-form-item> | |
| 10 | + <el-form-item :label="$t('activitiesTypeManage.edit.typeDesc')" prop="typeDesc"> | |
| 11 | + <el-input v-model="formData.typeDesc" :placeholder="$t('activitiesTypeManage.edit.typeDescPlaceholder')" /> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item :label="$t('activitiesTypeManage.edit.seq')" prop="seq"> | |
| 14 | + <el-input v-model="formData.seq" :placeholder="$t('activitiesTypeManage.edit.seqPlaceholder')" /> | |
| 15 | + </el-form-item> | |
| 16 | + <el-form-item :label="$t('activitiesTypeManage.edit.defaultShow')" prop="defaultShow"> | |
| 17 | + <el-select v-model="formData.defaultShow" :placeholder="$t('activitiesTypeManage.edit.defaultShowPlaceholder')" | |
| 18 | + style="width:100%"> | |
| 19 | + <el-option :label="$t('common.yes')" value="Y" /> | |
| 20 | + <el-option :label="$t('common.no')" value="N" /> | |
| 21 | + </el-select> | |
| 22 | + </el-form-item> | |
| 23 | + </el-form> | |
| 24 | + <span slot="footer" class="dialog-footer"> | |
| 25 | + <el-button @click="visible = false"> | |
| 26 | + {{ $t('common.cancel') }} | |
| 27 | + </el-button> | |
| 28 | + <el-button type="primary" @click="handleSubmit"> | |
| 29 | + {{ $t('common.confirm') }} | |
| 30 | + </el-button> | |
| 31 | + </span> | |
| 32 | + </el-dialog> | |
| 33 | +</template> | |
| 34 | + | |
| 35 | +<script> | |
| 36 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 37 | +import { updateActivitiesType } from '@/api/oa/activitiesTypeManageApi' | |
| 38 | + | |
| 39 | +export default { | |
| 40 | + name: 'EditActivitiesType', | |
| 41 | + data() { | |
| 42 | + return { | |
| 43 | + visible: false, | |
| 44 | + formData: { | |
| 45 | + typeCd: '', | |
| 46 | + typeName: '', | |
| 47 | + typeDesc: '', | |
| 48 | + seq: '', | |
| 49 | + defaultShow: '', | |
| 50 | + communityId: '' | |
| 51 | + }, | |
| 52 | + rules: { | |
| 53 | + typeCd: [ | |
| 54 | + { required: true, message: this.$t('activitiesTypeManage.validate.typeCdRequired'), trigger: 'blur' } | |
| 55 | + ], | |
| 56 | + typeName: [ | |
| 57 | + { required: true, message: this.$t('activitiesTypeManage.validate.typeNameRequired'), trigger: 'blur' }, | |
| 58 | + { max: 100, message: this.$t('activitiesTypeManage.validate.typeNameMaxLength'), trigger: 'blur' } | |
| 59 | + ], | |
| 60 | + typeDesc: [ | |
| 61 | + { max: 500, message: this.$t('activitiesTypeManage.validate.typeDescMaxLength'), trigger: 'blur' } | |
| 62 | + ], | |
| 63 | + seq: [ | |
| 64 | + { required: true, message: this.$t('activitiesTypeManage.validate.seqRequired'), trigger: 'blur' }, | |
| 65 | + ], | |
| 66 | + defaultShow: [ | |
| 67 | + { required: true, message: this.$t('activitiesTypeManage.validate.defaultShowRequired'), trigger: 'change' } | |
| 68 | + ] | |
| 69 | + } | |
| 70 | + } | |
| 71 | + }, | |
| 72 | + methods: { | |
| 73 | + open(row) { | |
| 74 | + this.visible = true | |
| 75 | + this.formData = { | |
| 76 | + ...row, | |
| 77 | + communityId: getCommunityId() | |
| 78 | + } | |
| 79 | + this.$nextTick(() => { | |
| 80 | + this.$refs.form && this.$refs.form.clearValidate() | |
| 81 | + }) | |
| 82 | + }, | |
| 83 | + handleClose() { | |
| 84 | + this.$refs.form.resetFields() | |
| 85 | + }, | |
| 86 | + handleSubmit() { | |
| 87 | + this.$refs.form.validate(async valid => { | |
| 88 | + if (valid) { | |
| 89 | + try { | |
| 90 | + await updateActivitiesType({ | |
| 91 | + ...this.formData, | |
| 92 | + seq: Number(this.formData.seq) | |
| 93 | + }) | |
| 94 | + this.$message.success(this.$t('activitiesTypeManage.edit.success')) | |
| 95 | + this.visible = false | |
| 96 | + this.$emit('success') | |
| 97 | + } catch (error) { | |
| 98 | + this.$message.error(this.$t('activitiesTypeManage.edit.error')) | |
| 99 | + } | |
| 100 | + } | |
| 101 | + }) | |
| 102 | + } | |
| 103 | + } | |
| 104 | +} | |
| 105 | +</script> | |
| 0 | 106 | \ No newline at end of file | ... | ... |
src/components/oa/editActivitiesView.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('activitiesManage.edit.title')" :visible.sync="dialogVisible" width="70%" @close="handleClose"> | |
| 3 | + <el-form ref="form" :model="form" label-width="120px" :rules="rules"> | |
| 4 | + <el-form-item :label="$t('activitiesManage.edit.title')" prop="title"> | |
| 5 | + <el-input v-model="form.title" :placeholder="$t('activitiesManage.edit.titlePlaceholder')" /> | |
| 6 | + </el-form-item> | |
| 7 | + <el-form-item :label="$t('activitiesManage.edit.typeCd')" prop="typeCd"> | |
| 8 | + <el-select v-model="form.typeCd" :placeholder="$t('activitiesManage.edit.typeCdPlaceholder')" style="width:100%"> | |
| 9 | + <el-option v-for="item in typeCds" :key="item.typeCd" :label="item.typeName" :value="item.typeCd" /> | |
| 10 | + </el-select> | |
| 11 | + </el-form-item> | |
| 12 | + <el-form-item :label="$t('activitiesManage.edit.headerImg')" prop="headerImg"> | |
| 13 | + <upload-image-url ref="uploadImage" :limit="1" @notifyUploadCoverImage="handleImageChange" /> | |
| 14 | + </el-form-item> | |
| 15 | + <el-form-item :label="$t('activitiesManage.edit.startTime')" prop="startTime"> | |
| 16 | + <el-date-picker v-model="form.startTime" type="datetime" | |
| 17 | + :placeholder="$t('activitiesManage.edit.startTimePlaceholder')" style="width:100%" | |
| 18 | + value-format="yyyy-MM-dd HH:mm:ss" /> | |
| 19 | + </el-form-item> | |
| 20 | + <el-form-item :label="$t('activitiesManage.edit.endTime')" prop="endTime"> | |
| 21 | + <el-date-picker v-model="form.endTime" type="datetime" | |
| 22 | + :placeholder="$t('activitiesManage.edit.endTimePlaceholder')" style="width:100%" | |
| 23 | + value-format="yyyy-MM-dd HH:mm:ss" /> | |
| 24 | + </el-form-item> | |
| 25 | + <el-form-item :label="$t('activitiesManage.edit.context')" prop="context"> | |
| 26 | + <rich-text-editor ref="richTextEditor" v-model="form.context" /> | |
| 27 | + </el-form-item> | |
| 28 | + </el-form> | |
| 29 | + <span slot="footer" class="dialog-footer"> | |
| 30 | + <el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button> | |
| 31 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.save') }}</el-button> | |
| 32 | + </span> | |
| 33 | + </el-dialog> | |
| 34 | +</template> | |
| 35 | + | |
| 36 | +<script> | |
| 37 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 38 | +import { updateActivities, getActivitiesDetail, listActivitiesType } from '@/api/oa/activitiesManageApi' | |
| 39 | +import UploadImageUrl from '@/components/upload/UploadImageUrl' | |
| 40 | +import RichTextEditor from "@/components/editor/RichTextEditor"; | |
| 41 | + | |
| 42 | +export default { | |
| 43 | + name: 'EditActivitiesView', | |
| 44 | + components: { | |
| 45 | + UploadImageUrl, | |
| 46 | + RichTextEditor | |
| 47 | + }, | |
| 48 | + data() { | |
| 49 | + return { | |
| 50 | + dialogVisible: false, | |
| 51 | + form: { | |
| 52 | + activitiesId: '', | |
| 53 | + title: '', | |
| 54 | + typeCd: '', | |
| 55 | + headerImg: '', | |
| 56 | + context: '', | |
| 57 | + startTime: '', | |
| 58 | + endTime: '', | |
| 59 | + communityId: '' | |
| 60 | + }, | |
| 61 | + typeCds: [], | |
| 62 | + rules: { | |
| 63 | + title: [ | |
| 64 | + { required: true, message: this.$t('activitiesManage.validate.titleRequired'), trigger: 'blur' }, | |
| 65 | + { max: 200, message: this.$t('activitiesManage.validate.titleMaxLength'), trigger: 'blur' } | |
| 66 | + ], | |
| 67 | + typeCd: [ | |
| 68 | + { required: true, message: this.$t('activitiesManage.validate.typeCdRequired'), trigger: 'change' } | |
| 69 | + ], | |
| 70 | + headerImg: [ | |
| 71 | + { required: true, message: this.$t('activitiesManage.validate.headerImgRequired'), trigger: 'change' } | |
| 72 | + ], | |
| 73 | + context: [ | |
| 74 | + { required: true, message: this.$t('activitiesManage.validate.contextRequired'), trigger: 'blur' } | |
| 75 | + ], | |
| 76 | + startTime: [ | |
| 77 | + { required: true, message: this.$t('activitiesManage.validate.startTimeRequired'), trigger: 'change' } | |
| 78 | + ], | |
| 79 | + endTime: [ | |
| 80 | + { required: true, message: this.$t('activitiesManage.validate.endTimeRequired'), trigger: 'change' } | |
| 81 | + ], | |
| 82 | + activitiesId: [ | |
| 83 | + { required: true, message: this.$t('activitiesManage.validate.activitiesIdRequired'), trigger: 'blur' } | |
| 84 | + ] | |
| 85 | + } | |
| 86 | + } | |
| 87 | + }, | |
| 88 | + methods: { | |
| 89 | + open(row) { | |
| 90 | + this.dialogVisible = true | |
| 91 | + this.$nextTick(async () => { | |
| 92 | + this.$refs.form && this.$refs.form.resetFields() | |
| 93 | + this.loadActivitiesType() | |
| 94 | + await this.loadActivitiesDetail(row.activitiesId) | |
| 95 | + }) | |
| 96 | + }, | |
| 97 | + async loadActivitiesType() { | |
| 98 | + try { | |
| 99 | + const params = { | |
| 100 | + page: 1, | |
| 101 | + row: 50, | |
| 102 | + communityId: getCommunityId() | |
| 103 | + } | |
| 104 | + const { data } = await listActivitiesType(params) | |
| 105 | + this.typeCds = data | |
| 106 | + } catch (error) { | |
| 107 | + console.error('获取活动类型失败:', error) | |
| 108 | + } | |
| 109 | + }, | |
| 110 | + async loadActivitiesDetail(activitiesId) { | |
| 111 | + try { | |
| 112 | + const params = { | |
| 113 | + activitiesId, | |
| 114 | + page: 1, | |
| 115 | + row: 50, | |
| 116 | + communityId: getCommunityId() | |
| 117 | + } | |
| 118 | + const {activitiess} = await getActivitiesDetail(params) | |
| 119 | + this.form = { ...activitiess[0] } | |
| 120 | + this.$refs.uploadImage.setImages([activitiess[0].headerImg]) | |
| 121 | + this.$refs.richTextEditor.setContent(activitiess[0].context) | |
| 122 | + } catch (error) { | |
| 123 | + console.error('获取活动详情失败:', error) | |
| 124 | + } | |
| 125 | + }, | |
| 126 | + handleImageChange(images) { | |
| 127 | + this.form.headerImg = images.length > 0 ? images[0] : '' | |
| 128 | + }, | |
| 129 | + async handleSubmit() { | |
| 130 | + this.$refs.form.validate(async valid => { | |
| 131 | + if (valid) { | |
| 132 | + try { | |
| 133 | + this.form.communityId = getCommunityId() | |
| 134 | + await updateActivities(this.form) | |
| 135 | + this.$message.success(this.$t('common.saveSuccess')) | |
| 136 | + this.dialogVisible = false | |
| 137 | + this.$emit('success') | |
| 138 | + } catch (error) { | |
| 139 | + console.error('更新活动失败:', error) | |
| 140 | + } | |
| 141 | + } | |
| 142 | + }) | |
| 143 | + }, | |
| 144 | + handleClose() { | |
| 145 | + this.$refs.form.resetFields() | |
| 146 | + } | |
| 147 | + } | |
| 148 | +} | |
| 149 | +</script> | |
| 0 | 150 | \ No newline at end of file | ... | ... |
src/i18n/index.js
| ... | ... | @@ -206,6 +206,7 @@ import { messages as equipmentAccountDetailMessages } from '../views/machine/equ |
| 206 | 206 | import { messages as printEquipmentAccountLabelMessages } from '../views/resource/printEquipmentAccountLabelLang' |
| 207 | 207 | import {messages as inspectioni18n} from './inspectionI18n' |
| 208 | 208 | import {messages as machineI18n} from './machineI18n' |
| 209 | +import {messages as oaI18n} from './oaI18n' | |
| 209 | 210 | |
| 210 | 211 | Vue.use(VueI18n) |
| 211 | 212 | |
| ... | ... | @@ -416,6 +417,7 @@ const messages = { |
| 416 | 417 | ...printEquipmentAccountLabelMessages.en, |
| 417 | 418 | ...inspectioni18n.en, |
| 418 | 419 | ...machineI18n.en, |
| 420 | + ...oaI18n.en, | |
| 419 | 421 | }, |
| 420 | 422 | zh: { |
| 421 | 423 | ...loginMessages.zh, |
| ... | ... | @@ -622,6 +624,7 @@ const messages = { |
| 622 | 624 | ...printEquipmentAccountLabelMessages.zh, |
| 623 | 625 | ...inspectioni18n.zh, |
| 624 | 626 | ...machineI18n.zh, |
| 627 | + ...oaI18n.zh, | |
| 625 | 628 | } |
| 626 | 629 | } |
| 627 | 630 | ... | ... |
src/i18n/oaI18n.js
0 → 100644
| 1 | +import { messages as activitiesTypeManageMessages } from '../views/oa/activitiesTypeManageLang' | |
| 2 | +import { messages as activitiesManageMessages } from '../views/oa/activitiesManageLang' | |
| 3 | +export const messages ={ | |
| 4 | + en:{ | |
| 5 | + ...activitiesTypeManageMessages.en, | |
| 6 | + ...activitiesManageMessages.en, | |
| 7 | + }, | |
| 8 | + zh:{ | |
| 9 | + ...activitiesTypeManageMessages.zh, | |
| 10 | + ...activitiesManageMessages.zh, | |
| 11 | + } | |
| 12 | +} | |
| 0 | 13 | \ No newline at end of file | ... | ... |
src/router/index.js
| ... | ... | @@ -5,6 +5,7 @@ import Login from '@/views/user/login/Login.vue' |
| 5 | 5 | import printEquipmentAccountLabel from '@/views/resource/printEquipmentAccountLabelList.vue' |
| 6 | 6 | import inspectionRouter from './inspectionRouter' |
| 7 | 7 | import machineRouter from './machineRouter' |
| 8 | +import oaRouter from './oaRouter' | |
| 8 | 9 | |
| 9 | 10 | Vue.use(VueRouter) |
| 10 | 11 | |
| ... | ... | @@ -926,6 +927,7 @@ const routes = [ |
| 926 | 927 | |
| 927 | 928 | ...inspectionRouter, |
| 928 | 929 | ...machineRouter, |
| 930 | + ...oaRouter, | |
| 929 | 931 | // 其他子路由可以在这里添加 |
| 930 | 932 | ] |
| 931 | 933 | }, | ... | ... |
src/router/oaRouter.js
0 → 100644
| 1 | +export default [ | |
| 2 | + { | |
| 3 | + path: '/pages/property/activitiesTypeManage', | |
| 4 | + name: '/pages/property/activitiesTypeManage', | |
| 5 | + component: () => import('@/views/oa/activitiesTypeManageList.vue') | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + path:'/pages/property/activitiesManage', | |
| 9 | + name:'/pages/property/activitiesManage', | |
| 10 | + component: () => import('@/views/oa/activitiesManageList.vue') | |
| 11 | + }, | |
| 12 | +] | |
| 0 | 13 | \ No newline at end of file | ... | ... |
src/views/oa/activitiesManageLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + activitiesManage: { | |
| 4 | + search: { | |
| 5 | + title: 'Search Conditions', | |
| 6 | + activitiesId: 'Please enter activity ID', | |
| 7 | + titlePlaceholder: 'Please enter title', | |
| 8 | + typeCd: 'Please select activity type', | |
| 9 | + staffName: 'Please enter publisher name' | |
| 10 | + }, | |
| 11 | + list: { | |
| 12 | + title: 'Activity List' | |
| 13 | + }, | |
| 14 | + table: { | |
| 15 | + activitiesId: 'Activity ID', | |
| 16 | + title: 'Title', | |
| 17 | + typeCd: 'Type', | |
| 18 | + startTime: 'Start Time', | |
| 19 | + endTime: 'End Time', | |
| 20 | + userName: 'Publisher' | |
| 21 | + }, | |
| 22 | + add: { | |
| 23 | + title: 'Add Activity', | |
| 24 | + titlePlaceholder: 'Required, please enter title', | |
| 25 | + typeCd: 'Activity Type', | |
| 26 | + startTime: 'start time', | |
| 27 | + endTime: 'end time', | |
| 28 | + typeCdPlaceholder: 'Required, please select type', | |
| 29 | + isMoreCommunity: 'Multi-community', | |
| 30 | + isMoreCommunityPlaceholder: 'Please select if multi-community', | |
| 31 | + headerImg: 'Header Image (800*595)', | |
| 32 | + startTimePlaceholder: 'Required, please enter start time', | |
| 33 | + endTimePlaceholder: 'Required, please enter end time', | |
| 34 | + context: 'Content' | |
| 35 | + }, | |
| 36 | + edit: { | |
| 37 | + title: 'Edit Activity', | |
| 38 | + titlePlaceholder: 'Required, please enter title', | |
| 39 | + typeCd: 'Activity Type', | |
| 40 | + startTime: 'start time', | |
| 41 | + endTime: 'end time', | |
| 42 | + typeCdPlaceholder: 'Required, please select type', | |
| 43 | + headerImg: 'Header Image (800*595)', | |
| 44 | + startTimePlaceholder: 'Required, please enter start time', | |
| 45 | + endTimePlaceholder: 'Required, please enter end time', | |
| 46 | + context: 'Content' | |
| 47 | + }, | |
| 48 | + delete: { | |
| 49 | + title: 'Confirm Operation', | |
| 50 | + confirmText: 'Are you sure to delete this activity?' | |
| 51 | + }, | |
| 52 | + validate: { | |
| 53 | + titleRequired: 'Title is required', | |
| 54 | + titleMaxLength: 'Title cannot exceed 200 characters', | |
| 55 | + typeCdRequired: 'Type is required', | |
| 56 | + headerImgRequired: 'Header image is required', | |
| 57 | + contextRequired: 'Content is required', | |
| 58 | + startTimeRequired: 'Start time is required', | |
| 59 | + endTimeRequired: 'End time is required', | |
| 60 | + activitiesIdRequired: 'Activity ID is required', | |
| 61 | + imageSize: 'Image size cannot exceed 2MB' | |
| 62 | + } | |
| 63 | + } | |
| 64 | + }, | |
| 65 | + zh: { | |
| 66 | + activitiesManage: { | |
| 67 | + search: { | |
| 68 | + title: '查询条件', | |
| 69 | + activitiesId: '请输入活动ID', | |
| 70 | + titlePlaceholder: '请输入标题', | |
| 71 | + typeCd: '请选择活动类型', | |
| 72 | + staffName: '请输入发布人名称' | |
| 73 | + }, | |
| 74 | + list: { | |
| 75 | + title: '活动列表' | |
| 76 | + }, | |
| 77 | + table: { | |
| 78 | + activitiesId: '活动ID', | |
| 79 | + title: '标题', | |
| 80 | + typeCd: '类型', | |
| 81 | + startTime: '开始时间', | |
| 82 | + endTime: '结束时间', | |
| 83 | + userName: '发布人' | |
| 84 | + }, | |
| 85 | + add: { | |
| 86 | + title: '添加活动', | |
| 87 | + titlePlaceholder: '必填,请输入标题', | |
| 88 | + typeCd: '类型', | |
| 89 | + startTime: '开始时间', | |
| 90 | + endTime: '结束时间', | |
| 91 | + typeCdPlaceholder: '必填,请选择类型', | |
| 92 | + isMoreCommunity: '多小区', | |
| 93 | + isMoreCommunityPlaceholder: '请选择是否多小区', | |
| 94 | + headerImg: '头部照片(800*595)', | |
| 95 | + startTimePlaceholder: '必填,请输入开始时间', | |
| 96 | + endTimePlaceholder: '必填,请输入结束时间', | |
| 97 | + context: '内容' | |
| 98 | + }, | |
| 99 | + edit: { | |
| 100 | + title: '编辑活动', | |
| 101 | + titlePlaceholder: '必填,请输入标题', | |
| 102 | + typeCd: '类型', | |
| 103 | + typeCdPlaceholder: '必填,请选择类型', | |
| 104 | + headerImg: '头部照片(800*595)', | |
| 105 | + startTimePlaceholder: '必填,请输入开始时间', | |
| 106 | + endTimePlaceholder: '必填,请输入结束时间', | |
| 107 | + startTime: '开始时间', | |
| 108 | + endTime: '结束时间', | |
| 109 | + context: '内容' | |
| 110 | + }, | |
| 111 | + delete: { | |
| 112 | + title: '确认操作', | |
| 113 | + confirmText: '确认删除该活动吗?' | |
| 114 | + }, | |
| 115 | + validate: { | |
| 116 | + titleRequired: '标题不能为空', | |
| 117 | + titleMaxLength: '标题不能超过200个字符', | |
| 118 | + typeCdRequired: '类型不能为空', | |
| 119 | + headerImgRequired: '头部照片不能为空', | |
| 120 | + contextRequired: '内容不能为空', | |
| 121 | + startTimeRequired: '开始时间不能为空', | |
| 122 | + endTimeRequired: '结束时间不能为空', | |
| 123 | + activitiesIdRequired: '活动ID不能为空', | |
| 124 | + imageSize: '图片大小不能超过2MB' | |
| 125 | + } | |
| 126 | + } | |
| 127 | + } | |
| 128 | +} | |
| 0 | 129 | \ No newline at end of file | ... | ... |
src/views/oa/activitiesManageList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="activities-manage-container animated fadeInRight"> | |
| 3 | + <el-card class="box-card"> | |
| 4 | + <div slot="header" class="flex justify-between"> | |
| 5 | + <span>{{ $t('activitiesManage.search.title') }}</span> | |
| 6 | + <el-button type="text" style="float: right; padding: 3px 0" @click="_moreCondition"> | |
| 7 | + {{ activitiesManageInfo.moreCondition ? $t('common.hide') : $t('common.more') }} | |
| 8 | + </el-button> | |
| 9 | + </div> | |
| 10 | + <el-row :gutter="20"> | |
| 11 | + <el-col :span="6"> | |
| 12 | + <el-input v-model="activitiesManageInfo.conditions.activitiesId" | |
| 13 | + :placeholder="$t('activitiesManage.search.activitiesId')" clearable /> | |
| 14 | + </el-col> | |
| 15 | + <el-col :span="8"> | |
| 16 | + <el-input v-model="activitiesManageInfo.conditions.title" :placeholder="$t('activitiesManage.search.title')" | |
| 17 | + clearable /> | |
| 18 | + </el-col> | |
| 19 | + <el-col :span="6"> | |
| 20 | + <el-select v-model="activitiesManageInfo.conditions.typeCd" :placeholder="$t('activitiesManage.search.typeCd')" | |
| 21 | + style="width:100%"> | |
| 22 | + <el-option v-for="item in activitiesManageInfo.typeCds" :key="item.typeCd" :label="item.typeName" | |
| 23 | + :value="item.typeCd" /> | |
| 24 | + </el-select> | |
| 25 | + </el-col> | |
| 26 | + <el-col :span="4"> | |
| 27 | + <el-button type="primary" @click="_queryActivitiesMethod"> | |
| 28 | + <i class="el-icon-search"></i> | |
| 29 | + {{ $t('common.search') }} | |
| 30 | + </el-button> | |
| 31 | + <el-button @click="_resetActivitiesMethod"> | |
| 32 | + <i class="el-icon-refresh"></i> | |
| 33 | + {{ $t('common.reset') }} | |
| 34 | + </el-button> | |
| 35 | + </el-col> | |
| 36 | + </el-row> | |
| 37 | + <el-row v-if="activitiesManageInfo.moreCondition" :gutter="20" style="margin-top:15px"> | |
| 38 | + <el-col :span="6"> | |
| 39 | + <el-input v-model="activitiesManageInfo.conditions.staffName" | |
| 40 | + :placeholder="$t('activitiesManage.search.staffName')" clearable /> | |
| 41 | + </el-col> | |
| 42 | + </el-row> | |
| 43 | + </el-card> | |
| 44 | + | |
| 45 | + <el-card class="box-card" style="margin-top:20px"> | |
| 46 | + <div slot="header" class="flex justify-between"> | |
| 47 | + <span>{{ $t('activitiesManage.list.title') }}</span> | |
| 48 | + <el-button type="primary" size="small" @click="_openAddActivitiesModal"> | |
| 49 | + <i class="el-icon-plus"></i> | |
| 50 | + {{ $t('common.add') }} | |
| 51 | + </el-button> | |
| 52 | + </div> | |
| 53 | + <el-table :data="activitiesManageInfo.activitiess" border style="width: 100%"> | |
| 54 | + <el-table-column prop="activitiesId" :label="$t('activitiesManage.table.activitiesId')" align="center" /> | |
| 55 | + <el-table-column prop="title" :label="$t('activitiesManage.table.title')" align="center" /> | |
| 56 | + <el-table-column prop="typeCdName" :label="$t('activitiesManage.table.typeCd')" align="center" /> | |
| 57 | + <el-table-column prop="startTime" :label="$t('activitiesManage.table.startTime')" align="center" /> | |
| 58 | + <el-table-column prop="endTime" :label="$t('activitiesManage.table.endTime')" align="center" /> | |
| 59 | + <el-table-column prop="userName" :label="$t('activitiesManage.table.userName')" align="center" /> | |
| 60 | + <el-table-column :label="$t('common.operation')" align="center" width="200"> | |
| 61 | + <template slot-scope="scope"> | |
| 62 | + <el-button size="mini" @click="_openEditActivitiesModel(scope.row)"> | |
| 63 | + {{ $t('common.edit') }} | |
| 64 | + </el-button> | |
| 65 | + <el-button size="mini" type="danger" @click="_openDeleteActivitiesModel(scope.row)"> | |
| 66 | + {{ $t('common.delete') }} | |
| 67 | + </el-button> | |
| 68 | + </template> | |
| 69 | + </el-table-column> | |
| 70 | + </el-table> | |
| 71 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | |
| 72 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | |
| 73 | + @current-change="handleCurrentChange" style="margin-top:20px;text-align:right" /> | |
| 74 | + </el-card> | |
| 75 | + | |
| 76 | + <add-activities-view ref="addActivitiesView" @success="handleSuccess" /> | |
| 77 | + <edit-activities-view ref="editActivitiesView" @success="handleSuccess" /> | |
| 78 | + <delete-activities ref="deleteActivities" @success="handleSuccess" /> | |
| 79 | + </div> | |
| 80 | +</template> | |
| 81 | + | |
| 82 | +<script> | |
| 83 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 84 | +import { listActivities, listActivitiesType } from '@/api/oa/activitiesManageApi' | |
| 85 | +import AddActivitiesView from '@/components/oa/addActivitiesView' | |
| 86 | +import EditActivitiesView from '@/components/oa/editActivitiesView' | |
| 87 | +import DeleteActivities from '@/components/oa/deleteActivities' | |
| 88 | + | |
| 89 | +export default { | |
| 90 | + name: 'ActivitiesManageList', | |
| 91 | + components: { | |
| 92 | + AddActivitiesView, | |
| 93 | + EditActivitiesView, | |
| 94 | + DeleteActivities | |
| 95 | + }, | |
| 96 | + data() { | |
| 97 | + return { | |
| 98 | + activitiesManageInfo: { | |
| 99 | + activitiess: [], | |
| 100 | + total: 0, | |
| 101 | + records: 1, | |
| 102 | + moreCondition: false, | |
| 103 | + title: '', | |
| 104 | + typeCds: [], | |
| 105 | + conditions: { | |
| 106 | + title: '', | |
| 107 | + typeCd: '', | |
| 108 | + staffName: '', | |
| 109 | + activitiesId: '', | |
| 110 | + endTimeFlag: '1', | |
| 111 | + page: 1, | |
| 112 | + row: 10, | |
| 113 | + communityId: '' | |
| 114 | + } | |
| 115 | + }, | |
| 116 | + page: { | |
| 117 | + current: 1, | |
| 118 | + size: 10, | |
| 119 | + total: 0 | |
| 120 | + } | |
| 121 | + } | |
| 122 | + }, | |
| 123 | + created() { | |
| 124 | + this.communityId = getCommunityId() | |
| 125 | + this.activitiesManageInfo.conditions.communityId = this.communityId | |
| 126 | + this._listActivitiess() | |
| 127 | + this._loadActivitiesType() | |
| 128 | + }, | |
| 129 | + methods: { | |
| 130 | + async _listActivitiess() { | |
| 131 | + try { | |
| 132 | + const params = { | |
| 133 | + ...this.activitiesManageInfo.conditions, | |
| 134 | + page: this.page.current, | |
| 135 | + row: this.page.size | |
| 136 | + } | |
| 137 | + const { data, total } = await listActivities(params) | |
| 138 | + this.activitiesManageInfo.activitiess = data | |
| 139 | + this.page.total = total | |
| 140 | + } catch (error) { | |
| 141 | + console.error('获取活动列表失败:', error) | |
| 142 | + } | |
| 143 | + }, | |
| 144 | + async _loadActivitiesType() { | |
| 145 | + try { | |
| 146 | + const params = { | |
| 147 | + page: 1, | |
| 148 | + row: 50, | |
| 149 | + communityId: this.communityId | |
| 150 | + } | |
| 151 | + const { data } = await listActivitiesType(params) | |
| 152 | + this.activitiesManageInfo.typeCds = data | |
| 153 | + } catch (error) { | |
| 154 | + console.error('获取活动类型失败:', error) | |
| 155 | + } | |
| 156 | + }, | |
| 157 | + _openAddActivitiesModal() { | |
| 158 | + this.$refs.addActivitiesView.open() | |
| 159 | + }, | |
| 160 | + _openEditActivitiesModel(row) { | |
| 161 | + this.$refs.editActivitiesView.open(row) | |
| 162 | + }, | |
| 163 | + _openDeleteActivitiesModel(row) { | |
| 164 | + this.$refs.deleteActivities.open(row) | |
| 165 | + }, | |
| 166 | + _queryActivitiesMethod() { | |
| 167 | + this.page.current = 1 | |
| 168 | + this._listActivitiess() | |
| 169 | + }, | |
| 170 | + _resetActivitiesMethod() { | |
| 171 | + this.activitiesManageInfo.conditions = { | |
| 172 | + title: '', | |
| 173 | + typeCd: '', | |
| 174 | + staffName: '', | |
| 175 | + activitiesId: '', | |
| 176 | + endTimeFlag: '1', | |
| 177 | + page: 1, | |
| 178 | + row: 10, | |
| 179 | + communityId: this.communityId | |
| 180 | + } | |
| 181 | + this._listActivitiess() | |
| 182 | + }, | |
| 183 | + _moreCondition() { | |
| 184 | + this.activitiesManageInfo.moreCondition = !this.activitiesManageInfo.moreCondition | |
| 185 | + }, | |
| 186 | + handleSuccess() { | |
| 187 | + this._listActivitiess() | |
| 188 | + }, | |
| 189 | + handleSizeChange(val) { | |
| 190 | + this.page.size = val | |
| 191 | + this._listActivitiess() | |
| 192 | + }, | |
| 193 | + handleCurrentChange(val) { | |
| 194 | + this.page.current = val | |
| 195 | + this._listActivitiess() | |
| 196 | + } | |
| 197 | + } | |
| 198 | +} | |
| 199 | +</script> | |
| 200 | + | |
| 201 | +<style lang="scss" scoped> | |
| 202 | +.activities-manage-container { | |
| 203 | + padding: 20px; | |
| 204 | + | |
| 205 | + .box-card { | |
| 206 | + margin-bottom: 20px; | |
| 207 | + } | |
| 208 | + | |
| 209 | + .no_display { | |
| 210 | + display: none; | |
| 211 | + } | |
| 212 | +} | |
| 213 | +</style> | |
| 0 | 214 | \ No newline at end of file | ... | ... |
src/views/oa/activitiesTypeManageLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + activitiesTypeManage: { | |
| 4 | + search: { | |
| 5 | + title: 'Search Conditions', | |
| 6 | + typeCd: 'Type Code', | |
| 7 | + typeName: 'Type Name', | |
| 8 | + defaultShow: 'Mobile Display', | |
| 9 | + all: 'All', | |
| 10 | + yes: 'Yes', | |
| 11 | + no: 'No' | |
| 12 | + }, | |
| 13 | + list: { | |
| 14 | + title: 'Information Categories' | |
| 15 | + }, | |
| 16 | + table: { | |
| 17 | + typeCd: 'Type Code', | |
| 18 | + typeName: 'Type Name', | |
| 19 | + typeDesc: 'Type Description', | |
| 20 | + seq: 'Display Order', | |
| 21 | + defaultShow: 'Mobile Display' | |
| 22 | + }, | |
| 23 | + add: { | |
| 24 | + title: 'Add Category', | |
| 25 | + typeName: 'Type Name', | |
| 26 | + typeNamePlaceholder: 'Required, please enter type name', | |
| 27 | + typeDesc: 'Type Description', | |
| 28 | + typeDescPlaceholder: 'Optional, please enter type description', | |
| 29 | + seq: 'Display Order', | |
| 30 | + seqPlaceholder: 'Required, please enter display order', | |
| 31 | + defaultShow: 'Mobile Display', | |
| 32 | + defaultShowPlaceholder: 'Required, please select mobile display', | |
| 33 | + success: 'Add successfully', | |
| 34 | + error: 'Add failed' | |
| 35 | + }, | |
| 36 | + edit: { | |
| 37 | + title: 'Edit Category', | |
| 38 | + typeCd: 'Type Code', | |
| 39 | + typeName: 'Type Name', | |
| 40 | + typeNamePlaceholder: 'Required, please enter type name', | |
| 41 | + typeDesc: 'Type Description', | |
| 42 | + typeDescPlaceholder: 'Optional, please enter type description', | |
| 43 | + seq: 'Display Order', | |
| 44 | + seqPlaceholder: 'Required, please enter display order', | |
| 45 | + defaultShow: 'Mobile Display', | |
| 46 | + defaultShowPlaceholder: 'Required, please select mobile display', | |
| 47 | + success: 'Edit successfully', | |
| 48 | + error: 'Edit failed' | |
| 49 | + }, | |
| 50 | + delete: { | |
| 51 | + title: 'Delete Confirmation', | |
| 52 | + confirm: 'Are you sure to delete this category?', | |
| 53 | + success: 'Delete successfully', | |
| 54 | + error: 'Delete failed' | |
| 55 | + }, | |
| 56 | + validate: { | |
| 57 | + typeCdRequired: 'Type code is required', | |
| 58 | + typeNameRequired: 'Type name is required', | |
| 59 | + typeNameMaxLength: 'Type name cannot exceed 100 characters', | |
| 60 | + typeDescMaxLength: 'Type description cannot exceed 500 characters', | |
| 61 | + seqRequired: 'Display order is required', | |
| 62 | + seqNumber: 'Display order must be a number', | |
| 63 | + defaultShowRequired: 'Mobile display is required' | |
| 64 | + }, | |
| 65 | + fetchError: 'Failed to fetch data' | |
| 66 | + } | |
| 67 | + }, | |
| 68 | + zh: { | |
| 69 | + activitiesTypeManage: { | |
| 70 | + search: { | |
| 71 | + title: '查询条件', | |
| 72 | + typeCd: '大类编码', | |
| 73 | + typeName: '大类名称', | |
| 74 | + defaultShow: '手机显示', | |
| 75 | + all: '全部', | |
| 76 | + yes: '是', | |
| 77 | + no: '否' | |
| 78 | + }, | |
| 79 | + list: { | |
| 80 | + title: '信息大类' | |
| 81 | + }, | |
| 82 | + table: { | |
| 83 | + typeCd: '大类编码', | |
| 84 | + typeName: '大类名称', | |
| 85 | + typeDesc: '大类描述', | |
| 86 | + seq: '显示序号', | |
| 87 | + defaultShow: '手机显示' | |
| 88 | + }, | |
| 89 | + add: { | |
| 90 | + title: '添加大类', | |
| 91 | + typeName: '大类名称', | |
| 92 | + typeNamePlaceholder: '必填,请填写大类名称', | |
| 93 | + typeDesc: '大类描述', | |
| 94 | + typeDescPlaceholder: '选填,请填写大类描述', | |
| 95 | + seq: '显示序号', | |
| 96 | + seqPlaceholder: '必填,请填写显示序号', | |
| 97 | + defaultShow: '手机显示', | |
| 98 | + defaultShowPlaceholder: '必填,请选择是否手机显示', | |
| 99 | + success: '添加成功', | |
| 100 | + error: '添加失败' | |
| 101 | + }, | |
| 102 | + edit: { | |
| 103 | + title: '修改大类', | |
| 104 | + typeCd: '大类编码', | |
| 105 | + typeName: '大类名称', | |
| 106 | + typeNamePlaceholder: '必填,请填写大类名称', | |
| 107 | + typeDesc: '大类描述', | |
| 108 | + typeDescPlaceholder: '选填,请填写大类描述', | |
| 109 | + seq: '显示序号', | |
| 110 | + seqPlaceholder: '必填,请填写显示序号', | |
| 111 | + defaultShow: '手机显示', | |
| 112 | + defaultShowPlaceholder: '必填,请选择是否显示', | |
| 113 | + success: '修改成功', | |
| 114 | + error: '修改失败' | |
| 115 | + }, | |
| 116 | + delete: { | |
| 117 | + title: '删除确认', | |
| 118 | + confirm: '确定删除信息大类?', | |
| 119 | + success: '删除成功', | |
| 120 | + error: '删除失败' | |
| 121 | + }, | |
| 122 | + validate: { | |
| 123 | + typeCdRequired: '大类编码不能为空', | |
| 124 | + typeNameRequired: '大类名称不能为空', | |
| 125 | + typeNameMaxLength: '大类名称超过100位', | |
| 126 | + typeDescMaxLength: '描述超过500位', | |
| 127 | + seqRequired: '显示序号不能为空', | |
| 128 | + seqNumber: '显示序号不是有效数字', | |
| 129 | + defaultShowRequired: '是否显示不能为空' | |
| 130 | + }, | |
| 131 | + fetchError: '获取数据失败' | |
| 132 | + } | |
| 133 | + } | |
| 134 | +} | |
| 0 | 135 | \ No newline at end of file | ... | ... |
src/views/oa/activitiesTypeManageList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="activities-type-manage-container"> | |
| 3 | + <!-- 查询条件 --> | |
| 4 | + <el-card class="search-wrapper"> | |
| 5 | + <div slot="header" class="flex justify-between"> | |
| 6 | + <span>{{ $t('activitiesTypeManage.search.title') }}</span> | |
| 7 | + </div> | |
| 8 | + <el-row :gutter="20"> | |
| 9 | + <el-col :span="6"> | |
| 10 | + <el-input v-model="searchForm.typeCd" :placeholder="$t('activitiesTypeManage.search.typeCd')" clearable /> | |
| 11 | + </el-col> | |
| 12 | + <el-col :span="6"> | |
| 13 | + <el-input v-model="searchForm.typeName" :placeholder="$t('activitiesTypeManage.search.typeName')" clearable /> | |
| 14 | + </el-col> | |
| 15 | + <el-col :span="6"> | |
| 16 | + <el-select v-model="searchForm.defaultShow" :placeholder="$t('activitiesTypeManage.search.defaultShow')" | |
| 17 | + style="width:100%"> | |
| 18 | + <el-option :label="$t('activitiesTypeManage.search.all')" value="" /> | |
| 19 | + <el-option :label="$t('activitiesTypeManage.search.yes')" value="Y" /> | |
| 20 | + <el-option :label="$t('activitiesTypeManage.search.no')" value="N" /> | |
| 21 | + </el-select> | |
| 22 | + </el-col> | |
| 23 | + <el-col :span="6"> | |
| 24 | + <el-button type="primary" @click="handleSearch"> | |
| 25 | + {{ $t('common.search') }} | |
| 26 | + </el-button> | |
| 27 | + <el-button @click="handleReset"> | |
| 28 | + {{ $t('common.reset') }} | |
| 29 | + </el-button> | |
| 30 | + </el-col> | |
| 31 | + </el-row> | |
| 32 | + </el-card> | |
| 33 | + | |
| 34 | + <!-- 列表 --> | |
| 35 | + <el-card class="list-wrapper"> | |
| 36 | + <div slot="header" class="flex justify-between"> | |
| 37 | + <span>{{ $t('activitiesTypeManage.list.title') }}</span> | |
| 38 | + <el-button type="primary" style="float: right;" @click="handleAdd"> | |
| 39 | + {{ $t('common.add') }} | |
| 40 | + </el-button> | |
| 41 | + </div> | |
| 42 | + | |
| 43 | + <el-table v-loading="loading" :data="tableData" border style="width: 100%"> | |
| 44 | + <el-table-column prop="typeCd" :label="$t('activitiesTypeManage.table.typeCd')" align="center" /> | |
| 45 | + <el-table-column prop="typeName" :label="$t('activitiesTypeManage.table.typeName')" align="center" /> | |
| 46 | + <el-table-column prop="typeDesc" :label="$t('activitiesTypeManage.table.typeDesc')" align="center" /> | |
| 47 | + <el-table-column prop="seq" :label="$t('activitiesTypeManage.table.seq')" align="center" /> | |
| 48 | + <el-table-column prop="defaultShow" :label="$t('activitiesTypeManage.table.defaultShow')" align="center"> | |
| 49 | + <template slot-scope="scope"> | |
| 50 | + {{ scope.row.defaultShow === 'Y' ? $t('common.yes') : $t('common.no') }} | |
| 51 | + </template> | |
| 52 | + </el-table-column> | |
| 53 | + <el-table-column :label="$t('common.operation')" align="center" width="200"> | |
| 54 | + <template slot-scope="scope"> | |
| 55 | + <el-button size="mini" type="primary" @click="handleEdit(scope.row)"> | |
| 56 | + {{ $t('common.edit') }} | |
| 57 | + </el-button> | |
| 58 | + <el-button size="mini" type="danger" @click="handleDelete(scope.row)"> | |
| 59 | + {{ $t('common.delete') }} | |
| 60 | + </el-button> | |
| 61 | + </template> | |
| 62 | + </el-table-column> | |
| 63 | + </el-table> | |
| 64 | + | |
| 65 | + <el-pagination :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | |
| 66 | + :total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | |
| 67 | + @current-change="handleCurrentChange" /> | |
| 68 | + </el-card> | |
| 69 | + | |
| 70 | + <!-- 子组件 --> | |
| 71 | + <add-activities-type ref="addDialog" @success="handleSuccess" /> | |
| 72 | + <edit-activities-type ref="editDialog" @success="handleSuccess" /> | |
| 73 | + <delete-activities-type ref="deleteDialog" @success="handleSuccess" /> | |
| 74 | + </div> | |
| 75 | +</template> | |
| 76 | + | |
| 77 | +<script> | |
| 78 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 79 | +import { queryActivitiesType } from '@/api/oa/activitiesTypeManageApi' | |
| 80 | +import AddActivitiesType from '@/components/oa/addActivitiesType' | |
| 81 | +import EditActivitiesType from '@/components/oa/editActivitiesType' | |
| 82 | +import DeleteActivitiesType from '@/components/oa/deleteActivitiesType' | |
| 83 | + | |
| 84 | +export default { | |
| 85 | + name: 'ActivitiesTypeManageList', | |
| 86 | + components: { | |
| 87 | + AddActivitiesType, | |
| 88 | + EditActivitiesType, | |
| 89 | + DeleteActivitiesType | |
| 90 | + }, | |
| 91 | + data() { | |
| 92 | + return { | |
| 93 | + loading: false, | |
| 94 | + searchForm: { | |
| 95 | + typeCd: '', | |
| 96 | + typeName: '', | |
| 97 | + defaultShow: '', | |
| 98 | + communityId: '' | |
| 99 | + }, | |
| 100 | + tableData: [], | |
| 101 | + pagination: { | |
| 102 | + current: 1, | |
| 103 | + size: 10, | |
| 104 | + total: 0 | |
| 105 | + } | |
| 106 | + } | |
| 107 | + }, | |
| 108 | + created() { | |
| 109 | + this.searchForm.communityId = getCommunityId() | |
| 110 | + this.getList() | |
| 111 | + }, | |
| 112 | + methods: { | |
| 113 | + async getList() { | |
| 114 | + try { | |
| 115 | + this.loading = true | |
| 116 | + const params = { | |
| 117 | + page: this.pagination.current, | |
| 118 | + row: this.pagination.size, | |
| 119 | + ...this.searchForm | |
| 120 | + } | |
| 121 | + const { data, total } = await queryActivitiesType(params) | |
| 122 | + this.tableData = data | |
| 123 | + this.pagination.total = total | |
| 124 | + } catch (error) { | |
| 125 | + this.$message.error(this.$t('activitiesTypeManage.fetchError')) | |
| 126 | + } finally { | |
| 127 | + this.loading = false | |
| 128 | + } | |
| 129 | + }, | |
| 130 | + handleSearch() { | |
| 131 | + this.pagination.current = 1 | |
| 132 | + this.getList() | |
| 133 | + }, | |
| 134 | + handleReset() { | |
| 135 | + this.searchForm = { | |
| 136 | + typeCd: '', | |
| 137 | + typeName: '', | |
| 138 | + defaultShow: '', | |
| 139 | + communityId: getCommunityId() | |
| 140 | + } | |
| 141 | + this.pagination.current = 1 | |
| 142 | + this.getList() | |
| 143 | + }, | |
| 144 | + handleAdd() { | |
| 145 | + this.$refs.addDialog.open() | |
| 146 | + }, | |
| 147 | + handleEdit(row) { | |
| 148 | + this.$refs.editDialog.open(row) | |
| 149 | + }, | |
| 150 | + handleDelete(row) { | |
| 151 | + this.$refs.deleteDialog.open(row) | |
| 152 | + }, | |
| 153 | + handleSuccess() { | |
| 154 | + this.getList() | |
| 155 | + }, | |
| 156 | + handleSizeChange(val) { | |
| 157 | + this.pagination.size = val | |
| 158 | + this.getList() | |
| 159 | + }, | |
| 160 | + handleCurrentChange(val) { | |
| 161 | + this.pagination.current = val | |
| 162 | + this.getList() | |
| 163 | + } | |
| 164 | + } | |
| 165 | +} | |
| 166 | +</script> | |
| 167 | + | |
| 168 | +<style lang="scss" scoped> | |
| 169 | +.activities-type-manage-container { | |
| 170 | + padding: 20px; | |
| 171 | + | |
| 172 | + .search-wrapper { | |
| 173 | + margin-bottom: 20px; | |
| 174 | + | |
| 175 | + .el-row { | |
| 176 | + margin-bottom: -20px; | |
| 177 | + } | |
| 178 | + | |
| 179 | + .el-col { | |
| 180 | + margin-bottom: 20px; | |
| 181 | + } | |
| 182 | + } | |
| 183 | + | |
| 184 | + .list-wrapper { | |
| 185 | + .el-pagination { | |
| 186 | + margin-top: 20px; | |
| 187 | + text-align: right; | |
| 188 | + } | |
| 189 | + } | |
| 190 | +} | |
| 191 | +</style> | |
| 0 | 192 | \ No newline at end of file | ... | ... |