Commit 8a4c5d8e authored by moonby's avatar moonby

Merge branch 'master' of gitee.com:tj-wang-yahui/AMS_HeatSys_Vue_V10

parents 7dcbe027 2680d266
This diff is collapsed.
This diff is collapsed.
......@@ -21,6 +21,7 @@
"jsencrypt": "^3.3.2",
"jspdf": "^2.5.1",
"less": "^4.2.0",
"lodash": "^4.17.21",
"mitt": "^3.0.1",
"node-sass": "^9.0.0",
"public-ip": "^6.0.2",
......
......@@ -92,8 +92,15 @@ export const postExternalQOQ = params => {
})
}
//换热站机组用量同比接口(耗水量、耗电量、耗热量)
export const postYOY = params => {
//换热站机组用量同比接口(耗水量、耗电量、耗热量)网内
export const postWithinYOY = params => {
return http.post(`/api/analysis/within/YOY`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
//换热站机组用量同比接口(耗水量、耗电量、耗热量)网外
export const postExternalYOY = params => {
return http.post(`/api/analysis/external/YOY`, params).then(res => res).catch(function (error) {
console.log(error);
})
......
......@@ -77,7 +77,7 @@ export const alterWeatherMagData = params => { // 添加或修改气象干预数
return http.post(`/api/cusweather/SaveAll`, params)
}
export const getTransfer = param => { // 获取换热站列表
export const getTransferInterface = param => { // 获取换热站列表
return http.post("/api/cusweather/getTransferIds",param)
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,83 +5,84 @@
<div class="card-header">
<span>瞬时热量对比配置</span>
</div>
<table cellpadding="0" cellspacing="1">
<el-form ref="formRef" :rules="rules" :model="List" label-width="auto">
<table v-loading="loading" cellpadding="0" cellspacing="1">
<tr>
<th style="width: 25%">计划名称:</th>
<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-form-item prop="planName" style="padding: 0;margin: 0;">
<el-input style="width: 80%" v-model="List.planName"></el-input>
</el-form-item>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th style="width: 25%">偏差百分比 (%):</th>
<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-form-item prop="diffPercentage" style="padding: 0;margin: 0;">
<el-input v-float-number style="width: 80%" v-model="List.diffPercentage"></el-input>
</el-form-item>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th style="width: 25%">判断时间 (分):</th>
<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-form-item prop="timeoutMin" style="padding: 0;margin: 0;">
<el-input style="width: 80%" v-model="List.timeoutMin"></el-input>
</el-form-item>
</td>
</tr>
</table>
</td>
</tr>
<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%" v-model="List.tempRegulation"></el-input>
<el-form-item prop="tempRegulation" style="padding: 0;margin: 0;">
<el-input style="width: 80%" v-model="List.tempRegulation"></el-input>
</el-form-item>
</td>
</tr>
</table>
</td>
</tr>
<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-form-item prop="description" style="padding: 0;margin: 0;">
<el-input style="width: 80%" type="textarea" rows="6" v-model="List.description"></el-input>
</el-form-item>
</td>
</tr>
</table>
</td>
</tr>
</table>
</el-form>
<div class="btngrounp">
<el-button type="primary" @click="onSave">保存</el-button>
<el-button type="primary" style="margin: 0 0 0 5px" @click="onCancel">关闭</el-button>
</div>
</el-card>
</div>
</div>
......@@ -94,9 +95,9 @@ import { ElMessage } from "element-plus";
import http from "../../api/http";
import { vFloatNumber } from "@/utils/directives.js";
const loading = ref(false)
const formRef = ref()
const List = ref([
const List = ref(
{
"planId": "",
"planName": "",
......@@ -106,25 +107,46 @@ const List = ref([
"description": "",
"isActive": ''
}
])
const getInstanceHeat = async () => {
)
//校验规则
const rules = reactive({
planName: [
{ pattern: /^.{1,20}$/, "message": "计划名称必须是1-20位字符", trigger: "blur" }
],
diffPercentage: [
{ pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur" }
],
timeoutMin: [
{ pattern: /^(\d{1,10})$/, "message": "判断时间必须是1-10位正整数", trigger: "blur" }
],
tempRegulation: [
{ pattern: /^(-?\d{1,10})(\.[0-9]{1,4})?$/, message: "请输入正确的调节温度最大值", trigger: "blur" }
],
description: [
{ pattern: /^.{1,50}$/, "message": "备注必须是1-50位字符", trigger: "blur" }
]
});
const getInstanceHeat = () => {
loading.value = true
const data = await postInstantHeat();
console.log(data);
List.value = data.data[0]
http.post("api/Scheduling/BizInstantaneousHeat/Get", false).then(res => {
if (res.success) {
List.value = res.data[0]
console.log("res.data===>", res.data);
loading.value = false
}
})
}
const onSave = async () => {
// await postInstantHeatUpdate(List.value)
await http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((result) => {
await formRef.value.validate()
await http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((res) => {
if (res.success) {
ElMessage.success(res.message)
getInstanceHeat()
}
}).catch((error) => {
console.log(error)
})
ElMessage.success('修改成功')
getInstanceHeat()
}
onMounted(() => {
getInstanceHeat()
......
This diff is collapsed.
<script setup>
import {computed, isRef, onMounted, reactive, ref, shallowRef} from "vue";
import {computed, isRef, onBeforeMount, onMounted, reactive, ref, shallowRef} from "vue";
import ReviseWindow from "./weatherManageSub/ReviseWindow.vue";
import BindWindow from "./weatherManageSub/BindWindow.vue";
import {getWeatherMagData, alterWeatherMagData, deleteWeatherMagData} from '@/api/scheduling.js'
import {
getWeatherMagData,
alterWeatherMagData,
deleteWeatherMagData,
getOrganizationStructureInterface
} from '@/api/scheduling.js'
import AddWindow from "./weatherManageSub/AddWindow.vue";
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 dataBackup = ref([]);
const reviseWindowOpen = ref(false) // 修改按钮弹窗状态
const bindWindowOpen = ref(false) // 绑定按钮弹窗状态
const addWindowOpen = ref(false) // 新增按钮弹窗状态
......@@ -20,7 +24,32 @@ const tableHeaderClass = data => { // 表头样式
const tableBodyClass = data => { // 表体样式
return 'table-body-class'
}
const isAutoSearchKey = ref() // 手自动模式查询
const supplySearchKey = ref() // 供热站查询
const organizationStructure = ref([]) // 组织结构数据
const supplyData = ref([]) // 供热站数据
function search() {
if(!isAutoSearchKey.value && !supplySearchKey.value){
getData()
}else {
if(isAutoSearchKey.value && supplySearchKey.value){
data.value = dataBackup.value.filter(item => {
return item.isAuto === isAutoSearchKey.value && item.supplyName.includes(supplySearchKey.value)
})
}else {
if(isAutoSearchKey.value){
data.value = dataBackup.value.filter(item => {
return item.isAuto === isAutoSearchKey.value
})
}else {
data.value = dataBackup.value.filter(item => {
return item.supplyName.includes(supplySearchKey.value)
})
}
}
}
}
const revise = (row) => { // 修改按钮单击事件
dependentSub.value = row
reviseWindowOpen.value = true
......@@ -29,6 +58,10 @@ const bind = (row) => { // 绑定按钮单击事件
dependentSub.value = row
bindWindowOpen.value = true
}
const cancelRevise = ()=>{
reviseWindowOpen.value = false
getData()
}
const confirmRevise = val => { // 修改弹窗确认按钮事件
let params = cloneDeep(val)
params.isAuto = params.isAuto === '自动模式' ? true : false
......@@ -48,7 +81,7 @@ const confirmRevise = val => { // 修改弹窗确认按钮事件
})
}else {
ElMessage({
message: '修改失败.',
message: res.message,
type: 'error',
})
}
......@@ -76,7 +109,7 @@ const confirmBind = val => {
bindWindowOpen.value = false
}else {
ElMessage({
message: '绑定失败.',
message: res.message,
type: 'error',
})
}
......@@ -94,30 +127,31 @@ const onCancelBind = () => {
bindWindowOpen.value = false
getData()
}
onMounted(() => {
onBeforeMount(()=>{
getData()
getOrganizationStructure()
})
function getData() {
getWeatherMagData().then(res => {
data.value = res.data
dataBackup.value = [...data.value];
})
}
function handleAddWinOpenClose(){
addWindowOpen.value = false
}
function handleAdd(val){
console.log("新增数据",val)
alterWeatherMagData(val).then(res=>{
if(res.success){
getData()
addWindowOpen.value = false
ElMessage({
message: '新增成功.',
message: res.message,
type: 'success',
})
addWindowOpen.value = false
getData()
}else {
ElMessage({
message: '新增失败.',
message: res.message,
type: 'error',
})
}
......@@ -139,17 +173,54 @@ function getCurrentDateTime() {
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
} // 生成时间
function getSupply() {
supplyData.value = []
organizationStructure.value[0].serviceCenterList.forEach(fir_item => {
fir_item.supplyList.forEach(sec_item => {
let temp = {
supplyId: sec_item.supplyId,
supplyName: sec_item.supplyName,
}
supplyData.value.push({...temp})
})
})
} // 根据组织结构获取供热站数据
function getOrganizationStructure() {
getOrganizationStructureInterface().then(res => {
organizationStructure.value = res.data
getSupply()
}).catch(err => {
ElMessage.error('接口异常,获取数据失败.')
})
} // 获取组织结构
function resetSearch(){
isAutoSearchKey.value = ''
supplySearchKey.value = ''
getData()
}
</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>
<div class="isAuto-search-area">
手自动模式:
<el-select v-model="isAutoSearchKey" style="width: 220px" placeholder="请选择手自动模式" clearable>
<el-option :label="手动模式" value="手动模式"/>
<el-option :label="自动模式" value="自动模式"/>
</el-select>
</div>
<div class="supplyName-search-area">
供热站名称:
<el-input v-model="supplySearchKey" placeholder="请输入供热站名称" clearable style="width: 220px"/>
</div>
</el-col>
<el-col :span="9" right-col>
<el-col :span="7" right-col>
<el-button type="primary" @click="addWindowOpen = true" class="add-btn">新增</el-button>
<el-button type="primary" @click="search">查询</el-button>
<el-button type="primary" @click="resetSearch">重置</el-button>
</el-col>
</el-row>
<div class="table-wrapper">
......@@ -158,7 +229,8 @@ function getCurrentDateTime() {
stripe
border
style="width: 100%"
height="900px"
height="720px"
:default-sort="{ prop: 'operateTime', order: 'descending' }"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass">
<el-table-column prop="allowPagingId" label="编号" align="center" width="60"/>
......@@ -179,7 +251,6 @@ function getCurrentDateTime() {
<div class="table-operate-column">
<el-button link @click="revise(scope.row)" type="primary">修改</el-button>
<el-button link @click="bind(scope.row)" type="primary">绑定换热站</el-button>
<el-button link type="primary">详情</el-button>
</div>
</template>
</el-table-column>
......@@ -193,28 +264,38 @@ function getCurrentDateTime() {
<ReviseWindow
:open="reviseWindowOpen"
:data="dependentSub"
@onCancel="reviseWindowOpen = false"
@onCancel="cancelRevise"
@onConfirm="confirmRevise"
></ReviseWindow>
<BindWindow
:open="bindWindowOpen"
:data="dependentSub"
:supply="supplyData"
@onCancel="onCancelBind"
@onConfirm="confirmBind"></BindWindow>
</div>
</div>
</template>
<style scoped>
.weather-manage-container {
width: 100%;
margin: 4px;
}
.el-col[left-col] {
.el-col[left-col]{
border-right: 1px solid #a6c3e9;
display: flex;
align-items: center;
justify-content: start;
padding-left: 20px;
font-size: 14px;
.isAuto-search-area{
margin-right: 20px;
}
.supplyName-search-area{
}
}
.el-row {
......
This diff is collapsed.
<script setup>
import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect} from "vue";
import {vFloatNumber} from "@/utils/directives.js";
import { ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect, reactive } from "vue";
import { vFloatNumber } from "@/utils/directives.js";
const props = defineProps({
open: {
......@@ -9,23 +9,23 @@ const props = defineProps({
required: true
}
})
const emit = defineEmits(['onCancel','onConfirm'])
const emit = defineEmits(['onCancel', 'onConfirm'])
const addData = ref({
transfers:[], // 换热站
transfers: [], // 换热站
customizeName: '', // 自定义名称
diffPercentage: '', // 自动偏差百分比
illumination: '', // 光照
isAuto: false, // 是否自动模式
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
operateTime:"", // 操作时间
operateTime: "", // 操作时间
sort: '', // 排序
tempRegulation: '', // 自动调节温度
temperature: '', // 温度
timeoutMin: '', // 自动验证循环时间
wind: '', // 风速
description: null, // 排序字段,全为Null
updateNullFields:"", // 无用,但不为空
isActive:false, // 是否启用
updateNullFields: "", // 无用,但不为空
isActive: false, // 是否启用
})
const inputStyle = {
color: 'black',
......@@ -36,9 +36,13 @@ function handleClose() {
emit('onCancel')
}
function handleConfirm() {
formRef.value.validate(valid=>{
if(valid){
addData.value.operateTime = getCurrentDateTime()
emit('onConfirm',addData.value)
emit('onConfirm', addData.value)
resetInput()
}
})
}
function getCurrentDateTime() {
const now = new Date();
......@@ -51,94 +55,148 @@ function getCurrentDateTime() {
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
} // 生成时间
function resetInput(){
addData.value={
transfers:[], // 换热站
function onOpen() {
resetInput()
formRef.value.resetFields()
}
function resetInput() {
addData.value = {
transfers: [], // 换热站
customizeName: '', // 自定义名称
diffPercentage: '', // 自动偏差百分比
illumination: '', // 光照
isAuto: false, // 是否自动模式
isFixed: false, // 干预模式:true 固定模式,false 气象仪模式
operateTime:"", // 操作时间
operateTime: "", // 操作时间
sort: '', // 排序
tempRegulation: '', // 自动调节温度
temperature: '', // 温度
timeoutMin: '', // 自动验证循环时间
wind: '', // 风速
description: null, // 排序字段,全为Null
updateNullFields:"", // 无用,但不为空
isActive:false, // 是否启用
updateNullFields: "", // 无用,但不为空
isActive: false, // 是否启用
}
}
const formRef = ref()
//校验规则
const rules = reactive({
diffPercentage: [
{ pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur" }
],
wind: [
{ pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "风速必须是1-11位实数", trigger: "blur" }
],
illumination: [
{ pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "光照必须是1-11位实数", trigger: "blur" }
],
sort: [
{ pattern: /^(\d{1,11})$/, "message": "排序必须是1-11位正整数", trigger: "blur" }
],
timeoutMin: [
{ pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "判断时间必须是1-11位实数", trigger: "blur" }
],
temperature: [
{required: true, message: '请输入正确的温度'},
{ pattern: /^(-?\d{1,11})(\.[0-9]{1,4})?$/, message: "请输入正确的温度", trigger: "blur" }
]
});
</script>
<template>
<el-dialog
v-model="props.open"
width="1000px"
title="新增"
@close="emit('onCancel')">
<el-dialog v-model="props.open" width="1000px" title="新增" @close="emit('onCancel')" @open="onOpen">
<template #default>
<div class="dialog-content">
<el-form :rules="rules" ref="formRef" :model="addData" label-width="auto">
<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="addData.customizeName" style="width: 510px"/>
<el-input maxlength="11" :input-style="inputStyle" v-model="addData.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="addData.isFixed">
<el-radio :value="true" :style="{marginLeft:'10px'}">固定模式</el-radio>
<el-radio :value="false" :style="{marginLeft:'-15px'}">气象仪模式</el-radio>
<el-radio :value="true" :style="{ marginLeft: '10px' }">固定模式</el-radio>
<el-radio :value="false" :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="addData.temperature" style="width: 510px"/>
<el-form-item prop="temperature" style="padding: 0;margin: 0;">
<el-input maxlength="11" :input-style="inputStyle" v-model="addData.temperature" style="width: 510px" />
</el-form-item>
</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-model="addData.wind" style="width: 510px"/>
<el-form-item prop="wind" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="addData.wind" style="width: 510px" />
</el-form-item>
</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-model="addData.illumination" style="width: 510px"/>
<el-form-item prop="illumination" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="addData.illumination"
style="width: 510px" />
</el-form-item>
</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-model="addData.sort" style="width: 510px"/>
<el-form-item prop="sort" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="addData.sort" style="width: 510px" />
</el-form-item>
</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="addData.isAuto" label="自动模式"/>
<el-checkbox :style="{ marginLeft: '10px' }" v-model="addData.isAuto" label="自动模式" />
</el-col>
<el-col :span="5" class="content-col-label">自动偏差百分比(%d):</el-col>
<el-col :span="7" class="content-col-value">
<el-input v-float-number :input-style="inputStyle" v-model="addData.diffPercentage" style="width: 240px"/>
<el-form-item prop="diffPercentage" style="padding: 0;margin: 0;">
<el-input v-float-number :input-style="inputStyle" maxlength="11" v-model="addData.diffPercentage"
style="width: 240px" />
</el-form-item>
</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-input v-float-number :input-style="inputStyle" v-model="addData.timeoutMin" style="width: 240px"/>
<el-form-item prop="timeoutMin" style="padding: 0;margin: 0;">
<el-input v-float-number :input-style="inputStyle" maxlength="11" v-model="addData.timeoutMin"
style="width: 240px" />
</el-form-item>
</el-col>
<el-col :span="5" class="content-col-label">自动调节温度(℃):</el-col>
<el-col :span="7" class="content-col-value">
<el-input v-float-number :input-style="inputStyle" v-model="addData.tempRegulation" style="width: 240px"/>
<el-form-item prop="tempRegulation" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="addData.tempRegulation"
style="width: 240px" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<template #footer>
......@@ -151,7 +209,6 @@ function resetInput(){
</template>
<style scoped>
.el-row {
color: black;
height: 35px;
......@@ -179,10 +236,12 @@ function resetInput(){
.el-input {
color: black;
}
.el-radio{
.el-radio {
color: black;
}
.el-checkbox{
.el-checkbox {
color: black;
}
</style>
\ No newline at end of file
<script setup>
import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect} from "vue";
import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect, reactive} from "vue";
import cloneDeep from 'lodash/cloneDeep'
import {vFloatNumber} from "@/utils/directives.js";
import {getTransferInterface} from "@/api/scheduling.js";
const props = defineProps({
open: {
......@@ -12,7 +14,7 @@ const props = defineProps({
data: {
type: Object,
default: {},
required:true
required: true
}
})
const emit = defineEmits({
......@@ -22,7 +24,32 @@ const emit = defineEmits({
}
})
const reviseData = ref({})
watchEffect(()=>{
const formRef = ref()
//校验规则
const rules = reactive({
diffPercentage: [
{pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur"}
],
wind: [
{pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "风速必须是1-11位实数", trigger: "blur"}
],
illumination: [
{pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "光照必须是1-11位实数", trigger: "blur"}
],
sort: [
{pattern: /^(\d{1,11})$/, "message": "排序必须是1-11位正整数", trigger: "blur"}
],
timeoutMin: [
{pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "判断时间必须是1-10位实数", trigger: "blur"}
],
temperature: [
{required: true, message: '请输入正确的温度', trigger: 'blur'},
{pattern: /^(-?\d{1,11})(\.[0-9]{1,4})?$/, message: "请输入正确的温度", trigger: "blur"}
]
});
watchEffect(() => {
// reviseData.value = {...props.data}
props.data.transfers = []
props.data.updateNullFields = ''
......@@ -44,85 +71,124 @@ const switchingisAuto = computed({
}
}
}) // 可写计算属性,手动、自动模式切换
function onOpen(){
// console.log('props.data数据',props.data)
// console.log('修改弹窗接收到的数据',reviseData.value)
function onOpen() {
formRef.value.resetFields()
}
async function handleConfirm() {
if (reviseData.value.hasOwnProperty('supplyId')) {
if (reviseData.value.supplyId) {
const result = await getTransferInterface(param)
for (let item of result.data) {
reviseData.value.transfers.push(
{
customizeId: reviseData.value.customizeId,
unitId: item.transferId,
updateNullFields: ''
}
)
}
}
}
formRef.value.validate(valid => {
if (valid) {
emit('onConfirm', reviseData.value)
}
})
}
</script>
<template>
<el-dialog
v-model="props.open"
width="1000px"
title="自定义修改"
@close="emit('onCancel')"
@open="onOpen">
<el-dialog v-model="props.open" width="1000px" title="自定义修改" @close="emit('onCancel')" @open="onOpen">
<template #default>
<div class="dialog-content">
<el-form ref="formRef" :model="reviseData" :rules="rules" label-width="auto">
<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 maxlength="11" :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-form-item prop="temperature" style="padding: 0;margin: 0;">
<el-input maxlength="11" :input-style="inputStyle" v-model="reviseData.temperature"
style="width: 510px"/>
</el-form-item>
</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-model="reviseData.wind" style="width: 510px"/>
<el-form-item prop="wind" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="reviseData.wind" style="width: 510px"/>
</el-form-item>
</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-model="reviseData.illumination" style="width: 510px"/>
<el-form-item prop="illumination" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="reviseData.illumination"
style="width: 510px"/>
</el-form-item>
</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-model="reviseData.sort" style="width: 510px"/>
<el-form-item prop="sort" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="reviseData.sort" style="width: 510px"/>
</el-form-item>
</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="7" class="content-col-value">
<el-input v-float-number :input-style="inputStyle" v-model="reviseData.diffPercentage" style="width: 240px"/>
<el-form-item prop="diffPercentage" style="padding: 0;margin: 0;">
<el-input v-float-number :input-style="inputStyle" maxlength="11" v-model="reviseData.diffPercentage"
style="width: 240px"/>
</el-form-item>
</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-input v-float-number :input-style="inputStyle" v-model="reviseData.timeoutMin" style="width: 240px"/>
<el-form-item prop="timeoutMin" style="padding: 0;margin: 0;">
<el-input v-float-number :input-style="inputStyle" maxlength="11" v-model="reviseData.timeoutMin"
style="width: 240px"/>
</el-form-item>
</el-col>
<el-col :span="5" class="content-col-label">自动调节温度(℃):</el-col>
<el-col :span="7" class="content-col-value">
<el-input v-float-number :input-style="inputStyle" v-model="reviseData.tempRegulation" style="width: 240px"/>
<el-form-item prop="tempRegulation" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="reviseData.tempRegulation"
style="width: 240px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="emit('onConfirm', reviseData)">保存</el-button>
<el-button type="primary" @click="handleConfirm">保存</el-button>
<el-button type="primary" @click="emit('onCancel')">关闭</el-button>
</div>
</template>
......@@ -130,7 +196,6 @@ function onOpen(){
</template>
<style scoped>
.el-row {
color: black;
height: 35px;
......@@ -158,10 +223,12 @@ function onOpen(){
.el-input {
color: black;
}
.el-radio{
.el-radio {
color: black;
}
.el-checkbox{
.el-checkbox {
color: black;
}
</style>
\ No newline at end of file
......@@ -200,11 +200,76 @@
</a>
</div>
<div class="h-link">
<a href="javascript:void(0)" :title="realName">
<a href="javascript:void(0)" @click="dialogFormVisible = true" :title="realName">
<el-icon :style="{ fontSize: '30px' }">
<UserFilled color="rgb(161,187,214)" />
</el-icon>
</a>
<el-dialog v-model="dialogFormVisible" width="1000" >
<el-tabs :tab-position="tabPosition">
<el-tab-pane label="个人资料">
<el-form :model="userinfo">
<el-form-item label="登录名:" label-width="140px">
<el-input v-model="userinfo.userName"/>
</el-form-item>
<el-form-item label="真实姓名:" label-width="140px">
<el-input v-model="userinfo.realName"/>
</el-form-item>
<el-form-item label="密码:" label-width="140px">
<el-input v-model="password" type="password"/>
</el-form-item>
<el-form-item label="供热企业:" label-width="140px">
{{ showenterpriseName }}
</el-form-item>
<el-form-item label="角色:" label-width="140px">
<el-select v-model="roleId" placeholder="无" >
<el-option label="超级管理员" :value="1" />
<el-option label="管理员" :value="2" />
<el-option label="供热企业负责人" :value="3" />
<el-option label="供热站负责人" :value="4" />
<el-option label="换热站负责人" :value="5" />
<el-option label="游客" :value="6" />
<el-option label="锅炉房负责人" :value="7" />
<el-option label="外部人员" :value="8" />
</el-select>
</el-form-item>
<el-form-item label="联系电话:" label-width="140px">
<el-input v-model="userinfo.mobile"/>
</el-form-item>
<el-form-item label="邮箱:" label-width="140px">
<el-input v-model="userinfo.email"/>
</el-form-item>
<el-form-item label="启用短信提醒:" label-width="140px">
<el-checkbox v-model="userinfo.isSms" label="启用" />
</el-form-item>
<el-form-item label="描述:" label-width="140px">
<el-input v-model="userinfo.description" type="textarea"/>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="修改密码">
<!-- <el-form :model="savepass">
<el-form-item label="原密码:" label-width="140px">
<el-input v-model="savepass.userName" type="password"/>
</el-form-item>
<el-form-item label="新密码:" label-width="140px">
<el-input v-model="savepass.realName" type="password"/>
</el-form-item>
<el-form-item label="再次输入新密码:" label-width="140px">
<el-input v-model="savepass" type="password"/>
</el-form-item>
</el-form> -->
</el-tab-pane>
</el-tabs>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="updateuser">
保存
</el-button>
</div>
</template>
</el-dialog>
</div>
<div class="h-link">
<a href="javascript:void(0)" title="系统设置">
......@@ -708,6 +773,7 @@ export default defineComponent({
const countid = ref();
const sta = ref(0);
const consta = ref(0);
const password = ref('fnoihfnoighaoiw');
//获取用户信息
function getuser() {
var user = store.getters.getUserInfo();
......@@ -731,7 +797,6 @@ export default defineComponent({
.post("/api/alarm/GetAlarmMsg", AlarmInfo.value, false)
.then((result) => {
if (result.data !== null && sta.value === 0) {
console.log(result);
sta.value = 1;
title.value = result.data[0].title;
msg.value = result.data[0].msg;
......@@ -765,7 +830,6 @@ export default defineComponent({
function countalarm() {
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
if (result.data !== null && consta.value === 0) {
console.log(result);
consta.value = 1;
counttitle.value = result.data[1].title;
countmsg.value = result.data[1].msg;
......@@ -803,6 +867,30 @@ export default defineComponent({
countalarm();
}, 60 * 1000); // 每分钟执行一次
//个人资料弹出框
const dialogFormVisible = ref(false)//个人资料弹出框显示隐藏
var userinfo = ref(111);
async function getuserdata(){
var user = store.getters.getUserInfo();
if (user) {
userId.value = user.userId;
}
const useridInfo = reactive({"id":userId.value});
await http.post("/api/User/getData", useridInfo).then((result) => {
userinfo.value = result.data;
})
}
function updateuser(){
userinfo.value.updateNullFields = "";
userinfo.value.enterpriseName = "";
userinfo.value.token = "";
userinfo.value.roleId = roleId;
http.post("/api/User/save", userinfo.value).then((result) => {
console.log(result)
})
}
getuserdata();
return {
menuWidth,
mainHeight,
......@@ -818,6 +906,8 @@ export default defineComponent({
contextMenuVisible,
visibleItem,
currentMenuId,
dialogFormVisible,
userinfo,
amslogo,
amslogo_style,
addTab,
......@@ -834,7 +924,9 @@ export default defineComponent({
openMap,
enterMenu,
leaveMenu,
//enterpriseId
updateuser,
showenterpriseName,
password
};
},
methods: {
......
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