Commit dd2b2761 authored by jiaxu.yan's avatar jiaxu.yan

Merge branch 'master' of http://gitlab.91isoft.com:90/hikvision/web-project

# Conflicts:
#	src/views/SchedulingPage/weatherManageSub/AddWindow.vue
#	src/views/SchedulingPage/weatherManageSub/ReviseWindow.vue
parents 253e9fee 5e01974b
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
"jquery": "^3.7.1", "jquery": "^3.7.1",
"jsencrypt": "^3.3.2", "jsencrypt": "^3.3.2",
"less": "^4.2.0", "less": "^4.2.0",
"lodash": "^4.17.21",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"mock": "^0.1.1", "mock": "^0.1.1",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
......
...@@ -75,7 +75,11 @@ export const alterWeatherMagData = params => { // 添加或修改气象干预数 ...@@ -75,7 +75,11 @@ export const alterWeatherMagData = params => { // 添加或修改气象干预数
} }
export const getTransfer = param => { // 获取换热站列表 export const getTransfer = param => { // 获取换热站列表
return http.post(`/api/cusweather/getTransferIds?id=${param}`, param) return http.post("/api/cusweather/getTransferIds",param)
}
export const deleteWeatherMagData = params => { // 删除气象干预数据
return http.post("/api/cusweather/Delete",params)
} }
export const getAnnualParam = () => { // 获取年度参数列表 export const getAnnualParam = () => { // 获取年度参数列表
......
...@@ -67,8 +67,13 @@ ...@@ -67,8 +67,13 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<div class="left"> <div class="left">
<p v-for="(item,index) in cnNames_before">{{item.cnName}}</p> <el-table :data="cnNames_before" :style="{ width: '100%' }">
<el-table-column prop="cnName">
<template #default="scope">
<div @click="selectParams(scope.row)">{{ scope.row.cnName }}</div>
</template>
</el-table-column>
</el-table>
</div> </div>
</el-col> </el-col>
...@@ -82,7 +87,7 @@ ...@@ -82,7 +87,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="cnNames_before.cnName"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -178,7 +183,9 @@ ...@@ -178,7 +183,9 @@
</table> </table>
<div class="btngrounp"> <div class="btngrounp">
<el-button type="primary" @click="onDel">删除</el-button> <el-button v-if="button" type="primary" @click="onDel">添加</el-button>
<el-button v-else-if="button" type="primary" @click="onDel">删除</el-button>
<el-button v-else="button" type="primary" @click="onDel">修改</el-button>
</div> </div>
<!-- </el-card> --> <!-- </el-card> -->
</div> </div>
...@@ -186,11 +193,14 @@ ...@@ -186,11 +193,14 @@
<el-col :span="6"> <el-col :span="6">
<div class="left"> <div class="left">
<ul> <el-table :data="cnNames_after" :style="{ width: '100%' }">
<li v-for="(item,index) in cnNames_after"> <el-table-column prop="cnName">
{{item.cnName}} <template #default="scope">
</li> <div @click="selectParams(scope.row)">{{ scope.row.cnName }}</div>
</ul> </template>
</el-table-column>
</el-table>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -471,8 +481,12 @@ function getImgUrl(scope, item) { ...@@ -471,8 +481,12 @@ function getImgUrl(scope, item) {
// 报警参数设置 // 报警参数设置
let cnNames_before = reactive([{}]) let cnNames_before = reactive([{
let cnNames_after = reactive([{}]) cnName: ""
}])
let cnNames_after = reactive([{
cnName: ""
}])
const getCnNames = () => { const getCnNames = () => {
let newType = let newType =
type.value == "GetPipeAlarmStatusData" ? 1 : type.value == "GetBoilerAlarmStatusData" ? 2 : 3 type.value == "GetPipeAlarmStatusData" ? 1 : type.value == "GetBoilerAlarmStatusData" ? 2 : 3
...@@ -483,29 +497,51 @@ const getCnNames = () => { ...@@ -483,29 +497,51 @@ const getCnNames = () => {
data.then(function (val) { data.then(function (val) {
cnNames_before = val.data.before cnNames_before = val.data.before
cnNames_after = val.data.after cnNames_after = val.data.after
// console.log("@@@@",cnNames_before); // console.log("@@@@", cnNames_before);
// console.log("@@@@",cnNames_after); // console.log("@@@@",cnNames_after);
// console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId)
}); });
}
fillTable() let params = reactive([{
"pipeAlarmParaId": "",
"pipeParaBaseId": "",
"pipeId": "",
"gatherType": "",
"voicePath": "",
"isVoice": "",
"topMost": "",
"upper": "",
"lower": "",
"downMost": "",
"alarmPlan": "",
"isShortMessage": "",
"isAlarm": "",
"isActive": "",
"updateNullFields": ""
}])
}
const params = reactive([{}])
const fillTable = () => {
getCnNames()
const selectParams = (row) => {
getCnNames()
let newType = let newType =
type.value == "GetPipeAlarmStatusData" ? 1 : type.value == "GetBoilerAlarmStatusData" ? 2 : 3 type.value == "GetPipeAlarmStatusData" ? 1 : type.value == "GetBoilerAlarmStatusData" ? 2 : 3
let newAlarmInfo = AlarmInfo.value[0]; let newAlarmInfo = AlarmInfo.value[0];
const data = http.post("/api/alarm/para/GetAlarmParaInfo",{type:newType,id:newAlarmInfo,baseid:cnNames_before.transParaBaseId},false) const data = http.post("/api/alarm/para/GetAlarmParaInfo", { type: newType, id: newAlarmInfo, baseid: row.transParaBaseId }, false)
console.log(data); // console.log(data);
} data.then(function (val) {
params = val.data
console.log("Params:", params);
});
getCnNames() }
// 按钮
const button = ref(false)
onMounted(() => { onMounted(() => {
...@@ -632,7 +668,7 @@ table td { ...@@ -632,7 +668,7 @@ table td {
.left { .left {
// border: 1px solid red; // border: 1px solid red;
overflow: auto; overflow: auto;
height: 800px; height: 400px;
border-top: 1px solid #eff1f4; border-top: 1px solid #eff1f4;
border-bottom: 1px solid #eff1f4; border-bottom: 1px solid #eff1f4;
padding: 0px 30px 11px 27px; padding: 0px 30px 11px 27px;
......
...@@ -173,13 +173,16 @@ ...@@ -173,13 +173,16 @@
options.length = 0; options.length = 0;
PatrolInfo.Id.length = 0; PatrolInfo.Id.length = 0;
var result = store.getters.getEnterprise(); var result = store.getters.getEnterprise();
console.log("result的值:",result)
if (result) { if (result) {
result.forEach(element=>{ result.forEach(element=>{
if(element.enterpriseId=== enterpriseId.value){ if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){ if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{ element.serviceCenterList.forEach(center=>{
let c = []; let c = [];
center.supplyList.forEach(supply => { center.supplyList.forEach(supply => {
// console.log("suppleList",supply)
let chi = []; let chi = [];
supply.transferList.forEach(unit => { supply.transferList.forEach(unit => {
chi.push({ value: unit.unitId, label: unit.unitName }); chi.push({ value: unit.unitId, label: unit.unitName });
......
...@@ -3,6 +3,7 @@ import {computed, onMounted, reactive, ref} from "vue"; ...@@ -3,6 +3,7 @@ import {computed, onMounted, reactive, ref} from "vue";
import {zhCn} from "element-plus/es/locale/index"; import {zhCn} from "element-plus/es/locale/index";
import {getAnnualParam, alterAnnualParam, addAnnualParam, deleteAnnualParam} from '@/api/scheduling.js' import {getAnnualParam, alterAnnualParam, addAnnualParam, deleteAnnualParam} from '@/api/scheduling.js'
import {ElMessage, ElMessageBox} from "element-plus"; import {ElMessage, ElMessageBox} from "element-plus";
import {vFloatNumber} from "@/utils/directives.js";
const data = ref() const data = ref()
const dataBackup = ref([]) const dataBackup = ref([])
...@@ -217,31 +218,31 @@ function resetInput() { ...@@ -217,31 +218,31 @@ function resetInput() {
<el-row> <el-row>
<el-col :span="8" col-label>标准:</el-col> <el-col :span="8" col-label>标准:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="reviseForm.standard" placeholder="" style="width: 370px"/> <el-input v-float-number v-model="reviseForm.standard" placeholder="" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" col-label>度日数标定值:</el-col> <el-col :span="8" col-label>度日数标定值:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="reviseForm.degreeStandard" style="width: 370px"/> <el-input v-float-number v-model="reviseForm.degreeStandard" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" col-label>室内温度:</el-col> <el-col :span="8" col-label>室内温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="reviseForm.indoorTemperature" style="width: 370px"/> <el-input v-float-number v-model="reviseForm.indoorTemperature" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" col-label>室外温度:</el-col> <el-col :span="8" col-label>室外温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="reviseForm.outdoorTemperature" style="width: 370px"/> <el-input v-float-number v-model="reviseForm.outdoorTemperature" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" col-label>回水温度:</el-col> <el-col :span="8" col-label>回水温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="reviseForm.backWaterTemperature" style="width: 370px"/> <el-input v-float-number v-model="reviseForm.backWaterTemperature" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
...@@ -282,31 +283,31 @@ function resetInput() { ...@@ -282,31 +283,31 @@ function resetInput() {
<el-row> <el-row>
<el-col :span="8" col-label>标准:</el-col> <el-col :span="8" col-label>标准:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="addForm.standard" placeholder="" style="width: 370px"/> <el-input v-float-number v-model="addForm.standard" placeholder="" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" col-label>度日数标定值:</el-col> <el-col :span="8" col-label>度日数标定值:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="addForm.degreeStandard" style="width: 370px"/> <el-input v-float-number v-model="addForm.degreeStandard" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" col-label>室内温度:</el-col> <el-col :span="8" col-label>室内温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="addForm.indoorTemperature" style="width: 370px"/> <el-input v-float-number v-model="addForm.indoorTemperature" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" col-label>室外温度:</el-col> <el-col :span="8" col-label>室外温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="addForm.outdoorTemperature" style="width: 370px"/> <el-input v-float-number v-model="addForm.outdoorTemperature" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" col-label>回水温度:</el-col> <el-col :span="8" col-label>回水温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="addForm.backWaterTemperature" style="width: 370px"/> <el-input v-float-number v-model="addForm.backWaterTemperature" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
......
...@@ -2,22 +2,15 @@ ...@@ -2,22 +2,15 @@
<div class="contentBlock"> <div class="contentBlock">
<div class="contentBlockInn"> <div class="contentBlockInn">
<el-card class="card-contianer"> <el-card class="card-contianer">
<table <table cellpadding="0" cellspacing="1" style="background-color: #99bbe8">
cellpadding="0"
cellspacing="1"
style="background-color: #99bbe8"
>
<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-input <el-input v-float-number style="width: 80%; text-align: left"
v-float-number v-model="formDatas.openingOfElectricValve">
style="width: 80%; text-align: left"
v-model="formDatas.openingOfElectricValve"
>
<template #append> <template #append>
<div style="width: 40px">%</div> <div style="width: 40px">%</div>
</template> </template>
...@@ -31,22 +24,21 @@ ...@@ -31,22 +24,21 @@
<tr> <tr>
<th style="width: 25%">换热站</th> <th style="width: 25%">换热站</th>
<td style="text-align: left"> <td style="text-align: left">
<!-- <el-checkbox-group v-model="form.type" style="width: 60%;"> <!-- <el-checkbox-group v-model="formDatas.transferIds" style="width: 60%;">
<el-checkbox v-for="(option, index) in options" :key="index" :label="option"> <el-checkbox v-for="(option, index) in options" :key="index" :label="option" :value="options.value">
{{ option }} {{ option.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> --> </el-checkbox-group> -->
<el-checkbox-group <!-- <el-checkbox-group v-model="checkList" style="width: 60%;">
v-model="formDatas.transferIds" <el-checkbox v-for="(option, index) in options" :key="index" :label="option" :value="option.value">
style="width: 60%" {{ option.label }}
> </el-checkbox> -->
<el-checkbox <el-checkbox-group v-model="formDatas.transferIds" style="width: 60%">
v-for="(option, index) in options" <el-checkbox v-for="(option, index) in options" :label="option.value" :key="index">
:label="option.value"
:key="index"
>
{{ option.label }} {{ option.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</td> </td>
</tr> </tr>
...@@ -57,11 +49,7 @@ ...@@ -57,11 +49,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 <el-input v-float-number style="width: 80%" v-model="formDatas.boilerOutletWaterTemperature">
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>
...@@ -79,11 +67,7 @@ ...@@ -79,11 +67,7 @@
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-form> <el-form>
<el-input <el-input v-float-number style="width: 80%" v-model="formDatas.holdingTime">
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>
...@@ -101,11 +85,7 @@ ...@@ -101,11 +85,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 <el-input v-float-number style="width: 80%" v-model="formDatas.upperLlimitMainFlow">
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>
...@@ -122,11 +102,7 @@ ...@@ -122,11 +102,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 <el-input v-float-number style="width: 80%" v-model="formDatas.lowerLlimitMainFlow">
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>
...@@ -142,11 +118,7 @@ ...@@ -142,11 +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-input <el-input v-float-number style="width: 80%" v-model="formDatas.maxTargetTemperature">
v-float-number
style="width: 80%"
v-model="formDatas.maxTargetTemperature"
>
<template #append> <template #append>
<div style="width: 40px"></div> <div style="width: 40px"></div>
</template> </template>
...@@ -163,11 +135,7 @@ ...@@ -163,11 +135,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 <el-input v-float-number style="width: 80%" v-model="formDatas.bestHoldingTime">
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>
...@@ -183,9 +151,7 @@ ...@@ -183,9 +151,7 @@
<div> <div>
<div class="btngrounp"> <div class="btngrounp">
<el-button type="primary" @click="onSave">保存</el-button> <el-button type="primary" @click="onSave">保存</el-button>
<el-button type="primary" style="margin: 0 0 0 5px" <el-button type="primary" style="margin: 0 0 0 5px">关闭</el-button>
>关闭</el-button
>
</div> </div>
</div> </div>
</th> </th>
...@@ -227,7 +193,7 @@ const getListData = () => { ...@@ -227,7 +193,7 @@ const getListData = () => {
lock: true, lock: true,
text: "获取数据中", text: "获取数据中",
background: "rgba(0, 0, 0, 0.7)", background: "rgba(0, 0, 0, 0.7)",
}); });
http.get("/api/configboiler/getData").then((result) => { http.get("/api/configboiler/getData").then((result) => {
formDatas.value = result.data; formDatas.value = result.data;
...@@ -241,7 +207,7 @@ const onSave = async () => { ...@@ -241,7 +207,7 @@ const onSave = async () => {
lock: true, lock: true,
text: "保存数据中", text: "保存数据中",
background: "rgba(0, 0, 0, 0.7)", background: "rgba(0, 0, 0, 0.7)",
}); });
formDatas.value.transferIds = formDatas.value.transferIds.join(","); formDatas.value.transferIds = formDatas.value.transferIds.join(",");
const result = await postConfigBoilerUpdate({ ...formDatas.value }); const result = await postConfigBoilerUpdate({ ...formDatas.value });
...@@ -279,7 +245,7 @@ function getSupplys() { ...@@ -279,7 +245,7 @@ function getSupplys() {
} }
}); });
} }
console.log(options); console.log("组长遍历的options:", options);
} }
onMounted(() => { onMounted(() => {
getListData(); getListData();
...@@ -299,6 +265,7 @@ onMounted(() => { ...@@ -299,6 +265,7 @@ onMounted(() => {
table { table {
width: 100%; width: 100%;
.el-input__inner { .el-input__inner {
text-align: left !important; text-align: left !important;
} }
......
...@@ -7,6 +7,7 @@ import { postEnergyManage, postEnergyDel, postEnergyUpdate } from "@/api/schedul ...@@ -7,6 +7,7 @@ import { postEnergyManage, postEnergyDel, postEnergyUpdate } from "@/api/schedul
import http from '../../api/http' import http from '../../api/http'
import loading from 'element-plus' import loading from 'element-plus'
import store from '../../store' import store from '../../store'
import { vFloatNumber } from "@/utils/directives.js";
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const tableData = ref([{}]) const tableData = ref([{}])
const formEnergy = ref({ const formEnergy = ref({
...@@ -15,7 +16,7 @@ const formEnergy = ref({ ...@@ -15,7 +16,7 @@ const formEnergy = ref({
"energyType": "", "energyType": "",
"record": "", "record": "",
"recordDate": "", "recordDate": "",
"energyName":'' "energyName": ''
}) })
const energyForm = ref() const energyForm = ref()
const dialogVisible = ref(false) const dialogVisible = ref(false)
...@@ -138,11 +139,11 @@ const handleDelete = async (row) => { ...@@ -138,11 +139,11 @@ const handleDelete = async (row) => {
type: 'warning', type: 'warning',
confirmButtonClass: 'ExitConfirmButton' confirmButtonClass: 'ExitConfirmButton'
}) })
const res = await http.get("api/energy/Delete",{params:{EnergyId:row.energyId}}, false) const res = await http.get("api/energy/Delete", { params: { EnergyId: row.energyId } }, false)
if(res.success) { if (res.success) {
ElMessage.success("删除成功") ElMessage.success("删除成功")
getEnergyData() getEnergyData()
}else { } else {
ElMessage.error("删除失败") ElMessage.error("删除失败")
} }
} }
...@@ -174,7 +175,7 @@ const handleEdit = (val) => { ...@@ -174,7 +175,7 @@ const handleEdit = (val) => {
dialogVisible.value = true dialogVisible.value = true
nextTick(() => { nextTick(() => {
Object.assign(formEnergy.value, { ...val }) Object.assign(formEnergy.value, { ...val })
console.log("val:",val); console.log("val:", val);
// var newArr = [] // var newArr = []
// formEnergy.supplyId.map((item)=> { // formEnergy.supplyId.map((item)=> {
// newArr.push(item[item.length-1]) // newArr.push(item[item.length-1])
...@@ -220,7 +221,7 @@ const onSubmit = () => { ...@@ -220,7 +221,7 @@ const onSubmit = () => {
} }
}) })
} }
const props = { multiple: false, emitPath: false,checkStrictly: true } const props = { multiple: false, emitPath: false, checkStrictly: true }
const enterpriseId = ref(); const enterpriseId = ref();
let supplyIdOptions = reactive([]) let supplyIdOptions = reactive([])
getEnterprise(); getEnterprise();
...@@ -400,7 +401,7 @@ onMounted(() => { ...@@ -400,7 +401,7 @@ onMounted(() => {
<tr> <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-model="formEnergy.record" placeholder="请输入能源用度" /> <el-input v-float-number v-model="formEnergy.record" placeholder="请输入能源用度" />
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,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="List.diffPercentage"></el-input> <el-input v-float-number style="width: 80%" v-model="List.diffPercentage"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,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="List.tempRegulation"></el-input> <el-input v-float-number style="width: 80%" v-model="List.tempRegulation"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -93,6 +93,7 @@ import { postInstantHeat, postInstantHeatUpdate } from "@/api/scheduling" ...@@ -93,6 +93,7 @@ import { postInstantHeat, postInstantHeatUpdate } from "@/api/scheduling"
import { toRaw } from "@vue/reactivity"; import { toRaw } from "@vue/reactivity";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import http from "../../api/http"; import http from "../../api/http";
import { vFloatNumber } from "@/utils/directives.js";
const loading = ref(false) const loading = ref(false)
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import {onMounted, ref} from "vue"; import {onMounted, ref} from "vue";
import {ElMessage, ElMessageBox} from "element-plus"; import {ElMessage, ElMessageBox} from "element-plus";
import {getPhenomenon,addPhenomenon,alterPhenomenon,deletePhenomenon} from "@/api/scheduling.js" import {getPhenomenon,addPhenomenon,alterPhenomenon,deletePhenomenon} from "@/api/scheduling.js"
import {vFloatNumber} from "@/utils/directives.js";
const data = ref() const data = ref()
const dataBackup = ref([]) const dataBackup = ref([])
...@@ -175,7 +176,7 @@ function getData(){ ...@@ -175,7 +176,7 @@ function getData(){
<el-row> <el-row>
<el-col :span="8" col-label>对应温度:</el-col> <el-col :span="8" col-label>对应温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="reviseForm.phenomenonTemp" placeholder="" style="width: 370px"/> <el-input v-float-number v-model="reviseForm.phenomenonTemp" placeholder="" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -221,7 +222,7 @@ function getData(){ ...@@ -221,7 +222,7 @@ function getData(){
<el-row> <el-row>
<el-col :span="8" col-label>对应温度:</el-col> <el-col :span="8" col-label>对应温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="addForm.phenomenonTemp" placeholder="" style="width: 370px"/> <el-input v-float-number v-model="addForm.phenomenonTemp" placeholder="" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
......
...@@ -2,9 +2,12 @@ ...@@ -2,9 +2,12 @@
import {computed, isRef, onMounted, reactive, ref, shallowRef} from "vue"; import {computed, isRef, onMounted, reactive, ref, shallowRef} from "vue";
import ReviseWindow from "./weatherManageSub/ReviseWindow.vue"; import ReviseWindow from "./weatherManageSub/ReviseWindow.vue";
import BindWindow from "./weatherManageSub/BindWindow.vue"; import BindWindow from "./weatherManageSub/BindWindow.vue";
import {getWeatherMagData, alterWeatherMagData, getTransfer} from '@/api/scheduling.js' import {getWeatherMagData, alterWeatherMagData, deleteWeatherMagData} from '@/api/scheduling.js'
import AddWindow from "./weatherManageSub/AddWindow.vue"; import AddWindow from "./weatherManageSub/AddWindow.vue";
import {ElMessage} from "element-plus"; import {ElMessage, ElMessageBox} from "element-plus";
import store from "@/store/index.js";
import cloneDeep from 'lodash/cloneDeep'
import {vFloatNumber} from "@/utils/directives.js";
const data = ref() const data = ref()
const reviseWindowOpen = ref(false) // 修改按钮弹窗状态 const reviseWindowOpen = ref(false) // 修改按钮弹窗状态
...@@ -27,22 +30,30 @@ const bind = (row) => { // 绑定按钮单击事件 ...@@ -27,22 +30,30 @@ const bind = (row) => { // 绑定按钮单击事件
bindWindowOpen.value = true bindWindowOpen.value = true
} }
const confirmRevise = val => { // 修改弹窗确认按钮事件 const confirmRevise = val => { // 修改弹窗确认按钮事件
console.log('修改数据',val) let params = cloneDeep(val)
// alterWeatherMagData(val).then(res=>{ params.isAuto = params.isAuto === '自动模式' ? true : false
// getData() params.isFixed = params.isFixed === '固定模式' ? true : false
// reviseWindowOpen.value = false params.operateTime = getCurrentDateTime()
// ElMessage({ if(params.supplyId === ''){
// message: '修改成功.', delete params.supplyId // 移除supplyId属性
// type: 'success', // 该属性要么有一个正确的值,要么移除,否则报错
// }) }
// }).catch(err=>{ alterWeatherMagData(params).then(res=>{
// ElMessage({ getData()
// message: '修改失败.', reviseWindowOpen.value = false
// type: 'error', ElMessage({
// }) message: '修改成功.',
// }) type: 'success',
})
}).catch(err=>{
ElMessage({
message: '修改失败.',
type: 'error',
})
})
} }
const confirmBind = val => { const confirmBind = val => {
// 绑定,新增,和修改用的是同一个接口
bindWindowOpen.value = false bindWindowOpen.value = false
} }
onMounted(() => { onMounted(() => {
...@@ -51,7 +62,7 @@ onMounted(() => { ...@@ -51,7 +62,7 @@ onMounted(() => {
function getData() { function getData() {
getWeatherMagData().then(res => { getWeatherMagData().then(res => {
data.value = res.data data.value = res.data
console.log("所有数据",data.value) console.log("气象干预所有数据",data.value)
}) })
} }
function handleAddWinOpenClose(){ function handleAddWinOpenClose(){
...@@ -73,18 +84,28 @@ function handleAdd(val){ ...@@ -73,18 +84,28 @@ function handleAdd(val){
}) })
}) })
} // 新增数据提交 } // 新增数据提交
function getCurrentDateTime() {
const now = new Date();
const year = now.getFullYear();
const month = ('0' + (now.getMonth() + 1)).slice(-2); // 月份从0开始,所以加1
const day = ('0' + now.getDate()).slice(-2);
const hours = ('0' + now.getHours()).slice(-2);
const minutes = ('0' + now.getMinutes()).slice(-2);
const seconds = ('0' + now.getSeconds()).slice(-2);
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
} // 生成时间
</script> </script>
<template> <template>
<div class="weather-manage-container"> <div class="weather-manage-container">
<el-row> <el-row>
<el-col :span="15" left-col> <el-col :span="15" left-col>
<el-button type="primary" @click="addWindowOpen = true" class="add-btn">新增</el-button>
<el-button type="primary" @click="getData">查询</el-button>
</el-col> </el-col>
<el-col :span="9" right-col> <el-col :span="9" right-col>
<el-button type="primary" @click="addWindowOpen = true" class="add-btn">新增</el-button>
<!-- <el-button type="primary" class="add-btn">新增</el-button>-->
<el-button type="primary">查询</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div class="table-wrapper"> <div class="table-wrapper">
...@@ -93,12 +114,13 @@ function handleAdd(val){ ...@@ -93,12 +114,13 @@ function handleAdd(val){
stripe stripe
border border
style="width: 100%" style="width: 100%"
height="900px"
:header-cell-class-name="tableHeaderClass" :header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass"> :row-class-name="tableBodyClass">
<el-table-column prop="allowPagingId" label="编号" align="center" width="60"/> <el-table-column prop="allowPagingId" label="编号" align="center" width="60"/>
<el-table-column prop="customizeName" label="自定义名称" width="200"/> <el-table-column prop="customizeName" sortable label="自定义名称" width="200"/>
<el-table-column prop="supplyName" label="供热站名称" width="160"/> <el-table-column prop="supplyName" sortable label="供热站名称" width="160"/>
<el-table-column prop="operateTime" label="操作时间" width="210"/> <el-table-column prop="operateTime" sortable label="操作时间" width="210"/>
<el-table-column prop="isFixed" label="干预模式" width="120"/> <el-table-column prop="isFixed" label="干预模式" width="120"/>
<el-table-column prop="temperature" label="温度" width="60"/> <el-table-column prop="temperature" label="温度" width="60"/>
<el-table-column prop="wind" label="风速" width="60"/> <el-table-column prop="wind" label="风速" width="60"/>
...@@ -107,8 +129,8 @@ function handleAdd(val){ ...@@ -107,8 +129,8 @@ function handleAdd(val){
<el-table-column prop="diffPercentage" label="自动偏差百分比" width="170"/> <el-table-column prop="diffPercentage" label="自动偏差百分比" width="170"/>
<el-table-column prop="timeoutMin" label="验证时间" width="100"/> <el-table-column prop="timeoutMin" label="验证时间" width="100"/>
<el-table-column prop="tempRegulation" label="调节温度" width="100"/> <el-table-column prop="tempRegulation" label="调节温度" width="100"/>
<el-table-column prop="sort" sortable label="排序" width="60"/> <el-table-column prop="sort" label="排序" width="60"/>
<el-table-column label="操作" width="200"> <el-table-column label="操作" fixed="right" width="200">
<template #default="scope"> <template #default="scope">
<div class="table-operate-column"> <div class="table-operate-column">
<el-button link @click="revise(scope.row)" type="primary">修改</el-button> <el-button link @click="revise(scope.row)" type="primary">修改</el-button>
...@@ -163,6 +185,7 @@ function handleAdd(val){ ...@@ -163,6 +185,7 @@ function handleAdd(val){
.add-btn { .add-btn {
margin: 5px 0; margin: 5px 0;
margin-left: 10px;
} }
:deep(.table-header-class) { :deep(.table-header-class) {
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
import {onMounted, ref, watch, watchEffect} from "vue"; import {onMounted, ref, watch, watchEffect} from "vue";
import {ElMessage, ElMessageBox} from "element-plus"; import {ElMessage, ElMessageBox} from "element-plus";
import {getWind, deleteWind, alterWind, addWind} from "@/api/scheduling.js" import {getWind, deleteWind, alterWind, addWind} from "@/api/scheduling.js"
import store from "@/store/index.js";
import {vFloatNumber} from "@/utils/directives.js";
const data = ref() const data = ref()
const dataBackup = ref([]) const dataBackup = ref([])
...@@ -94,6 +96,7 @@ function onAddSubmit() { ...@@ -94,6 +96,7 @@ function onAddSubmit() {
onMounted(() => { onMounted(() => {
getData() getData()
}) })
function getData() { function getData() {
...@@ -165,7 +168,7 @@ function resetInput() { ...@@ -165,7 +168,7 @@ function resetInput() {
<el-row> <el-row>
<el-col :span="8" col-label>对应温度:</el-col> <el-col :span="8" col-label>对应温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="reviseForm.windTemp" placeholder="" style="width: 370px"/> <el-input v-float-number v-model="reviseForm.windTemp" placeholder="" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -199,7 +202,7 @@ function resetInput() { ...@@ -199,7 +202,7 @@ function resetInput() {
<el-row> <el-row>
<el-col :span="8" col-label>对应温度:</el-col> <el-col :span="8" col-label>对应温度:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-input v-model="addForm.windTemp" placeholder="" style="width: 370px"/> <el-input v-float-number v-model="addForm.windTemp" placeholder="" style="width: 370px"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
......
<script setup> <script setup>
import { import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect} from "vue";
ref, import {vFloatNumber} from "@/utils/directives.js";
defineProps,
defineEmits,
computed,
isRef,
onMounted,
watchEffect,
} from "vue";
import { vFloatNumber } from "@/utils/directives.js";
const props = defineProps({ const props = defineProps({
open: { open: {
type: Boolean, type: Boolean,
default: false, default: false,
required: true, required: true
}, }
}); })
const emit = defineEmits(["onCancel", "onConfirm"]); const emit = defineEmits(['onCancel','onConfirm'])
const addData = ref({ const addData = ref({
transfers: [], // 换热站 transfers:[], // 换热站
customizeName: "", // 自定义名称 customizeName: '', // 自定义名称
diffPercentage: "", // 自动偏差百分比 diffPercentage: '', // 自动偏差百分比
illumination: "", // 光照 illumination: '', // 光照
isAuto: false, // 是否自动模式 isAuto: false, // 是否自动模式
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式 isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
operateTime: "", // 操作时间 operateTime:"", // 操作时间
sort: "", // 排序 sort: '', // 排序
tempRegulation: "", // 自动调节温度 tempRegulation: '', // 自动调节温度
temperature: "", // 温度 temperature: '', // 温度
timeoutMin: "", // 自动验证循环时间 timeoutMin: '', // 自动验证循环时间
wind: "", // 风速 wind: '', // 风速
description: null, // 排序字段,全为Null description: null, // 排序字段,全为Null
updateNullFields: "", // 无用,但不为空 updateNullFields:"", // 无用,但不为空
isActive: false, // 是否启用 isActive:false, // 是否启用
}); })
const inputStyle = { const inputStyle = {
color: "black", color: 'black',
height: "24px", height: '24px'
}; }
function handleClose() { function handleClose() {
resetInput(); resetInput()
emit("onCancel"); emit('onCancel')
} }
function handleConfirm() { function handleConfirm() {
addData.value.operateTime = getCurrentDateTime(); addData.value.operateTime = getCurrentDateTime()
emit("onConfirm", addData.value); emit('onConfirm',addData.value)
resetInput(); resetInput()
} }
function getCurrentDateTime() { function getCurrentDateTime() {
const now = new Date(); const now = new Date();
const year = now.getFullYear(); const year = now.getFullYear();
const month = ("0" + (now.getMonth() + 1)).slice(-2); // 月份从0开始,所以加1 const month = ('0' + (now.getMonth() + 1)).slice(-2); // 月份从0开始,所以加1
const day = ("0" + now.getDate()).slice(-2); const day = ('0' + now.getDate()).slice(-2);
const hours = ("0" + now.getHours()).slice(-2); const hours = ('0' + now.getHours()).slice(-2);
const minutes = ("0" + now.getMinutes()).slice(-2); const minutes = ('0' + now.getMinutes()).slice(-2);
const seconds = ("0" + now.getSeconds()).slice(-2); const seconds = ('0' + now.getSeconds()).slice(-2);
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
} // 生成时间 } // 生成时间
function resetInput() { function resetInput(){
addData.value = { addData.value={
transfers: [], // 换热站 transfers:[], // 换热站
customizeName: "", // 自定义名称 customizeName: '', // 自定义名称
diffPercentage: "", // 自动偏差百分比 diffPercentage: '', // 自动偏差百分比
illumination: "", // 光照 illumination: '', // 光照
isAuto: false, // 是否自动模式 isAuto: false, // 是否自动模式
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式 isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
operateTime: "", // 操作时间 operateTime:"", // 操作时间
sort: "", // 排序 sort: '', // 排序
tempRegulation: "", // 自动调节温度 tempRegulation: '', // 自动调节温度
temperature: "", // 温度 temperature: '', // 温度
timeoutMin: "", // 自动验证循环时间 timeoutMin: '', // 自动验证循环时间
wind: "", // 风速 wind: '', // 风速
description: null, // 排序字段,全为Null description: null, // 排序字段,全为Null
updateNullFields: "", // 无用,但不为空 updateNullFields:"", // 无用,但不为空
isActive: false, // 是否启用 isActive:false, // 是否启用
}; }
} }
</script> </script>
...@@ -84,120 +77,66 @@ function resetInput() { ...@@ -84,120 +77,66 @@ function resetInput() {
v-model="props.open" v-model="props.open"
width="1000px" width="1000px"
title="新增" title="新增"
@close="emit('onCancel')" @close="emit('onCancel')">
>
<template #default> <template #default>
<div class="dialog-content"> <div class="dialog-content">
<el-row style="border-top: #a6c3e9 1px solid"> <el-row style="border-top: #a6c3e9 1px solid">
<el-col :span="8" class="content-col-label">自定义名称:</el-col> <el-col :span="8" class="content-col-label">自定义名称:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input :input-style="inputStyle" v-model="addData.customizeName" style="width: 510px"/>
:input-style="inputStyle"
v-model="addData.customizeName"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">干预模式:</el-col> <el-col :span="8" class="content-col-label">干预模式:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-radio-group v-model="addData.isFixed"> <el-radio-group v-model="addData.isFixed">
<el-radio :value="true" :style="{ marginLeft: '10px' }" <el-radio :value="true" :style="{marginLeft:'10px'}">固定模式</el-radio>
>固定模式</el-radio <el-radio :value="false" :style="{marginLeft:'-15px'}">气象仪模式</el-radio>
>
<el-radio :value="false" :style="{ marginLeft: '-15px' }"
>气象仪模式</el-radio
>
</el-radio-group> </el-radio-group>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">温度:</el-col> <el-col :span="8" class="content-col-label">温度:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input v-float-number :input-style="inputStyle" v-model="addData.temperature" style="width: 510px"/>
:input-style="inputStyle"
v-float-number
v-model="addData.temperature"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">风速:</el-col> <el-col :span="8" class="content-col-label">风速:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input :input-style="inputStyle" v-model="addData.wind" style="width: 510px"/>
:input-style="inputStyle"
v-float-number
v-model="addData.wind"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">光照:</el-col> <el-col :span="8" class="content-col-label">光照:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input :input-style="inputStyle" v-model="addData.illumination" style="width: 510px"/>
:input-style="inputStyle"
v-float-number
v-model="addData.illumination"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">排序:</el-col> <el-col :span="8" class="content-col-label">排序:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input :input-style="inputStyle" v-model="addData.sort" style="width: 510px"/>
:input-style="inputStyle"
v-float-number
v-model="addData.sort"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="5" class="content-col-label">切换自动模式:</el-col> <el-col :span="5" class="content-col-label">切换自动模式:</el-col>
<el-col :span="7" class="content-col-value"> <el-col :span="7" class="content-col-value">
<el-checkbox <el-checkbox :style="{marginLeft:'10px'}" v-model="addData.isAuto" label="自动模式"/>
:style="{ marginLeft: '10px' }"
v-model="addData.isAuto"
label="自动模式"
/>
</el-col> </el-col>
<el-col :span="5" class="content-col-label" <el-col :span="5" class="content-col-label">自动偏差百分比(%d):</el-col>
>自动偏差百分比(%d):</el-col
>
<el-col :span="7" class="content-col-value"> <el-col :span="7" class="content-col-value">
<el-input <el-input v-float-number :input-style="inputStyle" v-model="addData.diffPercentage" style="width: 240px"/>
:input-style="inputStyle"
v-float-number
v-model="addData.diffPercentage"
style="width: 240px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="5" class="content-col-label" <el-col :span="5" class="content-col-label">自动验证循环时间(分钟):</el-col>
>自动验证循环时间(分钟):</el-col
>
<el-col :span="7" class="content-col-value"> <el-col :span="7" class="content-col-value">
<el-input <el-input v-float-number :input-style="inputStyle" v-model="addData.timeoutMin" style="width: 240px"/>
:input-style="inputStyle"
v-float-number
v-model="addData.timeoutMin"
style="width: 240px"
/>
</el-col> </el-col>
<el-col :span="5" class="content-col-label" <el-col :span="5" class="content-col-label">自动调节温度(℃):</el-col>
>自动调节温度(℃):</el-col
>
<el-col :span="7" class="content-col-value"> <el-col :span="7" class="content-col-value">
<el-input <el-input v-float-number :input-style="inputStyle" v-model="addData.tempRegulation" style="width: 240px"/>
:input-style="inputStyle"
v-float-number
v-model="addData.tempRegulation"
style="width: 240px"
/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
...@@ -212,6 +151,7 @@ function resetInput() { ...@@ -212,6 +151,7 @@ function resetInput() {
</template> </template>
<style scoped> <style scoped>
.el-row { .el-row {
color: black; color: black;
height: 35px; height: 35px;
...@@ -239,10 +179,10 @@ function resetInput() { ...@@ -239,10 +179,10 @@ function resetInput() {
.el-input { .el-input {
color: black; color: black;
} }
.el-radio { .el-radio{
color: black; color: black;
} }
.el-checkbox { .el-checkbox{
color: black; color: black;
} }
</style> </style>
\ No newline at end of file
<script setup> <script setup>
import {ref, defineProps, defineEmits, watchEffect, onMounted} from "vue"; import {ref, defineProps, defineEmits, watchEffect, onMounted, reactive} from "vue";
import http from "@/api/http.js"; import {getTransfer} from "@/api/scheduling.js"
import store from "@/store/index.js"; import store from "@/store/index.js";
import cloneDeep from 'lodash/cloneDeep'
const props = defineProps({ const props = defineProps({
open: { open: {
...@@ -23,17 +24,15 @@ const emit = defineEmits({ ...@@ -23,17 +24,15 @@ const emit = defineEmits({
}) })
const bindData = ref({}) const bindData = ref({})
watchEffect(()=>{ watchEffect(()=>{
bindData.value = {...props.data} // bindData.value = {...props.data}
bindData.value = cloneDeep(props.data) // 深拷贝数据
}) })
const inputStyle = { const inputStyle = {
color: 'black', color: 'black',
height: '24px' height: '24px'
} }
const heatingStationList = ref([ const supplyData = ref([]) // 供热站数据
'行政区供热站', const transferData = ref([]) // 换热站数据
'二号供热站',
'三号供热站'
]) // 供热站列表
const heatExchangeList = ref([ const heatExchangeList = ref([
'兴安里', '兴安里',
'永明里', '永明里',
...@@ -55,12 +54,32 @@ const heatExchangeList = ref([ ...@@ -55,12 +54,32 @@ const heatExchangeList = ref([
'振业里' '振业里'
]) // 换热站列表 ]) // 换热站列表
onMounted(()=>{ onMounted(()=>{
// let result = store.getters.getEnterprise() getSupply()
// console.log("绑定窗口挂载",result) getTransferData()
}) })
const onSubmit = ()=>{ const onSubmit = ()=>{
emit('onConfirm', bindData) emit('onConfirm', bindData)
} // 点击保存按钮 } // 点击保存按钮
function getTransferData(){ // 获取绑定换热站数据,若在onMounted中无法调用失败(id可能为空),则在opOpen时操作
let param = {
id: bindData.value.customizeId
}
getTransfer(param).then(res=>{
transferData.value = res.data
})
}
function getSupply(){
let result = store.getters.getEnterprise()
result[0].serviceCenterList.forEach(fir_item =>{
fir_item.supplyList.forEach(sec_item=>{
supplyData.value.push({
supplyId: sec_item.supplyId,
supplyName: sec_item.supplyName,
})
})
})
}
</script> </script>
<template> <template>
...@@ -80,8 +99,8 @@ const onSubmit = ()=>{ ...@@ -80,8 +99,8 @@ const onSubmit = ()=>{
<el-row class="not-select-row"> <el-row class="not-select-row">
<el-col :span="8" class="content-col-label">供热站:</el-col> <el-col :span="8" class="content-col-label">供热站:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-select v-model="bindData.supplyName" placeholder="" style="width: 210px;" class="custom-select" size="small"> <el-select v-model="bindData.supplyId" placeholder="" style="width: 210px;" class="custom-select" size="small">
<el-option v-for="item in heatingStationList" :key="item" :label="item" :value="item"/> <el-option v-for="item in supplyData" :key="item.supplyId" :label="item.supplyName" :value="item.supplyId"/> <!--此处还需考虑-->
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
......
<script setup> <script setup>
import { vFloatNumber } from "@/utils/directives.js"; import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect} from "vue";
import { import cloneDeep from 'lodash/cloneDeep'
ref, import {vFloatNumber} from "@/utils/directives.js";
defineProps,
defineEmits,
computed,
isRef,
onMounted,
watchEffect,
} from "vue";
const props = defineProps({ const props = defineProps({
open: { open: {
type: Boolean, type: Boolean,
default: false, default: false,
required: true, required: true
}, },
data: { data: {
type: Object, type: Object,
default: {}, default: {},
required: true, required:true
}, }
}); })
const emit = defineEmits({ const emit = defineEmits({
onCancel: null, onCancel: null,
onConfirm: (data) => { onConfirm: data => {
return true; return true
}, }
}); })
const reviseData = ref({}); const reviseData = ref({})
watchEffect(() => { watchEffect(()=>{
reviseData.value = { ...props.data }; // reviseData.value = {...props.data}
}); props.data.transfers = []
props.data.updateNullFields = ''
reviseData.value = cloneDeep(props.data) // 深拷贝数据
})
const inputStyle = { const inputStyle = {
color: "black", color: 'black',
height: "24px", height: '24px'
}; }
const switchingisAuto = computed({ const switchingisAuto = computed({
get() { get() {
return reviseData.value.isAuto === "自动模式"; return reviseData.value.isAuto === '自动模式'
}, },
set(newValue) { set(newValue) {
if (newValue) { if (newValue) {
reviseData.value.isAuto = "自动模式"; reviseData.value.isAuto = '自动模式'
} else { } else {
reviseData.value.isAuto = "手动模式"; reviseData.value.isAuto = '手动模式'
} }
}, }
}); // 可写计算属性,手动、自动模式切换 }) // 可写计算属性,手动、自动模式切换
function onOpen() { function onOpen(){
console.log("props.data数据", props.data); // console.log('props.data数据',props.data)
console.log("修改弹窗接收到的数据", reviseData.value); // console.log('修改弹窗接收到的数据',reviseData.value)
} }
</script> </script>
...@@ -60,128 +56,73 @@ function onOpen() { ...@@ -60,128 +56,73 @@ function onOpen() {
width="1000px" width="1000px"
title="自定义修改" title="自定义修改"
@close="emit('onCancel')" @close="emit('onCancel')"
@open="onOpen" @open="onOpen">
>
<template #default> <template #default>
<div class="dialog-content"> <div class="dialog-content">
<el-row style="border-top: #a6c3e9 1px solid"> <el-row style="border-top: #a6c3e9 1px solid">
<el-col :span="8" class="content-col-label">自定义名称:</el-col> <el-col :span="8" class="content-col-label">自定义名称:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input :input-style="inputStyle" v-model="reviseData.customizeName" style="width: 510px"/>
:input-style="inputStyle"
v-model="reviseData.customizeName"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">干预模式:</el-col> <el-col :span="8" class="content-col-label">干预模式:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-radio-group v-model="reviseData.isFixed"> <el-radio-group v-model="reviseData.isFixed">
<el-radio value="固定模式" :style="{ marginLeft: '10px' }" <el-radio value="固定模式" :style="{marginLeft:'10px'}">固定模式</el-radio>
>固定模式</el-radio <el-radio value="气象仪模式" :style="{marginLeft:'-15px'}">气象仪模式</el-radio>
>
<el-radio value="气象仪模式" :style="{ marginLeft: '-15px' }"
>气象仪模式</el-radio
>
</el-radio-group> </el-radio-group>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">温度:</el-col> <el-col :span="8" class="content-col-label">温度:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input v-float-number :input-style="inputStyle" v-model="reviseData.temperature" style="width: 510px"/>
v-float-number
:input-style="inputStyle"
v-model="reviseData.temperature"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">风速:</el-col> <el-col :span="8" class="content-col-label">风速:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input :input-style="inputStyle" v-model="reviseData.wind" style="width: 510px"/>
:input-style="inputStyle"
v-float-number
v-model="reviseData.wind"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">光照:</el-col> <el-col :span="8" class="content-col-label">光照:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input :input-style="inputStyle" v-model="reviseData.illumination" style="width: 510px"/>
:input-style="inputStyle"
v-float-number
v-model="reviseData.illumination"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" class="content-col-label">排序:</el-col> <el-col :span="8" class="content-col-label">排序:</el-col>
<el-col :span="16" class="content-col-value"> <el-col :span="16" class="content-col-value">
<el-input <el-input :input-style="inputStyle" v-model="reviseData.sort" style="width: 510px"/>
:input-style="inputStyle"
v-float-number
v-model="reviseData.sort"
style="width: 510px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="5" class="content-col-label">切换自动模式:</el-col> <el-col :span="5" class="content-col-label">切换自动模式:</el-col>
<el-col :span="7" class="content-col-value"> <el-col :span="7" class="content-col-value">
<el-checkbox <el-checkbox :style="{marginLeft:'10px'}" v-model="switchingisAuto" label="自动模式"/>
:style="{ marginLeft: '10px' }"
v-model="switchingisAuto"
label="自动模式"
/>
</el-col> </el-col>
<el-col :span="5" class="content-col-label" <el-col :span="5" class="content-col-label">自动偏差百分比(%d):</el-col>
>自动偏差百分比(%d):</el-col
>
<el-col :span="7" class="content-col-value"> <el-col :span="7" class="content-col-value">
<el-input <el-input v-float-number :input-style="inputStyle" v-model="reviseData.diffPercentage" style="width: 240px"/>
:input-style="inputStyle"
v-float-number
v-model="reviseData.diffPercentage"
style="width: 240px"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="5" class="content-col-label" <el-col :span="5" class="content-col-label">自动验证循环时间(分钟):</el-col>
>自动验证循环时间(分钟):</el-col
>
<el-col :span="7" class="content-col-value"> <el-col :span="7" class="content-col-value">
<el-input <el-input v-float-number :input-style="inputStyle" v-model="reviseData.timeoutMin" style="width: 240px"/>
:input-style="inputStyle"
v-model="reviseData.timeoutMin"
style="width: 240px"
/>
</el-col> </el-col>
<el-col :span="5" class="content-col-label" <el-col :span="5" class="content-col-label">自动调节温度(℃):</el-col>
>自动调节温度(℃):</el-col
>
<el-col :span="7" class="content-col-value"> <el-col :span="7" class="content-col-value">
<el-input <el-input v-float-number :input-style="inputStyle" v-model="reviseData.tempRegulation" style="width: 240px"/>
:input-style="inputStyle"
v-float-number
v-model="reviseData.tempRegulation"
style="width: 240px"
/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button type="primary" @click="emit('onConfirm', reviseData)" <el-button type="primary" @click="emit('onConfirm', reviseData)">保存</el-button>
>保存</el-button
>
<el-button type="primary" @click="emit('onCancel')">关闭</el-button> <el-button type="primary" @click="emit('onCancel')">关闭</el-button>
</div> </div>
</template> </template>
...@@ -189,6 +130,7 @@ function onOpen() { ...@@ -189,6 +130,7 @@ function onOpen() {
</template> </template>
<style scoped> <style scoped>
.el-row { .el-row {
color: black; color: black;
height: 35px; height: 35px;
...@@ -216,10 +158,10 @@ function onOpen() { ...@@ -216,10 +158,10 @@ function onOpen() {
.el-input { .el-input {
color: black; color: black;
} }
.el-radio { .el-radio{
color: black; color: black;
} }
.el-checkbox { .el-checkbox{
color: black; color: black;
} }
</style> </style>
\ No newline at end of file
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