Commit b69fb0bc authored by 裴文涛's avatar 裴文涛

天气工况完成

parent aaf4cfbb
......@@ -39,12 +39,12 @@ export const getWeatherMagData = () => { // 获取气象干预数据
return http.get(`/api/cusweather/getData`)
}
export const alterWeatherMagData = params => { // 更新气象干预数据
export const alterWeatherMagData = params => { // 添加或修改气象干预数据/重新绑定换热站
return http.post(`/api/cusweather/SaveAll`, params)
}
export const getTransfer = param =>{ // 获取换热站列表
return http.post(`\`/api/cusweather/getTransferIdsid=?${param}\``,param)
return http.post(`/api/cusweather/getTransferIds?id=${param}`,param)
}
export const getAnnualParam = ()=>{ // 获取年度参数列表
......@@ -64,3 +64,14 @@ export const deleteAnnualParam = params =>{ // 删除年度参数
return http.post(`/api/Scheduling/BizHeatSet/Delete?Id=${params}`)
}
export const getPhenomenon = ()=>{ // 获取数据列表————天气工况
return http.post('/api/Scheduling/WeatherCondition/Get')
}
export const alterPhenomenon = params => { // 修改数据————天气工况
return http.post('/api/Scheduling/WeatherCondition/Update', params)
}
export const deletePhenomenon = params =>{ // 删除数据————天气工况
return http.post(`/api/Scheduling/WeatherCondition/Delete?Id=${params}`)
}
......@@ -48,7 +48,7 @@ function handleDelete(val) {
{
confirmButtonText:'确定',
cancelButtonText:'取消',
type:'Warning'
type:'warning'
}
).then(()=>{
deleteAnnualParam(val.paramId).then(res=>{
......@@ -158,7 +158,7 @@ function resetInput(){
<el-row first>
<el-col :span="8" col-label class="energy-type-class">节能等级:</el-col>
<el-col :span="16" col-value>
<el-select placeholder="" size="small" v-model="addForm.energyType" style="width: 370px">
<el-select placeholder="" size="small" v-model="reviseForm.energyType" style="width: 370px">
<el-option
v-for="item in energyTypeList"
:key="item"
......
This diff is collapsed.
<script setup>
import {computed, isRef, onMounted, reactive, ref, shallowRef} from "vue";
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import ReviseWindow from "./weatherManageSub/ReviseWindow.vue";
import BindWindow from "./weatherManageSub/BindWindow.vue";
import {getWeatherMagData, alterWeatherMagData, getTransfer} from '@/api/scheduling.js'
......@@ -9,64 +8,52 @@ import AddWindow from "./weatherManageSub/AddWindow.vue";
const data = ref()
const reviseWindowOpen = ref(false) // 修改按钮弹窗状态
const bindWindowOpen = ref(false) // 绑定按钮弹窗状态
const addWindowOpen = ref(false)
const dependentSub = ref({}) // 弹窗数据
const addWindowOpen = ref(false) // 新增按钮弹窗状态
const dependentSub = ref({}) // 修改和绑定弹窗数据依赖
const tableHeaderClass = data => { // 表头样式
return 'table-header-class'
}
const tableBodyClass = data => { // 表体样式
return 'table-body-class'
}
const revise = (row) => { // 修改按钮单击事件
dependentSub.value = row
reviseWindowOpen.value = true
}
const bind = (row) => { // 绑定按钮单击事件
getTransfer(row.customizeId).then(res => {
console.log(res)
})
// getTransfer(id).then(res=>{
// // console.log(res)
// })
dependentSub.value = row
bindWindowOpen.value = true
}
const confirmRevise = val => { // 修改弹窗确认按钮事件
for (let i = 0; i < data.value.length; i++) {
if (data.value[i].customizeId === val.customizeId) {
// data.value[i] = {...val}
console.log(val)
// alterWeatherMagData(val).then(res => {
// console.log(res)
// console.log("操作结果")
// }).catch(err=>{
// console.log("错误信息",err)
// })
break
}
}
alterWeatherMagData(val).then(res=>{
getData()
reviseWindowOpen.value = false
})
}
const confirmBind = val => {
console.log("处理换热站绑定")
bindWindowOpen.value = false
}
onMounted(() => {
getData()
})
function getData() {
getWeatherMagData().then(res => {
data.value = res.data
})
}
function handleAddWinOpenClose(){
addWindowOpen.value = false
}
function handleAdd(val){
alterWeatherMagData(val).then(res=>{
getData()
addWindowOpen.value = false
}
})
} // 新增数据提交
</script>
<template>
......
......@@ -10,38 +10,26 @@ const props = defineProps({
})
const emit = defineEmits(['onCancel','onConfirm'])
const addData = ref({
transfers:[], // 换热站
customizeName: '', // 自定义名称
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
temperature: '', // 温度
wind: '', // 风速
diffPercentage: '', // 自动偏差百分比
illumination: '', // 光照
sort: '', // 排序
isAuto: false, // 是否自动模式
diffPercentage: '', // 自动偏差百分比
timeoutMin: '', // 自动验证循环时间
tempRegulation: '', // 自动调节温度
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
operateTime:"", // 操作时间
sort: '', // 排序
tempRegulation: '', // 自动调节温度
temperature: '', // 温度
timeoutMin: '', // 自动验证循环时间
wind: '', // 风速
description: null, // 排序字段,全为Null
updateNullField:"", // 无用,但不为空
updateNullFields:"", // 无用,但不为空
isActive:false, // 是否启用
supplyId:'', // 供热站编号
})
const inputStyle = {
color: 'black',
height: '24px'
}
const switchingisAuto = computed({
get() {
return addData.value.isAuto === '自动模式'
},
set(newValue) {
if (newValue) {
addData.value.isAuto = '自动模式'
} else {
addData.value.isAuto = '手动模式'
}
}
}) // 可写计算属性,手动、自动模式切换
function handleClose() {
addData.value = {
customizeName: '', // 自定义名称
......@@ -63,6 +51,7 @@ function handleClose() {
emit('onCancel')
}
function handleConfirm() {
addData.value.operateTime = getCurrentDateTime()
emit('onConfirm',addData.value)
addData.value = {
customizeName: '', // 自定义名称
......@@ -82,6 +71,17 @@ function handleConfirm() {
supplyId:'', // 供热站编号
}
}
function getCurrentDateTime() {
const now = new Date();
const year = now.getFullYear();
const month = ('0' + (now.getMonth() + 1)).slice(-2); // 月份从0开始,所以加1
const day = ('0' + now.getDate()).slice(-2);
const hours = ('0' + now.getHours()).slice(-2);
const minutes = ('0' + now.getMinutes()).slice(-2);
const seconds = ('0' + now.getSeconds()).slice(-2);
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
} // 生成时间
</script>
<template>
......@@ -102,8 +102,8 @@ function handleConfirm() {
<el-col :span="8" class="content-col-label">干预模式:</el-col>
<el-col :span="16" class="content-col-value">
<el-radio-group v-model="addData.isFixed">
<el-radio value="固定模式" :style="{marginLeft:'10px'}">固定模式</el-radio>
<el-radio value="气象仪模式" :style="{marginLeft:'-15px'}">气象仪模式</el-radio>
<el-radio :value="true" :style="{marginLeft:'10px'}">固定模式</el-radio>
<el-radio :value="false" :style="{marginLeft:'-15px'}">气象仪模式</el-radio>
</el-radio-group>
</el-col>
</el-row>
......@@ -134,7 +134,7 @@ function handleConfirm() {
<el-row>
<el-col :span="5" class="content-col-label">切换自动模式:</el-col>
<el-col :span="7" class="content-col-value">
<el-checkbox :style="{marginLeft:'10px'}" v-model="switchingisAuto" label="自动模式"/>
<el-checkbox :style="{marginLeft:'10px'}" v-model="addData.isAuto" label="自动模式"/>
</el-col>
<el-col :span="5" class="content-col-label">自动偏差百分比(%d):</el-col>
<el-col :span="7" class="content-col-value">
......
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