teacherCreation.vue 7.9 KB

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