he wei
2023-12-08 f182d3bafb07fe93a4109742cb3553b795c6c919
src/components/alarmCard.vue
@@ -1,5 +1,5 @@
<template>
  <div class="alarm-card">
  <div :class="['alarm-card', {pointer: childrenCount > 0}]">
    <div class="name">{{ name }}</div>
    <div
      :class="[
@@ -34,25 +34,25 @@
      type: Number,
      default: 0,
    },
    childrenVisible: {
      type: Boolean,
      default: false,
    },
    // childrenVisible: {
    //   type: Boolean,
    //   default: false,
    // },
    flag: {
      type: [Number, Array],
      default: 0,
    },
  },
  computed: {
    cols() {
      return Math.ceil(Math.sqrt(this.childrenCount));
    },
    rows() {
      if (!this.cols) {
        return 0;
      }
      return Math.ceil(this.childrenCount / this.cols);
    },
    // cols() {
    //   return Math.ceil(Math.sqrt(this.childrenCount));
    // },
    // rows() {
    //   if (!this.cols) {
    //     return 0;
    //   }
    //   return Math.ceil(this.childrenCount / this.cols);
    // },
    isAlarm() {
      const flag = this.flag;
      if (Array.isArray(flag)) {
@@ -89,6 +89,9 @@
  padding: 6px;
  justify-content: space-between;
  align-items: center;
  &.pointer {
    cursor: pointer;
  }
  .state {
    width: 60px;
    background: #78eef8;
@@ -104,48 +107,48 @@
      background: #ff3801;
    }
  }
  .card-children-container {
    z-index: 100;
    position: fixed;
    top: 50%;
    left: 50%;
    width: 1600px;
  // .card-children-container {
  //   z-index: 100;
  //   position: fixed;
  //   top: 50%;
  //   left: 50%;
  //   width: 1600px;
    // height: 600px;
    transform: translate(-50%, -50%);
    background: gray;
    padding: 20px;
    display: flex;
    flex-direction: column;
    &.small {
      width: 800px;
    }
    .sub-title {
      text-align: center;
      font-size: 20px;
      padding-bottom: 10px;
    }
    .row {
      display: flex;
      & ~ .row {
        margin-top: 8px;
      }
      .col {
        flex: 1;
        & ~ .col {
          margin-left: 8px;
        }
      }
    }
  }
  .mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
  }
  //   // height: 600px;
  //   transform: translate(-50%, -50%);
  //   background: gray;
  //   padding: 20px;
  //   display: flex;
  //   flex-direction: column;
  //   &.small {
  //     width: 800px;
  //   }
  //   .sub-title {
  //     text-align: center;
  //     font-size: 20px;
  //     padding-bottom: 10px;
  //   }
  //   .row {
  //     display: flex;
  //     & ~ .row {
  //       margin-top: 8px;
  //     }
  //     .col {
  //       flex: 1;
  //       & ~ .col {
  //         margin-left: 8px;
  //       }
  //     }
  //   }
  // }
  // .mask {
  //   position: fixed;
  //   top: 0;
  //   left: 0;
  //   right: 0;
  //   bottom: 0;
  //   background: rgba(0, 0, 0, 0.4);
  //   z-index: 99;
  // }
}
</style>