table.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view class="m_right">
  3. <img src="../../assets/home/topImg.jpg" class="s_logo" mode=""></img>
  4. <view class="m_right_container">
  5. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  6. <thead class="m-table-hander">
  7. <tr>
  8. <th>项目</th>
  9. <th>名称</th>
  10. <th>类型</th>
  11. <th>创建人</th>
  12. <th>查看</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. <tr v-for="(item,index) in tabledata" :key="index">
  17. <th>{{item.Id}}</th>
  18. <th>{{item.ProjectName}}</th>
  19. <th>{{item.Type}}</th>
  20. <th>{{item.CreateUserName}}</th>
  21. <th style="position: relative;"><button type="default" @click="find(item,index)" size="mini" class="m_delete">查看</button></th>
  22. </tr>
  23. </tbody>
  24. </table>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name: "student_table",
  31. data() {
  32. return {
  33. index: 1,
  34. tabledata: []
  35. }
  36. },
  37. methods: {
  38. paging(obj) {
  39. this.index = obj;
  40. },
  41. getList() {
  42. uni.request({
  43. url: mydata_api + "/project/getprojects",
  44. data: {
  45. "UserID": mydata_userInfo.UserID
  46. },
  47. method: "POST",
  48. dataType: "json",
  49. success: res => {
  50. this.tabledata = res.data.Projects
  51. // console.log('tabledata=',this.tabledata)
  52. // let aData = {
  53. // "CreateTime": "2020-01-01 00:00:00",
  54. // "CreateUserID": "59458299-3b84-4895-98f6-b990cdaedc72",
  55. // "CreateUserName": "朱峰",
  56. // "Describe": '“实验以振兴国产科技电影”和“实现中国航天强国梦”的宏大蓝图为背景,以我国首次登陆火星计划为现实脚本,运用现场实时特效技术手段,对火星地面、外太空等场景进行“经典学习”和“实践创兴”并通过持续开发和学生在实验过程中的资源上传不断扩大现场创作的实景和虚拟资产库,使学生再学习过程中,即是资源学习者和方案讨论者,也是资源建设者',
  57. // "Id": 30,
  58. // "ProjectName": "《火星计划》",
  59. // "ProjectReviewImage": "../../../assets/studentAndTeacher/table/marsPlanReviewImage.png",
  60. // "ReviewImageOss": "../../../assets/studentAndTeacher/table/marsPlanMainCover.png",
  61. // "Type": "科幻",
  62. // }
  63. // this.tabledata.unshift(aData);
  64. // console.log('res=',this.tabledata)
  65. this.$forceUpdate();//强制刷新页面
  66. }
  67. })
  68. },
  69. find(obj,index){
  70. this.$emit('viewProject',obj,index);
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. .m_right {
  77. width: 100%;
  78. margin-top: 5rpx;
  79. // padding: 0 150rpx;
  80. background-color: #fff;
  81. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  82. .m_right_container {
  83. padding: 150rpx;
  84. }
  85. .s_logo {
  86. width: 100%;
  87. // height: 800rpx;
  88. // object-fit: cover;
  89. }
  90. .m_right_hander {
  91. text-align: right;
  92. height: 250rpx;
  93. position: relative;
  94. .m_btn_red {
  95. position: absolute;
  96. height: 80rpx;
  97. line-height: 80rpx;
  98. padding: 0 40rpx;
  99. right: 0;
  100. top: 50%;
  101. transform: translateY(-50%);
  102. background: #EA252C;
  103. color: #fff;
  104. }
  105. }
  106. }
  107. tbody tr {
  108. border-top: 2rpx solid #DDDDDD !important;
  109. }
  110. tbody tr th:first-child {
  111. position: relative;
  112. }
  113. tbody tr th {
  114. font-weight: 400 !important;
  115. height: 140rpx;
  116. line-height: 140rpx;
  117. }
  118. tbody tr:hover {
  119. // color: #fff;
  120. background: #FDEBEC;
  121. // opacity: 0.08;
  122. }
  123. .m-table-hander {
  124. background-color: #FFF8F7;
  125. height: 140rpx;
  126. line-height: 140rpx;
  127. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  128. font-weight: bold;
  129. }
  130. .m_edit {
  131. position: absolute;
  132. top: 50%;
  133. left: 50%;
  134. transform: translate(-50%, -50%);
  135. background: rgb(67, 127, 250);
  136. color: rgb(255, 255, 255);
  137. min-width: 130rpx;
  138. }
  139. .m_delete {
  140. position: absolute;
  141. top: 50%;
  142. left: 50%;
  143. min-width: 130rpx;
  144. transform: translate(-50%, -50%);
  145. background: rgb(234, 37, 44);
  146. color: rgb(255, 255, 255);
  147. z-index: 100;
  148. }
  149. .m_right_footer {
  150. margin-top: 80rpx;
  151. }
  152. .m_logoimg {
  153. width: 80rpx;
  154. height: 80rpx;
  155. position: absolute;
  156. top: 50%;
  157. left: 50%;
  158. transform: translate(-50%, -50%);
  159. }
  160. .m_paging {
  161. text-align: right;
  162. .m_paging_item {
  163. padding: 10rpx 18rpx;
  164. border: 1rpx solid #DDDDDD;
  165. border-radius: 8rpx;
  166. margin-right: 10rpx;
  167. }
  168. .p_act {
  169. background: #EA252C;
  170. color: #fff;
  171. border: inherit;
  172. }
  173. }
  174. .m_paging_item:hover {
  175. background: #EA252C;
  176. color: #fff;
  177. border: inherit;
  178. }
  179. .m_act1 {
  180. color: #FF0019;
  181. }
  182. </style>