Commit f182416c authored by hubaoshan's avatar hubaoshan

结束时间不能早于开始时间等bug

parent 52e4eb8a
......@@ -25,5 +25,5 @@ export const exportTransTempHistoryData = (item) =>{
}
export const exportTransTempAlarmData = (item) =>{
return httpTwo.get(`/bustransfertemperaturealarm/export?stationId=${item.stationId}&alarmStatus=${item.alarmStatus}&beginTime=${item.beginTime}&endTime=${item.endTime}&alarmType=${item.alarmType}`,'','',{responseType:'blob'})
return httpTwo.get(`/bustransfertemperaturealarm/export?stationId=${item.stationId}&handleStatus=${item.handleStatus}&alarmStatus=${item.alarmStatus}&beginTime=${item.beginTime}&endTime=${item.endTime}&alarmType=${item.alarmType}`,'','',{responseType:'blob'})
}
......@@ -13,6 +13,7 @@ import {
exportExtinguisherAlarmData, getListNewData
} from "../../../api/AIStation/Extinguisher.js";
import {useRoute} from "vue-router";
import {ElMessage} from "element-plus";
const options = ref([]);
const enterpriseId = ref();
......@@ -220,9 +221,31 @@ const resetSearch = () => {
endTime: '',
}
console.log('queryParams:',queryParams)
getData()
// getData()
}
watch(
() => queryParams.endTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.endTime = '';
}
}
)
watch(
() => queryParams.beginTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.beginTime = '';
}
}
)
const loading = ref(true);
getEnterprise();
......@@ -338,16 +361,6 @@ watch(
selectedBtn.value = 1
// 路由变化,执行相应操作
performActions()
// handleGetAIToken();
// const checkAIToken = setInterval(() => {
// if (localStorage.getItem('AIToken')) {
// clearInterval(checkAIToken); // 停止轮询
// getNumber();
// // getData();
// resetSearch();
// }
// }, 100); // 每100ms检查一次
// console.log('route.path', route.path)
}
},
{ immediate: true } // 只在路径变化时触发
......@@ -398,7 +411,7 @@ watch(
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search" class="add-search-btn">查询</el-button>
<el-button type="primary" @click="resetSearch()" class="add-search-btn" v-if="selectedBtn !== 3">重置</el-button>
<el-button type="primary" @click="resetSearch()" class="add-search-btn">重置</el-button>
<el-button type="primary" @click="handleExport()" class="add-search-btn">导出</el-button>
</el-form-item>
</el-form>
......
......@@ -14,6 +14,7 @@ import {
import {useRoute} from "vue-router";
import {handleGetAIToken} from "../AItoken.js";
import ExtinguisherNewDataPage from "../ExtinguisherPage/ExtinguisherNewDataPage.vue";
import {ElMessage} from "element-plus";
const options = ref([]);
......@@ -218,7 +219,7 @@ const resetSearch = () => {
beginTime: '',
endTime: '',
}
getData()
// getData()
}
const loading = ref(true);
......@@ -337,21 +338,33 @@ watch(
selectedBtn.value = 1
// 路由变化,执行相应操作
performActions()
// handleGetAIToken();
// // 轮询检测 localStorage 是否更新
// const checkAIToken = setInterval(() => {
// if (localStorage.getItem('AIToken')) {
// clearInterval(checkAIToken); // 停止轮询
// getNumber();
// // getData();
// resetSearch();
// }
// }, 100); // 每100ms检查一次
// console.log('route.path', route.path)
}
},
{ immediate: true } // 只在路径变化时触发
)
watch(
() => queryParams.endTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.endTime = '';
}
}
)
watch(
() => queryParams.beginTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.beginTime = '';
}
}
)
</script>
<template>
<div class="app-content">
......
......@@ -15,6 +15,7 @@ import {
import {useRoute} from "vue-router";
import {handleGetAIToken} from "../AItoken.js";
import RecyclePumpNewDataPage from "../RecyclePumpPage/RecyclePumpNewDataPage.vue";
import {ElMessage} from "element-plus";
const {proxy} = getCurrentInstance();
......@@ -242,7 +243,7 @@ const resetSearch = () => {
beginTime: '',
endTime: '',
}
getData()
// getData()
}
const options = ref([]);
const enterpriseId = ref();
......@@ -362,21 +363,33 @@ watch(
selectedBtn.value = 1
// 路由变化,执行相应操作
performActions()
// handleGetAIToken();
// // 轮询检测 localStorage 是否更新
// const checkAIToken = setInterval(() => {
// if (localStorage.getItem('AIToken')) {
// clearInterval(checkAIToken); // 停止轮询
// getNumber();
// // getData();
// resetSearch();
// }
// }, 100); // 每100ms检查一次
// console.log('route.path', route.path)
}
},
{ immediate: true } // 只在路径变化时触发
)
watch(
() => queryParams.endTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.endTime = '';
}
}
)
watch(
() => queryParams.beginTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.beginTime = '';
}
}
)
</script>
<template>
<div class="app-content">
......@@ -428,7 +441,7 @@ watch(
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search" class="add-search-btn">查询</el-button>
<el-button type="primary" @click="resetSearch" class="add-search-btn" v-if="selectedBtn !== 3">重置</el-button>
<el-button type="primary" @click="resetSearch" class="add-search-btn">重置</el-button>
<el-button type="primary" @click="handleExport()" class="add-search-btn">导出</el-button>
</el-form-item>
<!-- <div>-->
......
......@@ -13,6 +13,7 @@ import {
} from "../../../api/AIStation/RecyclePump.js";
import {handleGetAIToken} from "../AItoken.js";
import {useRoute} from "vue-router";
import {ElMessage} from "element-plus";
const {proxy} = getCurrentInstance();
// 列表
......@@ -193,16 +194,16 @@ const resetSearch = () => {
queryParams.endTime = ''
queryParams.stationId = ''
searchData.value = []
// childParams.value = {
// // page: Page.page,
// // size: Page.rows,
// // stationId: '',
// // alarmStatus: '',
// // alarmType: '',
// // beginTime: '',
// // endTime: '',
// }
getData()
childParams.value = {
page: Page.page,
size: Page.rows,
stationId: '',
alarmStatus: '',
alarmType: '',
beginTime: '',
endTime: '',
}
// getData()
};
const childComponentRef = ref(null);
// 子组件getData()方法
......@@ -335,6 +336,29 @@ function getSupplys(){
// stationId.value.push(options[0].children[0].children[0].value);
}
getSupplys();
watch(
() => queryParams.endTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.endTime = '';
}
}
)
watch(
() => queryParams.beginTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.beginTime = '';
}
}
)
</script>
<template>
<div class="app-content">
......@@ -381,7 +405,7 @@ getSupplys();
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search" class="add-search-btn">查询</el-button>
<el-button type="primary" @click="resetSearch" class="add-search-btn" v-if="selectedBtn !== 3">重置</el-button>
<el-button type="primary" @click="resetSearch" class="add-search-btn">重置</el-button>
<el-button type="primary" @click="handleExport" class="add-search-btn">导出</el-button>
</el-form-item>
</el-form>
......
......@@ -252,10 +252,10 @@ function handleDetail(item){
</template>
</el-table-column>
<el-table-column prop="handleStatus" align="center" label="处理状态" sortable :sort-map="sortMapData">
<template #header>
<span>处理状态</span>
<el-button size="small" @click="handleStatus1">操作</el-button>
</template>
<!-- <template #header>-->
<!-- <span>处理状态</span>-->
<!-- <el-button size="small" @click="handleStatus1">操作</el-button>-->
<!-- </template>-->
<template #default="scope">
<span v-if="scope.row.handleStatus=== 0" style="color: red">未处理</span>
<span v-else-if="scope.row.handleStatus=== 1">已处理</span>
......
......@@ -196,7 +196,7 @@ const handleSortChange = (data) => {
:data="TransTempHistoryData"
border
style="width: 98%;margin-left: 15px"
height="calc(100vh - 280px)"
height="calc(100vh - 330px)"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass"
@sort-change="handleSortChange"
......
......@@ -23,6 +23,7 @@ import {
import {getPipAlarmNumber} from "../../../api/AIStation/PipelineTemp.js";
import {useRoute} from "vue-router";
import {handleGetAIToken} from "../AItoken.js";
import {ElMessage} from "element-plus";
const {proxy} = getCurrentInstance();
// 列表
......@@ -79,7 +80,16 @@ const alarmStatusList = [
value: 1
}
]
const handleStatusList = [
{
label: '未处理',
value: 0
},
{
label: '已处理',
value: 1
}
]
const alarmTypeList = [
{
label: '最高温度',
......@@ -107,6 +117,7 @@ const alarmTypeList = [
}
]
const queryParams = reactive({
handleStatus: '',
stationId: '',
alarmStatus: '',
alarmType: '',
......@@ -118,7 +129,7 @@ const Page = reactive({total: 0, rows: 20, page: 1});
const searchData = ref([]);
const search = () => {
let stationId = ''
if (queryParams.stationId === undefined){
if (queryParams.stationId === undefined) {
stationId = queryParams.stationId = ''
} else {
stationId = queryParams.stationId[2]
......@@ -127,24 +138,28 @@ const search = () => {
page: Page.page,
size: Page.rows,
stationId: stationId,
handleStatus:queryParams.handleStatus,
alarmStatus: queryParams.alarmStatus,
alarmType: queryParams.alarmType,
beginTime: queryParams.beginTime,
endTime: queryParams.endTime,
}
if (item.stationId === undefined){
if (item.stationId === undefined) {
item.stationId = ''
}
if (item.beginTime == null){
if (item.beginTime == null) {
item.beginTime = ''
}
if (item.endTime == null){
if (item.endTime == null) {
item.endTime = ''
}
if (item.alarmStatus === undefined){
if (item.alarmStatus === undefined) {
item.alarmStatus = ''
}
if (item.alarmType === undefined){
if (item.handleStatus === undefined) {
item.handleStatus = ''
}
if (item.alarmType === undefined) {
item.alarmType = ''
}
if (selectedBtn.value === 1) {
......@@ -167,25 +182,29 @@ function getNumber() {
/** 导出按钮操作 */
const handleExport = () => {
const item = {
handleStatus:queryParams.handleStatus,
stationId: queryParams.stationId,
alarmStatus: queryParams.alarmStatus,
alarmType: queryParams.alarmType,
beginTime: queryParams.beginTime,
endTime: queryParams.endTime,
}
if (item.stationId === undefined){
if (item.stationId === undefined) {
item.stationId = ''
}
if (item.beginTime == null){
if (item.beginTime == null) {
item.beginTime = ''
}
if (item.endTime == null){
if (item.endTime == null) {
item.endTime = ''
}
if (item.alarmStatus === undefined){
if (item.alarmStatus === undefined) {
item.alarmStatus = ''
}
if (item.alarmType === undefined){
if (item.handleStatus === undefined) {
item.handleStatus = ''
}
if (item.alarmType === undefined) {
item.alarmType = ''
}
console.log('selectedBtn.value:', selectedBtn.value)
......@@ -234,6 +253,7 @@ const handleExport = () => {
// 重置
const resetSearch = () => {
queryParams.handleStatus = ''
queryParams.alarmStatus = ''
queryParams.beginTime = ''
queryParams.endTime = ''
......@@ -244,12 +264,13 @@ const resetSearch = () => {
page: Page.page,
size: Page.rows,
stationId: '',
handleStatus: '',
alarmStatus: '',
alarmType: '',
beginTime: '',
endTime: '',
}
getData()
// getData()
};
const options = ref([]);
const enterpriseId = ref();
......@@ -264,81 +285,33 @@ function getEnterprise() {
}
}
// 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 => {
// let allItems = []
// 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)
// 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;
// });
// }
// }
function getSupplys(){
function getSupplys() {
loading.value = true;
// tableData.length = 0;
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
let allItems = []
result.forEach(element=>{
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{
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.stationList.forEach(station => {
chi.push({ value: station.stationId, label: station.stationName });
chi.push({value: station.stationId, label: station.stationName});
});
c.push({ children: chi, label: supply.supplyName});
c.push({children: chi, label: supply.supplyName});
});
allItems.push({children: c, label: center.serviceCenterName});
})
}else{
} else {
element.supplyList.forEach(element => {
let chi = [];
element.stationList.forEach(station => {
chi.push({ value: station.stationId, label: station.stationName });
chi.push({value: station.stationId, label: station.stationName});
})
allItems.push({children: chi, label: element.serviceCenterName});
})
......@@ -349,6 +322,7 @@ function getSupplys(){
}
// stationId.value.push(options[0].children[0].children[0].value);
}
getSupplys();
getNumber()
const performActions = async () => {
......@@ -365,26 +339,38 @@ const number = ref(0)
watch(
() => route.path, // 只监听路径变化
() => {
if(route.path === '/AIStation/TransTemp') {
if (route.path === '/AIStation/TransTemp') {
selectedComponent.value = TransTempNewDataPage
activeName.value = TransTempNewDataPage;
selectedBtn.value = 1
// 路由变化,执行相应操作
performActions()
// handleGetAIToken();
// // 轮询检测 localStorage 是否更新
// const checkAIToken = setInterval(() => {
// if (localStorage.getItem('AIToken')) {
// clearInterval(checkAIToken); // 停止轮询
// getNumber();
// // getData();
// resetSearch();
// }
// }, 100); // 每100ms检查一次
// console.log('route.path', route.path)
}
},
{ immediate: true } // 只在路径变化时触发
{immediate: true} // 只在路径变化时触发
)
watch(
() => queryParams.endTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.endTime = '';
}
}
)
watch(
() => queryParams.beginTime,
() => {
if (queryParams.endTime && queryParams.beginTime && queryParams.endTime < queryParams.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.beginTime = '';
}
}
)
</script>
<template>
......@@ -392,22 +378,27 @@ watch(
<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="queryParams.stationId" filterable clearable :show-all-levels="false"
placeholder="请选择" style="min-width: 210px;" />
<!-- <el-select v-model="queryParams.stationId" placeholder="请选择" style="min-width: 200px" filterable clearable>-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.value"-->
<!-- :label="item.stationName"-->
<!-- :value="item.stationId">-->
<!-- </el-option>-->
<!-- </el-select>-->
<el-cascader :options="options" v-model="queryParams.stationId" filterable clearable :show-all-levels="false"
placeholder="请选择" style="min-width: 210px;"/>
<!-- <el-select v-model="queryParams.stationId" placeholder="请选择" style="min-width: 200px" filterable clearable>-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.value"-->
<!-- :label="item.stationName"-->
<!-- :value="item.stationId">-->
<!-- </el-option>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item label="告警状态:" prop="alarmStatus" v-show="selectedBtn === 1 || selectedBtn === 2">
<el-select placeholder="请选择" clearable style="width: 200px" v-model="queryParams.alarmStatus">
<el-option v-for="item in alarmStatusList" :key="item.value" :value="item.value" :label="item.label"/>
</el-select>
</el-form-item>
<el-form-item label="处理状态:" prop="handleStatus" v-show=" selectedBtn === 3">
<el-select placeholder="请选择" clearable style="width: 200px" v-model="queryParams.handleStatus">
<el-option v-for="item in handleStatusList" :key="item.value" :value="item.value" :label="item.label"/>
</el-select>
</el-form-item>
<el-form-item label="报警类型:" prop="alarmType" v-show="selectedBtn === 3">
<el-select placeholder="请选择" clearable style="width: 200px" v-model="queryParams.alarmType">
<el-option v-for="item in alarmTypeList" :key="item.value" :value="item.value" :label="item.label"/>
......@@ -437,15 +428,15 @@ watch(
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search" class="add-search-btn">查询</el-button>
<el-button type="primary" @click="resetSearch" class="add-search-btn" v-if="selectedBtn !== 3">重置</el-button>
<el-button type="primary" @click="resetSearch" class="add-search-btn">重置</el-button>
<el-button type="primary" @click="handleExport" class="add-search-btn">导出</el-button>
</el-form-item>
<!-- <div>-->
<!-- <el-form-item v-if="selectedBtn === 3">-->
<!-- <el-button type="primary" @click="search" class="add-search-btn">查询</el-button>-->
<!-- <el-button type="primary" @click="handleExport" class="add-search-btn">导出</el-button>-->
<!-- </el-form-item>-->
<!-- </div>-->
<!-- <div>-->
<!-- <el-form-item v-if="selectedBtn === 3">-->
<!-- <el-button type="primary" @click="search" class="add-search-btn">查询</el-button>-->
<!-- <el-button type="primary" @click="handleExport" class="add-search-btn">导出</el-button>-->
<!-- </el-form-item>-->
<!-- </div>-->
</el-form>
</div>
<div>
......@@ -458,7 +449,8 @@ watch(
>
</el-tab-pane>
</el-tabs>
<component :is="selectedComponent" ref="childComponentRef" :queryParams='childParams' :search-data="searchData"></component>
<component :is="selectedComponent" ref="childComponentRef" :queryParams='childParams'
:search-data="searchData"></component>
</div>
</div>
......
......@@ -604,7 +604,7 @@ function validateIp(rule, value, callback) {
<div class="search-wrapper">
<el-form style="padding: 10px 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="换热站:">
<el-cascader :options="options" v-model="queryParams.stationId" filterable clearable :show-all-levels="false"
<el-cascader :options="options" v-model="queryParams.stationId" filterable 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-->
......@@ -707,7 +707,7 @@ function validateIp(rule, value, callback) {
<el-form label-width="80px">
<el-form-item label="换热站:">
<el-cascader :options="options" v-model="addOrUpdateForm.stationId" filterable clearable :show-all-levels="false"
placeholder="请选择" style="min-width: 810px;" />
placeholder="请选择" style="min-width: 652px;" />
<!-- <el-select v-model="addOrUpdateForm.stationId" placeholder="请选择" filterable clearable>-->
<!-- <el-option-->
<!-- v-for="item in options"-->
......
......@@ -142,7 +142,29 @@ const resetSearch = () => {
loadData();
};
watch(
() => queryParams.value.endTime,
() => {
if (queryParams.value.endTime && queryParams.value.beginTime && queryParams.value.endTime < queryParams.value.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.value.endTime = '';
}
}
)
watch(
() => queryParams.value.beginTime,
() => {
if (queryParams.value.endTime && queryParams.value.beginTime && queryParams.value.endTime < queryParams.value.beginTime) {
ElMessage.error({
message: '结束时间不能早于开始时间!'
})
queryParams.value.beginTime = '';
}
}
)
getEnterprise();
function getEnterprise(){
const result = store.getters.getEnterprise();
......
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