修改方案数据&设备补召

This commit is contained in:
zhujiyan
2024-09-30 16:32:16 +08:00
parent cca15c2e8c
commit 67abe76339
9 changed files with 69 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
import createAxios from '@/utils/request' import createAxios from '@/utils/request'
// 获取设备补页面数据 // 获取设备补页面数据
export function getMakeUpData(data: any) { export function getMakeUpData(data: any) {
return createAxios({ return createAxios({
url: '/cs-harmonic-boot/offlineDataUpload/makeUpData?lineId='+data, url: '/cs-harmonic-boot/offlineDataUpload/makeUpData?lineId='+data,
@@ -16,8 +16,8 @@ export function getAskDirOrFile(data: any) {
}) })
} }
//设备补操作 //设备补操作
// 获取设备补页面数据 // 获取设备补页面数据
export function offlineDataUploadMakeUp(data: any) { export function offlineDataUploadMakeUp(data: any) {
return createAxios({ return createAxios({
url: '/cs-harmonic-boot/offlineDataUpload/makeUp', url: '/cs-harmonic-boot/offlineDataUpload/makeUp',

View File

@@ -27,7 +27,7 @@ export const adminBaseRoute = {
}, },
{ {
// 设备补 // 设备补
path: '/supplementaryRecruitment', path: '/supplementaryRecruitment',
name: 'supplementaryRecruitment', name: 'supplementaryRecruitment',
component: () => import('@/views/govern/device/control/supplementaryRecruitment.vue'), component: () => import('@/views/govern/device/control/supplementaryRecruitment.vue'),

View File

@@ -10,7 +10,7 @@ export const yMethod = (arr: any) => {
maxValue = Math.max(...arr) maxValue = Math.max(...arr)
minValue = Math.min(...arr) minValue = Math.min(...arr)
console.log('🚀 ~ yMethod ~ minValue:', minValue) console.log('🚀 ~ yMethod ~ minValue:', minValue,maxValue)
// interval = (maxValue - minValue) / 4 // interval = (maxValue - minValue) / 4
// if (maxValue > 1000) { // if (maxValue > 1000) {

View File

@@ -13,7 +13,7 @@
模版下载 模版下载
</el-button> --> </el-button> -->
<el-button v-if="deviceType == '1'" type="primary" @click="handleImport">离线数据导入</el-button> <el-button v-if="deviceType == '1'" type="primary" @click="handleImport">离线数据导入</el-button>
<el-button v-if="deviceType == '1'" type="primary" @click="handleaddDevice">设备补</el-button> <el-button v-if="deviceType == '1'" type="primary" @click="handleaddDevice">设备补</el-button>
<el-button v-if="deviceType == '1'" type="primary" @click="handleAnalysisList">解析列表</el-button> <el-button v-if="deviceType == '1'" type="primary" @click="handleAnalysisList">解析列表</el-button>
</template> </template>
<el-descriptions-item label="名称"> <el-descriptions-item label="名称">
@@ -393,7 +393,7 @@ const handleSizeChange = (val: number) => {
handleClick() handleClick()
} }
const { push, options, currentRoute } = useRouter() const { push, options, currentRoute } = useRouter()
//设备补 //设备补
const handleaddDevice = () => { const handleaddDevice = () => {
push({ push({
path: '/supplementaryRecruitment', path: '/supplementaryRecruitment',

View File

@@ -2,10 +2,10 @@
<div class="default-main device"> <div class="default-main device">
<currentDevice ref="currentDeviceRef"/> <currentDevice ref="currentDeviceRef"/>
<!-- <el-tabs v-model="activeName" type="border-card"> <!-- <el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="当前设备补" name="0"> <el-tab-pane label="当前设备补" name="0">
<currentDevice v-if="activeName == '0'" ref="currentDeviceRef"/> <currentDevice v-if="activeName == '0'" ref="currentDeviceRef"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="历史设备补" name="1"> <el-tab-pane label="历史设备补" name="1">
<history v-if="activeName == '1'" /> <history v-if="activeName == '1'" />
</el-tab-pane> </el-tab-pane>
</el-tabs> --> </el-tabs> -->

View File

@@ -1,4 +1,4 @@
<!-- 当前设备补 --> <!-- 当前设备补 -->
<template> <template>
<div class="default-main"> <div class="default-main">
<TableHeader> <TableHeader>

View File

@@ -1,5 +1,5 @@
<template> <template>
<!-- 设备补 --> <!-- 设备补 -->
<div class="default-main current_device" v-loading="loading"> <div class="default-main current_device" v-loading="loading">
<div class="current_header"> <div class="current_header">
<el-form-item label="日期"> <el-form-item label="日期">
@@ -13,7 +13,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<!-- <el-button type="primary" :icon="Search" @click="handleSearch">查询</el-button> --> <!-- <el-button type="primary" :icon="Search" @click="handleSearch">查询</el-button> -->
<el-button type="primary" :icon="Setting" @click="handleUpDevice"></el-button> <el-button type="primary" :icon="Setting" @click="handleUpDevice"></el-button>
<el-button :icon="Back" @click="go(-1)">返回</el-button> <el-button :icon="Back" @click="go(-1)">返回</el-button>
</el-form-item> </el-form-item>
</div> </div>

View File

@@ -1,4 +1,4 @@
<!-- 历史数据补 --> <!-- 历史数据补 -->
<template> <template>
<div class="default-main"> <div class="default-main">
<TableHeader> <TableHeader>

View File

@@ -22,8 +22,12 @@
<p>测试项信息</p> <p>测试项信息</p>
</div> --> </div> -->
<el-tabs v-model="activeName" type="border-card" @click="handleClickTabs"> <el-tabs v-model="activeName" type="border-card" @click="handleClickTabs">
<el-tab-pane v-for="(item, index) in deviceData.records" :label="item.itemName" <el-tab-pane
:name="item.id" :key="index"> v-for="(item, index) in deviceData.records"
:label="item.itemName"
:name="item.id"
:key="index"
>
<template #label> <template #label>
<span class="custom-tabs-label"> <span class="custom-tabs-label">
<el-icon> <el-icon>
@@ -101,10 +105,20 @@
<div class="history_header"> <div class="history_header">
<el-form :model="searchForm" class="history_select" id="history_select"> <el-form :model="searchForm" class="history_select" id="history_select">
<el-form-item label="统计指标" label-width="80px"> <el-form-item label="统计指标" label-width="80px">
<el-select collapse-tags collapse-tags-tooltip v-model="searchForm.index" <el-select
placeholder="请选择统计指标" multiple :multiple-limit="3"> collapse-tags
<el-option v-for="item in indexOptions" :key="item.id" :label="item.name" collapse-tags-tooltip
:value="item.id"></el-option> v-model="searchForm.index"
placeholder="请选择统计指标"
multiple
:multiple-limit="3"
>
<el-option
v-for="item in indexOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="值类型"> <el-form-item label="值类型">
@@ -114,20 +128,36 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<div v-for="(item, index) in countData" :key="index"> <div v-for="(item, index) in countData" :key="index">
<el-form-item :label="item.name + '谐波次数'" label-width="180px" <el-form-item
v-if="item.countOptions.length != 0"> :label="item.name + '谐波次数'"
label-width="180px"
v-if="item.countOptions.length != 0"
>
<!-- multiple --> <!-- multiple -->
<el-select v-model="item.count" collapse-tags collapse-tags-tooltip <el-select
placeholder="请选择谐波次数" style="width: 100px"> v-model="item.count"
<el-option v-for="vv in item.countOptions" :key="vv" :label="vv" collapse-tags
:value="vv"></el-option> collapse-tags-tooltip
placeholder="请选择谐波次数"
style="width: 100px"
>
<el-option
v-for="vv in item.countOptions"
:key="vv"
:label="vv"
:value="vv"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item label="统计类型" label-width="80px"> <el-form-item label="统计类型" label-width="80px">
<el-select v-model="searchForm.type" placeholder="请选择值类型"> <el-select v-model="searchForm.type" placeholder="请选择值类型">
<el-option v-for="item in typeOptions" :key="item.id" :label="item.name" <el-option
:value="item.id"></el-option> v-for="item in typeOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -493,9 +523,9 @@ const init = (flag: boolean) => {
list[i].seriesName + list[i].seriesName +
' ' + ' ' +
`<div style="width:16px;height:16px;float:left;background:${list[i].color};border-radius:50%;margin:0 15px"></div>` + `<div style="width:16px;height:16px;float:left;background:${list[i].color};border-radius:50%;margin:0 15px"></div>` +
`<div style='float:right;padding-left:20px;'>${list[i].value[1].toFixed( `<div style='float:right;padding-left:20px;'>${
2 list[i].value[1] == null ? '' : list[i].value[1].toFixed(2)
)} </div><br/>` } </div><br/>`
} }
return res return res
} }
@@ -506,7 +536,7 @@ const init = (flag: boolean) => {
formatter: { formatter: {
day: '{MM}-{dd}', day: '{MM}-{dd}',
month: '{MM}', month: '{MM}',
year: '{yyyy}', year: '{yyyy}'
} }
} }
}, },
@@ -586,7 +616,7 @@ const init = (flag: boolean) => {
chartsList chartsList
.map((kk: any, kks: any) => { .map((kk: any, kks: any) => {
if (kk.statisticalName == vv.name) { if (kk.statisticalName == vv.name) {
return Array.from(new Set([xAxis[kks], kk.statisticalData])) return [xAxis[kks], kk.statisticalData]
} else { } else {
return '' return ''
} }
@@ -600,7 +630,7 @@ const init = (flag: boolean) => {
}) })
}) })
//处理多y轴 //处理多y轴
if (unitList.length != 0 && unitList.length > 1) { // if (unitList.length != 0 && unitList.length > 1) {
console.log(max, min) console.log(max, min)
// echartsData.value.options.yAxis[0].yAxisIndex = 0 // echartsData.value.options.yAxis[0].yAxisIndex = 0
unitList.map((item: any, index: any) => { unitList.map((item: any, index: any) => {
@@ -641,7 +671,7 @@ const init = (flag: boolean) => {
}) })
} }
}) })
} // }
//设置数据项颜色 //设置数据项颜色
echartsData.value.options.series.map((item: any, index: any) => { echartsData.value.options.series.map((item: any, index: any) => {
item.itemStyle = { item.itemStyle = {
@@ -726,7 +756,7 @@ const handleExport = async () => {
xAxis = timeList.sort((a: any, b: any) => { xAxis = timeList.sort((a: any, b: any) => {
new Date(a).getTime() - new Date(b).getTime() new Date(a).getTime() - new Date(b).getTime()
}) })
xAxis = Array.from(new Set(xAxis)) // xAxis = Array.from(new Set(xAxis))
// 使用这个函数转换数据为CSV格式 // 使用这个函数转换数据为CSV格式
let csv: any = '' let csv: any = ''
const list = echartsData.value.options.series const list = echartsData.value.options.series
@@ -750,13 +780,12 @@ const handleExport = async () => {
count = index count = index
} }
let itemList: any = list[index].data[indexs] let itemList: any = list[index].data[indexs]
console.log(itemList); console.log(itemList)
if (itemList && itemList.length != 0) { if (itemList && itemList.length != 0) {
index == list.length - 1 ? (strs += itemList[1]) : (strs += itemList[1] + ',') index == list.length - 1 ? (strs += itemList[1]) : (strs += itemList[1] + ',')
} else { } else {
index == list.length - 1 ? strs += '/' :strs += '/,' index == list.length - 1 ? (strs += '/') : (strs += '/,')
} }
}) })
if (count == 0 && xAxis[indexs]) { if (count == 0 && xAxis[indexs]) {
csv += `${xAxis[indexs]},` + strs + '\n' csv += `${xAxis[indexs]},` + strs + '\n'