Commit 32c251f6 authored by 裴文涛's avatar 裴文涛

风力配置

parent 140f5795
import http from './http' import http from './http'
//能源消耗 //能源消耗
export const postEnergyManage = params => { export const postEnergyManage = params => {
return http.post(`/api/energy/getData`, params).then(res => res).catch(function (error) { return http.post(`/api/energy/getData`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
} }
// 瞬时热量-获取列表 // 瞬时热量-获取列表
export const postInstantHeat = params => { export const postInstantHeat = params => {
return http.post(`api/Scheduling/BizInstantaneousHeat/Get`).then(res => res).catch(function (error) { return http.post(`api/Scheduling/BizInstantaneousHeat/Get`).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
} }
// 瞬时热量-新增修改 // 瞬时热量-新增修改
export const postInstantHeatUpdate = params => { export const postInstantHeatUpdate = params => {
return http.post(`api/Scheduling/BizInstantaneousHeat/Update`,params).then(res => res).catch(function (error) { return http.post(`api/Scheduling/BizInstantaneousHeat/Update`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
} }
// 参数设置 // 参数设置
export const postConfigBoilerUpdate = params => { export const postConfigBoilerUpdate = params => {
return http.post(`api/configboiler/Save`,params).then(res => res).catch(function (error) { return http.post(`api/configboiler/Save`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
} }
export const postSecAbsTUc = params => { export const postSecAbsTUc = params => {
return http.post(`/api/analysis/external/SecAbsTUc`, params).then(res => res).catch(function (error) { return http.post(`/api/analysis/external/SecAbsTUc`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
} }
export const postEnergyManageSave = params => { export const postEnergyManageSave = params => {
return http.post(`/api/energy/Save`, params).then(res => res).catch(function (error) { return http.post(`/api/energy/Save`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
} }
export const getWeatherMagData = () => { // 获取气象干预数据 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/getTransferIds?id=${param}`,param) return http.post(`/api/cusweather/getTransferIds?id=${param}`, param)
} }
export const getAnnualParam = ()=>{ // 获取年度参数列表 export const getAnnualParam = () => { // 获取年度参数列表
return http.post('/api/Scheduling/BizHeatSet/Get') return http.post('/api/Scheduling/BizHeatSet/Get')
} }
...@@ -63,23 +62,26 @@ export const alterAnnualParam = params => { // 修改年度参数 ...@@ -63,23 +62,26 @@ export const alterAnnualParam = params => { // 修改年度参数
return http.post('/api/Scheduling/BizHeatSet/Update', params) return http.post('/api/Scheduling/BizHeatSet/Update', params)
} }
export const addAnnualParam = params =>{ // 新增年度参数 export const addAnnualParam = params => { // 新增年度参数
return http.post('/api/Scheduling/BizHeatSet/Add',params) return http.post('/api/Scheduling/BizHeatSet/Add', params)
} }
export const deleteAnnualParam = params =>{ // 删除年度参数 export const deleteAnnualParam = params => { // 删除年度参数
// console.log("地址:",`/api/Scheduling/BizHeatSet/Delete?Id=${params}`) // console.log("地址:",`/api/Scheduling/BizHeatSet/Delete?Id=${params}`)
return http.post(`/api/Scheduling/BizHeatSet/Delete?Id=${params}`) return http.post(`/api/Scheduling/BizHeatSet/Delete?Id=${params}`)
} }
export const getPhenomenon = ()=>{ // 获取数据列表————天气工况 export const getPhenomenon = () => { // 获取数据列表————天气工况
return http.post('/api/Scheduling/WeatherCondition/Get') return http.post('/api/Scheduling/WeatherCondition/Get')
} }
export const addPhenomenon = params => { // 新增数据————天气工况
return http.post('/api/Scheduling/WeatherCondition/Add', params)
}
export const alterPhenomenon = params => { // 修改数据————天气工况 export const alterPhenomenon = params => { // 修改数据————天气工况
return http.post('/api/Scheduling/WeatherCondition/Update', params) return http.post('/api/Scheduling/WeatherCondition/Update', params)
} }
export const deletePhenomenon = params =>{ // 删除数据————天气工况 export const deletePhenomenon = params => { // 删除数据————天气工况
return http.post(`/api/Scheduling/WeatherCondition/Delete?Id=${params}`) return http.post(`/api/Scheduling/WeatherCondition/Delete?Id=${params}`)
} }
...@@ -16,6 +16,7 @@ const reviseWindowOpen = ref(false) ...@@ -16,6 +16,7 @@ const reviseWindowOpen = ref(false)
const addWindowOpen = ref(false) const addWindowOpen = ref(false)
const reviseForm = ref({}) const reviseForm = ref({})
const addForm = ref({ const addForm = ref({
supplyId:"00000000-0000-0000-0000-000000000000",
energyType:'', energyType:'',
year:'', year:'',
standard:'', standard:'',
......
<script setup> <script setup>
import {onMounted, ref} from "vue"; import {onMounted, ref} from "vue";
import {ElMessageBox} from "element-plus"; import {ElMessageBox} from "element-plus";
import {getPhenomenon,alterPhenomenon,deletePhenomenon} from "@/api/scheduling.js" import {getPhenomenon,addPhenomenon,alterPhenomenon,deletePhenomenon} from "@/api/scheduling.js"
const data = ref() const data = ref()
const searchKey = ref('') // 查询参数 const searchKey = ref('') // 查询参数
const reviseWindowOpen = ref(false) const reviseWindowOpen = ref(false)
const addWindowOpen = ref(false)
const reviseForm = ref({}) // 修改表单 const reviseForm = ref({}) // 修改表单
const addForm = ref({}) // 新增表单
const tableHeaderClass = data => { // 表头样式 const tableHeaderClass = data => { // 表头样式
return 'table-header-class' return 'table-header-class'
} }
...@@ -14,6 +16,9 @@ const tableBodyClass = data => { // 表体样式 ...@@ -14,6 +16,9 @@ const tableBodyClass = data => { // 表体样式
return 'table-body-class' return 'table-body-class'
} }
function add(){
addWindowOpen.value = true
} // 新增按钮单击事件
function revise(val){ function revise(val){
reviseForm.value = {...val} reviseForm.value = {...val}
reviseWindowOpen.value = true reviseWindowOpen.value = true
...@@ -36,6 +41,8 @@ function omit(val){ ...@@ -36,6 +41,8 @@ function omit(val){
} // 删除按钮单击事件 } // 删除按钮单击事件
function handleClose(){ function handleClose(){
reviseWindowOpen.value = false reviseWindowOpen.value = false
addWindowOpen.value = false
resetInput()
} // 关闭弹窗 } // 关闭弹窗
function onReviseSubmit(){ function onReviseSubmit(){
alterPhenomenon(reviseForm.value).then(res=>{ alterPhenomenon(reviseForm.value).then(res=>{
...@@ -43,7 +50,20 @@ function onReviseSubmit(){ ...@@ -43,7 +50,20 @@ function onReviseSubmit(){
reviseWindowOpen.value = false reviseWindowOpen.value = false
}) })
} // 修改表单提交 } // 修改表单提交
function onAddSubmit(){
addPhenomenon(addForm.value).then(res=>{
console.log(res)
})
handleClose()
} // 新增表单提交
function resetInput(){
addForm.value = {
phenomenonName: '',
phenomenonType: '',
phenomenonTemp: '',
phenomenonDesc: ''
}
} // 清空新增表单输入框
onMounted(()=>{ onMounted(()=>{
getData() getData()
...@@ -65,6 +85,7 @@ function getData(){ ...@@ -65,6 +85,7 @@ function getData(){
</el-col> </el-col>
</el-row> </el-row>
<el-button type="primary" class="add-search-btn">查询</el-button> <el-button type="primary" class="add-search-btn">查询</el-button>
<el-button type="primary" @click="add" class="add-search-btn">新增</el-button>
</div> </div>
<div class="table-wrapper"> <div class="table-wrapper">
<el-table <el-table
...@@ -105,6 +126,16 @@ function getData(){ ...@@ -105,6 +126,16 @@ function getData(){
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<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.phenomenonType" style="width: 370px">
<el-option value="1" label="1--晴天"/>
<el-option value="2" label="2--多云"/>
<el-option value="3" label="3--阴天"/>
</el-select>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="8" col-label>对应温度:</el-col> <el-col :span="8" col-label>对应温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
...@@ -125,6 +156,52 @@ function getData(){ ...@@ -125,6 +156,52 @@ function getData(){
</div> </div>
</template> </template>
</el-dialog> <!-- 修改弹窗 --> </el-dialog> <!-- 修改弹窗 -->
<el-dialog
title="天气工况设置新增"
v-model="addWindowOpen"
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="addForm.phenomenonName" style="width: 370px">
<el-option value="晴天" label="晴天"/>
<el-option value="多云" label="多云"/>
<el-option value="阴天" label="阴天"/>
</el-select>
</el-col>
</el-row>
<el-row>
<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.phenomenonType" style="width: 370px">
<el-option value="1" label="1--晴天"/>
<el-option value="2" label="2--多云"/>
<el-option value="3" label="3--阴天"/>
</el-select>
</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="onAddSubmit">保存</el-button>
<el-button type="primary" @click="handleClose">关闭</el-button>
</div>
</template>
</el-dialog> <!-- 新增弹窗 -->
</div> </div>
</div> </div>
</template> </template>
......
<template> <script setup>
<!-- 条件筛选卡片 --> import {ref} from "vue";
<el-card class="card-contianer"> import {ElMessageBox} from "element-plus";
<div class="div-header">
<el-form-item> const data = ref()
<div>级数</div> const searchKey = ref('') // 查询参数
</el-form-item> const reviseWindowOpen = ref(false)
<el-form-item > const reviseForm = ref({}) // 修改表单
<el-select v-model="form.region" placeholder="请选择" style="width: 200px"> const tableHeaderClass = data => { // 表头样式
<el-option label="一级风" value="shanghai" /> return 'table-header-class'
<el-option label="二级风" value="beijing" /> }
</el-select> const tableBodyClass = data => { // 表体样式
</el-form-item> return 'table-body-class'
<el-form-item> }
<el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button>
</el-form-item> function revise(val){
reviseForm.value = {...val}
</div> reviseWindowOpen.value = true
</el-card> } // 修改按钮单击事件
<el-card class="moduleCard" :height="tableHeight" style="padding: 4px;"> function omit(val){
<el-table :data="tableData" :height="tableHeight" :cell-style="setCellStyle" id="out-table" let id = val.phenomenonId
border highlight-current-row :header-cell-style="setHeaderCellStyle" :header-cell-class-name="handleHeadAddClass" > ElMessageBox.confirm(
<el-table-column prop="index" label="序号" fixed /> '点击确定后,该条数据将删除,是否继续?',
<el-table-column prop="magnitude" label="级数" fixed /> 'Warning',
<el-table-column prop="temperature" label="对应温度" fixed /> {
<el-table-column prop="desc" label="描述" fixed /> confirmButtonText:'确定',
<el-table-column prop="alarmMessage" label="操作" fixed > cancelButtonText:'取消',
type:'warning'
<el-button link type="primary" size="small" @click="dialogFormVisible = true"> }
修改 ).then(()=>{
</el-button>
<el-button link type="primary" size="small" @click="del">删除</el-button>
</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="多云" />
</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> }).catch(err=>{})
</table> } // 删除按钮单击事件
</td> function handleClose(){
</tr> reviseWindowOpen.value = false
} // 关闭弹窗
function onReviseSubmit(){
</table> } // 修改表单提交
</script>
<template>
<div class="windManage-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="windLevel" label="级数"/>
<el-table-column prop="windTemp" label="对应温度"/>
<el-table-column prop="windDesc" 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>
</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.windLevel" style="width: 370px">
<el-option v-for="(item,index) in 14" :key="index" :value="item" :label="item"/>
</el-select>
</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.windTemp" 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.windDesc" placeholder="" style="width: 370px"/>
</el-col>
</el-row>
</template>
<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> <!-- 修改弹窗 -->
</div>
</el-dialog>
</div> </div>
</template> </template>
<style lang="less" scoped>
<script lang="ts" setup> .windManage-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,
magnitude:3,
temperature:1.00.toFixed(2),
desc:'三级风'
},
{
index:2,
magnitude:8,
temperature:-3.00.toFixed(2),
desc:'八级风'
},
{
index:3,
magnitude:6,
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; .search-wrapper {
} width: 100%;
function handleHeadAddClass({ column }) { display: flex;
if (sortField[column.property]) { justify-content: start;
column.order = sortField[column.property]
}
} }
.search-wrapper .el-row {
function setContentHeight() { width: 50%;
tableHeight.value = window.innerHeight - 240; border: none;
display: flex;
align-items: center;
margin: 5px 10px 5px 5px;
} }
onMounted(() => {
window.addEventListener('resize', setContentHeight); .el-col[label] {
}) display: flex;
onUnmounted(() => { justify-content: end;
window.removeEventListener('resize', setContentHeight); align-items: center;
})
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: '删除取消',
})
})
} }
</script> .add-search-btn {
<style lang="less" scoped> margin: 5px 10px 5px 0;
.moduleCard {
width: auto;
overflow: auto;
//max-height: 540px;
padding: 0px;
::v-deep .el-card__body {
padding: 0px;
}
} }
.pagination { :deep(.table-header-class) {
padding: 4px; text-align: center;
margin-left: 20px; font-size: 12px;
height: 30px; background-color: #c4d8f1 !important;
//background-color: #8939cf; color: #124c6a;
vertical-align: middle;
} }
:deep(.table-body-class) {
//鼠标所在行的颜色 font-size: 12px;
::v-deep .el-table__body tr:hover>td { color: black;
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
} }
::v-deep .el-table__body tr.current-row>td { .table-operate-column {
background-color: #92cbf1 !important; display: flex;
justify-content: center;
align-items: center;
} }
.card-contianer { .table-operate-column .el-button {
width: auto; font-size: 12px;
height: 70px;
.div-header {
width: 100%;
display: flex;
margin: 20px;
}
} }
.el-form-item { ::v-deep .el-table__body tr:hover > td {
margin-top: -20px; background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
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;
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%;
} }
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;
table th { color: #124362;
}
.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 { .el-col[col-value]{
text-align: center; display: flex;
background-color: #ffffff; justify-content: start;
padding: 5px 10px; align-items: center;
} padding-left: 5px;
.btngrounp {
width: 300px;
}
.gc td {
background-color: #a6ffa6;
}
.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
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