首页报警列表样式调整

test
zhangdi 1 year ago
parent 9779c5bbbe
commit e4a032231e
  1. 65
      pages/home/components/alarm.vue
  2. 3
      pages/home/components/eacharts_nightpie.vue
  3. BIN
      static/images/alarm_icon.png

@ -1,7 +1,9 @@
<template> <template>
<view v-if="list.length>0"> <view v-if="list.length > 0">
<view class="work-title">设备报警</view> <view class="work-title">设备报警</view>
<view v-for="(item, index) in list" :key="index" class="alarm-box"> <view class="view_box">
<view :style="transitionStyle">
<view v-for="(item, index) in list" :key="index" class="alarm-box" @click="alarmImg()">
<view class="alarm-left" :style="{ borderColor: item.color }"> <view class="alarm-left" :style="{ borderColor: item.color }">
<i>{{ item.alarmName }}</i> <i>{{ item.alarmName }}</i>
<i>{{ item.levelNanme }}</i> <i>{{ item.levelNanme }}</i>
@ -16,6 +18,20 @@
<view class="alarm-right"></view> <view class="alarm-right"></view>
</view> </view>
</view> </view>
</view>
<!-- <view class="view_box">
<view :style="transitionStyle">
<block v-for="(item, index) in list" :key="index">
<view>
-------------{{ item }}----------
</view>
</block>
</view>
</view> -->
</view>
</template> </template>
<script> <script>
export default { export default {
@ -26,10 +42,17 @@ export default {
严重: "rgba(233,157,66,1)", 严重: "rgba(233,157,66,1)",
}, },
list: [], list: [],
transitionStyle: ''
}; };
}, },
mounted() { mounted() {
this.deviceList() this.deviceList()
//
// this.getList().then((res) => {
// console.log(res)
// this.list = [...res.data, ...res.data]
// })
}, },
methods: { methods: {
deviceList() { deviceList() {
@ -49,8 +72,40 @@ export default {
v.color = this.colorList[v.levelNanme] v.color = this.colorList[v.levelNanme]
}); });
this.list = res.data this.list = res.data
// list
this.init()
} }
}) })
},
alarmImg() {
uni.previewImage({
current: '', // http
urls: [require('@/static/images/alarm_icon.png')]
})
},
init() {
// transition
setTimeout(() => {
this.transitionStyle = 'transition: all 10s linear 0s;transform: translateY(-50%);'
setInterval(() => {
this.transitionStyle = ''
setTimeout(() => {
this.transitionStyle =
'transition: all 10s linear 0s;transform: translateY(-50%);'
}, 20)
}, 8000)
}, 20)
},
//
getList() {
return new Promise((resolve) => {
setTimeout(() => {
resolve({
code: '200',
data: [1, 2, 3, 4, 5, 6, 7, 8, 9]
})
}, 200)
})
} }
} }
}; };
@ -131,4 +186,10 @@ export default {
} }
} }
} }
.view_box {
// background-color: #aaa2fb;
height: 300rpx;
overflow: hidden;
}
</style> </style>

@ -54,7 +54,8 @@ export default {
name: "", name: "",
type: "pie", type: "pie",
center: ['50%', '50%'], center: ['50%', '50%'],
roseType: 'area', radius: ['40%', '70%'],
// roseType: 'area',
label: { label: {
// . // .
normal: { normal: {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Loading…
Cancel
Save