<template>
|
<view class="item_container">
|
<view class="item_left">
|
<view class="left_count">{{index}}</view>
|
<!-- <view class="left_status">{{item[warnArr[alertType - 0].prop] ? '未处理' : '已处理'}}</view> -->
|
<view class="left_status">未处理</view>
|
</view>
|
<view class="item_right">
|
<view class="right_text">设备: {{item.equipmentName}}({{item.workingProcedure}})</view>
|
<!-- <view class="right_text">时间: {{item.alertTime}}</view> -->
|
<view class="right_text" v-if="alertType=='1'">
|
描述:
|
<view class="desc">
|
<text>{{item.detergentDesc}}</text>
|
</view>
|
</view>
|
<view class="right_text" v-else-if="alertType=='2'">
|
描述:
|
<view class="desc">
|
<text>{{item.knifeToolDesc}}</text>
|
</view>
|
</view>
|
<view class="right_text" v-else-if="alertType=='3'">
|
描述:
|
<view class="desc">
|
<text>{{item.cuttingFluidDesc}}</text>
|
</view>
|
</view>
|
<view class="right_text" v-else>
|
描述:
|
<view class="desc">
|
<text>{{item.alertDesc}}</text>
|
</view>
|
</view>
|
<view class="right_button">
|
<!-- <u-button type="warning" class="right_button_item" @click="closeWarning" :disabled="!item[warnArr[alertType - 0].prop]">关闭</u-button> -->
|
<!-- <u-button type="warning" class="right_button_item" @click="closeWarning">关闭</u-button> -->
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
closeEquipmentAlert
|
} from '@/api/home/index.js'
|
import {
|
$successInfo
|
} from '@/static/js/utils/index.js'
|
export default {
|
props: {
|
alertType: {
|
type: String,
|
required: true
|
},
|
index: {
|
type: Number,
|
required: true
|
},
|
item: {
|
type: Object,
|
required: true
|
}
|
},
|
emits: ['getList'],
|
data() {
|
return {
|
warnArr: [{
|
type: 1,
|
prop: 'isAlertDetergent'
|
}, {
|
type: 2,
|
prop: 'isAlertKnifeTool'
|
}, {
|
type: 3,
|
prop: 'isAlertCuttingFluid'
|
}, {
|
type: 4,
|
prop: 'isAlert'
|
}]
|
}
|
},
|
methods: {
|
//关闭报警
|
closeWarning() {
|
const param = {
|
equipmentId: this.item.equipmentId,
|
alertType: this.alertType
|
}
|
closeEquipmentAlert(param).then(res => {
|
uni.showModal({
|
title: "关闭成功",
|
showCancel: false
|
})
|
this.$emit('getList');
|
})
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.item_container {
|
width: 100%;
|
margin-bottom: 15rpx;
|
background: #fff;
|
display: flex;
|
|
.item_left {
|
width: 25%;
|
display: flex;
|
flex-direction: column;
|
justify-content: start;
|
align-items: center;
|
margin-top: 20rpx;
|
|
.left_count {
|
width: 40rpx;
|
height: 40rpx;
|
color: #fff;
|
background: #F18202;
|
font-size: 30rpx;
|
text-align: center;
|
line-height: 40rpx;
|
border-radius: 50%;
|
margin-bottom: 15rpx;
|
}
|
|
.left_status {
|
padding: 8rpx;
|
color: #ff0000;
|
border: 1px solid #ff0000;
|
}
|
}
|
|
.item_right {
|
padding: 20rpx 0;
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-around;
|
align-items: flex-start;
|
font-size: 32rpx;
|
font-weight: 700;
|
|
.right_text {
|
margin-bottom: 15rpx;
|
|
.desc {
|
margin-left: 20rpx;
|
font-weight: 400;
|
font-size: 30rpx;
|
}
|
}
|
|
.right_button {
|
align-self: flex-end;
|
padding-right: 30rpx;
|
box-sizing: border-box;
|
|
.right_button_item {
|
background: #F18202;
|
width: 150rpx;
|
}
|
|
}
|
}
|
}
|
</style>
|