teacherCreation.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <view class="m_container df fdr">
  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_data " v-for="(item,index) in menu" :key="index" @click="checkMenu(item,0)">
  13. <view class="m_menu-item">
  14. <view :class="item.select&&childrenIndex==-1?'m_act':''"></view>
  15. <view class="m_menu_item_icon">
  16. <span class="font_family " :class="item.select&&childrenIndex==-1? item.icon+' m_act1 ':item.icon"></span>
  17. </view>
  18. <view class="m_menu_item_name" :class="item.select&&childrenIndex==-1?'m_act_font':''">{{item.title}}</view>
  19. <view class="m_menu_right">
  20. <icon :type="''" class="font_family icon-lujing2 " :class="item.select? 'm_act11':''"></icon>
  21. </view>
  22. </view>
  23. <view class="m_menu-item-checked" v-for="(children,aindex) in item.list" :key="aindex" v-show="item.select"
  24. @click.stop="checkMenu(children,1)">
  25. <view class="m_menu_item_name" :class="children.select?'cact':''">{{children.title}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <scroll-view class="rightBox" scroll-y="true" :scroll-top="scrollTop" @scroll="scroll">
  31. <!-- <view class="rightBox"> -->
  32. <!-- showboder -->
  33. <teacher ref="teacher" v-show="index==1" @paging="paging"></teacher>
  34. <create ref="create" v-show="index==3"></create>
  35. <vtable ref="table" v-show="index==2"></vtable>
  36. <project ref="project" v-show="index==4"></project>
  37. <location ref="location" v-show="index==2||index==4"></location>
  38. <!-- </view> -->
  39. </scroll-view>
  40. </view>
  41. </template>
  42. <script>
  43. import teacher from "./teacher/teacher.vue"
  44. import create from "./teacher/create.vue"
  45. import vtable from "./teacher/table.vue"
  46. import project from "./teacher/project.vue"
  47. import location from "./teacher/location_temp.vue"
  48. // import location from "./teacher/location.vue"
  49. export default {
  50. data() {
  51. return {
  52. index: 1,
  53. childrenIndex: -1,
  54. name: '张林老师',
  55. position: '计算机系',
  56. menu: [{
  57. id: 1,
  58. icon: "icon-bianzu22",
  59. select: true,
  60. title: '新建项目',
  61. list: []
  62. }, {
  63. id: 2,
  64. icon: "icon-bianzu22",
  65. select: false,
  66. title: '选择项目',
  67. list: [{
  68. id: 4,
  69. title: "项目一",
  70. select: false
  71. }]
  72. }],
  73. scrollTop: 0,
  74. oldScrollTop: 0,
  75. }
  76. },
  77. components: {
  78. teacher,
  79. create,
  80. vtable,
  81. project,
  82. location
  83. },
  84. created() {
  85. },
  86. methods: {
  87. checkMenu(obj, i) {
  88. this.index = obj.id;
  89. if (i == 0) {
  90. this.index = obj.id;
  91. this.menu.forEach(p => p.select = false);
  92. obj.list.forEach(p => p.select = false);
  93. obj.select = true;
  94. } else {
  95. obj.select = true;
  96. }
  97. },
  98. paging(obj) {
  99. this.index = obj;
  100. },
  101. childrenClick(obj) {
  102. obj.select = true;
  103. },
  104. scroll(e) {
  105. //记录scroll 位置
  106. this.oldScrollTop = e.detail.scrollTop
  107. },
  108. goTop(e) {
  109. //视图会发生重新渲染
  110. this.scrollTop = this.oldScrollTop
  111. //当视图渲染结束 重新设置为0
  112. this.$nextTick(() => {
  113. this.scrollTop = 0
  114. });
  115. }
  116. }
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. @import '../../assets/icon/iconfont.css';
  121. .rightBox{
  122. flex:1;
  123. }
  124. .m_menu_right {
  125. position: absolute;
  126. right: 50rpx;
  127. top: 50%;
  128. transform: translateY(-50%);
  129. font-size: 30rpx;
  130. }
  131. .m_menu-item-checked {}
  132. .m_container {
  133. // display: flex;
  134. // justify-content: space-between;
  135. width: 100%;
  136. // height: 100%;
  137. height: px2vh(960);
  138. .m_left {
  139. // width: 500rpx;
  140. width: px2vw(374);
  141. background-color: #fff;
  142. border-right: 10rpx solid #ECECEC;
  143. border-top: 5rpx solid #ECECEC;
  144. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  145. .m_hander {
  146. text-align: center;
  147. background-color: #fff;
  148. height: 600rpx;
  149. position: relative;
  150. // margin: 5rpx 10rpx 10rpx 0;
  151. border-bottom: 8rpx solid #ECECEC;
  152. .m_teacher {
  153. position: absolute;
  154. top: 50%;
  155. left: 50%;
  156. transform: translate(-50%, -50%);
  157. }
  158. .m_teacher_name {
  159. font-size: 1.1rem;
  160. font-weight: 600;
  161. padding: 30rpx 0;
  162. font-family: MicrosoftYaHei;
  163. }
  164. .m_head_portrait {
  165. width: 250rpx;
  166. height: 250rpx;
  167. color: #555555;
  168. }
  169. }
  170. }
  171. .m_right {
  172. width: 100%;
  173. margin-top: 5rpx;
  174. // padding: 0 150rpx;
  175. background-color: #fff;
  176. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  177. .m_right_hander {
  178. text-align: right;
  179. height: 250rpx;
  180. position: relative;
  181. .m_btn_red {
  182. position: absolute;
  183. height: 80rpx;
  184. line-height: 80rpx;
  185. padding: 0 40rpx;
  186. right: 0;
  187. top: 50%;
  188. transform: translateY(-50%);
  189. background: #EA252C;
  190. color: #fff;
  191. }
  192. }
  193. }
  194. .m_menu-icon {
  195. width: 24rpx;
  196. height: 24rpx;
  197. }
  198. .m_menu {
  199. background-color: #fff;
  200. .m_menu-item {
  201. position: relative;
  202. display: flex;
  203. padding: 20rpx 0;
  204. line-height: 90rpx;
  205. font-weight: 500;
  206. border-bottom: 1px solid #DDDDDD;
  207. .m_menu_item_icon {
  208. width: 100rpx;
  209. text-align: right;
  210. margin-right: 15rpx;
  211. }
  212. .m_menu_item_name {
  213. margin-left: 10rpx;
  214. font-weight: 600;
  215. }
  216. .m_act {
  217. background: #FF0019;
  218. width: 8rpx;
  219. border-radius: 0px 200rpx 200rpx 0px;
  220. position: absolute;
  221. height: 90rpx;
  222. top: 20rpx;
  223. left: 0;
  224. }
  225. }
  226. }
  227. .m_act_font {
  228. // color: #FF0019;
  229. }
  230. }
  231. tbody tr {
  232. border-top: 2rpx solid #DDDDDD !important;
  233. }
  234. tbody tr th {
  235. font-weight: 400 !important;
  236. height: 140rpx;
  237. line-height: 140rpx;
  238. }
  239. tbody tr:hover {
  240. // color: #fff;
  241. background: #FDEBEC;
  242. // opacity: 0.08;
  243. }
  244. .m-table-hander {
  245. background-color: #FFF8F7;
  246. height: 140rpx;
  247. line-height: 140rpx;
  248. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  249. font-weight: bold;
  250. }
  251. .m_edit {
  252. position: absolute;
  253. top: 50%;
  254. left: 50%;
  255. transform: translate(-50%, -50%);
  256. background: rgb(67, 127, 250);
  257. color: rgb(255, 255, 255);
  258. min-width: 130rpx;
  259. }
  260. .m_delete {
  261. position: absolute;
  262. top: 50%;
  263. left: 50%;
  264. min-width: 130rpx;
  265. transform: translate(-50%, -50%);
  266. background: rgb(234, 37, 44);
  267. color: rgb(255, 255, 255);
  268. }
  269. .m_right_footer {
  270. margin-top: 80rpx;
  271. }
  272. .m_paging {
  273. text-align: right;
  274. .m_paging_item {
  275. padding: 10rpx 18rpx;
  276. border: 1rpx solid #DDDDDD;
  277. border-radius: 8rpx;
  278. margin-right: 10rpx;
  279. }
  280. .p_act {
  281. background: #EA252C;
  282. color: #fff;
  283. border: inherit;
  284. }
  285. }
  286. .m_paging_item:hover {
  287. background: #EA252C;
  288. color: #fff;
  289. border: inherit;
  290. }
  291. .m_act1 {
  292. color: #FF0019;
  293. }
  294. .m_act11 {
  295. // color: #FF0019;
  296. transform: rotate(90deg);
  297. transition: all 500ms ease;
  298. }
  299. .s_logo {
  300. width: 100%;
  301. height: 1000rpx;
  302. }
  303. .s_content_container {
  304. padding: 0 206rpx;
  305. .s_title {
  306. font-weight: bold;
  307. text-align: center;
  308. line-height: 200rpx;
  309. font-size: 45rpx;
  310. }
  311. .s_content {
  312. font-weight: 500;
  313. font-size: 40rpx;
  314. line-height: 70rpx;
  315. }
  316. }
  317. .m_btn_download {
  318. height: 80rpx;
  319. line-height: 80rpx;
  320. padding: 0 70rpx;
  321. background: #EA252C;
  322. color: #fff;
  323. font-family: MicrosoftYaHei;
  324. }
  325. .m_menu-item-checked .m_menu_item_name {
  326. line-height: 70rpx;
  327. text-align: center;
  328. }
  329. .m_menu-item-checked .cact {
  330. color: #EA252C;
  331. }
  332. </style>