¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request" |
| | | export default { |
| | | // å·¥åºè½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyList(data) { |
| | | return request({ |
| | | url: "/processEnergy/dailyProcessEnergy/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyChart(data) { |
| | | return request({ |
| | | url: "/processEnergy/dailyProcessEnergy/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼æï¼å表 |
| | | monthlyList(data) { |
| | | return request({ |
| | | url: "/processEnergy/monthlyProcessEnergy/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼æï¼å¾è¡¨ |
| | | monthlyChart(data) { |
| | | return request({ |
| | | url: "/processEnergy/monthlyProcessEnergy/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼å¹´ï¼å表 |
| | | yearList(data) { |
| | | return request({ |
| | | url: "/processEnergy/YearProcessEnergy/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼å¹´ï¼å¾è¡¨ |
| | | yearChart(data) { |
| | | return request({ |
| | | url: "/processEnergy/YearProcessEnergy/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="chart-box"> |
| | | <div id="ChartDom" style="width: 100%; height: 100%"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import * as echarts from "echarts" |
| | | const { proxy } = getCurrentInstance() |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | const settingsStore = useSettingsStore() |
| | | const emit = defineEmits() |
| | | const props = defineProps({ |
| | | chartData: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }) |
| | | |
| | | watch( |
| | | () => props.chartData, |
| | | (val) => { |
| | | console.log("watch", val) |
| | | initChart() |
| | | } |
| | | ) |
| | | watch( |
| | | () => settingsStore.sideTheme, |
| | | (val) => { |
| | | initChart() |
| | | } |
| | | ) |
| | | |
| | | onMounted(() => { |
| | | initChart() |
| | | }) |
| | | |
| | | function initChart(value) { |
| | | const chartDom = document.getElementById("ChartDom") |
| | | if (echarts.getInstanceByDom(chartDom)) { |
| | | echarts.dispose(chartDom) |
| | | } |
| | | const myChart = echarts.init(chartDom) |
| | | let option = { |
| | | title: { |
| | | text: props.chartData.title, |
| | | left: "40", |
| | | textStyle: { |
| | | color: "#2979ff", |
| | | }, |
| | | }, |
| | | color: ["#40c2ff", "#2979ff", "#ff9900", "#fa3534"], |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | }, |
| | | legend: { |
| | | icon: "rect", |
| | | itemWidth: 14, |
| | | itemHeight: 10, |
| | | textStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | grid: { |
| | | top: "60", |
| | | left: "50", |
| | | right: "40", |
| | | bottom: "20", |
| | | containLabel: true, |
| | | }, |
| | | xAxis: { |
| | | type: "category", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [5, 0, 0, 0], |
| | | // formatter: '{value} ml' |
| | | }, |
| | | data: props.chartData.xData, |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | type: "value", |
| | | nameTextStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [0, 0, 5, 0], |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | type: "dashed", |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | }, |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: props.chartData.title, |
| | | type: "bar", |
| | | barWidth: "16", |
| | | // tooltip: { |
| | | // valueFormatter: function (value) { |
| | | // return value + "tce" |
| | | // }, |
| | | // }, |
| | | itemStyle: { |
| | | borderRadius: [15, 15, 0, 0], |
| | | }, |
| | | data: props.chartData.yData, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "Max" }, |
| | | { type: "min", name: "Min" }, |
| | | ], |
| | | }, |
| | | }, |
| | | ], |
| | | } |
| | | setTimeout(() => { |
| | | myChart.setOption(option) |
| | | }, 200) |
| | | |
| | | window.addEventListener( |
| | | "resize", |
| | | () => { |
| | | myChart.resize() |
| | | }, |
| | | { passive: true } |
| | | ) |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .chart-box { |
| | | width: 100%; |
| | | height: 400px; |
| | | border: 1px solid #eaeaea; |
| | | margin-top: 20px; |
| | | padding-top: 20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | v-model="queryParams.dataTime" |
| | | type="date" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="éæ©æ¥æ" |
| | | style="width: 100%" |
| | | :clearable="false" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 24" :key="index" :label="index - 1 + 'æ¶'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index - 1}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import processApi from "@/api/process/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | processApi |
| | | .dailyList({ |
| | | ...queryParams.value, |
| | | timeType: "HOUR", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | queryParams.value.timeType = "HOUR" |
| | | processApi.dailyChart(queryParams.value).then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¶") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month + "-" + date |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="month" |
| | | :clearable="false" |
| | | value-format="YYYY-MM" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 31" :key="index" :label="index + 'æ¥'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/monthlyComprehensive/monthlyComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import processApi from "@/api/process/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | timeType: "DAY", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | processApi |
| | | .monthlyList({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (energyList.value && energyList.value.length !== 0) { |
| | | selectChange(energyList.value[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | processApi |
| | | .monthlyChart({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¥") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month |
| | | console.log(queryParams.value.dataTime) |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "DAY", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="year" |
| | | :clearable="false" |
| | | value-format="YYYY" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 12" :key="index" :label="index + 'æ'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/yearComprehensive/yearComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import processApi from "@/api/process/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "2025-01-01", |
| | | timeType: "MONTH", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | processApi |
| | | .yearList({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | processApi |
| | | .yearChart({ |
| | | ...queryParams.value, |
| | | // dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "" |
| | | } |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "MONTH", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | |
| | | getTime() |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |