<script setup>
|
import { ref ,onMounted} from 'vue';
|
import { searchMaintainApi } from '../../api/index.js'
|
import { BASE_URL } from '../../config/baseUrl.js';
|
|
const baseUrl = ref(BASE_URL)
|
const maintainList = ref([])
|
async function searchMaintain(){
|
await searchMaintainApi({limit:10000,page:1}).then((res) =>{
|
if(res.code == 200){
|
maintainList.value = res.data.list
|
maintainList.value.forEach((item) =>{
|
item.resultTypeView = item.resultType == 1 ? '正常' : ( item.resultType == 2 ? '异常' : '')
|
})
|
}
|
})
|
}
|
onMounted(async() =>{
|
await searchMaintain()
|
})
|
</script>
|
<template>
|
<view class="container">
|
<navbar title = '维护记录'></navbar>
|
<view class="content">
|
<view v-if="maintainList.length > 0" class="main">
|
<view v-for="(item,index) in maintainList" class="item">
|
<view class="item-child">
|
<text>维修人:</text>
|
<text class="value">{{item.inspectUser}}</text>
|
</view>
|
<view class="item-child-area">
|
<view>维修内容:</view>
|
<textarea class="text-area value">{{item.content}}</textarea>
|
</view>
|
<view class="item-child">
|
<text>维修状态:</text>
|
<text class="value">{{item.resultTypeView}}</text>
|
</view>
|
<view class="item-child">
|
<text>维修时间:</text>
|
<text class="value">{{item.createTimeView}}</text>
|
</view>
|
<view class="item-child">
|
<text>备注:</text>
|
<text class="value remark">{{item.remark}}</text>
|
</view>
|
<view class="item-child-area">
|
<text>上传图片:</text>
|
<view class="item-img-box">
|
<image class="item-img" :src="baseUrl + '/upload' + item.inspectUrl" mode="aspectFit"></image>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="nodata" v-else>
|
<image class="nodata-img" src="../../static/images/other/nodata.png" mode="widthFix"></image>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<style lang="scss" scoped>
|
.container{
|
width:100%;
|
box-sizing: border-box;
|
.content{
|
height:calc(100vh - 176rpx);
|
background: linear-gradient(to bottom,#8BC1FC 0%,#D2F2FE 30%,#D2F2FE 100%);
|
padding:30rpx 30rpx 100rpx;
|
box-sizing: border-box;
|
.main{
|
width:100%;
|
height:100%;
|
padding:20rpx;
|
box-sizing: border-box;
|
background:rgba(255, 255, 255, 0.6);
|
border-radius:10rpx;
|
overflow: scroll;
|
.item{
|
width:100%;
|
// height:500rpx;
|
border:1rpx solid rgba(77,173,225,0.3);
|
border-radius:10rpx;
|
background: rgba(255, 255, 255, 0.6);
|
margin-bottom:40rpx;
|
display: flex;
|
flex-direction: column;
|
padding:20rpx 30rpx;
|
justify-content: space-between;
|
box-sizing: border-box;
|
color: rgba(48,102,218,0.6);
|
box-shadow: 0 3rpx 5rpx 1rpx rgba(197, 199, 203, 0.6);
|
.value{
|
color: rgba(86, 86, 90, 1.0);
|
}
|
.item-child{
|
width:100%;
|
margin-bottom:20rpx;
|
.remark{
|
margin-left:5%;
|
font-size:28rpx;
|
}
|
}
|
.item-child-area{
|
width:100%;
|
display: flex;
|
flex-direction: column;
|
margin-bottom:20rpx;
|
.text-area{
|
width:90%;
|
margin-top:20rpx;
|
margin-left:5%;
|
border:1rpx solid rgba(116, 160, 255, 0.3);
|
font-size:28rpx;
|
padding:20rpx;
|
box-sizing: border-box;
|
border-radius:10rpx;
|
}
|
.item-img-box{
|
width:220rpx;
|
height:220rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
border: 1rpx dashed #8BC1FC;
|
margin-top:20rpx;
|
margin-left:10%;
|
.item-img{
|
width:200rpx;
|
height:200rpx;
|
}
|
}
|
}
|
}
|
}
|
.nodata{
|
width:100%;
|
height:100%;
|
display: flex;
|
justify-content: center;
|
background: rgba(255,255,255,0.6);
|
border-radius:10rpx;
|
padding-top:150rpx;
|
box-sizing: border-box;
|
.nodata-img{
|
width: 520rpx;
|
}
|
}
|
}
|
}
|
|
</style>
|