提交图片修改

This commit is contained in:
liyuanchao 2025-08-23 13:51:56 +08:00
parent 5a0a86fe4a
commit 9a60d90592
5 changed files with 364 additions and 340 deletions

View File

@ -59,7 +59,7 @@ const install = (Vue, vm) => {
warnsProcess:(params = {})=>vm.$u.post(config.adminPath+'/sis/alarmEvents/complete',params),
getWarnDetail:(params = {}, id) => vm.$u.get(config.adminPath+`/sis/alarmEvents/${id}`,params),
getWarnEventInfo:(params = {}, alarmId) => vm.$u.get(config.adminPath+`/sis/alarmEventAttachments/query/${alarmId}`,params),
getWarnEventInfo:(params = {}, alarmId) => vm.$u.get(config.adminPath+`/sis/alarmEventProcess/query/result/${alarmId}`,params),
//巡检任务列表
getInspection:(params = {})=>vm.$u.get(config.adminPath+'/property/item/list',params),

View File

@ -22,24 +22,16 @@
<image class="right-arrow" src="/static/ic_right_arrow_g.png" />
</view>
<view class="add-repair-label">问题详情 <text class="add-repair-optional">(非必填)</text></view>
<textarea v-model="repairInfo.remark" class="add-repair-detail-textarea" placeholder="如果以上报事不能解决您的问题,可以在这里填写说明" />
<textarea v-model="repairInfo.remark" class="add-repair-detail-textarea"
placeholder="如果以上报事不能解决您的问题,可以在这里填写说明" />
</view>
<!-- 上传照片 -->
<view class="add-repair-section">
<view class="add-repair-label">上传照片 <text class="add-repair-optional">(非必填最多三张)</text></view>
<u-upload
:fileList="selectedImages"
@on-list-change="onListChange"
@delete="deletePic"
name="upload"
multiple
maxCount="3"
width="180"
height="180"
:autoUpload="false"
></u-upload>
<u-upload :fileList="selectedImages" @on-list-change="onListChange" @delete="deletePic" name="upload"
multiple maxCount="3" width="180" height="180" :autoUpload="false"></u-upload>
</view>
<!-- 提交按钮 -->
@ -50,7 +42,9 @@
<script>
// MediaSelectorMediaType
import MediaSelector, { MediaType } from '@/utils/mediaSelector';
import MediaSelector, {
MediaType
} from '@/utils/mediaSelector';
import {
uploadFiles
} from '@/common/upload.js';
@ -77,7 +71,9 @@ export default {
this.selectedType = item;
},
async getOrderType() {
let params = {parentId:'1952989217332658178'}
let params = {
parentId: '1952989217332658178'
}
let res = await this.$u.api.getRepairTypes(params);
if (res.code == '200') {
this.repairTypes = res.data
@ -120,10 +116,17 @@ export default {
name: 'file',
vm: this // token
});
const allSuccess = result.every(item => item.code == 200);
if (!allSuccess) {
uni.showToast({
title: '上传失败',
icon: 'none'
});
return;
}
// resultdata.url,
const urls = result.map(item => item.data?.url || '').filter(url => url !== '');
const urls = result.map(item => item.data?.ossId || '').filter(ossId => ossId !== '');
this.repairInfo.orderImgUrl = urls.join(',');
this.realSubmit()
@ -153,10 +156,14 @@ export default {
});
},
goRepaired() {
uni.navigateTo({ url: '/pages/sys/user/myRepair/repaired' });
uni.navigateTo({
url: '/pages/sys/user/myRepair/repaired'
});
},
goSelectLocation() {
uni.navigateTo({ url: '/pages/sys/user/myRepair/selectLocation' });
uni.navigateTo({
url: '/pages/sys/user/myRepair/selectLocation'
});
}
}
@ -202,6 +209,7 @@ export default {
font-size: 24rpx;
color: #808080;
}
.right-arrow {
width: 11rpx;
height: 21rpx;
@ -254,6 +262,7 @@ export default {
margin-bottom: 40rpx;
box-sizing: border-box;
}
.add-repair-label {
font-size: 32rpx;
color: #000000;
@ -333,5 +342,4 @@ export default {
font-weight: bold;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.18);
}
</style>

View File

@ -74,6 +74,12 @@
created() {
this.onRefresh()
},
onShow() {
uni.$once('refreshData', () => {
this.tabLoaded = [false, false]
this.onRefresh()
});
},
methods: {
goBack() {
uni.navigateBack();

View File

@ -142,7 +142,8 @@ export default {
async loadEevetInfo() {
let res = await this.$u.api.getWarnEventInfo({}, this.warnInfo.id);
if (res.code == "200") {
this.realImages = res.data
this.handleDesc = res.data.workReply
this.realImages = res.data.attachments
}
this.loading = false;
},
@ -182,8 +183,16 @@ export default {
name: 'file',
vm: this
});
const allSuccess = result.every(item => item.code == 200);
if (!allSuccess) {
uni.showToast({
title: '上传失败',
icon: 'none'
});
return;
}
this.realImages = result.map(item => item.data?.url || '').filter(url => url !== '');
this.realImages = result.map(item => item.data?.ossId || '').filter(ossId => ossId !== '');
this.realSubmit();
},

View File

@ -142,6 +142,7 @@ export default {
},
onShow() {
uni.$once('refreshData', () => {
this.tabLoaded = [false, false]
this.onRefresh()
});
},