table.vue 4.6 KB

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