funReport.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="">
  3. <!-- 筛选框start -->
  4. <view style="height:98rpx"></view>
  5. <view class="ding">
  6. <!-- <calendar></calendar> -->
  7. <view class="example-body">
  8. <uni-datetime-picker v-model="datetimerange" type="daterange" start-placeholder="请选择开始时间"
  9. end-placeholder="请选择结束时间" start="2000-3-20 12:00:00" end="2025-10-20 20:00:00" rangeSeparator="至" />
  10. </view>
  11. </view>
  12. <!-- 筛选框end -->
  13. <view class="site-items" style="margin-top:0;height: calc(100vh - 286rpx)">
  14. <view class="cu-list menu-avatar" >
  15. <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
  16. v-for="(item,index) in funcReport" :key="index"
  17. @touchstart="ListTouchStart"
  18. @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index"
  19. >
  20. <view class="cu-avatar round lg">
  21. <image class="image-bg" src="/static/funcList.png"/>
  22. </view>
  23. <view class="content">
  24. <view class="pro-title">
  25. <view class="cut">{{item.title}}</view>
  26. </view>
  27. <view class="pro-des ">
  28. <view class="text-cut">
  29. {{item.des}}
  30. </view>
  31. </view>
  32. <view class="pro-date ">{{item.time}}</view>
  33. </view>
  34. <view class="nav-right num">
  35. <view class="text-grey">
  36. <text class="icon iconfont margin-right-sm margin-left-lg">&#xe629;</text>
  37. </view>
  38. </view>
  39. <view class="move">
  40. <view class="bg-grey" @click.stop="editItem(item)">编辑</view>
  41. <view class="bg-red" @click.stop="deleteItem(item)">删除</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view style="padding-bottom:60px"></view>
  46. <!-- <view v-if="!authList.length&&authListRes==1" class="text-center margin-top"> 暂无数据</view>
  47. <view v-show="isLoadMore&&this.currentPage>1" style="padding-bottom:60px">
  48. <uni-load-more :status="loadStatus"></uni-load-more>
  49. </view> -->
  50. </view>
  51. <!-- 新增按钮start -->
  52. <view style="width: 100%;
  53. position: fixed;
  54. bottom: 0px;
  55. right: 0px;
  56. height: 64px;
  57. background: #fff;">
  58. <view class="plus">
  59. <image src="../../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage()"></image>
  60. </view>
  61. </view>
  62. <!-- 新增按钮end -->
  63. </view>
  64. </template>
  65. <script>
  66. import json from '../../../data/json.js';
  67. export default {
  68. data() {
  69. return {
  70. funcReport: json.funcReport,
  71. modalName: null,
  72. getData:[],
  73. dwtype:0,
  74. datetimerange: ['', ''],
  75. listTouchStart: 0,
  76. listTouchDirection: null,
  77. };
  78. },
  79. onLoad: function(option) {
  80. this.dwtype=option.dwtype
  81. // this.getDeviceList({'company_code':uni.getStorageSync('selectedCode'),"dwtype":option.dwtype})
  82. },
  83. onNavigationBarButtonTap(e) {
  84. console.log(e)
  85. uni.navigateTo({
  86. url: './export/export?dwtype='+this.dwtype,
  87. });
  88. },
  89. methods: {
  90. // 设备类型数据请求
  91. // async getDeviceList(params = {}) {
  92. // const res = await this.$myRequest({
  93. // url: 'DeviceManagement/getDeviceList',
  94. // data:params,
  95. // showLoading: true
  96. // })
  97. // this.getData=res.data.data;
  98. // console.log(this.getData);
  99. // },
  100. //编辑
  101. editItem(item) {
  102. uni.redirectTo({
  103. url: '/pages/setting/funReport/funcAdd/funcAdd?id=' + item.id + '',
  104. });
  105. },
  106. //删除
  107. deleteItem(item) {
  108. alert('删除')
  109. // this.deleteStatus=true
  110. // uni.showModal({
  111. // title: '确认删除吗?',
  112. // content: '',
  113. // success: function(result) {
  114. // if (result.confirm) {
  115. // this.setDelSite({
  116. // "id": item.id
  117. // })
  118. // } else if (result.cancel) {
  119. // // console.log('用户点击取消');
  120. // }
  121. // }.bind(this)
  122. // });
  123. },
  124. // 新增
  125. goAddPage(type) {
  126. uni.redirectTo({
  127. url: '/pages/setting/funReport/funcAdd/funcAdd',
  128. success: res => {},
  129. fail: () => {},
  130. complete: () => {}
  131. });
  132. },
  133. // ListTouch触摸开始
  134. ListTouchStart(e) {
  135. this.listTouchStart = e.touches[0].pageX
  136. },
  137. // ListTouch计算方向
  138. ListTouchMove(e) {
  139. this.listTouchDirection = e.touches[0].pageX - this.listTouchStart < -80 ? 'left' : 'right'
  140. },
  141. // ListTouch计算滚动
  142. ListTouchEnd(e) {
  143. if (this.listTouchDirection == 'left') {
  144. this.modalName = e.currentTarget.dataset.target
  145. } else {
  146. this.modalName = null
  147. }
  148. this.listTouchDirection = null
  149. }
  150. }
  151. }
  152. </script>
  153. <style lang="scss">
  154. .cu-item {
  155. height: 180rpx !important
  156. }
  157. .plus {
  158. position: fixed;
  159. bottom: 3px;
  160. right: 3px;
  161. }
  162. </style>