Commit 77ecd1bc authored by 裴文涛's avatar 裴文涛
parents 29c4a617 cd57e9b3
<script setup>
import mitter from "@/utils/mitter";
import { ref } from "vue";
const props = defineProps({
items: Object,
prop: String,
});
const value = ref("");
const input = () => {
console.log(props.items);
mitter.emit("changeVal", { name: props.prop, value: value.value });
};
</script>
<template>
<div>
<el-date-picker v-bind="items" v-model="value" @input="input" />
</div>
</template>
import select from "./select.vue";
import input from "./input.vue";
import dateTimePicker from "./dateTimePicker.vue";
export default {
select,
input,
dateTimePicker
};
<script setup>
import mitter from "@/utils/mitter";
import { ref } from "vue";
const props = defineProps({
items: Object,
prop: String,
});
const value = ref("");
const input = () => {
console.log(props.items);
mitter.emit("changeVal", { name: props.prop, value: value.value });
};
</script>
<template>
<div>
<el-input v-bind="items" v-model="value" @input="input" />
</div>
</template>
<script setup>
import { ref } from "vue";
import emitter from "@/utils/mitter";
const porps = defineProps({
items: Object,
prop: String,
});
const value = ref("");
// 选择某一项之后触发changeVale事件
const onChangeFirstValue = (val) => {
emitter.emit("changeVal", { name: porps.prop, value: value.value });
};
</script>
<template>
<div>
<el-select
v-model="value"
:v-bind="items"
style="width: 240px"
@change="onChangeFirstValue(value)"
>
<el-option
v-for="item in items.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</template>
\ No newline at end of file
<template>
<div class="annual-param-container">
<el-card>
<div class="search-add-wrapper">
<el-form ref="searchForm" :inline="true" label-suffix=":">
<el-row :gutter="10">
<el-col
v-for="(item, index) in props.schemas"
:key="index"
:span="20"
>
<el-form-item :label="item.label" :prop="item.prop">
<component
:is="components[item.type]"
:prop="item.prop"
:items="item.componentProps"
></component>
<!-- <el-input v-model="queryPrarms" placeholder="请选择" /> -->
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-button type="primary" class="add-search-btn" @click="handleSearch"
>查询</el-button
>
<el-button type="primary" class="add-search-btn" @click="handleReset"
>重置</el-button
>
</div>
</div>
<div class="table-wrapper">
<el-table
:data="data"
stripe
border
style="width: 100%"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass"
>
<el-table-column
v-for="(column, key) in columns"
:key="key"
:v-bind="column"
></el-table-column>
</el-table>
</div>
</el-card>
</div>
</template>
<script setup>
import { defineProps, reactive, watch } from "vue";
import mitter from "@/utils/mitter";
import components from "@/components/FormComponents/index"; // 将所有组件引入
const emit = defineEmits(["DataChange"]);
const props = defineProps({
schemas: {
type: Array,
default: [],
},
formData: {
type: Object,
default: () => {},
},
api: {
type: String,
default: "",
},
columns: {
type: Array,
default: [],
},
});
const data = reactive([]);
const searchForm = reactive({});
const handleSearch = () => {
console.log(handleSearch);
};
const handleReset = () => {
console.log(handleReset);
};
// 监听chageVal
mitter.on("changeVal", (data) => {
console.log(data);
const { name, value } = data;
if (name) {
props.formData[name] = value;
}
});
watch(
() => props.formData,
(newVal) => {
emit("DataChange", newVal);
},
{ deep: true }
);
defineExpose({ formData: props.formData });
</script>
<style scoped lang="less">
.annual-param-container {
width: 100%;
margin: 4px;
}
.search-add-wrapper {
width: 100%;
display: flex;
justify-content: start;
}
.search-add-wrapper .el-row {
border: none;
display: flex;
align-items: center;
margin: 5px 10px 5px 5px;
}
.add-search-btn {
margin: 5px 10px 5px 0;
}
:deep(.table-header-class) {
text-align: center;
font-size: 12px;
background-color: #c4d8f1 !important;
color: #124c6a;
}
:deep(.table-body-class) {
font-size: 12px;
color: black;
}
.table-operate-column {
display: flex;
justify-content: center;
align-items: center;
}
.table-operate-column .el-button {
font-size: 12px;
}
::v-deep .el-table__body tr:hover > td {
background: linear-gradient(
to top,
rgb(0, 198, 255),
rgb(255, 255, 255)
) !important;
}
.pagination-wrapper {
padding: 5px;
display: flex;
justify-content: space-between;
align-items: center;
}
.el-row[first] {
border-top: 1px solid #a6c3e9;
}
.el-row {
border-left: 1px solid #a6c3e9;
border-right: 1px solid #a6c3e9;
border-bottom: 1px solid #a6c3e9;
width: 100%;
height: 35px;
color: #124362;
}
.el-col[col-label] {
display: flex;
justify-content: end;
align-items: center;
border-right: 1px solid #a6c3e9;
background-color: #f2f6f8;
padding-right: 5px;
}
.el-col[col-value] {
display: flex;
justify-content: start;
align-items: center;
padding-left: 5px;
}
.el-input {
color: black;
height: 24px;
}
</style>
// 创建路由为历史 // 创建路由为历史
import {createRouter, createWebHistory} from "vue-router"; import { createRouter, createWebHistory } from "vue-router";
import LoginPage from '@/views/login/login.vue' import LoginPage from "@/views/login/login.vue";
import HomePage from '@/views/home.vue' import HomePage from "@/views/home.vue";
import AboutPage from '@/components/About.vue' import AboutPage from "@/components/About.vue";
import store from '@/store' import store from "@/store";
//import nProgress from 'nprogress' //import nProgress from 'nprogress'
import screenDisplay from '@/views/Gis/screenDisplay.vue' import screenDisplay from "@/views/Gis/screenDisplay.vue";
import iframe from '@/views/iframe.vue' import iframe from "@/views/iframe.vue";
// 定义路由规则 // 定义路由规则
const routes = [ const routes = [
{ {
path: '/', path: "/",
component: HomePage component: HomePage,
},
{
path: "/screenDisplay",
component: screenDisplay,
}, },
{ {
path: '/screenDisplay', path: "/iframe",
component: screenDisplay name: "iframe",
}, { component: iframe,
path: '/iframe',
name: 'iframe',
component: iframe
}, },
{ {
path: '/Login', path: "/Login",
name: "/Login", name: "/Login",
component: LoginPage component: LoginPage,
}, },
{ {
path: '/Home', path: "/Home",
name: "Home", name: "Home",
component: HomePage, component: HomePage,
children: [{ children: [
path: '/RealSupply', {
name: 'RealSupplyPage', path: "/RealSupply",
component: () => import('@/views/RealPage/RealSupplyPage.vue'), name: "RealSupplyPage",
meta: { component: () => import("@/views/RealPage/RealSupplyPage.vue"),
title: '首页-实时热源'
}
}, {
path: '/RealTransfer',
name: '/RealTransPage',
component: () => import('@/views/RealPage/RealTransPage.vue'),
meta: { meta: {
title: '实时换热站' title: "首页-实时热源",
} },
}, { },
path: '/RealPipe', {
name: 'RealPipePage', path: "/RealTransfer",
component: () => import('@/views/RealPage/RealPipePage.vue'), name: "/RealTransPage",
component: () => import("@/views/RealPage/RealTransPage.vue"),
meta: { meta: {
title: '实时总管' title: "实时换热站",
} },
}, { },
path: '/RealBoiler',
name: 'RealBoilerPage', {
component: () => import('@/views/RealPage/RealBoilerPage.vue'), path: "/RealPipe",
name: "RealPipePage",
component: () => import("@/views/RealPage/RealPipePage.vue"),
meta: { meta: {
title: '实时锅炉' title: "实时总管",
} },
}, { },
path: '/RealEnergy', {
name: 'RealEnergyPage', path: "/RealBoiler",
component: () => import('@/views/RealPage/RealEnergyPage.vue'), name: "RealBoilerPage",
component: () => import("@/views/RealPage/RealBoilerPage.vue"),
meta: { meta: {
title: '实时能耗' title: "实时锅炉",
} },
}, },
// },{ // },{
// path: '/RealGas', // path: '/RealGas',
...@@ -97,428 +96,454 @@ const routes = [ ...@@ -97,428 +96,454 @@ const routes = [
// } // }
// }, // },
{ {
path: '/PipeStatus', path: "/PipeStatus",
name: 'PipeStatusPage', name: "PipeStatusPage",
component: () => import('@/views/StatusPage/PipeStatusPage.vue'), component: () => import("@/views/StatusPage/PipeStatusPage.vue"),
meta: {
title: '总管状态'
}
}, {
path: '/BoilerStatus',
name: 'BoilerStatusPage',
component: () => import('@/views/StatusPage/BoilerStatusPage.vue'),
meta: { meta: {
title: '锅炉状态' title: "总管状态",
} },
}, { },
path: '/TransferStatus', {
name: 'TransferStatusPage', path: "/BoilerStatus",
component: () => import('@/views/StatusPage/TransferStatusPage.vue'), name: "BoilerStatusPage",
component: () => import("@/views/StatusPage/BoilerStatusPage.vue"),
meta: { meta: {
title: '换热站状态' title: "锅炉状态",
} },
}, { },
path: '/BoilerArtwork', {
name: 'BoilerArtworkPage', path: "/TransferStatus",
component: () => import('@/views/ArtworkPage/BoilerArtworkPage.vue'), name: "TransferStatusPage",
component: () => import("@/views/StatusPage/TransferStatusPage.vue"),
meta: { meta: {
title: '锅炉工艺图' title: "换热站状态",
} },
}, { },
path: '/MeasurementArtwork', {
name: 'MeasurementArtworkPage', path: "/BoilerArtwork",
component: () => import('@/views/ArtworkPage/MeasurementArtworkPage.vue'), name: "BoilerArtworkPage",
component: () => import("@/views/ArtworkPage/BoilerArtworkPage.vue"),
meta: { meta: {
title: '计量站工艺图' title: "锅炉工艺图",
} },
}, { },
path: '/AllBoilerArtwork', {
name: 'AllBoilerArtworkPage', path: "/MeasurementArtwork",
component: () => import('@/views/ArtworkPage/AllBoilerArtworkPage.vue'), name: "MeasurementArtworkPage",
component: () =>
import("@/views/ArtworkPage/MeasurementArtworkPage.vue"),
meta: { meta: {
title: '全景工艺图' title: "计量站工艺图",
} },
}, { },
path: '/TransferArtwork', {
name: 'TransferArtworkPage', path: "/AllBoilerArtwork",
component: () => import('@/views/ArtworkPage/TransferArtworkPage.vue'), name: "AllBoilerArtworkPage",
component: () => import("@/views/ArtworkPage/AllBoilerArtworkPage.vue"),
meta: { meta: {
title: '换热站工艺图' title: "全景工艺图",
} },
}, { },
path: '/AlarmStatus', {
name: 'AlarmStatusPage', path: "/TransferArtwork",
component: () => import('@/views/AlarmPage/AlarmStatusPage.vue'), name: "TransferArtworkPage",
component: () => import("@/views/ArtworkPage/TransferArtworkPage.vue"),
meta: { meta: {
title: '报警状态' title: "换热站工艺图",
} },
}, { },
path: '/Alarm', {
name: 'AlarmInfoPage', path: "/AlarmStatus",
component: () => import('@/views/AlarmPage/AlarmInfoPage.vue'), name: "AlarmStatusPage",
component: () => import("@/views/AlarmPage/AlarmStatusPage.vue"),
meta: { meta: {
title: '报警信息' title: "报警状态",
} },
}, { },
path: '/DataAnalysis', {
name: 'DataAnalysisPage', path: "/Alarm",
component: () => import('@/views/HandlerPage/DataAnalysisPage.vue'), name: "AlarmInfoPage",
component: () => import("@/views/AlarmPage/AlarmInfoPage.vue"),
meta: { meta: {
title: '能耗分析' title: "报警信息",
} },
}, { },
path: '/EnergyConsumption', {
name: 'EnergyConsumptionPage', path: "/DataAnalysis",
component: () => import('@/views/HandlerPage/EnergyConsumptionPage.vue'), name: "DataAnalysisPage",
component: () => import("@/views/HandlerPage/DataAnalysisPage.vue"),
meta: { meta: {
title: '能耗排名' title: "能耗分析",
} },
}, { },
path: '/Handler/EnerpriseEnergyView', {
name: 'EnerpriseEnergyView', path: "/EnergyConsumption",
component: () => import('@/views/HandlerPage/EnerpriseEnergyView.vue'), name: "EnergyConsumptionPage",
component: () =>
import("@/views/HandlerPage/EnergyConsumptionPage.vue"),
meta: { meta: {
title: '企业趋势图' title: "能耗排名",
} },
}, { },
path: '/Handler/TransferEnergyView', {
name: 'EnergyViewPage', path: "/Handler/EnerpriseEnergyView",
component: () => import('@/views/HandlerPage/TransferEnergyView.vue'), name: "EnerpriseEnergyView",
component: () => import("@/views/HandlerPage/EnerpriseEnergyView.vue"),
meta: { meta: {
title: '换热站趋势图' title: "企业趋势图",
} },
}, { },
path: '/Handler/QOQView', {
name: 'QOQView', path: "/Handler/TransferEnergyView",
component: () => import('@/views/HandlerPage/QOQ.vue'), name: "EnergyViewPage",
component: () => import("@/views/HandlerPage/TransferEnergyView.vue"),
meta: { meta: {
title: '用量环比' title: "换热站趋势图",
} },
}, { },
path: '/Handler/YOYView', {
name: 'YOYView', path: "/Handler/QOQView",
component: () => import('@/views/HandlerPage/YOY.vue'), name: "QOQView",
component: () => import("@/views/HandlerPage/QOQ.vue"),
meta: { meta: {
title: '用量同比' title: "用量环比",
} },
}, { },
path: '/HeatAnalysis', {
name: 'HeatAnalysisPage', path: "/Handler/YOYView",
component: () => import('@/views/Report/HeatAnalysisPage.vue'), name: "YOYView",
component: () => import("@/views/HandlerPage/YOY.vue"),
meta: { meta: {
title: '热量分析' title: "用量同比",
} },
}, { },
path: '/Forecast', {
name: 'ForecastPage', path: "/HeatAnalysis",
component: () => import('@/views/Report/ForecastPage.vue'), name: "HeatAnalysisPage",
component: () => import("@/views/Report/HeatAnalysisPage.vue"),
meta: { meta: {
title: '明日预测' title: "热量分析",
} },
}, { },
path: '/RealAnalysis', {
name: 'RealAnalysisPage', path: "/Forecast",
component: () => import('@/views/Report/RealAnalysisPage.vue'), name: "ForecastPage",
component: () => import("@/views/Report/ForecastPage.vue"),
meta: { meta: {
title: '实时热量分析' title: "明日预测",
} },
}, { },
path: '/TransferEnergy', {
name: 'TransferEnergyPage', path: "/RealAnalysis",
component: () => import('@/views/Report/TransferEnergyPage.vue'), name: "RealAnalysisPage",
component: () => import("@/views/Report/RealAnalysisPage.vue"),
meta: { meta: {
title: '换热站能耗' title: "实时热量分析",
} },
}, { },
path: '/AreaInfo', {
name: 'AreaInfoPage', path: "/TransferEnergy",
component: () => import('@/views/Report/AreaInfoPage.vue'), name: "TransferEnergyPage",
component: () => import("@/views/Report/TransferEnergyPage.vue"),
meta: { meta: {
title: '面积统计' title: "换热站能耗",
} },
}, { },
path: '/TodayPatrol', {
name: 'PatrolPage', path: "/AreaInfo",
component: () => import('@/views/PatrolPage/TodayPatrolPage.vue'), name: "AreaInfoPage",
component: () => import("@/views/Report/AreaInfoPage.vue"),
meta: { meta: {
title: '今日巡更' title: "面积统计",
} },
}, { },
path: '/HisPatrol', {
name: 'HisPatrolPage', path: "/TodayPatrol",
component: () => import('@/views/PatrolPage/HisPatrolPage.vue'), name: "PatrolPage",
component: () => import("@/views/PatrolPage/TodayPatrolPage.vue"),
meta: { meta: {
title: '巡更历史' title: "今日巡更",
} },
}, { },
path: '/HeatUser', {
name: 'HeatUserPage', path: "/HisPatrol",
component: () => import('@/views/HeatUserPage/HeatUserPage.vue'), name: "HisPatrolPage",
component: () => import("@/views/PatrolPage/HisPatrolPage.vue"),
meta: { meta: {
title: '热用户' title: "巡更历史",
} },
}, { },
path: '/HeatUser/Tap', {
name: 'TapPage', path: "/HeatUser",
component: () => import('@/views/HeatUserPage/TapPage.vue'), name: "HeatUserPage",
component: () => import("@/views/HeatUserPage/HeatUserPage.vue"),
meta: { meta: {
title: '阀门' title: "热用户",
} },
}, { },
path: '/History/Pipe', {
name: 'HisPipe', path: "/HeatUser/Tap",
component: () => import('@/views/HistoryPage/HisPipePage.vue'), name: "TapPage",
component: () => import("@/views/HeatUserPage/TapPage.vue"),
meta: { meta: {
title: '总管历史数据' title: "阀门",
} },
}, { },
path: '/History/Boiler', {
name: 'HisBoiler', path: "/History/Pipe",
component: () => import('@/views/HistoryPage/HisBoilerPage.vue'), name: "HisPipe",
component: () => import("@/views/HistoryPage/HisPipePage.vue"),
meta: { meta: {
title: '锅炉历史数据' title: "总管历史数据",
} },
}, { },
path: '/History/Transfer', {
name: 'HisTransfer', path: "/History/Boiler",
component: () => import('@/views/HistoryPage/HisTransPage.vue'), name: "HisBoiler",
component: () => import("@/views/HistoryPage/HisBoilerPage.vue"),
meta: { meta: {
title: '换热站历史数据' title: "锅炉历史数据",
} },
}, { },
path: '/History/Gas', {
name: 'HisGas', path: "/History/Transfer",
component: () => import('@/views/HistoryPage/HisGasPage.vue'), name: "HisTransfer",
component: () => import("@/views/HistoryPage/HisTransPage.vue"),
meta: { meta: {
title: '燃气历史数据' title: "换热站历史数据",
} },
}, { },
path: '/History/Water', {
name: 'HisWater', path: "/History/Gas",
component: () => import('@/views/HistoryPage/HisWaterPage.vue'), name: "HisGas",
component: () => import("@/views/HistoryPage/HisGasPage.vue"),
meta: { meta: {
title: '水表历史数据' title: "燃气历史数据",
} },
}, { },
path: '/History/Heat', {
name: 'HisHeat', path: "/History/Water",
component: () => import('@/views/HistoryPage/HisHeatPage.vue'), name: "HisWater",
component: () => import("@/views/HistoryPage/HisWaterPage.vue"),
meta: { meta: {
title: '热表历史数据' title: "水表历史数据",
} },
}, { },
path: '/History/Electric', {
name: 'HisElectric', path: "/History/Heat",
component: () => import('@/views/HistoryPage/HisElecPage.vue'), name: "HisHeat",
component: () => import("@/views/HistoryPage/HisHeatPage.vue"),
meta: { meta: {
title: '电表历史数据' title: "热表历史数据",
} },
}, { },
path: '/Handler/Overview', {
name: 'Overview', path: "/History/Electric",
component: () => import('@/views/HandlerPage/OverviewPage.vue'), name: "HisElectric",
component: () => import("@/views/HistoryPage/HisElecPage.vue"),
meta: { meta: {
title: '数据总览' title: "电表历史数据",
} },
}, { },
path: '/Handler/EnergyView', {
name: 'EnergyView', path: "/Handler/Overview",
component: () => import('@/views/HandlerPage/QOQ.vue'),//EnergyViewPage name: "Overview",
component: () => import("@/views/HandlerPage/OverviewPage.vue"),
meta: { meta: {
title: '趋势图' title: "数据总览",
} },
}, { },
path: '/Remote/Boiler', {
name: 'BoilerRemotePage', path: "/Handler/EnergyView",
component: () => import('@/views/RemotePage/BoilerControlPage.vue'), name: "EnergyView",
component: () => import("@/views/HandlerPage/QOQ.vue"), //EnergyViewPage
meta: { meta: {
title: '锅炉远程控制' title: "趋势图",
} },
}, },
{ {
path: '/Remote/ZdlmSelfTest', path: "/Remote/Boiler",
name: 'ZdlmSelfTestPage', name: "BoilerRemotePage",
component: () => import('@/views/RemotePage/ZdlmSelfTest.vue'), component: () => import("@/views/RemotePage/BoilerControlPage.vue"),
meta: { meta: {
title: '电动阀自检' title: "锅炉远程控制",
} },
}, },
{ {
path: '/Remote/Transfer', path: "/Remote/ZdlmSelfTest",
name: 'TransferRemotePage', name: "ZdlmSelfTestPage",
component: () => import('@/views/RemotePage/TransControlPage.vue'), component: () => import("@/views/RemotePage/ZdlmSelfTest.vue"),
meta: { meta: {
title: '换热站远程控制' title: "电动阀自检",
} },
}, { },
path: '/Remote/TransferPump', {
name: 'TransferPumpPage', path: "/Remote/Transfer",
component: () => import('@/views/RemotePage/TransferPumpPage.vue'), name: "TransferRemotePage",
component: () => import("@/views/RemotePage/TransControlPage.vue"),
meta: { meta: {
title: '循环泵压差控制' title: "换热站远程控制",
} },
}, { },
path: '/Video', {
name: 'VideoPage', path: "/Remote/TransferPump",
component: () => import('@/views/Video/VideoViewPage.vue'), name: "TransferPumpPage",
component: () => import("@/views/RemotePage/TransferPumpPage.vue"),
meta: { meta: {
title: '视频监控' title: "循环泵压差控制",
} },
}, },
{ {
path: '/Scheduling/EnergyManage', path: "/Video",
name: 'EnergyManagePage', name: "VideoPage",
component: () => import('@/views/SchedulingPage/EnergyManagePage.vue'), component: () => import("@/views/Video/VideoViewPage.vue"),
meta: { meta: {
title: '能源消耗' title: "视频监控",
} },
}, },
{ {
path: '/Scheduling/WeatherManage', path: "/Scheduling/EnergyManage",
name: 'WeatherManagePage', name: "EnergyManagePage",
component: () => import('@/views/SchedulingPage/WeatherManagePage.vue'), // component: () => import("@/views/SmartNumbers/PipeTemperature.vue"),
component: () => import("@/views/SchedulingPage/EnergyManagePage.vue"),
meta: { meta: {
title: '气象干预' title: "能源消耗",
} },
}, },
{ {
path: '/Scheduling/AnnualParam', path: "/Scheduling/WeatherManage",
name: 'AnnualParamPage', name: "WeatherManagePage",
component: () => import('@/views/SchedulingPage/AnnualParamPage.vue'), component: () => import("@/views/SchedulingPage/WeatherManagePage.vue"),
meta: { meta: {
title: '年度参数' title: "气象干预",
} },
}, },
{ {
path: '/Scheduling/ConfigBoiler', path: "/Scheduling/AnnualParam",
name: 'ConfigBoiler', name: "AnnualParamPage",
component: () => import('../views/SchedulingPage/ConfigBoilerPage.vue'), component: () => import("@/views/SchedulingPage/AnnualParamPage.vue"),
meta: { meta: {
title: '参数配置' title: "年度参数",
} },
}, },
{ {
path: '/Scheduling/WindManage', path: "/Scheduling/ConfigBoiler",
name: 'WindManage', name: "ConfigBoiler",
component: () => import('../views/SchedulingPage/WindManagePage.vue'), component: () => import("../views/SchedulingPage/ConfigBoilerPage.vue"),
meta: { meta: {
title: '风力配置管理' title: "参数配置",
} },
}, },
{ {
path: '/Scheduling/Phenomenon', path: "/Scheduling/WindManage",
name: 'Phenomenon', name: "WindManage",
component: () => import('../views/SchedulingPage/PhenomenonPage.vue'), component: () => import("../views/SchedulingPage/WindManagePage.vue"),
meta: { meta: {
title: '天气工况管理' title: "风力配置管理",
} },
},
{
path: "/Scheduling/Phenomenon",
name: "Phenomenon",
}, { component: () => import("../views/SchedulingPage/PhenomenonPage.vue"),
path: '/Scheduling/InstantHeat',
name: 'InstantHeatPage',
component: () => import('@/views/SchedulingPage/InstantHeatPage.vue'),
meta: { meta: {
title: '瞬时热量对比配置' title: "天气工况管理",
} },
}
]
}, },
{ {
path: '/About', path: "/Scheduling/InstantHeat",
name: name: "InstantHeatPage",
"/About", component: () => import("@/views/SchedulingPage/InstantHeatPage.vue"),
component: meta: {
AboutPage title: "瞬时热量对比配置",
} },
, },
{
path: '/GisHome',
name:
'/GisHome',
component:
() => import('@/views/Gis/screenDisplay.vue'),
meta:
{
title: '地图'
}
}
,
//捕获404路由
{
path: '/:pathMatch(.*)*',
name:
'NotFound',
component:
() => import('@/views/404.vue')
}
,
{ {
path: '/TransferArt', path: "/SmartNumbers",
name: name: "SmartNumbers",
'/TransferArt', component: () => import("@/views/SmartNumbers/PipeTemperature.vue"),
component: meta: {
() => import('@/components/art/TransferArt.vue'), title: "智数换热站",
meta: },
},
{ {
title: '换热站工艺图' path: "/SmartNumbers/PipeTemperature",
} name: "PipeTemperature",
} component: () => import("@/views/SmartNumbers/PipeTemperature.vue"),
, meta: {
title: "实时总管",
},
},
],
},
{ {
path: '/BoilerArt', path: "/About",
name: name: "/About",
'/BoilerArt', component: AboutPage,
component: },
() => import('@/components/art/BoilerArt.vue'),
meta:
{ {
title: '锅炉工艺图' path: "/GisHome",
} name: "/GisHome",
} component: () => import("@/views/Gis/screenDisplay.vue"),
, meta: {
title: "地图",
},
},
//捕获404路由
{ {
path: '/AllBoilerArt', path: "/:pathMatch(.*)*",
name: name: "NotFound",
'AllBoilerArt', component: () => import("@/views/404.vue"),
component: },
() => import('@/components/art/AllBoilerArt.vue'),
meta:
{ {
title: '锅炉全景工艺图' path: "/TransferArt",
} name: "/TransferArt",
} component: () => import("@/components/art/TransferArt.vue"),
, meta: {
title: "换热站工艺图",
},
},
{ {
path: '/MeasurementArt', path: "/BoilerArt",
name: name: "/BoilerArt",
'MeasurementArt', component: () => import("@/components/art/BoilerArt.vue"),
component: meta: {
() => import('@/components/art/MeasurementArt.vue'), title: "锅炉工艺图",
meta: },
},
{ {
title: '计量站全景工艺图' path: "/AllBoilerArt",
} name: "AllBoilerArt",
} component: () => import("@/components/art/AllBoilerArt.vue"),
, meta: {
title: "锅炉全景工艺图",
},
},
{ {
path: '/Visualizations', path: "/MeasurementArt",
name: name: "MeasurementArt",
'Visualizations', component: () => import("@/components/art/MeasurementArt.vue"),
component: meta: {
() => import('@/views/Visualizations/index.vue'), title: "计量站全景工艺图",
meta: },
},
{ {
title: '可视化' path: "/Visualizations",
} name: "Visualizations",
} component: () => import("@/views/Visualizations/index.vue"),
] meta: {
title: "可视化",
},
},
];
//创建路由实例对象 //创建路由实例对象
const router = createRouter({ const router = createRouter({
routes, routes,
history: createWebHistory(import.meta.env.BASE_URL) history: createWebHistory(import.meta.env.BASE_URL),
}) });
// // 使用路由守卫来判断是否已经加载了Home页面 // // 使用路由守卫来判断是否已经加载了Home页面
// let homeLoaded = false // let homeLoaded = false
...@@ -534,8 +559,7 @@ const router = createRouter({ ...@@ -534,8 +559,7 @@ const router = createRouter({
// } // }
// }) // })
let isgetOrg = false;
let isgetOrg = false
//全局前置路由守卫 //全局前置路由守卫
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
//store.dispatch("onLoading", true); //store.dispatch("onLoading", true);
...@@ -546,33 +570,33 @@ router.beforeEach(async (to, from, next) => { ...@@ -546,33 +570,33 @@ router.beforeEach(async (to, from, next) => {
const token = store.getters.getToken(); const token = store.getters.getToken();
//console.log(token); //console.log(token);
//如果未登录跳转到登录页面 //如果未登录跳转到登录页面
if (!userInfo && to.path !== '/login') return next('/login') if (!userInfo && to.path !== "/login") return next("/login");
//如果已登录避免重复登录 //如果已登录避免重复登录
if (userInfo && to.path == '/login') { if (userInfo && to.path == "/login") {
return next({path: from.path ? from.path : '/'}) return next({ path: from.path ? from.path : "/" });
} }
let hasNewRoutes = false let hasNewRoutes = false;
//如果用户登录成功,调用Vuex方法,存储用户信息 //如果用户登录成功,调用Vuex方法,存储用户信息
if (userInfo && !isgetOrg) { if (userInfo && !isgetOrg) {
try { try {
const res = await store.dispatch('getOrg') const res = await store.dispatch("getOrg");
isgetOrg = true isgetOrg = true;
} catch (error) { } catch (error) {
store.commit("clearUserInfo", ""); store.commit("clearUserInfo", "");
return next('/login') return next("/login");
} }
} }
//手动指定路由 //手动指定路由
//如果确实有新路由加入手动指定路由,否则直接放行 //如果确实有新路由加入手动指定路由,否则直接放行
hasNewRoutes ? next(to.fullPath) : next() hasNewRoutes ? next(to.fullPath) : next();
//next() //next()
}) });
// router.afterEach((to, from) => { // router.afterEach((to, from) => {
// store.dispatch("onLoading", false); // store.dispatch("onLoading", false);
// }) // })
// 共享路由实例对象 // 共享路由实例对象
export default router export default router;
\ No newline at end of file
import mitt from "mitt";
const emitter = mitt();
export default emitter;
\ No newline at end of file
...@@ -3,5 +3,5 @@ const port='8001'; ...@@ -3,5 +3,5 @@ const port='8001';
//export const SERVEICE='http://218.69.97.198:8001' //export const SERVEICE='http://218.69.97.198:8001'
//'http://218.69.97.198:8001' //'http://218.69.97.198:8001'
//export const TEST_SERVEICE='http://localhost:5013' //export const TEST_SERVEICE='http://192.168.1.2:5013/'
export const SERVEICE='http://localhost:5013' export const SERVEICE='http://192.168.1.2:5013/'
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-row> <el-row v-show="dialog_content">
<el-col :span="6"> <el-col :span="6">
<div class="left"> <div class="left">
<el-table :data="cnNames_before" class="scroll-table" :row-style="{ height: '16px' }" <el-table :data="cnNames_before" class="scroll-table" :row-style="{ height: '16px' }"
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<el-col :span="12"> <el-col :span="12">
<div class="middle"> <div class="middle">
<el-form ref="formRef" :model="addParams" :rules="rules" label-width="auto"> <el-form ref="formRef" :model="addParams" :rules="rules" label-width="auto" :disabled="form_control">
<table cellpadding="0" cellspacing="1" border="1" class="big_table"> <table cellpadding="0" cellspacing="1" border="1" class="big_table">
<tr> <tr>
<th style="width: 25%">报警名称:</th> <th style="width: 25%">报警名称:</th>
...@@ -187,7 +187,10 @@ ...@@ -187,7 +187,10 @@
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-input style="width: 80%" type="textarea" rows="6" v-model="addParams.alarmPlan"></el-input> <el-form-item prop="alarmPlan">
<el-input style="width: 80%" type="textarea" rows="6"
v-model="addParams.alarmPlan"></el-input>
</el-form-item>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -574,35 +577,33 @@ let param = ref({ ...@@ -574,35 +577,33 @@ let param = ref({
//表单校验规则 //表单校验规则
const formRef = ref() const formRef = ref()
addParams.value = {}
const rules = reactive({ const rules = reactive({
topMost: [ topMost: [
{ required: true, message: "上上限值是必填项", trigger: "blur" }, { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "上上限值是 1-10位实数", trigger: "blur" }
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "上上限值输入不合法", trigger: "blur" },
{ min: 1, max: 10, message: '上上限值必须是 1-10位的数字', trigger: 'blur' }
], ],
upper: [ upper: [
{ required: true, message: "上限值是必填项", trigger: "blur" }, { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "上限值是 1-10位实数", trigger: "blur" }
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "上限值输入不合法", trigger: "blur" },
{ min: 1, max: 10, message: '上限值必须是 1-10位的数字', trigger: 'blur' }
], ],
lower: [ lower: [
{ required: true, message: "下限值是必填项", trigger: "blur" }, { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "下限值是 1-10位实数", trigger: "blur" }
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "下限值输入不合法", trigger: "blur" },
{ min: 1, max: 10, message: '下限值必须是 1-10位的数字', trigger: 'blur' }
], ],
downMost: [ downMost: [
{ required: true, message: "下下限值是必填项", trigger: "blur" }, { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "下下限值是 1-10位实数", trigger: "blur" }
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "下下限值输入不合法", trigger: "blur" }, ],
{ min: 1, max: 10, message: '下下限值必须是 1-10位的数字', trigger: 'blur' } alarmPlan: [
{ pattern: /^.{1,50}$/, "message": "报警预案是 1-50位字符", trigger: "blur" }
] ]
}); });
let newType = ref(0) let newType = ref(0)
watchEffect(() => { watchEffect(() => {
console.log("监听::::", type.value); // console.log("监听::::", type.value);
if (type.value === "GetPipeAlarmStatusData") { if (type.value === "GetPipeAlarmStatusData") {
newType.value = 1 newType.value = 1
param.value.baseId = "pipeParaBaseId" param.value.baseId = "pipeParaBaseId"
...@@ -628,9 +629,17 @@ const getCnNames = () => { ...@@ -628,9 +629,17 @@ const getCnNames = () => {
}); });
} }
// 表单编辑控制
const dialog_content = ref(false)
const form_control = ref(true)
// 点击确定查询数据 // 点击确定查询数据
const paramsSetting = () => { const paramsSetting = () => {
dialog_content.value = true
getCnNames() getCnNames()
ElMessage.info("请选择参数后进行编辑...")
} }
// newRow接收param.value.baseId,添加需要使用 // newRow接收param.value.baseId,添加需要使用
...@@ -659,6 +668,7 @@ const selectBeforeParams = (row) => { ...@@ -659,6 +668,7 @@ const selectBeforeParams = (row) => {
// console.log("查看baseId --- dataaaaa:", data); // console.log("查看baseId --- dataaaaa:", data);
data.then(function () { data.then(function () {
param.value.cnName = row.cnName param.value.cnName = row.cnName
form_control.value = false
}); });
} else { } else {
ElMessage.info("该参数暂不需要修改...") ElMessage.info("该参数暂不需要修改...")
...@@ -692,6 +702,7 @@ const selectAfterParams = (row) => { ...@@ -692,6 +702,7 @@ const selectAfterParams = (row) => {
// 数据回显 // 数据回显
addParams.value = { ...val.data } addParams.value = { ...val.data }
param.value.cnName = row.cnName param.value.cnName = row.cnName
form_control.value = false
if (type.value === 1) { if (type.value === 1) {
delId.value = val.data.pipeAlarmParaId delId.value = val.data.pipeAlarmParaId
} else if (type.value === 2) { } else if (type.value === 2) {
...@@ -711,6 +722,9 @@ const selectAfterParams = (row) => { ...@@ -711,6 +722,9 @@ const selectAfterParams = (row) => {
const onAdd = () => { const onAdd = () => {
// console.log("!!!!!!!", addParams.value); // console.log("!!!!!!!", addParams.value);
// 提交添加或修改-以上至少有一个选项有值
if (addParams.value.topMost || addParams.value.upper || addParams.value.lower || addParams.value.downMost) {
// 执行添加或修改
addParams.value.updateNullFields = "" addParams.value.updateNullFields = ""
if (newType.value === 1) { if (newType.value === 1) {
addParams.value.pipeId = dept.value addParams.value.pipeId = dept.value
...@@ -720,6 +734,7 @@ const onAdd = () => { ...@@ -720,6 +734,7 @@ const onAdd = () => {
} else { } else {
addParams.value.gatherType = 1 addParams.value.gatherType = 1
} }
http.post("api/alarm/para/pipesave", { ...addParams.value }, false).then((res) => { http.post("api/alarm/para/pipesave", { ...addParams.value }, false).then((res) => {
if (res.success) { if (res.success) {
ElMessage.success(res.message) ElMessage.success(res.message)
...@@ -729,6 +744,7 @@ const onAdd = () => { ...@@ -729,6 +744,7 @@ const onAdd = () => {
delete addParams.value.voicePath delete addParams.value.voicePath
reset() reset()
param.value.cnName = "" param.value.cnName = ""
form_control.value = true
getCnNames() getCnNames()
} else { } else {
ElMessage.error("操作失败") ElMessage.error("操作失败")
...@@ -744,6 +760,7 @@ const onAdd = () => { ...@@ -744,6 +760,7 @@ const onAdd = () => {
delete addParams.value.boilerId delete addParams.value.boilerId
reset() reset()
param.value.cnName = "" param.value.cnName = ""
form_control.value = true
getCnNames() getCnNames()
} else { } else {
ElMessage.error("操作失败") ElMessage.error("操作失败")
...@@ -760,12 +777,18 @@ const onAdd = () => { ...@@ -760,12 +777,18 @@ const onAdd = () => {
delete addParams.value.unitId delete addParams.value.unitId
reset() reset()
param.value.cnName = "" param.value.cnName = ""
form_control.value = true
getCnNames() getCnNames()
} else { } else {
ElMessage.error("操作失败") ElMessage.error("操作失败")
} }
}) })
} }
} else {
ElMessage.error("请至少输入一个报警上下限数值")
}
} }
// 按钮 // 按钮
...@@ -785,6 +808,8 @@ const onDel = () => { ...@@ -785,6 +808,8 @@ const onDel = () => {
http.post("api/alarm/para/pipedelete", { id: delId.value }, false).then((res) => { http.post("api/alarm/para/pipedelete", { id: delId.value }, false).then((res) => {
if (res.success) { if (res.success) {
ElMessage.success(res.message) ElMessage.success(res.message)
param.value.cnName = ""
form_control.value = true
reset() reset()
} else { } else {
ElMessage.error("删除失败!!") ElMessage.error("删除失败!!")
...@@ -794,6 +819,8 @@ const onDel = () => { ...@@ -794,6 +819,8 @@ const onDel = () => {
http.post("api/alarm/para/boilerdelete", { id: delId.value }, false).then((res) => { http.post("api/alarm/para/boilerdelete", { id: delId.value }, false).then((res) => {
if (res.success) { if (res.success) {
ElMessage.success(res.message) ElMessage.success(res.message)
param.value.cnName = ""
form_control.value = true
reset() reset()
} else { } else {
ElMessage.error("删除失败") ElMessage.error("删除失败")
...@@ -803,6 +830,8 @@ const onDel = () => { ...@@ -803,6 +830,8 @@ const onDel = () => {
http.post("api/alarm/para/transdelete", { id: delId.value }, false).then((res) => { http.post("api/alarm/para/transdelete", { id: delId.value }, false).then((res) => {
if (res.success) { if (res.success) {
ElMessage.success(res.message) ElMessage.success(res.message)
param.value.cnName = ""
form_control.value = true
reset() reset()
} else { } else {
ElMessage.error("删除失败") ElMessage.error("删除失败")
...@@ -815,7 +844,6 @@ const onDel = () => { ...@@ -815,7 +844,6 @@ const onDel = () => {
}).finally(() => { }).finally(() => {
getCnNames() getCnNames()
}) })
} }
// 关闭dialog右上× 清空数据 // 关闭dialog右上× 清空数据
...@@ -828,6 +856,12 @@ const onClose = () => { ...@@ -828,6 +856,12 @@ const onClose = () => {
param.value.cnName = "" param.value.cnName = ""
} }
// watchEffect(() => {
// if (param.value.cnName) {
// form_control.value = false
// }
// })
onMounted(() => { onMounted(() => {
getuser() getuser()
setContentHeight(); setContentHeight();
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +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 v-float-number 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> <div style="width: 40px"></div>
</template> </template>
...@@ -112,7 +112,7 @@ ...@@ -112,7 +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 v-float-number style="width: 80%" v-model="formDatas.maxTargetTemperature"> <el-input style="width: 80%" v-model="formDatas.maxTargetTemperature">
<template #append> <template #append>
<div style="width: 40px"></div> <div style="width: 40px"></div>
</template> </template>
...@@ -166,11 +166,12 @@ import { ElMessage } from "element-plus"; ...@@ -166,11 +166,12 @@ 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";
import { nextTick } from "vue";
const loading = ref(false) const loading = ref(false)
const form = ref({ const form = ref({
types: [], types: [],
}); });
const formRef = ref() let formRef = ref()
const formDatas = ref([ const formDatas = ref([
{ {
...@@ -189,34 +190,33 @@ const formDatas = ref([ ...@@ -189,34 +190,33 @@ const formDatas = ref([
//表单校验规则 //表单校验规则
// 正则 /^(-?[0-9]+(\.[0-9]+)?){1,10}$/ ==> {1-10}不起作用,下面又一遍 // 正则 /^(-?\d{1,5})(\.[0-9]{1,4})?$/
// 正负可选
// 整数位至多5位
// 小数可选,小数部分之多4位
const rules = reactive({ const rules = reactive({
openingOfElectricValve: [ openingOfElectricValve: [
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "电动调节阀开度输入不合法", trigger: "blur" }, { pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur" }
{ min: 1, max: 10, message: '电动调节阀开度必须是 1-10位的数字', trigger: 'change' }
], ],
boilerOutletWaterTemperature: [ boilerOutletWaterTemperature: [
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "锅炉出水温度输入不合法", trigger: "blur" }, { pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的锅炉出水温度", trigger: "blur" }
{ min: 1, max: 10, message: '锅炉出水温度必须是 1-10位的数字', trigger: 'change' }
], ],
upperLlimitMainFlow: [ upperLlimitMainFlow: [
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "锅炉房供水总管流量上限值输入不合法", trigger: "blur" }, { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的锅炉房供水总管流量上限值", trigger: "blur" }
{ min: 1, max: 10, message: '锅炉房供水总管流量上限值必须是 1-10位的数字', trigger: 'change' }
], ],
lowerLlimitMainFlow: [ lowerLlimitMainFlow: [
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "锅炉房供水总管流量下限值输入不合法", trigger: "blur" }, { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的锅炉房供水总管流量下限值", trigger: "blur" }
{ min: 1, max: 10, message: '锅炉房供水总管流量下限值必须是 1-10位的数字', trigger: 'change' }
], ],
maxTargetTemperature: [ maxTargetTemperature: [
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "目标温度最大值输入不合法", trigger: "blur" }, { pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的目标温度最大值", trigger: "blur" },
{ min: 1, max: 10, message: '目标温度最大值必须是 1-10位的数字', trigger: 'change' }
], ],
bestHoldingTime: [ bestHoldingTime: [
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "持续时间输入不合法", trigger: "blur" }, { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的持续时间", trigger: "blur" }
{ min: 1, max: 10, message: '持续时间必须是 1-10位的数字', trigger: 'change' }
], ],
holdingTime: [ holdingTime: [
{ pattern: /^[0-9]\d{1,10}$/, "message": "保持时间必须是 1-10位的数字", trigger: 'change' } { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的保持时间", trigger: "blur" }
] ]
}); });
...@@ -278,9 +278,19 @@ function getSupplys() { ...@@ -278,9 +278,19 @@ function getSupplys() {
} }
// console.log("遍历的options===========>:", options); // console.log("遍历的options===========>:", options);
} }
const clearFormValidation = () => {
nextTick(() => {
formRef.value?.clearValidate()
})
}
onMounted(() => { onMounted(() => {
getListData(); getListData();
getSupplys(); getSupplys();
clearFormValidation()
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
import { ref, onMounted, getCurrentInstance, reactive, nextTick } from "vue"; import { ref, onMounted, getCurrentInstance, reactive, nextTick } from "vue";
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage } from "element-plus";
import axios from "axios"; import axios from "axios";
import { Search, Document } from "@element-plus/icons-vue"; import { Search, Minus, Document } from "@element-plus/icons-vue";
import { import {
getOrganizationStructureInterface getOrganizationStructureInterface
} from "@/api/scheduling"; } from "@/api/scheduling";
import http from "../../api/http"; import http from "../../api/http";
import loading from "element-plus";
import store from "../../store"; import store from "../../store";
import { vFloatNumber } from "@/utils/directives.js"; import { vFloatNumber } from "@/utils/directives.js";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
...@@ -32,12 +31,14 @@ const reset = () => { ...@@ -32,12 +31,14 @@ const reset = () => {
"energyName": '' "energyName": ''
} }
} }
const loading = ref(false)
const energyForm = ref() const energyForm = ref()
const dialogVisible = ref(false) const dialogVisible = ref(false)
const getEnergyData = () => { const getEnergyData = () => {
loading.value = true
http.post("/api/energy/getData", config.supplyType).then((res) => { http.post("/api/energy/getData", config.supplyType).then((res) => {
if (res.success) { if (res.success) {
loading.value = false
tableData.value = res.data; tableData.value = res.data;
ElMessage.success(res.message); ElMessage.success(res.message);
} else { } else {
...@@ -87,11 +88,16 @@ const config = reactive({ ...@@ -87,11 +88,16 @@ const config = reactive({
const handleSearch = () => { const handleSearch = () => {
config.supplyType = formInline.keyWord; config.supplyType = formInline.keyWord;
config.supplyType = [`${config.supplyType}`]; config.supplyType = [`${config.supplyType}`];
getEnergyData(), getEnergyData()
(formEnergy.value.energyType = ""),
ElMessage.success("获取数据成功");
}; };
// 重置按钮
const handleReset = () => {
formInline.keyWord = ""
config.supplyType = ["0", "1", "2", "3", "4"]
getEnergyData()
}
const timeFormat = (time) => { const timeFormat = (time) => {
var time = new Date(time); var time = new Date(time);
var year = time.getFullYear(); var year = time.getFullYear();
...@@ -100,7 +106,7 @@ const timeFormat = (time) => { ...@@ -100,7 +106,7 @@ const timeFormat = (time) => {
function add(m) { function add(m) {
return m < 10 ? "0" + m : m; return m < 10 ? "0" + m : m;
} }
return year + '/' + add(month) + '/' + add(date) + ' 0:00:00' return year + '/' + add(month) + '/' + add(date)
} }
//表单校验规则 //表单校验规则
...@@ -111,9 +117,7 @@ const rules = reactive({ ...@@ -111,9 +117,7 @@ const rules = reactive({
], ],
record: [ record: [
{ required: true, message: "能源用度是必选项", trigger: "blur" }, { required: true, message: "能源用度是必选项", trigger: "blur" },
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "能源用度必须输入1-10位数字", trigger: "blur" }, { pattern: /^(\d{1,10})$/, "message": "能源用度是 1-10位正整数", trigger: "blur" }
{ min: 1, max: 10, message: '能源用度必须是 1-10位的数字', trigger: 'blur' }
], ],
recordDate: [{ required: true, message: "日期是必选项" }], recordDate: [{ required: true, message: "日期是必选项" }],
}); });
...@@ -256,6 +260,7 @@ function getOrganizationStructure() { ...@@ -256,6 +260,7 @@ function getOrganizationStructure() {
onMounted(() => { onMounted(() => {
getOrganizationStructure() getOrganizationStructure()
getEnergyData() getEnergyData()
}) })
</script> </script>
...@@ -288,6 +293,10 @@ onMounted(() => { ...@@ -288,6 +293,10 @@ onMounted(() => {
<Search style="width: 1em; height: 1em; margin-right: 8px" /> <Search style="width: 1em; height: 1em; margin-right: 8px" />
查询 查询
</el-button> </el-button>
<el-button type="primary" @click="handleReset">
<Minus style="width: 1em; height: 1em; margin-right: 8px" />
重置
</el-button>
<el-button type="primary" @click="handleAdd"> <el-button type="primary" @click="handleAdd">
<Document style="width: 1em; height: 1em; margin-right: 8px" /> <Document style="width: 1em; height: 1em; margin-right: 8px" />
新增 新增
...@@ -297,7 +306,7 @@ onMounted(() => { ...@@ -297,7 +306,7 @@ onMounted(() => {
</table> </table>
<el-table :data="tableData" style="width: 100%;font-size: 12px;color: #181818;" <el-table v-loading="loading" :data="tableData" style="width: 100%;font-size: 12px;color: #181818;"
:header-cell-style="{ color: '#225475', backgroundColor: '#B8CFEE', 'text-align': 'center', height: '40px', padding: '0px', border: '1px solid #99bbe8' }" :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: '30px', padding: '0px' }" border :cell-style="{ 'text-align': 'center', padding: '0px' }" :row-style="{ height: '30px', padding: '0px' }" border
stripe max-height="633"> stripe max-height="633">
......
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
<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="planName" style="padding: 0;margin: 0;">
<el-input style="width: 80%" v-model="List.planName"></el-input> <el-input style="width: 80%" v-model="List.planName"></el-input>
</el-form-item>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -54,7 +56,7 @@ ...@@ -54,7 +56,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="tempRegulation" style="padding: 0;margin: 0;"> <el-form-item prop="tempRegulation" style="padding: 0;margin: 0;">
<el-input v-float-number style="width: 80%" v-model="List.tempRegulation"></el-input> <el-input style="width: 80%" v-model="List.tempRegulation"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -67,7 +69,9 @@ ...@@ -67,7 +69,9 @@
<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="description" style="padding: 0;margin: 0;">
<el-input style="width: 80%" type="textarea" rows="6" v-model="List.description"></el-input> <el-input style="width: 80%" type="textarea" rows="6" v-model="List.description"></el-input>
</el-form-item>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -106,20 +110,20 @@ const List = ref( ...@@ -106,20 +110,20 @@ const List = ref(
) )
//校验规则 //校验规则
const rules = reactive({ const rules = reactive({
planName: [
{ pattern: /^.{1,20}$/, "message": "计划名称必须是1-20位字符", trigger: "blur" }
],
diffPercentage: [ diffPercentage: [
{ required: true, message: "偏差百分比是必填项", trigger: "blur" }, { pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur" }
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, "message": "偏差百分比输入不合法", trigger: 'blur' },
{ min: 1, max: 10, message: '偏差百分比必须是 1-10位的数字', trigger: 'change' }
], ],
timeoutMin: [ timeoutMin: [
{ required: true, message: "判断时间是必填项", trigger: "blur" }, { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "判断时间必须是1-10位实数", trigger: "blur" }
{ pattern: /^[0-9]\d{1,10}$/, "message": "判断时间必须是 1-10位的数字", trigger: 'change' }
], ],
tempRegulation: [ tempRegulation: [
{ required: true, message: "调节温度是必选项", trigger: "blur" }, { pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的调节温度最大值", trigger: "blur" }
{ pattern: /^(-?[0-9]+(\.[0-9]+)?)$/, "message": "调节温度输入不合法", trigger: 'blur' }, ],
{ min: 1, max: 10, message: '调节温度必须是 1-10位的数字', trigger: 'change' } description: [
{ pattern: /^.{1,50}$/, "message": "备注必须是1-50位字符", trigger: "blur" }
] ]
}); });
......
<template>
<PageData
api="/api/Scheduling/WeatherCondition/Get"
:schemas="schemas"
:columns="columns"
:formData="formData"
@DataChange="formDataChange"
></PageData>
</template>
<script setup>
import { computed, onMounted, reactive, ref } from "vue";
import PageData from "@/components/PageData.vue";
import { columns, schemas } from "./formSchems";
const formData = ref({
name: "",
code: "",
date: "",
});
const formDataChange = (val) => {
formData.value = val;
};
</script>
import { ref } from "vue";
export const columns = ref([
{
label: "设备名称",
prop: "name",
align: "center",
with: 200,
},
{
label: "设备名称",
prop: "name",
align: "center",
with: 200,
},
{
label: "设备名称",
prop: "name",
align: "center",
with: 200,
},
]);
export const schemas = ref([
{
label: "设备名称",
prop: "name",
type: "input",
componentProps: {
placeholder: "请输入设备名称",
},
},
{
label: "设备编号",
prop: "code",
type: "select",
componentProps: {
options: [
{ label: "11111", value: 1 },
{ label: "22222", value: 2 },
],
placeholder: "请输入设备编号",
},
},
{
label: "设备名称",
prop: "date",
type: "dateTimePicker",
componentProps: {
type: "datetimerange",
startPlaceholder: "开始日起",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
datFormat: "YYYY/MM/DD",
timeFormat: "HH:mm:ss",
},
},
]);
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