Commit 2eeaaa45 authored by qjeslks's avatar qjeslks
parents f35091b9 da07dc47
This diff is collapsed.
This diff is collapsed.
......@@ -21,6 +21,7 @@
"jsencrypt": "^3.3.2",
"jspdf": "^2.5.1",
"less": "^4.2.0",
"lodash": "^4.17.21",
"mitt": "^3.0.1",
"node-sass": "^9.0.0",
"public-ip": "^6.0.2",
......
......@@ -77,7 +77,7 @@ export const alterWeatherMagData = params => { // 添加或修改气象干预数
return http.post(`/api/cusweather/SaveAll`, params)
}
export const getTransfer = param => { // 获取换热站列表
export const getTransferInterface = param => { // 获取换热站列表
return http.post("/api/cusweather/getTransferIds",param)
}
......
This diff is collapsed.
......@@ -5,83 +5,84 @@
<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 v-float-number 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 v-float-number 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>
<el-form ref="formRef" :rules="rules" :model="List" label-width="auto">
<table v-loading="loading" 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-form-item prop="planName" style="padding: 0;margin: 0;">
<el-input style="width: 80%" v-model="List.planName"></el-input>
</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 style="text-align: left">
<el-form-item prop="diffPercentage" style="padding: 0;margin: 0;">
<el-input v-float-number style="width: 80%" v-model="List.diffPercentage"></el-input>
</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 style="text-align: left">
<el-form-item prop="timeoutMin" style="padding: 0;margin: 0;">
<el-input style="width: 80%" v-model="List.timeoutMin"></el-input>
</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 style="text-align: left">
<el-form-item prop="tempRegulation" style="padding: 0;margin: 0;">
<el-input style="width: 80%" v-model="List.tempRegulation"></el-input>
</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 style="text-align: left">
<el-form-item prop="description" style="padding: 0;margin: 0;">
<el-input style="width: 80%" type="textarea" rows="6" v-model="List.description"></el-input>
</el-form-item>
</td>
</tr>
</table>
</td>
</tr>
</table>
</el-form>
<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>
......@@ -94,9 +95,9 @@ import { ElMessage } from "element-plus";
import http from "../../api/http";
import { vFloatNumber } from "@/utils/directives.js";
const loading = ref(false)
const formRef = ref()
const List = ref([
const List = ref(
{
"planId": "",
"planName": "",
......@@ -106,25 +107,46 @@ const List = ref([
"description": "",
"isActive": ''
}
])
const getInstanceHeat = async () => {
)
//校验规则
const rules = reactive({
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
const data = await postInstantHeat();
console.log(data);
List.value = data.data[0]
loading.value = false
http.post("api/Scheduling/BizInstantaneousHeat/Get", false).then(res => {
if (res.success) {
List.value = res.data[0]
console.log("res.data===>", res.data);
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()
await formRef.value.validate()
await http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((res) => {
if (res.success) {
ElMessage.success(res.message)
getInstanceHeat()
}
}).catch((error) => {
console.log(error)
})
}
onMounted(() => {
getInstanceHeat()
......
This diff is collapsed.
<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 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 {ElMessage, ElMessageBox} from "element-plus";
import store from "@/store/index.js";
import cloneDeep from 'lodash/cloneDeep'
import {vFloatNumber} from "@/utils/directives.js";
const data = ref()
const dataBackup = ref([]);
const reviseWindowOpen = ref(false) // 修改按钮弹窗状态
const bindWindowOpen = ref(false) // 绑定按钮弹窗状态
const addWindowOpen = ref(false) // 新增按钮弹窗状态
......@@ -20,7 +24,32 @@ const tableHeaderClass = data => { // 表头样式
const tableBodyClass = data => { // 表体样式
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) => { // 修改按钮单击事件
dependentSub.value = row
reviseWindowOpen.value = true
......@@ -29,6 +58,10 @@ const bind = (row) => { // 绑定按钮单击事件
dependentSub.value = row
bindWindowOpen.value = true
}
const cancelRevise = ()=>{
reviseWindowOpen.value = false
getData()
}
const confirmRevise = val => { // 修改弹窗确认按钮事件
let params = cloneDeep(val)
params.isAuto = params.isAuto === '自动模式' ? true : false
......@@ -48,7 +81,7 @@ const confirmRevise = val => { // 修改弹窗确认按钮事件
})
}else {
ElMessage({
message: '修改失败.',
message: res.message,
type: 'error',
})
}
......@@ -76,7 +109,7 @@ const confirmBind = val => {
bindWindowOpen.value = false
}else {
ElMessage({
message: '绑定失败.',
message: res.message,
type: 'error',
})
}
......@@ -94,30 +127,31 @@ const onCancelBind = () => {
bindWindowOpen.value = false
getData()
}
onMounted(() => {
onBeforeMount(()=>{
getData()
getOrganizationStructure()
})
function getData() {
getWeatherMagData().then(res => {
data.value = res.data
dataBackup.value = [...data.value];
})
}
function handleAddWinOpenClose(){
addWindowOpen.value = false
}
function handleAdd(val){
console.log("新增数据",val)
alterWeatherMagData(val).then(res=>{
if(res.success){
getData()
addWindowOpen.value = false
ElMessage({
message: '新增成功.',
message: res.message,
type: 'success',
})
addWindowOpen.value = false
getData()
}else {
ElMessage({
message: '新增失败.',
message: res.message,
type: 'error',
})
}
......@@ -139,17 +173,54 @@ function getCurrentDateTime() {
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>
<template>
<div class="weather-manage-container">
<el-row>
<el-col :span="15" left-col>
<el-button type="primary" @click="addWindowOpen = true" class="add-btn">新增</el-button>
<el-button type="primary" @click="getData">查询</el-button>
<div class="isAuto-search-area">
手自动模式:
<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 :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-row>
<div class="table-wrapper">
......@@ -158,7 +229,8 @@ function getCurrentDateTime() {
stripe
border
style="width: 100%"
height="900px"
height="720px"
:default-sort="{ prop: 'operateTime', order: 'descending' }"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass">
<el-table-column prop="allowPagingId" label="编号" align="center" width="60"/>
......@@ -179,7 +251,6 @@ function getCurrentDateTime() {
<div class="table-operate-column">
<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>
......@@ -193,28 +264,38 @@ function getCurrentDateTime() {
<ReviseWindow
:open="reviseWindowOpen"
:data="dependentSub"
@onCancel="reviseWindowOpen = false"
@onCancel="cancelRevise"
@onConfirm="confirmRevise"
></ReviseWindow>
<BindWindow
:open="bindWindowOpen"
:data="dependentSub"
:supply="supplyData"
@onCancel="onCancelBind"
@onConfirm="confirmBind"></BindWindow>
</div>
</div>
</template>
<style scoped>
.weather-manage-container {
width: 100%;
margin: 4px;
}
.el-col[left-col] {
.el-col[left-col]{
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 {
......
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