From e9257841908bfa9dc4647998870d483fd099b0ef Mon Sep 17 00:00:00 2001 From: wj <347312259@qq.com> Date: Tue, 23 May 2023 16:31:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=BD=E8=80=97=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- psdc-ui/src/views/analyse/nhfx/index.vue | 65 +++++++++++++++++------- psdc-ui/src/views/analyse/nhtj/index.vue | 22 ++++---- 2 files changed, 59 insertions(+), 28 deletions(-) diff --git a/psdc-ui/src/views/analyse/nhfx/index.vue b/psdc-ui/src/views/analyse/nhfx/index.vue index 69ca40c..bcf0e43 100644 --- a/psdc-ui/src/views/analyse/nhfx/index.vue +++ b/psdc-ui/src/views/analyse/nhfx/index.vue @@ -3,9 +3,15 @@ - - 上一日 - 下一日 + + + + + + + + 上一年 + 下一年 查询
@@ -70,10 +76,11 @@ @current-change="hbfxHandleCurrentChange"/>
- +
+ 关闭
@@ -85,11 +92,13 @@ import {Histogram} from '@element-plus/icons-vue' import {ref,reactive,onMounted,nextTick } from "vue"; import { getHuanbiFx } from "@/api/analyse/nhfx/nhfx" +import { getDevice } from "@/api/control/manual" onMounted(async () => { await nextTick(); // 在这里进行el-tabs的初始化操作 formattedDateFun() + getDeviceList() }) /** 格式化日期*/ @@ -99,13 +108,12 @@ function formattedDateFun(){ year = date.getFullYear() month = (date.getMonth()+1).toString().padStart(2, '0'); day = date.getDate().toString().padStart(2, '0'); + dateValue2.value = `${year}-${month}-${day}` // let hours = date.getHours() // let minutes = date.getMinutes() // let seconds = date.getSeconds() - dateValue1.value = `${year}-${month}-${day}` - dateValue2.value = `${year}-${month}-${day}` // timer.value = `${hours}:${minutes}:${seconds}` - console.log(dateValue2.value) + // console.log(dateValue2.value) // console.log(timer.value) } @@ -114,17 +122,31 @@ const activeName = ref('同比分析') /** ----------同比分析----------*/ /** 过滤查询*/ -const dateValue1 = ref(new Date()) -function lastDay(){ - const current = dateValue1.value; - const previous = new Date(current.getFullYear(), current.getMonth(), current.getDate() - 1); - dateValue1.value = previous; +//渲染设备列表 +const selectDevice = ref() +const deviceName = ref([]) +function getDeviceList(){ + getDevice().then((res)=>{ + deviceName.value = res.data + console.log(deviceName.value) + }) } -function nextDay(){ - const current = dateValue1.value; - const next = new Date(current.getFullYear(), current.getMonth(), current.getDate() + 1); - dateValue1.value = next; + +//切换年份处理 +const dateValue1 = ref(new Date().getFullYear().toString()); +//上一年 +function lastYear(){ + const year = parseInt(dateValue1.value); + dateValue1.value = (year - 1).toString(); + console.log('上一年',dateValue1.value) +} +//下一年 +function nextYear(){ + const year = parseInt(dateValue1.value); + dateValue1.value = (year + 1).toString(); + console.log('下一年',dateValue1.value) } +//查询 function handleQuery1(){} /** 数据表格处理*/ @@ -238,8 +260,13 @@ const title = ref() const open = ref(false) function handleChart(){ open.value = true; - console.log('图表按钮') + + }; +//关闭弹框按钮 +function close(){ + open.value = false; +} @@ -300,7 +327,9 @@ function handleChart(){ background-color: #409EFF !important; color: #fff !important; } - +.floatRight{ + margin-left: 90%; +} ::v-deep .el-tabs__item{ diff --git a/psdc-ui/src/views/analyse/nhtj/index.vue b/psdc-ui/src/views/analyse/nhtj/index.vue index 55b11c7..fadfe1f 100644 --- a/psdc-ui/src/views/analyse/nhtj/index.vue +++ b/psdc-ui/src/views/analyse/nhtj/index.vue @@ -11,19 +11,11 @@ - - - - - - - + - + 搜索 @@ -81,12 +73,14 @@ import {Delete,Histogram} from '@element-plus/icons-vue' import {ref, reactive, onMounted, watch,onBeforeUnmount} from "vue"; import {getTable} from '@/api/analyse/nhtj/nhtj' +import { getDevice } from "@/api/control/manual" import * as echarts from "echarts"; /** 页面加载时*/ onMounted(()=>{ formattedDateFun(); getTableFun(); + getDeviceList() }) @@ -109,6 +103,14 @@ function formattedDateFun(){ /** 筛选处理 */ +//渲染设备列表 +const deviceName = ref([]) +function getDeviceList(){ + getDevice().then((res)=>{ + deviceName.value = res.data + }) +} + const dateRange = ref([]); const startDate = ref() const endDate = ref()