Commit 4aa69a06 authored by jiaxu.yan's avatar jiaxu.yan

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

# Conflicts:
#	src/views/SchedulingPage/ConfigBoilerPage.vue
parents 1c4ecc1f efa83de3
......@@ -15,7 +15,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button>
<el-button type="primary" @click="open" style="min-width: 70px;">报警参数设置</el-button>
<el-button type="primary" v-show="roleId" @click="open" style="min-width: 70px;">报警参数设置</el-button>
</el-form-item>
</div>
</el-card>
......@@ -279,7 +279,7 @@ const show = ref(false)
const refreshItem = ref(0)
const AlarmInfo = ref([])
const dept = ref('')
const roleId = ref(false)
function open() {
show.value = true
......@@ -514,42 +514,27 @@ console.log("AlarmInfo.value:::", AlarmInfo.value);
const userId = ref();
const roleIds = ref();
//获取用户信息
function getuser() {
const getuser = () => {
var user = store.getters.getUserInfo();
console.log("user================>", user);
console.log("user.enterpriseId================>", user.enterpriseId);
if (user) {
enterpriseId.value = user.enterpriseId;
userId.value = user.userId;
roleIds.value = user.roleId;
}
// 权限小于3显示按钮
if (roleIds.value < 3) {
roleId.value = true
}
}
console.log("userId=========>", userId.value);
console.log("roleIds=========>", roleIds.value);
getuser()
let cnNames_before = ref([])
let cnNames_after = ref([])
console.log("---------------------AlarmInfo.value:", AlarmInfo.value);
let params = ref({
"pipeAlarmParaId": "",
"pipeParaBaseId": "",
"pipeId": "",
"gatherType": "",
"voicePath": "",
"isVoice": "",
"topMost": "",
"upper": "",
"lower": "",
"downMost": "",
"alarmPlan": "",
"isShortMessage": "",
"isAlarm": "",
"isActive": true,
"updateNullFields": "",
})
// v-moedl表单参数,用于提交
let addParams = ref({
"updateNullFields": "",
"voicePath": "",
......@@ -564,6 +549,7 @@ let addParams = ref({
"isActive": true
})
// 重置表单
const reset = () => {
addParams.value = {
"updateNullFields": "",
......@@ -579,6 +565,8 @@ const reset = () => {
"isActive": true
}
}
// 给表单第一个属性"报警名称"赋值
let param = ref({
"cnName": "",
"baseId": ""
......@@ -626,7 +614,6 @@ watchEffect(() => {
param.value.baseId = "transParaBaseId"
}
})
// 接口2:换热站基础参数编号(transParaBaseId) -> 接口1:baseId
const getCnNames = () => {
// console.log('dept-------------------', dept.value);
......@@ -635,8 +622,8 @@ const getCnNames = () => {
data.then(function (val) {
cnNames_before.value = val.data.before
cnNames_after.value = val.data.after
// console.log("cnNames_before@@@@", cnNames_before);
// console.log("cnNames_after@@@@", cnNames_after);
// console.log("cnNames_before===>", cnNames_before);
// console.log("cnNames_after===>", cnNames_after);
// console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId)
});
}
......@@ -646,6 +633,10 @@ const paramsSetting = () => {
getCnNames()
}
// newRow接收param.value.baseId,添加需要使用
// selectBeforeParams 和 selectAfterParams==> 两个方法调用一个接口
// selectBeforeParams 是点击左侧未参数时调用,此时未配置参数,故data无数据
// selectAfterParams 是点击右侧已配置的参数时调用,此时参数已配置,故data有数据
let newRow = ref({})
const selectBeforeParams = (row) => {
reset()
......@@ -666,10 +657,7 @@ const selectBeforeParams = (row) => {
if (param.value.baseId) {
const data = http.post("api/alarm/para/GetAlarmParaInfo", { type: newType.value, id: dept.value, baseid: param.value.baseId }, false)
// console.log("查看baseId --- dataaaaa:", data);
data.then(function (val) {
// console.log("valllll:", val);
params.value = val.data
// console.log("!!!!!Params.value:", params.value);
data.then(function () {
param.value.cnName = row.cnName
});
} else {
......@@ -703,8 +691,6 @@ const selectAfterParams = (row) => {
// console.log("valllll:", val);
// 数据回显
addParams.value = { ...val.data }
// console.log("addParams.value/////////", addParams.value);
// console.log("!!!!!Params.value:", params.value);
param.value.cnName = row.cnName
if (type.value === 1) {
delId.value = val.data.pipeAlarmParaId
......@@ -719,7 +705,10 @@ const selectAfterParams = (row) => {
}
}
// 总管
// 添加 addParams中写三个类型相同的属性,根据类型和设备进行动态的删除和添加
// 点击添加按钮要根据参数所属不同的类型和设备进行传参
// 修改亦如此
const onAdd = () => {
// console.log("!!!!!!!", addParams.value);
addParams.value.updateNullFields = ""
......@@ -780,6 +769,11 @@ const onAdd = () => {
}
// 按钮
// 表单下面的按钮
// 按钮分为两组:一组添加和删除 一组修改和删除
// 选择类型和设备 点击确定之后,当点击左侧的参数调用xxbeforexx接口,且表单的报警名称有值添加按钮可用
// 当点击添加之后表单的报警名称没有值,添加按钮不可用
// 点击右侧的参数调用xxxafterxxx接口,添加按钮变为修改,同时修改按钮可用
const button = ref(true)
// 删除逻辑
......@@ -824,7 +818,7 @@ const onDel = () => {
}
// 关闭dialog清空数据
// 关闭dialog右上× 清空数据
const onClose = () => {
type.value = ""
dept.value = ""
......@@ -835,6 +829,7 @@ const onClose = () => {
}
onMounted(() => {
getuser()
setContentHeight();
window.addEventListener('resize', setContentHeight);
})
......
......@@ -4,9 +4,6 @@ import { ElMessageBox, ElMessage } from "element-plus";
import axios from "axios";
import { Search, Document } from "@element-plus/icons-vue";
import {
postEnergyManage,
postEnergyDel,
postEnergyUpdate,
getOrganizationStructureInterface
} from "@/api/scheduling";
import http from "../../api/http";
......@@ -56,12 +53,12 @@ const tableLabel = reactive([
{
prop: "allowPagingId",
label: "序号",
width: 100,
width: 100
},
{
prop: "supplyName",
label: "名称",
width: 200,
width: 200
},
{
prop: "energyType",
......@@ -70,21 +67,21 @@ const tableLabel = reactive([
{
prop: "record",
label: "用度",
width: 200,
width: 200
},
{
prop: "recordDate",
label: "日期",
width: 300,
width: 300
},
]);
const formInline = reactive({
keyWord: "",
keyWord: ""
});
const config = reactive({
supplyType: ["0", "1", "2", "3", "4"],
supplyType: ["0", "1", "2", "3", "4"]
});
const handleSearch = () => {
......@@ -160,7 +157,7 @@ const handleAdd = () => {
dialogVisible.value = true;
reset()
}
// 编辑
const handleEdit = (val) => {
// console.log("supplyData===>", supplyData.value);
supplyData.value.forEach((item) => {
......@@ -190,7 +187,7 @@ const onSubmit = () => {
http.post("api/energy/Save", { ...formEnergy.value }, false).then(res => {
if (res.success) {
dialogVisible.value = false
// ElMessage.success(res.message)
ElMessage.success(res.message)
getEnergyData();
loading.value = false
}
......@@ -201,7 +198,7 @@ const onSubmit = () => {
http.post("api/energy/Save", { ...formEnergy.value }, false).then((res => {
if (res.success) {
dialogVisible.value = false
// ElMessage.success(res.message)
ElMessage.success(res.message)
getEnergyData();
loading.value = false
}
......@@ -306,6 +303,7 @@ onMounted(() => {
stripe max-height="633">
<el-table-column prop="allowPagingId" label="序号" />
<el-table-column prop="supplyName" label="名称" />
<!-- TODO energyType显示中文 -->
<el-table-column prop="energyType" property="energyType" label="能源类型">
<template #default="scope">
<span v-if="scope.row.energyType == '0'">非节能</span>
......@@ -454,7 +452,7 @@ table td {
padding: 5px 10px;
}
// 固定表头
// 固定表头!!要给table一个最大高度max-height
.el-table__body-wrapper.is-scrolling-none {
overflow-y: auto;
max-height: calc(100vh - 457px); //table-固定头部的高度
......
......@@ -33,8 +33,6 @@
</table>
</td>
</tr>
<tr>
<th style="width: 25%">判断时间 (分):</th>
<td style="width: 60%; margin: 0; padding: 0">
......@@ -49,8 +47,6 @@
</table>
</td>
</tr>
<tr>
<th style="width: 25%">调节温度 (℃)</th>
<td style="width: 60%; margin: 0; padding: 0">
......@@ -65,8 +61,6 @@
</table>
</td>
</tr>
<tr>
<th style="width: 25%">备注</th>
<td style="width: 60%; margin: 0; padding: 0">
......@@ -79,16 +73,12 @@
</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>
......@@ -119,16 +109,16 @@ const rules = reactive({
diffPercentage: [
{ required: true, message: "偏差百分比是必填项", trigger: "blur" },
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, "message": "偏差百分比输入不合法", trigger: 'blur' },
{ min: 1, max: 10, message: '偏差百分比必须是 1-10位的数字', trigger: 'blur' }
{ min: 1, max: 10, message: '偏差百分比必须是 1-10位的数字', trigger: 'change' }
],
timeoutMin: [
{ required: true, message: "判断时间是必填项", trigger: "blur" },
{ pattern: /^[0-9]\d{1,10}$/, "message": "判断时间必须是 1-10位的数字", trigger: 'blur' }
{ pattern: /^[0-9]\d{1,10}$/, "message": "判断时间必须是 1-10位的数字", trigger: 'change' }
],
tempRegulation: [
{ required: true, message: "调节温度是必选项", trigger: "blur" },
{ pattern: /^(-?[0-9]+(\.[0-9]+)?)$/, "message": "调节温度输入不合法", trigger: 'blur' },
{ min: 1, max: 10, message: '调节温度必须是 1-10位的数字', trigger: 'blur' }
{ min: 1, max: 10, message: '调节温度必须是 1-10位的数字', trigger: 'change' }
]
});
......
<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";
......@@ -10,6 +15,7 @@ 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 +26,33 @@ const tableHeaderClass = data => { // 表头样式
const tableBodyClass = data => { // 表体样式
return 'table-body-class'
}
const isAutoSearchKey = ref() // 手自动模式查询
const supplySearchKey = ref() // 供热站查询
const organizationStructure = ref([]) // 组织结构数据
const supplyData = ref([]) // 供热站数据
const transferStructData = 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
......@@ -99,11 +131,16 @@ const onCancelBind = () => {
getData()
}
onMounted(() => {
})
onBeforeMount(()=>{
getData()
getOrganizationStructure()
})
function getData() {
getWeatherMagData().then(res => {
data.value = res.data
dataBackup.value = [...data.value];
})
}
function handleAddWinOpenClose(){
......@@ -143,17 +180,69 @@ 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 getAllTransfer() {
organizationStructure.value[0].serviceCenterList.forEach(serviceCenter => { // 共有两个服务中心
let supplyList = serviceCenter.supplyList // 供热站列表,每个服务中心对应一定的供热站
supplyList.forEach(supply => { // 供热站
transferStructData.value.push(
{
supplyId: supply.supplyId,
supplyName: supply.supplyName,
transferList: supply.transferList
}
)
})
transferStructData.value.forEach(item=>{
item.transferList.forEach((unit)=>{
unit.isUsed = false
unit.customizeId = ''
})
})
})
} // 根据组织结构获取换热站结构数据
function getOrganizationStructure() {
getOrganizationStructureInterface().then(res => {
organizationStructure.value = res.data
getSupply()
getAllTransfer()
}).catch(err => {
ElMessage.error('接口异常,获取数据失败.')
})
} // 获取组织结构
</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: 300px" 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: 300px"/>
</div>
</el-col>
<el-col :span="9" right-col>
<el-button type="primary" @click="addWindowOpen = true" class="add-btn">新增</el-button>
<el-button type="primary" @click="search">查询</el-button>
</el-col>
</el-row>
<div class="table-wrapper">
......@@ -162,7 +251,7 @@ function getCurrentDateTime() {
stripe
border
style="width: 100%"
height="900px"
height="720px"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass">
<el-table-column prop="allowPagingId" label="编号" align="center" width="60"/>
......@@ -183,7 +272,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>
......@@ -203,22 +291,34 @@ function getCurrentDateTime() {
<BindWindow
:open="bindWindowOpen"
:data="dependentSub"
:supply="supplyData"
:transfer="transferStructData"
:all-weather-mag-data="dataBackup"
@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 {
......
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