Commit c33ffbf0 authored by jiaxu.yan's avatar jiaxu.yan

feat: 初次提交 调度管理

parent ff7fa8d4
import http from './http'
//能源消耗-获取
export const postEnergyManage = params => {
return http.post(`/api/energy/getData`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
// 能源消耗-删除
// export const postEnergyDel = EnergyId => {
// return http.post(`/api/energy/Delete`,{params:{EnergyId}}).then(res => res).catch(function (error) {
// console.log(error);
// })
// }
export const postEnergyDel = params => {
return http.post(`/api/energy/Delete`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
// 能源消耗-修改
export const postEnergyUpdate = params => {
return http.post(`/api/energy/Save`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
// 瞬时热量-获取列表
export const postInstantHeat = params => {
return http.post(`api/Scheduling/BizInstantaneousHeat/Get`).then(res => res).catch(function (error) {
console.log(error);
})
}
// 瞬时热量-新增修改
export const postInstantHeatUpdate = params => {
return http.post(`api/Scheduling/BizInstantaneousHeat/Update`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
// 参数设置
export const postConfigBoilerUpdate = params => {
return http.post(`api/configboiler/Save`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
export const postSecAbsTUc = params => {
return http.post(`/api/analysis/external/SecAbsTUc`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
export const postEnergyManageSave = params => {
return http.post(`/api/energy/Save`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
export const getWeatherMagData = () => { // 获取气象干预数据
return http.get(`/api/cusweather/getData`)
}
export const alterWeatherMagData = params => { // 添加或修改气象干预数据/重新绑定换热站
return http.post(`/api/cusweather/SaveAll`, params)
}
export const getTransfer = param => { // 获取换热站列表
return http.post(`/api/cusweather/getTransferIds?id=${param}`, param)
}
export const getAnnualParam = () => { // 获取年度参数列表
return http.post('/api/Scheduling/BizHeatSet/Get')
}
export const alterAnnualParam = params => { // 修改年度参数
return http.post('/api/Scheduling/BizHeatSet/Update', params)
}
export const addAnnualParam = params => { // 新增年度参数
return http.post('/api/Scheduling/BizHeatSet/Add', params)
}
export const deleteAnnualParam = params => { // 删除年度参数
// console.log("地址:",`/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 addPhenomenon = params => { // 新增数据————天气工况
return http.post('/api/Scheduling/WeatherCondition/Add', params)
}
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}`)
}
export const getWind = () => { // 获取数据列表————风力配置
return http.post('/api/Scheduling/WindConfiguration/Get')
}
export const addWind = params => { // 新增数据————风力配置
return http.post('/api/Scheduling/WindConfiguration/Add', params)
}
export const alterWind = params => { // 修改数据————风力配置
return http.post('/api/Scheduling/WindConfiguration/Update',params)
}
export const deleteWind = params => { // 删除数据————风力配置
return http.post(`/api/Scheduling/WindConfiguration/Delete?Id=${params}`)
}
<script setup>
import {computed, onMounted, reactive, ref} from "vue";
import {zhCn} from "element-plus/es/locale/index";
import {getAnnualParam, alterAnnualParam, addAnnualParam, deleteAnnualParam} from '@/api/scheduling.js'
import {ElMessageBox} from "element-plus";
const data = ref()
const dataBackup = ref([])
const tableHeaderClass = data => { // 表头样式
return 'table-header-class'
}
const tableBodyClass = data => { // 表体样式
return 'table-body-class'
}
const searchKey = ref('') // 查询参数
const reviseWindowOpen = ref(false)
const addWindowOpen = ref(false)
const reviseForm = ref({})
const addForm = ref({
supplyId: "00000000-0000-0000-0000-000000000000",
energyType: '',
year: '',
standard: '',
degreeStandard: '',
indoorTemperature: '',
outdoorTemperature: '',
backWaterTemperature: ''
})
const energyTypeList = ref(['一步节能', '二步节能', '三步节能', '四步节能', '非节能']) // 节能等级列表
const currentMonth = ref(0)
const currentYear = ref(0)
const selectYearValue = computed(() => {
if (currentMonth.value >= 7) {
return currentYear.value + "年-" + (currentYear.value + 1) + "年"
} else {
return (currentYear.value - 1) + "年-" + currentYear.value + "年"
}
})
function handleEdit(val) {
currentYear.value = new Date().getFullYear()
currentMonth.value = new Date().getMonth() + 1
reviseForm.value = {...val}
reviseWindowOpen.value = true
} // 处理修改
function handleDelete(val) {
ElMessageBox.confirm(
'点击确定后,该条数据将删除,是否继续?',
'Warning',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
deleteAnnualParam(val.paramId).then(res => {
if (res.success) {
getData()
}
})
}).catch(err => {
})
} // 处理删除
function handleAdd() {
currentYear.value = new Date().getFullYear()
currentMonth.value = new Date().getMonth() + 1
addWindowOpen.value = true
} // 处理新增
function handleSearch() {
if (!searchKey.value) {
getData()
} else {
data.value = dataBackup.value.filter(item => item.year.includes(searchKey.value))
}
} // 处理查询
function onSubmit() {
alterAnnualParam(reviseForm.value).then(res => {
if (res.success) {
getData()
handleClose()
}
})
} // 提交修改
function onAddSubmit() { // 提交新增
data.value.forEach((item, index, array) => {
if (item.energyType === addForm.energyType && item.year === addForm.year) {
alert("该类型年度已存在")
return
}
})
addAnnualParam(addForm.value).then(res => {
getData()
handleClose()
})
} // 提交新增
function handleClose() {
reviseWindowOpen.value = false
addWindowOpen.value = false
resetInput()
} // 关闭弹窗
onMounted(() => {
getData()
})
function getData() {
getAnnualParam().then(res => {
data.value = res.data
dataBackup.value = [...data.value]
})
}
function resetInput() {
addForm.value = {
energyType: '',
year: '',
standard: '',
degreeStandard: '',
indoorTemperature: '',
outdoorTemperature: '',
backWaterTemperature: ''
}
}
</script>
<template>
<div class="annual-param-container">
<div class="search-add-wrapper">
<el-row>
<el-col :span="8" label>年度:</el-col>
<el-col :span="16">
<el-input clearable v-model="searchKey"/>
</el-col>
</el-row>
<el-button type="primary" class="add-search-btn" @click="handleAdd">新增</el-button>
<el-button type="primary" class="add-search-btn" @click="handleSearch">查询</el-button>
</div>
<div class="table-wrapper">
<el-table
:data="data"
border
stripe
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass"
style="width: 100%">
<el-table-column label="序号" type="index" align="center" width="60"/>
<el-table-column label="节能类型" prop="energyType"/>
<el-table-column label="年度" prop="year"/>
<el-table-column label="热指标(W/m²)" prop="standard"/>
<el-table-column label="度日数标定值" prop="degreeStandard"/>
<el-table-column label="室内温度(℃)" prop="indoorTemperature"/>
<el-table-column label="室外温度(℃)" prop="outdoorTemperature"/>
<el-table-column label="回水温度(℃)" prop="backWaterTemperature"/>
<el-table-column label="操作">
<template #default="scope">
<div class="table-operate-column">
<el-button link type="primary" @click="handleEdit(scope.row)">修改</el-button>
<el-button link type="primary" @click="handleDelete(scope.row)">删除</el-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="revise-window-dialog">
<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.energyType" style="width: 370px">
<el-option
v-for="item in energyTypeList"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col :span="8" col-label>年度:</el-col>
<el-col :span="16" col-value>
<el-select placeholder="" size="small" v-model="reviseForm.year" style="width: 370px">
<el-option :value="selectYearValue" :label="selectYearValue"/>
</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.standard" 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.degreeStandard" 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.indoorTemperature" 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.outdoorTemperature" 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.backWaterTemperature" style="width: 370px"/>
</el-col>
</el-row>
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="onSubmit">保存</el-button>
<el-button type="primary" @click="handleClose">关闭</el-button>
</div>
</template>
</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.energyType" style="width: 370px">
<el-option
v-for="item in energyTypeList"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col :span="8" col-label>年度:</el-col>
<el-col :span="16" col-value>
<el-select placeholder="" size="small" v-model="selectYearValue" style="width: 370px">
<el-option :value="selectYearValue" :label="selectYearValue"/>
</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="addForm.standard" 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="addForm.degreeStandard" 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="addForm.indoorTemperature" 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="addForm.outdoorTemperature" 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="addForm.backWaterTemperature" 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>
</template>
<style scoped lang="less">
.annual-param-container {
width: 100%;
margin: 4px;
}
.search-add-wrapper {
width: 100%;
display: flex;
justify-content: start;
}
.search-add-wrapper .el-row {
width: 50%;
border: none;
display: flex;
align-items: center;
margin: 5px 10px 5px 5px;
}
.el-col[label] {
display: flex;
justify-content: end;
align-items: center;
}
.add-search-btn {
margin: 5px 10px 5px 0;
}
:deep(.table-header-class) {
text-align: center;
font-size: 12px;
background-color: #c4d8f1 !important;
color: #124c6a;
}
:deep(.table-body-class) {
font-size: 12px;
color: black;
}
.table-operate-column {
display: flex;
justify-content: center;
align-items: center;
}
.table-operate-column .el-button {
font-size: 12px;
}
::v-deep .el-table__body tr:hover > td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
.pagination-wrapper {
padding: 5px;
display: flex;
justify-content: space-between;
align-items: center;
}
.el-row[first] {
border-top: 1px solid #a6c3e9;
}
.el-row {
border-left: 1px solid #a6c3e9;
border-right: 1px solid #a6c3e9;
border-bottom: 1px solid #a6c3e9;
width: 100%;
height: 35px;
color: #124362;
}
.el-col[col-label] {
display: flex;
justify-content: end;
align-items: center;
border-right: 1px solid #a6c3e9;
background-color: #f2f6f8;
padding-right: 5px;
}
.el-col[col-value] {
display: flex;
justify-content: start;
align-items: center;
padding-left: 5px;
}
.el-input {
color: black;
height: 24px;
}
</style>
\ No newline at end of file
<template>
<div class="contentBlock">
<div class="contentBlockInn">
<el-card class="card-contianer">
<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-input style="width: 80%" v-model="formDatas.openingOfElectricValve">
<template #append>
<div style="width: 40px">%
</div>
</template>
</el-input>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th style="width: 25%">换热站</th>
<td style="text-align: left">
<el-checkbox-group v-model="form.type" style="width: 60%;">
<el-checkbox v-for="(option, index) in options" :key="index" :label="option">
{{ option }}
</el-checkbox>
</el-checkbox-group>
</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 style="width: 80%" v-model="formDatas.boilerOutletWaterTemperature">
<template #append>
<div style="width: 40px;">
</div>
</template>
</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-form>
<el-input style="width: 80%" v-model="formDatas.holdingTime">
<template #append>
<div style="width: 40px">
分钟
</div>
</template>
</el-input>
</el-form>
</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 style="width: 80%" v-model="formDatas.upperLlimitMainFlow">
<template #append>
<div style="width: 40px;">
m3/h
</div>
</template>
</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 style="width: 80%" v-model="formDatas.lowerLlimitMainFlow">
<template #append>
<div style="width: 40px">
m3/h
</div>
</template>
</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 style="width: 80%" v-model="formDatas.maxTargetTemperature">
<template #append>
<div style="width: 40px;">
</div>
</template>
</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 style="width: 80%" v-model="formDatas.bestHoldingTime">
<template #append>
<div style="width: 40px">
分钟
</div>
</template>
</el-input>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th></th>
<th rowspan="3">
<div>
<div class="btngrounp">
<el-button type="primary" @click="onSave">保存</el-button>
<el-button type="primary" style="margin: 0 0 0 5px">关闭</el-button>
</div>
</div>
</th>
</tr>
</table>
</el-card>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, onUnmounted, onBeforeMount } from "vue";
import { postConfigBoilerUpdate } from '@/api/scheduling.js'
import http from '../../api/http';
const options = reactive(['瑞景园低区', '瑞景园高区', '翰锦园', '圣美园低区', '圣美园高区', '社区服务中心', '风雅园', '风雅园_幼儿园', '枫润园低区', '枫润园高区']);
const form = ref({
types: []
})
const formDatas = ref([
{
"updateNullFields": "updateNullFields",
"configId": "",
"openingOfElectricValve": "",
"boilerOutletWaterTemperature": "",
"holdingTime": "",
"upperLlimitMainFlow": "",
"lowerLlimitMainFlow": "",
"maxTargetTemperature": "",
"bestHoldingTime": "",
"transferIds": ""
}
])
const getListData = () => {
http.get("/api/configboiler/getData").then((result) => {
formDatas.value = result.data;
})
}
const onSave = async () => {
await postConfigBoilerUpdate({...formDatas.value}).then((res) => {
if (res.success) {
ElMessage.success('修改成功')
getListData()
}
})
}
// const onSave = () => {
// http.post("api/configboiler/Save","`updateNullFields=formDatas.updateNullFields&configId=formDatas.configId&openingOfElectricValve=formDatas.openingOfElectricValve&boilerOutletWaterTemperature=formDatas.boilerOutletWaterTemperature&holdingTime=formDatas.holdingTime&upperLlimitMainFlow=formDatas.upperLlimitMainFlow&lowerLlimitMainFlow=formDatas.lowerLlimitMainFlow&maxTargetTemperature=formDatas.maxTargetTemperature&bestHoldingTime=formDatas.bestHoldingTime&transferIds=formDatas.transferIds`").then((result) => {
// if (result.success) {
// ElMessage.success('修改成功')
// getListData()
// }
// }).catch((error) => {
// console.log(error)
// })
// }
// const onSave = () => {
// http.post("api/configboiler/Save","formDatas.value").then((result) => {
// if (result.success) {
// ElMessage.success('修改成功')
// getListData()
// }
// }).catch((error) => {
// console.log(error)
// })
// }
onMounted(() => {
getListData()
})
</script>
<style lang="less" scoped>
.contentBlock {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ffffff;
overflow: auto;
}
table {
width: 100%;
}
table,
tr,
th,
td {
font-size: 14px;
margin: 0;
padding: 0;
}
table {
width: 100%;
}
table th {
background-color: #dfe8f6;
text-align: center;
padding: 5px 10px;
}
table td {
text-align: center;
background-color: #ffffff;
padding: 5px 10px;
}
.btngrounp {
width: 300px;
}
.gc td {
background-color: #a6ffa6;
}
.gc td:first-child {
background-color: #ffffff;
}
table.botList td {
width: 33%;
text-align: left;
font-weight: bolder;
}
</style>
\ No newline at end of file
<script setup>
import { ref, onMounted, getCurrentInstance, reactive, nextTick } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import axios from 'axios'
import { Search, Document } from "@element-plus/icons-vue"
import { postEnergyManage, postSecAbsTUc, postEnergyManageSave, postEnergyDel } from "@/api/scheduling"
import http from '../../api/http'
const { proxy } = getCurrentInstance()
const tableData = ref([{}])
const formEnergy = reactive({})
const energyForm = ref()
const dialogVisible = ref(false)
const getEnergyData = async () => {
await http.post("/api/energy/getData", tableData.energyType = ["0", "1", "2", "3", "4"]).then(res => {
console.log("res:", res);
tableData.value = res.data
}).catch(err => {
console.log(error)
})
ElMessage.success('查询成功')
console.log("tableData:", tableData.value);
// config.total = data.count
}
const tableLabel = reactive([
{
prop: 'allowPagingId',
label: "序号",
width: 100
},
{
prop: 'supplyName',
label: '名称',
width: 200
},
{
prop: 'energyType',
label: "能源类型"
},
{
prop: 'record',
label: "用度",
width: 200
},
{
prop: 'recordDate',
label: "日期",
width: 300
}
])
const formInline = reactive({
keyWord: ''
})
const config = reactive({
total: 0,
page: 1,
supplyName: "",
})
const handleSearch = () => {
config.supplyName,
getEnergyData(),
config.supplyName = ''
}
const timeFormat = (time) => {
var time = new Date(time)
var year = time.getFullYear()
var month = time.getMonth()
var date = time.getDate()
function add(m) {
return m < 10 ? '0' + m : m
}
return year + '/' + add(month) + '/' + add(date) + ' 0:00:00'
}
//表单校验规则
const rules = reactive({
supplyName: [{ required: true, message: "名称是必填项", trigger: "blur" }],
energyType: [
{ required: true, message: "能源类型是必填项", trigger: "blur" },
],
record: [{ required: true, message: "能源用度是必选项", trigger: "change" }],
recordDate: [{ required: true, message: "日期是必选项" }]
})
//
const handleChange = (page) => {
config.page = page,
getEnergyData()
}
// 删除
// const handleDelete = async (row) => {
// // console.log(row.energyId);
// console.log('"'+row.energyId+'"');
// await ElMessageBox.confirm("你确定要删除吗?", {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// confirmButtonClass: 'ExitConfirmButton'
// }).then(async () => {
// // await postEnergyDel('"'+row.energyId+'"')
// await postEnergyDel({EnergyId:row.energyId})
// ElMessage({
// type: 'success', message: '删除成功'
// })
// getEnergyData()
// })
// }
// 删除
// const handleDelete = async (row) => {
// console.log(row.energyId);
// console.log('"' + row.energyId + '"');
// let EnergyId = row.energyId
// await ElMessageBox.confirm("你确定要删除吗?", {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// confirmButtonClass: 'ExitConfirmButton'
// })
// await http.post("api/energy/Delete?EnergyId="+'"'+row.energyId +'"',false ).then(res => {
// console.log(res);
// }).then(res => {
// ElMessage({
// type: 'success', message: '删除成功'
// })
// getEnergyData()
// })
// }
// 新增
const action = ref('add')
const handleClose = () => {
dialogVisible.value = false
// proxy.$ref['energyForm'].resetFields()
}
const handleCancel = () => {
dialogVisible.value = false
// proxy.$ref['energyForm'].resetFields()
}
const handleAdd = () => {
action.value = "add",
dialogVisible.value = true;
// proxy.$refs['energyForm'].resetFields()
formEnergy.supplyName = '',
formEnergy.energyType = ''
}
const handleEdit = (val) => {
action.value = "edit"
dialogVisible.value = true
nextTick(() => {
Object.assign(formEnergy, { ...val })
})
}
const onSubmit = () => {
energyForm.value.validate(async (valid) => {
if (valid) {
let res = null;
formEnergy.recordDate = /^\d{4}-\d{2}-\d{2}$/.test(formEnergy.recordDate) ? formEnergy.recordDate : timeFormat(formEnergy.recordDate)
if (action.value === 'add') {
// res = await proxy.$api.addEnergy(formEnergy)
// res =await postEnergyManageSave(formEnergy.value)
// console.log(res);
await http.post("api/energy/Save",formEnergy.value , false).then(res => {
console.log(res);
}).then(res => {
ElMessage({
type: 'success', message: '新增成功'
})
getEnergyData()
})
if (res) {
dialogVisible.value = false
// proxy.$refs['energyForm'].resetFields()
getEnergyData()
}
} else {
// res = await proxy.$api.editEnergy(formEnergy)
res = postEnergyManageSave(formEnergy.value)
console.log(res);
proxy.$refs['energyForm'].resetFields()
dialogVisible.value = false
getEnergyData()
}
} else {
ElMessage({
showClose: true,
message: '请输入正确的内容',
type: 'error'
})
}
})
}
onMounted(() => {
getEnergyData()
})
</script>
<template>
<table class="table_search" cellpadding="0" cellspacing="1" style="background-color: #99bbe8;width: 100%;">
<tr style="height: 10px;">
<th width="30%">
<span>能源类型:</span>
</th>
<th style=" background-color: #ffffff;">
<div class="th_div">
<el-form ref="formRef" :model="formInline" :inline="true"
style="display: flex; justify-content: center; align-items: center; margin: 0;">
<el-form-item class="select-clean" prop="supplyName" label-width="280px" style="margin: 0;">
<el-select v-model="config.supplyName" placeholder="请选择" style="width:360px; margin-left: 20px;">
<el-option label="东部供热站" value="东部供热站" />
<el-option label="行政区供热站" value="行政区供热站" />
<el-option label="福宛里供热站" value="福宛里供热站" />
</el-select>
</el-form-item>
</el-form>
</div>
</th>
<th width="100%" style="background-color: #ffffff;text-align: left;">
<el-button type="primary" @click="handleSearch">
<Search style="width: 1em; height: 1em; margin-right: 8px" />
查询
</el-button>
<el-button type="primary" @click="handleAdd">
<Document style="width: 1em; height: 1em; margin-right: 8px" />
新增
</el-button>
</th>
</tr>
</table>
<div class="table">
<el-table :data="tableData" style="width: 100%;font-size: 12px;color: #181818;"
:header-cell-style="{ color: '#225475', backgroundColor: '#B8CFEE', 'text-align': 'center', height: '30px', padding: '0px', border: '1px solid #99bbe8' }"
:cell-style="{ 'text-align': 'center', padding: '0px' }" :row-style="{ height: '30px', padding: '0px' }" border
stripe>
<el-table-column v-for="item in tableLabel" :key="item.prop" :width="item.width ? item.width : 150"
:prop="item.prop" :label="item.label" />
<!-- <el-table-column prop="allowPagingId" label="Date" width="180" />
<el-table-column prop="supplyName" label="Name" width="180" />
<el-table-column prop="energyType" label="Address" />
<el-table-column prop="record" label="Address" />
<el-table-column prop="recordDate" label="Address" /> -->
<el-table-column fixed="right" label="操作" min-width="140">
<template #="scope">
<el-button link type="primary" size="small" @click="handleEdit(scope.row)">
编辑
</el-button>
<el-button link type="primary" size="small" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="bottom">
<div class="bottom-left" style="color: #4B4847; font-size: 12px;">
共{{ config.total }}条记录,当前为第{{ config.page }}页,共{{ parseInt(config.total / 10 + 0.9) }}页
</div>
<el-pagination background layout="prev, pager, next" next-text="下一页" class="pager" :total="config.total"
size="small" @current-change="handleChange" />
</div>
</div>
<el-dialog v-model="dialogVisible" :title="action == 'add' ? '数据新增' : '数据修改'" width="50%" :before-close="handleClose">
<el-form :inline="true" :model="formEnergy" :rules="rules" ref="energyForm" :hide-required-asterisk="true">
<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="formEnergy.supplyName" 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-select v-model="formEnergy.energyType" placeholder="请选择">
<el-option label="热" value="1" />
<el-option label="水" value="2" />
<el-option label="电" value="3" />
<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-form-item prop="record" style="margin: 0;padding: 0;width: 100%;">
<el-input v-model="formEnergy.record" placeholder="请输入能源用度" />
</el-form-item>
</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>
<el-form-item prop="recordDate" style="margin: 0;padding: 0;width: 100%;">
<el-date-picker value-format="YYYY-MM-DD HH:mm:ss" v-model="formEnergy.recordDate" type="datetime"
placeholder="请输入日期" style="width: 100%" />
</el-form-item>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="dialog-footer">
<el-button type="primary" @click="handleCancel">关闭</el-button>
<el-button type="primary" @click="onSubmit">保存</el-button>
</div>
</el-form>
</el-dialog>
</template>
<style scoped lang="less">
.energy-header {
display: flex;
}
.select-clean {
display: flex;
}
.table {
margin-top: 10px;
margin-left: 4px;
}
.table_search {
width: 100%;
margin-left: 4px;
}
table,
tr,
th,
td {
font-size: 14px;
margin: 0;
padding: 0;
}
table {
width: 100%;
}
table th {
background-color: #dfe8f6;
text-align: center;
padding: 5px 10px;
}
table td {
text-align: center;
background-color: #ffffff;
padding: 5px 10px;
}
.dialog-footer {
text-align: center;
margin-top: 10px;
background-color: #ffffff;
}
//鼠标所在行的颜色
::v-deep .el-table__body tr:hover>td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
::v-deep .el-table__body tr.current-row>td {
background-color: #92cbf1 !important;
}
.bottom {
// border: 1px solid red;
margin-top: 10px;
width: 100%;
display: flex;
right: 10px;
bottom: 30px;
justify-content: space-between;
.bottom-left {
display: flex;
}
.pager {
display: flex;
}
}
</style>
<template>
<div class="contentBlock">
<div class="contentBlockInn">
<el-card class="card-contianer">
<div class="card-header">
<span>瞬时热量对比配置</span>
</div>
<table cellpadding="0" cellspacing="1">
<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 style="width: 80%" v-model="List.planName"></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 style="width: 80%" v-model="List.diffPercentage"></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 style="width: 80%" v-model="List.timeoutMin"></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 style="width: 80%" v-model="List.tempRegulation"></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 style="width: 80%" type="textarea" rows="6" v-model="List.description"></el-input>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="btngrounp">
<el-button type="primary" @click="onSave">保存</el-button>
<el-button type="primary" style="margin: 0 0 0 5px" @click="onCancel">关闭</el-button>
</div>
</el-card>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, onUnmounted } from "vue";
import { postInstantHeat, postInstantHeatUpdate } from "@/api/scheduling"
import { toRaw } from "@vue/reactivity";
import { ElMessage } from "element-plus";
import http from "../../api/http";
const loading = ref(false)
const List = ref([
{
"planId": "",
"planName": "",
"diffPercentage": "",
"timeoutMin": "",
"tempRegulation": "",
"description": "",
"isActive": ''
}
])
const getInstanceHeat = async () => {
loading.value = true
const data = await postInstantHeat();
console.log(data);
List.value = data.data[0]
loading.value = false
}
const onSave = async () => {
// await postInstantHeatUpdate(List.value)
await http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((result) => {
}).catch((error) => {
console.log(error)
})
ElMessage.success('修改成功')
getInstanceHeat()
}
onMounted(() => {
getInstanceHeat()
})
</script>
<style lang="less" scoped>
.card-contianer {
background-color: #DFE8F6;
}
.card-header {
text-align: center;
font-weight: 700;
font-size: 28px;
margin-bottom: 10px;
}
.btngrounp {
margin-top: 10px;
text-align: center;
}
table {
width: 100%;
}
table,
tr,
th,
td {
font-size: 14px;
margin: 0;
padding: 0;
}
table {
width: 100%;
border-collapse: collapse;
}
table th {
background-color: #F2F6F8;
text-align: center;
padding: 5px 10px;
border: 1px solid #DFE8F6;
}
table td {
text-align: center;
background-color: #ffffff;
padding: 5px 10px;
border: 1px solid #DFE8F6;
border-bottom: 0;
}
table.botList td {
width: 33%;
text-align: left;
font-weight: bolder;
}
</style>
<script setup>
import {onMounted, ref} from "vue";
import {ElMessageBox} from "element-plus";
import {getPhenomenon,addPhenomenon,alterPhenomenon,deletePhenomenon} from "@/api/scheduling.js"
const data = ref()
const dataBackup = ref([])
const searchKey = ref('') // 查询参数
const reviseWindowOpen = ref(false)
const addWindowOpen = ref(false)
const reviseForm = ref({}) // 修改表单
const addForm = ref({}) // 新增表单
const tableHeaderClass = data => { // 表头样式
return 'table-header-class'
}
const tableBodyClass = data => { // 表体样式
return 'table-body-class'
}
function add(){
addWindowOpen.value = true
} // 新增按钮单击事件
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 search(){
if(!searchKey.value){
getData()
}else {
data.value = dataBackup.value.filter(item => item.phenomenonName.includes(searchKey.value) )
}
}
function handleClose(){
reviseWindowOpen.value = false
addWindowOpen.value = false
resetInput()
} // 关闭弹窗
function onReviseSubmit(){
alterPhenomenon(reviseForm.value).then(res=>{
getData()
reviseWindowOpen.value = false
})
} // 修改表单提交
function onAddSubmit(){
addPhenomenon(addForm.value).then(res=>{
handleClose()
getData()
})
} // 新增表单提交
function resetInput(){
addForm.value = {
phenomenonName: '',
phenomenonType: '',
phenomenonTemp: '',
phenomenonDesc: ''
}
} // 清空新增表单输入框
onMounted(()=>{
getData()
})
function getData(){
getPhenomenon().then(res => {
data.value = res.data
dataBackup.value = [...data.value]
})
}
</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 clearable v-model="searchKey"/>
</el-col>
</el-row>
<el-button type="primary" @click="search" class="add-search-btn">查询</el-button>
<el-button type="primary" @click="add" 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>
</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>
</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="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-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="onReviseSubmit">保存</el-button>
<el-button type="primary" @click="handleClose">关闭</el-button>
</div>
</template>
</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="addForm.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="addForm.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>
</template>
<style lang="less" scoped>
.phenomenon-container{
width: 100%;
margin: 4px;
}
.search-wrapper {
width: 100%;
display: flex;
justify-content: start;
}
.search-wrapper .el-row {
width: 50%;
border: none;
display: flex;
align-items: center;
margin: 5px 10px 5px 5px;
}
.el-col[label] {
display: flex;
justify-content: end;
align-items: center;
}
.add-search-btn {
margin: 5px 10px 5px 0;
}
:deep(.table-header-class) {
text-align: center;
font-size: 12px;
background-color: #c4d8f1 !important;
color: #124c6a;
}
:deep(.table-body-class) {
font-size: 12px;
color: black;
}
.table-operate-column {
display: flex;
justify-content: center;
align-items: center;
}
.table-operate-column .el-button {
font-size: 12px;
}
::v-deep .el-table__body tr:hover > td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
.el-row[first]{
border-top: 1px solid #a6c3e9;
}
.el-row{
border-left: 1px solid #a6c3e9;
border-right: 1px solid #a6c3e9;
border-bottom: 1px solid #a6c3e9;
width: 100%;
height: 35px;
color: #124362;
}
.el-col[col-label]{
display: flex;
justify-content: end;
align-items: center;
border-right: 1px solid #a6c3e9;
background-color: #dfe8f6;
padding-right: 5px;
}
.el-col[col-value]{
display: flex;
justify-content: start;
align-items: center;
padding-left: 5px;
}
.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 ReviseWindow from "./weatherManageSub/ReviseWindow.vue";
import BindWindow from "./weatherManageSub/BindWindow.vue";
import {getWeatherMagData, alterWeatherMagData, getTransfer} from '@/api/scheduling.js'
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 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(id).then(res=>{
// // console.log(res)
// })
dependentSub.value = row
bindWindowOpen.value = true
}
const confirmRevise = val => { // 修改弹窗确认按钮事件
alterWeatherMagData(val).then(res=>{
getData()
reviseWindowOpen.value = false
})
}
const confirmBind = val => {
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>
<div class="weather-manage-container">
<el-row>
<el-col :span="15" left-col>
</el-col>
<el-col :span="9" right-col>
<el-button type="primary" @click="addWindowOpen = true" class="add-btn">新增</el-button>
<!-- <el-button type="primary" class="add-btn">新增</el-button>-->
<el-button type="primary">查询</el-button>
</el-col>
</el-row>
<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 prop="allowPagingId" label="编号" align="center" width="60"/>
<el-table-column prop="customizeName" label="自定义名称" width="200"/>
<el-table-column prop="supplyName" label="供热站名称" width="160"/>
<el-table-column prop="operateTime" label="操作时间" width="210"/>
<el-table-column prop="isFixed" label="干预模式" width="120"/>
<el-table-column prop="temperature" label="温度" width="60"/>
<el-table-column prop="wind" label="风速" width="60"/>
<el-table-column prop="illumination" label="光照" width="60"/>
<el-table-column prop="isAuto" label="手自动切换" width="120"/>
<el-table-column prop="diffPercentage" label="自动偏差百分比" width="170"/>
<el-table-column prop="timeoutMin" label="验证时间" width="100"/>
<el-table-column prop="tempRegulation" label="调节温度" width="100"/>
<el-table-column prop="sort" label="排序" width="60"/>
<el-table-column label="操作" width="200">
<template #default="scope">
<div class="table-operate-column">
<!-- <el-link :underline="false" @click="revise(scope.row)" type="primary">修改</el-link>-->
<!-- <el-link :underline="false" @click="bind(scope.row)" type="primary">绑定换热站</el-link>-->
<!-- <el-link :underline="false" type="primary">详情</el-link>-->
<el-button link @click="revise(scope.row)" type="primary">修改</el-button>
<el-button link @click="bind(scope.row)" type="primary">绑定换热站</el-button>
<el-button link type="primary">详情</el-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="dialog-wrapper">
<AddWindow
:open="addWindowOpen"
@onCancel="handleAddWinOpenClose"
@on-confirm="handleAdd"></AddWindow>
<ReviseWindow
:open="reviseWindowOpen"
:data="dependentSub"
@onCancel="reviseWindowOpen = false"
@onConfirm="confirmRevise"
></ReviseWindow>
<BindWindow
:open="bindWindowOpen"
:data="dependentSub"
@onCancel="bindWindowOpen = false"
@onConfirm="confirmBind"></BindWindow>
</div>
</div>
</template>
<style scoped>
.weather-manage-container {
width: 100%;
margin: 4px;
}
.el-col[left-col] {
border-right: 1px solid #a6c3e9;
}
.el-row {
width: 100%;
border: 1px solid #a6c3e9;
margin: 5px 0 10px 0;
}
.el-col[right-col] {
padding-left: 10px;
}
.add-btn {
margin: 5px 0;
}
:deep(.table-header-class) {
text-align: center;
font-size: 12px;
background-color: #c4d8f1 !important;
color: #124c6a;
}
:deep(.table-body-class) {
font-size: 12px;
color: black;
}
.table-wrapper {
}
.table-operate-column {
display: flex;
justify-content: center;
align-items: center;
}
.table-operate-column .el-button {
font-size: 12px;
}
::v-deep .el-table__body tr:hover > td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
</style>
\ No newline at end of file
<script setup>
import {onMounted, ref, watch, watchEffect} from "vue";
import {ElMessageBox} from "element-plus";
import {getWind, deleteWind, alterWind, addWind} from "@/api/scheduling.js"
const data = ref()
const dataBackup = ref([])
const searchKey = ref('') // 查询参数
const reviseWindowOpen = ref(false)
const addWindowOpen = ref(false)
const reviseForm = ref({}) // 修改表单
const addForm = ref({}) // 新增表单
const tableHeaderClass = data => { // 表头样式
return 'table-header-class'
}
const tableBodyClass = data => { // 表体样式
return 'table-body-class'
}
function add() {
addWindowOpen.value = true
} // 新增按钮单击事件
function revise(val) {
reviseForm.value = {...val}
reviseWindowOpen.value = true
} // 修改按钮单击事件
function omit(val) {
let id = val.windId
ElMessageBox.confirm(
'点击确定后,该条数据将删除,是否继续?',
'Warning',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
deleteWind(id).then(res => {
getData()
})
}).catch(err => {
})
} // 删除按钮单击事件
function search() {
if(!searchKey.value){
getData()
}else {
data.value = dataBackup.value.filter(item => searchKey.value == item.windLevel)
}
} // 处理查询
function handleClose() {
reviseWindowOpen.value = false
addWindowOpen.value = false
resetInput()
} // 关闭弹窗
function onReviseSubmit() {
alterWind(reviseForm.value).then(res => {
getData()
handleClose()
})
} // 修改表单提交
function onAddSubmit() {
addWind(addForm.value).then(res => {
getData()
handleClose()
})
} // 新增表单提交
onMounted(() => {
getData()
})
function getData() {
getWind().then(res => {
data.value = res.data
dataBackup.value = [...data.value]
})
}
function resetInput() {
addForm.value = {
windLevel: '',
windTemp: '',
windDesc: ''
}
}
</script>
<template>
<div class="windManage-container">
<div class="search-wrapper">
<el-row>
<el-col :span="8" label>级数:</el-col>
<el-col :span="16">
<el-select placeholder="" clearable style="width: 200px" v-model="searchKey">
<el-option v-for="item in 14" :key="item" :value="item" :label="item"/>
</el-select>
</el-col>
</el-row>
<el-button type="primary" @click="search" class="add-search-btn">查询</el-button>
<el-button type="primary" @click="add" 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>
<div class="dialog-footer">
<el-button type="primary" @click="onReviseSubmit">保存</el-button>
<el-button type="primary" @click="handleClose">关闭</el-button>
</div>
</template>
</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.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="addForm.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="addForm.windDesc" 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>
</template>
<style lang="less" scoped>
.windManage-container {
width: 100%;
margin: 4px;
}
.search-wrapper {
width: 100%;
display: flex;
justify-content: start;
}
.search-wrapper .el-row {
width: 50%;
border: none;
display: flex;
align-items: center;
margin: 5px 10px 5px 5px;
}
.el-col[label] {
display: flex;
justify-content: end;
align-items: center;
}
.add-search-btn {
margin: 5px 10px 5px 0;
}
:deep(.table-header-class) {
text-align: center;
font-size: 12px;
background-color: #c4d8f1 !important;
color: #124c6a;
}
:deep(.table-body-class) {
font-size: 12px;
color: black;
}
.table-operate-column {
display: flex;
justify-content: center;
align-items: center;
}
.table-operate-column .el-button {
font-size: 12px;
}
::v-deep .el-table__body tr:hover > td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
.el-row[first] {
border-top: 1px solid #a6c3e9;
}
.el-row {
border-left: 1px solid #a6c3e9;
border-right: 1px solid #a6c3e9;
border-bottom: 1px solid #a6c3e9;
width: 100%;
height: 35px;
color: #124362;
}
.el-col[col-label] {
display: flex;
justify-content: end;
align-items: center;
border-right: 1px solid #a6c3e9;
background-color: #dfe8f6;
padding-right: 5px;
}
.el-col[col-value] {
display: flex;
justify-content: start;
align-items: center;
padding-left: 5px;
}
.el-input {
color: black;
height: 24px;
}
</style>
\ No newline at end of file
<script setup>
import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect} from "vue";
const props = defineProps({
open: {
type: Boolean,
default: false,
required: true
}
})
const emit = defineEmits(['onCancel','onConfirm'])
const addData = ref({
transfers:[], // 换热站
customizeName: '', // 自定义名称
diffPercentage: '', // 自动偏差百分比
illumination: '', // 光照
isAuto: false, // 是否自动模式
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
operateTime:"", // 操作时间
sort: '', // 排序
tempRegulation: '', // 自动调节温度
temperature: '', // 温度
timeoutMin: '', // 自动验证循环时间
wind: '', // 风速
description: null, // 排序字段,全为Null
updateNullFields:"", // 无用,但不为空
isActive:false, // 是否启用
})
const inputStyle = {
color: 'black',
height: '24px'
}
function handleClose() {
addData.value = {
customizeName: '', // 自定义名称
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
temperature: '', // 温度
wind: '', // 风速
illumination: '', // 光照
sort: '', // 排序
isAuto: false, // 是否自动模式
diffPercentage: '', // 自动偏差百分比
timeoutMin: '', // 自动验证循环时间
tempRegulation: '', // 自动调节温度
operateTime:"", // 操作时间
description: null, // 排序字段,全为Null
updateNullField:"", // 无用,但不为空
isActive:false, // 是否启用
supplyId:'', // 供热站编号
}
emit('onCancel')
}
function handleConfirm() {
addData.value.operateTime = getCurrentDateTime()
emit('onConfirm',addData.value)
addData.value = {
customizeName: '', // 自定义名称
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
temperature: '', // 温度
wind: '', // 风速
illumination: '', // 光照
sort: '', // 排序
isAuto: false, // 是否自动模式
diffPercentage: '', // 自动偏差百分比
timeoutMin: '', // 自动验证循环时间
tempRegulation: '', // 自动调节温度
operateTime:"", // 操作时间
description: null, // 排序字段,全为Null
updateNullField:"", // 无用,但不为空
isActive:false, // 是否启用
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>
<el-dialog
v-model="props.open"
width="1000px"
title="新增"
@close="emit('onCancel')">
<template #default>
<div class="dialog-content">
<el-row style="border-top: #a6c3e9 1px solid">
<el-col :span="8" class="content-col-label">自定义名称:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="addData.customizeName" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
<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="true" :style="{marginLeft:'10px'}">固定模式</el-radio>
<el-radio :value="false" :style="{marginLeft:'-15px'}">气象仪模式</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row>
<el-col :span="8" class="content-col-label">温度:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="addData.temperature" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="8" class="content-col-label">风速:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="addData.wind" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="8" class="content-col-label">光照:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="addData.illumination" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="8" class="content-col-label">排序:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="addData.sort" style="width: 510px"/>
</el-col>
</el-row>
<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="addData.isAuto" label="自动模式"/>
</el-col>
<el-col :span="5" class="content-col-label">自动偏差百分比(%d):</el-col>
<el-col :span="7" class="content-col-value">
<el-input :input-style="inputStyle" v-model="addData.diffPercentage" style="width: 240px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="5" class="content-col-label">自动验证循环时间(分钟):</el-col>
<el-col :span="7" class="content-col-value">
<el-input :input-style="inputStyle" v-model="addData.timeoutMin" style="width: 240px"/>
</el-col>
<el-col :span="5" class="content-col-label">自动调节温度(℃):</el-col>
<el-col :span="7" class="content-col-value">
<el-input :input-style="inputStyle" v-model="addData.tempRegulation" style="width: 240px"/>
</el-col>
</el-row>
</div>
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleConfirm">保存</el-button>
<el-button type="primary" @click="handleClose">关闭</el-button>
</div>
</template>
</el-dialog>
</template>
<style scoped>
.el-row {
color: black;
height: 35px;
border-bottom: #a6c3e9 1px solid;
border-left: #a6c3e9 1px solid;
border-right: #a6c3e9 1px solid;
}
.content-col-label {
display: flex;
justify-content: end;
align-items: center;
background-color: #dfe8f6;
border-right: #a6c3e9 1px solid;
padding-right: 5px;
}
.content-col-value {
display: flex;
justify-content: start;
align-items: center;
padding-left: 5px;
}
.el-input {
color: black;
}
.el-radio{
color: black;
}
.el-checkbox{
color: black;
}
</style>
\ No newline at end of file
<script setup>
import {ref, defineProps, defineEmits, watchEffect} from "vue";
const props = defineProps({
open: {
type: Boolean,
default: false,
required: true
},
data: {
type: Object,
default: null,
required: true
}
})
const emit = defineEmits({
onCancel: null,
onConfirm: ({}) => {
return true
}
})
const bindData = ref({})
watchEffect(()=>{
bindData.value = {...props.data}
})
const inputStyle = {
color: 'black',
height: '24px'
}
const heatingStationList = ref([
'行政区供热站',
'二号供热站',
'三号供热站'
]) // 供热站列表
const heatExchangeList = ref([
'兴安里',
'永明里',
'润泽园',
'凯旋一期',
'凯旋二期',
'凯旋三期',
'兴旺里东区',
'兴旺里西区',
'兴盛里南环',
'兴盛里北环',
'七邻里',
'胜利里南区',
'胜利里北区',
'兴慧里',
'兴德里',
'行政办公区',
'开元里',
'振业里'
]) // 换热站列表
const onSubmit = ()=>{
emit('onConfirm', bindData)
} // 点击保存按钮
</script>
<template>
<el-dialog
v-model="props.open"
width="1000px"
title="换热站绑定"
@close="emit('onCancel')">
<template #default>
<div class="dialog-content">
<el-row style="border-top: #a6c3e9 1px solid" class="not-select-row">
<el-col :span="8" class="content-col-label">自定义名称:</el-col>
<el-col :span="16" class="content-col-value">
<el-input v-model="bindData.customizeName" style="width: 510px" :input-style="inputStyle"/>
</el-col>
</el-row>
<el-row class="not-select-row">
<el-col :span="8" class="content-col-label">供热站:</el-col>
<el-col :span="16" class="content-col-value">
<el-select v-model="bindData.supplyName" placeholder="" style="width: 210px;" class="custom-select" size="small">
<el-option v-for="item in heatingStationList" :key="item" :label="item" :value="item"/>
</el-select>
</el-col>
</el-row>
<el-row class="select-row">
<el-col :span="8" class="content-col-label">换热站:</el-col>
<el-col :span="16" class="content-col-value">
<el-checkbox-group v-model="bindData.heatExchangeList" style="width: 510px">
<el-checkbox v-for="item in heatExchangeList" :key="item" :label="item"/>
</el-checkbox-group>
</el-col>
</el-row>
</div>
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="onSubmit">保存</el-button>
<el-button type="primary" @click="emit('onCancel')">关闭</el-button>
</div>
</template>
</el-dialog>
</template>
<style scoped>
.not-select-row {
color: black;
height: 35px;
border-bottom: #a6c3e9 1px solid;
border-left: #a6c3e9 1px solid;
border-right: #a6c3e9 1px solid;
}
.select-row{
color: black;
border-bottom: #a6c3e9 1px solid;
border-left: #a6c3e9 1px solid;
border-right: #a6c3e9 1px solid;
}
.content-col-label {
display: flex;
justify-content: end;
align-items: center;
background-color: #dfe8f6;
border-right: #a6c3e9 1px solid;
padding-right: 5px;
}
.content-col-value {
display: flex;
justify-content: start;
align-items: center;
padding-left: 5px;
}
.el-input {
color: black;
}
.el-checkbox{
color: black;
}
.custom-select .el-input__inner{
color: yellow;
background-color: #dfe8f6;
}
</style>
\ No newline at end of file
<script setup>
import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect} from "vue";
const props = defineProps({
open: {
type: Boolean,
default: false,
required: true
},
data: {
type: Object,
default: {},
required:true
}
})
const emit = defineEmits({
onCancel: null,
onConfirm: data => {
return true
}
})
const reviseData = ref({})
watchEffect(()=>{
reviseData.value = {...props.data}
})
const inputStyle = {
color: 'black',
height: '24px'
}
const switchingisAuto = computed({
get() {
return reviseData.value.isAuto === '自动模式'
},
set(newValue) {
if (newValue) {
reviseData.value.isAuto = '自动模式'
} else {
reviseData.value.isAuto = '手动模式'
}
}
}) // 可写计算属性,手动、自动模式切换
</script>
<template>
<el-dialog
v-model="props.open"
width="1000px"
title="自定义修改"
@close="emit('onCancel')">
<template #default>
<div class="dialog-content">
<el-row style="border-top: #a6c3e9 1px solid">
<el-col :span="8" class="content-col-label">自定义名称:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="reviseData.customizeName" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="8" class="content-col-label">干预模式:</el-col>
<el-col :span="16" class="content-col-value">
<el-radio-group v-model="reviseData.isFixed">
<el-radio value="固定模式" :style="{marginLeft:'10px'}">固定模式</el-radio>
<el-radio value="气象仪模式" :style="{marginLeft:'-15px'}">气象仪模式</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row>
<el-col :span="8" class="content-col-label">温度:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="reviseData.temperature" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="8" class="content-col-label">风速:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="reviseData.wind" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="8" class="content-col-label">光照:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="reviseData.illumination" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="8" class="content-col-label">排序:</el-col>
<el-col :span="16" class="content-col-value">
<el-input :input-style="inputStyle" v-model="reviseData.sort" style="width: 510px"/>
</el-col>
</el-row>
<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-col>
<el-col :span="5" class="content-col-label">自动偏差百分比(%d):</el-col>
<el-col :span="7" class="content-col-value">
<el-input :input-style="inputStyle" v-model="reviseData.diffPercentage" style="width: 240px"/>
</el-col>
</el-row>
<el-row>
<el-col :span="5" class="content-col-label">自动验证循环时间(分钟):</el-col>
<el-col :span="7" class="content-col-value">
<el-input :input-style="inputStyle" v-model="reviseData.timeoutMin" style="width: 240px"/>
</el-col>
<el-col :span="5" class="content-col-label">自动调节温度(℃):</el-col>
<el-col :span="7" class="content-col-value">
<el-input :input-style="inputStyle" v-model="reviseData.tempRegulation" style="width: 240px"/>
</el-col>
</el-row>
</div>
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="emit('onConfirm', reviseData)">保存</el-button>
<el-button type="primary" @click="emit('onCancel')">关闭</el-button>
</div>
</template>
</el-dialog>
</template>
<style scoped>
.el-row {
color: black;
height: 35px;
border-bottom: #a6c3e9 1px solid;
border-left: #a6c3e9 1px solid;
border-right: #a6c3e9 1px solid;
}
.content-col-label {
display: flex;
justify-content: end;
align-items: center;
background-color: #dfe8f6;
border-right: #a6c3e9 1px solid;
padding-right: 5px;
}
.content-col-value {
display: flex;
justify-content: start;
align-items: center;
padding-left: 5px;
}
.el-input {
color: black;
}
.el-radio{
color: black;
}
.el-checkbox{
color: black;
}
</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