Commit 2b6dd655 authored by xuke's avatar xuke

能源消耗接口

parent 4211ac20
<script setup>
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script>
<template> <template>
<router-view ></router-view> <!-- 国际化处理 -->
<el-config-provider :locale="zhCn">
<router-view></router-view>
</el-config-provider>
</template> </template>
<style> <style>
#app{ #app {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 100%; width: 100%;
height:100%; height: 100%;
overflow:hidden; overflow: hidden;
text-align: left; text-align: left;
min-height: 100vh; min-height: 100vh;
max-width: 100vw; max-width: 100vw;
/* display: flex; /* display: flex;
flex-direction: column; */ flex-direction: column; */
} }
/*
/*
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0 !important; width: 0 !important;
} }
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<div class="contentBlock"> <div class="contentBlock">
<div class="contentBlockInn"> <div class="contentBlockInn">
<el-card class="card-contianer"> <el-card class="card-contianer">
<table cellpadding="0" cellspacing="1" style="background-color: #99bbe8"> <table cellpadding="0" cellspacing="1" style="background-color: #99bbe8">
<tr> <tr>
<th style="width: 25%">电调阈开启度</th> <th style="width: 25%">电调阈开启度</th>
...@@ -12,7 +11,6 @@ ...@@ -12,7 +11,6 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-input style="width: 80%" v-model="formDatas.openingOfElectricValve"> <el-input style="width: 80%" v-model="formDatas.openingOfElectricValve">
<template #append> <template #append>
<div style="width: 40px">% <div style="width: 40px">%
</div> </div>
...@@ -20,20 +18,24 @@ ...@@ -20,20 +18,24 @@
</el-input> </el-input>
</td> </td>
</tr> </tr>
</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 v-model="form.type" style="width: 60%;"> <!-- <el-checkbox-group v-model="form.type" style="width: 60%;">
<el-checkbox v-for="(option, index) in options" :key="index" :label="option"> <el-checkbox v-for="(option, index) in options" :key="index" :label="option">
{{ option }} {{ option }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> -->
<el-checkbox-group v-model="form.type" style="width: 60%;">
<el-checkbox v-for="(option, index) in formDatas.transferIds" :label="option">
{{ option }}
</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</td> </td>
</tr> </tr>
...@@ -45,7 +47,6 @@ ...@@ -45,7 +47,6 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-input style="width: 80%" v-model="formDatas.boilerOutletWaterTemperature"> <el-input style="width: 80%" v-model="formDatas.boilerOutletWaterTemperature">
<template #append> <template #append>
<div style="width: 40px;"> <div style="width: 40px;">
...@@ -71,17 +72,13 @@ ...@@ -71,17 +72,13 @@
<div style="width: 40px"> <div style="width: 40px">
分钟 分钟
</div> </div>
</template> </template>
</el-input> </el-input>
</el-form> </el-form>
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
...@@ -96,17 +93,14 @@ ...@@ -96,17 +93,14 @@
<div style="width: 40px;"> <div style="width: 40px;">
m3/h m3/h
</div> </div>
</template> </template>
</el-input> </el-input>
</td> </td>
</tr> </tr>
</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">
...@@ -119,15 +113,12 @@ ...@@ -119,15 +113,12 @@
m3/h m3/h
</div> </div>
</template> </template>
</el-input> </el-input>
</td> </td>
</tr> </tr>
</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">
...@@ -140,10 +131,8 @@ ...@@ -140,10 +131,8 @@
</div> </div>
</template> </template>
</el-input> </el-input>
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
...@@ -194,6 +183,7 @@ ...@@ -194,6 +183,7 @@
import { ref, reactive, onMounted, onUnmounted, onBeforeMount } from "vue"; import { ref, reactive, onMounted, onUnmounted, onBeforeMount } from "vue";
import { postConfigBoilerUpdate } from '@/api/scheduling.js' import { postConfigBoilerUpdate } from '@/api/scheduling.js'
import http from '../../api/http'; import http from '../../api/http';
import { ElMessage } from "element-plus";
const options = reactive(['瑞景园低区', '瑞景园高区', '翰锦园', '圣美园低区', '圣美园高区', '社区服务中心', '风雅园', '风雅园_幼儿园', '枫润园低区', '枫润园高区']); const options = reactive(['瑞景园低区', '瑞景园高区', '翰锦园', '圣美园低区', '圣美园高区', '社区服务中心', '风雅园', '风雅园_幼儿园', '枫润园低区', '枫润园高区']);
...@@ -202,7 +192,7 @@ const form = ref({ ...@@ -202,7 +192,7 @@ const form = ref({
}) })
const formDatas = ref([ const formDatas = ref([
{ {
"updateNullFields": "updateNullFields", "updateNullFields": "",
"configId": "", "configId": "",
"openingOfElectricValve": "", "openingOfElectricValve": "",
"boilerOutletWaterTemperature": "", "boilerOutletWaterTemperature": "",
...@@ -218,39 +208,16 @@ const formDatas = ref([ ...@@ -218,39 +208,16 @@ const formDatas = ref([
const getListData = () => { const getListData = () => {
http.get("/api/configboiler/getData").then((result) => { http.get("/api/configboiler/getData").then((result) => {
formDatas.value = result.data; formDatas.value = result.data;
formDatas.value.updateNullFields=""
}) })
} }
const onSave = async () => { const onSave = async () => {
await postConfigBoilerUpdate({...formDatas.value}).then((res) => { const result = await postConfigBoilerUpdate({...formDatas.value})
if (res.success) { if(result.success) {
ElMessage.success('修改成功') ElMessage.success('修改成功')
getListData()
} }
})
} }
// const onSave = () => {
// http.post("api/configboiler/Save","`updateNullFields=formDatas.updateNullFields&configId=formDatas.configId&openingOfElectricValve=formDatas.openingOfElectricValve&boilerOutletWaterTemperature=formDatas.boilerOutletWaterTemperature&holdingTime=formDatas.holdingTime&upperLlimitMainFlow=formDatas.upperLlimitMainFlow&lowerLlimitMainFlow=formDatas.lowerLlimitMainFlow&maxTargetTemperature=formDatas.maxTargetTemperature&bestHoldingTime=formDatas.bestHoldingTime&transferIds=formDatas.transferIds`").then((result) => {
// if (result.success) {
// ElMessage.success('修改成功')
// getListData()
// }
// }).catch((error) => {
// console.log(error)
// })
// }
// const onSave = () => {
// http.post("api/configboiler/Save","formDatas.value").then((result) => {
// if (result.success) {
// ElMessage.success('修改成功')
// getListData()
// }
// }).catch((error) => {
// console.log(error)
// })
// }
onMounted(() => { onMounted(() => {
getListData() getListData()
......
...@@ -5,6 +5,8 @@ import axios from 'axios' ...@@ -5,6 +5,8 @@ import axios from 'axios'
import { Search, Document } from "@element-plus/icons-vue" import { Search, Document } from "@element-plus/icons-vue"
import { postEnergyManage, postEnergyDel, postEnergyUpdate } from "@/api/scheduling" import { postEnergyManage, postEnergyDel, postEnergyUpdate } from "@/api/scheduling"
import http from '../../api/http' import http from '../../api/http'
import loading from 'element-plus'
import store from '../../store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const tableData = ref([{}]) const tableData = ref([{}])
const formEnergy = ref({ const formEnergy = ref({
...@@ -12,14 +14,15 @@ const formEnergy = ref({ ...@@ -12,14 +14,15 @@ const formEnergy = ref({
"supplyId": "", "supplyId": "",
"energyType": "", "energyType": "",
"record": "", "record": "",
"recordDate": "" "recordDate": "",
"energyName":''
}) })
const energyForm = ref() const energyForm = ref()
const dialogVisible = ref(false) const dialogVisible = ref(false)
const getEnergyData = async () => { const getEnergyData = async () => {
await http.post("/api/energy/getData", config.supplyType).then(res => { await http.post("/api/energy/getData", config.supplyType).then(res => {
console.log("res:", res); // console.log("res:", res);
tableData.value = res.data tableData.value = res.data
}).catch(err => { }).catch(err => {
console.log(error) console.log(error)
...@@ -27,6 +30,12 @@ const getEnergyData = async () => { ...@@ -27,6 +30,12 @@ const getEnergyData = async () => {
ElMessage.success('获取数据成功') ElMessage.success('获取数据成功')
} }
//获取换热机组列表
// const getSupplys =() => {
// const res = http.get("api/home/GetOrg",false)
// console.log(res.data);
// }
const tableLabel = reactive([ const tableLabel = reactive([
{ {
...@@ -60,14 +69,14 @@ const formInline = reactive({ ...@@ -60,14 +69,14 @@ const formInline = reactive({
}) })
const config = reactive({ const config = reactive({
supplyType: ["0","1","2","3","4"], supplyType: ["0", "1", "2", "3", "4"],
}) })
const handleSearch = () => { const handleSearch = () => {
config.supplyType = formInline.keyWord config.supplyType = formInline.keyWord
config.supplyType = [`${config.supplyType}`] config.supplyType = [`${config.supplyType}`]
getEnergyData(), getEnergyData(),
tableData.energyType = '', formEnergy.value.energyType = '',
ElMessage.success('获取数据成功') ElMessage.success('获取数据成功')
} }
...@@ -85,7 +94,7 @@ const timeFormat = (time) => { ...@@ -85,7 +94,7 @@ const timeFormat = (time) => {
//表单校验规则 //表单校验规则
const rules = reactive({ const rules = reactive({
supplyName: [{ required: true, message: "名称是必填项", trigger: "blur" }], supplyId: [{ required: true, message: "名称是必填项", trigger: "blur" }],
energyType: [ energyType: [
{ required: true, message: "能源类型是必填项", trigger: "blur" }, { required: true, message: "能源类型是必填项", trigger: "blur" },
...@@ -129,13 +138,13 @@ const handleDelete = async (row) => { ...@@ -129,13 +138,13 @@ const handleDelete = async (row) => {
type: 'warning', type: 'warning',
confirmButtonClass: 'ExitConfirmButton' confirmButtonClass: 'ExitConfirmButton'
}) })
await http.post("api/energy/Delete", EnergyId = '"' + row.energyId + '"', false).then(res => { const res = await http.get("api/energy/Delete",{params:{EnergyId:row.energyId}}, false)
}).then(res => { if(res.success) {
ElMessage({ ElMessage.success("删除成功")
type: 'success', message: '删除成功'
})
getEnergyData() getEnergyData()
}) }else {
ElMessage.error("删除失败")
}
} }
...@@ -155,7 +164,7 @@ const handleAdd = () => { ...@@ -155,7 +164,7 @@ const handleAdd = () => {
action.value = "add", action.value = "add",
dialogVisible.value = true; dialogVisible.value = true;
proxy.$refs['energyForm'].resetFields() proxy.$refs['energyForm'].resetFields()
formEnergy.supplyName = '', formEnergy.supplyType = '',
formEnergy.energyType = '' formEnergy.energyType = ''
} }
...@@ -165,6 +174,12 @@ const handleEdit = (val) => { ...@@ -165,6 +174,12 @@ const handleEdit = (val) => {
dialogVisible.value = true dialogVisible.value = true
nextTick(() => { nextTick(() => {
Object.assign(formEnergy.value, { ...val }) Object.assign(formEnergy.value, { ...val })
console.log("val:",val);
// var newArr = []
// formEnergy.supplyId.map((item)=> {
// newArr.push(item[item.length-1])
// })
// console.log(newArr);
}) })
} }
...@@ -192,7 +207,8 @@ const onSubmit = () => { ...@@ -192,7 +207,8 @@ const onSubmit = () => {
res = postEnergyUpdate(formEnergy.value) res = postEnergyUpdate(formEnergy.value)
proxy.$refs['energyForm'].resetFields() proxy.$refs['energyForm'].resetFields()
dialogVisible.value = false dialogVisible.value = false
formEnergy.value.supplyId = ''
formEnergy.energyType = ''
getEnergyData() getEnergyData()
} }
} else { } else {
...@@ -203,11 +219,63 @@ const onSubmit = () => { ...@@ -203,11 +219,63 @@ const onSubmit = () => {
}) })
} }
}) })
}
const props = { multiple: false, emitPath: false,checkStrictly: true }
const enterpriseId = ref();
let supplyIdOptions = reactive([])
getEnterprise();
function getEnterprise() {
var result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
const PatrolInfo = reactive({
"Id": [],
"startTime": "",
"endTime": "",
"start": 0,
"count": 30,
"sort": ""
})
const options = reactive([]);
const getSupplys = () => {
loading.value = true;
options.length = 0;
PatrolInfo.Id.length = 0;
var result = store.getters.getEnterprise();
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 => {
let chi = [];
supply.transferList.forEach(unit => {
// chi.push({ value: unit.unitId, label: unit.unitName });
});
c.push({ children: chi, label: supply.supplyName, value: supply.supplyId });
});
options.push({ children: c, label: center.serviceCenterName });
})
} else {
element.supplyList.forEach(element => {
let chi = [];
element.transferList.forEach(unit => {
chi.push({ value: unit.unitId, label: unit.unitName });
})
options.push({ children: chi, label: element.supplyName });
})
}
}
});
}
} }
onMounted(() => { onMounted(() => {
getEnergyData() getEnergyData()
getSupplys()
}) })
...@@ -289,11 +357,14 @@ onMounted(() => { ...@@ -289,11 +357,14 @@ onMounted(() => {
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-select v-model="formEnergy.supplyId" placeholder="请选择"> <!-- <el-select v-model="formEnergy.supplyId" placeholder="请选择">
<el-option label="东部供热站" value="DFA20074-8731-457F-B63F-4E1858CFE266" /> <el-option label="东部供热站" value="DFA20074-8731-457F-B63F-4E1858CFE266" />
<el-option label="行政区供热站" value="行政区供热站" /> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
<el-option label="福宛里供热站" value="福宛里供热站" /> </el-select> -->
</el-select> <el-form-item prop="supplyName" style="margin: 0;padding: 0;width: 100%;">
<el-cascader :options="options" v-model="formEnergy.supplyId" :props="props" collapse-tags clearable
:show-all-levels="false" placeholder="请选择" class="el-cascader-menu" />
</el-form-item>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -306,12 +377,15 @@ onMounted(() => { ...@@ -306,12 +377,15 @@ onMounted(() => {
<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="energyType" style="margin: 0;padding: 0;width: 100%;">
<el-select v-model="formEnergy.energyType" placeholder="请选择"> <el-select v-model="formEnergy.energyType" placeholder="请选择">
<el-option label="热" value="1" /> <el-option label="非节能" value="0" />
<el-option label="水" value="2" /> <el-option label="一步节能" value="1" />
<el-option label="电" value="3" /> <el-option label="二步节能" value="2" />
<el-option label="机械" value="4" /> <el-option label="三步节能" value="3" />
<el-option label="四步节能" value="4" />
</el-select> </el-select>
</el-form-item>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -426,6 +500,9 @@ table td { ...@@ -426,6 +500,9 @@ table td {
background-color: #92cbf1 !important; background-color: #92cbf1 !important;
} }
.el-cascader-menu {
width: 100%;
}
// .bottom { // .bottom {
// // border: 1px solid red; // // border: 1px solid red;
......
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