123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427 |
- <template>
- <view class="processWrapper ">
- <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&&!TabCur" class="cu-tag badge">
- <block class="cu-tag badge">{{alarmUntreatedCount}} </block>
- </view>
- {{item}}
- </view>
- </scroll-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" style="background-image:url(../../static/process-icon.png);"></view>
- <view class="content">
- <view class="pro-title">
- <view class="cut">{{item.measName}}</view>
- </view>
- <view class="pro-des ">
- <view class="text-cut">
- {{item.digitalValue!=0?"动作":"复归"}}
- </view>
- </view>
- <view class="pro-date ">{{item.soeTime}}</view>
- </view>
- <view class="action" style="z-index:99;width:170rpx;text-align:right">
- <view class="unProcess" @tap="goUnprocessDetail(item.id)">未处理<text
- class="icon iconfont margin-left-xs margin-right-xs"></text></view>
- </view>
- </view>
- <view class=" text-center margin-top" v-if="alarmUntreatedCount === 0">暂无数据...</view>
- </view>
- </view>
- </block>
- <block v-if="TabCur==1">
- <view class="processList">
- <!-- 筛选 start -->
- <view v-if="this.type==1 " class=" padding-bottom-xs" style="border-bottom:1rpx solid rgba(221,221,221,.3)">
- <view class="cu-bar search filter-section">
- <view class="search-form border-gray round bg-white">
- <select name="" id="" v-model="handleStatus">
- <option value="0">全部</option>
- <option value="1">已处理</option>
- <option value="2">待确认</option>
- <option value="3">自动恢复</option>
- <option value="4">过期失效</option>
- </select>
- </view>
- <view class="action" v-if="this.handleStatus==2">
- <view>
- <checkbox-group class="block " @change="allChoose">
- <view class="cu-form-group">
- <checkbox value="all" class='round blue' :class="{'checked':allChecked}"
- :checked="allChecked?true:false">
- </checkbox>
- <view class="title">批量处理</view>
- </view>
- </checkbox-group>
- </view>
- </view>
- </view>
- </view>
- <!-- 筛选end -->
- <checkbox-group @change="changeCheckbox">
- <view class="cu-list menu-avatar " :class="this.handleStatus==2?'handle2scroll':''">
- <view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
- <view class="cu-form-group checkPos">
- <checkbox :value="String(item.id)" class='round blue '
- :class="{'checked':checkedArr.includes(String(item.id))}"
- :checked="checkedArr.includes(String(item.id))">
- </checkbox>
- </view>
- <view class="cu-avatar lg" :style="{'left':handleStatus==2 ? '60rpx':'0'}"
- style="background-image:url(../../static/processed-icon.png);"></view>
- <view class="content" :style="{'left':handleStatus==2 ? '180rpx':'120rpx'}">
- <view class="pro-title">
- <view class="cut">{{item.measName}}</view>
- </view>
- <view class="pro-des ">
- <view class="text-cut">
- {{item.digitalValue!=0?"动作":"复归"}}
- </view>
- </view>
- <view class="pro-date ">{{item.soeTime}}</view>
- </view>
- <view class="action" style="z-index:99;width:180rpx;text-align:right">
- <view class="processed" v-if="item.handling_status==1"
- @tap="goProcessedDetail(item)">
- 已处理
- <text class="icon iconfont margin-left-xs margin-right-xs"></text>
- </view>
- <view style="color:#FF8125" v-if="item.handling_status==2"
- @tap="goProcessedDetail(item)">待确认
- <text class="icon iconfont margin-left-xs margin-right-xs"></text>
- </view>
- <view style="color:#4274E7" v-if="item.handling_status==3"
- @tap="goProcessedDetail(item)">自动回复
- <text class="icon iconfont margin-left-xs margin-right-xs"></text>
- </view>
- <view style="color:#999999" v-if="item.handling_status==4"
- @tap="goProcessedDetail(item)">过期失效
- <text class="icon iconfont margin-left-xs margin-right-xs"></text>
- </view>
- </view>
- </view>
- <view class="text-center margin-top" v-if="alarmUntreatedCount1 === 0">暂无数据...</view>
- </view>
- <view v-if="this.handleStatus==2" class="btn-area submitBottomBtn padding-lr-sm">
- <button class="bg-blue round margin-top" @click="$noMultipleClicks(quickConfirm)">快速确认 </button>
- </view>
- </checkbox-group>
- </view>
- </block>
- </view>
- </template>
- <script>
- import json from '../../data/json.js';
- export default {
- data() {
- return {
- noClick:true,
- allChecked: false,
- checkbox: [{
- value: 'A',
- checked: true
- }, {
- value: 'B',
- checked: true
- }, {
- value: 'C',
- checked: false
- }],
- handleStatus: 0,
- checkedArr: [],
- // unporcessList: json.unprocessList,
- unporcessList: [],
- porcessedList: [],
- type: '0',
- modalName: null,
- listTouchStart: 0,
- listTouchDirection: null,
- CustomBar: this.CustomBar,
- TabCur: 0,
- tabNav: ['未处理', '已处理'],
- companyCode: '',
- alarmUntreatedCount: '',
- alarmUntreatedCount1: '',
- processingStatus: '',
- };
- },
- watch: {
- handleStatus(val) {
- // this.porcessedList={};
- this.getProcessData({
- "companyCode": this.companyCode,
- "type": this.type,
- "processingStatus": val
- }, this.TabCur);
- }
- },
- computed: {
- },
- onLoad: function(option) {
- console.log(option.type);
- console.log(option.companyCode);
- if (option.type == 1) {
- uni.setNavigationBarTitle({
- title: '电力检测'
- });
- } else {
- uni.setNavigationBarTitle({
- title: '视频告警'
- });
- }
- this.getProcessData({
- "companyCode": option.companyCode,
- "type": option.type,
- "processingStatus": "0"
- }, 0);
- console.log('onload里')
- this.companyCode = option.companyCode;
- this.processingStatus = 1
- this.type = option.type;
- },
- methods: {
-
- quickConfirm(){
-
- // alert( this.formMess.start_time)
- if (!this.checkedArr.length) {
- uni.showToast({
- title: "请至少选择一条需要确认的数据",
- icon: "none"
- });
- return
- }
-
- console.log(this.checkedArr)
-
- this.quickConfirmRes({
- "id": this.checkedArr.toString(),
- "companyCode": this.companyCode,
-
- })
-
-
- },
-
- // 请求
- async quickConfirmRes(ming = {}) {
- const res = await this.$myRequest({
- url: 'IntegratedAlarm/setBatchProcessing',
- data: ming
- })
- if (!res.data.flag) {
- uni.showToast({
- title: "添加失败",
- icon: "none"
- });
- } else {
- uni.showToast({
- title: "添加成功",
- });
- }
- setTimeout(() => {
- uni.navigateTo({
-
-
- url: '/pages/processList/processList?companyCode=' + this.companyCode +
- '&type=1'
- });
- }, 1000);
- },
- // 全选事件
- allChoose(e) {
- let chooseItem = e.detail.value;
- // 全选
- if (chooseItem[0] == 'all') {
- this.allChecked = true;
- for (let item of this.porcessedList) {
- let itemVal = String(item.id);
- if (!this.checkedArr.includes(itemVal)) {
- this.checkedArr.push(itemVal);
- }
- }
- } else {
- // 取消全选
- this.allChecked = false;
- this.checkedArr = [];
- }
- },
- changeCheckbox(e) {
- this.checkedArr = e.detail.value;
- // 如果选择的数组中有值,并且长度等于列表的长度,就是全选
- if (this.checkedArr.length > 0 && this.checkedArr.length == this.porcessedList.length) {
- this.allChecked = true;
- } else {
- this.allChecked = false;
- }
- },
- async getProcessData(ming = {}, whichTab) {
- const res = await this.$myRequest({
- url: 'IntegratedAlarm/getElectricAlarmUntreated',
- data: ming,
- showLoading: true
- })
- if (whichTab == 0) {
- this.unporcessList = res.data.data;
- this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
- } else {
- this.porcessedList = res.data.data;
- this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
- }
- console.log(this.porcessedList)
- },
- tabSelect(e) {
- console.log(e.currentTarget);
- this.TabCur = e.currentTarget.dataset.id;
- this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
- this.handleStatus=0
- this.getProcessData({
- "companyCode": this.companyCode,
- "type": this.type,
- "processingStatus": !e.currentTarget.dataset.id ? e.currentTarget.dataset.id : '1,2,3,4'
- }, this.TabCur);
- },
- // 页面跳转
- goUnprocessDetail(id) {
- uni.navigateTo({
- url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode +
- '&processingStatus=0&id=' + id +
- '&type=1',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- goVideoUnprocessDetail(id) {
- uni.navigateTo({
- url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode +
- '&processingStatus=0&id=' + id +
- '&type=2',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- goProcessedDetail(item) {
- uni.navigateTo({
- url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode +
- '&handling_status=' + item.handling_status +
- '&id=' + item.id + '&type=1',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- goVideoProcessedDetail(id) {
- uni.navigateTo({
- url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode +
- '&processingStatus=' + this.processingStatus +
- '&id=' + id + '&type=2',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- InputFocus(e) {
- this.InputBottom = e.detail.height
- },
- InputBlur(e) {
- this.InputBottom = 0
- },
- }
- }
- </script>
- <style lang="scss">
- .handle2scroll {
- height: calc(100vh - 400rpx);
- overflow: scroll;
- }
- //已处理未处理消息个数样式
- .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>
|