联调app
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
<view>
|
||||
<view class="filterCriteria">
|
||||
<!-- 筛选条件 -->
|
||||
<Cn-filterCriteria @select="select" :showDatetime="false"> </Cn-filterCriteria>
|
||||
<Cn-filterCriteria @select="select" :singleChoice="true" :showDatetime="true"> </Cn-filterCriteria>
|
||||
<view class="choose1">
|
||||
<view>
|
||||
<checkbox-group @change="changeBox"
|
||||
><checkbox value="true" :checked="checkedAll" />全选
|
||||
</checkbox-group></view
|
||||
>
|
||||
<view class="nav-menu nav-menu-btn" @click="selectDevice('transfer')">申请报表 </view>
|
||||
<view class="nav-menu nav-menu-btn" @click="selectDevice">申请报告 </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="smallLabel mt20">
|
||||
@@ -24,11 +24,15 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 卡片 -->
|
||||
<view class="event-list" :style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }">
|
||||
<scroll-view
|
||||
scroll-y="true"
|
||||
class="event-list"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
>
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card
|
||||
class="event-item"
|
||||
:class="judgment(item.showName)"
|
||||
:class="judgment(item.showName).type"
|
||||
v-for="(item, index) in store.data"
|
||||
:key="index"
|
||||
@click="clackCard(item)"
|
||||
@@ -39,27 +43,17 @@
|
||||
<!-- 动态图标:根据类型切换 -->
|
||||
<uni-icons
|
||||
:custom-prefix="judgment(item.showName) == 'interrupt' ? 'custom-icon' : 'iconfont'"
|
||||
:type="
|
||||
judgment(item.showName) == 'sag'
|
||||
? 'icon-xiajiang'
|
||||
: judgment(item.showName) == 'swell'
|
||||
? 'icon-shangsheng'
|
||||
: 'minus'
|
||||
"
|
||||
:color="
|
||||
judgment(item.showName) == 'sag'
|
||||
? '#2563eb '
|
||||
: judgment(item.showName) == 'swell'
|
||||
? '#e6a23c'
|
||||
: '#909399'
|
||||
"
|
||||
:size="judgment(item.showName) == 'interrupt' ? '50' : '25'"
|
||||
:type="judgment(item.showName).icon"
|
||||
:color="judgment(item.showName).color"
|
||||
:size="judgment(item.showName).size"
|
||||
></uni-icons>
|
||||
</view>
|
||||
<view class="event-info">
|
||||
<view class="event-title">
|
||||
<text class="event-id">{{ item.equipmentName }}</text>
|
||||
<text class="event-tag" :class="`${judgment(item.showName)}-tag`">{{ item.showName }}</text>
|
||||
<text class="event-tag" :class="`${judgment(item.showName).type}-tag`">{{
|
||||
item.showName
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="event-desc">
|
||||
<text>工程名称:{{ item.engineeringName }}</text>
|
||||
@@ -88,11 +82,12 @@
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else style="top: 20%"></Cn-empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import list from '@/common/js/list'
|
||||
import { applicationReport } from '@/common/api/report.js'
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
@@ -112,20 +107,21 @@ export default {
|
||||
array: ['发生时间', '暂降深度', '持续时间'],
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
mounted() {
|
||||
this.setHeight()
|
||||
},
|
||||
|
||||
methods: {
|
||||
setHeight() {
|
||||
uni.createSelectorQuery()
|
||||
.select('.filterCriteria')
|
||||
.boundingClientRect((rect) => {
|
||||
console.log('🚀 ~ rect:', rect)
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 100 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 100 || 0
|
||||
this.height = rect?.height + 90 || 0
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
@@ -144,8 +140,11 @@ export default {
|
||||
this.store.params.projectId = this.selectValue.projectId
|
||||
this.store.params.deviceId = this.selectValue.deviceId
|
||||
this.store.params.lineId = this.selectValue.lineId
|
||||
this.store.params.startTime = this.selectValue.range[0]
|
||||
this.store.params.endTime = this.selectValue.range[1]
|
||||
this.store.params.target = ['Evt_Sys_DipStr']
|
||||
this.store.params.startTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
|
||||
this.store.params.endTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
|
||||
// this.store.params.startTime = this.selectValue.range[0]
|
||||
// this.store.params.endTime = this.selectValue.range[1]
|
||||
this.store.loadedCallback = () => {
|
||||
this.checkedTotal = 0
|
||||
this.store.data = this.store.data.map((item) => {
|
||||
@@ -184,16 +183,89 @@ export default {
|
||||
this.sort = e.detail.value
|
||||
this.init()
|
||||
},
|
||||
judgment(val) {
|
||||
judgment(val, key) {
|
||||
switch (val) {
|
||||
case '电压暂降':
|
||||
return 'sag'
|
||||
return {
|
||||
type: 'sag',
|
||||
icon: 'icon-a-svg4',
|
||||
color: '#2563eb',
|
||||
size: '25',
|
||||
}
|
||||
case '电压暂升':
|
||||
return 'swell'
|
||||
return {
|
||||
type: 'swell',
|
||||
icon: 'icon-a-svg5',
|
||||
color: '#e6a23c',
|
||||
size: '25',
|
||||
}
|
||||
case '电压中断':
|
||||
return 'interrupt'
|
||||
return {
|
||||
type: 'interrupt',
|
||||
icon: 'icon-zhongduan2',
|
||||
color: '#6b7280',
|
||||
size: '35',
|
||||
}
|
||||
case '瞬态':
|
||||
return {
|
||||
type: 'transient',
|
||||
icon: 'icon-shuntaishijian',
|
||||
color: '#8b5cf6',
|
||||
size: '40',
|
||||
}
|
||||
case '未知':
|
||||
return {
|
||||
type: 'unknown',
|
||||
icon: 'icon-wenhao',
|
||||
color: '#6b7280',
|
||||
size: '45',
|
||||
}
|
||||
}
|
||||
},
|
||||
// 申请
|
||||
selectDevice() {
|
||||
if (this.checkedTotal == 0) {
|
||||
return uni.showToast({
|
||||
title: '请选择事件!',
|
||||
icon: 'none',
|
||||
})
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: '申请中,请稍等...',
|
||||
mask: true,
|
||||
})
|
||||
|
||||
let list = this.store.data.filter((item) => item.checked === true)
|
||||
applicationReport({
|
||||
list: list.map((item) => item.id),
|
||||
lineId: list[0].lineId,
|
||||
startTime: this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay,
|
||||
endTime: this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay,
|
||||
}).then((res) => {
|
||||
this.store.reload()
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '申请暂态报告,成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
isAllLineIdSame(data) {
|
||||
// 获取第一个元素的lineId作为基准
|
||||
const baseLineId = data[0].lineId
|
||||
|
||||
// 遍历数组,检查每个元素的lineId是否和基准一致
|
||||
for (let item of data) {
|
||||
// 兼容元素可能没有lineId的情况
|
||||
if (!item || item.lineId !== baseLineId) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
},
|
||||
|
||||
computed: {},
|
||||
@@ -220,9 +292,11 @@ export default {
|
||||
}
|
||||
}
|
||||
.nav-menu {
|
||||
height: 40rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
line-height: 40rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #ebeaec;
|
||||
|
||||
@@ -60,26 +60,28 @@
|
||||
</picker> -->
|
||||
</view>
|
||||
<view class="content device" :style="{ minHeight: minHeight }">
|
||||
<Cn-device-card v-for="(item, index) in deviceListFilter" :device="item" :key="index">
|
||||
<template v-slot:title>
|
||||
<!-- 卡片标题 -->
|
||||
|
||||
<switch
|
||||
v-if="transfer || share"
|
||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||
style="transform: scale(0.8); position: relative; left: 20rpx"
|
||||
@change="switchChange(item)"
|
||||
/>
|
||||
<view class="star-icon" v-else @click="toggleStar(item)">
|
||||
<uni-icons
|
||||
custom-prefix="custom-icon"
|
||||
:type="item.isTop == 1 ? 'star-filled' : 'star'"
|
||||
:color="item.isTop == 1 ? '#ffcc00' : ''"
|
||||
size="25"
|
||||
></uni-icons>
|
||||
</view>
|
||||
</template>
|
||||
</Cn-device-card>
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item
|
||||
v-for="(item, index) in deviceListFilter"
|
||||
:threshold="0"
|
||||
:right-options="item.isTop == 0 ? options1 : options12"
|
||||
@click="bindClick($event, item)"
|
||||
>
|
||||
<Cn-device-card :device="item" :key="index">
|
||||
<template v-slot:title>
|
||||
<!-- 卡片标题 -->
|
||||
|
||||
<switch
|
||||
v-if="transfer || share"
|
||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||
style="transform: scale(0.8); position: relative; left: 20rpx"
|
||||
@change="switchChange(item)"
|
||||
/>
|
||||
<view class="star-icon" v-else> <uni-icons type="search" size="25"></uni-icons> </view>
|
||||
</template>
|
||||
</Cn-device-card>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || deviceListFilter.length > 0"
|
||||
:status="store.status"
|
||||
@@ -118,6 +120,22 @@ export default {
|
||||
projectType: [],
|
||||
userInfo: {},
|
||||
selectProject: false,
|
||||
options1: [
|
||||
{
|
||||
text: '置顶',
|
||||
style: {
|
||||
backgroundColor: '#376cf3',
|
||||
},
|
||||
},
|
||||
],
|
||||
options12: [
|
||||
{
|
||||
text: '取消',
|
||||
style: {
|
||||
backgroundColor: '#ccc',
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -148,7 +166,7 @@ export default {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toggleStar(item) {
|
||||
bindClick(e, item) {
|
||||
engineeringPinToTop({
|
||||
targetId: item.equipmentId,
|
||||
targetType: 1,
|
||||
@@ -162,6 +180,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
selectDevice(type) {
|
||||
if (this.deviceListFilter.findIndex((item) => item.isPrimaryUser === '1') === -1) {
|
||||
this.$util.toast('没有可操作的设备')
|
||||
@@ -351,4 +370,9 @@ export default {
|
||||
.nav-menu {
|
||||
}
|
||||
}
|
||||
/deep/ .button-group--right {
|
||||
padding: 0 0 20rpx;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@@ -2,42 +2,49 @@
|
||||
<view class="index-device">
|
||||
<view class="nav" :style="{ top: navTabHeight + 'px' }"> </view>
|
||||
<view class="content device project-list" :style="{ minHeight: minHeight }">
|
||||
<uni-card v-for="(item, index) in store.data" :key="index">
|
||||
<view class="card-header">
|
||||
<view class="project-icon">
|
||||
<uni-icons custom-prefix="iconfont" type="icon-gongcheng" color="#2563eb" size="45"></uni-icons>
|
||||
</view>
|
||||
<view class="project-info">
|
||||
<view class="project-name">{{ item.engineeringName }}</view>
|
||||
<view class="project-stats">
|
||||
<view class="stat-item" @click="jump('nowEngineering', item)">
|
||||
<text class="stat-value blue">{{ item.devTotal }}</text>
|
||||
<text class="stat-label">设备总数</text>
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item
|
||||
v-for="(item, index) in store.data"
|
||||
:threshold="0"
|
||||
:right-options="item.isTop == 0 ? options1 : options12"
|
||||
@click="bindClick($event, item)"
|
||||
>
|
||||
<uni-card :key="index">
|
||||
<view class="card-header">
|
||||
<view class="project-icon">
|
||||
<uni-icons
|
||||
custom-prefix="iconfont"
|
||||
type="icon-gongcheng"
|
||||
color="#2563eb"
|
||||
size="45"
|
||||
></uni-icons>
|
||||
</view>
|
||||
<view class="stat-item" @click="jump('currentOnLineDevs', item)">
|
||||
<text class="stat-value green">{{ item.onlineDevTotal }}</text>
|
||||
<text class="stat-label">在线设备</text>
|
||||
</view>
|
||||
<view class="stat-item" @click="jump('currentOffLineDevs', item)">
|
||||
<text class="stat-value red">{{ item.offlineDevTotal }}</text>
|
||||
<text class="stat-label">离线设备</text>
|
||||
</view>
|
||||
<view class="stat-item" @click="jump('event', item)">
|
||||
<text class="stat-value red">{{ item.alarmTotal }}</text>
|
||||
<text class="stat-label">告警数量</text>
|
||||
<view class="project-info">
|
||||
<view class="project-name">{{ item.engineeringName }}</view>
|
||||
<view class="project-stats">
|
||||
<view class="stat-item" @click="jump('nowEngineering', item)">
|
||||
<text class="stat-value blue">{{ item.devTotal }}</text>
|
||||
<text class="stat-label">设备总数</text>
|
||||
</view>
|
||||
<view class="stat-item" @click="jump('currentOnLineDevs', item)">
|
||||
<text class="stat-value green">{{ item.onlineDevTotal }}</text>
|
||||
<text class="stat-label">在线设备</text>
|
||||
</view>
|
||||
<view class="stat-item" @click="jump('currentOffLineDevs', item)">
|
||||
<text class="stat-value red">{{ item.offlineDevTotal }}</text>
|
||||
<text class="stat-label">离线设备</text>
|
||||
</view>
|
||||
<view class="stat-item" @click="jump('event', item)">
|
||||
<text class="stat-value red">{{ item.alarmTotal }}</text>
|
||||
<text class="stat-label">告警数量</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="star-icon" @click="toggleStar(item)">
|
||||
<uni-icons
|
||||
custom-prefix="custom-icon"
|
||||
:type="item.isTop == 1 ? 'star-filled' : 'star'"
|
||||
:color="item.isTop == 1 ? '#ffcc00' : ''"
|
||||
size="25"
|
||||
></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<view class="pinToTop" v-if="item.isTop == 1"> 置顶 </view>
|
||||
</uni-card>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || deviceListFilter.length > 0"
|
||||
:status="store.status"
|
||||
@@ -61,6 +68,22 @@ export default {
|
||||
minHeight: 0,
|
||||
navTabHeight: 0,
|
||||
userInfo: {},
|
||||
options1: [
|
||||
{
|
||||
text: '置顶',
|
||||
style: {
|
||||
backgroundColor: '#376cf3',
|
||||
},
|
||||
},
|
||||
],
|
||||
options12: [
|
||||
{
|
||||
text: '取消',
|
||||
style: {
|
||||
backgroundColor: '#ccc',
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -77,7 +100,7 @@ export default {
|
||||
console.log(12333, this.store)
|
||||
},
|
||||
methods: {
|
||||
toggleStar(item) {
|
||||
bindClick(e, item) {
|
||||
engineeringPinToTop({
|
||||
targetId: item.engineeringId,
|
||||
targetType: 2,
|
||||
@@ -85,12 +108,13 @@ export default {
|
||||
}).then((res) => {
|
||||
if (res.code == 'A0000') {
|
||||
this.$util.toast('操作成功!')
|
||||
this.$emit('refresh')
|
||||
this.store.search()
|
||||
} else {
|
||||
this.$util.toast(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getDeviceList() {
|
||||
this.store.params.pageSize = 50
|
||||
this.store.firstCallBack = (res) => {
|
||||
@@ -124,6 +148,11 @@ export default {
|
||||
|
||||
jump(type, item) {
|
||||
if (type == 'event') {
|
||||
// 存储参数
|
||||
uni.setStorageSync('messageParams', {
|
||||
name: item.engineeringName,
|
||||
id: item.engineeringId,
|
||||
})
|
||||
uni.switchTab({
|
||||
url: '/pages/index/message1',
|
||||
})
|
||||
@@ -171,8 +200,9 @@ export default {
|
||||
}
|
||||
|
||||
.project-name {
|
||||
font-size: 15px;
|
||||
color: #3a3a3a;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #333333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
@@ -193,13 +223,13 @@ export default {
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 30rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 24rpx;
|
||||
color: #6a6a6a;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.blue {
|
||||
@@ -221,4 +251,26 @@ export default {
|
||||
/deep/ .uni-card {
|
||||
padding: 0 !important;
|
||||
}
|
||||
/deep/ .button-group--right {
|
||||
padding: 0 0 20rpx;
|
||||
}
|
||||
.pinToTop {
|
||||
background-color: $uni-theme-color;
|
||||
width: 100rpx;
|
||||
height: 60rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
||||
/* 核心:旋转成斜三角效果 */
|
||||
transform: rotate(45deg) translate(50rpx, -10rpx);
|
||||
transform-origin: top right;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="index-zhuyonghu">
|
||||
<template v-if="devCount.engineeringListLength > 1">
|
||||
<template v-if="devCount.engineeringListLength > 0">
|
||||
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('allEngineering')">
|
||||
@@ -53,7 +53,7 @@
|
||||
<view style="padding: 20rpx 20rpx 0">
|
||||
<Cn-grid title="" :auto-fill="false">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice(4)"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item
|
||||
<Cn-grid-item
|
||||
src="/static/device2.png"
|
||||
text="功能调试"
|
||||
@click="registerDevice(2)"
|
||||
@@ -64,12 +64,12 @@
|
||||
text="出厂调试"
|
||||
@click="registerDevice(3)"
|
||||
v-if="config.factory"
|
||||
></Cn-grid-item> -->
|
||||
<!-- <Cn-grid-item background="#fff" v-if="!config.feature"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff" v-if="!config.factory"></Cn-grid-item> -->
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff" v-if="!config.feature"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff" v-if="!config.factory"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item> -->
|
||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||
<!-- <Cn-grid-item src="/static/feedback2.png" text="问题反馈" @click="submitFeedBack"></Cn-grid-item>-->
|
||||
</Cn-grid>
|
||||
@@ -156,15 +156,15 @@ export default {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
confirm(value) {
|
||||
if (this.devCount.engineeringListLength > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new?type=' + this.type,
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new?from=index&type=' + this.type,
|
||||
})
|
||||
}
|
||||
// if (this.devCount.engineeringListLength > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new?type=' + this.type,
|
||||
})
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/engineering/new?from=index&type=' + this.type,
|
||||
// })
|
||||
// }
|
||||
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
|
||||
@@ -1,143 +1,140 @@
|
||||
<template>
|
||||
<view class="index-zhuyonghu">
|
||||
<template v-if="devCount.engineeringListLength > 1">
|
||||
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('allEngineering')">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('onLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('offLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt20"></view>
|
||||
</template>
|
||||
<view class="canneng-index-title mb20">当前工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('nowEngineering')">
|
||||
<view class="header-item-value"
|
||||
>{{ devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0 }}
|
||||
</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mt20">常用功能</view>
|
||||
<view style="padding: 20rpx 20rpx 0">
|
||||
<Cn-grid title="">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||
<Cn-grid-item src="/static/feedback2.png" text="问题反馈" @click="submitFeedBack"></Cn-grid-item>
|
||||
</Cn-grid>
|
||||
</view>
|
||||
<uni-popup ref="popup" type="dialog" @maskClick='maskClick'>
|
||||
<uni-popup-dialog
|
||||
mode="base"
|
||||
type="info"
|
||||
content="请选择设备类型"
|
||||
:duration="0"
|
||||
confirmText="直连设备"
|
||||
cancelText="网关接入"
|
||||
cancelColor= '#007aff'
|
||||
@close="close"
|
||||
@confirm="confirm"
|
||||
></uni-popup-dialog>
|
||||
|
||||
</uni-popup>
|
||||
</view>
|
||||
<view class="index-zhuyonghu">
|
||||
<template v-if="devCount.engineeringListLength > 1">
|
||||
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('allEngineering')">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('onLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('offLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt20"></view>
|
||||
</template>
|
||||
<view class="canneng-index-title mb20">当前工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('nowEngineering')">
|
||||
<view class="header-item-value"
|
||||
>{{ devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0 }}
|
||||
</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mt20">常用功能</view>
|
||||
<view style="padding: 20rpx 20rpx 0">
|
||||
<Cn-grid title="">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||
<Cn-grid-item src="/static/feedback2.png" text="问题反馈" @click="submitFeedBack"></Cn-grid-item>
|
||||
</Cn-grid>
|
||||
</view>
|
||||
<uni-popup ref="popup" type="dialog" @maskClick="maskClick">
|
||||
<uni-popup-dialog
|
||||
mode="base"
|
||||
type="info"
|
||||
content="请选择设备类型"
|
||||
:duration="0"
|
||||
confirmText="直连设备"
|
||||
cancelText="网关接入"
|
||||
cancelColor="#007aff"
|
||||
@close="close"
|
||||
@confirm="confirm"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
devCount: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
submitFeedBack() {
|
||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||
},
|
||||
registerDevice() {
|
||||
this.$refs.popup.open()
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '请选择设备类型',
|
||||
// confirmText: '直连设备',
|
||||
// cancelText: '网关接入',
|
||||
// cancelColor: '#007aff',
|
||||
// success: ({confirm, cancel}) => {
|
||||
// if (confirm) {
|
||||
// if (this.devCount.engineeringListLength > 0) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/device/new?type=4',
|
||||
// })
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/engineering/new?from=index'
|
||||
// })
|
||||
// }
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
devCount: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
submitFeedBack() {
|
||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||
},
|
||||
registerDevice() {
|
||||
this.$refs.popup.open()
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '请选择设备类型',
|
||||
// confirmText: '直连设备',
|
||||
// cancelText: '网关接入',
|
||||
// cancelColor: '#007aff',
|
||||
// success: ({confirm, cancel}) => {
|
||||
// if (confirm) {
|
||||
// if (this.devCount.engineeringListLength > 0) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/device/new?type=4',
|
||||
// })
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/engineering/new?from=index'
|
||||
// })
|
||||
// }
|
||||
|
||||
// } else if (cancel) {
|
||||
// // uni.navigateTo({
|
||||
// // url: '/pages/gateway/list',
|
||||
// // })
|
||||
// this.$util.toast('功能正在开发,敬请期待')
|
||||
// }
|
||||
// },
|
||||
// })
|
||||
},
|
||||
maskClick(){
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
close() {
|
||||
this.$util.toast('功能正在开发,敬请期待')
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
confirm(value) {
|
||||
|
||||
if (this.devCount.engineeringListLength > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new?type=4',
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new?from=index'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
registerGateway() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/new',
|
||||
})
|
||||
},
|
||||
jump(type) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/list?type=' + type,
|
||||
})
|
||||
},
|
||||
},
|
||||
// } else if (cancel) {
|
||||
// // uni.navigateTo({
|
||||
// // url: '/pages/gateway/list',
|
||||
// // })
|
||||
// this.$util.toast('功能正在开发,敬请期待')
|
||||
// }
|
||||
// },
|
||||
// })
|
||||
},
|
||||
maskClick() {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
close() {
|
||||
this.$util.toast('功能正在开发,敬请期待')
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
confirm(value) {
|
||||
// if (this.devCount.engineeringListLength > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new?type=4',
|
||||
})
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/engineering/new?from=index',
|
||||
// })
|
||||
// }
|
||||
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
registerGateway() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/new',
|
||||
})
|
||||
},
|
||||
jump(type) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/list?type=' + type,
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="dateReport">
|
||||
<view class="pd20">
|
||||
<!-- <view class="pd20">
|
||||
<uni-segmented-control
|
||||
:current="curSub"
|
||||
class="subsection"
|
||||
@@ -8,42 +8,58 @@
|
||||
:values="subsectionList"
|
||||
@clickItem="sectionChange"
|
||||
/>
|
||||
</view> -->
|
||||
<view class="filterCriteria">
|
||||
<!-- 筛选条件 -->
|
||||
<Cn-filterCriteria @select="select" :singleChoice="true" :report="true"> </Cn-filterCriteria>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 卡片 -->
|
||||
<view
|
||||
class="event-list"
|
||||
<scroll-view
|
||||
scroll-y="true"
|
||||
@refresherrefresh="refresherrefresh"
|
||||
:refresher-triggered="triggered"
|
||||
refresher-enabled="true"
|
||||
class="event-list mt20"
|
||||
v-if="eventList.length != 0"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + 56) + 'px)', overflow: 'auto' }"
|
||||
:style="{ height: 'calc(100vh - ' + height + 'px)', overflow: 'auto' }"
|
||||
>
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card class="event-item" :class="item.type" v-for="(item, index) in eventList" :key="index">
|
||||
<uni-card class="event-item" :class="item.type" v-for="(item, index) in store.data" :key="index">
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
<view class="event-header">
|
||||
<view class="event-info">
|
||||
<view class="event-title">
|
||||
<text class="event-id" >{{ item.id }}</text>
|
||||
<text class="event-tags">{{ item.tag }}</text>
|
||||
<text class="event-id">{{ item.lineName }}</text>
|
||||
<view class="event-tags"
|
||||
>{{ selectValue.report == 0 ? item.startTime : item.startTime + '至' + item.endTime }}
|
||||
<view class="iconText ml10" @click="download(item)"
|
||||
><uni-icons type="arrow-down" color="#fff" size="16"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情区域 -->
|
||||
<view class="event-detail">
|
||||
<text>频率偏差越限111次</text>
|
||||
<text>不平衡度越限3次</text>
|
||||
<text>电压畸变率越限5次</text>
|
||||
<text>偶次电压越限5次</text>
|
||||
<text>{{ item.overLimitDesc == '' ? '该监测点暂无指标越限' : item.overLimitDesc }}</text>
|
||||
</view>
|
||||
<view class="downloadReport">
|
||||
<!-- <view class="downloadReport" @click="download">
|
||||
<uni-icons type="download" size="16" color="#376cf3"></uni-icons>下载报告
|
||||
</view>
|
||||
</view> -->
|
||||
</uni-card>
|
||||
<uni-load-more :status="status"></uni-load-more>
|
||||
</view>
|
||||
<Cn-empty v-else></Cn-empty>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else style="top: 20%"></Cn-empty>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import list from '@/common/js/list'
|
||||
import { downloadHarmonicReport } from '@/common/api/report.js'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
@@ -60,6 +76,7 @@ export default {
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
status: 'noMore',
|
||||
@@ -73,20 +90,133 @@ export default {
|
||||
status: '1',
|
||||
},
|
||||
],
|
||||
thisSelectValue: {},
|
||||
triggered: true,
|
||||
height: 0,
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
|
||||
mounted() {
|
||||
this.setHeight()
|
||||
},
|
||||
methods: {
|
||||
setHeight() {
|
||||
uni.createSelectorQuery()
|
||||
.select('.filterCriteria')
|
||||
.boundingClientRect((rect) => {
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 130 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 75 || 0
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
},
|
||||
sectionChange(index) {
|
||||
this.curSub = index.currentIndex
|
||||
},
|
||||
scrolltolower() {
|
||||
if (this.total != this.indexList.length) {
|
||||
this.$emit('scrolltolower')
|
||||
} else {
|
||||
// this.status = 'noMore'
|
||||
}
|
||||
init() {
|
||||
if (this.selectValue.lineId == '') return
|
||||
|
||||
this.store = this.DataSource('/cs-report-boot/csAppReport/reportList')
|
||||
this.store.params.pageSize = 10000
|
||||
this.store.params.timeType = this.selectValue.report
|
||||
this.store.params.engineerId = this.selectValue.engineeringId
|
||||
this.store.params.projectId = this.selectValue.projectId
|
||||
this.store.params.devId = this.selectValue.deviceId
|
||||
this.store.params.lineId = this.selectValue.lineId
|
||||
this.store.params.time = this.selectValue.date
|
||||
// this.store.params.startTime = this.selectValue.range[0]
|
||||
// this.store.params.endTime = this.selectValue.range[1]
|
||||
this.store.loadedCallback = () => {}
|
||||
this.store.reload()
|
||||
},
|
||||
|
||||
select(value) {
|
||||
this.selectValue = value
|
||||
this.init()
|
||||
setTimeout(() => {
|
||||
this.setHeight()
|
||||
}, 100)
|
||||
},
|
||||
// 下载
|
||||
download(item) {
|
||||
uni.showLoading({
|
||||
title: '下载中,请稍等...',
|
||||
mask: true,
|
||||
})
|
||||
downloadHarmonicReport({
|
||||
devId: this.selectValue.deviceId,
|
||||
endTime: item.endTime,
|
||||
engineerId: this.selectValue.engineeringId,
|
||||
lineId: this.selectValue.lineId,
|
||||
list: [],
|
||||
projectId: this.selectValue.projectId,
|
||||
startTime: item.startTime,
|
||||
time: '',
|
||||
timeType: this.selectValue.report,
|
||||
}).then((res) => {
|
||||
// 下载文件资源到本地
|
||||
uni.downloadFile({
|
||||
url: res.data, // 后端返回的线上文件路径
|
||||
success: function (res) {
|
||||
if (res.statusCode === 200) {
|
||||
// 文件到本地
|
||||
uni.saveFile({
|
||||
tempFilePath: res.tempFilePath, //临时路径
|
||||
success: function (data) {
|
||||
var savedFilePath = data.savedFilePath
|
||||
// 在app端执行
|
||||
// #ifdef APP-PLUS
|
||||
let osname = plus.os.name
|
||||
// 如果是安卓的话弹出提示
|
||||
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '下载成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
|
||||
// #endif
|
||||
//ios手机直接打开文件,手动存储文件到手机,Android手机从根目录创建文件夹,保存文件并改名
|
||||
setTimeout(() => {
|
||||
//打开文档查看
|
||||
uni.openDocument({
|
||||
filePath: data.savedFilePath,
|
||||
success: function (ress) {
|
||||
console.log('成功打开文件')
|
||||
},
|
||||
fail() {
|
||||
console.log('打开文件失败')
|
||||
},
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
})
|
||||
console.log('下载成功')
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
mask: true,
|
||||
title: '下载失败!',
|
||||
duration: 1000,
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function (res) {},
|
||||
})
|
||||
})
|
||||
},
|
||||
// 下拉
|
||||
refresherrefresh() {
|
||||
this.triggered = true
|
||||
uni.startPullDownRefresh()
|
||||
setTimeout(() => {
|
||||
this.triggered = false
|
||||
}, 500)
|
||||
},
|
||||
},
|
||||
|
||||
@@ -101,12 +231,15 @@ export default {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.event-tags {
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
font-size: 27rpx !important ;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.event-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
font-size: 25rpx !important;
|
||||
// display: grid;
|
||||
// grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.downloadReport {
|
||||
width: 100%;
|
||||
@@ -120,5 +253,31 @@ export default {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.filterCriteria {
|
||||
.nav {
|
||||
background-color: #fff;
|
||||
}
|
||||
.choose1 {
|
||||
background-color: #fff;
|
||||
padding: 0 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
/deep/ .uni-checkbox-input {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
/deep/ .uni-scroll-view-refresher {
|
||||
display: none;
|
||||
}
|
||||
.iconText {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
border-radius: 50%;
|
||||
background-color: $uni-theme-color;
|
||||
text-align: center;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -10,57 +10,106 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 申请报表 -->
|
||||
<view v-if="curSub == 0">
|
||||
<!-- 申请报告 -->
|
||||
<view v-show="curSub == 0">
|
||||
<!-- apply -->
|
||||
<Apply :navHeight="navHeight"/>
|
||||
<Apply :navHeight="navHeight" />
|
||||
</view>
|
||||
|
||||
<!-- 申请记录 -->
|
||||
<view v-if="curSub == 1">
|
||||
<view class="filterCriteria">
|
||||
<!-- 筛选条件 -->
|
||||
<Cn-filterCriteria @select="select" :showQianTree="false"> </Cn-filterCriteria>
|
||||
</view>
|
||||
<view
|
||||
class="record event-list"
|
||||
v-if="eventList.length != 0"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + 56) + 'px)', overflow: 'auto' }"
|
||||
class="record event-list mt20"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
>
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card class="event-item" :class="item.type" v-for="(item, index) in eventList" :key="index">
|
||||
<view class="title" :class="item.status == 1 ? 'completed' : 'incomplete'">
|
||||
<view> {{ item.status == 1 ? '已完成' : '未完成' }} </view>
|
||||
</view>
|
||||
<uni-card class="event-item" :class="item.type" v-for="(item, index) in store.data" :key="index">
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
<view class="event-header">
|
||||
<view
|
||||
class="event-icon"
|
||||
:style="{ backgroundColor: item.isComplete == 1 ? '#10b98120' : '#FF000020' }"
|
||||
>
|
||||
<!-- 动态图标:根据类型切换 -->
|
||||
<uni-icons
|
||||
custom-prefix="iconfont"
|
||||
type="icon-baogaoguanli"
|
||||
size="40"
|
||||
:color="item.isComplete == 1 ? '#10b981' : '#FF0000'"
|
||||
></uni-icons>
|
||||
</view>
|
||||
<view class="event-info">
|
||||
<view class="event-title">
|
||||
<text class="event-id">{{ item.id }}</text>
|
||||
<text class="event-tags">{{ item.tag }}</text>
|
||||
<text class="event-id">{{ item.lineName }}</text>
|
||||
</view>
|
||||
<view class="event-desc">
|
||||
<text>工程名称:{{ item.engineeringName }}</text>
|
||||
<text>项目名称:{{ item.projectName }}</text>
|
||||
<text>设备名称:{{ item.deviceName }}</text>
|
||||
<!-- <text>申请时间:{{ item.time }}</text>
|
||||
<text>事件数:{{ item.eventNums }}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="event-action">
|
||||
<view class="iconText" v-if="item.isComplete == 1" @click="download(item)"
|
||||
><uni-icons type="arrow-down" color="#fff" size="16"></uni-icons>
|
||||
</view>
|
||||
<view
|
||||
class="nav-menu nav-menu-btn"
|
||||
v-else-if="userInfo.authorities === 'operation_manager'"
|
||||
@click="generate(item)"
|
||||
>生成报告
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情区域 -->
|
||||
<view class="event-detail">
|
||||
<text>申请人:xxx</text>
|
||||
<text>电话号码:18888888888</text>
|
||||
</view>
|
||||
<view class="downloadReport">
|
||||
<!-- <u-icon :name="item.status == 1 ? 'download' : 'upload'" color="#376cf3" size="40"></u-icon> -->
|
||||
<uni-icons
|
||||
:type="item.status == 1 ? 'download' : 'upload'"
|
||||
size="16"
|
||||
color="#376cf3"
|
||||
></uni-icons>
|
||||
<!-- <view class="device-body"> -->
|
||||
<view class="device-body-item">
|
||||
<text>申请人:</text>
|
||||
<text>{{ item.applyUser }}</text>
|
||||
</view>
|
||||
<view class="device-body-item">
|
||||
<text>申请时间:</text>
|
||||
<text>{{ item.time }}</text>
|
||||
</view>
|
||||
<view class="device-body-item">
|
||||
<text>暂降事件:</text>
|
||||
<text>{{ item.eventNums }}次</text>
|
||||
</view>
|
||||
<view class="device-body-item">
|
||||
<text>申请状态:</text>
|
||||
<text
|
||||
:style="{ color: item.isComplete == 1 ? '#10b981' : '#FF0000' }"
|
||||
style="font-weight: 700"
|
||||
>{{ item.isComplete == 1 ? '已完成' : '未完成' }}</text
|
||||
>
|
||||
</view>
|
||||
|
||||
{{ item.status == 1 ? '下载报告' : '生成报告' }}
|
||||
<!-- <view class="device-body-item">
|
||||
<text>申请时间:</text>
|
||||
<text>{{ item.time }}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- </view> -->
|
||||
</uni-card>
|
||||
<uni-load-more :status="status"></uni-load-more>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else style="top: 30%"></Cn-empty>
|
||||
</view>
|
||||
<Cn-empty v-else></Cn-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import Apply from './apply.vue'
|
||||
import list from '@/common/js/list'
|
||||
import { createEventReport, downloadEventReport } from '@/common/api/report.js'
|
||||
export default {
|
||||
components: { Apply },
|
||||
props: {
|
||||
@@ -81,99 +130,205 @@ export default {
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
value: ['0'],
|
||||
content: 123,
|
||||
curSub: 0,
|
||||
subsectionList: ['申请报表', '申请记录'],
|
||||
subsectionList: ['申请报告', '申请记录'],
|
||||
form: {
|
||||
type: 0,
|
||||
lindId: '',
|
||||
},
|
||||
status: 'noMore',
|
||||
eventList: [
|
||||
{
|
||||
id: '测试监测点',
|
||||
tag: '2026-01-23至2026-01-23',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
id: '测试监测点',
|
||||
tag: '2026-01-23至2026-01-23',
|
||||
status: '0',
|
||||
},
|
||||
],
|
||||
userInfo: {},
|
||||
height: 0,
|
||||
selectValue: {},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
mounted() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
scrolltolower() {
|
||||
this.$emit('scrolltolower')
|
||||
setHeight() {
|
||||
uni.createSelectorQuery()
|
||||
.select('.filterCriteria')
|
||||
.boundingClientRect((rect) => {
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 115 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 10 || 0
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
},
|
||||
init() {
|
||||
this.store = this.DataSource('/cs-report-boot/csAppReport/getApplicationReport')
|
||||
this.store.params.startTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
|
||||
this.store.params.endTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
|
||||
this.store.loadedCallback = () => {}
|
||||
this.store.reload()
|
||||
},
|
||||
async select(val) {
|
||||
this.selectValue = val
|
||||
await this.init()
|
||||
this.setHeight()
|
||||
},
|
||||
getHeight() {},
|
||||
|
||||
sectionChange(index) {
|
||||
this.curSub = index.currentIndex
|
||||
},
|
||||
// 生成报告
|
||||
generate(item) {
|
||||
uni.showLoading({
|
||||
title: '生成中,请稍等...',
|
||||
mask: true,
|
||||
})
|
||||
createEventReport({
|
||||
id: item.eventId,
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '生成事件报告成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
this.store.reload()
|
||||
})
|
||||
},
|
||||
// 下载报告
|
||||
download(item) {
|
||||
uni.showLoading({
|
||||
title: '下载中,请稍等...',
|
||||
mask: true,
|
||||
})
|
||||
downloadEventReport({
|
||||
id: item.eventId,
|
||||
}).then((res) => {
|
||||
// 下载文件资源到本地
|
||||
uni.downloadFile({
|
||||
url: res.data, // 后端返回的线上文件路径
|
||||
success: function (res) {
|
||||
if (res.statusCode === 200) {
|
||||
// 文件到本地
|
||||
uni.saveFile({
|
||||
tempFilePath: res.tempFilePath, //临时路径
|
||||
success: function (data) {
|
||||
var savedFilePath = data.savedFilePath
|
||||
// 在app端执行
|
||||
// #ifdef APP-PLUS
|
||||
let osname = plus.os.name
|
||||
// 如果是安卓的话弹出提示
|
||||
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '下载成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
|
||||
// #endif
|
||||
//ios手机直接打开文件,手动存储文件到手机,Android手机从根目录创建文件夹,保存文件并改名
|
||||
setTimeout(() => {
|
||||
//打开文档查看
|
||||
uni.openDocument({
|
||||
filePath: data.savedFilePath,
|
||||
success: function (ress) {
|
||||
console.log('成功打开文件')
|
||||
},
|
||||
fail() {
|
||||
console.log('打开文件失败')
|
||||
},
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
})
|
||||
console.log('下载成功')
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
mask: true,
|
||||
title: '下载失败!',
|
||||
duration: 1000,
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function (res) {},
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/pages/message1/index.scss';
|
||||
.event-title {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.event-tags {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.event-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-columns: 1fr 1.2fr;
|
||||
}
|
||||
.downloadReport {
|
||||
width: 100%;
|
||||
background: #376cf320;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
color: #376cf3;
|
||||
font-weight: 600;
|
||||
border-radius: 15rpx;
|
||||
margin-top: 10rpx;
|
||||
|
||||
// /deep/ .record {
|
||||
// .uni-card__content {
|
||||
// padding: 55rpx 20rpx 20rpx !important;
|
||||
// }
|
||||
// }
|
||||
.filterCriteria {
|
||||
.nav {
|
||||
background-color: #fff;
|
||||
}
|
||||
.choose1 {
|
||||
background-color: #fff;
|
||||
padding: 0 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
/deep/ .uni-checkbox-input {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
// .device-body {
|
||||
// padding: 10rpx 20rpx 20rpx;
|
||||
|
||||
.device-body-item {
|
||||
display: flex;
|
||||
// justify-content: space-between;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 1.5;
|
||||
}
|
||||
// }
|
||||
.iconText {
|
||||
display: flex;
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
border-radius: 50%;
|
||||
background-color: $uni-theme-color;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
width: calc(100% - 36rpx);
|
||||
// margin: 0 10px;
|
||||
top: 0;
|
||||
border-radius: 4px 4px 0 0;
|
||||
padding: 2px 10px;
|
||||
.nav-menu {
|
||||
height: 40rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-weight: 700;
|
||||
}
|
||||
.completed {
|
||||
background: #e1f3d8;
|
||||
color: #67c23a;
|
||||
}
|
||||
.incomplete {
|
||||
background: #fde2e2;
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
/deep/ .record {
|
||||
.uni-card__content {
|
||||
padding: 55rpx 20rpx 20rpx !important;
|
||||
border-radius: 8rpx;
|
||||
line-height: 40rpx;
|
||||
background: #ebeaec;
|
||||
color: #666;
|
||||
&-active {
|
||||
background: #dfe5f7;
|
||||
color: $uni-theme-color;
|
||||
}
|
||||
&-btn {
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user