list.vue 4.8 KB

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