Commit dd537370 authored by hubaoshan's avatar hubaoshan

页面优化

parent 9877c5c9
......@@ -5,11 +5,11 @@ export const getMoveListNewData = (item) => {
}
export const getMoveListHistoryData = (item) => {
return httpTwo.get(`/busdynamicenvironmental/historyList?page=${item.page}&rows=${item.size}&stationId=${item.stationId}&alarmStatus=${item.alarmStatus}`)
return httpTwo.get(`/busdynamicenvironmental/historyList?page=${item.page}&rows=${item.size}&stationId=${item.stationId}&beginTime=${item.beginTime}&endTime=${item.endTime}`)
}
export const getMoveListAlarmNewData = (item) => {
return httpTwo.get(`/busdynamicenvironmentalalarm/list?page=${item.page}&rows=${item.size}&stationId=${item.stationId}&alarmStatus=${item.alarmStatus}`)
return httpTwo.get(`/busdynamicenvironmentalalarm/list?page=${item.page}&rows=${item.size}&stationId=${item.stationId}&beginTime=${item.beginTime}&endTime=${item.endTime}`)
}
export const getMoveAlarmNumber = () => {
......
......@@ -4,11 +4,11 @@ export const getRecycleListNewData = (item) =>{
}
export const getRecycleListHistoryData = (item) =>{
return httpTwo.get(`/buscirculatingpump/historyList?page=${item.page}&rows=${item.size}&stationId=${item.stationId}&alarmStatus=${item.alarmStatus}`)
return httpTwo.get(`/buscirculatingpump/historyList?page=${item.page}&rows=${item.size}&stationId=${item.stationId}&beginTime=${item.beginTime}&endTime=${item.endTime}`)
}
export const getRecycleListAlarmData = (item) =>{
return httpTwo.get(`/buscirculatingpumpalarm/list?page=${item.page}&rows=${item.size}&stationId=${item.stationId}&alarmStatus=${item.alarmStatus}`)
return httpTwo.get(`/buscirculatingpumpalarm/list?page=${item.page}&rows=${item.size}&stationId=${item.stationId}&beginTime=${item.beginTime}&endTime=${item.endTime}`)
}
export const getRecycleAlarmNumber = () => {
......
......@@ -2,6 +2,8 @@
import {onMounted, reactive, ref, toRefs, watch} from "vue";
import analysisImage from '@/assets/imgs/dengluanniu_wx.png';
import {getListNewData} from "../../../api/AIStation/Extinguisher.js";
import {useRoute} from "vue-router";
import {handleGetAIToken} from "../AItoken.js";
const data = ref([])
......@@ -73,7 +75,18 @@ function getDataByParams() {
Page.rows = res.pageSize
})
}
// const route = useRoute()
// watch(
// () => route.path, // 只监听路径变化
// () => {
// if(route.path === '/AIStation/ExtinguisherPage/ExtinguisherNewDataPage') {
// // 路由变化,执行相应操作
// handleGetAIToken();
// console.log('route.path',route.path)
// }
// },
// { immediate: true } // 只在路径变化时触发
// )
watch(
() => props.queryParams,
(newData) => {
......
......@@ -12,9 +12,7 @@ import {
exportHistoryExtinguisherData,
exportExtinguisherAlarmData
} from "../../../api/AIStation/Extinguisher.js";
import {provide} from 'vue';
provide('getAIToken', handleGetAIToken);
const options = ref([]);
const enterpriseId = ref();
const props = {multiple: true, emitPath: false}
......
......@@ -2,11 +2,17 @@
import {ref, defineProps, defineEmits, computed, isRef, onMounted, watchEffect, reactive, watch} from "vue";
import {getAlarmListData} from "../../../api/AIStation/Extinguisher.js";
import {getMoveListAlarmNewData} from "../../../api/AIStation/MoveMonitor.js";
import {getTransListAlarmData} from "../../../api/AIStation/TransTemp.js";
import store from "../../../store/index.js";
import {handleGetAIToken} from "../AItoken.js";
import {useRoute} from "vue-router";
let AlarmData = ref([])
const params = ref({})
const options = ref([])
const enterpriseId = ref();
const loading = ref(true);
const tableHeaderClass = data => { // 表头样式
return 'table-header-class'
}
......@@ -33,41 +39,31 @@ const handleCurrentChange = (val) => {
//子组件接收父组件传递过来的值
const props = defineProps({
searchData: {
type: Object,
required: true
},
option: {
type: Array,
required: true
},
queryParams: {
type: Object,
required: true
}
});
watch(
() => props.searchData,
(newData) => {
AlarmData = props.searchData.rows;
Page.total = props.searchData.total;
}
);
// const route = useRoute()
// watch(
// () => route.path, // 只监听路径变化
// () => {
// if(route.path === '/AIStation/MoveMonitorPage/MoveMonitorAlarmPage') {
// // 路由变化,执行相应操作
// handleGetAIToken();
// console.log('route.path',route.path)
// }
// },
// { immediate: true } // 只在路径变化时触发
// )
watch(
() => props.queryParams,
(newData) => {
params.value = newData
getDataNew(params.value)
console.log('值eeeee',params.value)
}
)
watch(
() => props.option,
(newVal) => {
options.value = props.option
console.log('值eeeerrrrr',options.value)
},
{ deep: true }
)
getData()
function getData(){
const item = reactive({
......@@ -93,10 +89,80 @@ function getDataByParams(){
Page.rows = res.pageSize
})
}
function getName(name){
const option = options.value.find(item => item.stationId === name);
return option.stationName
function getName(name) {
if (AlarmData && AlarmData.value.length > 0 && name !== undefined && options && options.value.length > 0) {
const option = options.value.find(item => item.stationId === name);
return option.stationName
}
}
function getDataNew(item) {
getMoveListAlarmNewData(item).then(res => {
AlarmData.value = res.rows
Page.total = res.total
Page.rows = res.pageSize
})
}
getEnterprise();
function getEnterprise() {
const result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
//获取换热机组列表
function getSupplys() {
loading.value = true;
// tableData.length = 0;
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
result.forEach(element => {
let allItems = []
if (element.enterpriseId === enterpriseId.value) {
if (element.enterpriseId === "9bca54bc-8f27-4849-8d7d-50c5099e1949") {
element.serviceCenterList.forEach(center => {//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if (unit.stationId === station.stationId) {
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId,
unitId: unitId
})
});
});
})
} else {
element.supplyList.forEach(element => {
element.stationList.forEach(station => {
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId
})
})
})
}
}
options.value = allItems;
});
}
}
getSupplys()
</script>
<template>
......
......@@ -2,10 +2,12 @@
import {reactive, ref, watch} from "vue";
import analysisImage from '@/assets/imgs/dengluanniu_wx.png'
import {getListHistoryData} from "../../../api/AIStation/Extinguisher.js";
import {getMoveListHistoryData} from "../../../api/AIStation/MoveMonitor.js";
let HistoryData = ref([])
import {getMoveListAlarmNewData, getMoveListHistoryData} from "../../../api/AIStation/MoveMonitor.js";
import store from "../../../store/index.js";
const HistoryData = ref([])
const enterpriseId = ref();
const loading = ref(true);
const historyPage = reactive({total: 0, rows: 20, page: 1});
const tableHeaderClass = data => { // 表头样式
......@@ -42,43 +44,20 @@ const handleCurrentChange = (val) => {
};
//子组件接收父组件传递过来的值
const props = defineProps({
searchData: {
type: Object,
required: true
},
option: {
type: Array,
required: true
},
queryParams: {
type: Object,
required: true
}
});
watch(
() => props.searchData,
(newData) => {
console.log('值',props.searchData)
HistoryData = props.searchData.rows;
historyPage.total = props.searchData.total
}
);
watch(
() => props.queryParams,
(newData) => {
params.value = newData
getDataNew(params.value)
console.log('值eeeee',params.value)
console.log('值ooo',props.queryParams)
}
)
watch(
() => props.option,
(newVal) => {
options.value = newVal
console.log('值ooo',options.value)
},
{ deep: true }
)
getData()
function getData() {
console.log(222222222)
......@@ -106,10 +85,80 @@ function getDataByParams(){
historyPage.rows = res.pageSize
})
}
function getName(name){
const option = options.value.find(item => item.stationId === name);
return option.stationName
function getName(name) {
if (HistoryData && HistoryData.value.length > 0 && name !== undefined && options && options.value.length > 0) {
const option = options.value.find(item => item.stationId === name);
return option.stationName
}
}
function getDataNew(item) {
getMoveListHistoryData(item).then(res => {
HistoryData.value = res.rows
historyPage.total = res.total
historyPage.rows = res.pageSize
})
}
getEnterprise();
function getEnterprise() {
const result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
//获取换热机组列表
function getSupplys() {
loading.value = true;
// tableData.length = 0;
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
result.forEach(element => {
let allItems = []
if (element.enterpriseId === enterpriseId.value) {
if (element.enterpriseId === "9bca54bc-8f27-4849-8d7d-50c5099e1949") {
element.serviceCenterList.forEach(center => {//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if (unit.stationId === station.stationId) {
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId,
unitId: unitId
})
});
});
})
} else {
element.supplyList.forEach(element => {
element.stationList.forEach(station => {
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId
})
})
})
}
}
options.value = allItems;
});
}
}
getSupplys()
</script>
<template>
......
......@@ -2,10 +2,12 @@
import {onMounted, reactive, ref, watch} from "vue";
import analysisImage from '@/assets/imgs/dengluanniu_wx.png';
import {getListNewData} from "../../../api/AIStation/Extinguisher.js";
import {getMoveListNewData} from "../../../api/AIStation/MoveMonitor.js";
import {getMoveListHistoryData, getMoveListNewData} from "../../../api/AIStation/MoveMonitor.js";
import store from "../../../store/index.js";
const data = ref([])
const enterpriseId = ref();
const loading = ref(true);
// 分页
const Page = reactive({total: 0, rows: 20, page: 1});
const tableHeaderClass = data => { // 表头样式
......@@ -23,7 +25,7 @@ const handleSizeChange = (val) => {
getDataByParams()
};
const params = ref({})
const options = ref({})
const options = ref([])
// 当前页改变时触发
const handleCurrentChange = (val) => {
Page.page = val;
......@@ -47,49 +49,21 @@ function getDataByParams(){
}
//子组件接收父组件传递过来的值
const props = defineProps({
searchData: {
type: Object,
required: true
},
option: {
type: Array,
required: true
},
queryParams: {
type: Object,
required: true
}
});
watch(
() => props.searchData,
(newData) => {
console.log('值',props.searchData)
data.value = props.searchData.rows;
console.log('值w',data.value)
Page.total = props.searchData.total
}
);
watch(
() => props.queryParams,
(newData) => {
params.value = newData
getDataNew(params.value)
console.log('值eeeee',params.value)
console.log('值ooo',props.queryParams)
}
)
watch(
() => props.option,
(newVal) => {
options.value = newVal
console.log('值ooo',options.value)
},
{ deep: true }
)
onMounted(
()=>{
getData()
}
)
getData()
function getData(){
const item = reactive({
page: Page.page,
......@@ -106,10 +80,80 @@ function getData(){
Page.rows = res.pageSize
})
}
function getName(name){
const option = options.value.find(item => item.stationId === name);
return option.stationName
function getName(name) {
if (data && data.value.length > 0 && name !== undefined && options && options.value.length > 0) {
const option = options.value.find(item => item.stationId === name);
return option.stationName
}
}
function getDataNew(item) {
getMoveListNewData(item).then(res => {
data.value = res.rows
Page.total = res.total
Page.rows = res.pageSize
})
}
getEnterprise();
function getEnterprise() {
const result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
//获取换热机组列表
function getSupplys() {
loading.value = true;
// tableData.length = 0;
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
result.forEach(element => {
let allItems = []
if (element.enterpriseId === enterpriseId.value) {
if (element.enterpriseId === "9bca54bc-8f27-4849-8d7d-50c5099e1949") {
element.serviceCenterList.forEach(center => {//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if (unit.stationId === station.stationId) {
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId,
unitId: unitId
})
});
});
})
} else {
element.supplyList.forEach(element => {
element.stationList.forEach(station => {
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId
})
})
})
}
}
options.value = allItems;
});
}
}
getSupplys()
</script>
<template>
......
......@@ -7,9 +7,6 @@ import zhCn from "element-plus/dist/locale/zh-cn.mjs"
import store from "../../../store/index.js";
import {
getMoveAlarmNumber,
getMoveListAlarmNewData,
getMoveListHistoryData,
getMoveListNewData,
exportMoveMonitorNewData,
exportMoveMonitorHistoryData,
exportMoveMonitorAlarmData,
......@@ -18,9 +15,7 @@ import {
const options = ref([]);
const enterpriseId = ref();
const props = { multiple: true, emitPath: false }
const props = {multiple: true, emitPath: false}
const {proxy} = getCurrentInstance();
// 列表
const topBtn = ref([
......@@ -30,6 +25,7 @@ const topBtn = ref([
]);
const selectedBtn = ref(null);
const optionsList = ref([])
const childParams = ref({})
// 默认显示的组件页面
const selectedComponent = ref(MoveMonitorNewDataPage);
......@@ -43,7 +39,7 @@ const alarmNum = ref(0);
const searchData = ref({});
// 点击标签页切换事件
const handleTabClick = (tab, event) => {
console.log('id',tab)
console.log('id', tab)
const itemName = tab.props.label
const selectedItem = topBtn.value.find(item => item.name === itemName.slice(0, 4));
if (selectedItem) {
......@@ -88,28 +84,23 @@ const search = () => {
beginTime: queryParams.startTime,
endTime: queryParams.endTime,
}
if(selectedBtn.value === 1) {
getMoveListNewData(item).then(res => {
searchData.value = res
Page.total = res.total
Page.rows = res.pageSize
})
}else if(selectedBtn.value === 2){
getMoveListHistoryData(item).then(res => {
searchData.value = res
Page.total = res.total
})
}else if(selectedBtn.value === 3){
getMoveListAlarmNewData(item).then(res => {
searchData.value = res
Page.total = res.total
})
getMoveAlarmNumber().then(res => {
alarmNum.value = res.data
})
if (selectedBtn.value === 1) {
childParams.value = item
} else if (selectedBtn.value === 2) {
childParams.value = item
} else if (selectedBtn.value === 3) {
childParams.value = item
}
console.log('查询:', item);
};
getNumber()
function getNumber() {
getMoveAlarmNumber().then(res => {
console.log('123123123123-----------', res.data)
alarmNum.value = res.data
})
}
/** 导出按钮操作 */
const handleExport = () => {
......@@ -120,8 +111,8 @@ const handleExport = () => {
beginTime: queryParams.startTime,
endTime: queryParams.endTime,
}
console.log('selectedBtn.value:',selectedBtn.value)
if (selectedBtn.value === 1){
console.log('selectedBtn.value:', selectedBtn.value)
if (selectedBtn.value === 1) {
console.log('11111')
exportMoveMonitorNewData(item).then(res => {
const blob = new Blob([res])
......@@ -134,7 +125,7 @@ const handleExport = () => {
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
})
} else if (selectedBtn.value === 2){
} else if (selectedBtn.value === 2) {
console.log('22222')
exportMoveMonitorHistoryData(item).then(res => {
const blob = new Blob([res])
......@@ -147,7 +138,7 @@ const handleExport = () => {
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
})
} else if (selectedBtn.value === 3){
} else if (selectedBtn.value === 3) {
console.log('33333')
exportMoveMonitorAlarmData(item).then(res => {
const blob = new Blob([res])
......@@ -172,119 +163,68 @@ const resetSearch = () => {
queryParams.alarmType = ''
queryParams.stationId = ''
searchData.value = {}
const item = reactive({
page: Page.page,
size: Page.rows,
stationId: '',
alarmStatus:'',
alarmType: '',
beginTime: '',
endTime: ''
})
// if (selectedBtn.value === 1) {
// getMoveListNewData(item).then(res => {
// searchData.value = res
// })
// } else if (selectedBtn.value === 2) {
// getMoveListHistoryData(item).then(res => {
// searchData.value = res
// })
// } else if (selectedBtn.value === 3) {
// getMoveListAlarmNewData(item).then(res => {
// searchData.value = res
// })
// getMoveAlarmNumber().then(res => {
// alarmNum.value = res.data
// })
// }
}
const loading = ref(true);
getEnterprise();
function getEnterprise(){
function getEnterprise() {
const result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
//获取换热机组列表
// function getSupplys(){
// loading.value = true;
// // tableData.length = 0;
// options.length = 0;
// stationId.length = 0;
// const result = store.getters.getEnterprise();
// 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 => {
// let chi = [];
// supply.transferList.forEach(unit => {
// chi.push({ value: unit.unitId, label: unit.unitName });
// });
// c.push({ children: chi, label: supply.supplyName});
// });
// options.push({children: c, label: center.serviceCenterName});
// })
// }else{
// element.supplyList.forEach(element => {
// let chi = [];
// element.transferList.forEach(unit => {
// chi.push({ value: unit.unitId, label: unit.unitName });
// })
// options.push({ children: chi, label: element.supplyName});
// })
// }
// }
// });
// }
// // stationId.value.push(options[0].children[0].children[0].value);
// }
//获取换热机组列表
function getSupplys(){
function getSupplys() {
loading.value = true;
// tableData.length = 0;
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
console.log('result:',result)
result.forEach(element=>{
console.log('result:', result)
result.forEach(element => {
let allItems = []
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{//遍历一级目录下的
if (element.enterpriseId === enterpriseId.value) {
if (element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()) {
element.serviceCenterList.forEach(center => {//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
console.log('supply:',supply)
console.log('supply:', supply)
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if(unit.stationId === station.stationId){
if (unit.stationId === station.stationId) {
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId,unitId: unitId})
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId,
unitId: unitId
})
});
});
})
}else{
} else {
element.supplyList.forEach(element => {
element.stationList.forEach(station => {
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId})
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId
})
})
})
}
}
options.value = allItems;
optionsList.value = options.value
});
}
}
getSupplys();
</script>
......@@ -293,8 +233,8 @@ getSupplys();
<div class="search-wrapper">
<el-form :model="queryParams" :inline="true" style="padding: 10px 0 0 10px">
<el-form-item label="换热站:">
<!-- <el-cascader :options="options" v-model="stationId" :props="props" collapse-tags clearable :show-all-levels="false"-->
<!-- placeholder="请选择" style="min-width: 210px;" />-->
<!-- <el-cascader :options="options" v-model="stationId" :props="props" collapse-tags clearable :show-all-levels="false"-->
<!-- placeholder="请选择" style="min-width: 210px;" />-->
<el-select v-model="queryParams.stationId" placeholder="请选择" style="min-width: 210px" filterable clearable>
<el-option
v-for="item in options"
......@@ -348,7 +288,7 @@ getSupplys();
>
</el-tab-pane>
</el-tabs>
<component :is="selectedComponent" :option="optionsList" :queryParams = 'queryParams' :search-data="searchData"></component>
<component :is="selectedComponent" :queryParams='childParams'></component>
</div>
</div>
......
......@@ -2,10 +2,14 @@
import {ref, reactive, defineProps, watch} from "vue";
import {getPipListAlarmData} from "../../../api/AIStation/PipelineTemp.js";
import {getRecycleListAlarmData} from "../../../api/AIStation/RecyclePump.js";
import {getMoveListAlarmNewData} from "../../../api/AIStation/MoveMonitor.js";
import store from "../../../store/index.js";
const TransTempAlarmData = ref([])
const params = ref({})
const options = ref([])
const enterpriseId = ref();
const loading = ref(true);
const tableHeaderClass = data => { // 表头样式
return 'table-header-class'
}
......@@ -31,41 +35,21 @@ const handleCurrentChange = (val) => {
};
//子组件接收父组件传递过来的值
const props = defineProps({
searchData: {
type: Object,
required: true
},
option: {
type: Array,
required: true
},
queryParams: {
type: Object,
required: true
}
});
watch(
() => props.searchData,
(newData) => {
TransTempAlarmData.value = props.searchData.rows;
Page.total = props.searchData.total;
}
);
watch(
() => props.queryParams,
(newData) => {
params.value = newData
getDataNew(params.value)
console.log('值eeeee',params.value)
}
)
watch(
() => props.option,
(newVal) => {
options.value = props.option
console.log('值eeeerrrrr',options.value)
},
{ deep: true }
)
getData()
function getData(){
const item = reactive({
......@@ -91,10 +75,80 @@ function getDataByParams(){
Page.rows = res.pageSize
})
}
function getName(name){
const option = options.value.find(item => item.stationId === name);
return option.stationName
function getName(name) {
if (TransTempAlarmData && TransTempAlarmData.value.length > 0 && name !== undefined && options && options.value.length > 0) {
const option = options.value.find(item => item.stationId === name);
return option.stationName
}
}
function getDataNew(item) {
getRecycleListAlarmData(item).then(res => {
TransTempAlarmData.value = res.rows
Page.total = res.total
Page.rows = res.pageSize
})
}
getEnterprise();
function getEnterprise() {
const result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
//获取换热机组列表
function getSupplys() {
loading.value = true;
// tableData.length = 0;
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
result.forEach(element => {
let allItems = []
if (element.enterpriseId === enterpriseId.value) {
if (element.enterpriseId === "9bca54bc-8f27-4849-8d7d-50c5099e1949") {
element.serviceCenterList.forEach(center => {//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if (unit.stationId === station.stationId) {
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId,
unitId: unitId
})
});
});
})
} else {
element.supplyList.forEach(element => {
element.stationList.forEach(station => {
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId
})
})
})
}
}
options.value = allItems;
});
}
}
getSupplys()
</script>
<template>
......
<script setup>
import {reactive, ref, onMounted, watch} from "vue";
import {getPipListHistoryData} from "../../../api/AIStation/PipelineTemp.js";
import {getRecycleListHistoryData} from "../../../api/AIStation/RecyclePump.js";
import {getRecycleListAlarmData, getRecycleListHistoryData} from "../../../api/AIStation/RecyclePump.js";
import store from "../../../store/index.js";
const RecyclePumpData = ref([]);
const params = ref({})
const options = ref([])
const enterpriseId = ref();
const loading = ref(true);
// 分页
const Page = reactive({ total: 0, rows: 20, page: 1 });
......@@ -47,43 +50,22 @@ onMounted(() => {
});
//子组件接收父组件传递过来的值
const props = defineProps({
searchData: {
type: Object,
required: true
},
option: {
type: Array,
required: true
},
queryParams: {
type: Object,
required: true
}
});
watch(
() => props.searchData,
(newData) => {
console.log('值',props.searchData)
RecyclePumpData.value = props.searchData.rows;
Page.total = props.searchData.total
}
);
watch(
() => props.queryParams,
(newData) => {
params.value = newData
getDataNew(params.value)
console.log('值eeeee',params.value)
console.log('值ooo',props.queryParams)
}
)
watch(
() => props.option,
(newVal) => {
options.value = props.option
console.log('值ooo',options.value)
},
{ deep: true }
)
getData()
function getData() {
const item = reactive({
......@@ -108,10 +90,80 @@ function getDataByParams(){
Page.rows = res.pageSize
})
}
function getName(name){
const option = options.value.find(item => item.stationId === name);
return option.stationName
function getName(name) {
if (RecyclePumpData && RecyclePumpData.value.length > 0 && name !== undefined && options && options.value.length > 0) {
const option = options.value.find(item => item.stationId === name);
return option.stationName
}
}
function getDataNew(item) {
getRecycleListHistoryData(item).then(res => {
RecyclePumpData.value = res.rows
Page.total = res.total
Page.rows = res.pageSize
})
}
getEnterprise();
function getEnterprise() {
const result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
//获取换热机组列表
function getSupplys() {
loading.value = true;
// tableData.length = 0;
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
result.forEach(element => {
let allItems = []
if (element.enterpriseId === enterpriseId.value) {
if (element.enterpriseId === "9bca54bc-8f27-4849-8d7d-50c5099e1949") {
element.serviceCenterList.forEach(center => {//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if (unit.stationId === station.stationId) {
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId,
unitId: unitId
})
});
});
})
} else {
element.supplyList.forEach(element => {
element.stationList.forEach(station => {
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId
})
})
})
}
}
options.value = allItems;
});
}
}
getSupplys()
</script>
<template>
......
<script setup>
import {reactive, ref, onMounted, watch} from "vue";
import {getPipListNewData} from "../../../api/AIStation/PipelineTemp.js";
import {getRecycleListNewData} from "../../../api/AIStation/RecyclePump.js";
import {getRecycleListHistoryData, getRecycleListNewData} from "../../../api/AIStation/RecyclePump.js";
import store from "../../../store/index.js";
const RecyclePumpData = ref([]);
const params = ref({})
const options = ref([])
const enterpriseId = ref();
const loading = ref(true);
// 分页
const Page = reactive({ total: 0, rows: 20, page: 1 });
......@@ -47,44 +50,22 @@ onMounted(() => {
});
//子组件接收父组件传递过来的值
const props = defineProps({
searchData: {
type: Object,
required: true
},
option: {
type: Array,
required: true
},
queryParams: {
type: Object,
required: true
}
});
watch(
() => props.searchData,
(newData) => {
console.log('值',props.searchData)
RecyclePumpData.value = props.searchData.rows;
console.log('值w',data.value)
Page.total = props.searchData.total
}
);
watch(
() => props.queryParams,
(newData) => {
params.value = newData
getDataNew(params.value)
console.log('值eeeee',params.value)
console.log('值ooo',props.queryParams)
}
)
watch(
() => props.option,
(newVal) => {
options.value = props.option
console.log('值ooo',options.value)
},
{ deep: true }
)
getData()
function getData(){
const item = reactive({
......@@ -109,10 +90,80 @@ function getDataByParams(){
Page.rows = res.pageSize
})
}
function getName(name){
const option = options.value.find(item => item.stationId === name);
return option.stationName
function getName(name) {
if (RecyclePumpData && RecyclePumpData.value.length > 0 && name !== undefined && options && options.value.length > 0) {
const option = options.value.find(item => item.stationId === name);
return option.stationName
}
}
function getDataNew(item) {
getRecycleListNewData(item).then(res => {
RecyclePumpData.value = res.rows
Page.total = res.total
Page.rows = res.pageSize
})
}
getEnterprise();
function getEnterprise() {
const result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
//获取换热机组列表
function getSupplys() {
loading.value = true;
// tableData.length = 0;
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
result.forEach(element => {
let allItems = []
if (element.enterpriseId === enterpriseId.value) {
if (element.enterpriseId === "9bca54bc-8f27-4849-8d7d-50c5099e1949") {
element.serviceCenterList.forEach(center => {//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if (unit.stationId === station.stationId) {
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId,
unitId: unitId
})
});
});
})
} else {
element.supplyList.forEach(element => {
element.stationList.forEach(station => {
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId
})
})
})
}
}
options.value = allItems;
});
}
}
getSupplys()
</script>
<template>
......
......@@ -5,17 +5,8 @@ import RecyclePumpHistoryPage from './RecyclePumpHistoryPage.vue' // 导入组
import RecyclePumpAlarmPage from './RecyclePumpAlarmPage.vue' // 导入组件
import zhCn from "element-plus/dist/locale/zh-cn.mjs"
import store from "../../../store/index.js";
import {
getPipAlarmNumber,
getPipListAlarmData,
getPipListHistoryData,
getPipListNewData
} from "../../../api/AIStation/PipelineTemp.js";
import {
getRecycleAlarmNumber,
getRecycleListAlarmData,
getRecycleListHistoryData,
getRecycleListNewData,
exportRecyclePumpNewData,
exportRecyclePumpHistoryData,
exportRecyclePumpAlarmData,
......@@ -29,7 +20,7 @@ const topBtn = ref([
{id: 3, name: '报警信息', component: RecyclePumpAlarmPage}
]);
const selectedBtn = ref(null);
const dateRange = ref([])
const childParams = ref({})
// 默认显示的组件页面
const selectedComponent = ref(RecyclePumpNewDataPage);
......@@ -115,28 +106,23 @@ const search = () => {
startTime: queryParams.startTime,
endTime: queryParams.endTime,
}
if(selectedBtn.value === 1) {
getRecycleListNewData(item).then(res => {
searchData.value = res
Page.total = res.total
Page.rows = res.pageSize
})
}else if(selectedBtn.value === 2){
getRecycleListHistoryData(item).then(res => {
searchData.value = res
Page.total = res.total
})
}else if(selectedBtn.value === 3){
getRecycleListAlarmData(item).then(res => {
searchData.value = res
Page.total = res.total
})
getRecycleAlarmNumber().then(res => {
alarmNum.value = res.data
})
if (selectedBtn.value === 1) {
childParams.value = item
} else if (selectedBtn.value === 2) {
childParams.value = item
} else if (selectedBtn.value === 3) {
childParams.value = item
}
console.log('查询:', item);
};
getNumber()
function getNumber() {
getRecycleAlarmNumber().then(res => {
console.log('123123123123-----------', res.data)
alarmNum.value = res.data
})
}
/** 导出按钮操作 */
const handleExport = () => {
......@@ -147,8 +133,8 @@ const handleExport = () => {
beginTime: queryParams.startTime,
endTime: queryParams.endTime,
}
console.log('selectedBtn.value:',selectedBtn.value)
if (selectedBtn.value === 1){
console.log('selectedBtn.value:', selectedBtn.value)
if (selectedBtn.value === 1) {
console.log('11111')
exportRecyclePumpNewData(item).then(res => {
const blob = new Blob([res])
......@@ -161,7 +147,7 @@ const handleExport = () => {
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
})
} else if (selectedBtn.value === 2){
} else if (selectedBtn.value === 2) {
console.log('22222')
exportRecyclePumpHistoryData(item).then(res => {
const blob = new Blob([res])
......@@ -174,7 +160,7 @@ const handleExport = () => {
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
})
} else if (selectedBtn.value === 3){
} else if (selectedBtn.value === 3) {
console.log('33333')
exportRecyclePumpAlarmData(item).then(res => {
const blob = new Blob([res])
......@@ -199,122 +185,70 @@ const resetSearch = () => {
queryParams.alarmType = ''
queryParams.stationId = ''
searchData.value = {}
const item = reactive({
page: Page.page,
size: Page.rows,
stationId: '',
alarmStatus:'',
alarmType: '',
beginTime: '',
endTime: ''
})
// if (selectedBtn.value === 1) {
// getRecycleListNewData(item).then(res => {
// searchData.value = res
// })
// } else if (selectedBtn.value === 2) {
// getRecycleListHistoryData(item).then(res => {
// searchData.value = res
// })
// } else if (selectedBtn.value === 3) {
// getRecycleListAlarmData(item).then(res => {
// searchData.value = res
// })
// getRecycleAlarmNumber().then(res => {
// alarmNum.value = res.data
// })
// }
};
const options = ref([]);
const optionsList = ref([]);
const enterpriseId = ref();
const props = { multiple: true, emitPath: false }
const props = {multiple: true, emitPath: false}
const loading = ref(true);
getEnterprise();
function getEnterprise(){
function getEnterprise() {
const result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
//获取换热机组列表
// function getSupplys(){
// loading.value = true;
// // tableData.length = 0;
// options.length = 0;
// stationId.length = 0;
// const result = store.getters.getEnterprise();
// 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 => {
// let chi = [];
// supply.transferList.forEach(unit => {
// chi.push({ value: unit.unitId, label: unit.unitName });
// });
// c.push({ children: chi, label: supply.supplyName});
// });
// options.push({children: c, label: center.serviceCenterName});
// })
// }else{
// element.supplyList.forEach(element => {
// let chi = [];
// element.transferList.forEach(unit => {
// chi.push({ value: unit.unitId, label: unit.unitName });
// })
// options.push({ children: chi, label: element.supplyName});
// })
// }
// }
// });
// }
// // stationId.value.push(options[0].children[0].children[0].value);
// }
//获取换热机组列表
function getSupplys(){
function getSupplys() {
loading.value = true;
// tableData.length = 0;
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
console.log('result:',result)
result.forEach(element=>{
console.log('result:', result)
result.forEach(element => {
let allItems = []
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{//遍历一级目录下的
if (element.enterpriseId === enterpriseId.value) {
if (element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()) {
element.serviceCenterList.forEach(center => {//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
console.log('supply:',supply)
console.log('supply:', supply)
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if(unit.stationId === station.stationId){
if (unit.stationId === station.stationId) {
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId,unitId: unitId})
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId,
unitId: unitId
})
});
});
})
}else{
} else {
element.supplyList.forEach(element => {
element.stationList.forEach(station => {
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId})
allItems.push({
stationId: station.stationId,
stationName: station.stationName,
supplyId: station.supplyId
})
})
})
}
}
options.value = allItems;
optionsList.value = allItems;
});
}
}
getSupplys();
</script>
......@@ -323,8 +257,8 @@ getSupplys();
<div class="search-wrapper">
<el-form :model="queryParams" :inline="true" style="padding: 10px 0 0 10px">
<el-form-item label="换热站:">
<!-- <el-cascader :options="options" v-model="stationId" :props="props" collapse-tags clearable :show-all-levels="false"-->
<!-- placeholder="请选择" style="min-width: 210px;" />-->
<!-- <el-cascader :options="options" v-model="stationId" :props="props" collapse-tags clearable :show-all-levels="false"-->
<!-- placeholder="请选择" style="min-width: 210px;" />-->
<el-select v-model="queryParams.stationId" placeholder="请选择" style="min-width: 210px" filterable clearable>
<el-option
v-for="item in options"
......@@ -378,7 +312,7 @@ getSupplys();
>
</el-tab-pane>
</el-tabs>
<component :is="selectedComponent" :option="optionsList" :queryParams = 'queryParams' :search-data="searchData"></component>
<component :is="selectedComponent" :queryParams='childParams'></component>
</div>
</div>
......
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