Commit 2c0d9c74 authored by xuke's avatar xuke

能源消耗接口样式完善

parents 2a2ea4b3 76205dae
......@@ -19,6 +19,7 @@
"jquery": "^3.7.1",
"jsencrypt": "^3.3.2",
"less": "^4.2.0",
"lodash": "^4.17.21",
"mitt": "^3.0.1",
"mock": "^0.1.1",
"mockjs": "^1.1.0",
......
......@@ -16,6 +16,9 @@ export const postEnergyDel = params => {
console.log(error);
})
}
export const getOrganizationStructureInterface = ()=>{
return http.get('/api/home/GetOrg')
} // 获取组织结构接口
// 能源消耗-修改
export const postEnergyUpdate = params => {
......@@ -75,7 +78,11 @@ export const alterWeatherMagData = params => { // 添加或修改气象干预数
}
export const getTransfer = param => { // 获取换热站列表
return http.post(`/api/cusweather/getTransferIds?id=${param}`, param)
return http.post("/api/cusweather/getTransferIds",param)
}
export const deleteWeatherMagData = params => { // 删除气象干预数据
return http.post("/api/cusweather/Delete",params)
}
export const getAnnualParam = () => { // 获取年度参数列表
......@@ -93,7 +100,7 @@ export const addAnnualParam = params => { // 新增年度参数
export const deleteAnnualParam = 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`,params)
}
export const getPhenomenon = () => { // 获取数据列表————天气工况
......@@ -108,7 +115,7 @@ export const alterPhenomenon = params => { // 修改数据————天气工
}
export const deletePhenomenon = params => { // 删除数据————天气工况
return http.post(`/api/Scheduling/WeatherCondition/Delete?Id=${params}`)
return http.post(`/api/Scheduling/WeatherCondition/Delete`,params)
}
export const getWind = () => { // 获取数据列表————风力配置
......@@ -124,5 +131,5 @@ export const alterWind = params => { // 修改数据————风力配置
}
export const deleteWind = params => { // 删除数据————风力配置
return http.post(`/api/Scheduling/WindConfiguration/Delete?Id=${params}`)
return http.post(`/api/Scheduling/WindConfiguration/Delete`,params)
}
......@@ -173,13 +173,16 @@
options.length = 0;
PatrolInfo.Id.length = 0;
var result = store.getters.getEnterprise();
console.log("result的值:",result)
if (result) {
result.forEach(element=>{
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{
let c = [];
center.supplyList.forEach(supply => {
// console.log("suppleList",supply)
let chi = [];
supply.transferList.forEach(unit => {
chi.push({ value: unit.unitId, label: unit.unitName });
......
......@@ -3,6 +3,7 @@ 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 {ElMessage, ElMessageBox} from "element-plus";
import {vFloatNumber} from "@/utils/directives.js";
const data = ref()
const dataBackup = ref([])
......@@ -53,7 +54,10 @@ function handleDelete(val) {
type: 'warning'
}
).then(() => {
deleteAnnualParam(val.paramId).then(res => {
let param = {
id: val.paramId
}
deleteAnnualParam(param).then(res => {
if (res.success) {
getData()
ElMessage({
......@@ -61,13 +65,13 @@ function handleDelete(val) {
type: 'success',
})
}
})
}).catch(err => {
ElMessage({
message: '删除失败.',
type: 'error',
})
})
})
} // 处理删除
function handleAdd() {
currentYear.value = new Date().getFullYear()
......@@ -146,6 +150,10 @@ function resetInput() {
backWaterTemperature: ''
}
}
function energyTypeSort(){
return ['一步节能','二步节能','三步节能','四步节能','非节能']
} // 节能类型排序自定义方法
</script>
<template>
......@@ -165,12 +173,13 @@ function resetInput() {
:data="data"
border
stripe
:default-sort="{prop: 'year', order: 'descending'}"
: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="节能类型" sortable :sort-method="energyTypeSort" prop="energyType"/>
<el-table-column label="年度" sortable prop="year"/>
<el-table-column label="热指标(W/m²)" prop="standard"/>
<el-table-column label="度日数标定值" prop="degreeStandard"/>
<el-table-column label="室内温度(℃)" prop="indoorTemperature"/>
......@@ -215,33 +224,33 @@ function resetInput() {
</el-col>
</el-row>
<el-row>
<el-col :span="8" col-label>标准</el-col>
<el-col :span="8" col-label>热指标(W/m²)</el-col>
<el-col :span="16" col-value>
<el-input v-model="reviseForm.standard" placeholder="" style="width: 370px"/>
<el-input v-float-number 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-input v-float-number 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-input v-float-number 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-input v-float-number 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-input v-float-number v-model="reviseForm.backWaterTemperature" style="width: 370px"/>
</el-col>
</el-row>
</template>
......@@ -280,33 +289,33 @@ function resetInput() {
</el-col>
</el-row>
<el-row>
<el-col :span="8" col-label>标准</el-col>
<el-col :span="8" col-label>热指标(W/m²)</el-col>
<el-col :span="16" col-value>
<el-input v-model="addForm.standard" placeholder="" style="width: 370px"/>
<el-input v-float-number 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-input v-float-number 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-input v-float-number 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-input v-float-number 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-input v-float-number v-model="addForm.backWaterTemperature" style="width: 370px"/>
</el-col>
</el-row>
</template>
......
......@@ -169,7 +169,6 @@ import { ElMessage } from "element-plus";
const options = reactive([]);
import store from "../../store/index";
import { vFloatNumber } from "@/utils/directives.js";
import { load } from "@amap/amap-jsapi-loader";
import { ElLoading } from "element-plus";
const form = ref({
types: [],
......
......@@ -90,7 +90,6 @@
<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";
import { vFloatNumber } from "@/utils/directives.js";
......
......@@ -2,6 +2,7 @@
import {onMounted, ref} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import {getPhenomenon,addPhenomenon,alterPhenomenon,deletePhenomenon} from "@/api/scheduling.js"
import {vFloatNumber} from "@/utils/directives.js";
const data = ref()
const dataBackup = ref([])
......@@ -32,7 +33,9 @@ function search(){
}
}
function omit(val){
let id = val.phenomenonId
let param = {
id: val.phenomenonId
}
ElMessageBox.confirm(
'点击确定后,该条数据将删除,是否继续?',
'Warning',
......@@ -42,19 +45,19 @@ function omit(val){
type:'warning'
}
).then(()=>{
deletePhenomenon(id).then(res=>{
deletePhenomenon(param).then(res=>{
getData()
ElMessage({
message: '删除成功.',
type: 'success',
})
})
}).catch(err=>{
ElMessage({
message: '删除失败.',
type: 'error',
})
})
})
} // 删除按钮单击事件
function handleClose(){
reviseWindowOpen.value = false
......@@ -152,30 +155,26 @@ function getData(){
width="700px"
:before-close="handleClose">
<template #default>
<el-row first>
<!-- <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-input placeholder="" size="small" v-model="reviseForm.phenomenonName" style="width: 370px"/>
</el-col>
</el-row>
</el-row> -->
<el-row>
<el-col :span="8" col-label class="energy-type-class">类型</el-col>
<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-option :value="1" label="晴天"/>
<el-option :value="2" label="多云"/>
<el-option :value="3" label="阴天"/>
</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-input v-float-number v-model="reviseForm.phenomenonTemp" placeholder="" style="width: 370px"/>
</el-col>
</el-row>
<el-row>
......@@ -198,30 +197,26 @@ function getData(){
width="700px"
:before-close="handleClose">
<template #default>
<el-row first>
<!-- <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-input placeholder="" size="small" v-model="reviseForm.phenomenonName" style="width: 370px"/>
</el-col>
</el-row>
</el-row> -->
<el-row>
<el-col :span="8" col-label class="energy-type-class">类型:</el-col>
<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-option :value="1" label="晴天"/>
<el-option :value="2" label="多云"/>
<el-option :value="3" label="阴天"/>
</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-input v-float-number v-model="addForm.phenomenonTemp" placeholder="" style="width: 370px"/>
</el-col>
</el-row>
<el-row>
......
......@@ -2,9 +2,12 @@
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 {getWeatherMagData, alterWeatherMagData, deleteWeatherMagData} from '@/api/scheduling.js'
import AddWindow from "./weatherManageSub/AddWindow.vue";
import {ElMessage} from "element-plus";
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 reviseWindowOpen = ref(false) // 修改按钮弹窗状态
......@@ -27,23 +30,57 @@ const bind = (row) => { // 绑定按钮单击事件
bindWindowOpen.value = true
}
const confirmRevise = val => { // 修改弹窗确认按钮事件
console.log('修改数据',val)
// alterWeatherMagData(val).then(res=>{
// getData()
// reviseWindowOpen.value = false
// ElMessage({
// message: '修改成功.',
// type: 'success',
// })
// }).catch(err=>{
// ElMessage({
// message: '修改失败.',
// type: 'error',
// })
// })
let params = cloneDeep(val)
params.isAuto = params.isAuto === '自动模式' ? true : false
params.isFixed = params.isFixed === '固定模式' ? true : false
params.operateTime = getCurrentDateTime()
if(params.supplyId === ''){
delete params.supplyId // 移除supplyId属性
// 该属性要么有一个正确的值,要么移除,否则报错
}
alterWeatherMagData(params).then(res=>{
getData()
reviseWindowOpen.value = false
ElMessage({
message: '修改成功.',
type: 'success',
})
}).catch(err=>{
ElMessage({
message: '修改失败.',
type: 'error',
})
})
}
const confirmBind = val => {
// console.log(val)
let params = cloneDeep(val)
params.isAuto = params.isAuto === '自动模式' ? true : false
params.isFixed = params.isFixed === '固定模式' ? true : false
params.operateTime = getCurrentDateTime()
console.log(params)
// 绑定,新增,和修改用的是同一个接口
alterWeatherMagData(params).then(res=>{
console.log(res)
ElMessage({
message: '绑定成功.',
type: 'success',
})
getData()
bindWindowOpen.value = false
}).catch(err=>{
console.log(err)
ElMessage({
message: '绑定失败.',
type: 'error',
})
bindWindowOpen.value = false
getData()
})
}
const onCancelBind = () => {
bindWindowOpen.value = false
getData()
}
onMounted(() => {
getData()
......@@ -51,7 +88,6 @@ onMounted(() => {
function getData() {
getWeatherMagData().then(res => {
data.value = res.data
console.log("所有数据",data.value)
})
}
function handleAddWinOpenClose(){
......@@ -73,18 +109,28 @@ function handleAdd(val){
})
})
} // 新增数据提交
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>
<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>
</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">
......@@ -93,12 +139,13 @@ function handleAdd(val){
stripe
border
style="width: 100%"
height="900px"
: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="customizeName" sortable label="自定义名称" width="200"/>
<el-table-column prop="supplyName" sortable label="供热站名称" width="160"/>
<el-table-column prop="operateTime" sortable 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"/>
......@@ -107,8 +154,8 @@ function handleAdd(val){
<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" sortable label="排序" width="60"/>
<el-table-column label="操作" width="200">
<el-table-column prop="sort" label="排序" width="60"/>
<el-table-column label="操作" fixed="right" width="200">
<template #default="scope">
<div class="table-operate-column">
<el-button link @click="revise(scope.row)" type="primary">修改</el-button>
......@@ -133,7 +180,7 @@ function handleAdd(val){
<BindWindow
:open="bindWindowOpen"
:data="dependentSub"
@onCancel="bindWindowOpen = false"
@onCancel="onCancelBind"
@onConfirm="confirmBind"></BindWindow>
</div>
</div>
......@@ -163,6 +210,7 @@ function handleAdd(val){
.add-btn {
margin: 5px 0;
margin-left: 10px;
}
:deep(.table-header-class) {
......
This diff is collapsed.
<script setup>
import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect} from "vue";
import {vFloatNumber} from "@/utils/directives.js";
const props = defineProps({
open: {
......@@ -97,7 +98,7 @@ function resetInput(){
<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-input v-float-number :input-style="inputStyle" v-model="addData.temperature" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
......@@ -125,17 +126,17 @@ function resetInput(){
</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-input v-float-number :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-input v-float-number :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-input v-float-number :input-style="inputStyle" v-model="addData.tempRegulation" style="width: 240px"/>
</el-col>
</el-row>
</div>
......
<script setup>
import {ref, defineProps, defineEmits, watchEffect, onMounted} from "vue";
import http from "@/api/http.js";
import {ref, defineProps, defineEmits, watchEffect, onMounted, reactive, computed} from "vue";
import {getTransfer,getOrganizationStructureInterface} from "@/api/scheduling.js"
import {getWeatherMagData, alterWeatherMagData, deleteWeatherMagData} from '@/api/scheduling.js'
import store from "@/store/index.js";
import cloneDeep from 'lodash/cloneDeep'
import http from "@/api/http.js";
import {ElMessage} from "element-plus";
const props = defineProps({
open: {
......@@ -22,45 +26,111 @@ const emit = defineEmits({
}
})
const bindData = ref({})
let preSupplyName = bindData.value.supplyName // 上一选中的供热站
watchEffect(()=>{
// bindData.value = {...props.data}
bindData.value = cloneDeep(props.data) // 深拷贝数据
})
watchEffect(()=>{
bindData.value = {...props.data}
if(bindData.value.supplyName !== preSupplyName){
checkboxGroup.value.length = 0
preSupplyName = bindData.value.supplyName
}
})
const inputStyle = {
color: 'black',
height: '24px'
}
const heatingStationList = ref([
'行政区供热站',
'二号供热站',
'三号供热站'
]) // 供热站列表
const heatExchangeList = ref([
'兴安里',
'永明里',
'润泽园',
'凯旋一期',
'凯旋二期',
'凯旋三期',
'兴旺里东区',
'兴旺里西区',
'兴盛里南环',
'兴盛里北环',
'七邻里',
'胜利里南区',
'胜利里北区',
'兴慧里',
'兴德里',
'行政办公区',
'开元里',
'振业里'
]) // 换热站列表
const organizationStructure = ref([]) // 组织结构数据
const supplyData = ref([]) // 供热站数据
const transferStructData = ref([]) // 换热站结构数据,每个供热站和一定数量的换热站对应
const BindTransferData = ref([]) // 绑定换热站数据
const checkboxGroup = ref([]) // checkboxGroup上绑定的数据,是根据自定义Id获取到的换热站数据
const checkBoxTransferList = ref([]) // 根据供热站变化展示的不同的transfer
onMounted(()=>{
// let result = store.getters.getEnterprise()
// console.log("绑定窗口挂载",result)
getOrganizationStructure()
})
watchEffect(()=>{
// 监听绑定的bindData.supplyName的变换,返回对应的换热站数据
checkBoxTransferList.value.length =0 // 每次供热站的值变化后,清空当前展示的数据,重新赋值
transferStructData.value.forEach(item=>{
if(item.supplyName === bindData.value.supplyName){
item.transferList.forEach(transferObj =>{
checkBoxTransferList.value.push({
unitId:transferObj.unitId,
unitName:transferObj.unitName
})
})
}
})
// console.log("根据供热站变化的换热站数据计算属性",selTransferCheckBoxLs.value)
})
const onSubmit = ()=>{
emit('onConfirm', bindData)
supplyData.value.forEach(item=>{
if(item.supplyName === bindData.value.supplyName){
bindData.value.supplyId = item.supplyId
}
})
checkboxGroup.value.forEach(item=>{
bindData.value.transfers.push({
customizeId: bindData.value.customizeId,
unitId: item,
updateNullFields: ''
})
})
emit('onConfirm', bindData.value)
} // 点击保存按钮
function getBindTransferData(){ // 获取绑定换热站数据,若在onMounted中无法调用失败(id可能为空),则在opOpen时操作
let param = {
id: bindData.value.customizeId
}
getTransfer(param).then(res=>{
BindTransferData.value = res.data
checkboxGroup.value.length = 0 // 每一次打开弹窗都会根据新的Id获取获取对应的换热站数据,并且清空原数组,重新赋值
BindTransferData.value.forEach(item=>{
checkboxGroup.value.push(item.unitId)
})
})
}
function getSupply(){
organizationStructure.value[0].serviceCenterList.forEach(fir_item =>{
fir_item.supplyList.forEach(sec_item=>{
supplyData.value.push({
supplyId: sec_item.supplyId,
supplyName: sec_item.supplyName,
})
})
})
} // 根据组织结构获取供热站数据
function getAllTransfer(){
organizationStructure.value[0].serviceCenterList.forEach(serviceCenter=>{ // 共有两个服务中心
let supplyList = serviceCenter.supplyList // 供热站列表,每个服务中心对应一定的供热站
supplyList.forEach(supply=>{ // 供热站
transferStructData.value.push(
{
supplyId: supply.supplyId,
supplyName: supply.supplyName,
transferList:supply.transferList
}
)
})
})
} // 根据组织结构获取换热站结构数据
function getOrganizationStructure(){
getOrganizationStructureInterface().then(res=>{
organizationStructure.value = res.data
getSupply()
getAllTransfer()
}).catch(err=>{
ElMessage.error('接口异常,获取数据失败.')
})
} // 获取组织结构
function onOpen(){
getBindTransferData()
}
function checkBoxChange(val){
}
</script>
<template>
......@@ -68,7 +138,8 @@ const onSubmit = ()=>{
v-model="props.open"
width="1000px"
title="换热站绑定"
@close="emit('onCancel')">
@close="emit('onCancel')"
@open="onOpen">
<template #default>
<div class="dialog-content">
<el-row style="border-top: #a6c3e9 1px solid" class="not-select-row">
......@@ -81,16 +152,19 @@ const onSubmit = ()=>{
<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-option v-for="item in supplyData" :key="item.supplyId" :label="item.supplyName" :value="item.supplyName"/> <!--此处还需考虑-->
</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 @change="checkBoxChange" v-model="checkboxGroup" style="width: 510px">
<el-checkbox v-for="item in checkBoxTransferList" :key="item.unitId" :label="item.unitName" :value="item.unitId"></el-checkbox>
</el-checkbox-group>
<!-- <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>
......
<script setup>
import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect} from "vue";
import cloneDeep from 'lodash/cloneDeep'
import {vFloatNumber} from "@/utils/directives.js";
const props = defineProps({
open: {
......@@ -21,7 +23,10 @@ const emit = defineEmits({
})
const reviseData = ref({})
watchEffect(()=>{
reviseData.value = {...props.data}
// reviseData.value = {...props.data}
props.data.transfers = []
props.data.updateNullFields = ''
reviseData.value = cloneDeep(props.data) // 深拷贝数据
})
const inputStyle = {
color: 'black',
......@@ -40,8 +45,8 @@ const switchingisAuto = computed({
}
}) // 可写计算属性,手动、自动模式切换
function onOpen(){
console.log('props.data数据',props.data)
console.log('修改弹窗接收到的数据',reviseData.value)
// console.log('props.data数据',props.data)
// console.log('修改弹窗接收到的数据',reviseData.value)
}
</script>
......@@ -72,7 +77,7 @@ function onOpen(){
<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-input v-float-number :input-style="inputStyle" v-model="reviseData.temperature" style="width: 510px"/>
</el-col>
</el-row>
<el-row>
......@@ -100,17 +105,17 @@ function onOpen(){
</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-input v-float-number :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-input v-float-number :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-input v-float-number :input-style="inputStyle" v-model="reviseData.tempRegulation" style="width: 240px"/>
</el-col>
</el-row>
</div>
......
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