table.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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.ProjectName}}</th>
  18. <th></th>
  19. <th></th>
  20. <th>{{item.CreateUserName}}</th>
  21. <th style="position: relative;"><button type="default" @click="find(item)" size="mini" class="m_delete">查看</button></th>
  22. </tr>
  23. </tbody>
  24. </table>
  25. <!-- <view class="m_paging" style="margin-top: 80rpx;">
  26. <text class="m_paging_item m_paging_upper">上一页</text>
  27. <text 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 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: "home_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: this.$Api + "/project/getprojects",
  59. data: {
  60. "UserID": this.$UserId
  61. },
  62. method: "POST",
  63. dataType: "json",
  64. success: res => {
  65. var {
  66. data
  67. } = res;
  68. this.tabledata = res.Projects
  69. }
  70. })
  71. },
  72. find(obj){
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss">
  78. .m_right {
  79. width: 100%;
  80. height: px2vh(960);
  81. margin-top: 5rpx;
  82. // padding: 0 150rpx;
  83. background-color: #fff;
  84. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  85. .m_right_container {
  86. padding: 150rpx;
  87. }
  88. .s_logo {
  89. width: 100%;
  90. height: 800rpx;
  91. }
  92. .m_right_hander {
  93. text-align: right;
  94. height: 250rpx;
  95. position: relative;
  96. .m_btn_red {
  97. position: absolute;
  98. height: 80rpx;
  99. line-height: 80rpx;
  100. padding: 0 40rpx;
  101. right: 0;
  102. top: 50%;
  103. transform: translateY(-50%);
  104. background: #EA252C;
  105. color: #fff;
  106. }
  107. }
  108. }
  109. tbody tr {
  110. border-top: 2rpx solid #DDDDDD !important;
  111. }
  112. tbody tr th:first-child {
  113. position: relative;
  114. }
  115. tbody tr th {
  116. font-weight: 400 !important;
  117. height: 140rpx;
  118. line-height: 140rpx;
  119. }
  120. tbody tr:hover {
  121. // color: #fff;
  122. background: #FDEBEC;
  123. // opacity: 0.08;
  124. }
  125. .m-table-hander {
  126. background-color: #FFF8F7;
  127. height: 140rpx;
  128. line-height: 140rpx;
  129. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  130. font-weight: bold;
  131. }
  132. .m_edit {
  133. position: absolute;
  134. top: 50%;
  135. left: 50%;
  136. transform: translate(-50%, -50%);
  137. background: rgb(67, 127, 250);
  138. color: rgb(255, 255, 255);
  139. min-width: 130rpx;
  140. }
  141. .m_delete {
  142. position: absolute;
  143. top: 50%;
  144. left: 50%;
  145. min-width: 130rpx;
  146. transform: translate(-50%, -50%);
  147. background: rgb(234, 37, 44);
  148. color: rgb(255, 255, 255);
  149. }
  150. .m_right_footer {
  151. margin-top: 80rpx;
  152. }
  153. .m_logoimg {
  154. width: 80rpx;
  155. height: 80rpx;
  156. position: absolute;
  157. top: 50%;
  158. left: 50%;
  159. transform: translate(-50%, -50%);
  160. }
  161. .m_paging {
  162. text-align: right;
  163. .m_paging_item {
  164. padding: 10rpx 18rpx;
  165. border: 1rpx solid #DDDDDD;
  166. border-radius: 8rpx;
  167. margin-right: 10rpx;
  168. }
  169. .p_act {
  170. background: #EA252C;
  171. color: #fff;
  172. border: inherit;
  173. }
  174. }
  175. .m_paging_item:hover {
  176. background: #EA252C;
  177. color: #fff;
  178. border: inherit;
  179. }
  180. .m_act1 {
  181. color: #FF0019;
  182. }
  183. </style>