数据报表查询改为 默认天数据查询

This commit is contained in:
zhangyue 2026-07-28 15:24:37 +08:00
parent 7b1e701ee3
commit eff70e8ab5
1 changed files with 60 additions and 35 deletions

View File

@ -25,46 +25,60 @@
</a-col>
<!-- 设备 -->
<!-- <a-col :xs="24" :sm="12" :md="6" :lg="5">-->
<!-- <div class="filter-item">-->
<!-- <span class="filter-label">设备</span>-->
<!-- <a-select-->
<!-- v-model:value="selectedCategory"-->
<!-- placeholder="请选择设备"-->
<!-- :loading="categoryLoading"-->
<!-- allow-clear-->
<!-- show-search-->
<!-- :filter-option="filterOption"-->
<!-- style="flex: 1; min-width: 0"-->
<!-- >-->
<!-- <a-select-option v-for="item in categoryOptions" :key="item.id" :value="item.id">-->
<!-- {{ item.deployDes }}-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- </div>-->
<!-- </a-col>-->
<!-- <a-col :xs="24" :sm="12" :md="6" :lg="5">-->
<!-- <div class="filter-item">-->
<!-- <span class="filter-label">设备</span>-->
<!-- <a-select-->
<!-- v-model:value="selectedCategory"-->
<!-- placeholder="请选择设备"-->
<!-- :loading="categoryLoading"-->
<!-- allow-clear-->
<!-- show-search-->
<!-- :filter-option="filterOption"-->
<!-- style="flex: 1; min-width: 0"-->
<!-- >-->
<!-- <a-select-option v-for="item in categoryOptions" :key="item.id" :value="item.id">-->
<!-- {{ item.deployDes }}-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- </div>-->
<!-- </a-col>-->
<!-- 统计模式 -->
<a-col :xs="24" :sm="12" :md="5" :lg="4">
<div class="filter-item">
<span class="filter-label">模式</span>
<a-select v-model:value="selectedDimension" placeholder="请选择" style="flex: 1; min-width: 0">
<a-select-option value="dayhours">日统计</a-select-option>
<a-select-option value="monthDays">月统计</a-select-option>
<a-select-option value="yearMonth">年统计</a-select-option>
</a-select>
</div>
</a-col>
<!-- <a-col :xs="24" :sm="12" :md="5" :lg="4">-->
<!-- <div class="filter-item">-->
<!-- <span class="filter-label">模式</span>-->
<!-- <a-select v-model:value="selectedDimension" placeholder="请选择" style="flex: 1; min-width: 0">-->
<!-- <a-select-option value="dayhours">日统计</a-select-option>-->
<!-- <a-select-option value="monthDays">月统计</a-select-option>-->
<!-- <a-select-option value="yearMonth">年统计</a-select-option>-->
<!-- </a-select>-->
<!-- </div>-->
<!-- </a-col>-->
<!-- 日期 -->
<!-- <a-col :xs="24" :sm="12" :md="6" :lg="5">-->
<!-- <div class="filter-item">-->
<!-- <span class="filter-label">日期</span>-->
<!-- <a-date-picker-->
<!-- v-model:value="selectedDate"-->
<!-- :format="dateFormat"-->
<!-- :picker="pickerType"-->
<!-- :placeholder="datePlaceholder"-->
<!-- style="flex: 1; min-width: 0"-->
<!-- />-->
<!-- </div>-->
<!-- </a-col>-->
<a-col :xs="24" :sm="12" :md="6" :lg="5">
<div class="filter-item">
<span class="filter-label">日期</span>
<a-date-picker
<a-range-picker
range
v-model:value="selectedDate"
:format="dateFormat"
:picker="pickerType"
:placeholder="datePlaceholder"
:placeholder="['开始日期', '结束日期']"
style="flex: 1; min-width: 0"
/>
</div>
@ -188,10 +202,15 @@
const params = {
stationCode: stationCode,
// deployId: deployId,
summaryMode: summaryMode || 'dayhours',
startTime: startTime,
summaryMode: summaryMode || 'customDays',
// startTime: startTime,
};
if (startTime && Array.isArray(startTime) && startTime.length === 2) {
params.startTime = startTime[0]?.format(dateFormat.value) || null;
params.endTime = startTime[1]?.format(dateFormat.value) || null;
}
getDeviceAlertStatistic(params)
.then((res) => {
if (res.success) {
@ -204,7 +223,7 @@
// 使 highVal""
if (itemDetail.highVal) {
markLines.push({
name: itemDetail.itemName +'高阈值',
name: itemDetail.itemName + '高阈值',
value: itemDetail.highVal,
color: '#fcc419',
type: 'dashed',
@ -213,7 +232,7 @@
// 使 lowVal""
if (itemDetail.lowVal) {
markLines.push({
name: itemDetail.itemName +'低阈值',
name: itemDetail.itemName + '低阈值',
value: itemDetail.lowVal,
color: '#ff6b6b',
type: 'dotted',
@ -252,7 +271,7 @@
const chartInstances = [];
const chartRefs = {};
const selectedDimension = ref('dayhours');
const selectedDimension = ref('customDays');
const selectedDate = ref(null);
// ==================== ====================
@ -262,6 +281,8 @@
return 'YYYY-MM-DD';
case 'monthDays':
return 'YYYY-MM';
case 'customDays':
return 'YYYY-MM-DD';
case 'yearMonth':
return 'YYYY';
default:
@ -275,6 +296,8 @@
return 'date';
case 'monthDays':
return 'month';
case 'customDays':
return 'date';
case 'yearMonth':
return 'year';
default:
@ -288,6 +311,8 @@
return '选择日期';
case 'monthDays':
return '选择月份';
case 'customDays':
return '选择日期';
case 'yearMonth':
return '选择年份';
default: