胜天半子祁厅长
胜天半子祁厅长
  • 发布:2022-10-27 06:19
  • 更新:2023-01-12 14:16
  • 阅读:754

uni-admin的uni-stat自定义事件统计官方更新较慢,共享一个事件ID、设备标识、查询当天事件的优化代码

分类:uni-app

修改代码路径:pages/uni-stat/event/event.vue
改动后效果
可以根据事件ID、设备标识查询,以及解决了uniCloud数据库时区问题导致无法查询到当天统计数据问题

改动点

改动代码

#21 -                   <uni-datetime-picker type="daterange" :end="new Date().getTime()" v-model="query.create_time"  
#21 +                   <uni-datetime-picker type="daterange" :end="new Date().getTime()" :value="query.create_time"  

#26 +                   <view class="flex" style="padding-left: 32rpx;">  
#27 +                   <view class="my-label-text">搜索条件:</view>  
#28 +                   <input v-model="query.event_key" placeholder="事件ID" style="color: #a8a7a7; margin-right: 20rpx;"/>  
#29 +                   <input v-model="query.device_id" placeholder="设备标志" style="color: #a8a7a7"/>  
#30 +               </view>  

#96 +                   device_id: '', // 设备标志  
#97 +                   event_key: '', // 事件ID  

#147 +              useDatetimePicker(e) {  
#148 =              this.currentDateTab = -1  
#149 +              this.query.create_time = [e[0], e[1] + 24 * 3600000]  
#150 =          },  

#163 +                      end = getTimeOfSomeDayAgo(0)  

#275 +      .my-label-text {  
#276 +      font-size: 14px;  
#277 +      font-weight: bold;  
#278 +      color: #555;  
#279 +      margin-top: 17px;  
#280 +      margin-bottom: 17px;  
#281 +      margin-right: 5px;  
#282 +  }
0 关注 分享

要回复文章请先登录注册

White007

White007

nice!
2023-01-12 14:16
胜天半子祁厅长

胜天半子祁厅长 (作者)

基本上这个自定义事件能用起来了,按照指定事件查询有多少人操作了啥的都能解决
2022-10-27 06:20