Commit c099ac15 authored by 裴文涛's avatar 裴文涛
parents 9dd16573 fd1e8cdf
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button> <el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button>
<el-button type="primary" @click="paramsSetting" style="min-width: 70px;">报警参数设置</el-button> <el-button type="primary" @click="open" style="min-width: 70px;">报警参数设置</el-button>
</el-form-item> </el-form-item>
</div> </div>
</el-card> </el-card>
...@@ -64,6 +64,25 @@ ...@@ -64,6 +64,25 @@
<el-dialog v-model="show" class="dialog" :show-scrollbar="true"> <el-dialog v-model="show" class="dialog" :show-scrollbar="true">
<div class="div-header">
<el-form :inline="true">
<el-form-item label="查询类型:">
<el-select v-model="type" placeholder="请选择" style="width: 150px" @change="getoptions">
<el-option label="换热机组" value="GetTransAlarmStatusData" />
<el-option label="锅炉" value="GetBoilerAlarmStatusData" />
<el-option label="总管" value="GetPipeAlarmStatusData" />
</el-select>
</el-form-item>
<el-form-item label="设备:">
<el-cascader :options="options" v-model="dept" :props="prop" collapse-tags clearable :show-all-levels="false"
placeholder="请选择" style="min-width: 210px;" @change="getopt" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="paramsSetting" style="min-width: 70px;">确定</el-button>
</el-form-item>
</el-form>
</div>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<div class="left"> <div class="left">
...@@ -87,7 +106,7 @@ ...@@ -87,7 +106,7 @@
<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%" v-model="cnNames_before.cnName"></el-input> <el-input style="width: 80%" v-model="param.cnName"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -99,7 +118,7 @@ ...@@ -99,7 +118,7 @@
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-checkbox></el-checkbox> <el-checkbox v-model="addParams.isVoice"></el-checkbox>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -111,7 +130,7 @@ ...@@ -111,7 +130,7 @@
<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%"></el-input> <el-input style="width: 80%" v-model="addParams.topMost"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -123,7 +142,7 @@ ...@@ -123,7 +142,7 @@
<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%"></el-input> <el-input style="width: 80%" v-model="addParams.upper"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -136,7 +155,7 @@ ...@@ -136,7 +155,7 @@
<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%"></el-input> <el-input style="width: 80%" v-model="addParams.downMost"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -150,7 +169,7 @@ ...@@ -150,7 +169,7 @@
<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"></el-input> <el-input style="width: 80%" type="textarea" rows="6" v-model="addParams.alarmPlan"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -162,7 +181,7 @@ ...@@ -162,7 +181,7 @@
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-checkbox></el-checkbox> <el-checkbox v-model="addParams.isAlarm"></el-checkbox>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -174,7 +193,7 @@ ...@@ -174,7 +193,7 @@
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-checkbox></el-checkbox> <el-checkbox v-model="addParams.isShortMessage"></el-checkbox>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -183,9 +202,15 @@ ...@@ -183,9 +202,15 @@
</table> </table>
<div class="btngrounp"> <div class="btngrounp">
<el-button v-if="button" type="primary" @click="onDel">添加</el-button> <div v-if="button">
<el-button v-else-if="button" type="primary" @click="onDel">删除</el-button> <el-button :disabled="param.cnName === '' ? true : false" type="primary" @click="onAdd">添加</el-button>
<el-button v-else="button" type="primary" @click="onDel">修改</el-button> <el-button disabled type="primary" @click="onDel">删除</el-button>
</div>
<div v-else="button">
<el-button type="primary" @click="onEdit">修改</el-button>
<el-button type="primary" @click="onDel">删除</el-button>
</div>
</div> </div>
<!-- </el-card> --> <!-- </el-card> -->
</div> </div>
...@@ -216,6 +241,9 @@ ...@@ -216,6 +241,9 @@
import { ref, reactive, onMounted, onUnmounted } from 'vue'; import { ref, reactive, onMounted, onUnmounted } from 'vue';
import http from '../../api/http'; import http from '../../api/http';
import store from "../../store/index"; import store from "../../store/index";
import { ElMessage } from 'element-plus';
import { watch } from 'fs';
import { watchEffect } from 'vue';
//分页设置 //分页设置
const currentPage = ref(1) const currentPage = ref(1)
...@@ -232,22 +260,14 @@ const type = ref('GetTransAlarmStatusData'); ...@@ -232,22 +260,14 @@ const type = ref('GetTransAlarmStatusData');
const show = ref(false) const show = ref(false)
const refreshItem = ref(0) const refreshItem = ref(0)
const AlarmInfo = ref([]) const AlarmInfo = ref([])
const dept = ref('')
// getCnNames()
// console.log("type.value:",type.value);
// console.log("AlarmInfo.value:",AlarmInfo.value);
// console.log(type.value);
function open() {
function paramsSetting() {
show.value = true show.value = true
getCnNames()
} }
function onsubmit() { function onsubmit() {
...@@ -267,6 +287,7 @@ function getEnterprise() { ...@@ -267,6 +287,7 @@ function getEnterprise() {
} }
} }
const props = { multiple: true, emitPath: false } const props = { multiple: true, emitPath: false }
const prop = { multiple: true, emitPath: false, checkStrictly: true, multiple: false }
function setContentHeight() { function setContentHeight() {
tableHeight.value = window.innerHeight - 195; tableHeight.value = window.innerHeight - 195;
...@@ -330,7 +351,6 @@ function getoptions() { ...@@ -330,7 +351,6 @@ function getoptions() {
getSupplys(); getSupplys();
} }
gettransfer(); gettransfer();
getCnNames()
} }
//获取锅炉列表 //获取锅炉列表
...@@ -390,10 +410,10 @@ function getPipes() { ...@@ -390,10 +410,10 @@ function getPipes() {
} }
}); });
} }
options.forEach(element => { // options.forEach(element => {
AlarmInfo.push(element.value); // AlarmInfo.push(element.value);
}) // })
console.log(AlarmInfo.value); // console.log(AlarmInfo.value);
} }
//获取换热机组列表 //获取换热机组列表
...@@ -479,31 +499,41 @@ function getImgUrl(scope, item) { ...@@ -479,31 +499,41 @@ function getImgUrl(scope, item) {
return url; return url;
} }
console.log("AlarmInfo.value:::", AlarmInfo.value);
// 报警参数设置 // 报警参数设置
let cnNames_before = reactive([{ let cnNames_before = ref([])
cnName: "" let cnNames_after = ref([])
}]) console.log("---------------------AlarmInfo.value:", AlarmInfo.value);
let cnNames_after = reactive([{ let newType = ref(0)
cnName: "" watchEffect(() => {
}]) console.log("监听::::", type.value);
const getCnNames = () => { if (type.value === "GetPipeAlarmStatusData") {
let newType = newType.value = 1
type.value == "GetPipeAlarmStatusData" ? 1 : type.value == "GetBoilerAlarmStatusData" ? 2 : 3 } else if (type.value === "GetBoilerAlarmStatusData") {
let newAlarmInfo = AlarmInfo.value[0]; newType.value = 2
let data = http.post("api/alarm/para/GetAlarmPara", { type: newType, id: newAlarmInfo }, false) } else {
// console.log("data:", data); newType.value = 3
}
})
// 接口2:换热站基础参数编号(transParaBaseId) -> 接口1:baseId
const getCnNames = () => {
// console.log('dept-------------------', dept.value);
// console.log("++++++++++++++++++++++++", newType.value);
let data = http.post("api/alarm/para/GetAlarmPara", { type: newType.value, id: dept.value }, false);
data.then(function (val) { data.then(function (val) {
cnNames_before = val.data.before cnNames_before.value = val.data.before
cnNames_after = val.data.after cnNames_after.value = val.data.after
// console.log("@@@@", cnNames_before); // console.log("cnNames_before@@@@", cnNames_before);
// console.log("@@@@",cnNames_after); // console.log("cnNames_after@@@@", cnNames_after);
// console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId) // console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId)
}); });
} }
let params = reactive([{
let params = ref({
"pipeAlarmParaId": "", "pipeAlarmParaId": "",
"pipeParaBaseId": "", "pipeParaBaseId": "",
"pipeId": "", "pipeId": "",
...@@ -518,30 +548,78 @@ let params = reactive([{ ...@@ -518,30 +548,78 @@ let params = reactive([{
"isShortMessage": "", "isShortMessage": "",
"isAlarm": "", "isAlarm": "",
"isActive": "", "isActive": "",
"updateNullFields": "" "updateNullFields": "",
}]) })
let addParams = ref({
"updateNullFields": "",
"pipeParaBaseId": "",
"pipeId": dept.value,
"gatherType": "",
"voicePath": "",
"isVoice": "",
"topMost": "",
"upper": "",
"lower": "",
"downMost": "",
"alarmPlan": "",
"isShortMessage": "",
"isAlarm": "",
"isActive": ""
})
let param = ref({
"cnName": "",
"transParaBaseId": ""
})
// 点击确定查询数据
const paramsSetting = () => {
getCnNames()
}
const selectParams = (row) => {
param.value.transParaBaseId = row.transParaBaseId
console.log("param.value.transParaBaseId========", param.value.transParaBaseId);
if (param.value.transParaBaseId) {
const data = http.post("/api/alarm/para/GetAlarmParaInfo", { type: newType.value, id: dept.value, baseid: param.value.transParaBaseId }, false)
console.log("dataaaaa:", data);
data.then(function (val) {
console.log("valllll:", val);
params.value = val.data
console.log("!!!!!Params.value:", params.value);
param.value.cnName = row.cnName
});
} else {
ElMessage.info("该参数暂不需要修改...")
}
}
getCnNames() watchEffect(() => {
addParams.value.pipeId = dept.value
console.log(addParams.value.pipeId);
const selectParams = (row) => { })
getCnNames()
let newType =
type.value == "GetPipeAlarmStatusData" ? 1 : type.value == "GetBoilerAlarmStatusData" ? 2 : 3
let newAlarmInfo = AlarmInfo.value[0];
const data = http.post("/api/alarm/para/GetAlarmParaInfo", { type: newType, id: newAlarmInfo, baseid: row.transParaBaseId }, false)
// console.log(data);
data.then(function (val) {
params = val.data
console.log("Params:", params);
});
const onAdd = () => {
// const data = http.post("api/alarm/para/pipesave", { ...addParams.value }, false)
// console.log("新增data:::", data);
// if (data.success) {
// ElMessage.success("修改成功!!")
// } else {
// ElMessage.error("修改失败!!")
// }
http.post("api/alarm/para/pipesave", { ...addParams.value }, false).then((res) => {
if (res.success) {
ElMessage.success("修改成功!!")
getCnNames()
} else {
ElMessage.error("修改失败!!")
}
})
} }
// 按钮 // 按钮
const button = ref(false) const button = ref(true)
onMounted(() => { onMounted(() => {
......
...@@ -15,16 +15,15 @@ import { vFloatNumber } from "@/utils/directives.js"; ...@@ -15,16 +15,15 @@ import { vFloatNumber } from "@/utils/directives.js";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const tableData = ref([{}]); const tableData = ref([{}]);
const formEnergy = ref({ const formEnergy = ref({
updateNullFields: "", "updateNullFields": "",
supplyId: "", "supplyId": "",
energyType: "", "energyType": "",
record: "", "record": "",
recordDate: "", "recordDate": "",
energyName: "", "energyName": ''
}); })
const energyForm = ref(); const energyForm = ref()
const dialogVisible = ref(false); const dialogVisible = ref(false)
const getEnergyData = async () => { const getEnergyData = async () => {
await http await http
.post("/api/energy/getData", config.supplyType) .post("/api/energy/getData", config.supplyType)
...@@ -38,12 +37,6 @@ const getEnergyData = async () => { ...@@ -38,12 +37,6 @@ const getEnergyData = async () => {
ElMessage.success("获取数据成功"); ElMessage.success("获取数据成功");
}; };
//获取换热机组列表
// const getSupplys =() => {
// const res = http.get("api/home/GetOrg",false)
// console.log(res.data);
// }
const tableLabel = reactive([ const tableLabel = reactive([
{ {
prop: "allowPagingId", prop: "allowPagingId",
...@@ -95,8 +88,8 @@ const timeFormat = (time) => { ...@@ -95,8 +88,8 @@ 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) + ' 0:00:00'
}; }
//表单校验规则 //表单校验规则
const rules = reactive({ const rules = reactive({
...@@ -108,46 +101,18 @@ const rules = reactive({ ...@@ -108,46 +101,18 @@ const rules = reactive({
recordDate: [{ required: true, message: "日期是必选项" }], recordDate: [{ required: true, message: "日期是必选项" }],
}); });
// const handleChange = (page) => {
// config.page = page,
// getEnergyData()
// }
// 删除
// const handleDelete = async (row) => {
// // console.log(row.energyId);
// console.log('"' + row.energyId + '"');
// await ElMessageBox.confirm("你确定要删除吗?", {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// confirmButtonClass: 'ExitConfirmButton'
// }).then(async () => {
// // await postEnergyDel('"'+row.energyId+'"')
// await postEnergyDel({ EnergyId: row.energyId })
// ElMessage({
// type: 'success', message: '删除成功'
// })
// getEnergyData()
// })
// }
// 删除 // 删除
const handleDelete = async (row) => { const handleDelete = async (row) => {
console.log(row.energyId); console.log(row.energyId);
console.log('"' + row.energyId + '"'); console.log('"' + row.energyId + '"');
let EnergyId = row.energyId; let EnergyId = row.energyId;
await ElMessageBox.confirm("你确定要删除吗?", { await ElMessageBox.confirm("你确定要删除吗?", {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning',
confirmButtonClass: "ExitConfirmButton", confirmButtonClass: 'ExitConfirmButton'
}); })
const res = await http.get( const res = await http.post("api/energy/Delete", { id: row.energyId }, false)
"api/energy/Delete",
{ params: { EnergyId: row.energyId } },
false
);
if (res.success) { if (res.success) {
ElMessage.success("删除成功"); ElMessage.success("删除成功");
getEnergyData(); getEnergyData();
...@@ -157,24 +122,22 @@ const handleDelete = async (row) => { ...@@ -157,24 +122,22 @@ const handleDelete = async (row) => {
}; };
// 新增 // 新增
const action = ref("add"); const action = ref('add')
const handleClose = () => { const handleClose = () => {
dialogVisible.value = false; dialogVisible.value = false
proxy.$ref["energyForm"].resetFields(); proxy.$ref['energyForm'].resetFields()
}; }
const handleCancel = (formEl) => { const handleCancel = () => {
dialogVisible.value = false; dialogVisible.value = false
proxy.$ref['energyForm'].resetFields()
if (!formEl) return; }
formEl.resetFields();
};
const handleAdd = () => { const handleAdd = () => {
action.value = "add" action.value = "add",
dialogVisible.value = true; dialogVisible.value = true;
formEnergy.supplyType = ""; proxy.$refs['energyForm'].resetFields()
formEnergy.energyType = ""; formEnergy.supplyType = '',
}; formEnergy.energyType = ''
}
const handleEdit = (val) => { const handleEdit = (val) => {
action.value = "edit"; action.value = "edit";
...@@ -182,11 +145,6 @@ const handleEdit = (val) => { ...@@ -182,11 +145,6 @@ const handleEdit = (val) => {
nextTick(() => { nextTick(() => {
Object.assign(formEnergy.value, { ...val }); Object.assign(formEnergy.value, { ...val });
console.log("val:", val); console.log("val:", val);
// var newArr = []
// formEnergy.supplyId.map((item)=> {
// newArr.push(item[item.length-1])
// })
// console.log(newArr);
}); });
}; };
...@@ -200,7 +158,7 @@ const onSubmit = (formEl) => { ...@@ -200,7 +158,7 @@ const onSubmit = (formEl) => {
if (action.value === "add") { if (action.value === "add") {
await http await http
.post("api/energy/Save", { ...formEnergy.value }, false) .post("api/energy/Save", { ...formEnergy.value }, false)
.then((res) => {}) .then((res) => { })
.then((res) => { .then((res) => {
ElMessage({ ElMessage({
type: "success", type: "success",
...@@ -267,8 +225,7 @@ const getSupplys = () => { ...@@ -267,8 +225,7 @@ const getSupplys = () => {
let c = []; let c = [];
center.supplyList.forEach((supply) => { center.supplyList.forEach((supply) => {
let chi = []; let chi = [];
supply.transferList.forEach((unit) => { supply.transferList.forEach(unit => {
// chi.push({ value: unit.unitId, label: unit.unitName });
}); });
c.push({ c.push({
children: chi, children: chi,
...@@ -290,142 +247,70 @@ const getSupplys = () => { ...@@ -290,142 +247,70 @@ const getSupplys = () => {
} }
}); });
} }
}; }
onMounted(() => { onMounted(() => {
getEnergyData(); getEnergyData()
getSupplys(); getSupplys()
}); })
</script> </script>
<template> <template>
<table
class="table_search"
cellpadding="0"
cellspacing="1"
style="background-color: #99bbe8; width: 100%"
>
<tr style="height: 10px">
<th width="30%">
<span>能源类型:</span>
</th>
<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="请选择"
style="width: 360px; margin-left: 20px"
>
<el-option label="非节能" value="0" />
<el-option label="一步节能" value="1" />
<el-option label="二步节能" value="2" />
<el-option label="三步节能" value="3" />
<el-option label="四步节能" value="4" />
</el-select>
</el-form-item>
</el-form>
</div>
</th>
<th width="100%" style="background-color: #ffffff; text-align: left">
<el-button type="primary" @click="handleSearch">
<Search style="width: 1em; height: 1em; margin-right: 8px" />
查询
</el-button>
<el-button type="primary" @click="handleAdd">
<Document style="width: 1em; height: 1em; margin-right: 8px" />
新增
</el-button>
</th>
</tr>
</table>
<div class="table"> <div class="contentBlock">
<el-table <table cellpadding="0" cellspacing="1" style="background-color: #99bbe8;width: 100%;">
:data="tableData" <tr style="height: 10px;">
style="width: 100%; font-size: 12px; color: #181818" <th width="30%">
:header-cell-style="{ <span>能源类型:</span>
color: '#225475', </th>
backgroundColor: '#B8CFEE', <th width="40%" style=" background-color: #ffffff;">
'text-align': 'center', <div class="th_div">
height: '30px', <el-form ref="formRef" :model="formInline" :inline="true"
padding: '0px', style="display: flex; justify-content: center; align-items: center; margin: 0;">
border: '1px solid #99bbe8', <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;">
:cell-style="{ 'text-align': 'center', padding: '0px' }" <el-option label="非节能" value="0" />
:row-style="{ height: '30px', padding: '0px' }" <el-option label="一步节能" value="1" />
border <el-option label="二步节能" value="2" />
stripe <el-option label="三步节能" value="3" />
> <el-option label="四步节能" value="4" />
<el-table-column </el-select>
v-for="item in tableLabel" </el-form-item>
:key="item.prop" </el-form>
:width="item.width ? item.width : 150" </div>
:prop="item.prop" </th>
:label="item.label" <th width="100%" style="background-color: #ffffff;text-align: center;">
/> <el-button type="primary" @click="handleSearch">
<Search style="width: 1em; height: 1em; margin-right: 8px" />
查询
</el-button>
<el-button type="primary" @click="handleAdd">
<Document style="width: 1em; height: 1em; margin-right: 8px" />
新增
</el-button>
</th>
</tr>
</table>
<el-table :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
stripe>
<el-table-column v-for="item in tableLabel" :key="item.prop" :width="item.width ? item.width : 150"
:prop="item.prop" :label="item.label" />
<el-table-column fixed="right" label="操作" min-width="140"> <el-table-column fixed="right" label="操作" min-width="140">
<template #default="scope"> <template #default="scope">
<el-button <el-button link type="primary" size="small" @click="handleEdit(scope.row)">
link
type="primary"
size="small"
@click="handleEdit(scope.row)"
>
编辑 编辑
</el-button> </el-button>
<el-button <el-button link type="primary" size="small" @click="handleDelete(scope.row)">删除</el-button>
link
type="primary"
size="small"
@click="handleDelete(scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
<template #empty> <template #empty>
<el-empty description="暂无数据,快去添加数据吧.."></el-empty> <el-empty description="暂无数据,快去添加数据吧.."></el-empty>
</template> </template>
</el-table> </el-table>
<!-- <div class="bottom">
<div class="bottom-left" style="color: #4B4847; font-size: 12px;">
共{{ config.total }}条记录,当前为第{{ config.page }}页,共{{ parseInt(config.total / 10 + 0.9) }}页
</div>
<el-pagination background layout="prev, pager, next" next-text="下一页" class="pager" :total="total"
size="small" @current-change="handleChange" />
</div> -->
</div> </div>
<el-dialog v-model="dialogVisible" :title="action == 'add' ? '数据新增' : '数据修改'" width="50%" :before-close="handleClose">
<el-dialog <el-form :inline="true" :model="formEnergy" :rules="rules" ref="energyForm" :hide-required-asterisk="true">
v-model="dialogVisible"
:title="action == 'add' ? '数据新增' : '数据修改'"
width="50%"
:before-close="handleClose"
>
<el-form
:inline="true"
:model="formEnergy"
:rules="rules"
ref="energyForm"
:hide-required-asterisk="true"
>
<table cellpadding="0" cellspacing="1" style="background-color: #99bbe8"> <table cellpadding="0" cellspacing="1" style="background-color: #99bbe8">
<tr> <tr>
<th style="width: 25%">供热站</th> <th style="width: 25%">供热站</th>
...@@ -437,41 +322,23 @@ onMounted(() => { ...@@ -437,41 +322,23 @@ onMounted(() => {
<el-option label="东部供热站" value="DFA20074-8731-457F-B63F-4E1858CFE266" /> <el-option label="东部供热站" value="DFA20074-8731-457F-B63F-4E1858CFE266" />
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select> --> </el-select> -->
<el-form-item <el-form-item prop="supplyName" style="margin: 0; padding: 0; width: 100%">
prop="supplyName" <el-cascader :options="options" v-model="formEnergy.supplyId" :props="props" collapse-tags clearable
style="margin: 0; padding: 0; width: 100%" :show-all-levels="false" placeholder="请选择" class="el-cascader-menu" />
>
<el-cascader
:options="options"
v-model="formEnergy.supplyId"
:props="props"
collapse-tags
clearable
:show-all-levels="false"
placeholder="请选择"
class="el-cascader-menu"
/>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
<tr> <tr>
<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> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item <el-form-item prop="energyType" style="margin: 0; padding: 0; width: 100%">
prop="energyType" <el-select v-model="formEnergy.energyType" placeholder="请选择">
style="margin: 0; padding: 0; width: 100%"
>
<el-select
v-model="formEnergy.energyType"
placeholder="请选择"
>
<el-option label="非节能" :value="0" /> <el-option label="非节能" :value="0" />
<el-option label="一步节能" :value="1" /> <el-option label="一步节能" :value="1" />
<el-option label="二步节能" :value="2" /> <el-option label="二步节能" :value="2" />
...@@ -484,46 +351,29 @@ onMounted(() => { ...@@ -484,46 +351,29 @@ onMounted(() => {
</table> </table>
</td> </td>
</tr> </tr>
<tr> <tr>
<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> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form-item <el-form-item prop="record" style="margin: 0; padding: 0; width: 100%">
prop="record" <el-input v-float-number v-model="formEnergy.record" placeholder="请输入能源用度" />
style="margin: 0; padding: 0; width: 100%"
>
<el-input
v-float-number
v-model="formEnergy.record"
placeholder="请输入能源用度"
/>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
<tr> <tr>
<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> <tr>
<td> <td>
<el-form-item <el-form-item prop="recordDate" style="margin: 0; padding: 0; width: 100%">
prop="recordDate" <el-date-picker value-format="YYYY-MM-DD HH:mm:ss" v-model="formEnergy.recordDate" type="datetime"
style="margin: 0; padding: 0; width: 100%" placeholder="请输入日期" style="width: 100%" />
>
<el-date-picker
value-format="YYYY-MM-DD HH:mm:ss"
v-model="formEnergy.recordDate"
type="datetime"
placeholder="请输入日期"
style="width: 100%"
/>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -531,11 +381,8 @@ onMounted(() => { ...@@ -531,11 +381,8 @@ onMounted(() => {
</td> </td>
</tr> </tr>
</table> </table>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button type="primary" @click="handleCancel(energyForm)" <el-button type="primary" @click="handleCancel(energyForm)">关闭</el-button>
>关闭</el-button
>
<el-button type="primary" @click="onSubmit(energyForm)">保存</el-button> <el-button type="primary" @click="onSubmit(energyForm)">保存</el-button>
</div> </div>
</el-form> </el-form>
...@@ -543,22 +390,24 @@ onMounted(() => { ...@@ -543,22 +390,24 @@ onMounted(() => {
</template> </template>
<style scoped lang="less"> <style scoped lang="less">
.energy-header { .contentBlock {
display: flex; position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ffffff;
overflow: auto;
overflow-x: hidden;
} }
.select-clean { .select-clean {
display: flex; display: flex;
} }
.table {
margin-top: 10px;
margin-left: 4px;
}
.table_search { table {
width: 100%; width: 100%;
margin-left: 4px;
} }
table, table,
...@@ -586,44 +435,37 @@ table td { ...@@ -586,44 +435,37 @@ table td {
padding: 5px 10px; padding: 5px 10px;
} }
.dialog-footer { .dialog-footer {
text-align: center; text-align: center;
margin-top: 10px; margin-top: 10px;
background-color: #ffffff; background-color: #ffffff;
} }
.el-table__header th {
height: 50px;
/* 调整表头的高度 */
line-height: 50px;
/* 使文本垂直居中 */
}
.el-table__header th .cell {
font-size: 14px;
/* 调整字体大小 */
}
//鼠标所在行的颜色 //鼠标所在行的颜色
::v-deep .el-table__body tr:hover > td { ::v-deep .el-table__body tr:hover>td {
background: linear-gradient( background: linear-gradient(to top,
to top, rgb(0, 198, 255),
rgb(0, 198, 255), rgb(255, 255, 255)) !important;
rgb(255, 255, 255)
) !important;
} }
::v-deep .el-table__body tr.current-row > td { ::v-deep .el-table__body tr.current-row>td {
background-color: #92cbf1 !important; background-color: #92cbf1 !important;
} }
.el-cascader-menu { .el-cascader-menu {
width: 100%; width: 100%;
} }
// .bottom {
// // border: 1px solid red;
// margin-top: 10px;
// width: 100%;
// display: flex;
// right: 10px;
// bottom: 30px;
// justify-content: space-between;
// .bottom-left {
// display: flex;
// }
// .pager {
// display: flex;
// }
// }
</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