index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div class="safe">
  3. <div class="bottomCard">
  4. <div class="cardLine">
  5. <div
  6. class="lineItem card"
  7. :style="isFullScreen ? 'height: 90vh' : 'height: 95vh'"
  8. >
  9. <Safecom
  10. title="风机预警"
  11. deviceType="windturbine"
  12. alarmType="custom"
  13. />
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import dayjs from "dayjs";
  21. import Safecom from "@/views/IntegratedAlarm/safe/components/safecomponent.vue";
  22. export default {
  23. data() {
  24. return {
  25. isFullScreen: false,
  26. };
  27. },
  28. components: {
  29. Safecom,
  30. },
  31. created() {
  32. const clientHeight =
  33. document.documentElement.clientHeight || document.body.clientHeight;
  34. if (clientHeight === 1080) {
  35. this.isFullScreen = true;
  36. } else {
  37. this.isFullScreen = false;
  38. }
  39. },
  40. mounted() {
  41. window.onresize = () => {
  42. const clientHeight =
  43. document.documentElement.clientHeight || document.body.clientHeight;
  44. this.isFullScreen = window.screen.height == clientHeight;
  45. };
  46. console.log("isFullScreen=====>>>>", this.isFullScreen);
  47. },
  48. };
  49. </script>
  50. <style lang="less" scoped>
  51. .safe {
  52. width: 100%;
  53. height: 100%;
  54. padding: 20px 10px;
  55. .bottomCard {
  56. display: flex;
  57. align-items: center;
  58. width: 100%;
  59. height: 100%;
  60. justify-content: space-around;
  61. .cardLine {
  62. // width: calc(100% / 3 - 15px);
  63. // width: calc(100% / 2 - 15px);
  64. width: 100%;
  65. height: 100%;
  66. // height: 95vh;
  67. display: flex;
  68. flex-direction: column;
  69. // justify-content: space-between;
  70. align-items: center;
  71. .lineItem {
  72. width: 100%;
  73. height: calc(100% / 2 - 10px);
  74. }
  75. }
  76. }
  77. }
  78. .card {
  79. padding: 10px;
  80. border-radius: 4px;
  81. background-color: #161f1e;
  82. overflow: hidden;
  83. color: #fff;
  84. -webkit-transition: 0.3s;
  85. transition: 0.3s;
  86. box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  87. }
  88. </style>
  89. <style lang="scss">
  90. .notificatBox {
  91. width: 100%;
  92. .notificatP {
  93. color: rgb(7, 7, 7);
  94. }
  95. .btn {
  96. display: flex;
  97. justify-content: flex-end;
  98. }
  99. }
  100. .scrollbarC {
  101. width: 100%;
  102. display: flex;
  103. flex-wrap: wrap;
  104. justify-content: flex-start;
  105. align-content: flex-start;
  106. }
  107. </style>