<template>
|
|
<view class="template-job tn-safe-area-inset-bottom tn-skeleton">
|
|
<!-- 顶部自定义导航 -->
|
<!-- <view class=""> -->
|
|
<tn-nav-bar fixed :isBack="false">
|
<text class="page-title">信息</text>
|
</tn-nav-bar>
|
<!-- </view> -->
|
|
|
<view v-show="lock==false" class="page-wrap u-skeleton">
|
<data-list :width="width" class="data-list" ref="list" @load="handleLoad" @refresh="handleRefresh"
|
style="margin-top: 100px;">
|
|
<view v-for="(item, index) in list" :key="index">
|
|
<view>
|
<tn-button class="modal-btn" backgroundColor="#01BEFF" size="sm"
|
@click="itemClick(item,index)">处理</tn-button>
|
<view style="display: flex;margin-top: 10px;">
|
<u-checkbox-group v-model="item.checked" placement="column" @change="checkboxChange(item)">
|
<u-checkbox :customStyle="{marginTop: '5px'}">
|
</u-checkbox>
|
</u-checkbox-group>
|
<view style="margin-bottom: 10px;font-size: 20px;">告警类型:{{item.type}}</view>
|
</view>
|
|
<view style="display: flex;">
|
|
<view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">编号:{{item.objectid}}
|
</view>
|
<view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">姓名:{{item.pname}}</view>
|
</view>
|
|
<view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">
|
坐标:X{{item.px}};Y{{item.py}};F{{item.pfloor}}</view>
|
<view style="margin-left: 23px;margin-bottom: 10px;color: #5e5e5e;">
|
经纬:{{item.lat}};{{item.lng}};{{item.gao}}</view>
|
<view style="margin-left: 23px;margin-bottom: 10px;color: #ffaa00;">时间:{{item.time}}</view>
|
<u-line style="margin-left: 14px;"></u-line>
|
</view>
|
</view>
|
</data-list>
|
</view>
|
<tn-skeleton :show="showSkeleton"></tn-skeleton>
|
<view v-show="show"
|
style="align-items: center;justify-content: center;display: flex; background-color:#ffffff;width: 100%;height: 10%;position: absolute;z-index: 999999999;bottom: 0;">
|
<text class="title_linespan" style="color: #00aaff;text-decoration: underline;"
|
@click="moreprocessing">处理</text>
|
</view>
|
<successCom ref="refSuccess"></successCom>
|
<processingCom :warlist='warlist' v-show="lock==true" @prosuccess="prosuccess" @proBack="proBack">
|
</processingCom>
|
</view>
|
</template>
|
|
<script>
|
import processingCom from '@/pages/index/processing.vue'
|
|
import successCom from '@/components/success.vue'
|
import {
|
moreprocessingWarn,
|
findwarning
|
} from '@/config/api.js';
|
import {
|
minLogin
|
} from '@/js/minLogin.js'
|
import {
|
pagesAlarm
|
} from '@/js/pages/alarm.js'
|
export default {
|
mixins: [minLogin, pagesAlarm],
|
components: {
|
processingCom,
|
successCom
|
},
|
data() {
|
return {
|
show: false,
|
width: '90%',
|
checkboxValue1: [],
|
warnindex: 0,
|
warlist: {},
|
lock: false,
|
keyword: '',
|
pageNo: 1,
|
pageSize: 10,
|
imgStyle: {
|
width: '100px',
|
height: '1000px',
|
borderRadius: '50%'
|
},
|
showSkeleton: true,
|
options: [{
|
text: '删除',
|
style: {
|
backgroundColor: '#F93737',
|
}
|
}, ],
|
boxKey: 0,
|
scrollHeight: 500,
|
topheight: 0,
|
paddingTop: 60,
|
emitDate: 'indexHome',
|
show: false,
|
time: '',
|
list: [],
|
total: 0,
|
options1: [{
|
text: '删除',
|
style: {
|
backgroundColor: '#F93737'
|
}
|
}]
|
}
|
},
|
|
computed: {
|
countList() {
|
let num = 0;
|
for (let i in this.list) {
|
num += this.list[i].fQty;
|
}
|
return num;
|
}
|
},
|
|
mounted() {
|
this.topheight = this.vuex_custom_bar_height + 15
|
setTimeout(() => {
|
this.showSkeleton = false
|
}, 1000)
|
this.scrollHeight = this.screenHeight - 282;
|
|
setTimeout(() => {
|
this.paddingTop = this.vuex_padding_top
|
this.paddingTop += 5
|
}, 400)
|
},
|
onLoad() {
|
console.log(4444444);
|
this.lock = false
|
|
},
|
onUnload() {
|
this.lock = true
|
},
|
methods: {
|
moreprocessing() {
|
const params = {
|
ids: this.checkboxValue1
|
}
|
if (this.vuex_is_login) {
|
moreprocessingWarn(params).then((res) => {
|
if (res.code == 0) {
|
this.$refs.refSuccess.showBox({
|
type: 'success',
|
txt: '处理成功'
|
});
|
this.show = false
|
// location.reload();
|
this.handleRefresh({
|
page: 1,
|
size: this.pageSize
|
}, () => {
|
// 可以在这里处理加载完成后的逻辑
|
});
|
} else {
|
this.$refs.refSuccess.showBox({
|
type: 'error',
|
txt: '处理失败'
|
});
|
}
|
})
|
}
|
},
|
checkboxChange(n) {
|
this.show = true
|
if (this.checkboxValue1.indexOf(n.id) > -1) {
|
this.checkboxValue1.splice(this.checkboxValue1.indexOf(n.id), 1)
|
} else {
|
this.checkboxValue1.push(n.id)
|
}
|
if (this.checkboxValue1.length > 0) {
|
this.show = true
|
} else {
|
this.show = false
|
}
|
|
},
|
// 模拟请求加载数据
|
handleLoad(data, callback) {
|
const params = {
|
current: data.page,
|
size: data.size,
|
company: this.company,
|
}
|
if (this.vuex_is_login) {
|
findwarning(params).then((res) => {
|
|
if (res.code == 0) {
|
let list = [];
|
setTimeout(() => {
|
let list = res.data.map(item => ({
|
...item,
|
checked: false // 初始化checked属性为false
|
}));
|
this.list = [...this.list, ...list];
|
callback({
|
list: this.list,
|
total: res.data.length
|
});
|
}, 1500);
|
}
|
})
|
}else{
|
callback({
|
list: [],
|
total: 0
|
});
|
}
|
},
|
handleSearch(data, callback) {
|
const params = {
|
current: 1,
|
size: 10,
|
objectid: this.keyword,
|
company: this.company,
|
}
|
if (this.vuex_is_login) {
|
findwarning(params).then((res) => {
|
this.list = []
|
if (res.code == 0) {
|
let list = [];
|
setTimeout(() => {
|
let list = [];
|
for (var i = 0; i < res.data.length; i++) {
|
list.push(res.data[i]);
|
}
|
this.list = [...this.list, ...list];
|
callback({
|
list: this.list,
|
total: res.data.length
|
});
|
}, 1500);
|
}
|
})
|
}
|
},
|
// 模拟请求数据刷新
|
handleRefresh(data, callback) {
|
const params = {
|
current: data.page,
|
size: data.size,
|
objectid: data.objectid,
|
company: this.company,
|
}
|
if (this.vuex_is_login) {
|
findwarning(params).then((res) => {
|
if (res.code == 0) {
|
let list = [];
|
setTimeout(() => {
|
let list = [];
|
for (var i = 0; i < res.data.length; i++) {
|
list.push(res.data[i]);
|
}
|
this.list = []
|
this.list = [...this.list, ...list];
|
callback({
|
list: this.list,
|
total: res.data.length
|
});
|
}, 1500);
|
}
|
})
|
}
|
},
|
itemClick(item, index) {
|
this.lock = true
|
this.warlist = item
|
this.warnindex = index
|
},
|
proBack() {
|
this.lock = false
|
},
|
prosuccess(e) {
|
this.lock = false
|
|
if (e == '已处理') {
|
this.$refs.refSuccess.showBox({
|
type: 'success',
|
txt: '处理成功'
|
});
|
this.list.splice(this.warnindex, 1)
|
} else {
|
this.$refs.refSuccess.showBox({
|
type: 'error',
|
txt: '处理失败'
|
});
|
}
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.modal-btn {
|
position: absolute;
|
|
left: 80%;
|
// margin-top: 40px;
|
// display: flex;
|
// align-items: center;
|
// justify-content: center;
|
// box-sizing: border-box;
|
// width: 120rpx;
|
// height: 40rpx;
|
// background: rgba(103, 149, 255, 0.2);
|
}
|
|
.page-wrap {
|
height: 100%;
|
padding-top: 45px;
|
padding-left: 30rpx;
|
padding-right: 30rpx;
|
|
.test-view {
|
height: 300rpx;
|
}
|
|
.navbar-content {
|
width: 100%;
|
display: flex;
|
padding: 30rpx;
|
align-items: center;
|
justify-content: space-between;
|
}
|
|
.u-icon {
|
margin-left: 30rpx;
|
}
|
|
.item-wrap {
|
display: flex;
|
margin: 10rpx;
|
padding: 30rpx;
|
align-items: center;
|
border-radius: 16rpx;
|
box-shadow: 0rpx 8rpx 16rpx rgba(0, 0, 0, 0.11);
|
|
.avatar {
|
width: 150rpx;
|
height: 150rpx;
|
margin-right: 30rpx;
|
border-radius: 16rpx;
|
background-color: #c0c0c0;
|
}
|
|
.item {
|
// width: 100rpx;
|
height: 30rpx;
|
margin-bottom: 10rpx;
|
border-radius: 16rpx;
|
background-color: #c8c7cc;
|
}
|
|
}
|
}
|
</style>
|