teacherCreation.vue 8.3 KB

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