teacherCreation.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  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" v-on:viewProject='viewProject'></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. if (obj.id == 2) {
  98. this.$refs.table.getList();
  99. }
  100. },
  101. paging(obj) {
  102. this.index = obj;
  103. },
  104. childrenClick(obj) {
  105. obj.select = true;
  106. },
  107. scroll(e) {
  108. //记录scroll 位置
  109. this.oldScrollTop = e.detail.scrollTop
  110. },
  111. goTop(e) {
  112. //视图会发生重新渲染
  113. this.scrollTop = this.oldScrollTop
  114. //当视图渲染结束 重新设置为0
  115. this.$nextTick(() => {
  116. this.scrollTop = 0
  117. });
  118. },
  119. viewProject(obj, index) {
  120. console.log("查看项目", obj, index);
  121. this.menu[1].list[0].title = '项目' + (index + 1);
  122. this.checkMenu(this.menu[1].list[0],1);
  123. this.$refs.project.viewProject(obj);
  124. }
  125. }
  126. }
  127. </script>
  128. <style scoped lang="scss">
  129. @import '../../assets/icon/iconfont.css';
  130. .rightBox {
  131. flex: 1;
  132. }
  133. .m_menu_right {
  134. position: absolute;
  135. right: 50rpx;
  136. top: 50%;
  137. transform: translateY(-50%);
  138. font-size: 30rpx;
  139. }
  140. .m_menu-item-checked {}
  141. .m_container {
  142. // display: flex;
  143. // justify-content: space-between;
  144. width: 100%;
  145. // height: 100%;
  146. height: px2vh(960);
  147. .m_left {
  148. // width: 500rpx;
  149. width: px2vw(374);
  150. background-color: #fff;
  151. border-right: 10rpx solid #ECECEC;
  152. border-top: 5rpx solid #ECECEC;
  153. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  154. .m_hander {
  155. text-align: center;
  156. background-color: #fff;
  157. height: 600rpx;
  158. position: relative;
  159. // margin: 5rpx 10rpx 10rpx 0;
  160. border-bottom: 8rpx solid #ECECEC;
  161. .m_teacher {
  162. position: absolute;
  163. top: 50%;
  164. left: 50%;
  165. transform: translate(-50%, -50%);
  166. }
  167. .m_teacher_name {
  168. font-size: 1.1rem;
  169. font-weight: 600;
  170. padding: 30rpx 0;
  171. font-family: MicrosoftYaHei;
  172. }
  173. .m_head_portrait {
  174. width: 250rpx;
  175. height: 250rpx;
  176. color: #555555;
  177. }
  178. }
  179. }
  180. .m_right {
  181. width: 100%;
  182. margin-top: 5rpx;
  183. // padding: 0 150rpx;
  184. background-color: #fff;
  185. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  186. .m_right_hander {
  187. text-align: right;
  188. height: 250rpx;
  189. position: relative;
  190. .m_btn_red {
  191. position: absolute;
  192. height: 80rpx;
  193. line-height: 80rpx;
  194. padding: 0 40rpx;
  195. right: 0;
  196. top: 50%;
  197. transform: translateY(-50%);
  198. background: #EA252C;
  199. color: #fff;
  200. }
  201. }
  202. }
  203. .m_menu-icon {
  204. width: 24rpx;
  205. height: 24rpx;
  206. }
  207. .m_menu {
  208. background-color: #fff;
  209. .m_menu-item {
  210. position: relative;
  211. display: flex;
  212. padding: 20rpx 0;
  213. line-height: 90rpx;
  214. font-weight: 500;
  215. border-bottom: 1px solid #DDDDDD;
  216. .m_menu_item_icon {
  217. width: 100rpx;
  218. text-align: right;
  219. margin-right: 15rpx;
  220. }
  221. .m_menu_item_name {
  222. margin-left: 10rpx;
  223. font-weight: 600;
  224. }
  225. .m_act {
  226. background: #FF0019;
  227. width: 8rpx;
  228. border-radius: 0px 200rpx 200rpx 0px;
  229. position: absolute;
  230. height: 90rpx;
  231. top: 20rpx;
  232. left: 0;
  233. }
  234. }
  235. }
  236. .m_act_font {
  237. // color: #FF0019;
  238. }
  239. }
  240. tbody tr {
  241. border-top: 2rpx solid #DDDDDD !important;
  242. }
  243. tbody tr th {
  244. font-weight: 400 !important;
  245. height: 140rpx;
  246. line-height: 140rpx;
  247. }
  248. tbody tr:hover {
  249. // color: #fff;
  250. background: #FDEBEC;
  251. // opacity: 0.08;
  252. }
  253. .m-table-hander {
  254. background-color: #FFF8F7;
  255. height: 140rpx;
  256. line-height: 140rpx;
  257. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  258. font-weight: bold;
  259. }
  260. .m_edit {
  261. position: absolute;
  262. top: 50%;
  263. left: 50%;
  264. transform: translate(-50%, -50%);
  265. background: rgb(67, 127, 250);
  266. color: rgb(255, 255, 255);
  267. min-width: 130rpx;
  268. }
  269. .m_delete {
  270. position: absolute;
  271. top: 50%;
  272. left: 50%;
  273. min-width: 130rpx;
  274. transform: translate(-50%, -50%);
  275. background: rgb(234, 37, 44);
  276. color: rgb(255, 255, 255);
  277. }
  278. .m_right_footer {
  279. margin-top: 80rpx;
  280. }
  281. .m_paging {
  282. text-align: right;
  283. .m_paging_item {
  284. padding: 10rpx 18rpx;
  285. border: 1rpx solid #DDDDDD;
  286. border-radius: 8rpx;
  287. margin-right: 10rpx;
  288. }
  289. .p_act {
  290. background: #EA252C;
  291. color: #fff;
  292. border: inherit;
  293. }
  294. }
  295. .m_paging_item:hover {
  296. background: #EA252C;
  297. color: #fff;
  298. border: inherit;
  299. }
  300. .m_act1 {
  301. color: #FF0019;
  302. }
  303. .m_act11 {
  304. // color: #FF0019;
  305. transform: rotate(90deg);
  306. transition: all 500ms ease;
  307. }
  308. .s_logo {
  309. width: 100%;
  310. height: 1000rpx;
  311. }
  312. .s_content_container {
  313. padding: 0 206rpx;
  314. .s_title {
  315. font-weight: bold;
  316. text-align: center;
  317. line-height: 200rpx;
  318. font-size: 45rpx;
  319. }
  320. .s_content {
  321. font-weight: 500;
  322. font-size: 40rpx;
  323. line-height: 70rpx;
  324. }
  325. }
  326. .m_btn_download {
  327. height: 80rpx;
  328. line-height: 80rpx;
  329. padding: 0 70rpx;
  330. background: #EA252C;
  331. color: #fff;
  332. font-family: MicrosoftYaHei;
  333. }
  334. .m_menu-item-checked .m_menu_item_name {
  335. line-height: 70rpx;
  336. text-align: center;
  337. }
  338. .m_menu-item-checked .cact {
  339. color: #EA252C;
  340. }
  341. </style>