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"
......
<template>
<!-- 条件筛选卡片 -->
<el-card class="card-contianer">
<div class="div-header">
<el-form-item>
<div>名称</div>
</el-form-item>
<el-form-item >
<el-input></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button>
</el-form-item>
<script setup>
import {onMounted, ref} from "vue";
import {ElMessageBox} from "element-plus";
import {getPhenomenon,alterPhenomenon,deletePhenomenon} from "@/api/scheduling.js"
const data = ref()
const searchKey = ref('') // 查询参数
const reviseWindowOpen = ref(false)
const reviseForm = ref({}) // 修改表单
const tableHeaderClass = data => { // 表头样式
return 'table-header-class'
}
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">
修改
</el-button>
<el-button link type="primary" size="small" @click="del">删除</el-button>
onMounted(()=>{
getData()
})
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>
</el-card>
<el-footer style="height: 8px;">
<el-config-provider :locale="zhCn">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
:page-sizes="[30, 40, 50, 100, 200, 300]" :small="true" :disabled="disabled" :background="background"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="getdata" @current-change="getdata"
class="pagination" />
</el-config-provider>
</el-footer>
<div class="ams-dialog">
<el-dialog v-model="dialogFormVisible" title="天气工况设置修改" width="500">
<el-card>
<table
cellpadding="0"
cellspacing="1"
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="多云" />
</div>
<div class="dialog-window">
<el-dialog
title="天气工况设置修改"
v-model="reviseWindowOpen"
width="700px"
:before-close="handleClose">
<template #default>
<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="reviseForm.phenomenonName" style="width: 370px">
<el-option value="晴天" label="晴天"/>
<el-option value="多云" label="多云"/>
<el-option value="阴天" label="阴天"/>
</el-select>
</td>
</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>
<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>
</el-col>
</el-row>
<el-row>
<el-col :span="8" col-label>对应温度:</el-col>
<el-col :span="16" col-value>
<el-input v-model="reviseForm.phenomenonTemp" placeholder="" style="width: 370px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="8" col-label>描述:</el-col>
<el-col :span="16" col-value>
<el-input v-model="reviseForm.phenomenonDesc" placeholder="" style="width: 370px"/>
</el-col>
</el-row>
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="dialogFormVisible = false">
保存
</el-button>
<el-button @click="dialogFormVisible = false">关闭</el-button>
<el-button type="primary" @click="onReviseSubmit">保存</el-button>
<el-button type="primary" @click="handleClose">关闭</el-button>
</div>
</template>
</el-card>
</el-dialog>
</el-dialog> <!-- 修改弹窗 -->
</div>
</div>
</template>
<script lang="ts" setup>
import {ref, reactive, onMounted, onUnmounted} from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus'
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]
}
<style lang="less" scoped>
.phenomenon-container{
width: 100%;
margin: 4px;
}
function setContentHeight() {
tableHeight.value = window.innerHeight - 240;
.search-wrapper {
width: 100%;
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 = ()=>{
ElMessageBox.confirm(
'您确定要删除此条数据吗?',
'警告',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
ElMessage({
type: 'success',
message: '删除成功',
})
})
.catch(() => {
ElMessage({
type: 'info',
message: '删除取消',
})
})
.search-wrapper .el-row {
width: 50%;
border: none;
display: flex;
align-items: center;
margin: 5px 10px 5px 5px;
}
</script>
<style lang="less" scoped>
.moduleCard {
width: auto;
overflow: auto;
//max-height: 540px;
padding: 0px;
::v-deep .el-card__body {
padding: 0px;
}
.el-col[label] {
display: flex;
justify-content: end;
align-items: center;
}
.pagination {
padding: 4px;
margin-left: 20px;
height: 30px;
//background-color: #8939cf;
vertical-align: middle;
.add-search-btn {
margin: 5px 10px 5px 0;
}
//鼠标所在行的颜色
::v-deep .el-table__body tr:hover>td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
:deep(.table-header-class) {
text-align: center;
font-size: 12px;
background-color: #c4d8f1 !important;
color: #124c6a;
}
::v-deep .el-table__body tr.current-row>td {
background-color: #92cbf1 !important;
:deep(.table-body-class) {
font-size: 12px;
color: black;
}
.card-contianer {
width: auto;
height: 70px;
.div-header {
width: 100%;
.table-operate-column {
display: flex;
margin: 20px;
}
justify-content: center;
align-items: center;
}
.el-form-item {
margin-top: -20px;
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; //这里高度根据需求自己设定
.table-operate-column .el-button {
font-size: 12px;
}
.el-cascader__tags {
display: inline-flex;
margin-right: 10px;
flex-wrap: nowrap;
}
.contentBlock {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ffffff;
overflow: auto;
}
table {
width: 100%;
::v-deep .el-table__body tr:hover > td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
table,
tr,
th,
td {
font-size: 14px;
margin: 0;
padding: 0;
.el-row[first]{
border-top: 1px solid #a6c3e9;
}
table {
.el-row{
border-left: 1px solid #a6c3e9;
border-right: 1px solid #a6c3e9;
border-bottom: 1px solid #a6c3e9;
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;
text-align: center;
padding: 5px 10px;
}
table td {
text-align: center;
background-color: #ffffff;
padding: 5px 10px;
padding-right: 5px;
}
.btngrounp {
width: 300px;
}
.gc td {
background-color: #a6ffa6;
}
.gc td:first-child {
background-color: #ffffff;
.el-col[col-value]{
display: flex;
justify-content: start;
align-items: center;
padding-left: 5px;
}
table.botList td {
width: 33%;
text-align: left;
font-weight: bolder;
.el-input{
color: black;
height: 24px;
}
</style>
\ No newline at end of file
<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