list.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view>
  3. <!-- 第一种样式 人员管理-->
  4. <block v-if="datainfo.length>0">
  5. <!-- 人员管理 -->
  6. <block v-if="type=='people'">
  7. </block>
  8. <view class="shax">{{wtdt}}</view>
  9. </block>
  10. <!-- 无数据 -->
  11. <view class="nodata" v-else>
  12. <image :src="noiconpimg"></image>
  13. <view>
  14. 暂无数据
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  21. import config from '@/config'
  22. export default{
  23. props:{
  24. datainfo: {
  25. type: Array,
  26. default () {
  27. return []
  28. }
  29. },
  30. wtdt:{
  31. type:String,
  32. default () {
  33. return ''
  34. }
  35. },
  36. type:{
  37. type:String,
  38. default () {
  39. return 0
  40. }
  41. },
  42. },
  43. data(){
  44. return{
  45. noiconpimg:require("@/static/images/nodata.png"),
  46. baseUrl:config.baseUrl,
  47. delBtnWidth:66,//左滑默认宽度
  48. }
  49. },
  50. mounted() {
  51. },
  52. methods:{
  53. checkPermi, checkRole,
  54. getDetail(e){
  55. this.$emit('getDetail',e)
  56. },
  57. getAddFn(e){
  58. this.$emit('getAddFn',e)
  59. },
  60. getReadlist(e){
  61. this.$emit('getReadlist',e)
  62. },
  63. getZhan(idx){
  64. // var obj=JSON.parse(JSON.stringify(this.datainfo))[idx]
  65. // obj.zhanflag=!obj.zhanflag;
  66. // this.datainfo.splice(idx,1,obj);
  67. this.datainfo[idx].zhanflag=!this.datainfo[idx].zhanflag
  68. },
  69. getPreview(idx,arr) {
  70. var newArr=[];
  71. arr.forEach(ite=>{
  72. var ds=this.baseUrl+ite
  73. newArr.push(ds)
  74. })
  75. uni.previewImage({
  76. urls: newArr,
  77. current:idx,
  78. success: function(data) {},
  79. fail: function(err) {}
  80. });
  81. },
  82. //开始触摸滑动
  83. drawStart(e) {
  84. // console.log("开始触发");
  85. var touch = e.touches[0];
  86. this.startX = touch.clientX;
  87. },
  88. //触摸滑动
  89. drawMove(e) {
  90. // console.log("滑动");
  91. for (var index in this.datainfo) {
  92. // this.csListArrl[index].right=0
  93. this.$set(this.datainfo[index],'right',0);
  94. }
  95. var idx=e.currentTarget.dataset.idx
  96. var touch = e.touches[0];
  97. var item = this.datainfo[idx];
  98. var disX = this.startX - touch.clientX;
  99. if (disX >= 20) {
  100. if (disX > this.delBtnWidth) {
  101. disX = this.delBtnWidth;
  102. }
  103. // this.csListArrl[idx].right=disX
  104. this.$set(this.datainfo[idx],'right',disX);
  105. } else {
  106. // this.csListArrl[idx].right=0
  107. this.$set(this.datainfo[idx],'right',0);
  108. }
  109. },
  110. //触摸滑动结束
  111. drawEnd(e) {
  112. // console.log("滑动结束");
  113. var idx=e.currentTarget.dataset.idx
  114. var item = this.datainfo[idx];
  115. if (item.right >= this.delBtnWidth / 2) {
  116. // this.datainfo[idx].right=this.delBtnWidth
  117. this.$set(this.datainfo[idx],'right',this.delBtnWidth);
  118. } else {
  119. this.datainfo[idx].right=0
  120. }
  121. },
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .flex{display: flex;}
  127. .flexc{display: flex;align-items: center;}
  128. .mb10{margin-bottom: 20rpx;}
  129. .carlist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;
  130. .ctop{border-bottom: 2rpx solid #E5E5E5;padding: 24rpx 24rpx 22rpx;
  131. .imgs{width: 40rpx;height: 42rpx;margin-right: 32rpx;}
  132. .tit{font-size: 30rpx;color: #272727;font-weight: bold;margin-right: 20rpx;}
  133. .txt{font-weight: 500;font-size: 26rpx;
  134. &.ca{color: #3565ED;}
  135. &.cb{color: #FE5A0E;}
  136. &.cc{color: #28C529;}
  137. }
  138. .txta{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  139. .num{font-size: 24rpx;color: #AAAAAA;}
  140. }
  141. .plists{padding: 30rpx 24rpx 6rpx;
  142. .plist{background: linear-gradient(-90deg, #F2F5FF 0%, #FBFDFF 100%);border-radius: 20rpx;border: 2rpx solid #E6E6E6;margin-bottom: 24rpx;padding: 18rpx 26rpx 4rpx;display: flex;
  143. .head{width: 96rpx;height: 98rpx;margin-right: 32rpx;flex: 0 0 auto;margin-top: 36rpx;}
  144. .ptit{font-weight: bold;font-size: 30rpx;color: #272727;display: flex;align-items: center;margin-bottom: 14rpx;}
  145. .ptxt{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;margin-bottom: 14rpx;min-width: 176rpx;}
  146. }
  147. }
  148. .upimg{width: 26rpx;height: 22rpx;display: block;transform: rotate(180deg);transition: all 0.3s;margin: 0 auto 18rpx;
  149. &.act{transform: rotate(0deg);}
  150. }
  151. .btn{height: 34rpx;border-radius: 18rpx;display: flex;align-items: center;justify-content: center;padding: 0 10rpx;font-size: 22rpx;margin-right: 24rpx;
  152. &.btna{border: 2rpx solid #06C770;color: #06C770;}
  153. &.btnb{border: 2rpx solid #3565ED;color: #3565ED;}
  154. &.btnc{border: 2rpx solid #FE5A0E;color: #FE5A0E;}
  155. &.btnbga{border: 1px solid #0156FE;color: #3565ED;background: #DFEAFF;height: 36rpx;}
  156. &.btnbgb{border: 1px solid #C1C1C1;color: #666666;background: #F1F1F1;height: 36rpx;}
  157. &.btnbgc{border: 1px solid #FE5A0E;color:#FE5A0E;background:#FFEEE6;height: 36rpx;}
  158. }
  159. }
  160. // 无数据
  161. .nodata{display: flex;flex-direction: column;align-items: center;
  162. image{width: 440rpx;height: 440rpx;}
  163. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  164. }
  165. </style>