he wei
2023-12-06 74362878b01587845f6dadd9bdfda331848fed3e
src/components/alarmCard.vue
@@ -4,8 +4,12 @@
    <div
      :class="[
        'state',
        { level1: 1 == level, level2: 2 == level, level3: 3 == level , 'alarm': flag },
        {
          level1: 1 == level,
          level2: 2 == level,
          level3: 3 == level,
          alarm: isAlarm,
        },
      ]"
    ></div>
  </div>
@@ -32,12 +36,12 @@
    },
    childrenVisible: {
      type: Boolean,
      default: false
      default: false,
    },
    flag: {
      type: Number,
      type: [Number, Array],
      default: 0,
    }
    },
  },
  computed: {
    cols() {
@@ -49,6 +53,14 @@
      }
      return Math.ceil(this.childrenCount / this.cols);
    },
    isAlarm() {
      const flag = this.flag;
      if (Array.isArray(flag)) {
        return flag.some((v) => v > 0);
      } else {
        return !!flag;
      }
    },
  },
  data() {
    return {};
@@ -56,13 +68,12 @@
  components: {},
  methods: {
    close() {
      console.log('close?');
      this.$emit('close');
    }
      console.log("close?");
      this.$emit("close");
    },
  },
  mounted() {
  },
  mounted() {},
};
</script>
@@ -116,12 +127,12 @@
    }
    .row {
      display: flex;
      &~.row {
      & ~ .row {
        margin-top: 8px;
      }
      .col {
        flex: 1;
        & ~.col {
        & ~ .col {
          margin-left: 8px;
        }
      }
@@ -133,7 +144,7 @@
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.4);
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
  }
}