table.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="m_right">
  3. <image src="../../assets/home/homeBG.png" class="s_logo" mode=""></image>
  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('res=',this.tabledata)
  67. this.$forceUpdate();//强制刷新页面
  68. }
  69. })
  70. },
  71. find(obj,index){
  72. this.$emit('viewProject',obj,index);
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss">
  78. .m_right {
  79. width: 100%;
  80. margin-top: 5rpx;
  81. // padding: 0 150rpx;
  82. background-color: #fff;
  83. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  84. .m_right_container {
  85. padding: 150rpx;
  86. }
  87. .s_logo {
  88. width: 100%;
  89. height: 800rpx;
  90. }
  91. .m_right_hander {
  92. text-align: right;
  93. height: 250rpx;
  94. position: relative;
  95. .m_btn_red {
  96. position: absolute;
  97. height: 80rpx;
  98. line-height: 80rpx;
  99. padding: 0 40rpx;
  100. right: 0;
  101. top: 50%;
  102. transform: translateY(-50%);
  103. background: #EA252C;
  104. color: #fff;
  105. }
  106. }
  107. }
  108. tbody tr {
  109. border-top: 2rpx solid #DDDDDD !important;
  110. }
  111. tbody tr th:first-child {
  112. position: relative;
  113. }
  114. tbody tr th {
  115. font-weight: 400 !important;
  116. height: 140rpx;
  117. line-height: 140rpx;
  118. }
  119. tbody tr:hover {
  120. // color: #fff;
  121. background: #FDEBEC;
  122. // opacity: 0.08;
  123. }
  124. .m-table-hander {
  125. background-color: #FFF8F7;
  126. height: 140rpx;
  127. line-height: 140rpx;
  128. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  129. font-weight: bold;
  130. }
  131. .m_edit {
  132. position: absolute;
  133. top: 50%;
  134. left: 50%;
  135. transform: translate(-50%, -50%);
  136. background: rgb(67, 127, 250);
  137. color: rgb(255, 255, 255);
  138. min-width: 130rpx;
  139. }
  140. .m_delete {
  141. position: absolute;
  142. top: 50%;
  143. left: 50%;
  144. min-width: 130rpx;
  145. transform: translate(-50%, -50%);
  146. background: rgb(234, 37, 44);
  147. color: rgb(255, 255, 255);
  148. }
  149. .m_right_footer {
  150. margin-top: 80rpx;
  151. }
  152. .m_logoimg {
  153. width: 80rpx;
  154. height: 80rpx;
  155. position: absolute;
  156. top: 50%;
  157. left: 50%;
  158. transform: translate(-50%, -50%);
  159. }
  160. .m_paging {
  161. text-align: right;
  162. .m_paging_item {
  163. padding: 10rpx 18rpx;
  164. border: 1rpx solid #DDDDDD;
  165. border-radius: 8rpx;
  166. margin-right: 10rpx;
  167. }
  168. .p_act {
  169. background: #EA252C;
  170. color: #fff;
  171. border: inherit;
  172. }
  173. }
  174. .m_paging_item:hover {
  175. background: #EA252C;
  176. color: #fff;
  177. border: inherit;
  178. }
  179. .m_act1 {
  180. color: #FF0019;
  181. }
  182. </style>