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