home.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <div class="home">
  3. <div class="head-box">
  4. <!--<img class="logo-img" src="@/assets/ZDimages/logo@1x.png">-->
  5. <img class="logo-img" :src="rectangleLogo">
  6. <div class="title-box">
  7. <p class="title-p">实验室安全智慧化管控中心</p>
  8. </div>
  9. <div class="right-button-box">
  10. <p class="time-p">{{timeData?timeData:''}}</p>
  11. <div class="button-box">
  12. <img src="@/assets/ZDimages/icon_ay_tc@1x.png">
  13. <p @click="openBackManageUrl">退出</p>
  14. </div>
  15. </div>
  16. </div>
  17. <!--安全总览-->
  18. <newSafetyOverview ref="newSafetyOverview" v-if="pageType === 1"></newSafetyOverview>
  19. <!--设备资源-->
  20. <resourceDevice v-if="pageType === 2"></resourceDevice>
  21. <!--三维模型-->
  22. <dimensionalModel v-if="pageType === 3"></dimensionalModel>
  23. <!--视频资源-->
  24. <videoSurveillance v-if="pageType === 4"></videoSurveillance>
  25. <!--应急管控-->
  26. <emergencyManagement v-if="pageType === 5"></emergencyManagement>
  27. <planAlarm ref="planAlarm"></planAlarm>
  28. </div>
  29. </template>
  30. <script>
  31. import dimensionalModel from "./dimensionalModel/index.vue";
  32. import emergencyManagement from "./emergencyManagement/index.vue";
  33. import resourceDevice from "./resourceDevice/index.vue";
  34. import newSafetyOverview from "./newSafetyOverview/index.vue";
  35. import videoSurveillance from "./videoSurveillance/index.vue";
  36. import { getToken,removeToken } from '@/utils/auth'
  37. import planAlarm from "@/components/planAlarm/planAlarm.vue";
  38. export default {
  39. name: 'home',
  40. components: {
  41. dimensionalModel,
  42. emergencyManagement,
  43. resourceDevice,
  44. newSafetyOverview,
  45. videoSurveillance,
  46. planAlarm,
  47. },
  48. data () {
  49. return {
  50. rectangleLogo:localStorage.getItem('rectangleLogo'),
  51. // 时间
  52. timeData:null,
  53. // 定时器
  54. timer:null,
  55. pageType:1,
  56. }
  57. },
  58. created(){
  59. if(!getToken()){
  60. this.$router.push({path:'/'});
  61. }
  62. },
  63. mounted(){
  64. this.timeFunction();
  65. },
  66. methods:{
  67. openBackManageUrl(){
  68. this.$confirm('确定注销并退出系统吗?', '提示', {
  69. confirmButtonText: '确定',
  70. cancelButtonText: '取消',
  71. type: 'warning'
  72. }).then(() => {
  73. removeToken();
  74. if(localStorage.getItem('entranceJumpType') == 'SCHOOL'){
  75. window.location.href = process.env.VUE_APP_OUT_URL;
  76. }else if(localStorage.getItem('entranceJumpType') == 'PC'){
  77. window.location.href = process.env.VUE_APP_OUT_URL_PC;
  78. }
  79. }).catch(() => {});
  80. },
  81. //切换页面
  82. pageCheck(type){
  83. if(type == 3){
  84. window.open('https://zcsjpt-szls.nwafu.edu.cn/')
  85. }else{
  86. if(type !== this.pageType){
  87. this.$set(this,'pageType',type);
  88. }
  89. }
  90. },
  91. //时间定时器
  92. timeFunction(){
  93. let self = this;
  94. this.timer = window.setInterval(showTime, 1000);
  95. function showTime() {
  96. const date = new Date();
  97. const y = date.getFullYear().toString();
  98. const m = (date.getMonth() + 1).toString().padStart(2, '0');
  99. const d = date.getDate().toString().padStart(2, '0');
  100. const hours = date.getHours().toString().padStart(2, '0');
  101. const minutes = date.getMinutes().toString().padStart(2, '0');
  102. const seconds = date.getSeconds().toString().padStart(2, '0');
  103. self.$set(self,'timeData',y+'年'+m+'月'+d+'日 '+hours+':'+minutes+':'+seconds);
  104. }
  105. },
  106. goDataMap(obj){
  107. if(this.pageType == 1){
  108. this.$refs['newSafetyOverview'].laboratoryBigViewSelectTriggerInfoData(obj)
  109. }
  110. },
  111. },
  112. beforeDestroy() {
  113. //清除定时器
  114. window.clearInterval(this.timer);
  115. },
  116. destroyed() {
  117. //清除定时器
  118. window.clearInterval(this.timer);
  119. }
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .home{
  124. height:100%;
  125. background: no-repeat;
  126. background-color: #000F14;
  127. background-image: url("../assets/ZDimages/backImg.gif");
  128. background-size: 100% 1530px;
  129. position: relative;
  130. .head-box{
  131. height:121px;
  132. display: flex;
  133. .logo-img{
  134. width:350px;
  135. height:77px;
  136. margin:40px 0 0 60px;
  137. }
  138. .title-box{
  139. flex:1;
  140. .title-p{
  141. margin:18px auto 0;
  142. font-size:40px;
  143. line-height:40px;
  144. height:40px;
  145. font-weight:700;
  146. text-align: center;
  147. background: -webkit-linear-gradient(0deg, #34e4ff, #FFFFFF); /* Chrome, Safari */
  148. background: linear-gradient(0deg, #34e4ff, #FFFFFF); /* 标准语法 */
  149. -webkit-background-clip: text; /* Chrome, Safari */
  150. background-clip: text;
  151. -webkit-text-fill-color: transparent; /* Chrome, Safari */
  152. color: transparent; /* 其他浏览器 */
  153. }
  154. }
  155. .right-button-box{
  156. width:351px;
  157. height:42px;
  158. margin:55px 63px 0 0;
  159. display: flex;
  160. .time-p{
  161. width:245px;
  162. height:42px;
  163. line-height:42px;
  164. font-size:20px;
  165. color:#00FFFF;
  166. }
  167. .button-box{
  168. cursor: pointer;
  169. width:106px;
  170. height:42px;
  171. display: flex;
  172. img{
  173. width:24px;
  174. height:24px;
  175. margin:9px 5px 9px 15px;
  176. }
  177. p{
  178. font-size:24px;
  179. color:#00FFFF;
  180. width:62px;
  181. height:42px;
  182. line-height:42px;
  183. }
  184. }
  185. }
  186. }
  187. }
  188. </style>