|
@@ -6,6 +6,7 @@ import tableCop from './components/table.vue'
|
|
|
import { ref, nextTick, onActivated } from 'vue'
|
|
|
import request from '@/api/axios.js'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
+import util from "@tools/util";
|
|
|
import CurrentScatterChart from './components/current-scatter-chart.vue'
|
|
|
/**配置参数 */
|
|
|
const treeHeight = '40vh' //tree高度
|
|
@@ -18,6 +19,7 @@ const excelCheckIds = ref<string[]>([])
|
|
|
const excelList = ref<{ id: string, name: string }[]>([])
|
|
|
const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
activeTab.value = '1'
|
|
|
+ isChartArea.value = false
|
|
|
tableShowId.value = obj.id
|
|
|
tableName.value = obj.name
|
|
|
excelType.value = obj.type // 接收excel的type 用于控制右侧tab展示
|
|
@@ -85,7 +87,7 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
showEffectOn: "emphasis",
|
|
|
name: '无用点',
|
|
|
symbolSize: (data) => {
|
|
|
- return data.s? data.s>10 ? 10 : data.s : 4
|
|
|
+ return data.s ? data.s > 10 ? 10 : data.s : 4
|
|
|
},
|
|
|
datasetIndex: 0,
|
|
|
encode: {
|
|
@@ -101,7 +103,7 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
showEffectOn: "emphasis",
|
|
|
name: '有用点',
|
|
|
symbolSize: (data) => {
|
|
|
- return data.s? data.s>10 ? 10 : data.s : 4
|
|
|
+ return data.s ? data.s > 10 ? 10 : data.s : 4
|
|
|
},
|
|
|
datasetIndex: 1,
|
|
|
animation: false,
|
|
@@ -123,7 +125,6 @@ const funExcelChange = async (obj: any) => { //点击excel项时
|
|
|
yAxisIndex: 1,
|
|
|
},
|
|
|
]
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
const funExcelCheckChange = ({ checkArr, data }) => { //bug
|
|
@@ -234,11 +235,21 @@ const funSubmit = async (query) => {
|
|
|
if (res.code === 200) {
|
|
|
ElMessage.success(res.msg)
|
|
|
funGetProcessTree()
|
|
|
+ const excelInfo = res.data
|
|
|
+
|
|
|
+ /**拟合完成后 显示右侧图表及数据 */
|
|
|
+ funExcelChange({
|
|
|
+ id: excelInfo.id,
|
|
|
+ name: excelInfo.path.substring(excelInfo.path.indexOf(excelInfo.station + '_') + (excelInfo.station + '_').length),
|
|
|
+ type: 'fitting'
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
/**chart Data */
|
|
|
const xAxisData = ref([])
|
|
|
-const seriesData = ref([])
|
|
|
+const chartRef = ref() //chart 的ref
|
|
|
+const seriesData = ref<any>([])
|
|
|
+const isChartArea = ref(false) // 用来控制图表是否区域划分
|
|
|
const dataSet = ref('')
|
|
|
const funChartSelect = async (batch) => {
|
|
|
const wDataArr = []
|
|
@@ -262,39 +273,138 @@ const funChartSelect = async (batch) => {
|
|
|
yDataArr.push(dataSetObj[1].source[scatterIndex].k)
|
|
|
}
|
|
|
}
|
|
|
- const wtRes = await request.get('/power/fitting/filter', {params: {yk: yDataArr.join(','), wk: wDataArr.join(',')}})
|
|
|
- if(wtRes.code === 200){
|
|
|
+ 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 = []
|
|
|
+ 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, filter: data.filter === 0? '是': '否'})
|
|
|
- id++
|
|
|
- }else{
|
|
|
- tempArr.push({...data, id: id, filter: data.filter === 0? '是': '否'})
|
|
|
+ } else {
|
|
|
+ tempArr.push({ ...data, id: id, filter: data.filter === 0 ? '是' : '否' })
|
|
|
id++
|
|
|
}
|
|
|
- }else{
|
|
|
- tempArr.push({...data, id: id, filter: data.filter === 0? '是': '否'})
|
|
|
- id++
|
|
|
}
|
|
|
- }
|
|
|
- wtDialog.value = true
|
|
|
- nextTick(() => {
|
|
|
- wtTab.value = 'table'
|
|
|
- wtData.value = tempArr
|
|
|
- })
|
|
|
+ wtDialog.value = true
|
|
|
+ nextTick(() => {
|
|
|
+ wtTab.value = 'table'
|
|
|
+ wtData.value = tempArr
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+const funChartArea = () => {
|
|
|
+ if (seriesData.value?.length) {
|
|
|
+ if (!isChartArea.value) {
|
|
|
+ seriesData.value[0] = {
|
|
|
+ ...seriesData.value[0],
|
|
|
+ markLine: {
|
|
|
+ symbol: 'none',
|
|
|
+ label: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ lineStyle: {
|
|
|
+ color: 'rgba(96,174,255, 1)'
|
|
|
+ },
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ xAxis: 3,
|
|
|
+ valueIndex: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xAxis: 5,
|
|
|
+ valueIndex: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xAxis: 10,
|
|
|
+ valueIndex: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xAxis: 12,
|
|
|
+ valueIndex: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xAxis: 25,
|
|
|
+ valueIndex: 0
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ markArea: {
|
|
|
+ label: {
|
|
|
+ fontSize: util.vh(12),
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ color: 'rgba(236,245,255, 0)'
|
|
|
+ },
|
|
|
+ emphasis: {
|
|
|
+ itemStyle: {
|
|
|
+ color: 'rgba(96,174,255, 0.5)'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ name: '3~5m/s',
|
|
|
+ xAxis: 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xAxis: 5,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {
|
|
|
+ name: '5~10m/s',
|
|
|
+ xAxis: 5,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xAxis: 10,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {
|
|
|
+ name: '10~12m/s',
|
|
|
+ xAxis: 10,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xAxis: 12,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {
|
|
|
+ name: '12~25m/s',
|
|
|
+ xAxis: 12,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xAxis: 25,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ isChartArea.value = true
|
|
|
+ } else {
|
|
|
+ seriesData.value[0] = {
|
|
|
+ ...seriesData.value[0],
|
|
|
+ markLine: null,
|
|
|
+ markArea: null
|
|
|
+ }
|
|
|
+ isChartArea.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
/**dialog 数据 */
|
|
|
const wtDialog = ref(false)
|
|
|
const wtData = ref([])
|
|
@@ -348,6 +458,8 @@ onActivated(() => {
|
|
|
</el-col>
|
|
|
<el-col :span="16">
|
|
|
<div class="px-[10px] shadow rounded-[6px] shadow-blue-500">
|
|
|
+ <el-button class="absolute right-[16px] top-[4px] z-10" type="primary"
|
|
|
+ v-if="activeTab === '2' && excelType === 'fitting'" @click="funChartArea">区域划分</el-button>
|
|
|
<el-tabs v-model="activeTab">
|
|
|
<el-tab-pane label="表格数据" name="1">
|
|
|
</el-tab-pane>
|
|
@@ -357,9 +469,9 @@ onActivated(() => {
|
|
|
:height="tableHeight" :tableId="tableShowId" :tableName="tableName"></table-cop>
|
|
|
<div v-show="activeTab === '2'"
|
|
|
:style="{ height: typeof tableHeight === 'string' ? tableHeight : tableHeight + 'px' }" class="p-[10px]">
|
|
|
- <CurrentScatterChart width="100%" height="100%" chartTitle="风速功率曲线图" :xAxisData="xAxisData"
|
|
|
+ <CurrentScatterChart ref="chartRef" width="100%" height="100%" chartTitle="风速功率曲线图" :xAxisData="xAxisData"
|
|
|
:yAxisData="{ splitLine: { show: false } }" :seriesData="seriesData" :showLegend="true"
|
|
|
- :brushSelected="true" :dataSet="dataSet" @getSelected="funChartSelect" />
|
|
|
+ :brushSelected="!isChartArea" :dataSet="dataSet" @getSelected="funChartSelect" />
|
|
|
</div>
|
|
|
</el-tabs>
|
|
|
</div>
|