table.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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)" 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: "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: this.$Api + "/project/getprojects",
  59. data: {
  60. "UserID": this.$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(item) {
  72. uni.downloadFile({
  73. url: item.ProjectReviewImage,
  74. success: (res) => {
  75. if (res.statusCode === 200) {
  76. uni.openDocument({
  77. filePath: res.tempFilePath,
  78. // 如果文件名包含中文,建议使用escape(res.tempFilePath)转码,防止ios和安卓客户端导致的差异
  79. success: function(res) {
  80. console.log('打开文档成功');
  81. }
  82. });
  83. }
  84. },
  85. });
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .m_right {
  92. width: 100%;
  93. margin-top: 5rpx;
  94. // padding: 0 150rpx;
  95. background-color: #fff;
  96. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  97. .m_right_container {
  98. padding: 150rpx;
  99. }
  100. .s_logo {
  101. width: 100%;
  102. height: 800rpx;
  103. }
  104. .m_right_hander {
  105. text-align: right;
  106. height: 250rpx;
  107. position: relative;
  108. .m_btn_red {
  109. position: absolute;
  110. height: 80rpx;
  111. line-height: 80rpx;
  112. padding: 0 40rpx;
  113. right: 0;
  114. top: 50%;
  115. transform: translateY(-50%);
  116. background: #EA252C;
  117. color: #fff;
  118. }
  119. }
  120. }
  121. tbody tr {
  122. border-top: 2rpx solid #DDDDDD !important;
  123. }
  124. tbody tr th:first-child {
  125. position: relative;
  126. }
  127. tbody tr th {
  128. font-weight: 400 !important;
  129. height: 140rpx;
  130. line-height: 140rpx;
  131. }
  132. tbody tr:hover {
  133. // color: #fff;
  134. background: #FDEBEC;
  135. // opacity: 0.08;
  136. }
  137. .m-table-hander {
  138. background-color: #FFF8F7;
  139. height: 140rpx;
  140. line-height: 140rpx;
  141. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  142. font-weight: bold;
  143. }
  144. .m_edit {
  145. position: absolute;
  146. top: 50%;
  147. left: 50%;
  148. transform: translate(-50%, -50%);
  149. background: rgb(67, 127, 250);
  150. color: rgb(255, 255, 255);
  151. min-width: 130rpx;
  152. }
  153. .m_delete {
  154. position: absolute;
  155. top: 50%;
  156. left: 50%;
  157. min-width: 130rpx;
  158. transform: translate(-50%, -50%);
  159. background: rgb(234, 37, 44);
  160. color: rgb(255, 255, 255);
  161. }
  162. .m_right_footer {
  163. margin-top: 80rpx;
  164. }
  165. .m_logoimg {
  166. width: 80rpx;
  167. height: 80rpx;
  168. position: absolute;
  169. top: 50%;
  170. left: 50%;
  171. transform: translate(-50%, -50%);
  172. }
  173. .m_paging {
  174. text-align: right;
  175. .m_paging_item {
  176. padding: 10rpx 18rpx;
  177. border: 1rpx solid #DDDDDD;
  178. border-radius: 8rpx;
  179. margin-right: 10rpx;
  180. }
  181. .p_act {
  182. background: #EA252C;
  183. color: #fff;
  184. border: inherit;
  185. }
  186. }
  187. .m_paging_item:hover {
  188. background: #EA252C;
  189. color: #fff;
  190. border: inherit;
  191. }
  192. .m_act1 {
  193. color: #FF0019;
  194. }
  195. </style>