table.vue 4.4 KB

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