v1.9 业主页面男女 bug 修复

This commit is contained in:
wuxw 2025-07-30 17:50:29 +08:00
parent 8adb868d01
commit a87d01dc29
4 changed files with 15 additions and 13 deletions

View File

@ -93,7 +93,7 @@ export function uploadImage(data) {
formData.append('communityId', getCommunityId())
request({
url: 'uploadImage',
url: '/callComponent/upload/uploadFile/uploadImage',
method: 'post',
data: formData,
headers: {
@ -101,11 +101,7 @@ export function uploadImage(data) {
}
}).then(response => {
const res = response.data
if (res.code == 0) {
resolve(res)
} else {
reject(new Error(res.msg || '上传图片失败'))
}
}).catch(error => {
reject(error)
})

View File

@ -177,10 +177,11 @@ export default {
async loadAttributes() {
try {
const data = await getAttrSpecList({ page: 1, row: 100, tableName: 'building_owner_attr' })
const {data} = await getAttrSpecList({ page: 1, row: 100, tableName: 'building_owner_attr' })
this.attrs = data.filter(item => item.specShow === 'Y')
for (const attr of this.attrs) {
attr.value = ''
if (attr.specType === '3344') {
attr.values = await getAttrValue(attr.specCd)
attr.value = ''
@ -207,8 +208,8 @@ export default {
async uploadImage({ file }) {
try {
const res = await uploadImage({ file })
this.form.ownerPhoto = res.data.fileId
this.form.ownerPhotoUrl = res.data.url
this.form.ownerPhoto = res.fileId
this.form.ownerPhotoUrl = res.url
} catch (error) {
this.$message.error(this.$t('listOwner.upload.failed'))
}

View File

@ -37,7 +37,7 @@
<el-col :span="12" class="text-center">
<el-image style="width: 200px; height: 150px; border: 1px dashed #ccc;"
:src="form.ownerPhotoUrl || '/img/noPhoto.jpg'" fit="cover" />
<el-upload class="mt-10" :show-file-list="false" :before-upload="beforeUpload" :http-request="uploadImage">
<el-upload class="mt-10" :show-file-list="false" :before-upload="beforeUpload" :http-request="uploadImage" action="">
<el-button size="small" type="primary">
{{ $t('common.upload') }}
</el-button>
@ -179,10 +179,14 @@ export default {
async loadAttributes() {
try {
const data = await getAttrSpecList({ page: 1, row: 100, tableName: 'building_owner_attr' })
const {data} = await getAttrSpecList({ page: 1, row: 100, tableName: 'building_owner_attr' })
if (data.length == 0) {
return
}
this.attrs = data.filter(item => item.specShow === 'Y')
for (const attr of this.attrs) {
attr.value = ''
if (attr.specType === '3344') {
attr.values = await getAttrValue(attr.specCd)
}
@ -214,8 +218,9 @@ export default {
async uploadImage({ file }) {
try {
const res = await uploadImage({ file })
this.form.ownerPhoto = res.data.fileId
this.form.ownerPhotoUrl = res.data.url
this.form.ownerPhoto = res.fileId
this.form.ownerPhotoUrl = res.url
this.$forceUpdate()
} catch (error) {
this.$message.error(this.$t('listOwner.upload.failed'))
}

View File

@ -274,7 +274,7 @@ export default {
async getColumns() {
try {
const data = await getAttrSpecList({
const {data} = await getAttrSpecList({
page: 1,
row: 100,
tableName: 'building_owner_attr'