table.vue 4.8 KB

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