index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <div class="main-container-box">
  3. <nav-header></nav-header>
  4. <div class="panel-box">
  5. <div class="column1">
  6. <transition name="fade">
  7. <sbjk v-if="show"></sbjk>
  8. </transition>
  9. <monitor :width="width" v-if="monitorStatus" @monitorChange="monitorChange"></monitor>
  10. </div>
  11. <transition name="fade1">
  12. <div class="column2" v-if="show">
  13. <alarm-static></alarm-static>
  14. <handle-number></handle-number>
  15. <alarming></alarming>
  16. </div>
  17. </transition>
  18. <div class="panel monitor-setting" v-if="showModal_tow">
  19. <div class="panel-tit">
  20. 画面配置<img
  21. class="close"
  22. src="@/assets/close.png"
  23. alt=""
  24. @click="showModal_tow = false"
  25. />
  26. </div>
  27. <div class="monitor-option"></div>
  28. <div class="panel-footer"></div>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import sbjk from "./components/sbjk";
  35. import monitor from "./components/monitor";
  36. import alarming from "./components/alarming";
  37. import handleNumber from "./components/handleNumber";
  38. import alarmStatic from "./components/alarmStatic";
  39. import TimeMenu from "@/components/TimeMenu";
  40. import navHeader from "./components/navHeader";
  41. import { getToken, setToken, removeToken } from "@/utils/auth";
  42. export default {
  43. components: {
  44. sbjk,
  45. monitor,
  46. alarming,
  47. handleNumber,
  48. alarmStatic,
  49. TimeMenu,
  50. navHeader,
  51. getToken,
  52. },
  53. data() {
  54. return {
  55. showModal_tow: false,
  56. width: "100rem",
  57. show: true,
  58. monitorStatus:true,
  59. };
  60. },
  61. mounted() {
  62. var that = this;
  63. window.addEventListener(
  64. "message",
  65. function (event) {
  66. var isDOM = typeof event.data === "object";
  67. // // 监听父窗口发送过来的数据向服务器发送post请求
  68. var data = event.data;
  69. if (isDOM == true) {
  70. if ("param" in data == true) {
  71. if (data.param.name === "iframe" && data.param.id === "iframe") {
  72. that.handleClick();
  73. }
  74. }
  75. }
  76. },
  77. false
  78. );
  79. },
  80. methods: {
  81. handleClick: function () {
  82. this.show = !this.show;
  83. this.show == true ? (this.width = "100rem") : (this.width = "100%");
  84. },
  85. monitorChange(){
  86. this.monitorStatus = false
  87. setTimeout(()=>{
  88. this.monitorStatus = true
  89. },1)
  90. }
  91. },
  92. };
  93. </script>
  94. <style lang="scss">
  95. .fade-enter-active,
  96. .fade-leave-active {
  97. transition: all 0.5s linear;
  98. transform: translated3d(0, 0, 0);
  99. }
  100. .fade-enter, .fade-leave-to /*.move-leave-active in below version 2.1.8 */ {
  101. transform: translate3d(-100%, 0, 0);
  102. }
  103. .fade1-enter-active,
  104. .fade1-leave-active {
  105. transition: all 0.5s linear;
  106. transform: translated3d(0, 0, 0);
  107. }
  108. .fade1-enter, .fade1-leave-to /* .move-leave-active in below version 2.1.8 */ {
  109. transform: translate3d(100%, 0, 0);
  110. }
  111. iframe {
  112. position: fixed;
  113. top: 6rem;
  114. left: 0;
  115. right: 0;
  116. z-index: 0;
  117. margin: 0 auto;
  118. border: 0px red solid;
  119. // width: 100rem;
  120. height: calc(100vh - 7rem);
  121. }
  122. .monitor-setting {
  123. position: fixed;
  124. left: 0;
  125. right: 0;
  126. z-index: 15;
  127. margin: 0 auto;
  128. .monitor-option {
  129. padding: 2rem 4rem 2rem 4rem;
  130. }
  131. }
  132. .setting,
  133. .close {
  134. position: absolute;
  135. width: 2rem;
  136. right: 1.5rem;
  137. top: 1.3rem;
  138. cursor: pointer;
  139. }
  140. .close {
  141. width: 1.7rem;
  142. cursor: pointer;
  143. }
  144. /* 修复input 背景不协调 和光标变色 */
  145. /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
  146. $bg: #283443;
  147. $light_gray: #fff;
  148. $cursor: #fff;
  149. @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
  150. .main-container-box .el-input input {
  151. color: $cursor;
  152. }
  153. }
  154. </style>
  155. <style lang="scss" scoped>
  156. // @import "../../styles/mixin.scss";
  157. </style>
  158. <style lang="scss" >
  159. /* 初始化 */
  160. ul {
  161. padding: 0;
  162. margin: 0;
  163. list-style: none;
  164. }
  165. li,
  166. p {
  167. padding: 0;
  168. margin: 0;
  169. list-style: none;
  170. }
  171. .colorSuccess {
  172. color: #01e416;
  173. }
  174. .colorUnhandle {
  175. color: rgb(248, 72, 3);
  176. }
  177. .colorOverTime {
  178. color: #0bc3ff;
  179. }
  180. .colorUnpass {
  181. color: #fd7700;
  182. }
  183. .colorTotal {
  184. color: #ffec16;
  185. }
  186. body{
  187. width:100%;
  188. height:100%;
  189. overflow-y: hidden;
  190. }
  191. /* 首页公共css */
  192. .main-container-box {
  193. min-width: 1024px;
  194. background: url(../../assets/background_img_03.png);
  195. background-size: 100% 100%;
  196. background-repeat: no-repeat;
  197. overflow: hidden;
  198. padding-bottom:2rem;
  199. color: #fff;
  200. }
  201. .panel-box {
  202. min-width: 1024px;
  203. // max-width: 1920px;
  204. position: relative;
  205. height: calc(100vh - 8rem);
  206. margin-top: 6rem;
  207. display: flex;
  208. > div {
  209. position: absolute;
  210. top: 0;
  211. z-index: 1;
  212. width: 23%;
  213. }
  214. .column1 {
  215. left: 1rem;
  216. }
  217. .column2 {
  218. right: 1rem ;
  219. }
  220. }
  221. .panel {
  222. position: relative;
  223. background: #021132;
  224. border: 1px solid #3486da;
  225. .panel-tit {
  226. background: linear-gradient(
  227. to right,
  228. #021132 0%,
  229. #3053af 50%,
  230. #021132 100%
  231. );
  232. padding: 1.2rem;
  233. color: #fff;
  234. text-align: center;
  235. font-size: 1.6rem;
  236. font-family: "impact";
  237. }
  238. }
  239. .panel::before {
  240. position: absolute;
  241. top: 0;
  242. left: 0;
  243. content: "";
  244. width: 10px;
  245. height: 10px;
  246. border-top: 2px solid #02a6b5;
  247. border-left: 2px solid #02a6b5;
  248. }
  249. .panel::after {
  250. position: absolute;
  251. top: 0;
  252. right: 0;
  253. content: "";
  254. width: 10px;
  255. height: 10px;
  256. border-top: 2px solid #02a6b5;
  257. border-right: 2px solid #02a6b5;
  258. }
  259. .panel .panel-footer {
  260. position: absolute;
  261. left: 0;
  262. bottom: 0;
  263. width: 100%;
  264. }
  265. .panel .panel-footer::before {
  266. position: absolute;
  267. bottom: 0;
  268. left: 0;
  269. content: "";
  270. width: 10px;
  271. height: 10px;
  272. border-bottom: 2px solid #02a6b5;
  273. border-left: 2px solid #02a6b5;
  274. }
  275. .panel .panel-footer::after {
  276. position: absolute;
  277. bottom: 0;
  278. right: 0;
  279. content: "";
  280. width: 10px;
  281. height: 10px;
  282. border-bottom: 2px solid #02a6b5;
  283. border-right: 2px solid #02a6b5;
  284. }
  285. /* 约束屏幕尺寸 */
  286. @media screen and (max-width: 1024px) {
  287. html {
  288. font-size: 5px !important;
  289. }
  290. // .el-menu > div:nth-child(7) {
  291. // // width: calc(100vw / 33);
  292. // // margin-left: 27rem !important;
  293. // }
  294. }
  295. @media screen and (min-width: 1920px) {
  296. html {
  297. font-size: 10px !important;
  298. }
  299. }
  300. </style>
  301. <style scoped>
  302. .el-menu--collapse .el-menu .el-submenu,
  303. .el-menu--popup {
  304. min-width: 10rem !important;
  305. }
  306. </style>