project.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="m_right">
  3. <view class="m_right_hander">
  4. <button size="mini" class="m_btn_red">添加项目</button>
  5. </view>
  6. <view class="m_right_container">
  7. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  8. <thead class="m-table-hander">
  9. <tr>
  10. <th>
  11. <icon type="" @click="checkAll" style="color:#EA252C;" class="font_family" :class="checke?'icon-fuxuankuang_weixuanzhong4':'icon-fuxuankuang-true'"></icon>
  12. </th>
  13. <th>项目名称</th>
  14. <th>项目创建人</th>
  15. <th>项目创建时间</th>
  16. <th>项目描述</th>
  17. <th>项目推荐</th>
  18. <th>上线</th>
  19. <th>删除</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <tr v-for="(item,index) in tabledata" :key="index">
  24. <th>
  25. <icon type="" style="color:#EA252C;" class="font_family" :class="item.checke?'icon-fuxuankuang_weixuanzhong4':'icon-fuxuankuang-true'"></icon>
  26. </th>
  27. <th>{{item.ProjectName}}</th>
  28. <th>{{item.CreateUserName}}</th>
  29. <th>{{item.CreateTime}}</th>
  30. <th>{{ITEM.ProjectReviewImage}}</th>
  31. <th></th>
  32. <th style="position: relative;"><button type="default" size="mini" class="m_online">上线</button></th>
  33. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  34. </tr>
  35. </tbody>
  36. </table>
  37. </view>
  38. <view class="m_right_footer">
  39. <view class="m_paging">
  40. <text class="m_paging_item m_paging_upper" v-show="pageIndex>1&&pageCount>0">上一页</text>
  41. <text class="m_paging_item" :key="i" v-for="i in pageCount" @click="paging(i)" :class="i==pageIndex?'p_act':''">
  42. {{i}}
  43. </text>
  44. <text class="m_paging_item m_paging_lower" v-show="pageIndex!=pageCount&&pageCount>0">下一页</text>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. name: "project",
  52. data() {
  53. return {
  54. checke: false,
  55. queryList: {
  56. UserID: "",
  57. BeginNum: 0,
  58. EndNum: 15,
  59. },
  60. pageIndex: 1,
  61. pageSize: 16,
  62. pageCount: 12,
  63. tabledata: []
  64. }
  65. },
  66. created() {
  67. this.getList();
  68. },
  69. methods: {
  70. paging(obj) {
  71. this.pageIndex = obj;
  72. this.queryList.BeginNum = (this.pageIndex - 1) * this.pageSize;
  73. this.queryList.EndNum = this.pageIndex * this.pageSize - 1;
  74. this.getlist();
  75. },
  76. checkAll() {
  77. this.checke = !this.checke;
  78. this.tabledata.forEach(p => p.checke = this.checke);
  79. },
  80. getList() {
  81. this.queryList.UserID = this.$UserId;
  82. uni.request({
  83. url: this.$Api + "/backstage/getprojects",
  84. data: this.queryList,
  85. method: "POST",
  86. dataType: "json",
  87. success: res => {
  88. var {
  89. data
  90. } = res;
  91. if (data.code == 100) {
  92. if (data.AllNumOfList > 0) {
  93. this.tabledata = res.Projects
  94. this.tabledata.forEach(p => p.checke == false);
  95. var tempCount = parseInt(data.AllNumOfList / this.pageSize);
  96. if (tempCount * this.pageSize == data.AllNumOfList)
  97. this.pageCount = tempCount;
  98. else
  99. this.pageCount = tempCount + 1;
  100. this.checke = false;
  101. } else {
  102. this.tabledata = [];
  103. }
  104. } else {
  105. this.tabledata = [];
  106. this.pageCount = 0;
  107. }
  108. }
  109. })
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss">
  115. @import '../../assets/icon/iconfont.css';
  116. .m_right {
  117. width: 100%;
  118. margin-top: 5rpx;
  119. padding: 0 150rpx;
  120. background-color: #fff;
  121. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  122. .m_right_hander {
  123. text-align: right;
  124. height: 250rpx;
  125. position: relative;
  126. .m_btn_red {
  127. position: absolute;
  128. height: 80rpx;
  129. line-height: 80rpx;
  130. padding: 0 40rpx;
  131. right: 0;
  132. top: 50%;
  133. transform: translateY(-50%);
  134. background: #EA252C;
  135. color: #fff;
  136. }
  137. }
  138. }
  139. tbody tr {
  140. border-top: 2rpx solid #DDDDDD !important;
  141. }
  142. tbody tr th {
  143. font-weight: 400 !important;
  144. height: 140rpx;
  145. line-height: 140rpx;
  146. }
  147. tbody tr:hover {
  148. // color: #fff;
  149. background: #FDEBEC;
  150. // opacity: 0.08;
  151. }
  152. .m-table-hander {
  153. background-color: #FFF8F7;
  154. height: 140rpx;
  155. line-height: 140rpx;
  156. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  157. font-weight: bold;
  158. }
  159. .m_edit {
  160. position: absolute;
  161. top: 50%;
  162. left: 50%;
  163. transform: translate(-50%, -50%);
  164. background: rgb(67, 127, 250);
  165. color: rgb(255, 255, 255);
  166. min-width: 130rpx;
  167. }
  168. .m_delete {
  169. position: absolute;
  170. top: 50%;
  171. left: 50%;
  172. min-width: 130rpx;
  173. transform: translate(-50%, -50%);
  174. background: rgb(234, 37, 44);
  175. color: rgb(255, 255, 255);
  176. }
  177. .m_online {
  178. background: #437FFA;
  179. position: absolute;
  180. top: 50%;
  181. left: 50%;
  182. min-width: 130rpx;
  183. transform: translate(-50%, -50%);
  184. color: rgb(255, 255, 255);
  185. }
  186. .m_offline {
  187. background: #FD813B;
  188. position: absolute;
  189. top: 50%;
  190. left: 50%;
  191. min-width: 130rpx;
  192. transform: translate(-50%, -50%);
  193. color: rgb(255, 255, 255);
  194. }
  195. .m_right_footer {
  196. margin-top: 80rpx;
  197. }
  198. .m_paging {
  199. text-align: right;
  200. .m_paging_item {
  201. padding: 10rpx 18rpx;
  202. border: 1rpx solid #DDDDDD;
  203. border-radius: 8rpx;
  204. margin-right: 10rpx;
  205. }
  206. .p_act {
  207. background: #EA252C;
  208. color: #fff;
  209. border: inherit;
  210. }
  211. }
  212. .m_paging_item:hover {
  213. background: #EA252C;
  214. color: #fff;
  215. border: inherit;
  216. }
  217. .m_act1 {
  218. color: #FF0019;
  219. }
  220. </style>