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

天气工况完成

parent aaf4cfbb
...@@ -39,12 +39,12 @@ export const getWeatherMagData = () => { // 获取气象干预数据 ...@@ -39,12 +39,12 @@ export const getWeatherMagData = () => { // 获取气象干预数据
return http.get(`/api/cusweather/getData`) return http.get(`/api/cusweather/getData`)
} }
export const alterWeatherMagData = params => { // 更新气象干预数据 export const alterWeatherMagData = params => { // 添加或修改气象干预数据/重新绑定换热站
return http.post(`/api/cusweather/SaveAll`, params) return http.post(`/api/cusweather/SaveAll`, params)
} }
export const getTransfer = param =>{ // 获取换热站列表 export const getTransfer = param =>{ // 获取换热站列表
return http.post(`\`/api/cusweather/getTransferIdsid=?${param}\``,param) return http.post(`/api/cusweather/getTransferIds?id=${param}`,param)
} }
export const getAnnualParam = ()=>{ // 获取年度参数列表 export const getAnnualParam = ()=>{ // 获取年度参数列表
...@@ -64,3 +64,14 @@ export const deleteAnnualParam = params =>{ // 删除年度参数 ...@@ -64,3 +64,14 @@ export const deleteAnnualParam = params =>{ // 删除年度参数
return http.post(`/api/Scheduling/BizHeatSet/Delete?Id=${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) { ...@@ -48,7 +48,7 @@ function handleDelete(val) {
{ {
confirmButtonText:'确定', confirmButtonText:'确定',
cancelButtonText:'取消', cancelButtonText:'取消',
type:'Warning' type:'warning'
} }
).then(()=>{ ).then(()=>{
deleteAnnualParam(val.paramId).then(res=>{ deleteAnnualParam(val.paramId).then(res=>{
...@@ -158,7 +158,7 @@ function resetInput(){ ...@@ -158,7 +158,7 @@ function resetInput(){
<el-row first> <el-row first>
<el-col :span="8" col-label class="energy-type-class">节能等级:</el-col> <el-col :span="8" col-label class="energy-type-class">节能等级:</el-col>
<el-col :span="16" col-value> <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 <el-option
v-for="item in energyTypeList" v-for="item in energyTypeList"
:key="item" :key="item"
......
<template> <script setup>
<!-- 条件筛选卡片 --> import {onMounted, ref} from "vue";
<el-card class="card-contianer"> import {ElMessageBox} from "element-plus";
<div class="div-header"> import {getPhenomenon,alterPhenomenon,deletePhenomenon} from "@/api/scheduling.js"
<el-form-item>
<div>名称</div> const data = ref()
</el-form-item> const searchKey = ref('') // 查询参数
<el-form-item > const reviseWindowOpen = ref(false)
<el-input></el-input> const reviseForm = ref({}) // 修改表单
</el-form-item> const tableHeaderClass = data => { // 表头样式
<el-form-item> return 'table-header-class'
<el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button> }
</el-form-item> const tableBodyClass = data => { // 表体样式
return 'table-body-class'
}
function revise(val){
reviseForm.value = {...val}
reviseWindowOpen.value = true
} // 修改按钮单击事件
function omit(val){
let id = val.phenomenonId
ElMessageBox.confirm(
'点击确定后,该条数据将删除,是否继续?',
'Warning',
{
confirmButtonText:'确定',
cancelButtonText:'取消',
type:'warning'
}
).then(()=>{
deletePhenomenon(id).then(res=>{
getData()
})
}).catch(err=>{})
} // 删除按钮单击事件
function handleClose(){
reviseWindowOpen.value = false
} // 关闭弹窗
function onReviseSubmit(){
alterPhenomenon(reviseForm.value).then(res=>{
getData()
reviseWindowOpen.value = false
})
} // 修改表单提交
</div>
</el-card>
<el-card class="moduleCard" :height="tableHeight" style="padding: 4px">
<el-table :data="tableData" :height="tableHeight" :cell-style="setCellStyle" id="out-table"
border highlight-current-row :header-cell-style="setHeaderCellStyle" :header-cell-class-name="handleHeadAddClass" >
<el-table-column prop="index" label="序号" fixed />
<el-table-column prop="name" label="名称" fixed />
<el-table-column prop="temperature" label="对应温度" fixed />
<el-table-column prop="desc" label="描述" fixed />
<el-table-column prop="alarmMessage" label="操作" fixed >
<el-button link type="primary" size="small" @click="dialogFormVisible = true"> onMounted(()=>{
修改 getData()
</el-button> })
<el-button link type="primary" size="small" @click="del">删除</el-button>
function getData(){
getPhenomenon().then(res => {
data.value = res.data
})
}
</script>
<template>
<div class="phenomenon-container">
<div class="search-wrapper">
<el-row>
<el-col :span="8" label>名称:</el-col>
<el-col :span="16">
<el-input v-model="searchKey"/>
</el-col>
</el-row>
<el-button type="primary" class="add-search-btn">查询</el-button>
</div>
<div class="table-wrapper">
<el-table
:data="data"
stripe
border
style="width: 100%"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass">
<el-table-column type="index" label="序号" align="center" width="100"/>
<el-table-column prop="phenomenonName" label="名称"/>
<el-table-column prop="phenomenonTemp" label="对应温度"/>
<el-table-column prop="phenomenonDesc" label="描述"/>
<el-table-column label="操作" width="190">
<template #default="scope">
<div class="table-operate-column">
<el-button link @click="revise(scope.row)" type="primary">修改</el-button>
<el-button link @click="omit(scope.row)" type="primary">删除</el-button>
</div>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </div>
<el-footer style="height: 8px;"> <div class="dialog-window">
<el-config-provider :locale="zhCn"> <el-dialog
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" title="天气工况设置修改"
:page-sizes="[30, 40, 50, 100, 200, 300]" :small="true" :disabled="disabled" :background="background" v-model="reviseWindowOpen"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="getdata" @current-change="getdata" width="700px"
class="pagination" /> :before-close="handleClose">
</el-config-provider> <template #default>
</el-footer> <el-row first>
<div class="ams-dialog"> <el-col :span="8" col-label class="energy-type-class">名称:</el-col>
<el-dialog v-model="dialogFormVisible" title="天气工况设置修改" width="500"> <el-col :span="16" col-value>
<el-card> <el-select placeholder="" size="small" v-model="reviseForm.phenomenonName" style="width: 370px">
<table <el-option value="晴天" label="晴天"/>
cellpadding="0" <el-option value="多云" label="多云"/>
cellspacing="1" <el-option value="阴天" label="阴天"/>
style="background-color: #99bbe8"
>
<tr>
<th style="width: 25%">名称</th>
<td style="width: 60%; margin:0; padding: 0">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="text-align: left">
<el-select v-model="form.region" placeholder="选择天气名称">
<el-option label="阴天" value="阴天" />
<el-option label="晴天" value="晴天" />
<el-option label="多云" value="多云" />
</el-select> </el-select>
</td> </el-col>
</el-row>
</tr> <el-row>
</table> <el-col :span="8" col-label>对应温度:</el-col>
</td> <el-col :span="16" col-value>
</tr> <el-input v-model="reviseForm.phenomenonTemp" placeholder="" style="width: 370px"/>
<tr> </el-col>
<th style="width: 25%">对应温度</th> </el-row>
<td style="width: 60%; margin:0; padding: 0"> <el-row>
<table cellpadding="0" cellspacing="0"> <el-col :span="8" col-label>描述:</el-col>
<tr> <el-col :span="16" col-value>
<td style="text-align: left"> <el-input v-model="reviseForm.phenomenonDesc" placeholder="" style="width: 370px"/>
<el-input></el-input> </el-col>
</td> </el-row>
</template>
</tr>
</table>
</td>
</tr>
<tr>
<th style="width: 25%">描述</th>
<td style="width: 60%; margin:0; padding: 0">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="text-align: left">
<el-input></el-input>
</td>
</tr>
</table>
</td>
</tr>
</table>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button type="primary" @click="dialogFormVisible = false"> <el-button type="primary" @click="onReviseSubmit">保存</el-button>
保存 <el-button type="primary" @click="handleClose">关闭</el-button>
</el-button>
<el-button @click="dialogFormVisible = false">关闭</el-button>
</div> </div>
</template> </template>
</el-card> </el-dialog> <!-- 修改弹窗 -->
</el-dialog>
</div> </div>
</div>
</template> </template>
<style lang="less" scoped>
<script lang="ts" setup> .phenomenon-container{
import {ref, reactive, onMounted, onUnmounted} from 'vue'; width: 100%;
import { ElMessage, ElMessageBox } from 'element-plus' margin: 4px;
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import {useFloating} from "element-plus";
//分页设置
const currentPage = ref(1)
var pageSize = ref(30)
const disabled = ref(false)
const background = ref(false)
const total = ref(1)
const tableData = ref([
{
index:1,
name:'晴天',
temperature:1.00.toFixed(2),
desc:'晴天1'
},
{
index:2,
name:'阴天',
temperature:-3.00.toFixed(2),
desc:'阴天'
},
{
index:3,
name:'多云',
temperature:-1.00.toFixed(2),
desc:'多云'
}
]);
const tableHeight = ref(500);
const sortField = reactive({});
function setCellStyle({ row, column, rowIndex, columnIndex }) {
let css_color = {};
css_color['padding-left'] = '0px';
css_color['padding-right'] = '0px';
css_color['borderColor'] = '#97d5fd';
css_color['padding'] = '0px';
return css_color;
}
function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
let css_color;
var backcolor = 'd9f1ff';
css_color = { 'background-color': '#' + backcolor, 'padding-left': '0px', 'padding-right': '0px', 'borderColor': '#97d5fd', 'color': '#000', 'text-align': 'center', 'vertical-align': 'top' };
var backcolor = 'd9f1ff';
css_color = { 'background-color': '#' + backcolor, 'padding-left': '0px', 'padding-right': '0px', 'borderColor': '#97d5fd', 'color': '#000', 'text-align': 'center', 'vertical-align': 'top' };
return css_color;
}
function handleHeadAddClass({ column }) {
if (sortField[column.property]) {
column.order = sortField[column.property]
}
} }
.search-wrapper {
function setContentHeight() { width: 100%;
tableHeight.value = window.innerHeight - 240; display: flex;
justify-content: start;
} }
onMounted(() => {
window.addEventListener('resize', setContentHeight);
})
onUnmounted(() => {
window.removeEventListener('resize', setContentHeight);
})
const dialogFormVisible = ref(false)
const form = reactive({
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: '',
})
const del = ()=>{ .search-wrapper .el-row {
ElMessageBox.confirm( width: 50%;
'您确定要删除此条数据吗?', border: none;
'警告', display: flex;
{ align-items: center;
confirmButtonText: '确定', margin: 5px 10px 5px 5px;
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
ElMessage({
type: 'success',
message: '删除成功',
})
})
.catch(() => {
ElMessage({
type: 'info',
message: '删除取消',
})
})
} }
</script>
<style lang="less" scoped>
.moduleCard {
width: auto;
overflow: auto;
//max-height: 540px;
padding: 0px;
::v-deep .el-card__body { .el-col[label] {
padding: 0px; display: flex;
} justify-content: end;
align-items: center;
} }
.pagination { .add-search-btn {
padding: 4px; margin: 5px 10px 5px 0;
margin-left: 20px;
height: 30px;
//background-color: #8939cf;
vertical-align: middle;
} }
//鼠标所在行的颜色 :deep(.table-header-class) {
::v-deep .el-table__body tr:hover>td { text-align: center;
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important; font-size: 12px;
background-color: #c4d8f1 !important;
color: #124c6a;
} }
:deep(.table-body-class) {
::v-deep .el-table__body tr.current-row>td { font-size: 12px;
background-color: #92cbf1 !important; color: black;
} }
.card-contianer { .table-operate-column {
width: auto;
height: 70px;
.div-header {
width: 100%;
display: flex; display: flex;
margin: 20px; justify-content: center;
} align-items: center;
} }
.el-form-item { .table-operate-column .el-button {
margin-top: -20px; font-size: 12px;
margin-right: 30px;
}
.el-tag--mini {
height: 21px !important
}
.el-cascader .el-input .el-input__inner:focus, .el-cascader .el-input.is-focus .el-input__inner{
height: 33px; //这里高度根据需求自己设定
} }
.el-cascader__tags {
display: inline-flex; ::v-deep .el-table__body tr:hover > td {
margin-right: 10px; background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
flex-wrap: nowrap;
}
.contentBlock {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ffffff;
overflow: auto;
}
table {
width: 100%;
} }
table,
tr, .el-row[first]{
th, border-top: 1px solid #a6c3e9;
td {
font-size: 14px;
margin: 0;
padding: 0;
} }
table { .el-row{
border-left: 1px solid #a6c3e9;
border-right: 1px solid #a6c3e9;
border-bottom: 1px solid #a6c3e9;
width: 100%; width: 100%;
height: 35px;
color: #124362;
} }
table th { .el-col[col-label]{
display: flex;
justify-content: end;
align-items: center;
border-right: 1px solid #a6c3e9;
background-color: #dfe8f6; background-color: #dfe8f6;
text-align: center; padding-right: 5px;
padding: 5px 10px;
}
table td {
text-align: center;
background-color: #ffffff;
padding: 5px 10px;
} }
.btngrounp { .el-col[col-value]{
width: 300px; display: flex;
} justify-content: start;
.gc td { align-items: center;
background-color: #a6ffa6; padding-left: 5px;
}
.gc td:first-child {
background-color: #ffffff;
} }
table.botList td { .el-input{
width: 33%; color: black;
text-align: left; height: 24px;
font-weight: bolder;
} }
</style> </style>
\ No newline at end of file
<script setup> <script setup>
import {computed, isRef, onMounted, reactive, ref, shallowRef} from "vue"; 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 ReviseWindow from "./weatherManageSub/ReviseWindow.vue";
import BindWindow from "./weatherManageSub/BindWindow.vue"; import BindWindow from "./weatherManageSub/BindWindow.vue";
import {getWeatherMagData, alterWeatherMagData, getTransfer} from '@/api/scheduling.js' import {getWeatherMagData, alterWeatherMagData, getTransfer} from '@/api/scheduling.js'
...@@ -9,64 +8,52 @@ import AddWindow from "./weatherManageSub/AddWindow.vue"; ...@@ -9,64 +8,52 @@ import AddWindow from "./weatherManageSub/AddWindow.vue";
const data = ref() const data = ref()
const reviseWindowOpen = ref(false) // 修改按钮弹窗状态 const reviseWindowOpen = ref(false) // 修改按钮弹窗状态
const bindWindowOpen = ref(false) // 绑定按钮弹窗状态 const bindWindowOpen = ref(false) // 绑定按钮弹窗状态
const addWindowOpen = ref(false) const addWindowOpen = ref(false) // 新增按钮弹窗状态
const dependentSub = ref({}) // 弹窗数据 const dependentSub = ref({}) // 修改和绑定弹窗数据依赖
const tableHeaderClass = data => { // 表头样式 const tableHeaderClass = data => { // 表头样式
return 'table-header-class' return 'table-header-class'
} }
const tableBodyClass = data => { // 表体样式 const tableBodyClass = data => { // 表体样式
return 'table-body-class' return 'table-body-class'
} }
const revise = (row) => { // 修改按钮单击事件 const revise = (row) => { // 修改按钮单击事件
dependentSub.value = row dependentSub.value = row
reviseWindowOpen.value = true reviseWindowOpen.value = true
} }
const bind = (row) => { // 绑定按钮单击事件 const bind = (row) => { // 绑定按钮单击事件
getTransfer(row.customizeId).then(res => { // getTransfer(id).then(res=>{
console.log(res) // // console.log(res)
}) // })
dependentSub.value = row dependentSub.value = row
bindWindowOpen.value = true bindWindowOpen.value = true
} }
const confirmRevise = val => { // 修改弹窗确认按钮事件 const confirmRevise = val => { // 修改弹窗确认按钮事件
for (let i = 0; i < data.value.length; i++) { alterWeatherMagData(val).then(res=>{
if (data.value[i].customizeId === val.customizeId) { getData()
// data.value[i] = {...val}
console.log(val)
// alterWeatherMagData(val).then(res => {
// console.log(res)
// console.log("操作结果")
// }).catch(err=>{
// console.log("错误信息",err)
// })
break
}
}
reviseWindowOpen.value = false reviseWindowOpen.value = false
})
} }
const confirmBind = val => { const confirmBind = val => {
console.log("处理换热站绑定")
bindWindowOpen.value = false bindWindowOpen.value = false
} }
onMounted(() => { onMounted(() => {
getData() getData()
}) })
function getData() { function getData() {
getWeatherMagData().then(res => { getWeatherMagData().then(res => {
data.value = res.data data.value = res.data
}) })
} }
function handleAddWinOpenClose(){ function handleAddWinOpenClose(){
addWindowOpen.value = false addWindowOpen.value = false
} }
function handleAdd(val){ function handleAdd(val){
alterWeatherMagData(val).then(res=>{
getData()
addWindowOpen.value = false addWindowOpen.value = false
} })
} // 新增数据提交
</script> </script>
<template> <template>
......
...@@ -10,38 +10,26 @@ const props = defineProps({ ...@@ -10,38 +10,26 @@ const props = defineProps({
}) })
const emit = defineEmits(['onCancel','onConfirm']) const emit = defineEmits(['onCancel','onConfirm'])
const addData = ref({ const addData = ref({
transfers:[], // 换热站
customizeName: '', // 自定义名称 customizeName: '', // 自定义名称
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式 diffPercentage: '', // 自动偏差百分比
temperature: '', // 温度
wind: '', // 风速
illumination: '', // 光照 illumination: '', // 光照
sort: '', // 排序
isAuto: false, // 是否自动模式 isAuto: false, // 是否自动模式
diffPercentage: '', // 自动偏差百分比 isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
timeoutMin: '', // 自动验证循环时间
tempRegulation: '', // 自动调节温度
operateTime:"", // 操作时间 operateTime:"", // 操作时间
sort: '', // 排序
tempRegulation: '', // 自动调节温度
temperature: '', // 温度
timeoutMin: '', // 自动验证循环时间
wind: '', // 风速
description: null, // 排序字段,全为Null description: null, // 排序字段,全为Null
updateNullField:"", // 无用,但不为空 updateNullFields:"", // 无用,但不为空
isActive:false, // 是否启用 isActive:false, // 是否启用
supplyId:'', // 供热站编号
}) })
const inputStyle = { const inputStyle = {
color: 'black', color: 'black',
height: '24px' height: '24px'
} }
const switchingisAuto = computed({
get() {
return addData.value.isAuto === '自动模式'
},
set(newValue) {
if (newValue) {
addData.value.isAuto = '自动模式'
} else {
addData.value.isAuto = '手动模式'
}
}
}) // 可写计算属性,手动、自动模式切换
function handleClose() { function handleClose() {
addData.value = { addData.value = {
customizeName: '', // 自定义名称 customizeName: '', // 自定义名称
...@@ -63,6 +51,7 @@ function handleClose() { ...@@ -63,6 +51,7 @@ function handleClose() {
emit('onCancel') emit('onCancel')
} }
function handleConfirm() { function handleConfirm() {
addData.value.operateTime = getCurrentDateTime()
emit('onConfirm',addData.value) emit('onConfirm',addData.value)
addData.value = { addData.value = {
customizeName: '', // 自定义名称 customizeName: '', // 自定义名称
...@@ -82,6 +71,17 @@ function handleConfirm() { ...@@ -82,6 +71,17 @@ function handleConfirm() {
supplyId:'', // 供热站编号 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> </script>
<template> <template>
...@@ -102,8 +102,8 @@ function handleConfirm() { ...@@ -102,8 +102,8 @@ function handleConfirm() {
<el-col :span="8" class="content-col-label">干预模式:</el-col> <el-col :span="8" class="content-col-label">干预模式:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-radio-group v-model="addData.isFixed"> <el-radio-group v-model="addData.isFixed">
<el-radio value="固定模式" :style="{marginLeft:'10px'}">固定模式</el-radio> <el-radio :value="true" :style="{marginLeft:'10px'}">固定模式</el-radio>
<el-radio value="气象仪模式" :style="{marginLeft:'-15px'}">气象仪模式</el-radio> <el-radio :value="false" :style="{marginLeft:'-15px'}">气象仪模式</el-radio>
</el-radio-group> </el-radio-group>
</el-col> </el-col>
</el-row> </el-row>
...@@ -134,7 +134,7 @@ function handleConfirm() { ...@@ -134,7 +134,7 @@ function handleConfirm() {
<el-row> <el-row>
<el-col :span="5" class="content-col-label">切换自动模式:</el-col> <el-col :span="5" class="content-col-label">切换自动模式:</el-col>
<el-col :span="7" class="content-col-value"> <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>
<el-col :span="5" class="content-col-label">自动偏差百分比(%d):</el-col> <el-col :span="5" class="content-col-label">自动偏差百分比(%d):</el-col>
<el-col :span="7" class="content-col-value"> <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