数据报表查询改为 默认天数据查询
This commit is contained in:
parent
7b1e701ee3
commit
eff70e8ab5
|
|
@ -25,46 +25,60 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<!-- 设备 -->
|
<!-- 设备 -->
|
||||||
<!-- <a-col :xs="24" :sm="12" :md="6" :lg="5">-->
|
<!-- <a-col :xs="24" :sm="12" :md="6" :lg="5">-->
|
||||||
<!-- <div class="filter-item">-->
|
<!-- <div class="filter-item">-->
|
||||||
<!-- <span class="filter-label">设备</span>-->
|
<!-- <span class="filter-label">设备</span>-->
|
||||||
<!-- <a-select-->
|
<!-- <a-select-->
|
||||||
<!-- v-model:value="selectedCategory"-->
|
<!-- v-model:value="selectedCategory"-->
|
||||||
<!-- placeholder="请选择设备"-->
|
<!-- placeholder="请选择设备"-->
|
||||||
<!-- :loading="categoryLoading"-->
|
<!-- :loading="categoryLoading"-->
|
||||||
<!-- allow-clear-->
|
<!-- allow-clear-->
|
||||||
<!-- show-search-->
|
<!-- show-search-->
|
||||||
<!-- :filter-option="filterOption"-->
|
<!-- :filter-option="filterOption"-->
|
||||||
<!-- style="flex: 1; min-width: 0"-->
|
<!-- style="flex: 1; min-width: 0"-->
|
||||||
<!-- >-->
|
<!-- >-->
|
||||||
<!-- <a-select-option v-for="item in categoryOptions" :key="item.id" :value="item.id">-->
|
<!-- <a-select-option v-for="item in categoryOptions" :key="item.id" :value="item.id">-->
|
||||||
<!-- {{ item.deployDes }}-->
|
<!-- {{ item.deployDes }}-->
|
||||||
<!-- </a-select-option>-->
|
<!-- </a-select-option>-->
|
||||||
<!-- </a-select>-->
|
<!-- </a-select>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </a-col>-->
|
<!-- </a-col>-->
|
||||||
|
|
||||||
<!-- 统计模式 -->
|
<!-- 统计模式 -->
|
||||||
<a-col :xs="24" :sm="12" :md="5" :lg="4">
|
<!-- <a-col :xs="24" :sm="12" :md="5" :lg="4">-->
|
||||||
<div class="filter-item">
|
<!-- <div class="filter-item">-->
|
||||||
<span class="filter-label">模式</span>
|
<!-- <span class="filter-label">模式</span>-->
|
||||||
<a-select v-model:value="selectedDimension" placeholder="请选择" style="flex: 1; min-width: 0">
|
<!-- <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="dayhours">日统计</a-select-option>-->
|
||||||
<a-select-option value="monthDays">月统计</a-select-option>
|
<!-- <a-select-option value="monthDays">月统计</a-select-option>-->
|
||||||
<a-select-option value="yearMonth">年统计</a-select-option>
|
<!-- <a-select-option value="yearMonth">年统计</a-select-option>-->
|
||||||
</a-select>
|
<!-- </a-select>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</a-col>
|
<!-- </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">
|
<a-col :xs="24" :sm="12" :md="6" :lg="5">
|
||||||
<div class="filter-item">
|
<div class="filter-item">
|
||||||
<span class="filter-label">日期</span>
|
<span class="filter-label">日期</span>
|
||||||
<a-date-picker
|
<a-range-picker
|
||||||
|
range
|
||||||
v-model:value="selectedDate"
|
v-model:value="selectedDate"
|
||||||
:format="dateFormat"
|
:format="dateFormat"
|
||||||
:picker="pickerType"
|
:picker="pickerType"
|
||||||
:placeholder="datePlaceholder"
|
:placeholder="['开始日期', '结束日期']"
|
||||||
style="flex: 1; min-width: 0"
|
style="flex: 1; min-width: 0"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -188,10 +202,15 @@
|
||||||
const params = {
|
const params = {
|
||||||
stationCode: stationCode,
|
stationCode: stationCode,
|
||||||
// deployId: deployId,
|
// deployId: deployId,
|
||||||
summaryMode: summaryMode || 'dayhours',
|
summaryMode: summaryMode || 'customDays',
|
||||||
startTime: startTime,
|
// 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)
|
getDeviceAlertStatistic(params)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
@ -204,7 +223,7 @@
|
||||||
// ✅ 高阈值:使用 highVal,名称为"高阈值"
|
// ✅ 高阈值:使用 highVal,名称为"高阈值"
|
||||||
if (itemDetail.highVal) {
|
if (itemDetail.highVal) {
|
||||||
markLines.push({
|
markLines.push({
|
||||||
name: itemDetail.itemName +'高阈值',
|
name: itemDetail.itemName + '高阈值',
|
||||||
value: itemDetail.highVal,
|
value: itemDetail.highVal,
|
||||||
color: '#fcc419',
|
color: '#fcc419',
|
||||||
type: 'dashed',
|
type: 'dashed',
|
||||||
|
|
@ -213,7 +232,7 @@
|
||||||
// ✅ 低阈值:使用 lowVal,名称为"低阈值"
|
// ✅ 低阈值:使用 lowVal,名称为"低阈值"
|
||||||
if (itemDetail.lowVal) {
|
if (itemDetail.lowVal) {
|
||||||
markLines.push({
|
markLines.push({
|
||||||
name: itemDetail.itemName +'低阈值',
|
name: itemDetail.itemName + '低阈值',
|
||||||
value: itemDetail.lowVal,
|
value: itemDetail.lowVal,
|
||||||
color: '#ff6b6b',
|
color: '#ff6b6b',
|
||||||
type: 'dotted',
|
type: 'dotted',
|
||||||
|
|
@ -252,7 +271,7 @@
|
||||||
const chartInstances = [];
|
const chartInstances = [];
|
||||||
const chartRefs = {};
|
const chartRefs = {};
|
||||||
|
|
||||||
const selectedDimension = ref('dayhours');
|
const selectedDimension = ref('customDays');
|
||||||
const selectedDate = ref(null);
|
const selectedDate = ref(null);
|
||||||
|
|
||||||
// ==================== 根据统计模式动态计算日期格式 ====================
|
// ==================== 根据统计模式动态计算日期格式 ====================
|
||||||
|
|
@ -262,6 +281,8 @@
|
||||||
return 'YYYY-MM-DD';
|
return 'YYYY-MM-DD';
|
||||||
case 'monthDays':
|
case 'monthDays':
|
||||||
return 'YYYY-MM';
|
return 'YYYY-MM';
|
||||||
|
case 'customDays':
|
||||||
|
return 'YYYY-MM-DD';
|
||||||
case 'yearMonth':
|
case 'yearMonth':
|
||||||
return 'YYYY';
|
return 'YYYY';
|
||||||
default:
|
default:
|
||||||
|
|
@ -275,6 +296,8 @@
|
||||||
return 'date';
|
return 'date';
|
||||||
case 'monthDays':
|
case 'monthDays':
|
||||||
return 'month';
|
return 'month';
|
||||||
|
case 'customDays':
|
||||||
|
return 'date';
|
||||||
case 'yearMonth':
|
case 'yearMonth':
|
||||||
return 'year';
|
return 'year';
|
||||||
default:
|
default:
|
||||||
|
|
@ -288,6 +311,8 @@
|
||||||
return '选择日期';
|
return '选择日期';
|
||||||
case 'monthDays':
|
case 'monthDays':
|
||||||
return '选择月份';
|
return '选择月份';
|
||||||
|
case 'customDays':
|
||||||
|
return '选择日期';
|
||||||
case 'yearMonth':
|
case 'yearMonth':
|
||||||
return '选择年份';
|
return '选择年份';
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue