teams.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div>
  3. <div style="background-color: #FFFFFF;">
  4. <!-- <div class="top" @click="ret()">
  5. <div style="width: 10%;height: 5px;"></div>
  6. <div style="margin-left: 10px;">
  7. <span style="float: left;width: 20px;height: 20px;">
  8. <image src="../../static/icon/fanhui3.png" style="width: 18px;height: 18px;"></image>
  9. </span>
  10. <div style="margin-top: 5px;">
  11. <span style="color: #FFFFFF;">返回</span>
  12. </div>
  13. </div>
  14. <div style="text-align: center;margin-top: -22px;">
  15. <span style="color: #FFFFFF;">组织架构</span>
  16. </div>
  17. </div> -->
  18. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  19. <block slot="backText">返回</block>
  20. <block slot="content">组织架构</block>
  21. </cu-custom>
  22. <div class="ins">
  23. <div style="height: 3px;"></div>
  24. <input placeholder="🔍 搜索" style="text-align: center;" v-model="name" />
  25. </div>
  26. <br>
  27. <div style="height: 10px;width: 100%;background-color: #F1F1F1 ;"></div>
  28. <view class="cu-list menu radius" >
  29. <view class="cu-item arrow animation-slide-bottom" v-for='(item,index) in data'>
  30. <navigator class="content" @click="tmuser(item.id)" hover-class="none">
  31. <div style="margin-top: -10px;">
  32. <span class="imgs">
  33. <image :src="item.avatar" class="imgs"></image>
  34. </span>
  35. </div>
  36. <div style="margin-top: -40px;">
  37. <text style="margin-left: 40%;">{{item.realname}}</text>
  38. </div>
  39. <div style="margin-top: -25px;">
  40. <text class="text-grey" style="margin-left: 70%;">{{item.post}}</text>
  41. </div>
  42. </navigator>
  43. </view>
  44. </view>
  45. <!-- <div style="background-color: #FFFFFF;">
  46. <div style="margin-left: 10px;">
  47. <ul>
  48. <li class="s" v-for='(item,index) in data' >
  49. <br>
  50. <span class="imgs">
  51. <image :src="item.avatar" class="imgs"></image>
  52. </span>
  53. <div style="margin-left: 50px;margin-top: -40px;">
  54. <div>
  55. <h3>{{item.realname}}</h3>
  56. </div>
  57. <div style="margin-top: -27px;margin-left: 80px;">
  58. <span style="margin-left: 50px;color: #A3A7B1;font-size: 15px;" @click="tmuser(item.id)">{{item.post}}</span>
  59. <span style="width: 10px;height: 10px;float: right;"></span>
  60. <span style="float: right;color: #0081FF;font-size: 15px;" v-if='item.count=="1"' @click="jump(item.id)">TA的团队</span>
  61. </div>
  62. </div>
  63. <br>
  64. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  65. </li>
  66. </ul>
  67. </div>
  68. </div> -->
  69. </div>
  70. <div style="color:#A3A7B1;font-size: 15px;margin-left: 42%;">
  71. <span>共</span>
  72. <span style="margin-left: 10px;">{{data.length}}</span>
  73. <span style="margin-left: 10px;">人</span>
  74. </div>
  75. </div>
  76. </template>
  77. <script>
  78. import api from '@/api/api'
  79. export default {
  80. data() {
  81. return {
  82. data:[],
  83. name:'',
  84. userUrl:'/sys/user/departUser',
  85. userUrls:'/sys/user/queryById',
  86. }
  87. },
  88. watch:{
  89. name:{
  90. handler(newVal, objVal) {
  91. this.queryUserName(newVal);
  92. },
  93. }
  94. },
  95. created(){
  96. this.queryUserName()
  97. },
  98. methods:{
  99. tmuser(item){
  100. /* this.$store.commit('SET_TEMUSERID',item); */
  101. /* this.$http.get(this.userUrls,{params:{id:item}}).then(res=>{
  102. console.log("res",res)
  103. if (res.statusCode==200) {
  104. let perArr = res.data.data
  105. let avatar=(perArr.avatar && perArr.avatar.length > 0)? api.getFileAccessHttpUrl(perArr.avatar):'/static/avatar_boy.png'
  106. this.$store.commit('SET_CHAT',{chatname:perArr.realname,chatid:perArr.id,chatimg:avatar});
  107. this.$Router.push({name:'userchat'})
  108. }
  109. }).catch(err => {
  110. console.log(err);
  111. }); */
  112. //this.$store.commit('SET_CHAT',{chatname:item.realname,chatid:item.id,chatimg:item.avatar});
  113. this.$store.commit('SET_TEMUSERID',item);
  114. this.$Router.push({name:'teamuser2'})
  115. //this.$Router.push({name:'userchat'})
  116. },
  117. jump(item){
  118. this.$store.commit('SET_TEAMUSERID',item);
  119. this.$Router.push({name:'teames'})
  120. },
  121. queryUserName(name){
  122. this.data=[];
  123. this.$http.get(this.userUrl,{params:{departId:this.$store.getters.departId,name:name}}).then(res=>{
  124. if(res.data.length>0){
  125. for(var i=0;i<res.data.length;i++){
  126. var s={
  127. id:res.data[i].id,
  128. realname:res.data[i].realname,
  129. post:res.data[i].post,
  130. avatar:(res.data[i].avatar && res.data[i].avatar.length > 0)? api.getFileAccessHttpUrl(res.data[i].avatar):'/static/avatar_boy.png',
  131. count:res.data[i].count
  132. }
  133. this.data.push(s)
  134. }
  135. }
  136. }).catch(err => {
  137. console.log(err);
  138. });
  139. },
  140. ret(){
  141. this.$Router.push({name:'orgz'})
  142. }
  143. },
  144. }
  145. </script>
  146. <style>
  147. .ins{
  148. background-color: #F1F1F1;
  149. width: 90%;
  150. height: 30px;
  151. margin:0 auto;
  152. border-radius:5px 5px 5px 5px;
  153. margin-top: 15px;
  154. }
  155. .s{
  156. list-style-type:none;
  157. margin-left: -40px;
  158. }
  159. .imgs{
  160. width: 40px;
  161. height: 40px;
  162. border-radius:5px 5px 5px 5px;
  163. }
  164. .top{
  165. background-color: #5677AC;
  166. width: 100%;
  167. height: 40px;
  168. }
  169. </style>