Browse Source

巡检记录详情UI

master
liujiangyong 2 years ago
parent
commit
2c714f69a9
  1. 2
      weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.js
  2. 6
      weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.json
  3. 64
      weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxml
  4. 14
      weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxss

2
weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.js

@ -12,7 +12,7 @@ Page({
handleChange(e) { handleChange(e) {
this.setData({ this.setData({
activeValues: e.detail.value, activeValues: e.detail,
}); });
}, },

6
weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.json

@ -4,7 +4,9 @@
"navigationBarTitleText": "巡检记录详情", "navigationBarTitleText": "巡检记录详情",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"usingComponents": { "usingComponents": {
"t-collapse": "tdesign-miniprogram/collapse/collapse", "van-cell": "@vant/weapp/cell/index",
"t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel" "van-cell-group": "@vant/weapp/cell-group/index",
"van-collapse": "@vant/weapp/collapse/index",
"van-collapse-item": "@vant/weapp/collapse-item/index"
} }
} }

64
weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxml

@ -1,45 +1,25 @@
<!-- package/inspectionRecord/inspectionRecordDetail/inspectionRecordDetail.wxml --> <!-- package/inspectionRecord/inspectionRecordDetail/inspectionRecordDetail.wxml -->
<view class="page"> <view class="page">
<view class='list'> <van-cell-group>
<view class='content'> <van-cell size="large" title="结构物名称:" value="{{dataList.points.project.name}}" />
<view class='title'>结构物名称:</view> <van-cell size="large" title="巡检人:" value="{{dataList.points.user.name}}" />
<view class='value'>{{dataList.points.project.name}}</view> <van-cell size="large" title="巡检单位:" value="{{dataList.points.user.department.name}}" />
</view> <van-cell size="large" title="巡检频次:" value="{{dataList.points.frequency}}" />
<view class='content'> <van-cell size="large" title="上次巡检日期:" value="{{dataList.lastInspectionTime}}" />
<view class='title'>巡检人:</view> <van-cell size="large" title="本次巡检日期:" value="{{dataList.inspectionTime}}" />
<view class='value'>{{dataList.points.user.name}}</view> <van-cell size="large" title="巡检结果:" value="{{dataList.alarm ? '异常' : '正常'}}" style="--cell-value-color: {{dataList.alarm ? '#FF0000' : '#006BE3'}}" />
</view> <van-cell size="large" title="当前点位:" value="{{dataList.points.itemData.name}}" />
<view class='content'> <van-cell size="large" title="当前位置:" value="{{dataList.points.address}}" title-width="80px" />
<view class='title'>巡检单位:</view> </van-cell-group>
<view class='value'>{{dataList.points.user.department.name}}</view> <view style="margin-top: 16px">
</view> <van-collapse value="{{ activeValues }}" bind:change="handleChange">
<view class='content'>
<view class='title'>巡检频次:</view>
<view class='value'>{{dataList.points.frequency}}</view>
</view>
<view class='content'>
<view class='title'>上次巡检日期:</view>
<view class='value'>{{dataList.lastInspectionTime}}</view>
</view>
<view class='content'>
<view class='title'>本次巡检日期:</view>
<view class='value'>{{dataList.inspectionTime}}</view>
</view>
<view class='content'>
<view class='title'>巡检结果:</view>
<view class='value'>{{dataList.alarm ? '异常' : '正常'}}</view>
</view>
<view class='content'>
<view class='title'>当前点位:</view>
<view class='value'>{{dataList.points.itemData.name}}</view>
</view>
<view class='content'>
<view class='title'>当前位置:</view>
<view class='value'>{{dataList.points.address}}</view>
</view>
<t-collapse value="{{activeValues}}" bind:change="handleChange">
<view wx:for="{{dataList.points.inspectContent}}" wx:key="key" wx:for-index="key" wx:for-item="value"> <view wx:for="{{dataList.points.inspectContent}}" wx:key="key" wx:for-index="key" wx:for-item="value">
<t-collapse-panel header="{{key + ': ' + (value.isNormal ? '正常' : '异常')}}" value="{{key}}" expandIcon disabled="{{value.isNormal}}"> <van-collapse-item
title="{{key}}"
value="{{value.isNormal ? '正常' : '异常'}}"
style="--cell-value-color: {{value.isNormal ? '#006BE3' : '#FF0000'}}; --collapse-item-title-disabled-color: #323233"
disabled="{{value.isNormal}}"
>
<view class='content'> <view class='content'>
<view class='title'>描述:</view> <view class='title'>描述:</view>
<view class='value'>{{value.msgInp || '--'}}</view> <view class='value'>{{value.msgInp || '--'}}</view>
@ -48,14 +28,14 @@
<view class='title'>异常等级:</view> <view class='title'>异常等级:</view>
<view class='value'>{{value.level || '--'}}</view> <view class='value'>{{value.level || '--'}}</view>
</view> </view>
<view class='title'>巡检图片:</view> <view class='content'>巡检图片:</view>
<view class="img-v weui-uploader__bd" style="overflow:hidden;"> <view class="img-v weui-uploader__bd" style="overflow:hidden;">
<view class='pic' wx:for="{{value.imgs}}" wx:for-item="item" wx:key="*this"> <view class='pic' wx:for="{{value.imgs}}" wx:for-item="item" wx:key="*this">
<image class='weui-uploader__img showImg' src="{{imgUrl + item}}" data-img="{{imgUrl + item}}" data-index="{{index}}" data-key="{{key}}" mode="aspectFill" bindtap="previewImg"></image> <image class='weui-uploader__img showImg' src="{{imgUrl + item}}" data-img="{{imgUrl + item}}" data-index="{{index}}" data-key="{{key}}" mode="aspectFill" bindtap="previewImg"></image>
</view> </view>
</view> </view>
</t-collapse-panel> </van-collapse-item>
</view> </view>
</t-collapse> </van-collapse>
</view> </view>
</view> </view>

14
weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxss

@ -3,10 +3,6 @@ page {
background-color: #F7F7FA; background-color: #F7F7FA;
} }
.page {
padding: 30rpx;
}
.header-item-container { .header-item-container {
width: 100%; width: 100%;
height: 180rpx; height: 180rpx;
@ -52,7 +48,8 @@ page {
.content { .content {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
margin-bottom: 30rpx; margin-bottom: 20rpx;
font-size: 14px;
} }
.title { .title {
@ -60,9 +57,8 @@ page {
} }
.value { .value {
float: left; float: right;
text-align: justify; text-align: justify;
width: 400rpx;
word-break: break-word; word-break: break-word;
} }
@ -77,3 +73,7 @@ page {
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
} }
.page .van-icon-arrow {
color: #9699a6 !important;
}
Loading…
Cancel
Save