|
@@ -3,7 +3,7 @@ import searchCop from './components/search.vue'
|
|
|
import excelCop from '@/components/excel.vue'
|
|
|
import treeCop from '@/components/tree.vue'
|
|
|
import tableCop from './components/table.vue'
|
|
|
-import { ref } from 'vue'
|
|
|
+import { ref, nextTick, onActivated } from 'vue'
|
|
|
import request from '@/api/axios.js'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import CurrentScatterChart from './components/current-scatter-chart.vue'
|
|
@@ -37,7 +37,7 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
} else if (obj.type === 'fitting') {
|
|
|
activeTab.value = '2'
|
|
|
res = await request.get('/power/fitting/show', { params: { id: obj.id } })
|
|
|
- chartResponse = await request.get('/power/fitting/curve', { params: { id: obj.id } })
|
|
|
+ chartResponse = await request.get('/power/fitting/curve', { params: { id: obj.id, p: 1 } })
|
|
|
}
|
|
|
tableColumn.value = res.data.title.map(o => {
|
|
|
return {
|
|
@@ -53,13 +53,15 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
chartRes = chartResponse.data
|
|
|
dataSet.value = JSON.stringify([
|
|
|
{
|
|
|
- source: chartRes.scatterls
|
|
|
+ source: chartRes.wyd
|
|
|
+ // source: chartRes.scatterls
|
|
|
},
|
|
|
{
|
|
|
- source: chartRes.scatterhs
|
|
|
+ source: chartRes.yyd
|
|
|
+ // source: chartRes.scatterhs
|
|
|
}
|
|
|
])
|
|
|
- seriesData.value = [
|
|
|
+ seriesData.value = <any>[
|
|
|
{
|
|
|
name: "实际功率",
|
|
|
type: "line",
|
|
@@ -67,14 +69,6 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
symbolSize: 0, //设定实心点的大小
|
|
|
smooth: true, //这个是把线变成曲线
|
|
|
data: chartRes.sjgl,
|
|
|
- itemStyle: {
|
|
|
- normal: {
|
|
|
- color: "rgb(158,138,103)",
|
|
|
- lineStyle: {
|
|
|
- color: "rgb(158,138,103)",
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
xAxisIndex: 0,
|
|
|
},
|
|
|
{
|
|
@@ -84,78 +78,40 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
symbolSize: 0, //设定实心点的大小
|
|
|
smooth: true, //这个是把线变成曲线
|
|
|
data: chartRes.llgl,
|
|
|
- itemStyle: {
|
|
|
- normal: {
|
|
|
- color: "red",
|
|
|
- lineStyle: {
|
|
|
- color: "red",
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
xAxisIndex: 0,
|
|
|
},
|
|
|
{
|
|
|
type: 'effectScatter',
|
|
|
showEffectOn: "emphasis",
|
|
|
name: '无用点',
|
|
|
- // data: chartRes.scatterls,
|
|
|
- symbolSize: 5,
|
|
|
+ symbolSize: (data) => {
|
|
|
+ return data.s? data.s>10 ? 10 : data.s : 4
|
|
|
+ },
|
|
|
datasetIndex: 0,
|
|
|
encode: {
|
|
|
- x: 's',
|
|
|
- y: 'p'
|
|
|
+ x: 'x',
|
|
|
+ y: 'y'
|
|
|
},
|
|
|
animation: false,
|
|
|
- // large: true,
|
|
|
- // largeThreshold: 500,
|
|
|
xAxisIndex: 0,
|
|
|
yAxisIndex: 0,
|
|
|
},
|
|
|
- // {
|
|
|
- // name: "无用点",
|
|
|
- // type: "effectScatter",
|
|
|
- // showEffectOn: "emphasis",
|
|
|
- // symbolSize: 5,
|
|
|
- // data: chartRes.scatterls,
|
|
|
- // xAxisIndex: 0,
|
|
|
- // yAxisIndex: 0,
|
|
|
- // },
|
|
|
{
|
|
|
type: 'effectScatter',
|
|
|
showEffectOn: "emphasis",
|
|
|
name: '有用点',
|
|
|
- // data: chartRes.scatterhs,
|
|
|
- symbolSize: 5,
|
|
|
+ symbolSize: (data) => {
|
|
|
+ return data.s? data.s>10 ? 10 : data.s : 4
|
|
|
+ },
|
|
|
datasetIndex: 1,
|
|
|
animation: false,
|
|
|
encode: {
|
|
|
- x: 's',
|
|
|
- y: 'p'
|
|
|
- },
|
|
|
- itemStyle: {
|
|
|
- normal: {
|
|
|
- color: "#05bb4c",
|
|
|
- lineStyle: {
|
|
|
- color: "#05bb4c",
|
|
|
- },
|
|
|
- },
|
|
|
+ x: 'x',
|
|
|
+ y: 'y'
|
|
|
},
|
|
|
- // large: true,
|
|
|
- // largeThreshold: 500,
|
|
|
xAxisIndex: 0,
|
|
|
yAxisIndex: 0,
|
|
|
},
|
|
|
-
|
|
|
- // {
|
|
|
- // name: "有用点",
|
|
|
- // type: "effectScatter",
|
|
|
- // showEffectOn: "emphasis",
|
|
|
- // symbolSize: 5,
|
|
|
- // data: chartRes.scatterhs,
|
|
|
- // animationThreshold: 500,
|
|
|
- // xAxisIndex: 0,
|
|
|
- // yAxisIndex: 0,
|
|
|
- // },
|
|
|
{
|
|
|
name: "Cp值",
|
|
|
type: "line",
|
|
@@ -163,14 +119,6 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
symbolSize: 0, //设定实心点的大小
|
|
|
smooth: true, //这个是把线变成曲线
|
|
|
data: chartRes.cpz,
|
|
|
- itemStyle: {
|
|
|
- normal: {
|
|
|
- color: "#f8de5b",
|
|
|
- lineStyle: {
|
|
|
- color: "#f8de5b",
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
xAxisIndex: 0,
|
|
|
yAxisIndex: 1,
|
|
|
},
|
|
@@ -292,17 +240,13 @@ const funSubmit = async (query) => {
|
|
|
const xAxisData = ref([])
|
|
|
const seriesData = ref([])
|
|
|
const dataSet = ref('')
|
|
|
-const funChartSelect = (batch) => {
|
|
|
- wtTab.value = 'table'
|
|
|
- console.log(batch)
|
|
|
- const dataArr = []
|
|
|
- const tempArr = [] //用于以风机id 聚合dataArr
|
|
|
+const funChartSelect = async (batch) => {
|
|
|
+ const wDataArr = []
|
|
|
+ const yDataArr = []
|
|
|
let scatterls = []
|
|
|
let scatterhs = []
|
|
|
let dataSetObj = []
|
|
|
- let id = 1
|
|
|
wtData.value = []
|
|
|
- wtDialog.value = false
|
|
|
if (batch?.length && dataSet.value) {
|
|
|
scatterls = batch[0].selected[2].dataIndex
|
|
|
scatterhs = batch[0].selected[3].dataIndex
|
|
@@ -310,34 +254,44 @@ const funChartSelect = (batch) => {
|
|
|
dataSetObj = JSON.parse(dataSet.value)
|
|
|
if (scatterls?.length) {
|
|
|
for (const scatterIndex of scatterls) {
|
|
|
- dataArr.push({...dataSetObj[0].source[scatterIndex], u: '否'}) // s p w u w: '风机'
|
|
|
+ wDataArr.push(dataSetObj[0].source[scatterIndex].k)
|
|
|
}
|
|
|
}
|
|
|
if (scatterhs?.length) {
|
|
|
for (const scatterIndex of scatterhs) {
|
|
|
- dataArr.push({...dataSetObj[1].source[scatterIndex], u: '是'})
|
|
|
+ yDataArr.push(dataSetObj[1].source[scatterIndex].k)
|
|
|
}
|
|
|
}
|
|
|
- for(const data of dataArr){
|
|
|
- if(tempArr.length){
|
|
|
- const findIndex = tempArr.findIndex(o => o.w === data.w)
|
|
|
- if(findIndex !== -1){
|
|
|
- if(!tempArr[findIndex].children){
|
|
|
- tempArr[findIndex].children = []
|
|
|
+ const wtRes = await request.get('/power/fitting/filter', {params: {yk: yDataArr.join(','), wk: wDataArr.join(',')}})
|
|
|
+ if(wtRes.code === 200){
|
|
|
+ let id = 1
|
|
|
+ const tempArr = [] //用于以风机id 聚合dataArr
|
|
|
+ if(wtRes.data?.length){
|
|
|
+ for(const data of wtRes.data){
|
|
|
+ if(tempArr.length){
|
|
|
+ const findIndex = tempArr.findIndex(o => o.wtId === data.wtId)
|
|
|
+ if(findIndex !== -1){
|
|
|
+ if(!tempArr[findIndex].children){
|
|
|
+ tempArr[findIndex].children = []
|
|
|
+ }
|
|
|
+ tempArr[findIndex].children.push({...data, id: id, filter: data.filter === 0? '是': '否'})
|
|
|
+ id++
|
|
|
+ }else{
|
|
|
+ tempArr.push({...data, id: id, filter: data.filter === 0? '是': '否'})
|
|
|
+ id++
|
|
|
}
|
|
|
- tempArr[findIndex].children.push({...data, id: id})
|
|
|
- id++
|
|
|
}else{
|
|
|
- tempArr.push({...data, id: id})
|
|
|
+ tempArr.push({...data, id: id, filter: data.filter === 0? '是': '否'})
|
|
|
id++
|
|
|
}
|
|
|
- }else{
|
|
|
- tempArr.push({...data, id: id})
|
|
|
- id++
|
|
|
+ }
|
|
|
+ wtDialog.value = true
|
|
|
+ nextTick(() => {
|
|
|
+ wtTab.value = 'table'
|
|
|
+ wtData.value = tempArr
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- wtData.value = tempArr
|
|
|
- wtDialog.value = true
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -350,18 +304,25 @@ const activeTab = ref('1')
|
|
|
/**created */
|
|
|
funGetTree()
|
|
|
funGetProcessTree()
|
|
|
+/**activated */
|
|
|
+onActivated(() => {
|
|
|
+ funGetTree()
|
|
|
+ funGetProcessTree()
|
|
|
+})
|
|
|
</script>
|
|
|
<template>
|
|
|
<div class="bg-white pb-[10px]">
|
|
|
<search-cop @submit="funSubmit"></search-cop>
|
|
|
<el-dialog v-model="wtDialog" title="风机功率点位">
|
|
|
<el-tabs v-model="wtTab">
|
|
|
- <el-tab-pane label="表格数据" name="table">
|
|
|
+ <el-tab-pane label="数据" name="table">
|
|
|
<el-table :data="wtData" row-key="id" :max-height="550">
|
|
|
- <el-table-column property="w" align="center" label="风机" />
|
|
|
- <el-table-column property="s" sortable align="center" label="风速(m/s)" />
|
|
|
- <el-table-column property="p" sortable align="center" label="功率(kw)" />
|
|
|
- <el-table-column property="u" sortable align="center" label="是否有用点" />
|
|
|
+ <el-table-column property="wtId" align="center" label="风机" />
|
|
|
+ <el-table-column property="time" sortable :width="160" align="center" label="时间" />
|
|
|
+ <el-table-column property="speed" sortable align="center" label="风速(m/s)" />
|
|
|
+ <el-table-column property="power" sortable align="center" label="功率(kw)" />
|
|
|
+ <el-table-column property="rr" sortable align="center" label="转速" />
|
|
|
+ <el-table-column property="filter" sortable align="center" label="是否有用点" />
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="故障" name="problem" disabled>
|