Commit 30be4035 authored by 王亚晖's avatar 王亚晖
parents 7646d36d 8a4c5d8e
This diff is collapsed.
This diff is collapsed.
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
"jsencrypt": "^3.3.2", "jsencrypt": "^3.3.2",
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"less": "^4.2.0", "less": "^4.2.0",
"lodash": "^4.17.21",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"node-sass": "^9.0.0", "node-sass": "^9.0.0",
"public-ip": "^6.0.2", "public-ip": "^6.0.2",
......
...@@ -92,8 +92,15 @@ export const postExternalQOQ = params => { ...@@ -92,8 +92,15 @@ export const postExternalQOQ = params => {
}) })
} }
//换热站机组用量同比接口(耗水量、耗电量、耗热量) //换热站机组用量同比接口(耗水量、耗电量、耗热量)网内
export const postYOY = params => { export const postWithinYOY = params => {
return http.post(`/api/analysis/within/YOY`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
//换热站机组用量同比接口(耗水量、耗电量、耗热量)网外
export const postExternalYOY = params => {
return http.post(`/api/analysis/external/YOY`, params).then(res => res).catch(function (error) { return http.post(`/api/analysis/external/YOY`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
......
...@@ -77,7 +77,7 @@ export const alterWeatherMagData = params => { // 添加或修改气象干预数 ...@@ -77,7 +77,7 @@ export const alterWeatherMagData = params => { // 添加或修改气象干预数
return http.post(`/api/cusweather/SaveAll`, params) return http.post(`/api/cusweather/SaveAll`, params)
} }
export const getTransfer = param => { // 获取换热站列表 export const getTransferInterface = param => { // 获取换热站列表
return http.post("/api/cusweather/getTransferIds",param) return http.post("/api/cusweather/getTransferIds",param)
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -5,83 +5,84 @@ ...@@ -5,83 +5,84 @@
<div class="card-header"> <div class="card-header">
<span>瞬时热量对比配置</span> <span>瞬时热量对比配置</span>
</div> </div>
<el-form ref="formRef" :rules="rules" :model="List" label-width="auto">
<table v-loading="loading" cellpadding="0" cellspacing="1">
<table cellpadding="0" cellspacing="1"> <tr>
<tr> <th style="width: 25%">计划名称</th>
<th style="width: 25%">计划名称:</th> <td style="width: 60%; margin:0; padding: 0">
<td style="width: 60%; margin:0; padding: 0"> <table cellpadding="0" cellspacing="0">
<table cellpadding="0" cellspacing="0"> <tr>
<tr> <td style="text-align: left">
<td style="text-align: left"> <el-form-item prop="planName" style="padding: 0;margin: 0;">
<el-input style="width: 80%" v-model="List.planName"></el-input> <el-input style="width: 80%" v-model="List.planName"></el-input>
</td> </el-form-item>
</tr> </td>
</table> </tr>
</td> </table>
</tr> </td>
<tr> </tr>
<th style="width: 25%">偏差百分比 (%):</th> <tr>
<td style="width: 60%; margin: 0; padding: 0"> <th style="width: 25%">偏差百分比 (%)</th>
<table cellpadding="0" cellspacing="0"> <td style="width: 60%; margin: 0; padding: 0">
<tr> <table cellpadding="0" cellspacing="0">
<td style="text-align: left"> <tr>
<el-input v-float-number style="width: 80%" v-model="List.diffPercentage"></el-input> <td style="text-align: left">
</td> <el-form-item prop="diffPercentage" style="padding: 0;margin: 0;">
</tr> <el-input v-float-number style="width: 80%" v-model="List.diffPercentage"></el-input>
</table> </el-form-item>
</td> </td>
</tr> </tr>
</table>
</td>
<tr> </tr>
<th style="width: 25%">判断时间 (分):</th> <tr>
<td style="width: 60%; margin: 0; padding: 0"> <th style="width: 25%">判断时间 (分)</th>
<table cellpadding="0" cellspacing="0"> <td style="width: 60%; margin: 0; padding: 0">
<tr> <table cellpadding="0" cellspacing="0">
<td style="text-align: left"> <tr>
<el-input style="width: 80%" v-model="List.timeoutMin"></el-input> <td style="text-align: left">
</td> <el-form-item prop="timeoutMin" style="padding: 0;margin: 0;">
</tr> <el-input style="width: 80%" v-model="List.timeoutMin"></el-input>
</table> </el-form-item>
</td> </td>
</tr> </tr>
</table>
</td>
<tr> </tr>
<th style="width: 25%">调节温度 (℃)</th> <tr>
<td style="width: 60%; margin: 0; padding: 0"> <th style="width: 25%">调节温度 (℃)</th>
<table cellpadding="0" cellspacing="0"> <td style="width: 60%; margin: 0; padding: 0">
<tr> <table cellpadding="0" cellspacing="0">
<td style="text-align: left"> <tr>
<el-input v-float-number style="width: 80%" v-model="List.tempRegulation"></el-input> <td style="text-align: left">
</td> <el-form-item prop="tempRegulation" style="padding: 0;margin: 0;">
</tr> <el-input style="width: 80%" v-model="List.tempRegulation"></el-input>
</table> </el-form-item>
</td> </td>
</tr> </tr>
</table>
</td>
<tr> </tr>
<th style="width: 25%">备注</th> <tr>
<td style="width: 60%; margin: 0; padding: 0"> <th style="width: 25%">备注</th>
<table cellpadding="0" cellspacing="0"> <td style="width: 60%; margin: 0; padding: 0">
<tr> <table cellpadding="0" cellspacing="0">
<td style="text-align: left"> <tr>
<el-input style="width: 80%" type="textarea" rows="6" v-model="List.description"></el-input> <td style="text-align: left">
</td> <el-form-item prop="description" style="padding: 0;margin: 0;">
</tr> <el-input style="width: 80%" type="textarea" rows="6" v-model="List.description"></el-input>
</table> </el-form-item>
</td> </td>
</tr> </tr>
</table>
</td>
</table> </tr>
</table>
</el-form>
<div class="btngrounp"> <div class="btngrounp">
<el-button type="primary" @click="onSave">保存</el-button> <el-button type="primary" @click="onSave">保存</el-button>
<el-button type="primary" style="margin: 0 0 0 5px" @click="onCancel">关闭</el-button> <el-button type="primary" style="margin: 0 0 0 5px" @click="onCancel">关闭</el-button>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
...@@ -94,9 +95,9 @@ import { ElMessage } from "element-plus"; ...@@ -94,9 +95,9 @@ import { ElMessage } from "element-plus";
import http from "../../api/http"; import http from "../../api/http";
import { vFloatNumber } from "@/utils/directives.js"; import { vFloatNumber } from "@/utils/directives.js";
const loading = ref(false) const loading = ref(false)
const formRef = ref()
const List = ref(
const List = ref([
{ {
"planId": "", "planId": "",
"planName": "", "planName": "",
...@@ -106,25 +107,46 @@ const List = ref([ ...@@ -106,25 +107,46 @@ const List = ref([
"description": "", "description": "",
"isActive": '' "isActive": ''
} }
]) )
//校验规则
const rules = reactive({
const getInstanceHeat = async () => { planName: [
{ pattern: /^.{1,20}$/, "message": "计划名称必须是1-20位字符", trigger: "blur" }
],
diffPercentage: [
{ pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur" }
],
timeoutMin: [
{ pattern: /^(\d{1,10})$/, "message": "判断时间必须是1-10位正整数", trigger: "blur" }
],
tempRegulation: [
{ pattern: /^(-?\d{1,10})(\.[0-9]{1,4})?$/, message: "请输入正确的调节温度最大值", trigger: "blur" }
],
description: [
{ pattern: /^.{1,50}$/, "message": "备注必须是1-50位字符", trigger: "blur" }
]
});
const getInstanceHeat = () => {
loading.value = true loading.value = true
const data = await postInstantHeat(); http.post("api/Scheduling/BizInstantaneousHeat/Get", false).then(res => {
console.log(data); if (res.success) {
List.value = data.data[0] List.value = res.data[0]
loading.value = false console.log("res.data===>", res.data);
loading.value = false
}
})
} }
const onSave = async () => { const onSave = async () => {
// await postInstantHeatUpdate(List.value) await formRef.value.validate()
await http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((res) => {
await http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((result) => { if (res.success) {
}).catch((error) => { ElMessage.success(res.message)
console.log(error) getInstanceHeat()
}) }
ElMessage.success('修改成功') }).catch((error) => {
getInstanceHeat() console.log(error)
})
} }
onMounted(() => { onMounted(() => {
getInstanceHeat() getInstanceHeat()
......
This diff is collapsed.
<script setup> <script setup>
import {computed, isRef, onMounted, reactive, ref, shallowRef} from "vue"; import {computed, isRef, onBeforeMount, onMounted, reactive, ref, shallowRef} from "vue";
import ReviseWindow from "./weatherManageSub/ReviseWindow.vue"; import ReviseWindow from "./weatherManageSub/ReviseWindow.vue";
import BindWindow from "./weatherManageSub/BindWindow.vue"; import BindWindow from "./weatherManageSub/BindWindow.vue";
import {getWeatherMagData, alterWeatherMagData, deleteWeatherMagData} from '@/api/scheduling.js' import {
getWeatherMagData,
alterWeatherMagData,
deleteWeatherMagData,
getOrganizationStructureInterface
} from '@/api/scheduling.js'
import AddWindow from "./weatherManageSub/AddWindow.vue"; import AddWindow from "./weatherManageSub/AddWindow.vue";
import {ElMessage, ElMessageBox} from "element-plus"; import {ElMessage, ElMessageBox} from "element-plus";
import store from "@/store/index.js";
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
import {vFloatNumber} from "@/utils/directives.js";
const data = ref() const data = ref()
const dataBackup = ref([]);
const reviseWindowOpen = ref(false) // 修改按钮弹窗状态 const reviseWindowOpen = ref(false) // 修改按钮弹窗状态
const bindWindowOpen = ref(false) // 绑定按钮弹窗状态 const bindWindowOpen = ref(false) // 绑定按钮弹窗状态
const addWindowOpen = ref(false) // 新增按钮弹窗状态 const addWindowOpen = ref(false) // 新增按钮弹窗状态
...@@ -20,7 +24,32 @@ const tableHeaderClass = data => { // 表头样式 ...@@ -20,7 +24,32 @@ const tableHeaderClass = data => { // 表头样式
const tableBodyClass = data => { // 表体样式 const tableBodyClass = data => { // 表体样式
return 'table-body-class' return 'table-body-class'
} }
const isAutoSearchKey = ref() // 手自动模式查询
const supplySearchKey = ref() // 供热站查询
const organizationStructure = ref([]) // 组织结构数据
const supplyData = ref([]) // 供热站数据
function search() {
if(!isAutoSearchKey.value && !supplySearchKey.value){
getData()
}else {
if(isAutoSearchKey.value && supplySearchKey.value){
data.value = dataBackup.value.filter(item => {
return item.isAuto === isAutoSearchKey.value && item.supplyName.includes(supplySearchKey.value)
})
}else {
if(isAutoSearchKey.value){
data.value = dataBackup.value.filter(item => {
return item.isAuto === isAutoSearchKey.value
})
}else {
data.value = dataBackup.value.filter(item => {
return item.supplyName.includes(supplySearchKey.value)
})
}
}
}
}
const revise = (row) => { // 修改按钮单击事件 const revise = (row) => { // 修改按钮单击事件
dependentSub.value = row dependentSub.value = row
reviseWindowOpen.value = true reviseWindowOpen.value = true
...@@ -29,6 +58,10 @@ const bind = (row) => { // 绑定按钮单击事件 ...@@ -29,6 +58,10 @@ const bind = (row) => { // 绑定按钮单击事件
dependentSub.value = row dependentSub.value = row
bindWindowOpen.value = true bindWindowOpen.value = true
} }
const cancelRevise = ()=>{
reviseWindowOpen.value = false
getData()
}
const confirmRevise = val => { // 修改弹窗确认按钮事件 const confirmRevise = val => { // 修改弹窗确认按钮事件
let params = cloneDeep(val) let params = cloneDeep(val)
params.isAuto = params.isAuto === '自动模式' ? true : false params.isAuto = params.isAuto === '自动模式' ? true : false
...@@ -48,7 +81,7 @@ const confirmRevise = val => { // 修改弹窗确认按钮事件 ...@@ -48,7 +81,7 @@ const confirmRevise = val => { // 修改弹窗确认按钮事件
}) })
}else { }else {
ElMessage({ ElMessage({
message: '修改失败.', message: res.message,
type: 'error', type: 'error',
}) })
} }
...@@ -76,7 +109,7 @@ const confirmBind = val => { ...@@ -76,7 +109,7 @@ const confirmBind = val => {
bindWindowOpen.value = false bindWindowOpen.value = false
}else { }else {
ElMessage({ ElMessage({
message: '绑定失败.', message: res.message,
type: 'error', type: 'error',
}) })
} }
...@@ -94,30 +127,31 @@ const onCancelBind = () => { ...@@ -94,30 +127,31 @@ const onCancelBind = () => {
bindWindowOpen.value = false bindWindowOpen.value = false
getData() getData()
} }
onMounted(() => { onBeforeMount(()=>{
getData() getData()
getOrganizationStructure()
}) })
function getData() { function getData() {
getWeatherMagData().then(res => { getWeatherMagData().then(res => {
data.value = res.data data.value = res.data
dataBackup.value = [...data.value];
}) })
} }
function handleAddWinOpenClose(){ function handleAddWinOpenClose(){
addWindowOpen.value = false addWindowOpen.value = false
} }
function handleAdd(val){ function handleAdd(val){
console.log("新增数据",val)
alterWeatherMagData(val).then(res=>{ alterWeatherMagData(val).then(res=>{
if(res.success){ if(res.success){
getData()
addWindowOpen.value = false
ElMessage({ ElMessage({
message: '新增成功.', message: res.message,
type: 'success', type: 'success',
}) })
addWindowOpen.value = false
getData()
}else { }else {
ElMessage({ ElMessage({
message: '新增失败.', message: res.message,
type: 'error', type: 'error',
}) })
} }
...@@ -139,17 +173,54 @@ function getCurrentDateTime() { ...@@ -139,17 +173,54 @@ function getCurrentDateTime() {
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
} // 生成时间 } // 生成时间
function getSupply() {
supplyData.value = []
organizationStructure.value[0].serviceCenterList.forEach(fir_item => {
fir_item.supplyList.forEach(sec_item => {
let temp = {
supplyId: sec_item.supplyId,
supplyName: sec_item.supplyName,
}
supplyData.value.push({...temp})
})
})
} // 根据组织结构获取供热站数据
function getOrganizationStructure() {
getOrganizationStructureInterface().then(res => {
organizationStructure.value = res.data
getSupply()
}).catch(err => {
ElMessage.error('接口异常,获取数据失败.')
})
} // 获取组织结构
function resetSearch(){
isAutoSearchKey.value = ''
supplySearchKey.value = ''
getData()
}
</script> </script>
<template> <template>
<div class="weather-manage-container"> <div class="weather-manage-container">
<el-row> <el-row>
<el-col :span="15" left-col> <el-col :span="15" left-col>
<el-button type="primary" @click="addWindowOpen = true" class="add-btn">新增</el-button> <div class="isAuto-search-area">
<el-button type="primary" @click="getData">查询</el-button> 手自动模式:
<el-select v-model="isAutoSearchKey" style="width: 220px" placeholder="请选择手自动模式" clearable>
<el-option :label="手动模式" value="手动模式"/>
<el-option :label="自动模式" value="自动模式"/>
</el-select>
</div>
<div class="supplyName-search-area">
供热站名称:
<el-input v-model="supplySearchKey" placeholder="请输入供热站名称" clearable style="width: 220px"/>
</div>
</el-col> </el-col>
<el-col :span="9" right-col> <el-col :span="7" right-col>
<el-button type="primary" @click="addWindowOpen = true" class="add-btn">新增</el-button>
<el-button type="primary" @click="search">查询</el-button>
<el-button type="primary" @click="resetSearch">重置</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div class="table-wrapper"> <div class="table-wrapper">
...@@ -158,7 +229,8 @@ function getCurrentDateTime() { ...@@ -158,7 +229,8 @@ function getCurrentDateTime() {
stripe stripe
border border
style="width: 100%" style="width: 100%"
height="900px" height="720px"
:default-sort="{ prop: 'operateTime', order: 'descending' }"
:header-cell-class-name="tableHeaderClass" :header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass"> :row-class-name="tableBodyClass">
<el-table-column prop="allowPagingId" label="编号" align="center" width="60"/> <el-table-column prop="allowPagingId" label="编号" align="center" width="60"/>
...@@ -179,7 +251,6 @@ function getCurrentDateTime() { ...@@ -179,7 +251,6 @@ function getCurrentDateTime() {
<div class="table-operate-column"> <div class="table-operate-column">
<el-button link @click="revise(scope.row)" type="primary">修改</el-button> <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 @click="bind(scope.row)" type="primary">绑定换热站</el-button>
<el-button link type="primary">详情</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -193,28 +264,38 @@ function getCurrentDateTime() { ...@@ -193,28 +264,38 @@ function getCurrentDateTime() {
<ReviseWindow <ReviseWindow
:open="reviseWindowOpen" :open="reviseWindowOpen"
:data="dependentSub" :data="dependentSub"
@onCancel="reviseWindowOpen = false" @onCancel="cancelRevise"
@onConfirm="confirmRevise" @onConfirm="confirmRevise"
></ReviseWindow> ></ReviseWindow>
<BindWindow <BindWindow
:open="bindWindowOpen" :open="bindWindowOpen"
:data="dependentSub" :data="dependentSub"
:supply="supplyData"
@onCancel="onCancelBind" @onCancel="onCancelBind"
@onConfirm="confirmBind"></BindWindow> @onConfirm="confirmBind"></BindWindow>
</div> </div>
</div> </div>
</template> </template>
<style scoped> <style scoped>
.weather-manage-container { .weather-manage-container {
width: 100%; width: 100%;
margin: 4px;
} }
.el-col[left-col] { .el-col[left-col]{
border-right: 1px solid #a6c3e9; border-right: 1px solid #a6c3e9;
display: flex;
align-items: center;
justify-content: start;
padding-left: 20px;
font-size: 14px;
.isAuto-search-area{
margin-right: 20px;
}
.supplyName-search-area{
}
} }
.el-row { .el-row {
......
This diff is collapsed.
This diff is collapsed.
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