消毒机设备
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

349 lines
7.2 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <script setup lang="ts">
  2. import { useSystemStore } from '@/stores/systemStore'
  3. import HomeAlarmSvg from 'assets/images/home/home-alarm.svg'
  4. import ErrorBox from 'libs/modalUtil'
  5. import { formatDateTime } from 'libs/utils'
  6. import { authRoutes } from 'router/routes'
  7. import { onMounted, onUnmounted, ref } from 'vue'
  8. import { useRouter } from 'vue-router'
  9. const router = useRouter()
  10. const systemStore = useSystemStore()
  11. const languages = systemStore.$state.languages
  12. const currentTime = ref(formatDateTime())
  13. const languageType = ref('zh-cn')
  14. const timeInterval = setInterval(() => {
  15. currentTime.value = formatDateTime()
  16. }, 1000)
  17. onMounted(() => {
  18. console.log(111)
  19. })
  20. onUnmounted(() => {
  21. clearInterval(timeInterval)
  22. })
  23. const showErrorModal = () => {
  24. ErrorBox.alert('这是一条警告信息')
  25. }
  26. const onLogout = () => {
  27. router.push('/login')
  28. }
  29. </script>
  30. <template>
  31. <el-container class="main">
  32. <el-header class="header">
  33. <div class="logo">
  34. <img src="../assets/images/logo.svg" alt="">
  35. </div>
  36. <div class="header-right">
  37. <div class="header-menu">
  38. <div class="aside">
  39. <el-tag
  40. v-for="item in authRoutes.filter(item => item.meta!.isDefault)"
  41. :key="item.path"
  42. class="menu-tag"
  43. :class="{ 'aside-item-active': router.currentRoute.value.path.includes(item.path) }"
  44. @click="router.push(item.path)"
  45. >
  46. <template #default>
  47. <div class="menu-tags">
  48. <img class="swing-icon" :src="((router.currentRoute.value.path.includes(item.path) ? item.meta!.activeIcon : item.meta!.icon) as string)" alt="">
  49. <span class="text" :class="{ 'active-text': router.currentRoute.value.path.includes(item.path) }">{{ item.meta!.title }}</span>
  50. </div>
  51. </template>
  52. </el-tag>
  53. </div>
  54. </div>
  55. <div class="user">
  56. <el-select v-model="languageType" style="width: 100px; border-radius: 5px;" disabled>
  57. <el-option v-for="language in languages" :key="language.value" :value="language.value" :label="language.name">
  58. {{ language.name }}
  59. </el-option>
  60. </el-select>
  61. &nbsp;&nbsp;&nbsp;&nbsp;
  62. <bt-button
  63. type="primary"
  64. button-text="注销"
  65. @click="onLogout"
  66. />
  67. </div>
  68. </div>
  69. </el-header>
  70. <el-container class="container">
  71. <el-main>
  72. <router-view v-slot="{ Component }" class="content">
  73. <transition name="el-fade-in-linear">
  74. <component :is="Component" />
  75. </transition>
  76. </router-view>
  77. </el-main>
  78. </el-container>
  79. <footer class="footer">
  80. <div class="ip-info">IP : 192.0.0.0</div>
  81. <div class="alarm-info" @click="showErrorModal">
  82. <img :src="HomeAlarmSvg" width="20" alt="报警">
  83. <div>机器报警信息</div>
  84. </div>
  85. <div class="time">
  86. {{ currentTime }}
  87. </div>
  88. </footer>
  89. </el-container>
  90. </template>
  91. <style scoped lang="scss">
  92. .main {
  93. box-sizing: border-box;
  94. height: 100%;
  95. background: #fff;
  96. .header, .footer {
  97. height: 50px;
  98. width: 100%;
  99. display: flex;
  100. align-items: center;
  101. padding: 10px 15px;
  102. }
  103. .header {
  104. color: #393F46;
  105. .logo {
  106. height: 22px;
  107. width: 100px;
  108. display: flex;
  109. align-items: center;
  110. .title {
  111. margin:0 10px;
  112. color: #8799AB;
  113. font-weight: 600;
  114. }
  115. img {
  116. height: 100%;
  117. }
  118. .expand-icon {
  119. height: 15px;
  120. transition: all 0.3s;
  121. }
  122. .fold-icon {
  123. height: 15px;
  124. transform: rotate(90deg);
  125. transition: all 0.3s;
  126. }
  127. }
  128. .header-right {
  129. display: flex;
  130. align-items: center;
  131. height: 100%;
  132. .header-menu{
  133. width: 68vw;
  134. }
  135. .wifi-icon {
  136. width: 40px;
  137. height: 100%;
  138. background: #fff;
  139. border-radius: 5px;
  140. display: flex;
  141. align-items: center;
  142. justify-content: center;
  143. img {
  144. height: 50%;
  145. }
  146. }
  147. }
  148. .user {
  149. width: 20vw;
  150. text-align: right;
  151. .user-logout {
  152. margin-left: auto;
  153. }
  154. }
  155. }
  156. .container {
  157. height: calc(100% - 100px);
  158. background: #F6F6F6;
  159. }
  160. }
  161. .aside {
  162. overflow: hidden;
  163. padding-left: 10px;
  164. display: flex;
  165. align-items: center;
  166. .menu-tag{
  167. height: 2.5rem;
  168. border: 0px;
  169. width: 10rem;
  170. display: flex;
  171. gap: 5px;
  172. font-size: 16px;
  173. background: white;
  174. }
  175. .menu-tags{
  176. display: flex;
  177. align-items: center;
  178. .text {
  179. padding-left: 10px;
  180. color: #191919;
  181. }
  182. .active-text{
  183. color: #ffffff;
  184. }
  185. }
  186. .aside-item {
  187. height: 50px;
  188. border-radius: 10px;
  189. margin: 10px 0;
  190. padding: 0 10px;
  191. display: flex;
  192. align-items: center;
  193. overflow: hidden;
  194. height: 3.5vw;
  195. justify-content: center;
  196. min-width: 6rem;
  197. img {
  198. margin-right: 10px;
  199. }
  200. }
  201. .aside-item-active {
  202. background: #1989FA;
  203. display: flex;
  204. justify-content: center;
  205. }
  206. }
  207. .aside-off {
  208. width: 70px;
  209. //transition: all 0.1s ease;
  210. .aside-item {
  211. .text {
  212. opacity: 0
  213. }
  214. }
  215. .aside-item-active {
  216. background: rgba(0,0,0,0);
  217. color: #fff;
  218. }
  219. }
  220. .user-dropdown-item {
  221. display: flex;
  222. align-items: center;
  223. height: 100%;
  224. color: #393F46;
  225. font-weight: bold;
  226. img {
  227. height: 30px;
  228. margin-right: 10px;
  229. }
  230. }
  231. .el-main {
  232. padding: 0 15px;
  233. height: 100%;
  234. position: relative;
  235. }
  236. .content {
  237. width: 100%;
  238. height: $main-container;
  239. padding: 10px;
  240. }
  241. .footer-expand {
  242. padding: 10px 15px 10px 85px !important;
  243. }
  244. .main .footer {
  245. padding: 10px;
  246. .el-row {
  247. width: 100%;
  248. height: 100%;
  249. .el-col {
  250. height: 100%;
  251. }
  252. }
  253. .footer-left, .footer-right {
  254. width: 100%;
  255. height: 100%;
  256. background: #fff;
  257. border-radius: 5px;
  258. display: flex ;
  259. align-items: center;
  260. padding: 0 20px;
  261. }
  262. .footer-left {
  263. border-right: 5px solid #F6F6F6;
  264. img {
  265. height: 60%;
  266. }
  267. .text {
  268. color: #1C1C1C ;
  269. margin-left: 10px;
  270. font-size: 14px;
  271. }
  272. }
  273. .footer-right {
  274. border-left: 10px solid #F6F6F6;
  275. .status {
  276. width: 15px;
  277. height: 15px;
  278. border-radius: 50%;
  279. background: #4EE993;
  280. }
  281. .text {
  282. color: #1C1C1C ;
  283. margin-left: 10px;
  284. font-size: 14px;
  285. }
  286. }
  287. .ip-info{
  288. font-size: 1rem;
  289. width: 20vw;
  290. padding-left: 1.3vw;
  291. }
  292. .alarm-info {
  293. font-size: 1rem;
  294. width: 60vw;
  295. padding-left: 1.3vw;
  296. background: #F5F5F5;
  297. height: 5vh;
  298. display: flex;
  299. align-items: center;
  300. gap: 5px;
  301. }
  302. .time {
  303. height: 100%;
  304. display: flex;
  305. align-items: center;
  306. border-radius: 5px;
  307. margin-left: 2.5vw;
  308. padding: 1vw;
  309. }
  310. }
  311. .aside-item {
  312. .swing-icon {
  313. // animation: swing 1s ease-in-out;
  314. width: 1.25rem;
  315. }
  316. }
  317. .logout {
  318. display: flex;
  319. img {
  320. width: 15px;
  321. margin-right: 10px;
  322. }
  323. }
  324. @keyframes swing {
  325. 0% {
  326. transform: rotate(0deg);
  327. }
  328. 25% {
  329. transform: rotate(-30deg);
  330. }
  331. 50% {
  332. transform: rotate(30deg);
  333. }
  334. 75% {
  335. transform: rotate(-15deg);
  336. }
  337. 100% {
  338. transform: rotate(0deg);
  339. }
  340. }
  341. </style>