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

View File

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

View File

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

View File

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