Index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view class="m_container">
  3. <view class="m_left">
  4. <view class="m_menu">
  5. <view class="m_menu-item " :class="item.select?'m_act_font':''" v-for="(item,index) in menu" :key="index" @click="checkMenu(item)">
  6. <view :class="item.select?'m_act':''"></view>
  7. <view class="m_menu_item_icon">
  8. <icon type="" class="font_family" :class="item.select?(item.icon+' m_act1'):item.icon"></icon>
  9. </view>
  10. <view class="m_menu_item_name" v-text="item.title"></view>
  11. </view>
  12. </view>
  13. </view>
  14. <user ref="user" v-show="routerDataIndex==1"></user>
  15. <assets ref="assets" v-show="routerDataIndex==2"></assets>
  16. <project ref="project" v-show="routerDataIndex==3"></project>
  17. </view>
  18. </template>
  19. <script>
  20. import user from "./user.vue"
  21. import assets from "./assets.vue"
  22. import project from "./project.vue"
  23. export default {
  24. name: "manager_index",
  25. props: [],
  26. data() {
  27. return {
  28. routerDataIndex: 1,
  29. name: '张林老师',
  30. position: '计算机系',
  31. menu: [{
  32. id: 1,
  33. icon: "icon-bianzu",
  34. select: true,
  35. title: '用户'
  36. }, {
  37. id: 2,
  38. icon: "icon-xingzhuang21",
  39. select: false,
  40. title: '资产'
  41. }, {
  42. id: 3,
  43. icon: "icon-bianzubeifen20",
  44. select: false,
  45. title: '项目'
  46. }]
  47. }
  48. },
  49. components: {
  50. user,
  51. assets,
  52. project
  53. },
  54. created() {
  55. },
  56. methods: {
  57. checkMenu(obj) {
  58. this.menu.forEach(p => {
  59. if (p.id == obj.id) {
  60. p.select = true;
  61. this.routerDataIndex = obj.id;
  62. switch (this.routerDataIndex) {
  63. case 1:
  64. this.$refs.user.initPage();
  65. break;
  66. case 2:
  67. this.$refs.assets.initPage();
  68. break;
  69. case 3:
  70. this.$refs.project.initPage();
  71. break;
  72. default:
  73. console.log("切换中间导航状态", this.routerDataIndex);
  74. }
  75. } else {
  76. p.select = false;
  77. }
  78. });
  79. },
  80. //登录后默认显示用户列表,开始更新数据了
  81. onLogin(){
  82. this.$refs.user.initPage();
  83. }
  84. }
  85. }
  86. </script>
  87. <style scoped lang="scss">
  88. @import '../../assets/icon/iconfont.css';
  89. .m_container {
  90. display: flex;
  91. justify-content: space-between;
  92. width: 100%;
  93. height: 100%;
  94. .m_left {
  95. width: 500rpx;
  96. background-color: #fff;
  97. border-right: 10rpx solid #ECECEC;
  98. border-top: 5rpx solid #ECECEC;
  99. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  100. .m_hander {
  101. text-align: center;
  102. background-color: #fff;
  103. height: 600rpx;
  104. position: relative;
  105. // margin: 5rpx 10rpx 10rpx 0;
  106. border-bottom: 8rpx solid #ECECEC;
  107. .m_teacher {
  108. position: absolute;
  109. top: 50%;
  110. left: 50%;
  111. transform: translate(-50%, -50%);
  112. }
  113. .m_teacher_name {
  114. font-size: 1.1rem;
  115. font-weight: 600;
  116. padding: 30rpx 0;
  117. font-family: MicrosoftYaHei;
  118. }
  119. .m_head_portrait {
  120. width: 250rpx;
  121. height: 250rpx;
  122. color: #555555;
  123. }
  124. }
  125. }
  126. // .m_right {
  127. // width: 100%;
  128. // margin-top: 5rpx;
  129. // padding: 0 150rpx;
  130. // background-color: #fff;
  131. // box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  132. // .m_right_hander {
  133. // text-align: right;
  134. // height: 250rpx;
  135. // position: relative;
  136. // .m_btn_red {
  137. // position: absolute;
  138. // height: 80rpx;
  139. // line-height: 80rpx;
  140. // padding: 0 40rpx;
  141. // right: 0;
  142. // top: 50%;
  143. // transform: translateY(-50%);
  144. // background: #EA252C;
  145. // color: #fff;
  146. // }
  147. // }
  148. // }
  149. .m_menu-icon {
  150. width: 24rpx;
  151. height: 24rpx;
  152. }
  153. .m_menu {
  154. background-color: #fff;
  155. .m_menu-item {
  156. position: relative;
  157. display: flex;
  158. padding: 20rpx 0;
  159. line-height: 90rpx;
  160. font-weight: 500;
  161. border-bottom: 1px solid #DDDDDD;
  162. .m_menu_item_icon {
  163. width: 100rpx;
  164. text-align: right;
  165. margin-right: 15rpx;
  166. }
  167. .m_menu_item_name {
  168. margin-left: 10rpx;
  169. font-weight: 600;
  170. }
  171. .m_act {
  172. background: #FF0019;
  173. width: 8rpx;
  174. border-radius: 0px 200rpx 200rpx 0px;
  175. position: absolute;
  176. height: 90rpx;
  177. top: 20rpx;
  178. left: 0;
  179. }
  180. }
  181. }
  182. .m_act_font .m_menu_item_name {
  183. color: #FF0019;
  184. }
  185. }
  186. // tbody tr {
  187. // border-top: 2rpx solid #DDDDDD !important;
  188. // }
  189. // tbody tr th {
  190. // font-weight: 400 !important;
  191. // height: 140rpx;
  192. // line-height: 140rpx;
  193. // }
  194. // tbody tr:hover {
  195. // // color: #fff;
  196. // background: #FDEBEC;
  197. // // opacity: 0.08;
  198. // }
  199. // .m-table-hander {
  200. // background-color: #FFF8F7;
  201. // height: 140rpx;
  202. // line-height: 140rpx;
  203. // font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  204. // font-weight: bold;
  205. // }
  206. // .m_edit {
  207. // position: absolute;
  208. // top: 50%;
  209. // left: 50%;
  210. // transform: translate(-50%, -50%);
  211. // background: rgb(67, 127, 250);
  212. // color: rgb(255, 255, 255);
  213. // min-width: 130rpx;
  214. // }
  215. // .m_delete {
  216. // position: absolute;
  217. // top: 50%;
  218. // left: 50%;
  219. // min-width: 130rpx;
  220. // transform: translate(-50%, -50%);
  221. // background: rgb(234, 37, 44);
  222. // color: rgb(255, 255, 255);
  223. // }
  224. // .m_right_footer {
  225. // margin-top: 80rpx;
  226. // }
  227. // .m_paging {
  228. // text-align: right;
  229. // .m_paging_item {
  230. // padding: 10rpx 18rpx;
  231. // border: 1rpx solid #DDDDDD;
  232. // border-radius: 8rpx;
  233. // margin-right: 10rpx;
  234. // }
  235. // .p_act {
  236. // background: #EA252C;
  237. // color: #fff;
  238. // border: inherit;
  239. // }
  240. // }
  241. // .m_paging_item:hover {
  242. // background: #EA252C;
  243. // color: #fff;
  244. // border: inherit;
  245. // }
  246. .m_act1 {
  247. color: #FF0019;
  248. }
  249. </style>