Commit 9e641212 authored by 张伯涛's avatar 张伯涛

年度参数查询接口替换

parent ade3a35f
......@@ -85,8 +85,8 @@ export const deleteWeatherMagData = params => { // 删除气象干预数据
return http.post("/api/cusweather/Delete",params)
}
export const getAnnualParam = () => { // 获取年度参数列表
return http.post('/api/Scheduling/BizHeatSet/Get')
export const getAnnualParam = params => { // 获取年度参数列表
return http.post('/api/Scheduling/BizHeatSet/GetListByYear', params)
}
......
<script setup>
<script lang="ts" setup>
import {computed, onBeforeMount, onMounted, reactive, ref, watchEffect} from "vue";
import {
getAnnualParam,
......@@ -10,7 +10,7 @@ import {
import {ElMessage, ElMessageBox} from "element-plus";
import {vFloatNumber} from "@/utils/directives.js";
const data = ref()
const data = ref([])
const dataBackup = ref([])
const elTableRef = ref()
const tableHeaderClass = data => { // 表头样式
......@@ -19,7 +19,7 @@ const tableHeaderClass = data => { // 表头样式
const tableBodyClass = data => { // 表体样式
return 'table-body-class'
}
const searchKey = ref('') // 查询参数
const searchKey = ref('2024') // 查询参数
const reviseWindowOpen = ref(false)
const addWindowOpen = ref(false)
const reviseForm = ref({})
......@@ -124,6 +124,31 @@ const selectYearValue = computed(() => {
const organizationStructure = ref([]) // 组织结构数据
const supplyData = ref([]) // 供热站数据
function getOrganizationStructure() {
getOrganizationStructureInterface().then(res => {
organizationStructure.value = res.data
getSupply()
}).catch(err => {
ElMessage.error('接口异常,获取数据失败.')
})
} // 获取组织结构
function getData() {
const params = {
year: searchKey.value
}
getAnnualParam(params).then(res=>{
data.value = res.data
console.log( '111111111111111',data.value)
for (let item of data.value) {
if(item.supplyId.includes('00000000-0000-0000-0000-000000000000')){
delete item.supplyId
}
}
dataBackup.value = [...data.value]
})
}
function handleEdit(val) {
currentYear.value = new Date().getFullYear()
currentMonth.value = new Date().getMonth() + 1
......@@ -174,16 +199,17 @@ function handleAdd() {
addSaveBtnLoading.value = false
} // 处理新增
function handleSearch() {
if (!searchKey.value) {
getData()
} else {
data.value = dataBackup.value.filter(item => {
if (typeof item.year === 'object') {
item.year = ''
}
return item.year.includes(searchKey.value)
})
}
getData()
// if (!searchKey.value) {
// getData()
// } else {
// data.value = dataBackup.value.filter(item => {
// if (typeof item.year === 'object') {
// item.year = ''
// }
// return item.year.includes(searchKey.value)
// })
// }
} // 处理查询
function onReviseSubmit() {
formRef.value.validate(valid => {
......@@ -344,10 +370,10 @@ function handleClose() {
addWindowOpen.value = false
resetInput()
} // 关闭弹窗
onMounted(() => {
// onMounted(() => {
getOrganizationStructure()
getData()
})
// })
watchEffect(()=>{
for(let supply of supplyData.value){
for(let item of data.value){
......@@ -357,18 +383,6 @@ watchEffect(()=>{
}
}
})
function getData() {
getAnnualParam().then(res=>{
data.value = res.data
console.log(data.value)
for (let item of data.value) {
if(item.supplyId.includes('00000000-0000-0000-0000-000000000000')){
delete item.supplyId
}
}
dataBackup.value = [...data.value]
})
}
function resetInput() {
addForm.value = {
......@@ -410,14 +424,6 @@ function getSupply() {
})
})
} // 根据组织结构获取供热站数据
function getOrganizationStructure() {
getOrganizationStructureInterface().then(res => {
organizationStructure.value = res.data
getSupply()
}).catch(err => {
ElMessage.error('接口异常,获取数据失败.')
})
} // 获取组织结构
</script>
<template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment