Commit fee5e7d1 authored by xuke's avatar xuke

页面验收修改

parent 03071fe6
......@@ -34,7 +34,7 @@ const routes = [
component: HomePage,
children: [
{
path: "/RealSupply",
path: "/Scheduling/RealSupply",
name: "RealSupplyPage",
component: () => import("@/views/RealPage/RealSupplyPage.vue"),
meta: {
......
......@@ -845,7 +845,7 @@ const onDel = () => {
// 关闭dialog右上× 清空数据
const onClose = () => {
type.value = ""
// type.value = ""
dept.value = ""
cnNames_before.value = ""
cnNames_after.value = ""
......
......@@ -220,7 +220,8 @@ const rules = reactive({
{ required: true, message: "锅炉房供水总管流量下限值是必填项", trigger: "blur" }
],
maxTargetTemperature: [
{ required: true, message: "目标温度最大值是必填项", trigger: "blur" }
{ required: true, message: "目标温度最大值是必填项", trigger: "blur" },
{pattern: /^(-([1-9]?[0-9]{0,2}(\.\d+)?|1[01][0-9]{2}(\.\d+)?|1200(\.0+)?)|([0-9]?[0-9]{0,2}(\.\d+)?|1[01][0-9]{2}(\.\d+)?|1200(\.0+)?))$/ ,message: "目标温度的最大值是不超过1200最小值不小于-1200", trigger: "blur"}
],
bestHoldingTime: [
{ required: true, message: "总管流量上下限范围内保持时间必填项", trigger: "blur" }
......@@ -233,7 +234,7 @@ const getListData = () => {
http.get("/api/configboiler/getData").then((result) => {
if (result.success) {
formDatas.value = result.data;
ElMessage.success(result.message)
// ElMessage.success(result.message)
formDatas.value.transferIds = formDatas.value.transferIds.split(",");
formDatas.value.updateNullFields = "";
loading.value = false
......
<script setup>
import { ref, onMounted, getCurrentInstance, reactive, nextTick } from "vue";
import { ref, onMounted, getCurrentInstance, reactive, nextTick, watch, computed } from "vue";
import { useRoute } from 'vue-router'
import { ElMessageBox, ElMessage } from "element-plus";
import { ElMessageBox, ElMessage, ElPopover, ElButton, ElCheckbox, ElCheckboxGroup } from "element-plus";
import axios from "axios";
import { Search, Minus, Document } from "@element-plus/icons-vue";
import {
......@@ -10,7 +10,6 @@ import {
import http from "../../api/http";
import store from "../../store";
import { vFloatNumber } from "@/utils/directives.js";
import { computed } from "vue";
const { proxy } = getCurrentInstance();
const tableData = ref([{}]);
// 获取渲染
......@@ -44,7 +43,7 @@ const getEnergyData = () => {
if (res.success) {
loading.value = false
tableData.value = res.data;
ElMessage.success(res.message);
// ElMessage.success(res.message);
} else {
ElMessage.error("系统繁忙, 请稍后再试")
}
......@@ -91,8 +90,9 @@ const options = [
{ value: '4', label: '四步节能' },
];
const formInline = reactive({
keyWord: options.map(option => option.value),
// 选中的
const formInline = ref({
keyWord: []
});
const config = reactive({
......@@ -100,14 +100,13 @@ const config = reactive({
});
const handleSearch = () => {
config.supplyType = formInline.keyWord;
config.supplyType = [`${config.supplyType}`];
config.supplyType = formInline.value.keyWord;
getEnergyData()
};
// 重置按钮
const handleReset = () => {
formInline.keyWord = ""
formInline.value.keyWord = []
config.supplyType = ["0", "1", "2", "3", "4"]
getEnergyData()
}
......@@ -138,6 +137,20 @@ const rules = reactive({
recordDate: [{ required: true, message: "日期是必选项" }],
});
// 搜索
// 全选按钮的文本和值
const selectAllLabel = '全选'
const selectAllValue = 'ALL'
// 判断是否全部选中
const isAllSelected = computed(() =>
formInline.value.keyWord.length === options.length
)
// 计算全选选项是否已被选中
const isSelectAllOption = computed(() =>
formInline.value.keyWord.includes(selectAllValue)
)
// 放重复点击操作
const clicked = ref(false)
......@@ -188,7 +201,6 @@ const getCurrentDateTime = () => {
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
};
......@@ -220,10 +232,6 @@ const handleEdit = (val) => {
console.log("一行的数据val===>", val);
action.value = "edit";
dialogVisible.value = true;
// nextTick(() => {
// Object.assign(formEnergy.value, { ...val });
// console.log("val:", val);
// });
formEnergy.value = { ...val }
};
......@@ -312,6 +320,22 @@ function getOrganizationStructure() {
})
}
const checkAll = ref(false)
watch(
() => checkAll.value,
(newVal, oldVal) => {
if (!newVal) {
formInline.value.keyWord = [] // 如果已经全选,则取消全选
} else {
formInline.value.keyWord = options.map(option => option.value) // 否则全选
}
}
)
const changeValue = () => {
formInline.value.keyWord = formInline.value.keyWord.filter(i => i != '')
}
// 清除表单校验
const clearFormValidation = () => {
......@@ -321,7 +345,6 @@ const clearFormValidation = () => {
}
}
onMounted(() => {
getOrganizationStructure()
getEnergyData()
......@@ -337,24 +360,43 @@ onMounted(() => {
<div class="contentBlock">
<table cellpadding="0" cellspacing="1" style="background-color: #99bbe8;width: 100%;">
<tr style="height: 10px;">
<th width="30%">
<th>
<span>能源类型:</span>
</th>
<th width="40%" style=" background-color: #ffffff;">
<th style=" background-color: #ffffff;">
<div class="th_div">
<el-form ref="formRef" :model="formInline" :inline="true"
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-select v-model="formInline.keyWord" placeholder="请选择" multiple
style="width:360px; margin-left: 20px;">
<el-option v-for="option in options" :key="option.value" :label="option.label"
:value="option.value" />
style="width: 500px; margin-left: 20px;">
<el-option value="">
<template #default>
<!-- 全选按钮 -->
<el-checkbox :label="selectAllLabel" v-model="checkAll">
</el-checkbox>
</template>
</el-option>
<!-- 正常选项 -->
<el-option value="">
<template #default>
<el-checkbox-group v-model="formInline.keyWord" @change="changeValue">
<el-checkbox v-for="opt in options" :key="opt.value" :label="opt.value"
:value="opt.value">
{{ opt.label }}
</el-checkbox>
</el-checkbox-group>
</template>
</el-option>
<el-option v-for="(option, index) in options" :key="option.value" :label="option.label"
:value="option.value" v-show="false" @click="() => { }">
</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</th>
<th width="100%" style="background-color: #ffffff;text-align: center;">
<th style="background-color: #ffffff;text-align: center;">
<el-button type="primary" @click="handleSearch">
<Search style="width: 1em; height: 1em; margin-right: 8px" />
查询
......@@ -374,7 +416,7 @@ onMounted(() => {
<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' }"
:cell-style="{ 'text-align': 'center', padding: '0px' }" :row-style="{ height: '30px', padding: '0px' }" border
:cell-style="{ 'text-align': 'center', padding: '0px' }" :row-style="{ height: '40px', padding: '0px' }" border
stripe max-height="633">
<el-table-column prop="allowPagingId" label="序号" />
<el-table-column prop="supplyName" label="名称" />
......@@ -415,7 +457,7 @@ onMounted(() => {
<tr>
<td style="text-align: left">
<el-form-item prop="supplyId" style="margin: 0; padding: 0; width: 100%;">
<el-select v-model="formEnergy.supplyId" placeholder="请选择"> bbbbnnn
<el-select v-model="formEnergy.supplyId" placeholder="请选择">
<el-option v-for="item in supplyData" :key="item.supplyId" :label="item.supplyName"
:value="item.supplyId" />
</el-select>
......
......@@ -43,7 +43,7 @@
<tr>
<td style="text-align: left">
<el-form-item prop="timeoutMin" style="padding: 0;margin: 0;">
<el-input v-float-number maxlength="2" style="width: 80%" v-model="List.timeoutMin"></el-input>
<el-input v-float-number maxlength="5" style="width: 80%" v-model="List.timeoutMin"></el-input>
</el-form-item>
</td>
</tr>
......@@ -118,15 +118,16 @@ const rules = reactive({
],
timeoutMin: [
{ required: true, message: "判断时间是必填项", trigger: "blur" },
{ pattern: /^([1-9]|[1-5][0-9])$/, "message": "判断时间必须是大于0小于60的整数", trigger: "blur" }
{ pattern: /^([1-9]|[1-5][0-9])$/, "message": "判断时间必须是大于0小于60的整数", trigger: "change" }
],
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": "百分比必须是0-100", trigger: "blur" }
],
tempRegulation: [
{ 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" }
{ pattern: /^(-([1-2]?\d(\.\d+)?|30(\.0+)?)|([0-3]?\d(\.\d+)?|4[0-4](\.\d+)?|45(\.0+)?))$/, message: "调节温度必须是高于-30且低于45的浮点数", trigger: "blur" },
],
description: [
{ required: true, message: "备注是必填项", trigger: "blur" },
......
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