table.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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>{{'项目'+(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 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. mounted() {
  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. "UserID": mydata_userInfo.UserID
  62. },
  63. method: "POST",
  64. dataType: "json",
  65. success: res => {
  66. var {
  67. data
  68. } = res;
  69. this.tabledata = res.data.Projects
  70. console.log("table页面请求所有项目",res);
  71. // this.$forceUpdate();//强制刷新页面
  72. }
  73. })
  74. },
  75. //查看项目
  76. find(obj,index){
  77. // this.$emit('viewProject',obj,index)
  78. console.log('111111111')
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss">
  84. .m_right {
  85. width: 100%;
  86. height: px2vh(960);
  87. margin-top: 5rpx;
  88. // padding: 0 150rpx;
  89. background-color: #fff;
  90. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  91. .m_right_container {
  92. padding: 150rpx;
  93. }
  94. .s_logo {
  95. width: 100%;
  96. height: 800rpx;
  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. }
  156. .m_right_footer {
  157. margin-top: 80rpx;
  158. }
  159. .m_logoimg {
  160. width: 80rpx;
  161. height: 80rpx;
  162. position: absolute;
  163. top: 50%;
  164. left: 50%;
  165. transform: translate(-50%, -50%);
  166. }
  167. .m_paging {
  168. text-align: right;
  169. .m_paging_item {
  170. padding: 10rpx 18rpx;
  171. border: 1rpx solid #DDDDDD;
  172. border-radius: 8rpx;
  173. margin-right: 10rpx;
  174. }
  175. .p_act {
  176. background: #EA252C;
  177. color: #fff;
  178. border: inherit;
  179. }
  180. }
  181. .m_paging_item:hover {
  182. background: #EA252C;
  183. color: #fff;
  184. border: inherit;
  185. }
  186. .m_act1 {
  187. color: #FF0019;
  188. }
  189. </style>