Commit 2b6dd655 authored by xuke's avatar xuke

能源消耗接口

parent 4211ac20
<script setup>
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script>
<template>
<router-view ></router-view>
<!-- 国际化处理 -->
<el-config-provider :locale="zhCn">
<router-view></router-view>
</el-config-provider>
</template>
<style>
#app{
#app {
margin: 0;
padding: 0;
width: 100%;
height:100%;
overflow:hidden;
height: 100%;
overflow: hidden;
text-align: left;
min-height: 100vh;
max-width: 100vw;
/* display: flex;
flex-direction: column; */
}
/*
}
/*
::-webkit-scrollbar {
width: 0 !important;
}
......
......@@ -3,7 +3,6 @@
<div class="contentBlock">
<div class="contentBlockInn">
<el-card class="card-contianer">
<table cellpadding="0" cellspacing="1" style="background-color: #99bbe8">
<tr>
<th style="width: 25%">电调阈开启度</th>
......@@ -12,7 +11,6 @@
<tr>
<td style="text-align: left">
<el-input style="width: 80%" v-model="formDatas.openingOfElectricValve">
<template #append>
<div style="width: 40px">%
</div>
......@@ -20,20 +18,24 @@
</el-input>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th style="width: 25%">换热站</th>
<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">
{{ option }}
</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>
</td>
</tr>
......@@ -45,7 +47,6 @@
<tr>
<td style="text-align: left">
<el-input style="width: 80%" v-model="formDatas.boilerOutletWaterTemperature">
<template #append>
<div style="width: 40px;">
......@@ -71,17 +72,13 @@
<div style="width: 40px">
分钟
</div>
</template>
</el-input>
</el-form>
</td>
</tr>
</table>
</td>
</tr>
......@@ -96,17 +93,14 @@
<div style="width: 40px;">
m3/h
</div>
</template>
</el-input>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th style="width: 25%">锅炉房供水总管流量下限值</th>
<td style="width: 60%; margin: 0; padding: 0">
......@@ -119,15 +113,12 @@
m3/h
</div>
</template>
</el-input>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th style="width: 25%">目标温度最大值</th>
<td style="width: 60%; margin: 0; padding: 0">
......@@ -140,10 +131,8 @@
</div>
</template>
</el-input>
</td>
</tr>
</table>
</td>
......@@ -194,6 +183,7 @@
import { ref, reactive, onMounted, onUnmounted, onBeforeMount } from "vue";
import { postConfigBoilerUpdate } from '@/api/scheduling.js'
import http from '../../api/http';
import { ElMessage } from "element-plus";
const options = reactive(['瑞景园低区', '瑞景园高区', '翰锦园', '圣美园低区', '圣美园高区', '社区服务中心', '风雅园', '风雅园_幼儿园', '枫润园低区', '枫润园高区']);
......@@ -202,7 +192,7 @@ const form = ref({
})
const formDatas = ref([
{
"updateNullFields": "updateNullFields",
"updateNullFields": "",
"configId": "",
"openingOfElectricValve": "",
"boilerOutletWaterTemperature": "",
......@@ -218,39 +208,16 @@ const formDatas = ref([
const getListData = () => {
http.get("/api/configboiler/getData").then((result) => {
formDatas.value = result.data;
formDatas.value.updateNullFields=""
})
}
const onSave = async () => {
await postConfigBoilerUpdate({...formDatas.value}).then((res) => {
if (res.success) {
const result = await postConfigBoilerUpdate({...formDatas.value})
if(result.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(() => {
getListData()
......
......@@ -5,6 +5,8 @@ import axios from 'axios'
import { Search, Document } from "@element-plus/icons-vue"
import { postEnergyManage, postEnergyDel, postEnergyUpdate } from "@/api/scheduling"
import http from '../../api/http'
import loading from 'element-plus'
import store from '../../store'
const { proxy } = getCurrentInstance()
const tableData = ref([{}])
const formEnergy = ref({
......@@ -12,14 +14,15 @@ const formEnergy = ref({
"supplyId": "",
"energyType": "",
"record": "",
"recordDate": ""
"recordDate": "",
"energyName":''
})
const energyForm = ref()
const dialogVisible = ref(false)
const getEnergyData = async () => {
await http.post("/api/energy/getData", config.supplyType).then(res => {
console.log("res:", res);
// console.log("res:", res);
tableData.value = res.data
}).catch(err => {
console.log(error)
......@@ -27,6 +30,12 @@ const getEnergyData = async () => {
ElMessage.success('获取数据成功')
}
//获取换热机组列表
// const getSupplys =() => {
// const res = http.get("api/home/GetOrg",false)
// console.log(res.data);
// }
const tableLabel = reactive([
{
......@@ -60,14 +69,14 @@ const formInline = reactive({
})
const config = reactive({
supplyType: ["0","1","2","3","4"],
supplyType: ["0", "1", "2", "3", "4"],
})
const handleSearch = () => {
config.supplyType = formInline.keyWord
config.supplyType = [`${config.supplyType}`]
getEnergyData(),
tableData.energyType = '',
formEnergy.value.energyType = '',
ElMessage.success('获取数据成功')
}
......@@ -85,7 +94,7 @@ const timeFormat = (time) => {
//表单校验规则
const rules = reactive({
supplyName: [{ required: true, message: "名称是必填项", trigger: "blur" }],
supplyId: [{ required: true, message: "名称是必填项", trigger: "blur" }],
energyType: [
{ required: true, message: "能源类型是必填项", trigger: "blur" },
......@@ -129,13 +138,13 @@ const handleDelete = async (row) => {
type: 'warning',
confirmButtonClass: 'ExitConfirmButton'
})
await http.post("api/energy/Delete", EnergyId = '"' + row.energyId + '"', false).then(res => {
}).then(res => {
ElMessage({
type: 'success', message: '删除成功'
})
const res = await http.get("api/energy/Delete",{params:{EnergyId:row.energyId}}, false)
if(res.success) {
ElMessage.success("删除成功")
getEnergyData()
})
}else {
ElMessage.error("删除失败")
}
}
......@@ -155,7 +164,7 @@ const handleAdd = () => {
action.value = "add",
dialogVisible.value = true;
proxy.$refs['energyForm'].resetFields()
formEnergy.supplyName = '',
formEnergy.supplyType = '',
formEnergy.energyType = ''
}
......@@ -165,6 +174,12 @@ const handleEdit = (val) => {
dialogVisible.value = true
nextTick(() => {
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 = () => {
res = postEnergyUpdate(formEnergy.value)
proxy.$refs['energyForm'].resetFields()
dialogVisible.value = false
formEnergy.value.supplyId = ''
formEnergy.energyType = ''
getEnergyData()
}
} else {
......@@ -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(() => {
getEnergyData()
getSupplys()
})
......@@ -289,11 +357,14 @@ onMounted(() => {
<table cellpadding="0" cellspacing="0">
<tr>
<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="行政区供热站" />
<el-option label="福宛里供热站" value="福宛里供热站" />
</el-select>
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</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>
</tr>
</table>
......@@ -306,12 +377,15 @@ onMounted(() => {
<table cellpadding="0" cellspacing="0">
<tr>
<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-option label="热" value="1" />
<el-option label="水" value="2" />
<el-option label="电" value="3" />
<el-option label="机械" value="4" />
<el-option label="非节能" value="0" />
<el-option label="一步节能" value="1" />
<el-option label="二步节能" value="2" />
<el-option label="三步节能" value="3" />
<el-option label="四步节能" value="4" />
</el-select>
</el-form-item>
</td>
</tr>
</table>
......@@ -426,6 +500,9 @@ table td {
background-color: #92cbf1 !important;
}
.el-cascader-menu {
width: 100%;
}
// .bottom {
// // 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