Commit bd8d5f48 authored by 张伯涛's avatar 张伯涛

调度管理部分页面排序问题修改

parent b4373b81
......@@ -320,7 +320,7 @@ import AMapLoader from "@amap/amap-jsapi-loader";
<div v-show="mapLevel === 2">
<div class="secondLeftLayer">
<div class="secondLeftLayer_one">
<div style="display: flex;justify-content: space-between;padding: 10px">
<div style="display: flex;justify-content: space-between;padding: 3px 10px">
<div class="secondLeftLayer_title"><p>热源趋势曲线</p></div>
<div style="display: flex;align-items: center">
<ul v-for="(item,index) in heatSourceBtnList" :key="index">
......@@ -452,7 +452,6 @@ import {
} from "../api/screenDisplay";
import moment from 'moment'
import {defineComponent} from "vue";
import {getOrganizationStructureInterface} from "../api/scheduling.js";
export default defineComponent({
components: {
vue3ScrollSeamless
......@@ -462,7 +461,6 @@ export default defineComponent({
if(newV === 1) {
}else if(newV === 2) {
this.handleGetOrg() // 获取组织结构
this.getHeatSourceTrend(); //获取热源趋势曲线
this.handleGetGYSupplyWaterTrend(); // 获取一次侧补水曲线
this.getDayEnergyConsumption(); // 获取当日实时能耗
......@@ -1052,13 +1050,22 @@ export default defineComponent({
},
// 热源趋势曲线
getHeatSourceTrend() {
const nowDate = moment(new Date()).format('YYYY-MM-DD')
const StartTime = nowDate + ' 00:00:00'
const EndTime = nowDate + ' 23:59:59'
const now = new Date();
// 获取前一个小时的时间
now.setHours(now.getHours() - 1);
const EndTime = moment(now).format('YYYY-MM-DD HH') + ':00:00'
const startNow = new Date();
// 获取前25个小时的时间
startNow.setHours(startNow.getHours() - 25);
const StartTime = moment(startNow).format('YYYY-MM-DD HH') + ':00:00'
console.log('EndTime',EndTime)
console.log('StartTime',StartTime)
const params = {
StartTime: '2024-08-26 00:00:00',
EndTime: '2024-08-27 00:00:00',
CenterId: '7E0263D8-61BC-46F9-AA4F-52394687F8CD',
StartTime: StartTime,
EndTime: EndTime,
CenterId: this.mapBack.centerId,
}
GetGYHeatSourceTrend(params).then(res => {
this.temperatureList = res.data.temperatureList //温度列表
......@@ -1085,13 +1092,6 @@ export default defineComponent({
}
})
},
// 获取组织结构
handleGetOrg() {
getOrganizationStructureInterface().then(res => {
this.enterpriseId = res.data[0].enterpriseId
console.log('this.enterpriseId',this.enterpriseId)
})
},
// 一次侧补水量曲线
handleGetGYSupplyWaterTrend() {
const nowDate = moment(new Date()).format('YYYY-MM-DD')
......@@ -1100,7 +1100,7 @@ export default defineComponent({
const params = {
StartTime: StartTime,
EndTime: EndTime,
CenterId: '7E0263D8-61BC-46F9-AA4F-52394687F8CD',
CenterId: this.mapBack.centerId,
}
getGYSupplyWaterTrend(params).then(res => {
if(res.data && res.data.length > 0) {
......@@ -1122,7 +1122,7 @@ export default defineComponent({
//获取当日实时能耗
getDayEnergyConsumption() {
const params = {
id: '7E0263D8-61BC-46F9-AA4F-52394687F8CD'
id: this.mapBack.centerId
}
getGYSupplyRealData(params).then(res => {
this.dayEnergyForm = res.data[0]
......
......@@ -314,7 +314,14 @@ function getOrganizationStructure() {
ElMessage.error('接口异常,获取数据失败.')
})
}
function sortByEnergyLevel(a, b) {
return a.energyType - b.energyType;
}
function supplyNameLevel(a, b) {
const energyLevels = { '重阳里供热站': 1, '东部供热站': 2, '福苑里供热站': 3, '小王庄供热站': 4, '行政区供热站': 5 };
return energyLevels[a.supplyName] - energyLevels[b.supplyName];
}
const checkAll = ref(false)
watch(
() => checkAll.value,
......@@ -398,17 +405,17 @@ onMounted(() => {
</tr>
</table>
<!-- :default-sort = "{prop: 'recordDate', order: 'descending'}"-->
<el-table v-loading="loading" :data="tableData" style="width: 60%;font-size: 12px;color: #181818;"
height="calc(100vh - 160px)"
:default-sort = "{prop: 'recordDate', order: 'descending'}"
:header-cell-style="{ color: '#225475', backgroundColor: '#B8CFEE', 'text-align': 'center', height: '40px', padding: '0px', border: '1px solid #99bbe8' }"
:cell-style="{ 'text-align': 'center', padding: '0px' }" :row-style="{ height: '40px', padding: '0px' }" border
stripe>
<el-table-column prop="allowPagingId" label="序号" width="100" />
<el-table-column prop="supplyName" label="名称" />
<el-table-column type="index" label="序号" align="center" width="100"/>
<el-table-column label="名称" sortable :sort-method="(a, b) => supplyNameLevel(a, b)" :sort-by="['supplyName']" prop="supplyName" width="150"/>
<!-- TODO energyType显示中文 -->
<el-table-column prop="energyType" property="energyType" label="能源类型">
<el-table-column sortable :sort-method="(a, b) => sortByEnergyLevel(a, b)" :sort-by="['energyType']" property="energyType" label="能源类型">
<template #default="scope">
<span v-if="scope.row.energyType == '0'">非节能</span>
<span v-if="scope.row.energyType == '1'">一步节能</span>
......@@ -417,7 +424,7 @@ onMounted(() => {
<span v-if="scope.row.energyType == '4'">四步节能</span>
</template>
</el-table-column>
<el-table-column prop="record" label="用度" />
<el-table-column prop="record" sortable label="用度" />
<el-table-column prop="recordDate" sortable label="用度日期" />
<el-table-column fixed="right" label="操作"width="120">
<template #default="scope">
......
......@@ -240,7 +240,7 @@ const tableHeight = ref(h);
height="calc(100vh - 180px)"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass">
<el-table-column prop="allowPagingId" label="编号" align="center" width="60"/>
<el-table-column type="index" label="序号" align="center" width="100"/>
<el-table-column prop="customizeName" label="自定义名称" width="200"/>
<el-table-column prop="supplyName" label="供热站名称" width="160"/>
<el-table-column prop="operateTime" sortable label="操作时间" width="210"/>
......
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