Browse Source

问题处理巡检记录展示设备信息

master
liujiangyong 1 year ago
parent
commit
2531e0bfc9
  1. 15
      weapp/package/troubleshooting/shootingForm/index.js
  2. 11
      weapp/package/troubleshooting/shootingForm/index.wxml

15
weapp/package/troubleshooting/shootingForm/index.js

@ -69,14 +69,20 @@ Page({
points: {
...issue.PatrolRecord.points,
inspectContent: (() => {
// 1.1 版本(2023-10-18)之前 dataList.points.inspectContent 为 Object, 1.1版本因增加点位关联设备改为 Array
const priorToV1_1 = moment(issue.PatrolRecord.inspectionTime).isBefore(moment('2023-10-18'))
if (priorToV1_1) {
let inspectContent = []
for (let k in issue.PatrolRecord.points.inspectContent) {
inspectContent.push({
...issue.PatrolRecord.points.inspectContent[k],
itemName: k
name: k,
})
}
return inspectContent
return [{ checkItems: inspectContent }]
} else {
return issue.PatrolRecord.points.inspectContent
}
})()
}
}
@ -88,6 +94,7 @@ Page({
isRepair: tabIndex == 0 && (issue.state == 4 || issue.state == 7),
isCheck: tabIndex == 0 && issue.state == 5,
})
console.log(nextData, 'nextData')
this.setData({
strucFocusUser: {
...strucUser,
@ -215,8 +222,8 @@ Page({
// 预览图片
previewImg: function (e) {
const { index, itemindex, type } = e.currentTarget.dataset
const imgs = type == 'point' ? this.data.data.PatrolRecord.points.inspectContent[itemindex].imgs : this.data[type];
const { index, itemindex, deviceidx, type } = e.currentTarget.dataset
const imgs = type == 'point' ? this.data.data.PatrolRecord.points.inspectContent[deviceidx].checkItems[itemindex].imgs : this.data[type];
const newImgs = imgs.map(i => this.data.imgServer + i);
wx.previewImage({
current: newImgs[index],

11
weapp/package/troubleshooting/shootingForm/index.wxml

@ -15,10 +15,12 @@
</view>
<van-field value="{{data.PatrolRecord.points.itemData.name}}" label="点位" readonly accordion />
<van-collapse wx:if="{{data.PatrolRecord.points.inspectContent}}" value="{{ pointItemCollapseActiveNames }}" bind:change="onPointItemCollapseActiveChange" border="{{false}}">
<block wx:for="{{data.PatrolRecord.points.inspectContent}}" wx:key="index">
<van-collapse-item wx:if="{{!item.isNormal}}" name="{{item.itemName}}" border="{{false}}">
<block wx:for="{{data.PatrolRecord.points.inspectContent}}" wx:key="index" wx:for-item="device" wx:for-index="deviceidx">
<van-field wx:if="{{device.deviceName && device.alarm}}" value="{{device.deviceName}}" label="设备" readonly accordion />
<block wx:for="{{device.checkItems}}">
<van-collapse-item wx:if="{{!item.isNormal}}" name="{{item.id}}" border="{{false}}">
<view slot="title">
<van-field value="{{item.itemName}}" label="检查项" readonly />
<van-field value="{{item.name}}" label="检查项" readonly />
</view>
<view slot="">
<van-field value="{{item.level}}" label="异常等级" readonly />
@ -28,7 +30,7 @@
<view class="fs-cell-title" style="">现场照片</view>
<view class="fs-cell-content" style="">
<block wx:for="{{item.imgs}}" wx:for-index="imgIndex" wx:for-item="imgUrl" wx:key="imgIndex">
<image style="height:160rpx;width:160rpx;padding-right:12rpx;" src="{{imgServer+imgUrl}}" data-img="{{imgServer+imgUrl}}" data-index="{{imgIndex}}" data-key="{{imgIndex}}" data-itemindex="{{index}}" mode="aspectFill" bindtap="previewImg" data-type="point"></image>
<image style="height:160rpx;width:160rpx;padding-right:12rpx;" src="{{imgServer+imgUrl}}" data-img="{{imgServer+imgUrl}}" data-index="{{imgIndex}}" data-key="{{imgIndex}}" data-itemindex="{{index}}" data-deviceidx="{{deviceidx}}" mode="aspectFill" bindtap="previewImg" data-type="point"></image>
</block>
</view>
</view>
@ -36,6 +38,7 @@
</view>
</van-collapse-item>
</block>
</block>
</van-collapse>
<view class="mission-card-title mission-center-card-title">
<image class="icon" src="../../../images/title_icon.svg"></image>

Loading…
Cancel
Save