Commit 4aa69a06 authored by jiaxu.yan's avatar jiaxu.yan

Merge branch 'master' of http://gitlab.91isoft.com:90/hikvision/web-project

# Conflicts:
#	src/views/SchedulingPage/ConfigBoilerPage.vue
parents 1c4ecc1f efa83de3
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button> <el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button>
<el-button type="primary" @click="open" style="min-width: 70px;">报警参数设置</el-button> <el-button type="primary" v-show="roleId" @click="open" style="min-width: 70px;">报警参数设置</el-button>
</el-form-item> </el-form-item>
</div> </div>
</el-card> </el-card>
...@@ -279,7 +279,7 @@ const show = ref(false) ...@@ -279,7 +279,7 @@ const show = ref(false)
const refreshItem = ref(0) const refreshItem = ref(0)
const AlarmInfo = ref([]) const AlarmInfo = ref([])
const dept = ref('') const dept = ref('')
const roleId = ref(false)
function open() { function open() {
show.value = true show.value = true
...@@ -514,42 +514,27 @@ console.log("AlarmInfo.value:::", AlarmInfo.value); ...@@ -514,42 +514,27 @@ console.log("AlarmInfo.value:::", AlarmInfo.value);
const userId = ref(); const userId = ref();
const roleIds = ref(); const roleIds = ref();
//获取用户信息 //获取用户信息
function getuser() { const getuser = () => {
var user = store.getters.getUserInfo(); var user = store.getters.getUserInfo();
console.log("user================>", user);
console.log("user.enterpriseId================>", user.enterpriseId);
if (user) { if (user) {
enterpriseId.value = user.enterpriseId; enterpriseId.value = user.enterpriseId;
userId.value = user.userId; userId.value = user.userId;
roleIds.value = user.roleId; roleIds.value = user.roleId;
} }
// 权限小于3显示按钮
if (roleIds.value < 3) {
roleId.value = true
}
} }
console.log("userId=========>", userId.value); getuser()
console.log("roleIds=========>", roleIds.value);
let cnNames_before = ref([]) let cnNames_before = ref([])
let cnNames_after = ref([]) let cnNames_after = ref([])
console.log("---------------------AlarmInfo.value:", AlarmInfo.value);
let params = ref({
"pipeAlarmParaId": "",
"pipeParaBaseId": "",
"pipeId": "",
"gatherType": "",
"voicePath": "",
"isVoice": "",
"topMost": "",
"upper": "",
"lower": "",
"downMost": "",
"alarmPlan": "",
"isShortMessage": "",
"isAlarm": "",
"isActive": true,
"updateNullFields": "",
})
// v-moedl表单参数,用于提交
let addParams = ref({ let addParams = ref({
"updateNullFields": "", "updateNullFields": "",
"voicePath": "", "voicePath": "",
...@@ -564,6 +549,7 @@ let addParams = ref({ ...@@ -564,6 +549,7 @@ let addParams = ref({
"isActive": true "isActive": true
}) })
// 重置表单
const reset = () => { const reset = () => {
addParams.value = { addParams.value = {
"updateNullFields": "", "updateNullFields": "",
...@@ -579,6 +565,8 @@ const reset = () => { ...@@ -579,6 +565,8 @@ const reset = () => {
"isActive": true "isActive": true
} }
} }
// 给表单第一个属性"报警名称"赋值
let param = ref({ let param = ref({
"cnName": "", "cnName": "",
"baseId": "" "baseId": ""
...@@ -626,7 +614,6 @@ watchEffect(() => { ...@@ -626,7 +614,6 @@ watchEffect(() => {
param.value.baseId = "transParaBaseId" param.value.baseId = "transParaBaseId"
} }
}) })
// 接口2:换热站基础参数编号(transParaBaseId) -> 接口1:baseId // 接口2:换热站基础参数编号(transParaBaseId) -> 接口1:baseId
const getCnNames = () => { const getCnNames = () => {
// console.log('dept-------------------', dept.value); // console.log('dept-------------------', dept.value);
...@@ -635,8 +622,8 @@ const getCnNames = () => { ...@@ -635,8 +622,8 @@ const getCnNames = () => {
data.then(function (val) { data.then(function (val) {
cnNames_before.value = val.data.before cnNames_before.value = val.data.before
cnNames_after.value = val.data.after cnNames_after.value = val.data.after
// console.log("cnNames_before@@@@", cnNames_before); // console.log("cnNames_before===>", cnNames_before);
// console.log("cnNames_after@@@@", cnNames_after); // console.log("cnNames_after===>", cnNames_after);
// console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId) // console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId)
}); });
} }
...@@ -646,6 +633,10 @@ const paramsSetting = () => { ...@@ -646,6 +633,10 @@ const paramsSetting = () => {
getCnNames() getCnNames()
} }
// newRow接收param.value.baseId,添加需要使用
// selectBeforeParams 和 selectAfterParams==> 两个方法调用一个接口
// selectBeforeParams 是点击左侧未参数时调用,此时未配置参数,故data无数据
// selectAfterParams 是点击右侧已配置的参数时调用,此时参数已配置,故data有数据
let newRow = ref({}) let newRow = ref({})
const selectBeforeParams = (row) => { const selectBeforeParams = (row) => {
reset() reset()
...@@ -666,10 +657,7 @@ const selectBeforeParams = (row) => { ...@@ -666,10 +657,7 @@ const selectBeforeParams = (row) => {
if (param.value.baseId) { if (param.value.baseId) {
const data = http.post("api/alarm/para/GetAlarmParaInfo", { type: newType.value, id: dept.value, baseid: param.value.baseId }, false) const data = http.post("api/alarm/para/GetAlarmParaInfo", { type: newType.value, id: dept.value, baseid: param.value.baseId }, false)
// console.log("查看baseId --- dataaaaa:", data); // console.log("查看baseId --- dataaaaa:", data);
data.then(function (val) { data.then(function () {
// console.log("valllll:", val);
params.value = val.data
// console.log("!!!!!Params.value:", params.value);
param.value.cnName = row.cnName param.value.cnName = row.cnName
}); });
} else { } else {
...@@ -703,8 +691,6 @@ const selectAfterParams = (row) => { ...@@ -703,8 +691,6 @@ const selectAfterParams = (row) => {
// console.log("valllll:", val); // console.log("valllll:", val);
// 数据回显 // 数据回显
addParams.value = { ...val.data } addParams.value = { ...val.data }
// console.log("addParams.value/////////", addParams.value);
// console.log("!!!!!Params.value:", params.value);
param.value.cnName = row.cnName param.value.cnName = row.cnName
if (type.value === 1) { if (type.value === 1) {
delId.value = val.data.pipeAlarmParaId delId.value = val.data.pipeAlarmParaId
...@@ -719,7 +705,10 @@ const selectAfterParams = (row) => { ...@@ -719,7 +705,10 @@ const selectAfterParams = (row) => {
} }
} }
// 总管 // 添加 addParams中写三个类型相同的属性,根据类型和设备进行动态的删除和添加
// 点击添加按钮要根据参数所属不同的类型和设备进行传参
// 修改亦如此
const onAdd = () => { const onAdd = () => {
// console.log("!!!!!!!", addParams.value); // console.log("!!!!!!!", addParams.value);
addParams.value.updateNullFields = "" addParams.value.updateNullFields = ""
...@@ -780,6 +769,11 @@ const onAdd = () => { ...@@ -780,6 +769,11 @@ const onAdd = () => {
} }
// 按钮 // 按钮
// 表单下面的按钮
// 按钮分为两组:一组添加和删除 一组修改和删除
// 选择类型和设备 点击确定之后,当点击左侧的参数调用xxbeforexx接口,且表单的报警名称有值添加按钮可用
// 当点击添加之后表单的报警名称没有值,添加按钮不可用
// 点击右侧的参数调用xxxafterxxx接口,添加按钮变为修改,同时修改按钮可用
const button = ref(true) const button = ref(true)
// 删除逻辑 // 删除逻辑
...@@ -824,7 +818,7 @@ const onDel = () => { ...@@ -824,7 +818,7 @@ const onDel = () => {
} }
// 关闭dialog清空数据 // 关闭dialog右上× 清空数据
const onClose = () => { const onClose = () => {
type.value = "" type.value = ""
dept.value = "" dept.value = ""
...@@ -835,6 +829,7 @@ const onClose = () => { ...@@ -835,6 +829,7 @@ const onClose = () => {
} }
onMounted(() => { onMounted(() => {
getuser()
setContentHeight(); setContentHeight();
window.addEventListener('resize', setContentHeight); window.addEventListener('resize', setContentHeight);
}) })
......
...@@ -2,18 +2,8 @@ ...@@ -2,18 +2,8 @@
<div class="contentBlock"> <div class="contentBlock">
<div class="contentBlockInn"> <div class="contentBlockInn">
<el-card class="card-contianer"> <el-card class="card-contianer">
<el-form <el-form ref="formRef" :rules="rules" :model="formDatas" label-width="auto">
ref="formRef" <table v-loading="loading" cellpadding="0" cellspacing="1" style="background-color: #99bbe8">
:rules="rules"
:model="formDatas"
label-width="auto"
>
<table
v-loading="loading"
cellpadding="0"
cellspacing="1"
style="background-color: #99bbe8"
>
<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">
...@@ -21,11 +11,8 @@ ...@@ -21,11 +11,8 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="openingOfElectricValve"> <el-form-item prop="openingOfElectricValve">
<el-input <el-input v-float-number style="width: 80%; text-align: left"
v-float-number v-model="formDatas.openingOfElectricValve">
style="width: 80%; text-align: left"
v-model="formDatas.openingOfElectricValve"
>
<template #append> <template #append>
<div style="width: 40px">%</div> <div style="width: 40px">%</div>
</template> </template>
...@@ -36,25 +23,16 @@ ...@@ -36,25 +23,16 @@
</table> </table>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 25%">换热站</th> <th style="width: 25%">换热站</th>
<td style="text-align: left"> <td style="text-align: left">
<el-checkbox-group <el-checkbox-group v-model="formDatas.transferIds" style="width: 60%">
v-model="formDatas.transferIds" <el-checkbox v-for="(option, index) in options" :label="option.value" :key="index">
style="width: 60%"
>
<el-checkbox
v-for="(option, index) in options"
:label="option.value"
:key="index"
>
{{ option.label }} {{ option.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</td> </td>
</tr> </tr>
<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">
...@@ -62,11 +40,7 @@ ...@@ -62,11 +40,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="boilerOutletWaterTemperature"> <el-form-item prop="boilerOutletWaterTemperature">
<el-input <el-input v-float-number style="width: 80%" v-model="formDatas.boilerOutletWaterTemperature">
v-float-number
style="width: 80%"
v-model="formDatas.boilerOutletWaterTemperature"
>
<template #append> <template #append>
<div style="width: 40px"></div> <div style="width: 40px"></div>
</template> </template>
...@@ -77,7 +51,6 @@ ...@@ -77,7 +51,6 @@
</table> </table>
</td> </td>
</tr> </tr>
<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">
...@@ -85,11 +58,7 @@ ...@@ -85,11 +58,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="holdingTime"> <el-form-item prop="holdingTime">
<el-input <el-input v-float-number style="width: 80%" v-model="formDatas.holdingTime">
v-float-number
style="width: 80%"
v-model="formDatas.holdingTime"
>
<template #append> <template #append>
<div style="width: 40px">分钟</div> <div style="width: 40px">分钟</div>
</template> </template>
...@@ -100,7 +69,6 @@ ...@@ -100,7 +69,6 @@
</table> </table>
</td> </td>
</tr> </tr>
<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">
...@@ -108,11 +76,7 @@ ...@@ -108,11 +76,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="upperLlimitMainFlow"> <el-form-item prop="upperLlimitMainFlow">
<el-input <el-input v-float-number style="width: 80%" v-model="formDatas.upperLlimitMainFlow">
v-float-number
style="width: 80%"
v-model="formDatas.upperLlimitMainFlow"
>
<template #append> <template #append>
<div style="width: 40px">m3/h</div> <div style="width: 40px">m3/h</div>
</template> </template>
...@@ -123,7 +87,6 @@ ...@@ -123,7 +87,6 @@
</table> </table>
</td> </td>
</tr> </tr>
<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">
...@@ -131,11 +94,7 @@ ...@@ -131,11 +94,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="lowerLlimitMainFlow"> <el-form-item prop="lowerLlimitMainFlow">
<el-input <el-input v-float-number style="width: 80%" v-model="formDatas.lowerLlimitMainFlow">
v-float-number
style="width: 80%"
v-model="formDatas.lowerLlimitMainFlow"
>
<template #append> <template #append>
<div style="width: 40px">m3/h</div> <div style="width: 40px">m3/h</div>
</template> </template>
...@@ -153,11 +112,7 @@ ...@@ -153,11 +112,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="maxTargetTemperature"> <el-form-item prop="maxTargetTemperature">
<el-input <el-input v-float-number style="width: 80%" v-model="formDatas.maxTargetTemperature">
v-float-number
style="width: 80%"
v-model="formDatas.maxTargetTemperature"
>
<template #append> <template #append>
<div style="width: 40px"></div> <div style="width: 40px"></div>
</template> </template>
...@@ -168,7 +123,6 @@ ...@@ -168,7 +123,6 @@
</table> </table>
</td> </td>
</tr> </tr>
<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">
...@@ -176,11 +130,7 @@ ...@@ -176,11 +130,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="bestHoldingTime"> <el-form-item prop="bestHoldingTime">
<el-input <el-input v-float-number style="width: 80%" v-model="formDatas.bestHoldingTime">
v-float-number
style="width: 80%"
v-model="formDatas.bestHoldingTime"
>
<template #append> <template #append>
<div style="width: 40px">分钟</div> <div style="width: 40px">分钟</div>
</template> </template>
...@@ -197,9 +147,7 @@ ...@@ -197,9 +147,7 @@
<div> <div>
<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" <el-button type="primary" style="margin: 0 0 0 5px">关闭</el-button>
>关闭</el-button
>
</div> </div>
</div> </div>
</th> </th>
...@@ -218,11 +166,11 @@ import { ElMessage } from "element-plus"; ...@@ -218,11 +166,11 @@ import { ElMessage } from "element-plus";
const options = reactive([]); const options = reactive([]);
import store from "../../store/index"; import store from "../../store/index";
import { vFloatNumber } from "@/utils/directives.js"; import { vFloatNumber } from "@/utils/directives.js";
const loading = ref(false); const loading = ref(false)
const form = ref({ const form = ref({
types: [], types: [],
}); });
const formRef = ref(); const formRef = ref()
const formDatas = ref([ const formDatas = ref([
{ {
...@@ -239,117 +187,61 @@ const formDatas = ref([ ...@@ -239,117 +187,61 @@ const formDatas = ref([
}, },
]); ]);
//表单校验规则 //表单校验规则
// 正则 /^(-?[0-9]+(\.[0-9]+)?){1,10}$/ ==> {1-10}不起作用,下面又一遍
const rules = reactive({ const rules = reactive({
openingOfElectricValve: [ openingOfElectricValve: [
{ { pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "电动调节阀开度输入不合法", trigger: "blur" },
pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, { min: 1, max: 10, message: '电动调节阀开度必须是 1-10位的数字', trigger: 'change' }
message: "电动调节阀开度输入不合法",
trigger: "blur",
},
{
min: 1,
max: 10,
message: "电动调节阀开度必须是 1-10位的数字",
trigger: "blur",
},
], ],
boilerOutletWaterTemperature: [ boilerOutletWaterTemperature: [
{ { pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "锅炉出水温度输入不合法", trigger: "blur" },
pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, { min: 1, max: 10, message: '锅炉出水温度必须是 1-10位的数字', trigger: 'change' }
message: "锅炉出水温度输入不合法",
trigger: "blur",
},
{
min: 1,
max: 10,
message: "锅炉出水温度必须是 1-10位的数字",
trigger: "blur",
},
], ],
upperLlimitMainFlow: [ upperLlimitMainFlow: [
{ { pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "锅炉房供水总管流量上限值输入不合法", trigger: "blur" },
pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, { min: 1, max: 10, message: '锅炉房供水总管流量上限值必须是 1-10位的数字', trigger: 'change' }
message: "锅炉房供水总管流量上限值输入不合法",
trigger: "blur",
},
{
min: 1,
max: 10,
message: "锅炉房供水总管流量上限值必须是 1-10位的数字",
trigger: "blur",
},
], ],
lowerLlimitMainFlow: [ lowerLlimitMainFlow: [
{ { pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "锅炉房供水总管流量下限值输入不合法", trigger: "blur" },
pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, { min: 1, max: 10, message: '锅炉房供水总管流量下限值必须是 1-10位的数字', trigger: 'change' }
message: "锅炉房供水总管流量下限值输入不合法",
trigger: "blur",
},
{
min: 1,
max: 10,
message: "锅炉房供水总管流量下限值必须是 1-10位的数字",
trigger: "blur",
},
], ],
maxTargetTemperature: [ maxTargetTemperature: [
{ { pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "目标温度最大值输入不合法", trigger: "blur" },
pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, { min: 1, max: 10, message: '目标温度最大值必须是 1-10位的数字', trigger: 'change' }
message: "目标温度最大值输入不合法",
trigger: "blur",
},
{
min: 1,
max: 10,
message: "目标温度最大值必须是 1-10位的数字",
trigger: "blur",
},
], ],
bestHoldingTime: [ bestHoldingTime: [
{ { pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "持续时间输入不合法", trigger: "blur" },
pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, { min: 1, max: 10, message: '持续时间必须是 1-10位的数字', trigger: 'change' }
message: "持续时间输入不合法",
trigger: "blur",
},
{
min: 1,
max: 10,
message: "持续时间必须是 1-10位的数字",
trigger: "blur",
},
], ],
holdingTime: [ holdingTime: [
{ { pattern: /^[0-9]\d{1,10}$/, "message": "保持时间必须是 1-10位的数字", trigger: 'change' }
pattern: /^[0-9]\d{1,10}$/, ]
message: "保持时间必须是 1-10位的数字",
trigger: "blur",
},
],
}); });
// 获取数据列表
const getListData = () => { const getListData = () => {
loading.value = true; loading.value = true
http http.get("/api/configboiler/getData").then((result) => {
.get("/api/configboiler/getData") if (result.success) {
.then((result) => { formDatas.value = result.data;
if (result.success) { ElMessage.success(result.message)
formDatas.value = result.data; formDatas.value.transferIds = formDatas.value.transferIds.split(",");
ElMessage.success(result.message); formDatas.value.updateNullFields = "";
formDatas.value.transferIds = formDatas.value.transferIds.split(","); loading.value = false
formDatas.value.updateNullFields = ""; }
loading.value = false; }).catch(err => {
} console.log(err);
}) });
.catch((err) => {
console.log(err);
});
}; };
// 保存修改
const onSave = async () => { const onSave = async () => {
formDatas.value.transferIds = formDatas.value.transferIds.join(","); formDatas.value.transferIds = formDatas.value.transferIds.join(",");
const result = await postConfigBoilerUpdate({ ...formDatas.value }); const result = await postConfigBoilerUpdate({ ...formDatas.value });
if (result.success) { if (result.success) {
ElMessage.success(result.message); ElMessage.success(result.message)
getListData(); getListData();
} }
}; };
...@@ -371,8 +263,7 @@ function getSupplys() { ...@@ -371,8 +263,7 @@ function getSupplys() {
let c = []; let c = [];
center.supplyList.forEach((supply) => { center.supplyList.forEach((supply) => {
let chi = []; let chi = [];
console.log(supply); // 只展示小王庄地区supply.supplyId
if (supply.supplyId === "b354f45b-23e5-42be-a210-0fb92394f457") { if (supply.supplyId === "b354f45b-23e5-42be-a210-0fb92394f457") {
supply.transferList.forEach((unit) => { supply.transferList.forEach((unit) => {
options.push({ value: unit.unitId, label: unit.unitName }); options.push({ value: unit.unitId, label: unit.unitName });
...@@ -385,7 +276,7 @@ function getSupplys() { ...@@ -385,7 +276,7 @@ function getSupplys() {
} }
}); });
} }
console.log("遍历的options===========>:", options); // console.log("遍历的options===========>:", options);
} }
onMounted(() => { onMounted(() => {
getListData(); getListData();
......
...@@ -4,9 +4,6 @@ import { ElMessageBox, ElMessage } from "element-plus"; ...@@ -4,9 +4,6 @@ import { ElMessageBox, ElMessage } from "element-plus";
import axios from "axios"; import axios from "axios";
import { Search, Document } from "@element-plus/icons-vue"; import { Search, Document } from "@element-plus/icons-vue";
import { import {
postEnergyManage,
postEnergyDel,
postEnergyUpdate,
getOrganizationStructureInterface getOrganizationStructureInterface
} from "@/api/scheduling"; } from "@/api/scheduling";
import http from "../../api/http"; import http from "../../api/http";
...@@ -56,12 +53,12 @@ const tableLabel = reactive([ ...@@ -56,12 +53,12 @@ const tableLabel = reactive([
{ {
prop: "allowPagingId", prop: "allowPagingId",
label: "序号", label: "序号",
width: 100, width: 100
}, },
{ {
prop: "supplyName", prop: "supplyName",
label: "名称", label: "名称",
width: 200, width: 200
}, },
{ {
prop: "energyType", prop: "energyType",
...@@ -70,21 +67,21 @@ const tableLabel = reactive([ ...@@ -70,21 +67,21 @@ const tableLabel = reactive([
{ {
prop: "record", prop: "record",
label: "用度", label: "用度",
width: 200, width: 200
}, },
{ {
prop: "recordDate", prop: "recordDate",
label: "日期", label: "日期",
width: 300, width: 300
}, },
]); ]);
const formInline = reactive({ const formInline = reactive({
keyWord: "", keyWord: ""
}); });
const config = reactive({ const config = reactive({
supplyType: ["0", "1", "2", "3", "4"], supplyType: ["0", "1", "2", "3", "4"]
}); });
const handleSearch = () => { const handleSearch = () => {
...@@ -160,7 +157,7 @@ const handleAdd = () => { ...@@ -160,7 +157,7 @@ const handleAdd = () => {
dialogVisible.value = true; dialogVisible.value = true;
reset() reset()
} }
// 编辑
const handleEdit = (val) => { const handleEdit = (val) => {
// console.log("supplyData===>", supplyData.value); // console.log("supplyData===>", supplyData.value);
supplyData.value.forEach((item) => { supplyData.value.forEach((item) => {
...@@ -190,7 +187,7 @@ const onSubmit = () => { ...@@ -190,7 +187,7 @@ const onSubmit = () => {
http.post("api/energy/Save", { ...formEnergy.value }, false).then(res => { http.post("api/energy/Save", { ...formEnergy.value }, false).then(res => {
if (res.success) { if (res.success) {
dialogVisible.value = false dialogVisible.value = false
// ElMessage.success(res.message) ElMessage.success(res.message)
getEnergyData(); getEnergyData();
loading.value = false loading.value = false
} }
...@@ -201,7 +198,7 @@ const onSubmit = () => { ...@@ -201,7 +198,7 @@ const onSubmit = () => {
http.post("api/energy/Save", { ...formEnergy.value }, false).then((res => { http.post("api/energy/Save", { ...formEnergy.value }, false).then((res => {
if (res.success) { if (res.success) {
dialogVisible.value = false dialogVisible.value = false
// ElMessage.success(res.message) ElMessage.success(res.message)
getEnergyData(); getEnergyData();
loading.value = false loading.value = false
} }
...@@ -306,6 +303,7 @@ onMounted(() => { ...@@ -306,6 +303,7 @@ onMounted(() => {
stripe max-height="633"> stripe max-height="633">
<el-table-column prop="allowPagingId" label="序号" /> <el-table-column prop="allowPagingId" label="序号" />
<el-table-column prop="supplyName" label="名称" /> <el-table-column prop="supplyName" label="名称" />
<!-- TODO energyType显示中文 -->
<el-table-column prop="energyType" property="energyType" label="能源类型"> <el-table-column prop="energyType" property="energyType" label="能源类型">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.energyType == '0'">非节能</span> <span v-if="scope.row.energyType == '0'">非节能</span>
...@@ -454,7 +452,7 @@ table td { ...@@ -454,7 +452,7 @@ table td {
padding: 5px 10px; padding: 5px 10px;
} }
// 固定表头 // 固定表头!!要给table一个最大高度max-height
.el-table__body-wrapper.is-scrolling-none { .el-table__body-wrapper.is-scrolling-none {
overflow-y: auto; overflow-y: auto;
max-height: calc(100vh - 457px); //table-固定头部的高度 max-height: calc(100vh - 457px); //table-固定头部的高度
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
</table> </table>
</td> </td>
</tr> </tr>
<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">
...@@ -49,8 +47,6 @@ ...@@ -49,8 +47,6 @@
</table> </table>
</td> </td>
</tr> </tr>
<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">
...@@ -65,8 +61,6 @@ ...@@ -65,8 +61,6 @@
</table> </table>
</td> </td>
</tr> </tr>
<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">
...@@ -79,16 +73,12 @@ ...@@ -79,16 +73,12 @@
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
</el-form> </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>
...@@ -119,16 +109,16 @@ const rules = reactive({ ...@@ -119,16 +109,16 @@ const rules = reactive({
diffPercentage: [ diffPercentage: [
{ required: true, message: "偏差百分比是必填项", trigger: "blur" }, { required: true, message: "偏差百分比是必填项", trigger: "blur" },
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, "message": "偏差百分比输入不合法", trigger: 'blur' }, { pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, "message": "偏差百分比输入不合法", trigger: 'blur' },
{ min: 1, max: 10, message: '偏差百分比必须是 1-10位的数字', trigger: 'blur' } { min: 1, max: 10, message: '偏差百分比必须是 1-10位的数字', trigger: 'change' }
], ],
timeoutMin: [ timeoutMin: [
{ required: true, message: "判断时间是必填项", trigger: "blur" }, { required: true, message: "判断时间是必填项", trigger: "blur" },
{ pattern: /^[0-9]\d{1,10}$/, "message": "判断时间必须是 1-10位的数字", trigger: 'blur' } { pattern: /^[0-9]\d{1,10}$/, "message": "判断时间必须是 1-10位的数字", trigger: 'change' }
], ],
tempRegulation: [ tempRegulation: [
{ required: true, message: "调节温度是必选项", trigger: "blur" }, { required: true, message: "调节温度是必选项", trigger: "blur" },
{ pattern: /^(-?[0-9]+(\.[0-9]+)?)$/, "message": "调节温度输入不合法", trigger: 'blur' }, { pattern: /^(-?[0-9]+(\.[0-9]+)?)$/, "message": "调节温度输入不合法", trigger: 'blur' },
{ min: 1, max: 10, message: '调节温度必须是 1-10位的数字', trigger: 'blur' } { min: 1, max: 10, message: '调节温度必须是 1-10位的数字', trigger: 'change' }
] ]
}); });
......
<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 store from "@/store/index.js";
...@@ -10,6 +15,7 @@ import cloneDeep from 'lodash/cloneDeep' ...@@ -10,6 +15,7 @@ import cloneDeep from 'lodash/cloneDeep'
import {vFloatNumber} from "@/utils/directives.js"; 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 +26,33 @@ const tableHeaderClass = data => { // 表头样式 ...@@ -20,7 +26,33 @@ 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([]) // 供热站数据
const transferStructData = 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
...@@ -99,11 +131,16 @@ const onCancelBind = () => { ...@@ -99,11 +131,16 @@ const onCancelBind = () => {
getData() getData()
} }
onMounted(() => { 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(){
...@@ -143,17 +180,69 @@ function getCurrentDateTime() { ...@@ -143,17 +180,69 @@ 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 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
}
)
})
transferStructData.value.forEach(item=>{
item.transferList.forEach((unit)=>{
unit.isUsed = false
unit.customizeId = ''
})
})
})
} // 根据组织结构获取换热站结构数据
function getOrganizationStructure() {
getOrganizationStructureInterface().then(res => {
organizationStructure.value = res.data
getSupply()
getAllTransfer()
}).catch(err => {
ElMessage.error('接口异常,获取数据失败.')
})
} // 获取组织结构
</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: 300px" 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: 300px"/>
</div>
</el-col> </el-col>
<el-col :span="9" right-col> <el-col :span="9" right-col>
<el-button type="primary" @click="addWindowOpen = true" class="add-btn">新增</el-button>
<el-button type="primary" @click="search">查询</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div class="table-wrapper"> <div class="table-wrapper">
...@@ -162,7 +251,7 @@ function getCurrentDateTime() { ...@@ -162,7 +251,7 @@ function getCurrentDateTime() {
stripe stripe
border border
style="width: 100%" style="width: 100%"
height="900px" height="720px"
: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"/>
...@@ -183,7 +272,6 @@ function getCurrentDateTime() { ...@@ -183,7 +272,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>
...@@ -203,22 +291,34 @@ function getCurrentDateTime() { ...@@ -203,22 +291,34 @@ function getCurrentDateTime() {
<BindWindow <BindWindow
:open="bindWindowOpen" :open="bindWindowOpen"
:data="dependentSub" :data="dependentSub"
:supply="supplyData"
:transfer="transferStructData"
:all-weather-mag-data="dataBackup"
@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 {
......
<script setup> <script setup>
import {ref, defineProps, defineEmits, watchEffect, onMounted, reactive, computed} from "vue"; import {ref, defineProps, defineEmits, watchEffect, onMounted, reactive, computed, onBeforeMount} from "vue";
import {getTransfer,getOrganizationStructureInterface} from "@/api/scheduling.js" import {getTransfer, getWeatherMagData} from "@/api/scheduling.js"
import {getWeatherMagData, alterWeatherMagData, deleteWeatherMagData} from '@/api/scheduling.js' import { ElLoading } from 'element-plus'
import store from "@/store/index.js"; import store from "@/store/index.js";
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
import http from "@/api/http.js"; import http from "@/api/http.js";
...@@ -17,6 +17,21 @@ const props = defineProps({ ...@@ -17,6 +17,21 @@ const props = defineProps({
type: Object, type: Object,
default: null, default: null,
required: true required: true
},
supply: {
type: Array,
default: [],
required: true
},
transfer: {
type: Array,
default: [],
required: true
},
allWeatherMagData: {
type: Array,
default: [],
required: true
} }
}) })
const emit = defineEmits({ const emit = defineEmits({
...@@ -26,52 +41,59 @@ const emit = defineEmits({ ...@@ -26,52 +41,59 @@ const emit = defineEmits({
} }
}) })
const bindData = ref({}) const bindData = ref({})
const supplyData = ref([]) // 供热站数据
let loadingInstance = null
const transferData = ref([]) // 换热站结构数据,每个供热站和一定数量的换热站对应
const weatherMagData = ref([])
let preSupplyName = bindData.value.supplyName // 上一选中的供热站 let preSupplyName = bindData.value.supplyName // 上一选中的供热站
watchEffect(()=>{ let alreadyBindTransfer = ref([]) // 已绑定的换热站数据(和供热站一一对应)
// bindData.value = {...props.data}
bindData.value = cloneDeep(props.data) // 深拷贝数据
})
watchEffect(()=>{
if(bindData.value.supplyName !== preSupplyName){
checkboxGroup.value.length = 0
preSupplyName = bindData.value.supplyName
}
})
const inputStyle = { const inputStyle = {
color: 'black', color: 'black',
height: '24px' height: '24px'
} }
const organizationStructure = ref([]) // 组织结构数据
const supplyData = ref([]) // 供热站数据
const transferStructData = ref([]) // 换热站结构数据,每个供热站和一定数量的换热站对应
const BindTransferData = ref([]) // 绑定换热站数据 const BindTransferData = ref([]) // 绑定换热站数据
const checkboxGroup = ref([]) // checkboxGroup上绑定的数据,是根据自定义Id获取到的换热站数据 const checkboxGroup = ref([]) // checkboxGroup上绑定的数据,是根据自定义Id获取到的换热站数据
const checkBoxTransferList = ref([]) // 根据供热站变化展示的不同的transfer const checkBoxTransferList = ref([]) // 根据供热站变化展示的不同的transfer
onMounted(()=>{ onMounted(() => {
getOrganizationStructure()
})
watchEffect(() => {
bindData.value = cloneDeep(props.data) // 深拷贝数据
supplyData.value = cloneDeep(props.supply)
transferData.value = cloneDeep(props.transfer)
weatherMagData.value = cloneDeep(props.allWeatherMagData)
}) // 监听props的变化,传入依赖
watchEffect(() => {
if (bindData.value.supplyName !== preSupplyName) {
// checkboxGroup.value.length = 0
preSupplyName = bindData.value.supplyName
}
}) })
watchEffect(()=>{ watchEffect(() => {
// 监听绑定的bindData.supplyName的变换,返回对应的换热站数据 // 监听绑定的bindData.supplyName的变换,返回对应的换热站数据
checkBoxTransferList.value.length =0 // 每次供热站的值变化后,清空当前展示的数据,重新赋值 checkBoxTransferList.value.length = 0 // 每次供热站的值变化后,清空当前展示的数据,重新赋值
transferStructData.value.forEach(item=>{ transferData.value.forEach(item => {
if(item.supplyName === bindData.value.supplyName){ if (item.supplyName === bindData.value.supplyName) {
item.transferList.forEach(transferObj =>{ item.transferList.forEach(transferObj => {
checkBoxTransferList.value.push({ checkBoxTransferList.value.push({
unitId:transferObj.unitId, unitId: transferObj.unitId,
unitName:transferObj.unitName unitName: transferObj.unitName,
isUsed: transferObj.isUsed,
customizeId: transferObj.customizeId
}) })
}) })
} }
}) })
// console.log("根据供热站变化的换热站数据计算属性",selTransferCheckBoxLs.value) // console.log("根据供热站变化的换热站数据计算属性",selTransferCheckBoxLs.value)
}) })
const onSubmit = ()=>{
supplyData.value.forEach(item=>{ function onSubmit() {
if(item.supplyName === bindData.value.supplyName){ supplyData.value.forEach(item => {
if (item.supplyName === bindData.value.supplyName) {
bindData.value.supplyId = item.supplyId bindData.value.supplyId = item.supplyId
} }
}) })
checkboxGroup.value.forEach(item=>{ checkboxGroup.value.forEach(item => {
bindData.value.transfers.push({ bindData.value.transfers.push({
customizeId: bindData.value.customizeId, customizeId: bindData.value.customizeId,
unitId: item, unitId: item,
...@@ -80,59 +102,66 @@ const onSubmit = ()=>{ ...@@ -80,59 +102,66 @@ const onSubmit = ()=>{
}) })
emit('onConfirm', bindData.value) emit('onConfirm', bindData.value)
} // 点击保存按钮 } // 点击保存按钮
function getBindTransferData(){ // 获取绑定换热站数据,若在onMounted中无法调用失败(id可能为空),则在opOpen时操作 function getBindTransfer() { // 获取绑定换热站数据,若在onMounted中无法调用失败(id可能为空),则在opOpen时操作
let param = { let param = {
id: bindData.value.customizeId id: bindData.value.customizeId
} }
getTransfer(param).then(res=>{ getTransfer(param).then(res => {
BindTransferData.value = res.data BindTransferData.value = res.data
checkboxGroup.value.length = 0 // 每一次打开弹窗都会根据新的Id获取获取对应的换热站数据,并且清空原数组,重新赋值 checkboxGroup.value.length = 0 // 每一次打开弹窗都会根据新的Id获取获取对应的换热站数据,并且清空原数组,重新赋值
BindTransferData.value.forEach(item=>{ BindTransferData.value.forEach(item => {
checkboxGroup.value.push(item.unitId) checkboxGroup.value.push(item.unitId)
}) })
}) })
} // 获取当前绑定的换热站数据
function onOpen() {
loadingInstance = ElLoading.service({target: '.el-dialog'})
getBindTransfer()
getAlreadyBindTransfer()
console.log('--------------->>>',alreadyBindTransfer.value)
console.log('++++++++++++++>>>>',BindTransferData.value)
} }
function getSupply(){ function checkBoxChange(val) {
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){
// 获取所有已绑定换热站数据
async function getAlreadyBindTransfer() {
alreadyBindTransfer.value = []
for (const supplyItem of supplyData.value) {
let tempObj = {supplyName: "", transfers: []}
tempObj.supplyName = supplyItem.supplyName
for (let weaItem of weatherMagData.value) {
if (supplyItem.supplyName === weaItem.supplyName) {
const res = await getTransfer({id: weaItem.customizeId})
if (res.data.length) {
res.data.forEach(item => {
tempObj.transfers.push({...item})
})
}
}
}
alreadyBindTransfer.value.push(cloneDeep(tempObj))
} // 找到所有已绑定的换热站
for (const alreadyEle of alreadyBindTransfer.value) {
for (const alreadyTransItem of alreadyEle.transfers) {
for (const transferEle of transferData.value) {
for (const transferItem of transferEle.transferList) {
if(alreadyTransItem.unitId === transferItem.unitId){
transferItem.isUsed = true
transferItem.customizeId = alreadyTransItem.customizeId
break // 找到一个相同的换热站,标记状态为以使用,跳出循环
}
}
}
}
} // 为以绑定的换热站标记为以使用,并加入绑定的气象干预数据
loadingInstance.close()
} }
</script> </script>
<template> <template>
<el-dialog <el-dialog
v-model="props.open" v-model="props.open"
...@@ -151,8 +180,10 @@ function checkBoxChange(val){ ...@@ -151,8 +180,10 @@ function checkBoxChange(val){
<el-row class="not-select-row"> <el-row class="not-select-row">
<el-col :span="8" class="content-col-label">供热站:</el-col> <el-col :span="8" class="content-col-label">供热站:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-select v-model="bindData.supplyName" placeholder="" style="width: 210px;" class="custom-select" size="small"> <el-select v-model="bindData.supplyName" placeholder="" style="width: 210px;" class="custom-select"
<el-option v-for="item in supplyData" :key="item.supplyId" :label="item.supplyName" :value="item.supplyName"/> <!--此处还需考虑--> size="small">
<el-option v-for="item in supplyData" :key="item.supplyId" :label="item.supplyName"
:value="item.supplyName"/> <!--此处还需考虑-->
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
...@@ -160,11 +191,12 @@ function checkBoxChange(val){ ...@@ -160,11 +191,12 @@ function checkBoxChange(val){
<el-col :span="8" class="content-col-label">换热站:</el-col> <el-col :span="8" class="content-col-label">换热站:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-checkbox-group @change="checkBoxChange" v-model="checkboxGroup" style="width: 510px"> <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 v-for="item in checkBoxTransferList" :disabled="item.isUsed && item.customizeId !== bindData.customizeId" :key="item.unitId"
:label="item.unitName" :value="item.unitId"></el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<!-- <el-checkbox-group v-model="bindData.heatExchangeList" style="width: 510px">--> <!-- <el-checkbox-group v-model="bindData.heatExchangeList" style="width: 510px">-->
<!-- <el-checkbox v-for="item in heatExchangeList" :key="item" :label="item"/>--> <!-- <el-checkbox v-for="item in heatExchangeList" :key="item" :label="item"/>-->
<!-- </el-checkbox-group>--> <!-- </el-checkbox-group>-->
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
...@@ -186,7 +218,8 @@ function checkBoxChange(val){ ...@@ -186,7 +218,8 @@ function checkBoxChange(val){
border-left: #a6c3e9 1px solid; border-left: #a6c3e9 1px solid;
border-right: #a6c3e9 1px solid; border-right: #a6c3e9 1px solid;
} }
.select-row{
.select-row {
color: black; color: black;
border-bottom: #a6c3e9 1px solid; border-bottom: #a6c3e9 1px solid;
border-left: #a6c3e9 1px solid; border-left: #a6c3e9 1px solid;
...@@ -213,10 +246,11 @@ function checkBoxChange(val){ ...@@ -213,10 +246,11 @@ function checkBoxChange(val){
color: black; color: black;
} }
.el-checkbox{ .el-checkbox {
color: black; color: black;
} }
.custom-select .el-input__inner{
.custom-select .el-input__inner {
color: yellow; color: yellow;
background-color: #dfe8f6; background-color: #dfe8f6;
} }
......
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