123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- <template>
- <view class="processWrapper ">
- <view v-if="TabCur==0" style="height:98rpx"></view>
- <view v-if="TabCur==1" style="height:198rpx"></view>
- <view class="ding">
- <scroll-view scroll-x class="bg-white nav text-center">
- <view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav"
- :key="index" @tap="tabSelect" :data-id="index">
- <!-- <view v-if="TabCur==index" class="cu-tag badge">
- <block class="cu-tag badge">{{TabCur? porcessedList.length:alarm_count}} </block>
- </view> -->
- <view v-if="TabCur==index&&!TabCur&&alarm_count" class="cu-tag badge">
- <block class="">{{alarm_count}} </block>
- </view>
- {{item}}
- </view>
- </scroll-view>
- <view class="example-body" v-if="TabCur==1">
- <uni-datetime-picker v-model="datetimerange" type="daterange" start-placeholder="请选择开始时间"
- end-placeholder="请选择结束时间" start="2000-3-20 12:00:00" end="2025-10-20 20:00:00" rangeSeparator="至" />
- </view>
- </view>
- <block v-if="TabCur==0">
- <view class="processList">
- <view class="cu-list menu-avatar">
- <view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
- <view class="cu-avatar lg">
- <image class="image-bg" src="/static/process-icon.png" />
- </view>
- <view class="content">
- <view class="pro-title">
- <view class="cut">{{item.owner_name}}</view>
- </view>
- <view class="pro-des ">
- <view class="text-cut">
- {{item.unitinfo}}
- </view>
- </view>
- <view class="pro-date ">{{item.time}}</view>
- </view>
- <view class="action" style="z-index:99">
- <view class="unProcess" @tap="goUnprocessDetail(item)">未处理</view>
- </view>
- </view>
- <view class=" text-center margin-top" v-if="alarm_count == 0&&data_res == 0">暂无数据...</view>
- <view v-show="isLoadMore&&alarm_count != 0&&this.page>1">
- <uni-load-more :status="loadStatus"></uni-load-more>
- </view>
- </view>
- </view>
- </block>
- <block v-if="TabCur==1">
- <!-- <calendar></calendar> -->
- <view class="processList">
- <view class="cu-list menu-avatar ">
- <view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
- <view class="cu-avatar lg">
- <image class="image-bg" src="/static/processed-icon.png" />
- </view>
- <view class="content">
- <view class="pro-title">
- <view class="cut">{{item.owner_name}}</view>
- </view>
- <view class="pro-des ">
- <view class="text-cut">
- {{item.unitinfo}}
- </view>
- </view>
- <view class="pro-date ">{{item.time}}</view>
- </view>
- <view class="action" style="z-index:99">
- <view class="processed" @tap="goProcessedDetail(item)">已处理</view>
- </view>
- </view>
- <view v-show="isLoadMore&&alarm_count1 != 0&&this.page>1">
- <uni-load-more :status="loadStatus"></uni-load-more>
- </view>
- <view class="text-center margin-top" v-if="alarm_count1 == 0&&data_res == 0">暂无数据...</view>
- </view>
- </view>
- </block>
- </view>
- </template>
- <script>
- import json from '../../data/json.js';
- export default {
- data() {
- return {
- unporcessList: [],
- porcessedList: [],
- type: '0',
- modalName: null,
- listTouchStart: 0,
- listTouchDirection: null,
- CustomBar: this.CustomBar,
- TabCur: 0,
- tabNav: ['未处理', '已处理'],
- alarm_count: '',
- alarm_count1: '',
- datetimerange: ['', ''],
- data_res: 1,
- start_time: '',
- end_time: '',
- page: 1,
- pageSize: 10,
- loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
- isLoadMore: false, //是否加载中
- };
- },
- onBackPress(event) {
- uni.redirectTo({
- url: '../alarmingList/alarmingList'
- });
- return true;
- },
- onReachBottom() { //上拉触底函数
- if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
- this.isLoadMore = true
- this.page += 1
- this.getProcessData({
- "company_code": uni.getStorageSync('selectedCode'),
- "type": this.type,
- "processing_status": this.TabCur,
- "page": this.page,
- "pageSize": this.pageSize,
- "start_time": this.start_time,
- "end_time": this.end_time,
- }, this.TabCur);
- }
- },
- watch: {
- datetimerange(newval) {
- console.log('newval')
- console.log(newval)
- this.start_time = newval[0];
- this.end_time = newval[1]
- this.porcessedList = [],
- this.page = 1,
- this.goDone()
- }
- },
- onShow: function() {
- console.log(111)
- },
- onLoad: function(option) {
- console.log(222)
- this.companyCode = option.companyCode;
- this.processingStatus = 1
- this.type = option.type;
- this.goDone()
- let url = "";
- switch (parseInt(option.type)) {
- case 1:
- url = "报警主机"
- break;
- case 2:
- url = "水系统"
- break;
- case 4:
- url = "消防栓监测"
- break;
- case 6:
- url = "RTU测控终端"
- break;
- case 7:
- url = "电气火灾"
- break;
- case 16:
- url = "视频告警"
- break;
- case 17:
- url = "电梯报警"
- break;
- case 128:
- url = "井盖监测"
- break;
- case 129:
- url = "地磁"
- break;
- case 130:
- url = "门磁"
- break;
- case 131:
- url = "可燃气体"
- break;
- default:
- break;
- }
- uni.setNavigationBarTitle({
- title: url
- });
- },
- onNavigationBarButtonTap(e) {
- console.log(e)
- uni.navigateTo({
- url: './export/export?type=' + this.type,
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- methods: {
- goDone() {
- this.getProcessData({
- "company_code": uni.getStorageSync('selectedCode'),
- "type": this.type,
- "processing_status": this.TabCur,
- "page": this.page,
- "pageSize": this.pageSize,
- "start_handle_time": this.start_time,
- "end_handle_time": this.end_time,
- }, this.TabCur);
- },
- async getProcessData(params, whichTab) {
- const res = await this.$myRequest({
- url: 'ComprehensiveAlarm/getIntegratedAlarmList',
- data: params,
- showLoading: true
- })
- this.data_res = res.data.alarm_count ? 1 : 0
- if (res.data.data) {
- if (whichTab == 0) {
- this.unporcessList = this.unporcessList.concat(res.data.data)
- this.alarm_count = parseInt(res.data.alarm_count)
- } else {
- this.porcessedList = this.porcessedList.concat(res.data.data);
- this.alarm_count1 = parseInt(res.data.alarm_count)
- }
- if (res.data.data.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
- this.isLoadMore = true
- this.loadStatus = 'nomore'
- } else {
- this.isLoadMore = false
- }
- } else {
- this.isLoadMore = true
- this.loadStatus = 'nomore'
- }
- },
- tabSelect(e) {
- this.unporcessList = [],
- this.porcessedList = [],
- this.page = 1,
- this.datetimerange = ['', ''],
- console.log(e.currentTarget);
- this.TabCur = e.currentTarget.dataset.id;
- this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
- },
- // 页面跳转
- goUnprocessDetail(item) {
-
- // uni.navigateTo({
- // url: '/pages/unProcessDetail/unProcessDetail?id=' + item.id + '&type=' + item.type,
- // });
-
- uni.navigateTo({
- url: '/pages/proceDetailEle/proceDetailEle?id=' + item
- .id + '&type=' + this.type,
- });
-
-
- },
- goProcessedDetail(item) {
- // uni.navigateTo({
- // url: '/pages/processedDetail/processedDetail?id=' + item.id + '&type=' + item.type,
- // });
- uni.navigateTo({
- url: '/pages/proceDetailEle/proceDetailEle?id=' + item
- .id + '&type=' + this.type,
- });
- },
- }
- }
- </script>
- <style lang="scss">
- //已处理未处理消息个数样式
- .nav .cu-item.cur {
- position: relative;
- border-bottom: 8rpx solid;
- }
- .cu-tag.badge {
- top: 14rpx;
- right: 96rpx;
- }
- .nav .cu-item {
- width: 50%;
- margin: 0;
- .text-blue,
- .line-blue,
- .lines-blue {
- color: #4274E7
- }
- }
- </style>
|