123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <view class="fault-page">
- <navigation title="故障处理"></navigation>
- <view class="list-box" v-if="dataList.length>0">
- <view class="datetime-picker-box">
- <uni-datetime-picker v-model="single" type="date" @change="confirm" :border="false" />
- </view>
- <view class="list-item" v-for="(item, index) in dataList" :key="index">
- <view class="item-text">设备名称:{{ item.equipmentName || '-' }}</view>
- <view class="item-text">故障发生时间:{{ item.createTime || '-' }}</view>
- <view class="item-text">重新运行时间:{{ item.relieveTime || '-' }}</view>
- <view class="item-text">故障时长:{{ dayjs(item.relieveTime).diff(dayjs(item.createTime), 'minute') }}</view>
- </view>
- </view>
- <empty v-else text="暂无数据"></empty>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- dataList: [],
- single: '',
- }
- },
- onShow() {
- this.single = this.dayjs().format('YYYY-MM-DD')
- this.getList()
- },
- methods: {
- confirm(e) {
- this.single = e
- this.getList()
- },
- getList() {
- uni.showLoading({
- title: '正在加载...'
- })
- let params = {
- createTime: this.single
- }
- this.$api.iofaultList(params).then(res => {
- this.dataList = res.rows
- uni.hideLoading()
- }).catch(err => {})
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .fault-page {
- .list-box {
- padding: 0 20rpx;
- color: $uni-text-color-list;
- .datetime-picker-box {
- background-color: $uni-bg-color;
- width: 100%;
- margin-top: 20rpx;
- }
- .list-item {
- background-color: $uni-bg-color;
- padding: 20rpx;
- border-radius: 20rpx;
- margin-top: 28rpx;
- .item-text {
- margin-top: 10rpx;
- }
- }
- .btn-box {
- display: flex;
- justify-content: flex-end;
- margin-top: 10rpx;
- .btn-item {
- width: 175rpx;
- height: 50rpx;
- line-height: 50rpx;
- text-align: center;
- border-radius: 24rpx;
- margin-left: 20rpx;
- border: 1px solid #43adfd;
- color: #43adfd;
- }
- }
- }
- }
- </style>
|