teamList.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view>
  3. <u-navbar title="团队成员" title-color="#101010" ></u-navbar>
  4. <view class="top">
  5. <view class="search">
  6. <view class="searchBox">
  7. <u-search shape="square" placeholder="搜索授权用户" maxlength="12" v-model="testName" :show-action="false"
  8. :animation="true"></u-search>
  9. <u-button type="primary" size="mini" @click="testBtn">搜素</u-button>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="list" >
  14. <view class="item"
  15. v-for="(item,index) in list"
  16. :key="index">
  17. <view class="icon">
  18. <image class="img" v-if="item.headImg" :src="item.headImg" mode=""></image>
  19. <image class="img" v-else src="@/assets/img/默认头像.png" mode=""></image>
  20. </view>
  21. <view class="body">
  22. <view class="line1">
  23. <view class="title">
  24. {{item.realName}} ({{item.userName}})
  25. </view>
  26. </view>
  27. <view class="line2">
  28. <view class="value">
  29. {{roleNamesShow(item.roleNames)}}
  30. </view>
  31. </view>
  32. </view>
  33. <u-icon name="arrow-right" size="24" color="#BBBBBB" v-if="0"></u-icon>
  34. </view>
  35. </view>
  36. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  37. <view class="floating-button">
  38. <view class="button" @click="gotoUrl('/pages/team/teamAdd')" >
  39. 添加人员
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import * as API from '@/apis/pagejs/pagesTeam.js'
  46. export default {
  47. data() {
  48. return {
  49. list:[],
  50. listForm:{
  51. pageIndex: 1,
  52. pageSize: 20,
  53. recordsTotal: 1,
  54. status:0,
  55. roleName:"XJ,XJADMIN",
  56. roleName:"XJ",
  57. },
  58. testName: "",
  59. queryName: "",
  60. lockId:"",
  61. lockName:"",
  62. current:0,
  63. tabslist:[
  64. {
  65. name: '待处理'
  66. }, {
  67. name: '已处理'
  68. }
  69. ]
  70. };
  71. },
  72. onLoad(op) {
  73. },
  74. onShow(){
  75. this.getList()
  76. },
  77. methods: {
  78. roleNamesShow(str){
  79. var sz=str.split(",")
  80. var rsz=[]
  81. sz.forEach(item=>{
  82. if(item.indexOf('巡检')!=-1){
  83. rsz.push(item)
  84. }
  85. })
  86. return rsz.join(',')
  87. },
  88. submit(){
  89. },
  90. testBtn() {
  91. this.list = []
  92. //this.listForm.pageIndex=1
  93. this.listForm.name= this.testName
  94. this.getList()
  95. },
  96. getList(bl) {
  97. if(bl){
  98. this.listForm.pageIndex = 1
  99. }
  100. uni.showLoading({
  101. title: "加载中",
  102. mask: true,
  103. })
  104. API.userList(this.listForm).then((res) => {
  105. this.queryName = this.testName
  106. var list=[]
  107. if (this.listForm.pageIndex == 1) {
  108. list = res.data.data;
  109. } else {
  110. list = [
  111. ...list,
  112. ...res.data.data
  113. ];
  114. }
  115. this.list = res.data.data
  116. uni.hideLoading();
  117. }).catch(error => {
  118. uni.hideLoading();
  119. uni.showToast({
  120. title: error,
  121. icon: "none"
  122. })
  123. })
  124. },
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .list {
  130. padding: 24rpx 32rpx;
  131. background-color: rgba(255,255,255,1);
  132. .item {
  133. display: flex;
  134. border-bottom: 1px solid rgba(232, 232, 232, 1);
  135. padding: 12rpx 0;
  136. margin: 12rpx 0;
  137. .img {
  138. width: 72rpx;
  139. height: 72rpx;
  140. }
  141. .body {
  142. margin: 0 12rpx;
  143. width: 100%;
  144. .line1,
  145. .line2 {
  146. display: flex;
  147. justify-content: space-between;
  148. }
  149. .line2 {
  150. color: rgba(119,119,119,1);
  151. font-size: 24rpx;
  152. margin-top: 8rpx;
  153. }
  154. .line1 {
  155. .title {
  156. color: rgba(51, 51, 51, 1);
  157. font-size: 28rpx;
  158. font-weight: bold;
  159. }
  160. .status {
  161. background-color: rgba(255, 61, 0, 1);
  162. font-size: 24rpx;
  163. color:#fff;
  164. padding: 2rpx 8rpx;
  165. //border-radius: 4px;
  166. }
  167. .status0 {
  168. background-color: rgba(255, 61, 0, 1);
  169. }
  170. .status1 {
  171. background-color: #007aff;
  172. }
  173. .status2 {
  174. background-color: #ff9900;
  175. }
  176. .status3 {
  177. background-color: #19be6b;
  178. }
  179. .status4 {
  180. border: 1px solid rgba(255, 61, 0, 1);
  181. color: rgba(255, 61, 0, 1);
  182. }
  183. }
  184. .errorDesc{
  185. margin: 8rpx 0;
  186. width: 480rpx;
  187. color: #777777;
  188. font-size: 24rpx;
  189. overflow: hidden;
  190. text-overflow: ellipsis;
  191. white-space: nowrap; /* 禁止换行,强制单行 */
  192. }
  193. }
  194. }
  195. .item:last-child {
  196. border-bottom:0px solid rgba(232,232,232,1);
  197. }
  198. }
  199. .top{
  200. border-bottom: 1px solid #e8e8e8;
  201. }
  202. .search {
  203. padding: 16rpx 32rpx;
  204. background: #fff;
  205. .searchBox {
  206. display: flex;
  207. align-items: center;
  208. background: #F2F2F2;
  209. padding: 1px 16rpx;
  210. border-radius: 8px;
  211. justify-content: space-between;
  212. }
  213. }
  214. .floating-button {
  215. z-index: 999;
  216. position: fixed;
  217. bottom: 0; /* 距离底部 20px */
  218. width: 100%;
  219. display: flex;
  220. height: 120rpx;
  221. justify-content: center;
  222. background-color: rgba(255,255,255,1);
  223. .button{
  224. margin-top: 24rpx;
  225. border-radius: 50px;
  226. height: 80rpx;
  227. width: 80%;
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. padding:12rpx;
  232. background-color: rgba(22,119,255,1);
  233. color: rgba(255,255,255,1);
  234. font-size: 36rpx;
  235. }
  236. }
  237. </style>