intelligent-alarm-center.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="intelligent-alarm-center">
  3. <div class="intelligent-alarm-center-btn">
  4. <div @click="clickBtn(index)" class="i-btn" v-for="(btn, index) of btns" :key="index" :class="{ active: index == btnIndex }">{{ btn }}</div>
  5. </div>
  6. <div class="intelligent-alarm-center-box">
  7. <div
  8. class="intelligent-alarm-center-item"
  9. v-for="(panel, index) of panels"
  10. :key="index"
  11. :class="{ active: index == panelIndex }"
  12. @click="clickItem(index)"
  13. >
  14. <div class="intelligent-alarm-center-icon">
  15. <span class="i-svg-icon">
  16. <SvgIcon :svgid="panel.icon"></SvgIcon>
  17. </span>
  18. </div>
  19. <div class="intelligent-alarm-center-num">{{ panel.num }}</div>
  20. <div class="intelligent-alarm-center-name">{{ panel.name }}</div>
  21. </div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  27. export default {
  28. // 名称
  29. name: "intelligent-alarm-center",
  30. // 使用组件
  31. components: {
  32. SvgIcon,
  33. },
  34. // 数据
  35. data() {
  36. return {
  37. btns: ["光字牌", "实时报警", "历史报警"],
  38. btnIndex: 0,
  39. panels: [
  40. {
  41. icon: "svg-jkp",
  42. num: "5,916",
  43. name: "智能经营管控系统",
  44. },
  45. {
  46. icon: "svg-iac-yx",
  47. num: "5,916",
  48. name: "智能营销管控系统",
  49. },
  50. {
  51. icon: "svg-iac-jc",
  52. num: "5,916",
  53. name: "智能工程管控系统",
  54. },
  55. {
  56. icon: "svg-iac-dj",
  57. num: "5,916",
  58. name: "智能党建系统",
  59. },
  60. {
  61. icon: "svg-iac-p",
  62. num: "5,916",
  63. name: "两票系统",
  64. },
  65. {
  66. icon: "svg-iac-jj",
  67. num: "5,916",
  68. name: "智能经济运行系统",
  69. },
  70. {
  71. icon: "svg-iac-oa",
  72. num: "5,916",
  73. name: "OA及生产管理系统",
  74. },
  75. {
  76. icon: "svg-iac-wz",
  77. num: "5,916",
  78. name: "智能物资系统",
  79. },
  80. {
  81. icon: "svg-iac-aq",
  82. num: "5,916",
  83. name: "智能安全系统",
  84. },
  85. ],
  86. panelIndex: 1,
  87. };
  88. },
  89. // 函数
  90. methods: {
  91. clickBtn: function(index) {
  92. this.btnIndex = index;
  93. },
  94. clickItem: function(index) {
  95. this.panelIndex = index;
  96. },
  97. },
  98. // 生命周期钩子
  99. beforeCreate() {
  100. // 创建前
  101. },
  102. created() {
  103. // 创建后
  104. },
  105. beforeMount() {
  106. // 渲染前
  107. },
  108. mounted() {
  109. // 渲染后
  110. },
  111. beforeUpdate() {
  112. // 数据更新前
  113. },
  114. updated() {
  115. // 数据更新后
  116. },
  117. };
  118. </script>
  119. <style lang="less">
  120. .intelligent-alarm-center {
  121. widows: 100%;
  122. height: calc(100vh - 90px);
  123. overflow-y: auto;
  124. .intelligent-alarm-center-btn {
  125. display: flex;
  126. .i-btn {
  127. width: 11.296vh;
  128. height: 3.056vh;
  129. line-height: 3.056vh;
  130. background: #53626833;
  131. border: 1px solid #53626833;
  132. text-align: center;
  133. cursor: pointer;
  134. font-size: 1.296vh;
  135. color: #b3bdc0;
  136. transition: all 0.3s;
  137. + .i-btn {
  138. margin-left: 0.926vh;
  139. }
  140. &:hover,
  141. &.active {
  142. border: 1px solid #05bb4c;
  143. background: #05bb4c33;
  144. color: #05bb4c;
  145. }
  146. }
  147. }
  148. .intelligent-alarm-center-box {
  149. display: flex;
  150. flex-wrap: wrap;
  151. .intelligent-alarm-center-item {
  152. width: 360px;
  153. height: 14.259vh;
  154. background: #53626833;
  155. border: 1px solid #53626833;
  156. position: relative;
  157. overflow: hidden;
  158. margin: 1.481vh 1.481vh 0 0;
  159. cursor: pointer;
  160. transition: all 0.3s;
  161. .intelligent-alarm-center-icon {
  162. position: absolute;
  163. width: 13.889vh;
  164. height: 13.889vh;
  165. background: #7a909933;
  166. border-radius: 50%;
  167. right: -2.778vh;
  168. bottom: -2.778vh;
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. .i-svg-icon {
  173. font-size: 0;
  174. line-height: 0;
  175. svg {
  176. width: 5.093vh;
  177. height: 5.093vh;
  178. use {
  179. fill: #536268;
  180. width: 5.093vh;
  181. height: 5.093vh;
  182. }
  183. }
  184. }
  185. }
  186. .intelligent-alarm-center-num {
  187. font-size: 3.148vh;
  188. font-weight: 400;
  189. color: #ffffff;
  190. line-height: 3.241vh;
  191. margin: 3.704vh 0 0 2.407vh;
  192. }
  193. .intelligent-alarm-center-name {
  194. font-size: 1.481vh;
  195. font-weight: 400;
  196. color: #b3bdc0;
  197. line-height: 30px;
  198. margin: 1.481vh 0 0 2.407vh;
  199. }
  200. &:hover,
  201. &.active {
  202. background: #05bb4c33;
  203. border: 1px solid #05bb4c;
  204. margin-top: 0.556vh;
  205. .intelligent-alarm-center-icon {
  206. background: #07ED5F33;
  207. .i-svg-icon {
  208. svg {
  209. use {
  210. fill: #05BB4C;
  211. }
  212. }
  213. }
  214. }
  215. .intelligent-alarm-center-num {
  216. color: #05BB4C;
  217. }
  218. .intelligent-alarm-center-name {
  219. color: #FFFFFF;
  220. }
  221. }
  222. }
  223. }
  224. }
  225. </style>