修改测试问题
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
"version" : "2",
|
||||
"prompt" : "template",
|
||||
"title" : "服务协议和隐私政策",
|
||||
"message" : " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"https://pqmcn.com:8092/#/agreement\">《服务协议》</a>和<a href=\"https://pqmcn.com:8092/#/policy\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||
"message" : " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"http://www.pqmcc.com:27707/#/agreement\">《服务协议》</a>和<a href=\"http://www.pqmcc.com:27707/#/policy\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||
"buttonAccept" : "同意并接受",
|
||||
"buttonRefuse" : "暂不同意",
|
||||
"hrefLoader" : "system|default",
|
||||
"backToExit" : "false",
|
||||
"second" : {
|
||||
"title" : "确认提示",
|
||||
"message" : " 进入应用前,你需先同意<a href=\"https://pqmcn.com:8092/#/agreement\">《用户协议》</a>和<a href=\"https://pqmcn.com:8092/#/policy\">《隐私政策》</a>,否则将退出应用。",
|
||||
"message" : " 进入应用前,你需先同意<a href=\"http://www.pqmcc.com:27707/#/agreement\">《用户协议》</a>和<a href=\"http://www.pqmcc.com:27707/#/policy\">《隐私政策》</a>,否则将退出应用。",
|
||||
"buttonAccept" : "同意并继续",
|
||||
"buttonRefuse" : "退出应用"
|
||||
},
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
const debug = true // true 是连地服务端本地,false 是连接线上
|
||||
const debug = false // true 是连地服务端本地,false 是连接线上
|
||||
|
||||
const development = {
|
||||
domain: 'http://192.168.1.103:10215',
|
||||
// domain: 'http://192.168.1.102:27707/api',
|
||||
// domain: 'http://192.168.1.103:10215',
|
||||
domain: 'http://192.168.1.102:27707/api',
|
||||
}
|
||||
|
||||
const production = {
|
||||
domain: 'https://pqmcn.com:8092/api',
|
||||
domain: 'http://www.pqmcc.com:27707/api',
|
||||
}
|
||||
|
||||
const config = debug ? development : production
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name" : "灿能物联",
|
||||
"appid" : "__UNI__88BC25B",
|
||||
"description" : "",
|
||||
"versionName" : "1.6.83",
|
||||
"versionCode" : 170,
|
||||
"versionName" : "2.0.1",
|
||||
"versionCode" : 176,
|
||||
"transformPx" : false,
|
||||
"sassImplementationName" : "node-sass",
|
||||
/* 5+App特有相关 */
|
||||
@@ -142,9 +142,9 @@
|
||||
"proxy" : {
|
||||
"/api" : {
|
||||
"https" : true,
|
||||
// "target" : "https://pqmcn.com:8092/api",
|
||||
"target" : "http://www.pqmcc.com:27707/api",
|
||||
// "target" : "http://192.168.1.102:27707/api",
|
||||
"target" : "http://192.168.1.103:10215",
|
||||
// "target" : "http://192.168.1.103:10215",
|
||||
"changOrigin" : true,
|
||||
"pathRewrite" : {
|
||||
"/api" : ""
|
||||
|
||||
@@ -96,8 +96,8 @@ export default {
|
||||
return {
|
||||
sections: SECTIONS,
|
||||
phaseColors: [
|
||||
{ name: 'A相', color: '#F1B22E' },
|
||||
{ name: 'B相', color: '#2BA471' },
|
||||
{ name: 'A相', color: '#DAA520' },
|
||||
{ name: 'B相', color: '#2E8B57' },
|
||||
{ name: 'C相', color: '#D54941' },
|
||||
],
|
||||
renderData: {
|
||||
@@ -304,7 +304,7 @@ export default {
|
||||
}
|
||||
|
||||
.phase-value-vertical {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,8 +83,8 @@ export default {
|
||||
return {
|
||||
sections: SECTIONS,
|
||||
phaseColors: [
|
||||
{ name: 'A相', color: '#F1B22E' },
|
||||
{ name: 'B相', color: '#2BA471' },
|
||||
{ name: 'A相', color: '#DAA520' },
|
||||
{ name: 'B相', color: '#2E8B57' },
|
||||
{ name: 'C相', color: '#D54941' },
|
||||
],
|
||||
renderData: {
|
||||
@@ -173,9 +173,9 @@ export default {
|
||||
if (Number.isNaN(num)) return value
|
||||
if (divide) {
|
||||
// return (num / divide).toFixed(2)
|
||||
return num != 0 ? (num / divide).toFixed(2) : num
|
||||
return num != 0 ? (num / divide).toFixed(2) : num.toFixed(2)
|
||||
}
|
||||
return num
|
||||
return num.toFixed(2)
|
||||
},
|
||||
chunkedChildren(children) {
|
||||
const result = []
|
||||
@@ -290,7 +290,7 @@ export default {
|
||||
}
|
||||
|
||||
.phase-value-vertical {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<view class="xieBo">
|
||||
<view >
|
||||
<uni-load-more status="loading" v-if="loading"></uni-load-more>
|
||||
|
||||
<view v-else>
|
||||
<view v-else class="xieBo">
|
||||
<div class="header-form">
|
||||
<uni-data-select v-model="parity" :localdata="parityOption" @change="initEcharts" style="flex: 1"
|
||||
:clear="false"></uni-data-select>
|
||||
|
||||
@@ -692,7 +692,7 @@ export default {
|
||||
z-index: 2;
|
||||
text-align: center;
|
||||
color: #111;
|
||||
width: 150rpx;
|
||||
width: 180rpx;
|
||||
font-size: 16rpx;
|
||||
opacity: 0.8;
|
||||
|
||||
|
||||
@@ -664,4 +664,19 @@ export default {
|
||||
left: -9999px;
|
||||
width: 375px;
|
||||
}
|
||||
</style>
|
||||
|
||||
/deep/ .uni-select__input-text {
|
||||
width: 170px !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-select__selector-item {
|
||||
uni-text {
|
||||
white-space: nowrap !important;
|
||||
/* 强制不换行 */
|
||||
overflow: hidden !important;
|
||||
/* 溢出内容隐藏 */
|
||||
text-overflow: ellipsis !important;
|
||||
/* 溢出部分显示省略号 */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -144,8 +144,8 @@ export default {
|
||||
return {
|
||||
loading: true,
|
||||
phaseColors: [
|
||||
{ name: 'A相', color: '#F1B22E' },
|
||||
{ name: 'B相', color: '#2BA471' },
|
||||
{ name: 'A相', color: '#DAA520' },
|
||||
{ name: 'B相', color: '#2E8B57' },
|
||||
{ name: 'C相', color: '#D54941' },
|
||||
],
|
||||
deviceInfo: {},
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
echartsDataV2: {},
|
||||
echartsDataV3: {},
|
||||
echartsDataA1: {},
|
||||
echartsDataA2: {},
|
||||
echartsDataA2: {},
|
||||
echartsDataA3: {},
|
||||
// 图表实例,用于后续操作
|
||||
echart0: null,
|
||||
@@ -185,8 +185,8 @@ export default {
|
||||
{ name: '电压总谐波畸变率(%)', A: '-', B: '-', C: '-' },
|
||||
],
|
||||
phaseColors: [
|
||||
{ name: 'A相', color: '#F1B22E' },
|
||||
{ name: 'B相', color: '#2BA471' },
|
||||
{ name: 'A相', color: '#DAA520' },
|
||||
{ name: 'B相', color: '#2E8B57' },
|
||||
{ name: 'C相', color: '#D54941' },
|
||||
],
|
||||
disabled: false,
|
||||
@@ -1126,7 +1126,7 @@ export default {
|
||||
}
|
||||
|
||||
.phase-value-vertical {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ export default {
|
||||
checkedAll: false,
|
||||
checkedTotal: 0,
|
||||
sort: 0,
|
||||
array: ['发生时间', '暂降深度', '持续时间'],
|
||||
array: ['发生时间', '暂降幅值', '持续时间'],
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<!-- <view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }" @click="openDrawer"
|
||||
>{{ select.engineeringName || '工程' }}
|
||||
</view> -->
|
||||
<picker @change="projectNameChange" @cancel="selectProject = false" :value="select.projectNameIndex"
|
||||
<picker @change="projectNameChange" @cancel="selectProject = false" :value="select.projectNameIndex"
|
||||
:range="projectList" range-key="text" v-if="store.params.engineerId">
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }" @click="selectProject = true">
|
||||
{{
|
||||
@@ -39,7 +39,7 @@
|
||||
</view>
|
||||
</picker> -->
|
||||
</view>
|
||||
<view class="content device" >
|
||||
<view class="content device">
|
||||
<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)">
|
||||
@@ -245,6 +245,8 @@ export default {
|
||||
engineeringId: this.store.params.engineerId,
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.select.projectName = ''
|
||||
this.select.projectNameIndex = 0
|
||||
let arr = [
|
||||
{
|
||||
text: '全部项目',
|
||||
@@ -259,6 +261,7 @@ export default {
|
||||
}),
|
||||
]
|
||||
this.projectList = arr
|
||||
|
||||
uni.setStorageSync('projectList', arr)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="monitor-section-header">
|
||||
<view class="monitor-section-header mb16">
|
||||
<view class="section-title-row section-title-row--no-mb">
|
||||
<uni-icons type="settings" size="18" color="#376cf3" />
|
||||
<text class="section-title">已选展示指标</text>
|
||||
@@ -53,9 +53,13 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="monitor-search">
|
||||
<uni-search-bar v-model="filterKeyword" bgColor="#fff" placeholder="搜索项目、设备、监测点"
|
||||
cancelButton="none" />
|
||||
</view>
|
||||
|
||||
<view class="monitor-list">
|
||||
<view class="monitor-card card" v-for="(point, idx) in monitoringPoints" :key="idx">
|
||||
<view class="monitor-card card" v-for="(point, idx) in filteredMonitoringPoints" :key="idx">
|
||||
<view class="card-header">
|
||||
<view class="event-icon">
|
||||
<Cn-icon-transient name="监测点" />
|
||||
@@ -63,8 +67,8 @@
|
||||
<view class="card-header-info">
|
||||
<view class="point-name-row">
|
||||
<text class="point-name ellipsis">{{ point.pointName }}</text>
|
||||
<text class="event-tag" :class="point.runStatus == 1 ? 'lx-tag' : 'zx-tag'">
|
||||
{{ point.runStatus == 1 ? '离线' : '在线' }}
|
||||
<text class="event-tag" :class="point.runStatus == 0 ? 'zx-tag' : 'lx-tag'">
|
||||
{{ point.runStatus == 0 ? '在线' : '离线' }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="meta-row">
|
||||
@@ -84,7 +88,7 @@
|
||||
</view>
|
||||
<view v-if="hasTPhaseData(child)" class="phase-single">
|
||||
<text class="phase-value-vertical phase-value-vertical--neutral">{{ child.T
|
||||
}}</text>
|
||||
}}</text>
|
||||
</view>
|
||||
<view v-else class="phase-vertical">
|
||||
<view class="phase-item-vertical">
|
||||
@@ -111,9 +115,9 @@
|
||||
<text>更多指标</text>
|
||||
</view>
|
||||
</view>
|
||||
<uni-load-more v-if="listStatus == 'loading' || monitoringPoints.length > 0"
|
||||
<uni-load-more v-if="listStatus == 'loading' || filteredMonitoringPoints.length > 0"
|
||||
:status="listStatus"></uni-load-more>
|
||||
<Cn-empty v-else style="top: 35%"></Cn-empty>
|
||||
<Cn-empty v-else-if="listStatus !== 'loading'" style="top: 45%"></Cn-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -175,29 +179,51 @@ export default {
|
||||
],
|
||||
selectedIndicators: [],
|
||||
phaseColors: [
|
||||
{ name: 'A相', color: '#F1B22E' },
|
||||
{ name: 'B相', color: '#2BA471' },
|
||||
{ name: 'A相', color: '#DAA520' },
|
||||
{ name: 'B相', color: '#2E8B57' },
|
||||
{ name: 'C相', color: '#D54941' },
|
||||
],
|
||||
monitoringPoints: [],
|
||||
filterKeyword: '',
|
||||
listStatus: 'noMore',
|
||||
lineDataRequestId: 0,
|
||||
showBackTop: false,
|
||||
indicatorPopupShow: false,
|
||||
skipRefreshOnShow: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filteredMonitoringPoints() {
|
||||
const keyword = (this.filterKeyword || '').trim().toLowerCase()
|
||||
if (!keyword) return this.monitoringPoints
|
||||
return this.monitoringPoints.filter((point) => {
|
||||
const projectName = String(point.projectName || '').toLowerCase()
|
||||
const deviceName = String(point.deviceName || '').toLowerCase()
|
||||
const pointName = String(point.pointName || '').toLowerCase()
|
||||
return (
|
||||
projectName.indexOf(keyword) !== -1 ||
|
||||
deviceName.indexOf(keyword) !== -1 ||
|
||||
pointName.indexOf(keyword) !== -1
|
||||
)
|
||||
})
|
||||
},
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.showBackTop = e.scrollTop > 200
|
||||
},
|
||||
// 页面显示时同步工程名称
|
||||
// 页面显示时同步工程名称;从指标详情返回时不刷新
|
||||
onShow() {
|
||||
const engineering = uni.getStorageSync('engineering')
|
||||
const skipRefresh = this.skipRefreshOnShow
|
||||
this.skipRefreshOnShow = false
|
||||
if (engineering?.id) {
|
||||
this.engineeringName = engineering.name || ''
|
||||
this.engineeringId = engineering.id
|
||||
this.info()
|
||||
if (!skipRefresh) {
|
||||
this.info()
|
||||
}
|
||||
}
|
||||
if (this.targetLists.length) {
|
||||
if (this.targetLists.length && !skipRefresh) {
|
||||
this.loadSelectedIndicators()
|
||||
}
|
||||
},
|
||||
@@ -235,6 +261,7 @@ export default {
|
||||
loadLineData() {
|
||||
this.listStatus = 'loading'
|
||||
this.monitoringPoints = []
|
||||
this.filterKeyword = ''
|
||||
const requestId = ++this.lineDataRequestId
|
||||
const engineerId = this.engineeringId
|
||||
getLineDataByEngineer({ id: engineerId })
|
||||
@@ -265,6 +292,7 @@ export default {
|
||||
pointName: point.pointName || '',
|
||||
dataTime: point.dataTime || '',
|
||||
lineType: point.lineType,
|
||||
runStatus: point.runStatus,
|
||||
children: this.groupChildren(point.children || []),
|
||||
}))
|
||||
},
|
||||
@@ -401,6 +429,7 @@ export default {
|
||||
},
|
||||
// 跳转指标详情页,展示该监测点全部指标
|
||||
onMoreIndicators(point) {
|
||||
this.skipRefreshOnShow = true
|
||||
uni.setStorageSync('monitorPointDetail', {
|
||||
...point,
|
||||
engineeringName: this.engineeringName,
|
||||
@@ -614,7 +643,7 @@ export default {
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
padding: 0 10px 16rpx;
|
||||
padding: 0 10px 0rpx;
|
||||
}
|
||||
|
||||
.legend-row {
|
||||
@@ -640,6 +669,18 @@ export default {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.monitor-search {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
padding: 16rpx 10px 16rpx;
|
||||
background: #f7f8fa;
|
||||
|
||||
/deep/ .uni-searchbar {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.monitor-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -695,8 +736,8 @@ export default {
|
||||
flex-shrink: 0;
|
||||
padding: 4rpx 12rpx;
|
||||
font-size: 22rpx;
|
||||
color: #2ba471;
|
||||
background: #2ba47115;
|
||||
color: #2E8B57;
|
||||
background: #2E8B5715;
|
||||
border-radius: 8rpx;
|
||||
line-height: 1.2;
|
||||
}
|
||||
@@ -771,7 +812,7 @@ export default {
|
||||
}
|
||||
|
||||
.phase-value-vertical {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
|
||||
&--neutral {
|
||||
@@ -880,4 +921,8 @@ export default {
|
||||
background-color: #ff3b3020;
|
||||
color: #ff3b30;
|
||||
}
|
||||
|
||||
/deep/ .uni-searchbar__box {
|
||||
justify-content: left;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<view class="event-desc">
|
||||
<text>统计时间:{{
|
||||
curSub == 0 ? item.startTime : item.startTime + ' 至 ' + item.endTime
|
||||
}}</text>
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="event-action" v-if="!showNotGenerated(item)">
|
||||
@@ -54,7 +54,7 @@
|
||||
<view class="event-detail textBox" @touchmove.stop>
|
||||
<text v-if="!showNotGenerated(item)">{{
|
||||
item.overLimitDesc == '' ? '该监测点暂无指标越限' : item.overLimitDesc
|
||||
}}</text>
|
||||
}}</text>
|
||||
<text v-else>数据未生成,暂不支持下载</text>
|
||||
</view>
|
||||
<!-- <view class="downloadReport" @click="download">
|
||||
@@ -180,46 +180,14 @@ export default {
|
||||
timeType: this.selectValue.report,
|
||||
})
|
||||
.then((res) => {
|
||||
// 下载文件资源到本地
|
||||
const match = this.$config.static + res.data.match(/excelreport([^?]*)/)[1]
|
||||
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('下载成功')
|
||||
url: match,
|
||||
success: (downloadRes) => {
|
||||
if (downloadRes.statusCode === 200) {
|
||||
this.openReportFile(downloadRes.tempFilePath)
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
@@ -228,10 +196,19 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function (res) { },
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: '下载失败!',
|
||||
duration: 1000,
|
||||
})
|
||||
},
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
@@ -240,6 +217,72 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
openReportFile(tempFilePath) {
|
||||
const previewFile = (filePath) => {
|
||||
uni.hideLoading()
|
||||
uni.openDocument({
|
||||
filePath,
|
||||
fileType: 'xlsx',
|
||||
showMenu: true,
|
||||
success: () => {
|
||||
console.log('成功打开文件')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('打开文件失败', err)
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '预览失败',
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// iOS 需保留 xlsx 后缀,saveFile 随机路径会导致 openDocument 失败
|
||||
if (plus.os.name === 'iOS') {
|
||||
const fileName = `harmonic_report_${Date.now()}.xlsx`
|
||||
plus.io.resolveLocalFileSystemURL(
|
||||
tempFilePath,
|
||||
(entry) => {
|
||||
plus.io.resolveLocalFileSystemURL(
|
||||
'_doc/',
|
||||
(docEntry) => {
|
||||
entry.copyTo(
|
||||
docEntry,
|
||||
fileName,
|
||||
(newEntry) => previewFile(newEntry.fullPath),
|
||||
() => previewFile(tempFilePath)
|
||||
)
|
||||
},
|
||||
() => previewFile(tempFilePath)
|
||||
)
|
||||
},
|
||||
() => previewFile(tempFilePath)
|
||||
)
|
||||
return
|
||||
}
|
||||
// #endif
|
||||
|
||||
uni.saveFile({
|
||||
tempFilePath,
|
||||
success: (data) => {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '下载成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
setTimeout(() => previewFile(data.savedFilePath), 500)
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '保存失败!',
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
// 下拉
|
||||
refresherrefresh() {
|
||||
this.triggered = true
|
||||
@@ -386,6 +429,7 @@ export default {
|
||||
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/deep/ .segmented-control__text {
|
||||
line-height: 60rpx !important;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,12 @@
|
||||
<Cn-icon-transient name="监测点" />
|
||||
</view>
|
||||
<view class="card-header-info">
|
||||
<text class="point-name ellipsis">{{ pointInfo.pointName || '-' }}</text>
|
||||
<view class="point-name-row">
|
||||
<text class="point-name ellipsis">{{ pointInfo.pointName || '-' }}</text>
|
||||
<text class="event-tag ml10" :class="pointInfo.runStatus == 0 ? 'zx-tag' : 'lx-tag'">
|
||||
{{ pointInfo.runStatus == 0 ? '在线' : '离线' }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="meta-row">
|
||||
<text v-if="pointInfo.engineeringName" class="meta-item ellipsis">
|
||||
工程:{{ pointInfo.engineeringName }}
|
||||
@@ -69,8 +74,8 @@ export default {
|
||||
return {
|
||||
pointInfo: {},
|
||||
phaseColors: [
|
||||
{ name: 'A相', color: '#F1B22E' },
|
||||
{ name: 'B相', color: '#2BA471' },
|
||||
{ name: 'A相', color: '#DAA520' },
|
||||
{ name: 'B相', color: '#2E8B57' },
|
||||
{ name: 'C相', color: '#D54941' },
|
||||
],
|
||||
}
|
||||
@@ -155,17 +160,25 @@ export default {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.point-name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
margin-bottom: 8rpx;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.point-name {
|
||||
display: block;
|
||||
// flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #333333;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.meta-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-columns: 1fr ;
|
||||
gap: 6rpx 12rpx;
|
||||
}
|
||||
|
||||
@@ -263,7 +276,7 @@ export default {
|
||||
}
|
||||
|
||||
.phase-value-vertical {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
|
||||
&--neutral {
|
||||
@@ -282,4 +295,21 @@ export default {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.event-tag {
|
||||
flex-shrink: 0;
|
||||
font-size: 22rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.zx-tag {
|
||||
background-color: #10b98120;
|
||||
color: #10b981;
|
||||
}
|
||||
|
||||
.lx-tag {
|
||||
background-color: #ff3b3020;
|
||||
color: #ff3b30;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<Cn-filterCriteria @select="select" :showQianTree="false"> </Cn-filterCriteria>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" @scroll="onScroll" :scroll-top="scrollTop" scroll-with-animation
|
||||
@refresherrefresh="refresherrefresh" @scrolltolower="scrolltolower"
|
||||
:refresher-triggered="triggered" refresher-enabled="true" class="record event-list mt20"
|
||||
@refresherrefresh="refresherrefresh" @scrolltolower="scrolltolower" :refresher-triggered="triggered"
|
||||
refresher-enabled="true" 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 store.data" :key="index">
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
@@ -67,7 +67,7 @@
|
||||
<text>报告状态:</text>
|
||||
<text :style="{ color: item.isComplete == 1 ? '#10b981' : '#FF0000' }">{{
|
||||
item.isComplete == 1 ? '已完成' : '未完成'
|
||||
}}</text>
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="device-body-item">
|
||||
<text>申请时间:</text>
|
||||
@@ -192,10 +192,17 @@ export default {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '生成事件报告成功!',
|
||||
title: '生成报告成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
this.store.reload()
|
||||
}).catch((err) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: err.message,
|
||||
duration: 1000,
|
||||
})
|
||||
})
|
||||
},
|
||||
// 下载报告
|
||||
@@ -208,46 +215,26 @@ export default {
|
||||
id: item.eventId,
|
||||
})
|
||||
.then((res) => {
|
||||
// 下载文件资源到本地
|
||||
const pathMatch = res.data.match(/excelreport([^?]*)/)
|
||||
if (!pathMatch) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: '文件地址无效',
|
||||
duration: 1000,
|
||||
})
|
||||
return
|
||||
}
|
||||
const fileMeta = this.getReportFileMeta(pathMatch[1])
|
||||
const match = this.$config.static + pathMatch[1]
|
||||
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('下载成功')
|
||||
url: match,
|
||||
success: (downloadRes) => {
|
||||
if (downloadRes.statusCode === 200) {
|
||||
this.openReportFile(downloadRes.tempFilePath, fileMeta)
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
@@ -256,10 +243,19 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function (res) { },
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: '下载失败!',
|
||||
duration: 1000,
|
||||
})
|
||||
},
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
@@ -268,6 +264,79 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
getReportFileMeta(filePath) {
|
||||
const lower = (filePath || '').toLowerCase()
|
||||
if (lower.endsWith('.doc')) {
|
||||
return { fileType: 'doc', ext: 'doc' }
|
||||
}
|
||||
return { fileType: 'docx', ext: 'docx' }
|
||||
},
|
||||
openReportFile(tempFilePath, fileMeta) {
|
||||
const previewFile = (filePath) => {
|
||||
uni.hideLoading()
|
||||
uni.openDocument({
|
||||
filePath,
|
||||
fileType: fileMeta.fileType,
|
||||
showMenu: true,
|
||||
success: () => {
|
||||
console.log('成功打开文件')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('打开文件失败', err)
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '预览失败',
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// iOS 需保留 doc/docx 后缀,saveFile 随机路径会导致 openDocument 失败
|
||||
if (plus.os.name === 'iOS') {
|
||||
const fileName = `event_report_${Date.now()}.${fileMeta.ext}`
|
||||
plus.io.resolveLocalFileSystemURL(
|
||||
tempFilePath,
|
||||
(entry) => {
|
||||
plus.io.resolveLocalFileSystemURL(
|
||||
'_doc/',
|
||||
(docEntry) => {
|
||||
entry.copyTo(
|
||||
docEntry,
|
||||
fileName,
|
||||
(newEntry) => previewFile(newEntry.fullPath),
|
||||
() => previewFile(tempFilePath)
|
||||
)
|
||||
},
|
||||
() => previewFile(tempFilePath)
|
||||
)
|
||||
},
|
||||
() => previewFile(tempFilePath)
|
||||
)
|
||||
return
|
||||
}
|
||||
// #endif
|
||||
|
||||
uni.saveFile({
|
||||
tempFilePath,
|
||||
success: (data) => {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '下载成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
setTimeout(() => previewFile(data.savedFilePath), 500)
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '保存失败!',
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
// 刷新
|
||||
reload() {
|
||||
switch (this.curSub) {
|
||||
@@ -350,9 +419,9 @@ export default {
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 1.5;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// }
|
||||
@@ -418,6 +487,7 @@ export default {
|
||||
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/deep/ .segmented-control__text {
|
||||
line-height: 60rpx !important;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
selectValue: {},
|
||||
devCount: [],
|
||||
sortIndex: 0,
|
||||
sortOptions: ['发生时间', '暂降深度', '持续时间'],
|
||||
sortOptions: ['发生时间', '暂降幅值', '持续时间'],
|
||||
}
|
||||
},
|
||||
onLoad() { },
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
<view class="title">进度</view>
|
||||
<template v-if="pageData.status === '1'">
|
||||
<view class="title-btn mr10" @click="updateFeedBackStatus('2')">解决</view>
|
||||
<view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>
|
||||
<view class="title-btn mr10" @click="updateFeedBackStatus('0')" v-if="userInfo.authorities === 'app_vip_user'">关闭</view>
|
||||
</template>
|
||||
<template v-if="pageData.status === '2'">
|
||||
<view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>
|
||||
<view class="title-btn mr10" @click="updateFeedBackStatus('0')" v-if="userInfo.authorities === 'app_vip_user'">关闭</view>
|
||||
</template>
|
||||
<!-- <view class="title-btn" @click="open">回复</view> -->
|
||||
<view class="title-btn" @click="open" v-if="pageData.status != '0'">回复</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-list>
|
||||
@@ -54,11 +54,13 @@ export default {
|
||||
"url": "/static/logo.png",
|
||||
}
|
||||
],
|
||||
userInfo: {},
|
||||
pageData: {},
|
||||
pageOption: {}
|
||||
}
|
||||
},
|
||||
onLoad(o) {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.pageOption = o
|
||||
this.init()
|
||||
updateChatStatus({
|
||||
@@ -102,6 +104,7 @@ export default {
|
||||
open() {
|
||||
this.chatContent = ''
|
||||
this.$refs.inputDialog.open()
|
||||
|
||||
},
|
||||
over() {
|
||||
},
|
||||
|
||||
@@ -371,17 +371,23 @@ export default {
|
||||
}
|
||||
|
||||
/deep/ .uni-calendar-item__weeks-box-text {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/deep/ .uni-calendar-item--isDay-text {
|
||||
color: #333 !important; /* 改成你想要的颜色 */
|
||||
/deep/ .uni-calendar-item__weeks-box-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/deep/ .uni-calendar-item__weeks-box-circle {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
right: 6px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 39px;
|
||||
height: 39px;
|
||||
border-radius: 50%;
|
||||
@@ -389,9 +395,13 @@ export default {
|
||||
background-color: #e6a23c;
|
||||
}
|
||||
|
||||
/* 核心:选中圆圈下的 子元素(日期数字) */
|
||||
/* 选中圆圈下的日期数字 */
|
||||
/deep/ .uni-calendar-item__weeks-box-circle + .uni-calendar-item__weeks-box-text {
|
||||
color: #fff !important; /* 改成你想要的颜色 */
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-calendar-item--isDay-text {
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-calendar__backtoday,
|
||||
@@ -421,9 +431,9 @@ export default {
|
||||
}
|
||||
|
||||
/deep/ .uni-calendar-item__weeks-box-circle {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
right: 8px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Cn-page >
|
||||
<Cn-page>
|
||||
<view class="mine" slot="body">
|
||||
<view class="mine-nav mt20" style="border-bottom: none">
|
||||
<view class="mine-nav-label">暂态事件</view>
|
||||
@@ -85,9 +85,12 @@ export default {
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
updatePushConfig(this.config).then((res) => {
|
||||
// this.$util.toast(`配置修改成功!`)
|
||||
})
|
||||
if (this.config.eventInfo != undefined) {
|
||||
updatePushConfig(this.config).then((res) => {
|
||||
// this.$util.toast(`配置修改成功!`)
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
Binary file not shown.
BIN
static/user_manual1.docx
Normal file
BIN
static/user_manual1.docx
Normal file
Binary file not shown.
Reference in New Issue
Block a user