head.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <el-row class="content">
  3. <!-- <el-row class="weather">
  4. <img
  5. v-if="weatherObj.weather_pic"
  6. :src="weatherObj.weather_pic || ''"
  7. alt=""
  8. />
  9. <span v-if="weatherObj.weather"
  10. >{{ weatherObj.weather }} {{ weatherObj.temperature }}℃</span
  11. >
  12. </el-row> -->
  13. <el-row class="title" v-if="title">闵行区消防管理数字平台</el-row>
  14. <el-row class="title4" v-if="!title" style=" font-family: ZhenyanGB!important;">
  15. <a href="http://32.1.7.96:8011/project/mhzd_zdab/#/ciieSecurity" target="_blank"> <img src="@a/img/securityPlan/zhdd.png" alt="" /></a>
  16. 第七届中国国际进口博览会消防安保指挥平台
  17. <a > <img src="@a/img/securityPlan/hzfk.png" alt="" /></a>
  18. </el-row>
  19. <!-- <el-row class="title2" v-if="!title">进博会消防安保平台</el-row>
  20. <el-row class="title3" v-if="!title">
  21. <span >火灾防控</span>
  22. <span style="margin-left:.2rem;margin-top:.05rem;font-size:.2rem" >
  23. <a href="http://32.1.7.96:8010/zhts_mh_20231011_v1/#/ciieSecurity" style="text-decoration:none;color:rgba(137, 128, 128, 0.1);" target="_blank">指挥调度</a>
  24. </span>
  25. </el-row> -->
  26. <div class="nowTime">
  27. <div class="day">{{ dateDay }}</div>
  28. <div class="time">{{ dataTime }}</div>
  29. </div>
  30. <el-row class="nav">
  31. <el-row class="btnBox btnBoxLeft">
  32. <el-col
  33. class="btn btn1"
  34. v-for="(item, index) in btnList.slice(0, 4)"
  35. @click="btnClick(item)"
  36. :key="index"
  37. :class="{
  38. active: public_store.$state.routeInfo === item.router,
  39. }"
  40. >
  41. {{ item.name }}
  42. </el-col>
  43. </el-row>
  44. <el-row class="btnBox btnBoxRight">
  45. <el-col
  46. class="btn btn2"
  47. v-for="(item, index) in btnList.slice(4)"
  48. @click="btnClick(item)"
  49. :key="index"
  50. :class="{
  51. active: public_store.$state.routeInfo === item.router,
  52. }"
  53. >
  54. {{ item.name }}
  55. </el-col>
  56. </el-row>
  57. </el-row>
  58. <div class="homeIcon" @click="fanhui" v-if="!title">
  59. <HomeFilled style="width: 0.8em; height: 0.8em; margin-right: 0px" />
  60. </div>
  61. <!-- <div class="homeIcon" v-if="$route.fullPath !== '/'">
  62. <img src="~@a/img/icon/close.png" alt="" class="timeImage2" @click="fanhui" />
  63. </div> -->
  64. </el-row>
  65. </template>
  66. <script setup>
  67. import { useStore, mapGetters } from "vuex";
  68. import publicStore from "@/store/modules/public.js";
  69. import { useRoute, useRouter } from "vue-router";
  70. import {
  71. defineAsyncComponent,
  72. defineComponent,
  73. ref,
  74. onMounted,
  75. watch,
  76. } from "vue";
  77. import { ElMessage, ElMessageBox } from "element-plus";
  78. const public_store = publicStore(); //公共store
  79. const route = useRoute();
  80. const router = useRouter();
  81. const title = ref(true)
  82. const dateDay = ref("");
  83. const dataTime = ref("");
  84. const weatherObj = ref({});
  85. const dataWeekList = ref(["一", "二", "三", "四", "五", "六", "七"]);
  86. const valueTime = ref([]);
  87. const defaultTime = ref([
  88. new Date(2000, 1, 1, 0, 0, 0),
  89. new Date(2000, 2, 1, 23, 59, 59),
  90. ]); // '00:00:00', '23:59:59'
  91. const btnList = ref([])
  92. console.log(window.location.href.split("#"))
  93. // if(
  94. // window.location.href.indexOf("fire-signs") ||
  95. // window.location.href.indexOf("self-management") ||
  96. // window.location.href.indexOf("enforcement-dynamic") ||
  97. // window.location.href.indexOf("fire-data-analysis") ||
  98. // window.location.href.indexOf("rescue-station") ||
  99. // window.location.href.indexOf("water-sources") ||
  100. // window.location.href.indexOf("comprehensive-disposal") ||
  101. // window.location.href.indexOf("security-plan") ||
  102. // window.location.href.split("#")[1] == "/"
  103. // ){
  104. // btnList.value = [
  105. // { name: "城市消防体征", router: "/fire-signs" },
  106. // { name: "企业自主管理", router: "/self-management" },
  107. // { name: "消防执法动态", router: "/enforcement-dynamic" },
  108. // { name: "火灾数据分析", router: "/fire-data-analysis" },
  109. // { name: "消防救援站点", router: "/rescue-station" },
  110. // { name: "消防水源情况", router: "/water-sources" },
  111. // { name: "警情综合处置", router: "/comprehensive-disposal" },
  112. // { name: "大型安保预案", router: "/security-plan" },
  113. // ]
  114. // }else{
  115. // btnList.value = []
  116. // }
  117. if(window.location.href.split("#")[1] == "/security" ){
  118. btnList.value = []
  119. title.value = false
  120. }else{
  121. btnList.value = [
  122. { name: "城市消防体征", router: "/fire-signs" },
  123. { name: "企业自主管理", router: "/self-management" },
  124. { name: "消防执法动态", router: "/enforcement-dynamic" },
  125. { name: "火灾数据分析", router: "/fire-data-analysis" },
  126. { name: "消防救援站点", router: "/rescue-station" },
  127. { name: "消防水源情况", router: "/water-sources" },
  128. { name: "警情综合处置", router: "/comprehensive-disposal" },
  129. { name: "大型安保预案", router: "/security-plan" },
  130. ]
  131. title.value = true
  132. }
  133. valueTime.value = public_store.$state.timeList.map((val) => {
  134. return val;
  135. });
  136. //返回
  137. // function fanhui() {
  138. // router.go(-1);
  139. // }
  140. //天气
  141. async function getWeather() {
  142. // let res = await this.$axios.get("/service-fire/aliWeather");
  143. // if (JSON.parse(res.data).showapi_res_code === 0) {
  144. // weatherObj.value = JSON.parse(res.data).showapi_res_body.now;
  145. // }
  146. }
  147. //路由跳转
  148. function btnClick(val) {
  149. if (val.router === public_store.$state.routeInfo) {
  150. router.push({
  151. path: "/",
  152. });
  153. } else {
  154. router.push({
  155. path: val.router,
  156. });
  157. }
  158. }
  159. function fanhui(){
  160. window.location.href = "http://32.1.7.96:8010/zhts_mh_20231011_v1/#/ciieSecurity"
  161. // window.location.href = "http://www.baidu.com"
  162. }
  163. onMounted(() => {
  164. //当前年月日时分秒
  165. setInterval(() => {
  166. let day = new Date();
  167. dateDay.value =
  168. day.getFullYear() +
  169. "-" +
  170. (day.getMonth() + 1 < 10
  171. ? "0" + (day.getMonth() + 1)
  172. : "" + (day.getMonth() + 1)) +
  173. "-" +
  174. (day.getDate() < 10 ? "0" + day.getDate() : day.getDate());
  175. dataTime.value =
  176. (day.getHours() < 10 ? "0" + day.getHours() : day.getHours()) +
  177. ":" +
  178. (day.getMinutes() < 10
  179. ? "0" + day.getMinutes()
  180. : day.getMinutes()) +
  181. ":" +
  182. (day.getSeconds() < 10 ? "0" + day.getSeconds() : day.getSeconds());
  183. }, 1000);
  184. });
  185. watch(
  186. () => route,
  187. (to, from) => {
  188. // console.log(from); //从哪来
  189. // console.log(to); //到哪去
  190. public_store.$state.routeInfo = to.path;
  191. },
  192. { deep: true, immediate: true }
  193. );
  194. watch(
  195. () => public_store.$state.timeList,
  196. (val) => {
  197. valueTime.value = val.map((value) => {
  198. return value;
  199. });
  200. },
  201. { deep: true, immediate: true }
  202. );
  203. </script>
  204. <style lang="scss" scoped>
  205. @import "@/assets/scss/color.scss";
  206. .content {
  207. width: 100%;
  208. height: 0.9375rem;
  209. position: relative;
  210. background-image: url(~@a/img/topBackground.png);
  211. background-size: 100% 100%;
  212. background-color: transparent;
  213. z-index: 100;
  214. .weather {
  215. position: absolute;
  216. left: 0.375rem;
  217. top: 0.18rem;
  218. display: flex;
  219. justify-content: center;
  220. align-items: center;
  221. img {
  222. width: 0.375rem;
  223. }
  224. span {
  225. font-size: 0.2rem;
  226. margin-left: 0.135rem;
  227. @include color_primary($color-primary2);
  228. }
  229. }
  230. .nowTime {
  231. .day {
  232. position: absolute;
  233. top: 0.16rem;
  234. left: 0.125rem;
  235. width: auto;
  236. height: auto;
  237. font-size: 0.2rem;
  238. font-weight: 400;
  239. @include color_primary($color-primary3);
  240. }
  241. .time {
  242. position: absolute;
  243. top: 0.16rem;
  244. left: 1.3rem;
  245. font-size: 0.2rem;
  246. //font-weight: 700;
  247. @include color_primary($color-primary3);
  248. }
  249. }
  250. .title {
  251. position: absolute;
  252. left: 0;
  253. right: 0;
  254. margin: auto;
  255. top: 0.1rem;
  256. font-size: 0.375rem;
  257. font-weight: 700;
  258. width: fit-content;
  259. @include color_primary($color-primary1);
  260. background: linear-gradient(to bottom, #b4dffc, #fbfeff);
  261. -webkit-background-clip: text;
  262. color: transparent;
  263. font-family: syhtB !important;
  264. }
  265. .title2 {
  266. position: absolute;
  267. left: 0;
  268. right: 0;
  269. margin: auto;
  270. top: 0rem;
  271. font-size: 0.355rem;
  272. letter-spacing: 4px;
  273. font-weight: 700;
  274. width: fit-content;
  275. @include color_primary($color-primary1);
  276. background: linear-gradient(to bottom, #b4dffc, #fbfeff);
  277. -webkit-background-clip: text;
  278. color: transparent;
  279. font-family: syhtB !important;
  280. >p{
  281. font-size: 0.25rem;
  282. }
  283. // 转变为行内块元素 文字
  284. }
  285. .title4 {
  286. position: absolute;
  287. left: 0;
  288. right: 0;
  289. margin: auto;
  290. top: 0.03rem;
  291. font-size: 0.35rem;
  292. letter-spacing: 4px;
  293. font-weight: 700;
  294. width: fit-content;
  295. @include color_primary($color-primary1);
  296. background: linear-gradient(to bottom, #b4dffc, #fbfeff);
  297. -webkit-background-clip: text;
  298. color: transparent;
  299. font-family: syhtB !important;
  300. >p{
  301. font-size: 0.25rem;
  302. }
  303. img{
  304. height:.4rem;
  305. margin:.0 .8rem
  306. }
  307. // 转变为行内块元素 文字
  308. }
  309. .title3 {
  310. position: absolute;
  311. left: 0;
  312. right: 0;
  313. margin: auto;
  314. top: 0.45rem;
  315. font-size: 0.25rem;
  316. letter-spacing: 4px;
  317. font-weight: 700;
  318. width: fit-content;
  319. @include color_primary($color-primary1);
  320. background: linear-gradient(to bottom, #b4dffc, #fbfeff);
  321. -webkit-background-clip: text;
  322. color: transparent;
  323. font-family: syhtB !important;
  324. >p{
  325. font-size: 0.25rem;
  326. }
  327. // 转变为行内块元素 文字
  328. }
  329. .nav {
  330. .btnBox {
  331. display: flex;
  332. justify-content: space-between;
  333. flex: none;
  334. // background: red;
  335. .btn {
  336. overflow: hidden !important;
  337. white-space: nowrap !important;
  338. text-overflow: ellipsis !important;
  339. width: 1.325rem;
  340. // height: 0.3rem;
  341. // background: blue;
  342. background-size: 100% 100%;
  343. font-size: 0.2rem;
  344. @include color_primary($color-primary3);
  345. text-align: center;
  346. // line-height: 0.625rem;
  347. line-height: 0.6rem;
  348. flex: none;
  349. cursor: pointer;
  350. @include user_select();
  351. }
  352. .btn1 {
  353. margin: 0rem 0 0 0.275rem;
  354. }
  355. .btn2 {
  356. margin: 0rem 0.275rem 0 0;
  357. }
  358. .active {
  359. @include color_primary($color-primary1);
  360. border-bottom: 0.025rem solid #01d1ff;
  361. border-image: linear-gradient(to right, #01d1ff, #2969e8) 1;
  362. }
  363. }
  364. .btnBoxLeft {
  365. position: fixed;
  366. left: 9.8%;
  367. }
  368. .btnBoxRight {
  369. position: fixed;
  370. right: 9.8%;
  371. }
  372. }
  373. .homeIcon {
  374. position: absolute;
  375. right: 10px;
  376. top: -10px;
  377. font-size: 0.625rem;
  378. color: #28bcfa;
  379. }
  380. }
  381. .timeImage2 {
  382. width: 0.5rem;
  383. }
  384. </style>