基本功能都已完成
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<view class="margin-bottom">
|
||||
<view v-if="rectifyAttachments.length > 0" class="margin-top">
|
||||
<view v-if="detailData.attachments && detailData.attachments.length > 0" class="margin-top">
|
||||
<view class="flex" style="flex-wrap: wrap; gap: 10rpx;">
|
||||
<image v-for="(img, idx) in rectifyAttachments" :key="idx" :src="getFullPath(img.filePath)" style="width: 136rpx;height: 136rpx;border-radius: 16rpx;" mode="aspectFill" @click="previewRectifyImage(idx)"></image>
|
||||
<image v-for="(img, idx) in detailData.attachments" :key="idx" :src="getFullPath(img.filePath)" style="width: 136rpx;height: 136rpx;border-radius: 16rpx;" mode="aspectFill" @click="previewHazardImage(idx)"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="text-gray text-sm">暂无图片</view>
|
||||
@@ -44,7 +44,12 @@
|
||||
<button class="address-btn bg-blue">选择地址</button>
|
||||
</view>
|
||||
<view class="text-gray text-sm">如:办公楼3层东侧消防通道,生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view>
|
||||
<view class="flex margin-bottom ">
|
||||
|
||||
<!-- 隐患区域 -->
|
||||
<view class="text-gray margin-top margin-bottom">隐患区域</view>
|
||||
<view class="bg-gray padding radius">{{ detailData.areaName || '暂无' }}</view>
|
||||
|
||||
<view class="flex margin-bottom margin-top">
|
||||
<view class="text-gray">隐患描述</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
@@ -74,6 +79,7 @@
|
||||
source: '',
|
||||
description: '',
|
||||
address: '',
|
||||
areaName: '', // 隐患区域名称
|
||||
createdAt: '',
|
||||
attachments: []
|
||||
});
|
||||
@@ -93,8 +99,9 @@
|
||||
};
|
||||
|
||||
// 图片预览 - 隐患图片
|
||||
const previewImage = (attachments, index) => {
|
||||
const urls = attachments.map(item => getFullPath(item.filePath));
|
||||
const previewHazardImage = (index) => {
|
||||
if (!detailData.attachments || detailData.attachments.length === 0) return;
|
||||
const urls = detailData.attachments.map(item => getFullPath(item.filePath));
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: urls
|
||||
@@ -116,6 +123,8 @@
|
||||
const res = await getHiddenDangerDetail({ hazardId, assignId });
|
||||
if (res.code === 0 && res.data) {
|
||||
Object.assign(detailData, res.data);
|
||||
console.log('隐患详情数据:', res.data);
|
||||
console.log('隐患附件:', res.data.attachments);
|
||||
|
||||
// 提取整改附件:assigns[0].rectify.attachments
|
||||
if (res.data.assigns && res.data.assigns.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user