index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <div class="body-box">
  3. <SidevarItem></SidevarItem>
  4. <div class="content">
  5. <Navbar></Navbar>
  6. <router-view></router-view>
  7. </div>
  8. </div>
  9. </template>
  10. <script setup>
  11. import { ref, reactive, onBeforeMount, onMounted, watch } from "vue";
  12. import Navbar from "./sidebar/Navbar.vue";
  13. import SidevarItem from "./sidebar/SidevarItem.vue";
  14. import { useStore } from "vuex";
  15. import axios from "axios";
  16. import { useRouter } from "vue-router";
  17. const store = useStore();
  18. const router = useRouter();
  19. const api = ref("");
  20. watch(
  21. () => router.currentRoute.value.fullPath,
  22. (newValue, oldValue) => {
  23. console.log(newValue);
  24. if (newValue == "/schoolBus/statement") {
  25. store.commit("indexUp", 1);
  26. sessionStorage.setItem("sidevarItem", 1);
  27. }
  28. if (newValue == "/schoolBus/staff") {
  29. store.commit("indexUp", 2);
  30. sessionStorage.setItem("sidevarItem", 2);
  31. }
  32. if (newValue == "/schoolBus/account") {
  33. store.commit("indexUp", 3);
  34. sessionStorage.setItem("sidevarItem", 3);
  35. }
  36. if (newValue == "/schoolBus/bus") {
  37. store.commit("indexUp", 4);
  38. sessionStorage.setItem("sidevarItem", 4);
  39. }
  40. if (newValue == "/schoolBus/classes") {
  41. store.commit("indexUp", 6);
  42. sessionStorage.setItem("sidevarItem", 6);
  43. }
  44. if (newValue == "/schoolBus/buspath") {
  45. store.commit("indexUp", 5);
  46. sessionStorage.setItem("sidevarItem", 5);
  47. }
  48. if (newValue == "/schoolBus/system") {
  49. store.commit("indexUp", 8);
  50. sessionStorage.setItem("sidevarItem", 8);
  51. }
  52. if (newValue == "/schoolBus/blacklist") {
  53. store.commit("indexUp", 7);
  54. sessionStorage.setItem("sidevarItem", 7);
  55. }
  56. if (newValue == "/schoolBus/busquery") {
  57. store.commit("indexUp", 9);
  58. sessionStorage.setItem("sidevarItem", 9);
  59. }
  60. if (newValue == "/schoolBus/log") {
  61. store.commit("indexUp", 10);
  62. sessionStorage.setItem("sidevarItem", 10);
  63. }
  64. if (newValue == "/schoolBus/report") {
  65. store.commit("indexUp", 11);
  66. sessionStorage.setItem("sidevarItem", 11);
  67. }
  68. if (newValue == "/schoolBus/driverAudit") {
  69. store.commit("indexUp", 17);
  70. sessionStorage.setItem("sidevarItem", 17);
  71. }
  72. if (newValue == "/schoolBus/driverManagement") {
  73. store.commit("indexUp", 18);
  74. sessionStorage.setItem("sidevarItem", 18);
  75. }
  76. if (newValue == "/schoolBus/driverDeposit") {
  77. store.commit("indexUp", 19);
  78. sessionStorage.setItem("sidevarItem", 19);
  79. }
  80. if (newValue == "/schoolBus/driverPath") {
  81. store.commit("indexUp", 20);
  82. sessionStorage.setItem("sidevarItem", 20);
  83. }
  84. if (newValue == "/schoolBus/driverOrder") {
  85. store.commit("indexUp", 21);
  86. sessionStorage.setItem("sidevarItem", 21);
  87. }
  88. if (newValue == "/schoolBus/driverRule") {
  89. store.commit("indexUp", 22);
  90. sessionStorage.setItem("sidevarItem", 22);
  91. }
  92. if (newValue == "/schoolBus/news") {
  93. store.commit("indexUp", 0);
  94. sessionStorage.setItem("sidevarItem", 0);
  95. }
  96. }
  97. );
  98. const tableData = reactive({
  99. list: [],
  100. });
  101. onBeforeMount(async () => {
  102. api.value = store.state.user.api;
  103. // {
  104. // let res = await axios({
  105. // method: "post",
  106. // url: api.value + "/carBook/cnqueryHb.action",
  107. // headers: {
  108. // token: sessionStorage.getItem("token"),
  109. // },
  110. // });
  111. // console.log(res, "系统配置");
  112. // sessionStorage.setItem("waiting", JSON.stringify(res.data.data));
  113. // }
  114. });
  115. </script>
  116. <style scoped lang="scss">
  117. .body-box {
  118. display: flex;
  119. .content {
  120. // min-width: 1740px;
  121. max-width: calc(100vw - 72px);
  122. min-width: calc(100vw - 200px);
  123. width: 100%;
  124. height: calc(100vh);
  125. background-color: rgba(238, 238, 238, 1);
  126. :deep(.el-dialog__header .el-dialog__headerbtn) {
  127. outline: none;
  128. }
  129. }
  130. }
  131. </style>
  132. <style lang="scss">
  133. .is-message-box {
  134. .el-message-box__header {
  135. .el-message-box__headerbtn {
  136. outline: none;
  137. }
  138. }
  139. .el-message-box__btns {
  140. .el-button--primary {
  141. background-color: rgba(61, 81, 232, 1);
  142. border: 0.5px solid rgba(61, 81, 232, 1);
  143. }
  144. .el-button--primary:hover {
  145. background-color: rgb(119, 133, 239);
  146. border: 0.5px solid rgb(119, 133, 239);
  147. }
  148. }
  149. }
  150. .el-dialog__body {
  151. .el-input {
  152. .el-input__suffix-inner {
  153. color: rgba(61, 81, 232, 1);
  154. }
  155. }
  156. }
  157. .pw {
  158. .el-dialog__body {
  159. .el-form {
  160. .el-form-item {
  161. .queding {
  162. background-color: rgba(61, 81, 232, 1);
  163. border: 0.5px solid rgba(61, 81, 232, 1);
  164. }
  165. .queding:hover {
  166. background-color: rgb(119, 133, 239);
  167. border: 0.5px solid rgb(119, 133, 239);
  168. }
  169. }
  170. }
  171. }
  172. }
  173. #notification_1 {
  174. .el-notification__group {
  175. .el-notification__title {
  176. color: red;
  177. }
  178. }
  179. }
  180. *::-webkit-scrollbar-track {
  181. background-color: #fff;
  182. }
  183. *::-webkit-scrollbar {
  184. background-color: #57b2ff;
  185. height: 0;
  186. width: 0;
  187. }
  188. *::-webkit-scrollbar-thumb {
  189. background: #57b2ff;
  190. border-radius: 4px;
  191. height: 0;
  192. width: 0;
  193. }
  194. </style>