Liuyi
2024-12-02 e0cfcb8487f5f502b9e42a0c508fae71b6b56c55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<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>