| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <template>
- <div class="info__bg l-flex--col center jcenter ">
- <div class="info">
- <div class="l-flex--row center info__deviceName">
- {{ alarm.deviceName }}
- </div>
- <div
- class="l-flex--row center"
- :style="colorStyle"
- >
- <svg-icon
- class="alarm__icon"
- icon-class="v0-alarm"
- />
- <div class="alarm__name">
- {{ levelMap[alarm.level] }}
- </div>
- </div>
- <div class="l-flex--row center alarm__type">
- {{ alarm.type }}
- </div>
- <div
- v-for="(row, index) in rows"
- :key="index"
- class="l-flex--row info__row c-sibling-item--v far"
- >
- <div
- v-for="item in row"
- :key="item.key"
- class="l-flex--row l-flex__fill"
- >
- <div class="l-flex__none l-flex--row center row__label">
- {{ item.label }}
- </div>
- <div class="l-flex__fill row__value">
- {{ alarm[item.key] }}
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: 'AlarmInfo',
- components: {},
- props: {
- alarm: {
- type: Object,
- required: true
- }
- },
- data () {
- return {
- levelMap: ['普通等级', '提示等级', '紧急等级'],
- rows: [
- [
- {
- label: '发生时间',
- key: 'happenTime'
- },
- {
- label: 'MAC',
- key: 'mac'
- }
- ],
- [
- {
- label: '系统配置预处理方式',
- key: 'handle'
- },
- {
- label: '执行结果',
- key: 'status'
- }
- ],
- [
- {
- label: '位置',
- key: 'address'
- }
- ]
- ]
- }
- },
- methods: {
- colorStyle () {
- return this.alarm
- ? {
- color: ['#04A681', '#FFA000', '#F40645'][this.alarm.level]
- }
- : null
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .info {
- color: #f40645;
- width: 640px;
- height: 360px;
- &__bg {
- width: 720px;
- height: 440px;
- background: url("~@/assets/v1/bg_alarm.png");
- background-size: 100%;
- background-position: center;
- background-repeat: no-repeat;
- }
- &__row {
- height: 40px;
- opacity: 0.5;
- font-size: 16px;
- background: rgba(#7b102c, 0.5);
- margin: 0 16px;
- .row__label {
- color: #9ea9cd;
- width: 150px;
- }
- .row__value {
- color: #fff;
- }
- }
- &__deviceName {
- line-height: 48px;
- font-size: 32px;
- font-weight: bold;
- margin: 20px 0 15px 0;
- }
- .alarm {
- &__icon {
- width: 24px;
- height: 24px;
- background-repeat: no-repeat;
- background-size: 100%;
- }
- &__name {
- font-size: 24px;
- line-height: 36px;
- font-weight: 500;
- }
- &__type {
- font-size: 32px;
- line-height: 48px;
- font-weight: bold;
- margin: 15px 0 15px 0;
- }
- }
- }
- </style>
|