|
@@ -33,11 +33,11 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
let chartResponse = null
|
|
|
tableLoading.value = true
|
|
|
if (obj.type === 'process') {
|
|
|
- res = await request.get('/power/process/show', {params: { id: obj.id }})
|
|
|
+ res = await request.get('/power/process/show', { params: { id: obj.id } })
|
|
|
} 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 }})
|
|
|
+ res = await request.get('/power/fitting/show', { params: { id: obj.id } })
|
|
|
+ chartResponse = await request.get('/power/fitting/curve', { params: { id: obj.id } })
|
|
|
}
|
|
|
tableColumn.value = res.data.title.map(o => {
|
|
|
return {
|
|
@@ -51,9 +51,16 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
|
|
|
if (chartResponse) {
|
|
|
chartRes = chartResponse.data
|
|
|
+ dataSet.value = JSON.stringify([
|
|
|
+ {
|
|
|
+ source: chartRes.scatterls
|
|
|
+ },
|
|
|
+ {
|
|
|
+ source: chartRes.scatterhs
|
|
|
+ }
|
|
|
+ ])
|
|
|
seriesData.value = [
|
|
|
{
|
|
|
- id: 1,
|
|
|
name: "实际功率",
|
|
|
type: "line",
|
|
|
symbol: "line", //设定为实心点
|
|
@@ -62,16 +69,15 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
data: chartRes.sjgl,
|
|
|
itemStyle: {
|
|
|
normal: {
|
|
|
- color: "#05bb4c",
|
|
|
+ color: "rgb(158,138,103)",
|
|
|
lineStyle: {
|
|
|
- color: "#05bb4c",
|
|
|
+ color: "rgb(158,138,103)",
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
xAxisIndex: 0,
|
|
|
},
|
|
|
{
|
|
|
- id: 2,
|
|
|
name: "保证功率",
|
|
|
type: "line",
|
|
|
symbol: "line", //设定为实心点
|
|
@@ -89,21 +95,22 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
xAxisIndex: 0,
|
|
|
},
|
|
|
{
|
|
|
- id: 3,
|
|
|
- type: 'scatter',
|
|
|
+ type: 'effectScatter',
|
|
|
+ showEffectOn: "emphasis",
|
|
|
name: '无用点',
|
|
|
- data: chartRes.scatterls,
|
|
|
- // dimensions: ['x', 'y'],
|
|
|
- symbolSize: 5,
|
|
|
- encode:{
|
|
|
- x: [0],
|
|
|
- y: [1]
|
|
|
+ // data: chartRes.scatterls,
|
|
|
+ symbolSize: 5,
|
|
|
+ datasetIndex: 0,
|
|
|
+ encode: {
|
|
|
+ x: 's',
|
|
|
+ y: 'p'
|
|
|
},
|
|
|
- large: true,
|
|
|
- largeThreshold: 500,
|
|
|
+ animation: false,
|
|
|
+ // large: true,
|
|
|
+ // largeThreshold: 500,
|
|
|
xAxisIndex: 0,
|
|
|
yAxisIndex: 0,
|
|
|
- },
|
|
|
+ },
|
|
|
// {
|
|
|
// name: "无用点",
|
|
|
// type: "effectScatter",
|
|
@@ -114,21 +121,30 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
// yAxisIndex: 0,
|
|
|
// },
|
|
|
{
|
|
|
- id: 4,
|
|
|
- type: 'scatter',
|
|
|
+ type: 'effectScatter',
|
|
|
+ showEffectOn: "emphasis",
|
|
|
name: '有用点',
|
|
|
- data: chartRes.scatterhs,
|
|
|
- // dimensions: ['x', 'y'],
|
|
|
- symbolSize: 5,
|
|
|
- encode:{
|
|
|
- x: [0],
|
|
|
- y: [1]
|
|
|
+ // data: chartRes.scatterhs,
|
|
|
+ symbolSize: 5,
|
|
|
+ datasetIndex: 1,
|
|
|
+ animation: false,
|
|
|
+ encode: {
|
|
|
+ x: 's',
|
|
|
+ y: 'p'
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ normal: {
|
|
|
+ color: "#05bb4c",
|
|
|
+ lineStyle: {
|
|
|
+ color: "#05bb4c",
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
- large: true,
|
|
|
- largeThreshold: 500,
|
|
|
+ // large: true,
|
|
|
+ // largeThreshold: 500,
|
|
|
xAxisIndex: 0,
|
|
|
yAxisIndex: 0,
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
// {
|
|
|
// name: "有用点",
|
|
@@ -201,7 +217,7 @@ const funCurrentChange = ({ current, currentNode }) => {
|
|
|
time: o.time,
|
|
|
type: o.type,
|
|
|
windturbine: o.windturbine,
|
|
|
- name: o.path.substring(o.path.indexOf(o.station + '_') + (o.station+'_').length)
|
|
|
+ name: o.path.substring(o.path.indexOf(o.station + '_') + (o.station + '_').length)
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
@@ -241,7 +257,7 @@ const funProcessCurrentChange = ({ current, currentNode }) => {
|
|
|
time: o.time,
|
|
|
type: o.type,
|
|
|
windturbine: o.windturbine,
|
|
|
- name: o.path.substring(o.path.indexOf(o.station + '_') + (o.station+'_').length)
|
|
|
+ name: o.path.substring(o.path.indexOf(o.station + '_') + (o.station + '_').length)
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
@@ -266,7 +282,7 @@ const funSubmit = async (query) => {
|
|
|
...query,
|
|
|
ids: excelCheckIds.value.join(',')
|
|
|
}
|
|
|
- const res = await request.get('/power/fitting/data', {params: params})
|
|
|
+ const res = await request.get('/power/fitting/data', { params: params })
|
|
|
if (res.code === 200) {
|
|
|
ElMessage.success(res.msg)
|
|
|
funGetProcessTree()
|
|
@@ -275,9 +291,60 @@ const funSubmit = async (query) => {
|
|
|
/**chart Data */
|
|
|
const xAxisData = ref([])
|
|
|
const seriesData = ref([])
|
|
|
-const funChartSelect = (selected) => {
|
|
|
- console.log(selected)
|
|
|
+const dataSet = ref('')
|
|
|
+const funChartSelect = (batch) => {
|
|
|
+ wtTab.value = 'table'
|
|
|
+ console.log(batch)
|
|
|
+ const dataArr = []
|
|
|
+ const tempArr = [] //用于以风机id 聚合dataArr
|
|
|
+ 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
|
|
|
+ if (scatterls?.length || scatterhs?.length) {
|
|
|
+ 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: '风机'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (scatterhs?.length) {
|
|
|
+ for (const scatterIndex of scatterhs) {
|
|
|
+ dataArr.push({...dataSetObj[1].source[scatterIndex], u: '是'})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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 = []
|
|
|
+ }
|
|
|
+ tempArr[findIndex].children.push({...data, id: id})
|
|
|
+ id++
|
|
|
+ }else{
|
|
|
+ tempArr.push({...data, id: id})
|
|
|
+ id++
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ tempArr.push({...data, id: id})
|
|
|
+ id++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wtData.value = tempArr
|
|
|
+ wtDialog.value = true
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+/**dialog 数据 */
|
|
|
+const wtDialog = ref(false)
|
|
|
+const wtData = ref([])
|
|
|
+const wtTab = ref('table')
|
|
|
/**tab */
|
|
|
const activeTab = ref('1')
|
|
|
/**created */
|
|
@@ -287,7 +354,25 @@ funGetProcessTree()
|
|
|
<template>
|
|
|
<div class="bg-white pb-[10px]">
|
|
|
<search-cop @submit="funSubmit"></search-cop>
|
|
|
- <el-row :gutter="20">
|
|
|
+ <el-dialog v-model="wtDialog" title="风机功率点位">
|
|
|
+ <el-tabs v-model="wtTab">
|
|
|
+ <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>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="故障" name="problem" disabled>
|
|
|
+
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="预警" name="warning" disabled>
|
|
|
+
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-dialog>
|
|
|
+ <el-row :gutter="10">
|
|
|
<el-col :span="5">
|
|
|
<tree-cop :data="treeData" @checkChange="funTreeCheckChange" :show-checkbox="true" :height="treeHeight"
|
|
|
@currentChange="funCurrentChange" @refresh="funGetTree"></tree-cop>
|
|
@@ -309,10 +394,11 @@ funGetProcessTree()
|
|
|
</el-tab-pane>
|
|
|
<table-cop v-show="activeTab === '1'" :data="tableData" :loading="tableLoading" :column="tableColumn"
|
|
|
:height="tableHeight" :tableId="tableShowId" :tableName="tableName"></table-cop>
|
|
|
- <div v-show="activeTab === '2'" :style="{ height: typeof tableHeight === 'string' ? tableHeight: tableHeight + 'px' }" class="p-[10px]">
|
|
|
+ <div v-show="activeTab === '2'"
|
|
|
+ :style="{ height: typeof tableHeight === 'string' ? tableHeight : tableHeight + 'px' }" class="p-[10px]">
|
|
|
<CurrentScatterChart width="100%" height="100%" chartTitle="风速功率曲线图" :xAxisData="xAxisData"
|
|
|
:yAxisData="{ splitLine: { show: false } }" :seriesData="seriesData" :showLegend="true"
|
|
|
- :brushSelected="true" @getSelected="funChartSelect" />
|
|
|
+ :brushSelected="true" :dataSet="dataSet" @getSelected="funChartSelect" />
|
|
|
</div>
|
|
|
</el-tabs>
|
|
|
</div>
|