teacherCreation.vue 7.9 KB

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