teacherCreation.vue 7.5 KB

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