|
@@ -16,25 +16,29 @@ const tableHeight = ref(window.innerHeight - 150 + 'px')
|
|
|
/**excel 开始 */
|
|
|
const excelCheckIds = ref([])
|
|
|
const excelList = ref([])
|
|
|
+const excelCheckboxShow = ref(false)
|
|
|
/** 额定功率 */
|
|
|
const powerproduction = ref("")
|
|
|
//点击excel项时
|
|
|
const funExcelChange = async (obj) => {
|
|
|
- excelCheckIds.value = [obj.id] //当为单选展示风机图表时
|
|
|
- chartExcelList.value = excelList.value.map(o=> {
|
|
|
- return {
|
|
|
- ...o,
|
|
|
- name: o.windturbine
|
|
|
- }
|
|
|
- }) // 选中excel当前项时, excel列表赋值给dialog 下拉框
|
|
|
- queryForm.checkIds = excelList.value.map(o => o.id)
|
|
|
- checkAll.value = true
|
|
|
- funSubmit()
|
|
|
+ return false
|
|
|
+ // excelCheckIds.value = [obj.id] //当为单选展示风机图表时
|
|
|
+ // chartExcelList.value = excelList.value.map(o=> {
|
|
|
+ // return {
|
|
|
+ // ...o,
|
|
|
+ // name: o.windturbine
|
|
|
+ // }
|
|
|
+ // }) // 选中excel当前项时, excel列表赋值给dialog 下拉框
|
|
|
+ // queryForm.checkIds = excelList.value.map(o => o.id)
|
|
|
+ // checkAll.value = true
|
|
|
+ // funSubmit()
|
|
|
}
|
|
|
const funExcelCheckChange = ({ checkArr, data }) => {
|
|
|
excelCheckIds.value = checkArr
|
|
|
+ funSubmit()
|
|
|
}
|
|
|
/**tree 开始 */
|
|
|
+const treeCopRef = ref() //treeCop ref
|
|
|
const treeData = ref([])
|
|
|
const actTreeNode = ref(null)
|
|
|
const funRepeatMap = (arr) => {
|
|
@@ -62,9 +66,14 @@ const funGetTree = async () => {
|
|
|
treeData.value = funRepeatMap(res.data)
|
|
|
if(actTreeNode.value){
|
|
|
funCurrentChange({current: actTreeNode.value, currentNode: null})
|
|
|
- funExcelChange({id: actTreeNode.value.childs[0].id})
|
|
|
+ if(treeCopRef.value){
|
|
|
+ treeCopRef.value.setCheckedKeys([actTreeNode.value.id])
|
|
|
+ excelCheckIds.value = actTreeNode.value.childs.map(o => o.id)
|
|
|
+ funSubmit()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
const funTreeCheckChange = ({ current, checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) => { //tree change -> excel change
|
|
|
funCurrentChange({ current, currentNode: '' })
|
|
|
const checkIds = []
|
|
@@ -78,8 +87,11 @@ const funTreeCheckChange = ({ current, checkedNodes, checkedKeys, halfCheckedNod
|
|
|
}
|
|
|
}
|
|
|
excelCheckIds.value = checkIds
|
|
|
+ funSubmit()
|
|
|
}
|
|
|
+
|
|
|
const funCurrentChange = ({ current, currentNode }) => {
|
|
|
+ excelCheckboxShow.value = true
|
|
|
if (current.childs) {
|
|
|
excelList.value = current.childs.map(o => {
|
|
|
return {
|
|
@@ -103,6 +115,11 @@ let chartId = 1
|
|
|
const powerproductionNum = ref(0)
|
|
|
/**submit */
|
|
|
const funSubmit = async () => {
|
|
|
+ if (!excelCheckIds.value.length) {
|
|
|
+ ElMessage.error('请勾选要执行的项')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ wtData.value = []
|
|
|
const tempRes = await request.get('/wind/avg/speed', {
|
|
|
params: {
|
|
|
ids: excelCheckIds.value.join(','),
|
|
@@ -110,22 +127,16 @@ const funSubmit = async () => {
|
|
|
})
|
|
|
if (tempRes.code === 200) {
|
|
|
if (tempRes.data?.length) {
|
|
|
+ const xAxisData = [], barData1 = [], barData2 = [], lineData1 = [], lineData2 = []
|
|
|
for (const chart of tempRes.data) {
|
|
|
- chart.currentData.sort((a,b) => {
|
|
|
- return new Date(a.time).getTime() - new Date(b.time).getTime()
|
|
|
- })
|
|
|
- chart.preData.sort((a,b) => {
|
|
|
- return new Date(a.time).getTime() - new Date(b.time).getTime()
|
|
|
- })
|
|
|
- const xAxisData = [], barData1 = [], barData2 = [], lineData1 = [], lineData2 = []
|
|
|
- for(const current of chart.currentData){
|
|
|
- xAxisData.push(current.time)
|
|
|
- barData1.push(current.avgspeed)
|
|
|
- lineData1.push((current.mrxs*100).toFixed(2))
|
|
|
+ xAxisData.push(chart.wtId)
|
|
|
+ if (chart.currentData){
|
|
|
+ barData1.push(chart.currentData.avgspeed)
|
|
|
+ lineData1.push((chart.currentData.mrxs*100).toFixed(2))
|
|
|
}
|
|
|
- for(const current of chart.preData){
|
|
|
- barData2.push(current.avgspeed)
|
|
|
- lineData2.push((current.mrxs*100).toFixed(2))
|
|
|
+ if (chart.preData){
|
|
|
+ barData2.push(chart.preData.avgspeed)
|
|
|
+ lineData2.push((chart.preData.mrxs*100).toFixed(2))
|
|
|
}
|
|
|
barxAxis.data = xAxisData
|
|
|
linexAxis.data = xAxisData
|
|
@@ -142,7 +153,7 @@ const funSubmit = async () => {
|
|
|
/**lineChart */
|
|
|
const linexAxis = reactive({
|
|
|
type: 'category',
|
|
|
- name: '月',
|
|
|
+ name: '风机',
|
|
|
data: [],
|
|
|
splitLine: {
|
|
|
show: false
|
|
@@ -198,7 +209,14 @@ const lineSeries = reactive([{
|
|
|
color: '#F72C5B'
|
|
|
},
|
|
|
data: []
|
|
|
- }
|
|
|
+ },
|
|
|
+ itemStyle:{
|
|
|
+ normal:{
|
|
|
+ lineStyle:{
|
|
|
+ type:'dashed' //'dotted'点型虚线 'solid'实线 'dashed'线性虚线
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
}])
|
|
|
// 圈选散点触发函数
|
|
|
const funChartSelect = async (batch) => {
|
|
@@ -252,7 +270,7 @@ const funChartSelect = async (batch) => {
|
|
|
/**barChart */
|
|
|
const barxAxis = reactive({
|
|
|
type: 'category',
|
|
|
- name: '月',
|
|
|
+ name: '风机',
|
|
|
data: [],
|
|
|
splitLine: {
|
|
|
show: false
|
|
@@ -292,7 +310,7 @@ const barSeries = reactive([{
|
|
|
color: '#F72C5B'
|
|
|
},
|
|
|
data: []
|
|
|
- }
|
|
|
+ },
|
|
|
},{
|
|
|
name: "机舱风速(历史)",
|
|
|
type: "line",
|
|
@@ -308,7 +326,14 @@ const barSeries = reactive([{
|
|
|
color: '#F72C5B'
|
|
|
},
|
|
|
data: []
|
|
|
- }
|
|
|
+ },
|
|
|
+ itemStyle:{
|
|
|
+ normal:{
|
|
|
+ lineStyle:{
|
|
|
+ type:'dashed' //'dotted'点型虚线 'solid'实线 'dashed'线性虚线
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
}])
|
|
|
/**dialog 数据 */
|
|
|
const wtDialog = ref(false)
|
|
@@ -527,29 +552,29 @@ onActivated(() => {
|
|
|
<div class="text-[14px] absolute top-[-7px] text-[#838383] left-[20px]">数据展示</div>
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="5">
|
|
|
- <tree-cop :data="treeData" @checkChange="funTreeCheckChange" :show-checkbox="false" :height="treeHeight"
|
|
|
+ <tree-cop ref="treeCopRef" :data="treeData" @checkChange="funTreeCheckChange" :show-checkbox="true" :height="treeHeight"
|
|
|
@currentChange="funCurrentChange" @refresh="funGetTree">
|
|
|
</tree-cop>
|
|
|
</el-col>
|
|
|
<el-col :span="3">
|
|
|
- <excel-cop :checkIds="excelCheckIds" :showCheckbox="false" :data="excelList" :height="excelHeight"
|
|
|
+ <excel-cop :checkIds="excelCheckIds" :showCheckbox="excelCheckboxShow" :data="excelList" :height="excelHeight"
|
|
|
@excelChange="funExcelChange" @checkChange="funExcelCheckChange"></excel-cop>
|
|
|
</el-col>
|
|
|
<el-col :span="16">
|
|
|
<div :style="{ height: tableHeight }"
|
|
|
class="flex flex-wrap justify-center items-center overflow-x-hidden overflow-y-auto ">
|
|
|
<div class="mb-[10px] w-[100%] h-[49%] flex flex-col items-end shadow rounded-[6px] shadow-blue-500">
|
|
|
- <el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
|
|
|
+ <!-- <el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
|
|
|
@click="funActCop({xAxis:barxAxis, yAxis:baryAxis, series: barSeries}, 'barChartCop')">
|
|
|
<ZoomIn />
|
|
|
- </el-icon>
|
|
|
+ </el-icon> -->
|
|
|
<bar-chart-cop width="100%" height="100%" :subtext="`月平均风速`" :xAxis="barxAxis" :yAxis="baryAxis" :series="barSeries"></bar-chart-cop>
|
|
|
</div>
|
|
|
<div class="w-[100%] h-[49%] flex flex-col items-end shadow rounded-[6px] shadow-blue-500">
|
|
|
- <el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
|
|
|
+ <!-- <el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
|
|
|
@click="funActCop({xAxis:linexAxis, yAxis:lineyAxis, series: lineSeries}, 'lineChartCop')">
|
|
|
<ZoomIn />
|
|
|
- </el-icon>
|
|
|
+ </el-icon> -->
|
|
|
<bar-chart-cop width="100%" height="100%" :subtext="`毛容量系数`" :xAxis="linexAxis" :yAxis="lineyAxis" :series="lineSeries"></bar-chart-cop>
|
|
|
</div>
|
|
|
</div>
|