Index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <view class="m_container">
  3. <view class="m_left">
  4. <view class="m_hander">
  5. <view class="m_teacher">
  6. <image src="../../assets/login/loginPic2.png" class="m_head_portrait"></image>
  7. <view class="m_teacher_name" v-text="name"></view>
  8. <view class="m_teacher_position" v-text="position"></view>
  9. </view>
  10. </view>
  11. <view class="m_menu">
  12. <view class="m_menu-item " :class="item.select?'m_act_font':''" v-for="(item,index) in menu" :key="index" @click="checkMenu(item)">
  13. <view :class="item.select?'m_act':''">
  14. </view>
  15. <view class="m_menu_item_icon">
  16. <icon type="" class="font_family" :class="item.select?(item.icon+' m_act1'):item.icon"></icon>
  17. </view>
  18. <view class="m_menu_item_name" v-text="item.title"></view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="m_right">
  23. <view class="m_right_hander">
  24. <button size="mini" class="m_btn_red">添加用户</button>
  25. </view>
  26. <view class="m_right_container">
  27. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  28. <thead class="m-table-hander">
  29. <tr>
  30. <th>用户名</th>
  31. <th>班级</th>
  32. <th>学号</th>
  33. <th>电话</th>
  34. <th>ilab账户</th>
  35. <th>注册时间</th>
  36. <th>分数</th>
  37. <th>修改信息</th>
  38. <th>删除</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <tr>
  43. <th style="color: #EA252C;">张小旭</th>
  44. <th>26</th>
  45. <th>CMII09</th>
  46. <th>26</th>
  47. <th>15038728747</th>
  48. <th>2021-01-01</th>
  49. <th>90</th>
  50. <th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
  51. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  52. </tr>
  53. <tr>
  54. <th style="color: #EA252C;">张小旭</th>
  55. <th>26</th>
  56. <th>CMII09</th>
  57. <th>26</th>
  58. <th>15038728747</th>
  59. <th>2021-01-01</th>
  60. <th>90</th>
  61. <th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
  62. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  63. </tr>
  64. <tr>
  65. <th style="color: #EA252C;">张小旭</th>
  66. <th>26</th>
  67. <th>CMII09</th>
  68. <th>26</th>
  69. <th>15038728747</th>
  70. <th>2021-01-01</th>
  71. <th>90</th>
  72. <th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
  73. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  74. </tr>
  75. <tr>
  76. <th style="color: #EA252C;">张小旭</th>
  77. <th>26</th>
  78. <th>CMII09</th>
  79. <th>26</th>
  80. <th>15038728747</th>
  81. <th>2021-01-01</th>
  82. <th>90</th>
  83. <th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
  84. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  85. </tr>
  86. <tr>
  87. <th style="color: #EA252C;">张小旭</th>
  88. <th>26</th>
  89. <th>CMII09</th>
  90. <th>26</th>
  91. <th>15038728747</th>
  92. <th>2021-01-01</th>
  93. <th>90</th>
  94. <th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
  95. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  96. </tr>
  97. <tr>
  98. <th style="color: #EA252C;">张小旭</th>
  99. <th>26</th>
  100. <th>CMII09</th>
  101. <th>26</th>
  102. <th>15038728747</th>
  103. <th>2021-01-01</th>
  104. <th>90</th>
  105. <th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
  106. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  107. </tr>
  108. <tr>
  109. <th style="color: #EA252C;">张小旭</th>
  110. <th>26</th>
  111. <th>CMII09</th>
  112. <th>26</th>
  113. <th>15038728747</th>
  114. <th>2021-01-01</th>
  115. <th>90</th>
  116. <th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
  117. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  118. </tr>
  119. </tbody>
  120. </table>
  121. </view>
  122. <view class="m_right_footer">
  123. <view class="m_paging">
  124. <text class="m_paging_item m_paging_upper">上一页</text>
  125. <text class="m_paging_item" v-for="i in 8" @click="paging(i)" :class="i==index?'p_act':''">
  126. {{i}}
  127. </text>
  128. <text class="m_paging_item m_paging_lower">下一页</text>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. </template>
  134. <script>
  135. export default {
  136. name: "manager",
  137. props: [],
  138. data() {
  139. return {
  140. index: 1,
  141. name: '张林老师',
  142. position: '计算机系',
  143. menu: [{
  144. id: 1,
  145. icon: "icon-bianzu",
  146. select: true,
  147. title: '用户'
  148. }, {
  149. id: 2,
  150. icon: "icon-xingzhuang21",
  151. select: false,
  152. title: '资产'
  153. }, {
  154. id: 3,
  155. icon: "icon-bianzubeifen20",
  156. select: false,
  157. title: '项目'
  158. }],
  159. data: [{
  160. name: 'John Brown',
  161. age: 18,
  162. address: 'New York No. 1 Lake Park',
  163. id: "1",
  164. }],
  165. columns: [{
  166. title: "ID",
  167. key: "id"
  168. },
  169. {
  170. title: 'Name',
  171. key: 'name'
  172. },
  173. {
  174. title: 'Age',
  175. key: 'age'
  176. },
  177. {
  178. title: 'Address',
  179. key: 'address'
  180. }
  181. ],
  182. }
  183. },
  184. components: {},
  185. created() {
  186. },
  187. methods: {
  188. checkMenu(obj) {
  189. this.menu.forEach(p => p.select = false);
  190. obj.select = true;
  191. },
  192. paging(obj) {
  193. this.index = obj;
  194. }
  195. }
  196. }
  197. </script>
  198. <style scoped lang="scss">
  199. @import '../../assets/icon/iconfont.css';
  200. .m_container {
  201. display: flex;
  202. justify-content: space-between;
  203. width: 100%;
  204. height: 100%;
  205. .m_left {
  206. width: 500rpx;
  207. background-color: #fff;
  208. border-right: 10rpx solid #ECECEC;
  209. border-top: 5rpx solid #ECECEC;
  210. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  211. .m_hander {
  212. text-align: center;
  213. background-color: #fff;
  214. height: 600rpx;
  215. position: relative;
  216. // margin: 5rpx 10rpx 10rpx 0;
  217. border-bottom: 8rpx solid #ECECEC;
  218. .m_teacher {
  219. position: absolute;
  220. top: 50%;
  221. left: 50%;
  222. transform: translate(-50%, -50%);
  223. }
  224. .m_teacher_name {
  225. font-size: 1.1rem;
  226. font-weight: 600;
  227. padding: 30rpx 0;
  228. font-family: MicrosoftYaHei;
  229. }
  230. .m_head_portrait {
  231. width: 250rpx;
  232. height: 250rpx;
  233. color: #555555;
  234. }
  235. }
  236. }
  237. .m_right {
  238. width: 100%;
  239. margin-top: 5rpx;
  240. padding: 0 150rpx;
  241. background-color: #fff;
  242. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  243. .m_right_hander {
  244. text-align: right;
  245. height: 250rpx;
  246. position: relative;
  247. .m_btn_red {
  248. position: absolute;
  249. height: 80rpx;
  250. line-height: 80rpx;
  251. padding: 0 40rpx;
  252. right: 0;
  253. top: 50%;
  254. transform: translateY(-50%);
  255. background: #EA252C;
  256. color: #fff;
  257. }
  258. }
  259. }
  260. .m_menu-icon {
  261. width: 24rpx;
  262. height: 24rpx;
  263. }
  264. .m_menu {
  265. background-color: #fff;
  266. .m_menu-item {
  267. position: relative;
  268. display: flex;
  269. padding: 20rpx 0;
  270. line-height: 90rpx;
  271. font-weight: 500;
  272. border-bottom: 1px solid #DDDDDD;
  273. .m_menu_item_icon {
  274. width: 100rpx;
  275. text-align: right;
  276. margin-right: 15rpx;
  277. }
  278. .m_menu_item_name {
  279. margin-left: 10rpx;
  280. font-weight: 600;
  281. }
  282. .m_act {
  283. background: #FF0019;
  284. width: 8rpx;
  285. border-radius: 0px 200rpx 200rpx 0px;
  286. position: absolute;
  287. height: 90rpx;
  288. top: 20rpx;
  289. left: 0;
  290. }
  291. }
  292. }
  293. .m_act_font .m_menu_item_name {
  294. color: #FF0019;
  295. }
  296. }
  297. tbody tr {
  298. border-top: 2rpx solid #DDDDDD !important;
  299. }
  300. tbody tr th {
  301. font-weight: 400 !important;
  302. height: 140rpx;
  303. line-height: 140rpx;
  304. }
  305. tbody tr:hover {
  306. // color: #fff;
  307. background: #FDEBEC;
  308. // opacity: 0.08;
  309. }
  310. .m-table-hander {
  311. background-color: #FFF8F7;
  312. height: 140rpx;
  313. line-height: 140rpx;
  314. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  315. font-weight: bold;
  316. }
  317. .m_edit {
  318. position: absolute;
  319. top: 50%;
  320. left: 50%;
  321. transform: translate(-50%, -50%);
  322. background: rgb(67, 127, 250);
  323. color: rgb(255, 255, 255);
  324. min-width: 130rpx;
  325. }
  326. .m_delete {
  327. position: absolute;
  328. top: 50%;
  329. left: 50%;
  330. min-width: 130rpx;
  331. transform: translate(-50%, -50%);
  332. background: rgb(234, 37, 44);
  333. color: rgb(255, 255, 255);
  334. }
  335. .m_right_footer {
  336. margin-top: 80rpx;
  337. }
  338. .m_paging {
  339. text-align: right;
  340. .m_paging_item {
  341. padding: 10rpx 18rpx;
  342. border: 1rpx solid #DDDDDD;
  343. border-radius: 8rpx;
  344. margin-right: 10rpx;
  345. }
  346. .p_act {
  347. background: #EA252C;
  348. color: #fff;
  349. border: inherit;
  350. }
  351. }
  352. .m_paging_item:hover {
  353. background: #EA252C;
  354. color: #fff;
  355. border: inherit;
  356. }
  357. .m_act1{
  358. color: #FF0019;
  359. }
  360. </style>