Commit 726bd962 authored by xuke's avatar xuke

修改输入格式

parent b618c440
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="openingOfElectricValve" style="padding: 0;margin: 0;"> <el-form-item prop="openingOfElectricValve" style="padding: 0;margin: 0;">
<el-input maxlength="3" v-float-number style="width: 80%; text-align: left" <el-input maxlength="5" v-float-number style="width: 80%; text-align: left"
v-model="formDatas.openingOfElectricValve"> v-model="formDatas.openingOfElectricValve">
<template #append> <template #append>
<div style="width: 40px">%</div> <div style="width: 40px">%</div>
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="boilerOutletWaterTemperature" style="padding: 0;margin: 0;"> <el-form-item prop="boilerOutletWaterTemperature" style="padding: 0;margin: 0;">
<el-input maxlength="10" style="width: 80%" v-model="formDatas.boilerOutletWaterTemperature"> <el-input maxlength="10" 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>
...@@ -76,7 +77,8 @@ ...@@ -76,7 +77,8 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="upperLlimitMainFlow" style="padding: 0;margin: 0;"> <el-form-item prop="upperLlimitMainFlow" style="padding: 0;margin: 0;">
<el-input maxlength="10" v-float-number style="width: 80%" v-model="formDatas.upperLlimitMainFlow"> <el-input maxlength="10" 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>
...@@ -94,7 +96,8 @@ ...@@ -94,7 +96,8 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="lowerLlimitMainFlow" style="padding: 0;margin: 0;"> <el-form-item prop="lowerLlimitMainFlow" style="padding: 0;margin: 0;">
<el-input maxlength="10" v-float-number style="width: 80%" v-model="formDatas.lowerLlimitMainFlow"> <el-input maxlength="10" 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>
...@@ -112,7 +115,8 @@ ...@@ -112,7 +115,8 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="maxTargetTemperature" style="padding: 0;margin: 0;"> <el-form-item prop="maxTargetTemperature" style="padding: 0;margin: 0;">
<el-input maxlength="10" style="width: 80%" v-model="formDatas.maxTargetTemperature"> <el-input v-float-number maxlength="10" style="width: 80%"
v-model="formDatas.maxTargetTemperature">
<template #append> <template #append>
<div style="width: 40px"></div> <div style="width: 40px"></div>
</template> </template>
...@@ -197,27 +201,34 @@ const formDatas = ref([ ...@@ -197,27 +201,34 @@ const formDatas = ref([
const rules = reactive({ const rules = reactive({
openingOfElectricValve: [ openingOfElectricValve: [
{ pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur" } { required: true, message: "电调阈开启度是必填项", trigger: "blur" },
{ pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,2})?$/, "message": "请输入正确的百分比格式", trigger: "blur" }
], ],
boilerOutletWaterTemperature: [ boilerOutletWaterTemperature: [
{ pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的锅炉出水温度", trigger: "blur" } { required: true, message: "锅炉出水温度是必填项", trigger: "blur" }
], ],
// upperLlimitMainFlow: [ holdingTime: [
// { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的锅炉房供水总管流量上限值", trigger: "blur" } { required: true, message: "电调开启度保持时间是必填项", trigger: "blur" }
// ], ],
// lowerLlimitMainFlow: [ upperLlimitMainFlow: [
// { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的锅炉房供水总管流量下限值", trigger: "blur" }
// ], { required: true, message: "锅炉房供水总管流量上限值是必填项", trigger: "blur" }
maxTargetTemperature: [
{ pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的目标温度最大值", trigger: "blur" },
], ],
// bestHoldingTime: [ lowerLlimitMainFlow: [
// { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的持续时间", trigger: "blur" } { required: true, message: "锅炉房供水总管流量下限值是必填项", trigger: "blur" }
// ], ],
// holdingTime: [ maxTargetTemperature: [
// { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的保持时间", trigger: "blur" } { required: true, message: "目标温度最大值是必填项", trigger: "blur" }
// ] ],
bestHoldingTime: [
{ required: true, message: "总管流量上下限范围内保持时间必填项", trigger: "blur" }
],
}); });
// 获取数据列表 // 获取数据列表
...@@ -355,41 +366,42 @@ table.botList td { ...@@ -355,41 +366,42 @@ table.botList td {
text-align: left; text-align: left;
font-weight: bolder; font-weight: bolder;
} }
// 校验时样式 // 校验时样式
.el-form-item__content { .el-form-item__content {
margin-left: 0 !important; margin-left: 0 !important;
} }
.el-form-item__error--inline { .el-form-item__error--inline {
top: auto; top: auto;
left: auto; left: auto;
display: inline-block; display: inline-block;
margin-left: 10px; margin-left: 10px;
line-height: 18px; line-height: 18px;
position: fixed; position: fixed;
padding: 5px 10px; padding: 5px 10px;
background: rgba(0, 0, 0, 0.85); background: rgba(0, 0, 0, 0.85);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
0 0 5px rgba(0, 0, 0, 0.6); 0 0 5px rgba(0, 0, 0, 0.6);
word-break: break-all; word-break: break-all;
word-wrap: break-word; word-wrap: break-word;
border-radius: 4px; border-radius: 4px;
margin-top: 4px; margin-top: 4px;
max-width: 160px; max-width: 160px;
min-width: 100px; min-width: 100px;
height: auto; height: auto;
z-index: 10000; z-index: 10000;
color: white !important; color: white !important;
} }
.el-form-item__error--inline::before { .el-form-item__error--inline::before {
content: ''; content: '';
width: 0; width: 0;
height: 0; height: 0;
border: 6px solid transparent; border: 6px solid transparent;
border-right-color: #080B12; border-right-color: #080B12;
position: absolute; position: absolute;
left: -11px; left: -11px;
top: 8px; top: 8px;
} }
</style> </style>
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
import http from "../../api/http"; import http from "../../api/http";
import store from "../../store"; import store from "../../store";
import { vFloatNumber } from "@/utils/directives.js"; import { vFloatNumber } from "@/utils/directives.js";
import { computed } from "vue";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const tableData = ref([{}]); const tableData = ref([{}]);
// 获取渲染 // 获取渲染
...@@ -166,11 +167,35 @@ const handleCancel = () => { ...@@ -166,11 +167,35 @@ const handleCancel = () => {
dialogVisible.value = false dialogVisible.value = false
loading.value = false loading.value = false
} }
// 新增能源消耗的日期默认显示当前日期
// const defaultTime = ref(0)
const recordDate = ref(0)
const getCurrentDateTime = () => {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
// return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
recordDate.value = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds
};
const openDialog = () => {
getCurrentDateTime()
// formEnergy.recordDate = ref(getCurrentDateTime())
formEnergy.recordDate = recordDate.value
console.log("formEnergy.recordDate",formEnergy.recordDate);
}
const handleAdd = () => { const handleAdd = () => {
action.value = "add", action.value = "add",
dialogVisible.value = true; dialogVisible.value = true;
addSaveBtnLoading.value = false addSaveBtnLoading.value = false
reset() reset()
formEnergy.value.recordDate = recordDate.value
console.log('formEnergy.recordDate',formEnergy.value.recordDate);
} }
// 编辑 // 编辑
const handleEdit = (val) => { const handleEdit = (val) => {
...@@ -276,7 +301,11 @@ function getOrganizationStructure() { ...@@ -276,7 +301,11 @@ function getOrganizationStructure() {
onMounted(() => { onMounted(() => {
getOrganizationStructure() getOrganizationStructure()
getEnergyData() getEnergyData()
getCurrentDateTime()
}) })
</script> </script>
<template> <template>
...@@ -346,7 +375,7 @@ onMounted(() => { ...@@ -346,7 +375,7 @@ onMounted(() => {
</template> </template>
</el-table> </el-table>
</div> </div>
<el-dialog v-model="dialogVisible" :title="action == 'add' ? '数据新增' : '数据修改'" width="50%" :before-close="handleClose"> <el-dialog v-model="dialogVisible" @open="openDialog" :title="action == 'add' ? '数据新增' : '数据修改'" width="50%" :before-close="handleClose">
<el-form :inline="true" :model="formEnergy" :rules="rules" ref="energyForm" :hide-required-asterisk="true"> <el-form :inline="true" :model="formEnergy" :rules="rules" ref="energyForm" :hide-required-asterisk="true">
<table cellpadding="0" cellspacing="1" style="background-color: #99bbe8 ; height: 50px;"> <table cellpadding="0" cellspacing="1" style="background-color: #99bbe8 ; height: 50px;">
<tr> <tr>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="planName" style="padding: 0;margin: 0;"> <el-form-item prop="planName" style="padding: 0;margin: 0;">
<el-input maxlength="20" style="width: 80%" v-model="List.planName"></el-input> <el-input maxlength="20" style="width: 80%" v-model="List.planName"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="diffPercentage" style="padding: 0;margin: 0;"> <el-form-item prop="diffPercentage" style="padding: 0;margin: 0;">
<el-input v-float-number maxLenght="10" style="width: 80%" v-model="List.diffPercentage"></el-input> <el-input v-float-number maxLenght="10" style="width: 80%"
v-model="List.diffPercentage"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -42,7 +43,7 @@ ...@@ -42,7 +43,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="timeoutMin" style="padding: 0;margin: 0;"> <el-form-item prop="timeoutMin" style="padding: 0;margin: 0;">
<el-input v-float-number maxlength="10" style="width: 80%" v-model="List.timeoutMin"></el-input> <el-input v-float-number maxlength="2" style="width: 80%" v-model="List.timeoutMin"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -56,7 +57,7 @@ ...@@ -56,7 +57,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 maxlength="10" style="width: 80%" v-model="List.tempRegulation"></el-input> <el-input maxlength="9" style="width: 80%" v-model="List.tempRegulation"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -111,17 +112,24 @@ const List = ref( ...@@ -111,17 +112,24 @@ const List = ref(
//校验规则 //校验规则
const rules = reactive({ const rules = reactive({
planName: [ planName: [
{ required: true, message: "计划名称是必填项", trigger: "blur" }, { required: true, message: "计划名称是必填项", trigger: "blur" },
{ pattern: /^.{1,20}$/, "message": "计划名称必须是1-20位字符", trigger: "blur" } { pattern: /^.{1,30}$/, "message": "计划名称必须是1-30位字符", trigger: "blur" }
],
timeoutMin: [
{ required: true, message: "判断时间是必填项", trigger: "blur" },
{ pattern: /^([1-9]|[1-5][0-9])$/, "message": "判断时间必须是大于0小于60的整数", 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]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur" }
], ],
tempRegulation: [ tempRegulation: [
{ pattern: /^(-?\d{1,10})(\.[0-9]{1,4})?$/, message: "请输入正确的调节温度最大值", trigger: "blur" } { required: true, message: "调节温度是必填项", trigger: "blur" },
{ pattern: /^^(-([1-2]?\d(\.\d+)?|30(\.0+)?)|([0-3]?\d(\.\d+)?|4[0-4](\.\d+)?|45(\.0+)?))$$/, message: "调节温度必须是高于-30且低于45的浮点数", trigger: "blur" }
], ],
description: [ description: [
{ pattern: /^.{1,50}$/, "message": "备注必须是1-50位字符", trigger: "blur" } { required: true, message: "备注是必填项", trigger: "blur" },
{ pattern: /^.{1,200}$/, "message": "备注必须是1-200位字符", trigger: "blur" }
] ]
}); });
...@@ -137,14 +145,14 @@ const getInstanceHeat = () => { ...@@ -137,14 +145,14 @@ const getInstanceHeat = () => {
} }
const onSave = async () => { const onSave = async () => {
await formRef.value.validate() await formRef.value.validate()
await http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((res) => { await http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((res) => {
if (res.success) { if (res.success) {
ElMessage.success(res.message) ElMessage.success(res.message)
getInstanceHeat() getInstanceHeat()
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
onMounted(() => { onMounted(() => {
getInstanceHeat() getInstanceHeat()
...@@ -215,39 +223,39 @@ table.botList td { ...@@ -215,39 +223,39 @@ table.botList td {
// 校验时样式 // 校验时样式
.el-form-item__content { .el-form-item__content {
margin-left: 0 !important; margin-left: 0 !important;
} }
.el-form-item__error--inline { .el-form-item__error--inline {
top: auto; top: auto;
left: auto; left: auto;
display: inline-block; display: inline-block;
margin-left: 10px; margin-left: 10px;
line-height: 18px; line-height: 18px;
position: fixed; position: fixed;
padding: 5px 10px; padding: 5px 10px;
background: rgba(0, 0, 0, 0.85); background: rgba(0, 0, 0, 0.85);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
0 0 5px rgba(0, 0, 0, 0.6); 0 0 5px rgba(0, 0, 0, 0.6);
word-break: break-all; word-break: break-all;
word-wrap: break-word; word-wrap: break-word;
border-radius: 4px; border-radius: 4px;
margin-top: 4px; margin-top: 4px;
max-width: 160px; max-width: 160px;
min-width: 100px; min-width: 100px;
height: auto; height: auto;
z-index: 10000; z-index: 10000;
color: white !important; color: white !important;
} }
.el-form-item__error--inline::before { .el-form-item__error--inline::before {
content: ''; content: '';
width: 0; width: 0;
height: 0; height: 0;
border: 6px solid transparent; border: 6px solid transparent;
border-right-color: #080B12; border-right-color: #080B12;
position: absolute; position: absolute;
left: -11px; left: -11px;
top: 8px; top: 8px;
} }
</style> </style>
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