|
|
|
@ -0,0 +1,420 @@
|
|
|
|
|
<template>
|
|
|
|
|
<transition appear enter-active-class="animated fadeIn">
|
|
|
|
|
<q-card class="shadow-24">
|
|
|
|
|
<!-- 搜索条件 -->
|
|
|
|
|
<q-card-section>
|
|
|
|
|
<div class="row q-col-gutter-md">
|
|
|
|
|
<!-- 刷新 查询 -->
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-12">
|
|
|
|
|
<q-btn-group push glossy>
|
|
|
|
|
<q-btn push label="刷新" icon="refresh" @click="reFresh()">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">清空所有条件并,刷新数据</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
<q-btn push label="查询" icon="search" @click="getPage()">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">按条件查询数据</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-btn-group>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 搜索条件 -->
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-12">
|
|
|
|
|
<q-input dense label="日期范围" ref="rangDateRef" readonly outlined v-model="rangDateText">
|
|
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon name="event" class="cursor-pointer">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">选择日期范围</q-tooltip>
|
|
|
|
|
<q-popup-proxy ref="qDateProxy" transition-show="scale" transition-hide="scale">
|
|
|
|
|
<q-date v-model="rangeDate" years-in-month-view landscape range mask="YYYY-MM-DD"
|
|
|
|
|
@update:model-value="rangeDateUpdate">
|
|
|
|
|
<!-- <div class="row items-center justify-end">
|
|
|
|
|
<q-btn v-close-popup label="关闭" color="primary" flat />
|
|
|
|
|
</div> -->
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-3">
|
|
|
|
|
<q-btn v-close-popup label="本月" @click="setCurrMonth" color="orange"
|
|
|
|
|
flat />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-3">
|
|
|
|
|
<q-btn v-close-popup label="本年" @click="setCurrYear" color="red" flat />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-3"></div>
|
|
|
|
|
<div class="col-3">
|
|
|
|
|
<q-btn v-close-popup label="关闭" color="primary" flat />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-date>
|
|
|
|
|
</q-popup-proxy>
|
|
|
|
|
</q-icon>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
<q-card-section style="padding:0 10px 15px 10px;">
|
|
|
|
|
<div class="row q-col-gutter-md">
|
|
|
|
|
<div class="col-xl-12 col-lg-12 col-sm-12">
|
|
|
|
|
<q-table class="my-sticky-header-column-table" :rows="list" row-key="id" separator="cell"
|
|
|
|
|
:loading="loading" :columns="columns" @request="onRequest" v-model:pagination="pagination"
|
|
|
|
|
:table-style="{ height: Screen.height - 190 + 'px' }" flat bordered
|
|
|
|
|
:rows-per-page-options="[20, 30, 40, 50, 100]">
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="tr_hover">
|
|
|
|
|
<q-td style="font-size: 16px;" key="index" :props="props">{{ props.rowIndex + 1
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="name" :props="props">{{ props.row.name }}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="calories" :props="props">{{ props.row.calories
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="count" :props="props">{{ props.row.count }}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="start" :props="props">{{ props.row.start }}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="end" :props="props">{{ props.row.end }}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="total" :props="props">{{ props.row.total }}</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</q-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
</q-card>
|
|
|
|
|
</transition>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref } from 'vue';
|
|
|
|
|
import { Notify, Screen, date } from 'quasar';
|
|
|
|
|
import { sysConfigApi } from '../../api/sysConfig/sysConifgApi';
|
|
|
|
|
import { SysConfigEntity } from '../../api/sysConfig/model/sysConfig';
|
|
|
|
|
import { Pagination, convert } from 'src/api/class';
|
|
|
|
|
|
|
|
|
|
//公共
|
|
|
|
|
const pagination = ref(new Pagination(new SysConfigEntity()));
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const rangeDate = ref();
|
|
|
|
|
const rangDateText = ref();
|
|
|
|
|
const device = ref();
|
|
|
|
|
const deviceList = ref([]);
|
|
|
|
|
|
|
|
|
|
const columns = ref([
|
|
|
|
|
{
|
|
|
|
|
name: 'index',
|
|
|
|
|
label: '#',
|
|
|
|
|
field: 'index',
|
|
|
|
|
align: 'center',
|
|
|
|
|
headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'name',
|
|
|
|
|
align: 'center',
|
|
|
|
|
label: '设备名称',
|
|
|
|
|
field: 'name',
|
|
|
|
|
headerClasses: 'text-h4 text-weight-bold',
|
|
|
|
|
headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;',
|
|
|
|
|
},
|
|
|
|
|
{ name: 'count', align: 'center', label: '开炉次数', field: 'count', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'start', align: 'center', label: '总运行时长', field: 'start', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'end', align: 'center', label: '总报警时长', field: 'end', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'total', align: 'center', label: '总待机时长', field: 'total', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const list = ref([
|
|
|
|
|
{
|
|
|
|
|
name: '24#|Balzers',
|
|
|
|
|
calories: 159,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '25#|Balzers',
|
|
|
|
|
calories: 237,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '26#|Balzers',
|
|
|
|
|
calories: 262,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '9#|Ionbond',
|
|
|
|
|
calories: 305,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '19#|Ionbond',
|
|
|
|
|
calories: 356,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '12#|Ionbond',
|
|
|
|
|
calories: 375,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '13#|Ionbond',
|
|
|
|
|
calories: 392,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '16#|Ionbond',
|
|
|
|
|
calories: 408,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '23#|Ionbond',
|
|
|
|
|
calories: 452,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '17#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '18#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '20#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '11#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '21#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '15#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '22#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '14#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '3#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '7#|CemeCon',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '5#|CemeCon',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '6#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '4#|CemeCon',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '8#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '2#|CemeCon',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '10#|Balzers',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '1#|CemeCon',
|
|
|
|
|
calories: 518,
|
|
|
|
|
count: '12',
|
|
|
|
|
start: '89',
|
|
|
|
|
end: '102',
|
|
|
|
|
total: '500'
|
|
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const reFresh = () => {
|
|
|
|
|
device.value = ''
|
|
|
|
|
rangDateText.value = ''
|
|
|
|
|
rangeDate.value = ''
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onRequest = (props: any) => {
|
|
|
|
|
const { page, rowsPerPage, rowsNumber } = props.pagination;
|
|
|
|
|
pagination.value.page = page;
|
|
|
|
|
pagination.value.rowsPerPage = rowsPerPage != 0 ? rowsPerPage : rowsNumber;
|
|
|
|
|
getPage();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getPage = () => {
|
|
|
|
|
sysConfigApi.getPage(pagination.value).then((res: any) => {
|
|
|
|
|
list.value = res.dataList;;
|
|
|
|
|
convert(pagination.value, res);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置本月
|
|
|
|
|
const setCurrMonth = () => {
|
|
|
|
|
var d = new Date(); // 获取当前日期时间
|
|
|
|
|
var monthStart = date.formatDate(new Date(d.getFullYear(), d.getMonth(), 1), 'YYYY-MM-DD'); // 获取本月第一天的日期时间
|
|
|
|
|
var monthEnd = date.formatDate(new Date(d.getFullYear(), d.getMonth() + 1, 0), 'YYYY-MM-DD'); // 获取本月最后一天的日期时间(时间为23:59:59)
|
|
|
|
|
rangDateText.value = `${monthStart} ~ ${monthEnd}`
|
|
|
|
|
rangeDate.value = { from: `${monthStart}`, to: `${monthEnd}` }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 设置本年
|
|
|
|
|
const setCurrYear = () => {
|
|
|
|
|
var d = new Date(); // 获取当前日期时间
|
|
|
|
|
var monthStart = date.formatDate(new Date(d.getFullYear(), 0, 1), 'YYYY-MM-DD'); // 获取本月第一天的日期时间
|
|
|
|
|
var monthEnd = date.formatDate(new Date(d.getFullYear(), 12, 0), 'YYYY-MM-DD'); // 获取本月最后一天的日期时间(时间为23:59:59)
|
|
|
|
|
rangDateText.value = `${monthStart} ~ ${monthEnd}`
|
|
|
|
|
rangeDate.value = { from: `${monthStart}`, to: `${monthEnd}` }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 日期范围 改变事件
|
|
|
|
|
const rangeDateUpdate = (value: any, reason: any, details) => {
|
|
|
|
|
if (reason === 'add-range') {
|
|
|
|
|
const start = value.from // 开始日期
|
|
|
|
|
const end = value.to // 结束日期
|
|
|
|
|
const diff = date.getDateDiff(new Date(end), new Date(start), 'days') // 计算日期差值
|
|
|
|
|
// 判断 时间范围是否大于365天
|
|
|
|
|
if (diff >= 366) {
|
|
|
|
|
Notify.create({
|
|
|
|
|
position: 'top',
|
|
|
|
|
message: '日期范围不能大于365天!',
|
|
|
|
|
icon: 'feedback',
|
|
|
|
|
color: 'negative',
|
|
|
|
|
})
|
|
|
|
|
rangDateText.value = ''
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
rangDateText.value = start + ' ~ ' + end
|
|
|
|
|
}
|
|
|
|
|
if (reason === 'add-day') {
|
|
|
|
|
Notify.create({
|
|
|
|
|
position: 'top',
|
|
|
|
|
message: '日期范围不能为同一天!',
|
|
|
|
|
icon: 'feedback',
|
|
|
|
|
color: 'negative',
|
|
|
|
|
})
|
|
|
|
|
rangDateText.value = ''
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
/* .tr_hover {
|
|
|
|
|
background: #aaaaaa;
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
.tr_hover:hover {
|
|
|
|
|
background: #e8e8e8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.click-hover {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
color: #1976d2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.click-hover:hover {
|
|
|
|
|
color: #2196f3;
|
|
|
|
|
/* background-color: yellow; */
|
|
|
|
|
}
|
|
|
|
|
</style>
|