修改测试问题

This commit is contained in:
guanj
2026-07-02 09:55:30 +08:00
parent 1d73755a43
commit 40899e6d55
21 changed files with 380 additions and 157 deletions

View File

@@ -2,14 +2,14 @@
"version" : "2", "version" : "2",
"prompt" : "template", "prompt" : "template",
"title" : "服务协议和隐私政策", "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" : "同意并接受", "buttonAccept" : "同意并接受",
"buttonRefuse" : "暂不同意", "buttonRefuse" : "暂不同意",
"hrefLoader" : "system|default", "hrefLoader" : "system|default",
"backToExit" : "false", "backToExit" : "false",
"second" : { "second" : {
"title" : "确认提示", "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" : "同意并继续", "buttonAccept" : "同意并继续",
"buttonRefuse" : "退出应用" "buttonRefuse" : "退出应用"
}, },

View File

@@ -1,12 +1,12 @@
const debug = true // true 是连地服务端本地false 是连接线上 const debug = false // true 是连地服务端本地false 是连接线上
const development = { const development = {
domain: 'http://192.168.1.103:10215', // domain: 'http://192.168.1.103:10215',
// domain: 'http://192.168.1.102:27707/api', domain: 'http://192.168.1.102:27707/api',
} }
const production = { const production = {
domain: 'https://pqmcn.com:8092/api', domain: 'http://www.pqmcc.com:27707/api',
} }
const config = debug ? development : production const config = debug ? development : production

View File

@@ -2,8 +2,8 @@
"name" : "灿能物联", "name" : "灿能物联",
"appid" : "__UNI__88BC25B", "appid" : "__UNI__88BC25B",
"description" : "", "description" : "",
"versionName" : "1.6.83", "versionName" : "2.0.1",
"versionCode" : 170, "versionCode" : 176,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App */ /* 5+App */
@@ -142,9 +142,9 @@
"proxy" : { "proxy" : {
"/api" : { "/api" : {
"https" : true, "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.102:27707/api",
"target" : "http://192.168.1.103:10215", // "target" : "http://192.168.1.103:10215",
"changOrigin" : true, "changOrigin" : true,
"pathRewrite" : { "pathRewrite" : {
"/api" : "" "/api" : ""

View File

@@ -96,8 +96,8 @@ export default {
return { return {
sections: SECTIONS, sections: SECTIONS,
phaseColors: [ phaseColors: [
{ name: 'A相', color: '#F1B22E' }, { name: 'A相', color: '#DAA520' },
{ name: 'B相', color: '#2BA471' }, { name: 'B相', color: '#2E8B57' },
{ name: 'C相', color: '#D54941' }, { name: 'C相', color: '#D54941' },
], ],
renderData: { renderData: {
@@ -304,7 +304,7 @@ export default {
} }
.phase-value-vertical { .phase-value-vertical {
font-size: 28rpx; font-size: 26rpx;
font-weight: 700; font-weight: 700;
} }

View File

@@ -83,8 +83,8 @@ export default {
return { return {
sections: SECTIONS, sections: SECTIONS,
phaseColors: [ phaseColors: [
{ name: 'A相', color: '#F1B22E' }, { name: 'A相', color: '#DAA520' },
{ name: 'B相', color: '#2BA471' }, { name: 'B相', color: '#2E8B57' },
{ name: 'C相', color: '#D54941' }, { name: 'C相', color: '#D54941' },
], ],
renderData: { renderData: {
@@ -173,9 +173,9 @@ export default {
if (Number.isNaN(num)) return value if (Number.isNaN(num)) return value
if (divide) { if (divide) {
// return (num / divide).toFixed(2) // 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) { chunkedChildren(children) {
const result = [] const result = []
@@ -290,7 +290,7 @@ export default {
} }
.phase-value-vertical { .phase-value-vertical {
font-size: 28rpx; font-size: 26rpx;
font-weight: 700; font-weight: 700;
} }

View File

@@ -1,8 +1,8 @@
<template> <template>
<view class="xieBo"> <view >
<uni-load-more status="loading" v-if="loading"></uni-load-more> <uni-load-more status="loading" v-if="loading"></uni-load-more>
<view v-else> <view v-else class="xieBo">
<div class="header-form"> <div class="header-form">
<uni-data-select v-model="parity" :localdata="parityOption" @change="initEcharts" style="flex: 1" <uni-data-select v-model="parity" :localdata="parityOption" @change="initEcharts" style="flex: 1"
:clear="false"></uni-data-select> :clear="false"></uni-data-select>

View File

@@ -692,7 +692,7 @@ export default {
z-index: 2; z-index: 2;
text-align: center; text-align: center;
color: #111; color: #111;
width: 150rpx; width: 180rpx;
font-size: 16rpx; font-size: 16rpx;
opacity: 0.8; opacity: 0.8;

View File

@@ -664,4 +664,19 @@ export default {
left: -9999px; left: -9999px;
width: 375px; 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>

View File

@@ -144,8 +144,8 @@ export default {
return { return {
loading: true, loading: true,
phaseColors: [ phaseColors: [
{ name: 'A相', color: '#F1B22E' }, { name: 'A相', color: '#DAA520' },
{ name: 'B相', color: '#2BA471' }, { name: 'B相', color: '#2E8B57' },
{ name: 'C相', color: '#D54941' }, { name: 'C相', color: '#D54941' },
], ],
deviceInfo: {}, deviceInfo: {},
@@ -157,7 +157,7 @@ export default {
echartsDataV2: {}, echartsDataV2: {},
echartsDataV3: {}, echartsDataV3: {},
echartsDataA1: {}, echartsDataA1: {},
echartsDataA2: {}, echartsDataA2: {},
echartsDataA3: {}, echartsDataA3: {},
// 图表实例,用于后续操作 // 图表实例,用于后续操作
echart0: null, echart0: null,
@@ -185,8 +185,8 @@ export default {
{ name: '电压总谐波畸变率(%)', A: '-', B: '-', C: '-' }, { name: '电压总谐波畸变率(%)', A: '-', B: '-', C: '-' },
], ],
phaseColors: [ phaseColors: [
{ name: 'A相', color: '#F1B22E' }, { name: 'A相', color: '#DAA520' },
{ name: 'B相', color: '#2BA471' }, { name: 'B相', color: '#2E8B57' },
{ name: 'C相', color: '#D54941' }, { name: 'C相', color: '#D54941' },
], ],
disabled: false, disabled: false,
@@ -1126,7 +1126,7 @@ export default {
} }
.phase-value-vertical { .phase-value-vertical {
font-size: 28rpx; font-size: 26rpx;
font-weight: 700; font-weight: 700;
} }

View File

@@ -127,7 +127,7 @@ export default {
checkedAll: false, checkedAll: false,
checkedTotal: 0, checkedTotal: 0,
sort: 0, sort: 0,
array: ['发生时间', '暂降深度', '持续时间'], array: ['发生时间', '暂降幅值', '持续时间'],
} }
}, },
mounted() {}, mounted() {},

View File

@@ -4,7 +4,7 @@
<!-- <view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }" @click="openDrawer" <!-- <view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }" @click="openDrawer"
>{{ select.engineeringName || '工程' }} >{{ select.engineeringName || '工程' }}
</view> --> </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"> :range="projectList" range-key="text" v-if="store.params.engineerId">
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }" @click="selectProject = true"> <view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }" @click="selectProject = true">
{{ {{
@@ -39,7 +39,7 @@
</view> </view>
</picker> --> </picker> -->
</view> </view>
<view class="content device" > <view class="content device">
<uni-swipe-action> <uni-swipe-action>
<uni-swipe-action-item v-for="(item, index) in deviceListFilter" :threshold="0" <uni-swipe-action-item v-for="(item, index) in deviceListFilter" :threshold="0"
:right-options="item.isTop == 0 ? options1 : options12" @click="bindClick($event, item)"> :right-options="item.isTop == 0 ? options1 : options12" @click="bindClick($event, item)">
@@ -245,6 +245,8 @@ export default {
engineeringId: this.store.params.engineerId, engineeringId: this.store.params.engineerId,
}).then((res) => { }).then((res) => {
console.log(res) console.log(res)
this.select.projectName = ''
this.select.projectNameIndex = 0
let arr = [ let arr = [
{ {
text: '全部项目', text: '全部项目',
@@ -259,6 +261,7 @@ export default {
}), }),
] ]
this.projectList = arr this.projectList = arr
uni.setStorageSync('projectList', arr) uni.setStorageSync('projectList', arr)
}) })
}, },

View File

@@ -21,7 +21,7 @@
</view> </view>
</view> </view>
<view class="monitor-section-header"> <view class="monitor-section-header mb16">
<view class="section-title-row section-title-row--no-mb"> <view class="section-title-row section-title-row--no-mb">
<uni-icons type="settings" size="18" color="#376cf3" /> <uni-icons type="settings" size="18" color="#376cf3" />
<text class="section-title">已选展示指标</text> <text class="section-title">已选展示指标</text>
@@ -53,9 +53,13 @@
</view> </view>
</view> </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-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="card-header">
<view class="event-icon"> <view class="event-icon">
<Cn-icon-transient name="监测点" /> <Cn-icon-transient name="监测点" />
@@ -63,8 +67,8 @@
<view class="card-header-info"> <view class="card-header-info">
<view class="point-name-row"> <view class="point-name-row">
<text class="point-name ellipsis">{{ point.pointName }}</text> <text class="point-name ellipsis">{{ point.pointName }}</text>
<text class="event-tag" :class="point.runStatus == 1 ? 'lx-tag' : 'zx-tag'"> <text class="event-tag" :class="point.runStatus == 0 ? 'zx-tag' : 'lx-tag'">
{{ point.runStatus == 1 ? '线' : '线' }} {{ point.runStatus == 0 ? '线' : '线' }}
</text> </text>
</view> </view>
<view class="meta-row"> <view class="meta-row">
@@ -84,7 +88,7 @@
</view> </view>
<view v-if="hasTPhaseData(child)" class="phase-single"> <view v-if="hasTPhaseData(child)" class="phase-single">
<text class="phase-value-vertical phase-value-vertical--neutral">{{ child.T <text class="phase-value-vertical phase-value-vertical--neutral">{{ child.T
}}</text> }}</text>
</view> </view>
<view v-else class="phase-vertical"> <view v-else class="phase-vertical">
<view class="phase-item-vertical"> <view class="phase-item-vertical">
@@ -111,9 +115,9 @@
<text>更多指标</text> <text>更多指标</text>
</view> </view>
</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> :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> </view>
</view> </view>
@@ -175,29 +179,51 @@ export default {
], ],
selectedIndicators: [], selectedIndicators: [],
phaseColors: [ phaseColors: [
{ name: 'A相', color: '#F1B22E' }, { name: 'A相', color: '#DAA520' },
{ name: 'B相', color: '#2BA471' }, { name: 'B相', color: '#2E8B57' },
{ name: 'C相', color: '#D54941' }, { name: 'C相', color: '#D54941' },
], ],
monitoringPoints: [], monitoringPoints: [],
filterKeyword: '',
listStatus: 'noMore', listStatus: 'noMore',
lineDataRequestId: 0, lineDataRequestId: 0,
showBackTop: false, showBackTop: false,
indicatorPopupShow: 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) { onPageScroll(e) {
this.showBackTop = e.scrollTop > 200 this.showBackTop = e.scrollTop > 200
}, },
// 页面显示时同步工程名称 // 页面显示时同步工程名称;从指标详情返回时不刷新
onShow() { onShow() {
const engineering = uni.getStorageSync('engineering') const engineering = uni.getStorageSync('engineering')
const skipRefresh = this.skipRefreshOnShow
this.skipRefreshOnShow = false
if (engineering?.id) { if (engineering?.id) {
this.engineeringName = engineering.name || '' this.engineeringName = engineering.name || ''
this.engineeringId = engineering.id this.engineeringId = engineering.id
this.info() if (!skipRefresh) {
this.info()
}
} }
if (this.targetLists.length) { if (this.targetLists.length && !skipRefresh) {
this.loadSelectedIndicators() this.loadSelectedIndicators()
} }
}, },
@@ -235,6 +261,7 @@ export default {
loadLineData() { loadLineData() {
this.listStatus = 'loading' this.listStatus = 'loading'
this.monitoringPoints = [] this.monitoringPoints = []
this.filterKeyword = ''
const requestId = ++this.lineDataRequestId const requestId = ++this.lineDataRequestId
const engineerId = this.engineeringId const engineerId = this.engineeringId
getLineDataByEngineer({ id: engineerId }) getLineDataByEngineer({ id: engineerId })
@@ -265,6 +292,7 @@ export default {
pointName: point.pointName || '', pointName: point.pointName || '',
dataTime: point.dataTime || '', dataTime: point.dataTime || '',
lineType: point.lineType, lineType: point.lineType,
runStatus: point.runStatus,
children: this.groupChildren(point.children || []), children: this.groupChildren(point.children || []),
})) }))
}, },
@@ -401,6 +429,7 @@ export default {
}, },
// 跳转指标详情页,展示该监测点全部指标 // 跳转指标详情页,展示该监测点全部指标
onMoreIndicators(point) { onMoreIndicators(point) {
this.skipRefreshOnShow = true
uni.setStorageSync('monitorPointDetail', { uni.setStorageSync('monitorPointDetail', {
...point, ...point,
engineeringName: this.engineeringName, engineeringName: this.engineeringName,
@@ -614,7 +643,7 @@ export default {
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
gap: 12rpx; gap: 12rpx;
padding: 0 10px 16rpx; padding: 0 10px 0rpx;
} }
.legend-row { .legend-row {
@@ -640,6 +669,18 @@ export default {
color: #666666; color: #666666;
} }
.monitor-search {
position: sticky;
top: 0;
z-index: 10;
padding: 16rpx 10px 16rpx;
background: #f7f8fa;
/deep/ .uni-searchbar {
padding: 0;
}
}
.monitor-list { .monitor-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -695,8 +736,8 @@ export default {
flex-shrink: 0; flex-shrink: 0;
padding: 4rpx 12rpx; padding: 4rpx 12rpx;
font-size: 22rpx; font-size: 22rpx;
color: #2ba471; color: #2E8B57;
background: #2ba47115; background: #2E8B5715;
border-radius: 8rpx; border-radius: 8rpx;
line-height: 1.2; line-height: 1.2;
} }
@@ -771,7 +812,7 @@ export default {
} }
.phase-value-vertical { .phase-value-vertical {
font-size: 28rpx; font-size: 26rpx;
font-weight: 700; font-weight: 700;
&--neutral { &--neutral {
@@ -880,4 +921,8 @@ export default {
background-color: #ff3b3020; background-color: #ff3b3020;
color: #ff3b30; color: #ff3b30;
} }
/deep/ .uni-searchbar__box {
justify-content: left;
}
</style> </style>

View File

@@ -41,7 +41,7 @@
<view class="event-desc"> <view class="event-desc">
<text>统计时间{{ <text>统计时间{{
curSub == 0 ? item.startTime : item.startTime + ' 至 ' + item.endTime curSub == 0 ? item.startTime : item.startTime + ' 至 ' + item.endTime
}}</text> }}</text>
</view> </view>
</view> </view>
<view class="event-action" v-if="!showNotGenerated(item)"> <view class="event-action" v-if="!showNotGenerated(item)">
@@ -54,7 +54,7 @@
<view class="event-detail textBox" @touchmove.stop> <view class="event-detail textBox" @touchmove.stop>
<text v-if="!showNotGenerated(item)">{{ <text v-if="!showNotGenerated(item)">{{
item.overLimitDesc == '' ? '该监测点暂无指标越限' : item.overLimitDesc item.overLimitDesc == '' ? '该监测点暂无指标越限' : item.overLimitDesc
}}</text> }}</text>
<text v-else>数据未生成暂不支持下载</text> <text v-else>数据未生成暂不支持下载</text>
</view> </view>
<!-- <view class="downloadReport" @click="download"> <!-- <view class="downloadReport" @click="download">
@@ -180,46 +180,14 @@ export default {
timeType: this.selectValue.report, timeType: this.selectValue.report,
}) })
.then((res) => { .then((res) => {
// 下载文件资源到本地 const match = this.$config.static + res.data.match(/excelreport([^?]*)/)[1]
uni.downloadFile({ uni.downloadFile({
url: res.data, // 后端返回的线上文件路径 url: match,
success: function (res) { success: (downloadRes) => {
if (res.statusCode === 200) { if (downloadRes.statusCode === 200) {
// 文件到本地 this.openReportFile(downloadRes.tempFilePath)
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 { } else {
uni.hideLoading()
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
mask: true, 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) => { .catch((err) => {
uni.hideLoading()
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
mask: true, 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() { refresherrefresh() {
this.triggered = true this.triggered = true
@@ -386,6 +429,7 @@ export default {
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 1; z-index: 1;
} }
/deep/ .segmented-control__text { /deep/ .segmented-control__text {
line-height: 60rpx !important; line-height: 60rpx !important;
} }

View File

@@ -7,7 +7,12 @@
<Cn-icon-transient name="监测点" /> <Cn-icon-transient name="监测点" />
</view> </view>
<view class="card-header-info"> <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"> <view class="meta-row">
<text v-if="pointInfo.engineeringName" class="meta-item ellipsis"> <text v-if="pointInfo.engineeringName" class="meta-item ellipsis">
工程{{ pointInfo.engineeringName }} 工程{{ pointInfo.engineeringName }}
@@ -69,8 +74,8 @@ export default {
return { return {
pointInfo: {}, pointInfo: {},
phaseColors: [ phaseColors: [
{ name: 'A相', color: '#F1B22E' }, { name: 'A相', color: '#DAA520' },
{ name: 'B相', color: '#2BA471' }, { name: 'B相', color: '#2E8B57' },
{ name: 'C相', color: '#D54941' }, { name: 'C相', color: '#D54941' },
], ],
} }
@@ -155,17 +160,25 @@ export default {
min-width: 0; min-width: 0;
} }
.point-name-row {
display: flex;
align-items: center;
gap: 12rpx;
margin-bottom: 8rpx;
min-width: 0;
}
.point-name { .point-name {
display: block; // flex: 1;
min-width: 0;
font-size: 30rpx; font-size: 30rpx;
font-weight: 700; font-weight: 700;
color: #333333; color: #333333;
margin-bottom: 8rpx;
} }
.meta-row { .meta-row {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr ;
gap: 6rpx 12rpx; gap: 6rpx 12rpx;
} }
@@ -263,7 +276,7 @@ export default {
} }
.phase-value-vertical { .phase-value-vertical {
font-size: 28rpx; font-size: 26rpx;
font-weight: 700; font-weight: 700;
&--neutral { &--neutral {
@@ -282,4 +295,21 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; 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> </style>

View File

@@ -18,8 +18,8 @@
<Cn-filterCriteria @select="select" :showQianTree="false"> </Cn-filterCriteria> <Cn-filterCriteria @select="select" :showQianTree="false"> </Cn-filterCriteria>
</view> </view>
<scroll-view scroll-y="true" @scroll="onScroll" :scroll-top="scrollTop" scroll-with-animation <scroll-view scroll-y="true" @scroll="onScroll" :scroll-top="scrollTop" scroll-with-animation
@refresherrefresh="refresherrefresh" @scrolltolower="scrolltolower" @refresherrefresh="refresherrefresh" @scrolltolower="scrolltolower" :refresher-triggered="triggered"
:refresher-triggered="triggered" refresher-enabled="true" class="record event-list mt20" refresher-enabled="true" class="record event-list mt20"
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"> :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"> <uni-card class="event-item" :class="item.type" v-for="(item, index) in store.data" :key="index">
<!-- 头部图标 + 信息 + 操作 --> <!-- 头部图标 + 信息 + 操作 -->
@@ -67,7 +67,7 @@
<text>报告状态</text> <text>报告状态</text>
<text :style="{ color: item.isComplete == 1 ? '#10b981' : '#FF0000' }">{{ <text :style="{ color: item.isComplete == 1 ? '#10b981' : '#FF0000' }">{{
item.isComplete == 1 ? '已完成' : '未完成' item.isComplete == 1 ? '已完成' : '未完成'
}}</text> }}</text>
</view> </view>
<view class="device-body-item"> <view class="device-body-item">
<text>申请时间</text> <text>申请时间</text>
@@ -192,10 +192,17 @@ export default {
uni.showToast({ uni.showToast({
icon: 'success', icon: 'success',
mask: true, mask: true,
title: '生成事件报告成功!', title: '生成报告成功!',
duration: 1000, duration: 1000,
}) })
this.store.reload() 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, id: item.eventId,
}) })
.then((res) => { .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({ uni.downloadFile({
url: res.data, // 后端返回的线上文件路径 url: match,
success: function (res) { success: (downloadRes) => {
if (res.statusCode === 200) { if (downloadRes.statusCode === 200) {
// 文件到本地 this.openReportFile(downloadRes.tempFilePath, fileMeta)
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 { } else {
uni.hideLoading()
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
mask: true, 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) => { .catch((err) => {
uni.hideLoading()
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
mask: true, 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() { reload() {
switch (this.curSub) { switch (this.curSub) {
@@ -350,9 +419,9 @@ export default {
font-size: 26rpx; font-size: 26rpx;
color: #666666; color: #666666;
line-height: 1.5; line-height: 1.5;
} }
// } // }
@@ -418,6 +487,7 @@ export default {
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 1; z-index: 1;
} }
/deep/ .segmented-control__text { /deep/ .segmented-control__text {
line-height: 60rpx !important; line-height: 60rpx !important;
} }

View File

@@ -61,7 +61,7 @@ export default {
selectValue: {}, selectValue: {},
devCount: [], devCount: [],
sortIndex: 0, sortIndex: 0,
sortOptions: ['发生时间', '暂降深度', '持续时间'], sortOptions: ['发生时间', '暂降幅值', '持续时间'],
} }
}, },
onLoad() { }, onLoad() { },

View File

@@ -13,12 +13,12 @@
<view class="title">进度</view> <view class="title">进度</view>
<template v-if="pageData.status === '1'"> <template v-if="pageData.status === '1'">
<view class="title-btn mr10" @click="updateFeedBackStatus('2')">解决</view> <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>
<template v-if="pageData.status === '2'"> <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> </template>
<!-- <view class="title-btn" @click="open">回复</view> --> <view class="title-btn" @click="open" v-if="pageData.status != '0'">回复</view>
</view> </view>
</view> </view>
<uni-list> <uni-list>
@@ -54,11 +54,13 @@ export default {
"url": "/static/logo.png", "url": "/static/logo.png",
} }
], ],
userInfo: {},
pageData: {}, pageData: {},
pageOption: {} pageOption: {}
} }
}, },
onLoad(o) { onLoad(o) {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.pageOption = o this.pageOption = o
this.init() this.init()
updateChatStatus({ updateChatStatus({
@@ -102,6 +104,7 @@ export default {
open() { open() {
this.chatContent = '' this.chatContent = ''
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}, },
over() { over() {
}, },

View File

@@ -371,17 +371,23 @@ export default {
} }
/deep/ .uni-calendar-item__weeks-box-text { /deep/ .uni-calendar-item__weeks-box-text {
position: relative;
z-index: 1; z-index: 1;
line-height: 1;
} }
/deep/ .uni-calendar-item--isDay-text { /deep/ .uni-calendar-item__weeks-box-item {
color: #333 !important; /* 改成你想要的颜色 */ display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
} }
/deep/ .uni-calendar-item__weeks-box-circle { /deep/ .uni-calendar-item__weeks-box-circle {
position: absolute; position: absolute;
top: 7px; top: 50%;
right: 6px; left: 50%;
transform: translate(-50%, -50%);
width: 39px; width: 39px;
height: 39px; height: 39px;
border-radius: 50%; border-radius: 50%;
@@ -389,9 +395,13 @@ export default {
background-color: #e6a23c; background-color: #e6a23c;
} }
/* 核心:选中圆圈下的 子元素(日期数字 */ /* 选中圆圈下的日期数字 */
/deep/ .uni-calendar-item__weeks-box-circle + .uni-calendar-item__weeks-box-text { /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, /deep/ .uni-calendar__backtoday,
@@ -421,9 +431,9 @@ export default {
} }
/deep/ .uni-calendar-item__weeks-box-circle { /deep/ .uni-calendar-item__weeks-box-circle {
position: absolute; top: 50%;
top: 3px; left: 50%;
right: 8px; transform: translate(-50%, -50%);
width: 35px; width: 35px;
height: 35px; height: 35px;
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<Cn-page > <Cn-page>
<view class="mine" slot="body"> <view class="mine" slot="body">
<view class="mine-nav mt20" style="border-bottom: none"> <view class="mine-nav mt20" style="border-bottom: none">
<view class="mine-nav-label">暂态事件</view> <view class="mine-nav-label">暂态事件</view>
@@ -85,9 +85,12 @@ export default {
} }
}, },
onUnload() { onUnload() {
updatePushConfig(this.config).then((res) => { if (this.config.eventInfo != undefined) {
// this.$util.toast(`配置修改成功!`) updatePushConfig(this.config).then((res) => {
}) // this.$util.toast(`配置修改成功!`)
})
}
}, },
}, },
onLoad() { onLoad() {

Binary file not shown.

BIN
static/user_manual1.docx Normal file

Binary file not shown.