Commit 4652fca6 authored by 裴文涛's avatar 裴文涛
parents 7583a04c b618c440
...@@ -127,10 +127,10 @@ ...@@ -127,10 +127,10 @@
<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">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr height="60px"> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="topMost"> <el-form-item prop="topMost">
<el-input v-float-number style="width: 80%" v-model="addParams.topMost"></el-input> <el-input v-float-number maxlength="10" style="width: 80%" v-model="addParams.topMost"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -141,10 +141,10 @@ ...@@ -141,10 +141,10 @@
<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">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr height="60px"> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="upper"> <el-form-item prop="upper">
<el-input v-float-number style="width: 80%" v-model="addParams.upper"></el-input> <el-input v-float-number maxlength="10" style="width: 80%" v-model="addParams.upper"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -156,10 +156,10 @@ ...@@ -156,10 +156,10 @@
<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">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr height="60px"> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="lower"> <el-form-item prop="lower">
<el-input v-float-number style="width: 80%" v-model="addParams.lower"></el-input> <el-input v-float-number maxlength="10" style="width: 80%" v-model="addParams.lower"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -170,10 +170,10 @@ ...@@ -170,10 +170,10 @@
<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">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr height="60px"> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="downMost"> <el-form-item prop="downMost">
<el-input v-float-number style="width: 80%" v-model="addParams.downMost"></el-input> <el-input v-float-number maxlength="10" style="width: 80%" v-model="addParams.downMost"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -581,19 +581,6 @@ let param = ref({ ...@@ -581,19 +581,6 @@ let param = ref({
const formRef = ref() const formRef = ref()
addParams.value = {} addParams.value = {}
const rules = reactive({ const rules = reactive({
topMost: [
{ pattern: /^(\d{1,10})(\.[0-9]{1,4})?$/, "message": "上上限值长度超出范围", trigger: "blur" }
],
upper: [
{ pattern: /^(\d{1,10})(\.[0-9]{1,4})?$/, "message": "上限值长度超出范围", trigger: "blur" }
],
lower: [
{ pattern: /^(\d{1,10})(\.[0-9]{1,4})?$/, "message": "下限值长度超出范围", trigger: "blur" }
],
downMost: [
{ pattern: /^(\d{1,10})(\.[0-9]{1,4})?$/, "message": "下下限值长度超出范围", trigger: "blur" }
],
alarmPlan: [ alarmPlan: [
{ pattern: /^.{1,50}$/, "message": "报警预案必须是1-50位字符", trigger: "blur" } { pattern: /^.{1,50}$/, "message": "报警预案必须是1-50位字符", trigger: "blur" }
] ]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="contentBlock"> <div class="contentBlock">
<div class="contentBlockInn"> <div class="contentBlockInn">
<el-card class="card-contianer"> <el-card class="card-contianer">
<el-form ref="formRef" :rules="rules" :model="formDatas" label-width="auto"> <el-form ref="formRef" :rules="rules" :model="formDatas" label-width="auto" :inline-message="true">
<table v-loading="loading" cellpadding="0" cellspacing="1" style="background-color: #99bbe8"> <table v-loading="loading" cellpadding="0" cellspacing="1" style="background-color: #99bbe8">
<tr> <tr>
<th style="width: 25%">电调阈开启度</th> <th style="width: 25%">电调阈开启度</th>
...@@ -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 v-float-number style="width: 80%; text-align: left" <el-input maxlength="3" 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,7 @@ ...@@ -40,7 +40,7 @@
<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 style="width: 80%" v-model="formDatas.boilerOutletWaterTemperature"> <el-input maxlength="10" style="width: 80%" v-model="formDatas.boilerOutletWaterTemperature">
<template #append> <template #append>
<div style="width: 40px"></div> <div style="width: 40px"></div>
</template> </template>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="holdingTime" style="padding: 0;margin: 0;"> <el-form-item prop="holdingTime" style="padding: 0;margin: 0;">
<el-input v-float-number style="width: 80%" v-model="formDatas.holdingTime"> <el-input maxlength="10" v-float-number style="width: 80%" v-model="formDatas.holdingTime">
<template #append> <template #append>
<div style="width: 40px">分钟</div> <div style="width: 40px">分钟</div>
</template> </template>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<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 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 +94,7 @@ ...@@ -94,7 +94,7 @@
<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 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 +112,7 @@ ...@@ -112,7 +112,7 @@
<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 style="width: 80%" v-model="formDatas.maxTargetTemperature"> <el-input 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>
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="bestHoldingTime" style="padding: 0;margin: 0;"> <el-form-item prop="bestHoldingTime" style="padding: 0;margin: 0;">
<el-input v-float-number style="width: 80%" v-model="formDatas.bestHoldingTime"> <el-input maxlength="10" v-float-number style="width: 80%" v-model="formDatas.bestHoldingTime">
<template #append> <template #append>
<div style="width: 40px">分钟</div> <div style="width: 40px">分钟</div>
</template> </template>
...@@ -202,22 +202,22 @@ const rules = reactive({ ...@@ -202,22 +202,22 @@ const rules = reactive({
boilerOutletWaterTemperature: [ boilerOutletWaterTemperature: [
{ pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的锅炉出水温度", trigger: "blur" } { pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的锅炉出水温度", trigger: "blur" }
], ],
upperLlimitMainFlow: [ // upperLlimitMainFlow: [
{ pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的锅炉房供水总管流量上限值", trigger: "blur" } // { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的锅炉房供水总管流量上限值", trigger: "blur" }
], // ],
lowerLlimitMainFlow: [ // lowerLlimitMainFlow: [
{ pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的锅炉房供水总管流量下限值", trigger: "blur" } // { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的锅炉房供水总管流量下限值", trigger: "blur" }
], // ],
maxTargetTemperature: [ maxTargetTemperature: [
{ pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的目标温度最大值", trigger: "blur" }, { pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的目标温度最大值", trigger: "blur" },
], ],
bestHoldingTime: [ // bestHoldingTime: [
{ pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的持续时间", trigger: "blur" } // { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的持续时间", trigger: "blur" }
], // ],
holdingTime: [ // holdingTime: [
{ pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的保持时间", trigger: "blur" } // { pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "请输入正确的保持时间", trigger: "blur" }
] // ]
}); });
// 获取数据列表 // 获取数据列表
...@@ -355,4 +355,41 @@ table.botList td { ...@@ -355,4 +355,41 @@ table.botList td {
text-align: left; text-align: left;
font-weight: bolder; font-weight: bolder;
} }
// 校验时样式
.el-form-item__content {
margin-left: 0 !important;
}
.el-form-item__error--inline {
top: auto;
left: auto;
display: inline-block;
margin-left: 10px;
line-height: 18px;
position: fixed;
padding: 5px 10px;
background: rgba(0, 0, 0, 0.85);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
0 0 5px rgba(0, 0, 0, 0.6);
word-break: break-all;
word-wrap: break-word;
border-radius: 4px;
margin-top: 4px;
max-width: 160px;
min-width: 100px;
height: auto;
z-index: 10000;
color: white !important;
}
.el-form-item__error--inline::before {
content: '';
width: 0;
height: 0;
border: 6px solid transparent;
border-right-color: #080B12;
position: absolute;
left: -11px;
top: 8px;
}
</style> </style>
...@@ -78,8 +78,18 @@ const tableLabel = reactive([ ...@@ -78,8 +78,18 @@ const tableLabel = reactive([
}, },
]); ]);
// 多选options
// 定义选项
const options = [
{ value: '0', label: '非节能' },
{ value: '1', label: '一步节能' },
{ value: '2', label: '二步节能' },
{ value: '3', label: '三步节能' },
{ value: '4', label: '四步节能' },
];
const formInline = reactive({ const formInline = reactive({
keyWord: "" keyWord: options.map(option => option.value),
}); });
const config = reactive({ const config = reactive({
...@@ -92,12 +102,6 @@ const handleSearch = () => { ...@@ -92,12 +102,6 @@ const handleSearch = () => {
getEnergyData() getEnergyData()
}; };
// 重置按钮
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);
...@@ -118,7 +122,7 @@ const rules = reactive({ ...@@ -118,7 +122,7 @@ const rules = reactive({
], ],
record: [ record: [
{ required: true, message: "能源用度是必选项", trigger: "blur" }, { required: true, message: "能源用度是必选项", trigger: "blur" },
{ pattern: /^(\d{1,10})$/, "message": "能源用度是 1-10位正整数", trigger: "blur" }
], ],
recordDate: [{ required: true, message: "日期是必选项" }], recordDate: [{ required: true, message: "日期是必选项" }],
}); });
...@@ -154,11 +158,13 @@ const handleDelete = (row) => { ...@@ -154,11 +158,13 @@ const handleDelete = (row) => {
// 新增 // 新增
const action = ref('add') const action = ref('add')
const handleClose = () => { const handleClose = () => {
loading.value = false
dialogVisible.value = false dialogVisible.value = false
reset() reset()
} }
const handleCancel = () => { const handleCancel = () => {
dialogVisible.value = false dialogVisible.value = false
loading.value = false
} }
const handleAdd = () => { const handleAdd = () => {
action.value = "add", action.value = "add",
...@@ -184,6 +190,8 @@ const handleEdit = (val) => { ...@@ -184,6 +190,8 @@ const handleEdit = (val) => {
formEnergy.value = { ...val } formEnergy.value = { ...val }
}; };
const onSubmit = () => { const onSubmit = () => {
addSaveBtnLoading.value = true addSaveBtnLoading.value = true
loading.value = true loading.value = true
...@@ -194,8 +202,8 @@ const onSubmit = () => { ...@@ -194,8 +202,8 @@ const onSubmit = () => {
? formEnergy.recordDate ? formEnergy.recordDate
: timeFormat(formEnergy.recordDate); : timeFormat(formEnergy.recordDate);
if (action.value === "add") { if (action.value === "add") {
http.post("api/energy/Save", { ...formEnergy.value }, false).then(res => { http.post("api/energy/Save", { ...formEnergy.value }, false).then(res => {
loading.value = true loading.value = true
if (res.success) { if (res.success) {
dialogVisible.value = false dialogVisible.value = false
ElMessage.success(res.message) ElMessage.success(res.message)
...@@ -268,7 +276,6 @@ function getOrganizationStructure() { ...@@ -268,7 +276,6 @@ function getOrganizationStructure() {
onMounted(() => { onMounted(() => {
getOrganizationStructure() getOrganizationStructure()
getEnergyData() getEnergyData()
}) })
</script> </script>
...@@ -285,12 +292,10 @@ onMounted(() => { ...@@ -285,12 +292,10 @@ onMounted(() => {
<el-form ref="formRef" :model="formInline" :inline="true" <el-form ref="formRef" :model="formInline" :inline="true"
style="display: flex; justify-content: center; align-items: center; margin: 0;"> style="display: flex; justify-content: center; align-items: center; margin: 0;">
<el-form-item class="select-clean" prop="supplyType" label-width="280px" style="margin: 0;"> <el-form-item class="select-clean" prop="supplyType" label-width="280px" style="margin: 0;">
<el-select v-model="formInline.keyWord" placeholder="请选择" style="width:360px; margin-left: 20px;"> <el-select v-model="formInline.keyWord" placeholder="请选择" multiple
<el-option label="非节能" value="0" /> style="width:360px; margin-left: 20px;">
<el-option label="一步节能" value="1" /> <el-option v-for="option in options" :key="option.value" :label="option.label"
<el-option label="二步节能" value="2" /> :value="option.value" />
<el-option label="三步节能" value="3" />
<el-option label="四步节能" value="4" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -301,10 +306,6 @@ onMounted(() => { ...@@ -301,10 +306,6 @@ 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" />
新增 新增
...@@ -352,7 +353,7 @@ onMounted(() => { ...@@ -352,7 +353,7 @@ onMounted(() => {
<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">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr height="50px"> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="supplyName" style="margin: 0; padding: 0; width: 100%;"> <el-form-item prop="supplyName" style="margin: 0; padding: 0; width: 100%;">
<el-select v-model="formEnergy.supplyId" placeholder="请选择"> <el-select v-model="formEnergy.supplyId" placeholder="请选择">
...@@ -369,7 +370,7 @@ onMounted(() => { ...@@ -369,7 +370,7 @@ onMounted(() => {
<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">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr height="66px"> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="energyType" style="margin: 0; padding: 0; width: 100%"> <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="请选择">
...@@ -389,10 +390,10 @@ onMounted(() => { ...@@ -389,10 +390,10 @@ onMounted(() => {
<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">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr height="66px"> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item prop="record" style="margin: 0; padding: 0; width: 100%"> <el-form-item prop="record" style="margin: 0; padding: 0; width: 100%">
<el-input v-float-number v-model="formEnergy.record" placeholder="请输入能源用度" /> <el-input v-float-number maxlength="10" v-model="formEnergy.record" placeholder="请输入能源用度" />
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -403,7 +404,7 @@ onMounted(() => { ...@@ -403,7 +404,7 @@ onMounted(() => {
<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">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr height="66px"> <tr>
<td> <td>
<el-form-item prop="recordDate" style="margin: 0; padding: 0; width: 100%"> <el-form-item prop="recordDate" style="margin: 0; padding: 0; width: 100%">
<el-date-picker value-format="YYYY-MM-DD HH:mm:ss" v-model="formEnergy.recordDate" type="datetime" <el-date-picker value-format="YYYY-MM-DD HH:mm:ss" v-model="formEnergy.recordDate" type="datetime"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="card-header"> <div class="card-header">
<span>瞬时热量对比配置</span> <span>瞬时热量对比配置</span>
</div> </div>
<el-form ref="formRef" :rules="rules" :model="List" label-width="auto"> <el-form ref="formRef" :rules="rules" :model="List" label-width="auto" :inline-message="true">
<table v-loading="loading" cellpadding="0" cellspacing="1"> <table v-loading="loading" cellpadding="0" cellspacing="1">
<tr> <tr>
<th style="width: 25%">计划名称</th> <th style="width: 25%">计划名称</th>
...@@ -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 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,7 @@ ...@@ -28,7 +28,7 @@
<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 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 +42,7 @@ ...@@ -42,7 +42,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 style="width: 80%" v-model="List.timeoutMin"></el-input> <el-input v-float-number maxlength="10" style="width: 80%" v-model="List.timeoutMin"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -56,7 +56,7 @@ ...@@ -56,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 style="width: 80%" v-model="List.tempRegulation"></el-input> <el-input maxlength="10" style="width: 80%" v-model="List.tempRegulation"></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -111,14 +111,12 @@ const List = ref( ...@@ -111,14 +111,12 @@ const List = ref(
//校验规则 //校验规则
const rules = reactive({ const rules = reactive({
planName: [ planName: [
{ required: true, message: "计划名称是必填项", trigger: "blur" },
{ pattern: /^.{1,20}$/, "message": "计划名称必须是1-20位字符", trigger: "blur" } { pattern: /^.{1,20}$/, "message": "计划名称必须是1-20位字符", trigger: "blur" }
], ],
diffPercentage: [ diffPercentage: [
{ 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" }
], ],
timeoutMin: [
{ pattern: /^(\d{1,10})$/, "message": "判断时间必须是1-10位正整数", trigger: "blur" }
],
tempRegulation: [ tempRegulation: [
{ pattern: /^(-?\d{1,10})(\.[0-9]{1,4})?$/, message: "请输入正确的调节温度最大值", trigger: "blur" } { pattern: /^(-?\d{1,10})(\.[0-9]{1,4})?$/, message: "请输入正确的调节温度最大值", trigger: "blur" }
], ],
...@@ -214,4 +212,42 @@ table.botList td { ...@@ -214,4 +212,42 @@ table.botList td {
text-align: left; text-align: left;
font-weight: bolder; font-weight: bolder;
} }
// 校验时样式
.el-form-item__content {
margin-left: 0 !important;
}
.el-form-item__error--inline {
top: auto;
left: auto;
display: inline-block;
margin-left: 10px;
line-height: 18px;
position: fixed;
padding: 5px 10px;
background: rgba(0, 0, 0, 0.85);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
0 0 5px rgba(0, 0, 0, 0.6);
word-break: break-all;
word-wrap: break-word;
border-radius: 4px;
margin-top: 4px;
max-width: 160px;
min-width: 100px;
height: auto;
z-index: 10000;
color: white !important;
}
.el-form-item__error--inline::before {
content: '';
width: 0;
height: 0;
border: 6px solid transparent;
border-right-color: #080B12;
position: absolute;
left: -11px;
top: 8px;
}
</style> </style>
...@@ -201,6 +201,10 @@ function resetSearch(){ ...@@ -201,6 +201,10 @@ function resetSearch(){
supplySearchKey.value = '' supplySearchKey.value = ''
getData() getData()
} }
function revise1(row) {
console.log("scope.row", row);
}
</script> </script>
<template> <template>
......
...@@ -80,7 +80,16 @@ const rules = reactive({ ...@@ -80,7 +80,16 @@ const rules = reactive({
] ]
}) })
watchEffect(() => { watchEffect(() => {
<<<<<<< HEAD
// reviseData.value = {...props.data}
props.data.transfers = []
props.data.updateNullFields = ''
reviseData.value = cloneDeep(props.data) // 深拷贝数据
console.log("props.data===>", props.data);
console.log(reviseData.value);
=======
reviseData.value = props.data // 深拷贝数据 reviseData.value = props.data // 深拷贝数据
>>>>>>> 44482294a0f0e141cfad6fc71ae5bd19c87d6aed
}) })
const inputStyle = { const inputStyle = {
color: 'black', color: 'black',
...@@ -164,6 +173,14 @@ function handleConfirm() { ...@@ -164,6 +173,14 @@ function handleConfirm() {
) )
} }
} }
<<<<<<< HEAD
formRef.value.validate(valid => {
if (valid) {
emit('onConfirm', reviseData.value)
}
})
})
=======
} else { } else {
delete reviseData.value.supplyId delete reviseData.value.supplyId
} }
...@@ -171,11 +188,22 @@ function handleConfirm() { ...@@ -171,11 +188,22 @@ function handleConfirm() {
reviseData.value.isFixed = reviseData.value.isFixed === '固定模式' ? true : false; reviseData.value.isFixed = reviseData.value.isFixed === '固定模式' ? true : false;
console.log('修改数据', reviseData.value) console.log('修改数据', reviseData.value)
emit('onConfirm', reviseData.value) emit('onConfirm', reviseData.value)
>>>>>>> 44482294a0f0e141cfad6fc71ae5bd19c87d6aed
} }
}) })
} }
<<<<<<< HEAD
// 重置表单
const reset = () => {
const form = unref(formRef)
form.resetFields()
}
function onClose(){
reset()
=======
function onClose() { function onClose() {
>>>>>>> 44482294a0f0e141cfad6fc71ae5bd19c87d6aed
emit('onCancel') emit('onCancel')
} }
......
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