table.vue 4.9 KB

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