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">
<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 style="width: 80%" v-model="List.planName"></el-input>
</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.diffPercentage"></el-input>
</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 style="width: 80%" v-model="List.timeoutMin"></el-input>
</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>
</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 style="width: 80%" type="textarea" rows="6" v-model="List.description"></el-input>
</td>
</tr>
</table>
</td>
</tr>
</table>
<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>
<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>
<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>
<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-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]
loading.value = false
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) => {
}).catch((error) => {
console.log(error)
})
ElMessage.success('修改成功')
getInstanceHeat()
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)
})
}
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.
......@@ -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;
......@@ -802,7 +866,31 @@ export default defineComponent({
alarm();
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