teacherCreation.vue 8.4 KB

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