Browse Source

feat:故障风险管理UI完善

master
liujiangyong 1 year ago
parent
commit
c7c4822207
  1. 3
      weapp/images/arrow_right_blue.svg
  2. BIN
      weapp/images/calendar_card_bg.png
  3. BIN
      weapp/images/calendar_icon.png
  4. BIN
      weapp/images/fault_icon.png
  5. BIN
      weapp/images/right_bg.png
  6. BIN
      weapp/images/right_card_bg.png
  7. BIN
      weapp/images/right_icon.png
  8. 13
      weapp/package/riskManagement/riskCalendar/riskCalendar.js
  9. 8
      weapp/package/riskManagement/riskCalendar/riskCalendar.json
  10. 74
      weapp/package/riskManagement/riskCalendar/riskCalendar.wxml
  11. 105
      weapp/package/riskManagement/riskCalendar/riskCalendar.wxss
  12. 8
      weapp/package/riskManagement/riskManagement.js
  13. 42
      weapp/package/riskManagement/riskManagement.wxml
  14. 45
      weapp/package/riskManagement/riskManagement.wxss

3
weapp/images/arrow_right_blue.svg

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" class="design-iconfont">
<path d="M8.918625,6.235875 C8.924625,6.22423828 8.93436328,6.21451172 8.939625,6.20248828 C9.04275,5.98798828 9.009,5.7255 8.826375,5.55298828 L4.68675,1.637625 C4.46098828,1.42423828 4.10513672,1.43436328 3.891375,1.65976172 C3.67798828,1.88551172 3.68775,2.24136328 3.91351172,2.45513672 L7.62788672,5.968875 L3.928125,9.53475 C3.704625,9.75036328 3.697875,10.1062383 3.91351172,10.330125 C4.02375,10.4448633 4.17113672,10.5022617 4.31851172,10.5022617 C4.45913672,10.5022617 4.59976172,10.4497617 4.70888672,10.3447617 L8.81101172,6.39113672 C8.81889844,6.38325 8.821875,6.37238672 8.82976172,6.36414844 C8.83577344,6.35852344 8.84213672,6.35438672 8.848125,6.34839844 C8.88,6.315 8.896875,6.27411328 8.918625,6.235875 L8.918625,6.235875 Z" fill-opacity=".65" fill="#1684FF" fill-rule="nonzero"/>
</svg>

After

Width:  |  Height:  |  Size: 895 B

BIN
weapp/images/calendar_card_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

BIN
weapp/images/calendar_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
weapp/images/fault_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

BIN
weapp/images/right_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
weapp/images/right_card_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
weapp/images/right_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

13
weapp/package/riskManagement/riskCalendar/riskCalendar.js

@ -5,7 +5,20 @@ Page({
* 页面的初始数据
*/
data: {
show: false,
level: ['轻微', '中度', '严重'],
curLevel: '轻微',
todayAlarm: [1, 2, 3],
},
showPopup() {
this.setData({ show: true })
},
onCancel() {
this.setData({ show: false })
},
onConfirm(e) {
this.setData({ curLevel: e.detail.value, show: false })
},
/**

8
weapp/package/riskManagement/riskCalendar/riskCalendar.json

@ -1,9 +1,11 @@
{
"navigationBarBackgroundColor": "#1979ff",
"navigationBarBackgroundColor": "#006BE3",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "故障日历",
"navigationBarTitleText": "故障风险管理",
"enablePullDownRefresh": false,
"usingComponents": {
"ec-canvas": "../../components/ec-canvas/ec-canvas"
"van-calendar": "@vant/weapp/calendar/index",
"van-picker": "@vant/weapp/picker/index",
"van-popup": "@vant/weapp/popup/index"
}
}

74
weapp/package/riskManagement/riskCalendar/riskCalendar.wxml

@ -1,2 +1,74 @@
<!--package/riskManagement/riskCalendar/riskCalendar.wxml-->
<text>package/riskManagement/riskCalendar/riskCalendar.wxml</text>
<view class="risk-calendar">
<view class="card">
<view class="card-top flex flex-between">
<view class="card-left flex">
<image class="card-icon" src="/images/calendar_icon.png" />
<view class="title">巡检日历</view>
</view>
<view class="card-right">{{'2023-10-20'}}</view>
<image src="/images/calendar_card_bg.png" class="card-bg" />
</view>
<view class="calendar-box">
<van-calendar
show-mark="{{ false }}"
show-title="{{ false }}"
show-subtitle="{{ false }}"
poppable="{{ false }}"
show-confirm="{{ false }}"
row-height="48"
color="#1684FF"
class="calendar"
/>
</view>
</view>
<view class="title-box flex flex-between ">
<view class="title">异常等级</view>
<view class="flex" bind:tap="showPopup">
<view class="picker-text">{{curLevel}}</view>
<image class="arrow" src="/images/arrow_right_blue.svg" />
</view>
</view>
<van-popup show="{{ show }}" round position="bottom" bind:click-overlay="onCancel">
<van-picker
show-toolbar
columns="{{ level }}"
bind:cancel="onCancel"
bind:confirm="onConfirm"
/>
</van-popup>
<view wx:for="{{todayAlarm}}" class="card" style="margin-bottom: 10px">
<view class="card-top flex flex-between">
<view class="card-left flex">
<image class="card-icon" src="/images/right_icon.png" />
<view class="title">结构物A</view>
</view>
<view class="card-right-btn flex">查看详情</view>
<image src="/images/right_card_bg.png" class="card-bg" />
</view>
<view class="card-content">
<view class="row flex flex-between">
<view class="content-left">本次巡检日期</view>
<view class="content-right">2020/12/21 17:00:00</view>
</view>
<view class="row flex flex-between">
<view class="content-left">点位</view>
<view class="content-right">点位A</view>
</view>
<view class="row flex flex-between">
<view class="content-left">巡检人</view>
<view class="content-right">离成功</view>
</view>
<view class="row flex flex-between">
<view class="content-left">巡检结果</view>
<view class="content-right" style="color: red;">异常</view>
</view>
<view class="row flex flex-between">
<view class="content-left">异常等级</view>
<view class="content-right" style="color: red;">轻微</view>
</view>
</view>
</view>
</view>

105
weapp/package/riskManagement/riskCalendar/riskCalendar.wxss

@ -1 +1,104 @@
/* package/riskManagement/riskCalendar/riskCalendar.wxss */
/* package/riskManagement/riskCalendar/riskCalendar.wxss */
.risk-calendar {
height: 100%;
background-image: linear-gradient(179deg, #006BE3 0%, #4E87FF 16%, #4e87ff00 93%);
padding: 0 15px;
}
.card {
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 2px 2px 11px 0 #00000008, 0 0 4px 0 #00000012;
border-radius: 4px;
}
.card-top {
height: 68px;
background-image: linear-gradient(0deg, #F3F7FF 84%, #DBE6FF 100%);
border-radius: 4px;
position: relative;
}
.card-bg {
position: absolute;
top: 0;
right: 11px;
width: 115px;
height: 67px;
}
.card-left {
margin-left: 23px;
font-weight: 500;
font-size: 16px;
color: #000000d9;
}
.card-right {
margin-right: 18px;
color: #1684FF;
}
.card-right-btn {
width: 76px;
height: 26px;
margin-right: 18px;
background: #1684FF;
border-radius: 16px;
color: #fff;
font-size: 13px;
}
.card-icon {
width: 30px;
height: 30px;
margin-right: 8px;
}
.calendar-box {
padding-bottom: 12px;
}
.calendar {
--calendar-height: 300px;
}
.title-box {
margin: 10px 0;
}
.title {
font-weight: 600;
font-size: 16px;
color: #383A3B;
}
.picker-text {
font-weight: 600;
color: #1684FF;
text-align: right;
}
.arrow {
width: 12px;
height: 12px;
transform: rotate(90deg);
margin-left: 9px;
}
.card-content {
padding-bottom: 10px;
}
.row {
margin: 4px 26px;
color: #31373E;
}
.content-left {
font-size: 12px;
}
.content-right {
font-size: 14px;
}

8
weapp/package/riskManagement/riskManagement.js

@ -38,7 +38,7 @@ Page({
lazyLoad: true, // 将 lazyLoad 设为 true 后,需要手动初始化图表
},
isLoaded: false,
list: [1,2,3]
list: [1, 2, 3, 4],
},
// 初始化图表
@ -65,6 +65,12 @@ Page({
});
},
toCalendar() {
wx.navigateTo({
url: '/package/riskManagement/riskCalendar/riskCalendar',
})
},
/**
* 生命周期函数--监听页面加载
*/

42
weapp/package/riskManagement/riskManagement.wxml

@ -1,5 +1,7 @@
<!-- package / riskManagement / riskManagement.wxml -->
<view class="risk-management">
<image src="/images/right_bg.png" class="page-bg" />
<view class="icon"><text class="icon-text">故障统计</text></view>
<view class="flex flex-between">
@ -15,8 +17,7 @@
<view class="card">
<view class="flex flex-start">
<!-- <image src="" class="card-img" /> -->
<view class="card-img" style="background: blue;"></view>
<image src="/images/fault_icon.png" class="card-img" />
<view class="card-title">历史风险趋势</view>
</view>
<view class="chart">
@ -26,16 +27,45 @@
<view class="card">
<view class="flex flex-between">
<!-- <image src="" class="card-img" /> -->
<view class="flex">
<view class="card-img" style="background: blue;"></view>
<image src="/images/fault_icon.png" class="card-img" />
<view class="card-title">故障排行榜</view>
</view>
<view class="card-link">查看详情 ></view>
<view class="card-link" bindtap="toCalendar">查看详情 ></view>
</view>
<view style="margin-top: 10px">【故障次数统计】</view>
<view class="list" wx:for="{{list}}">
<view class="list-title">设备{{item}}</view>
<view class="list-line" />
<view class="list-content flex flex-between">
<view class="content-item content-left">
<view>所属结构物</view>
<view>故障次数</view>
<view>问题概述</view>
</view>
<view class="content-item content-right">
<view>管廊{{item}}</view>
<view>{{10}}次</view>
<view>{{'设备损坏' + item}}</view>
</view>
</view>
</view>
<view>【故障次数统计】</view>
<view style="margin-top: 10px">【故障评分统计】</view>
<view class="list" wx:for="{{list}}">
<view class="list-title">设备{{item}}</view>
<view class="list-line" />
<view class="list-content flex flex-between">
<view class="content-item content-left">
<view>所属结构物</view>
<view>故障评分</view>
<view>等级分布</view>
</view>
<view class="content-item content-right">
<view>管廊{{item}}</view>
<view>{{15 - item}}</view>
<view>严重:{{5-item}}次,中等{{2}}次,轻微{{1}}次</view>
</view>
</view>
</view>
</view>
</view>

45
weapp/package/riskManagement/riskManagement.wxss

@ -1,10 +1,18 @@
/* package/riskManagement/riskManagement.wxss */
.risk-management {
height: 100vh;
height: 100%;
background-image: linear-gradient(179deg, #006BE3 0%, #4E87FF 16%, #4e87ff00 93%);
padding: 0 15px;
}
.page-bg {
position: absolute;
width: 161px;
height: 174px;
opacity: 0.61;
right: 43px;
}
.icon {
width: 61px;
height: 31.86px;
@ -22,6 +30,7 @@
}
.title-item {
margin-top: 50px;
width: 150px;
color: #ffffffd9;
}
@ -43,6 +52,7 @@
border-radius: 4px;
padding: 12px;
margin-top: 12px;
position: relative;
}
.card-img {
@ -73,4 +83,37 @@
margin-top: 10px;
padding: 10px 7px;
background-color: #F1F7FF;
border-radius: 4px;
}
.list-title {
font-weight: 500;
font-size: 15px;
color: #1684FF;
}
.list-line {
width: 100%;
border-top: 1px solid #DAE6F6;
margin: 5px 0;
}
.list-content {
color: #31373E;
}
.content-item {
height: 72px;
display: flex;
flex-direction: column;
justify-content: space-evenly;
}
.content-left {
font-size: 12px;
}
.content-right {
font-size: 14px;
text-align: right;
}
Loading…
Cancel
Save