bottomSideder1.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <div v-if="isShowMenu == -1" class="bottom-side" :class="{ 'bottom-size-show': isShowMenu }">
  3. <FourBorderBg class="four-border-bg" v-for="(menu, index) in menuModules" :key="index">
  4. <div class="vent-flex-row">
  5. <div class="parent-menu">
  6. {{ menu.name }}
  7. </div>
  8. <div class="vent-flex-row-wrap child-menu">
  9. <div class="child-menu-item" v-for="(childMenu, childIndex) in menu.children" :key="childIndex"
  10. @click="handleMenuClick(childMenu)">
  11. {{ childMenu.name }}
  12. </div>
  13. </div>
  14. </div>
  15. </FourBorderBg>
  16. <div class="vent-flex-row-between menu-button-group">
  17. <div class="vent-flex-row program-group">
  18. <div v-for="(programMenu, index) in programMenus" class="program-menu" :key="index">{{ programMenu.title }}
  19. </div>
  20. </div>
  21. <div class="setting-group">
  22. <SvgIcon class="icon-style" size="18" name="home" />
  23. <SvgIcon class="icon-style" size="18" name="fixed" />
  24. <SvgIcon class="icon-style" size="18" name="enter" />
  25. <SvgIcon class="icon-style" size="18" name="setting" />
  26. <SvgIcon class="icon-style" size="18" name="hidden" />
  27. </div>
  28. </div>
  29. </div>
  30. <div v-else-if="isShowMenu == 0" class="menu-show-icon">
  31. <div class="icon" :class="themeIcon == 'styleTwo' ? 'icon-2' : 'icon-1'" @click="openMenu"></div>
  32. </div>
  33. </template>
  34. <script lang="ts">
  35. import { defineComponent, onMounted, ref } from 'vue';
  36. import type { Menu } from '/@/router/types';
  37. import FourBorderBg from '/@/components/vent/fourBorderBg.vue';
  38. import { Icon as SvgIcon } from '/@/components/Icon';
  39. import { getMenus } from '/@/router/menus';
  40. import { useGo } from '/@/hooks/web/usePage';
  41. import { useAppStore } from '/@/store/modules/app';
  42. export default defineComponent({
  43. name: 'BottomSider',
  44. components: { FourBorderBg, SvgIcon },
  45. setup() {
  46. // const appStore = useAppStore();
  47. // const themeIcon = appStore.getDarkMode
  48. const themeIcon=ref('styleTwo')
  49. const isShowMenu = ref(0);
  50. let menuModules = ref<Menu[]>([]);
  51. const go = useGo();
  52. const programMenus = [
  53. {
  54. title: '通风系统',
  55. path: '',
  56. },
  57. {
  58. title: '防尘系统',
  59. path: '',
  60. },
  61. {
  62. title: '防灭火系统',
  63. path: '',
  64. },
  65. ];
  66. function handleMenuClick(path: Menu) {
  67. go(path.path);
  68. isShowMenu.value = 0;
  69. }
  70. const closeMenu = () => {
  71. isShowMenu.value = 0;
  72. window.removeEventListener('click', closeMenu);
  73. };
  74. function openMenu() {
  75. isShowMenu.value = -1;
  76. window.addEventListener('click', closeMenu, true);
  77. }
  78. onMounted(async () => {
  79. menuModules.value = await getMenus();
  80. });
  81. return {
  82. themeIcon,
  83. menuModules,
  84. isShowMenu,
  85. handleMenuClick,
  86. openMenu,
  87. programMenus,
  88. };
  89. },
  90. });
  91. </script>
  92. <style lang="less" scoped>
  93. @keyframes menuShow {
  94. 0% {
  95. width: 0;
  96. height: 0;
  97. }
  98. 100% {
  99. width: 480px;
  100. height: 436px;
  101. }
  102. }
  103. .bottom-side {
  104. width: 480px;
  105. height: 436px;
  106. position: fixed;
  107. bottom: 2px;
  108. left: 0px;
  109. z-index: 99999;
  110. color: #fff;
  111. border: 1px solid #0099e6;
  112. background-color: #06115a;
  113. backdrop-filter: blur(8px);
  114. .four-border-bg {
  115. margin: 5px;
  116. background-color: #ffffff00;
  117. .main-container {
  118. background-color: #ffffff00 !important;
  119. box-shadow: 0 0 3px #ffffff33 inset;
  120. }
  121. .parent-menu {
  122. width: 100px;
  123. }
  124. .child-menu {
  125. width: 340px;
  126. font-size: 13px;
  127. }
  128. .child-menu-item {
  129. width: 100px;
  130. background-color: #0c3898;
  131. border-radius: 2px;
  132. text-align: center;
  133. margin: 5px;
  134. cursor: pointer;
  135. box-shadow: 0 0 3px #ffffff22 inset;
  136. &:hover {
  137. background-color: #0069ed;
  138. }
  139. }
  140. }
  141. .menu-button-group {
  142. margin-bottom: 5px;
  143. .program-menu {
  144. width: 90px;
  145. background: linear-gradient(#214ea5, #0f3075);
  146. margin-left: 5px;
  147. text-align: center;
  148. border-radius: 2px;
  149. cursor: pointer;
  150. }
  151. .icon-style {
  152. margin-right: 10px;
  153. &:last-child {
  154. margin-right: 5px;
  155. }
  156. }
  157. }
  158. }
  159. .bottom-size-show {
  160. animation: menuShow 0.4s;
  161. animation-iteration-count: 1;
  162. animation-fill-mode: forwards;
  163. animation-timing-function: ease-in;
  164. /* Safari and Chrome */
  165. -webkit-animation: menuShow 0.4s;
  166. -webkit-animation-iteration-count: 1;
  167. -webkit-animation-fill-mode: forwards;
  168. -webkit-animation-timing-function: ease-in;
  169. }
  170. .menu-show-icon {
  171. position: fixed;
  172. bottom: 5px;
  173. left: 5px;
  174. z-index: 1000000;
  175. .icon {
  176. width: 60px;
  177. height: 60px;
  178. position: relative;
  179. &:before {
  180. content: '';
  181. display: block;
  182. width: 60px;
  183. height: 60px;
  184. position: absolute;
  185. background: url('/@/assets/images/vent/bottom-icon/menu-icon-inner.png') no-repeat;
  186. background-position: center;
  187. }
  188. &:after {
  189. content: '';
  190. display: block;
  191. width: 60px;
  192. height: 60px;
  193. position: absolute;
  194. animation-timing-function: ease-in;
  195. animation: fadenum 8s infinite;
  196. }
  197. @keyframes fadenum {
  198. 0% {
  199. transform: rotate(0deg);
  200. }
  201. 10% {
  202. transform: rotate(360deg);
  203. }
  204. 100% {
  205. transform: rotate(360deg);
  206. }
  207. }
  208. }
  209. .icon-1 {
  210. background-image: url('/@/assets/images/vent/bottom-icon/menu-icon-outer.png');
  211. background-position: center;
  212. &:after {
  213. background: url('/@/assets/images/vent/bottom-icon/menu-icon-center.png') no-repeat;
  214. background-position: center;
  215. }
  216. }
  217. .icon-2 {
  218. background-image: url('/@/assets/images/vent/bottom-icon/1.png');
  219. background-position: center;
  220. &:after {
  221. background: url('/@/assets/images/vent/bottom-icon/2.png') no-repeat;
  222. background-position: center;
  223. }
  224. }
  225. }
  226. </style>