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

年度参数查询接口替换

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