table.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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>{{'项目'+(index+1)}}</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)" @click="onClickCheck"/> -->
  27. <checkbox :checked="Boolean(item.IsPublic)" disabled="false"/>
  28. </label>
  29. </checkbox-group>
  30. </th>
  31. </tr>
  32. </tbody>
  33. </table>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. name: "home_table",
  40. data() {
  41. return {
  42. index: 1,
  43. tabledata: []
  44. }
  45. },
  46. components: {
  47. // locationtemp
  48. },
  49. mounted() {
  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("table页面请求所有项目",res);
  80. this.$forceUpdate();//强制刷新页面
  81. }
  82. })
  83. },
  84. //查看项目
  85. find(obj,index){
  86. this.$emit('viewProject',obj,index);
  87. },
  88. onClickCheck(e){
  89. if(this.bPublic==true){
  90. this.bPublic = false;
  91. } else {
  92. this.bPublic = true;
  93. }
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. .m_right {
  100. width: 100%;
  101. height: px2vh(960);
  102. margin-top: 5rpx;
  103. // padding: 0 150rpx;
  104. background-color: #fff;
  105. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  106. .m_right_container {
  107. padding: 150rpx;
  108. }
  109. .s_logo {
  110. width: 100%;
  111. // height: 800rpx;
  112. }
  113. .m_right_hander {
  114. text-align: right;
  115. height: 250rpx;
  116. position: relative;
  117. .m_btn_red {
  118. position: absolute;
  119. height: 80rpx;
  120. line-height: 80rpx;
  121. padding: 0 40rpx;
  122. right: 0;
  123. top: 50%;
  124. transform: translateY(-50%);
  125. background: #EA252C;
  126. color: #fff;
  127. }
  128. }
  129. }
  130. tbody tr {
  131. border-top: 2rpx solid #DDDDDD !important;
  132. }
  133. tbody tr th:first-child {
  134. position: relative;
  135. }
  136. tbody tr th {
  137. font-weight: 400 !important;
  138. height: 140rpx;
  139. line-height: 140rpx;
  140. }
  141. tbody tr:hover {
  142. // color: #fff;
  143. background: #FDEBEC;
  144. // opacity: 0.08;
  145. }
  146. .m-table-hander {
  147. background-color: #FFF8F7;
  148. height: 140rpx;
  149. line-height: 140rpx;
  150. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  151. font-weight: bold;
  152. }
  153. .m_edit {
  154. position: absolute;
  155. top: 50%;
  156. left: 50%;
  157. transform: translate(-50%, -50%);
  158. background: rgb(67, 127, 250);
  159. color: rgb(255, 255, 255);
  160. min-width: 130rpx;
  161. }
  162. .m_delete {
  163. position: absolute;
  164. top: 50%;
  165. left: 50%;
  166. min-width: 130rpx;
  167. transform: translate(-50%, -50%);
  168. background: rgb(234, 37, 44);
  169. color: rgb(255, 255, 255);
  170. z-index: 3;
  171. }
  172. .m_right_footer {
  173. margin-top: 80rpx;
  174. }
  175. .m_logoimg {
  176. width: 80rpx;
  177. height: 80rpx;
  178. position: absolute;
  179. top: 50%;
  180. left: 50%;
  181. transform: translate(-50%, -50%);
  182. }
  183. .m_paging {
  184. text-align: right;
  185. .m_paging_item {
  186. padding: 10rpx 18rpx;
  187. border: 1rpx solid #DDDDDD;
  188. border-radius: 8rpx;
  189. margin-right: 10rpx;
  190. }
  191. .p_act {
  192. background: #EA252C;
  193. color: #fff;
  194. border: inherit;
  195. }
  196. }
  197. .m_paging_item:hover {
  198. background: #EA252C;
  199. color: #fff;
  200. border: inherit;
  201. }
  202. .m_act1 {
  203. color: #FF0019;
  204. }
  205. </style>