到处格式,拆分时间

This commit is contained in:
weicw
2021-11-09 09:17:49 +08:00
parent 9b52b7abac
commit eda3eb3de1
11 changed files with 378 additions and 468 deletions

View File

@@ -12,38 +12,33 @@
>
<template #toolbar>
<!-- 搜索表单 -->
<a-form :model="where" layout="inline" :labelCol="{ offset: 1 }">
<a-row>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="昼夜:">
<a-select
:options="timeSlotOptions"
v-model:value="where.timeSlot"
placeholder="昼夜"
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="8" :md="12" :sm="24" :xs="24">
<a-form-item label="时间范围:">
<!-- <a-month-picker v-model:value="timeScope" placeholder="起始" /> -->
<a-range-picker v-model:value="timeScope" format="YYYY-MM-DD" />
</a-form-item>
</a-col>
<a-form :model="where" layout="inline" >
<a-form-item label="起始日期:">
<a-date-picker valueFormat="YYYY-MM-DD 00:00:00" v-model:value="where.timeStart"></a-date-picker>
</a-form-item>
<a-form-item label="结束日期:">
<a-date-picker valueFormat="YYYY-MM-DD 23:59:59" v-model:value="where.timeEnd"></a-date-picker>
</a-form-item>
<a-form-item label="昼夜:">
<a-select
:options="timeSlotOptions"
v-model:value="where.timeSlot"
placeholder="昼夜"
>
</a-select>
</a-form-item>
<a-col :lg="4" :md="12" :sm="24" :xs="24">
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出excel</a-button>
</a-space>
</a-form-item>
</a-form>
<!-- <a-space>
</a-space> -->
</template>
<template #Leq="{ text, record }">
@@ -53,7 +48,8 @@
(where.timeSlot == '夜' && text <= 58)
"
color="green"
>{{ text }}</a-tag
>{{ text }}
</a-tag
>
<a-tag
v-else-if="
@@ -61,7 +57,8 @@
(record.timeSlot == '夜' && text > 58 && text <= 60)
"
color="blue"
>{{ text }}</a-tag
>{{ text }}
</a-tag
>
<a-tag
v-else-if="
@@ -69,7 +66,8 @@
(record.timeSlot == '夜' && text > 60 && text <= 62)
"
color="red"
>{{ text }}</a-tag
>{{ text }}
</a-tag
>
<a-tag
v-else-if="
@@ -77,7 +75,8 @@
(record.timeSlot == '夜' && text > 62 && text <= 64)
"
color="red"
>{{ text }}</a-tag
>{{ text }}
</a-tag
>
<a-tag
v-else-if="
@@ -85,7 +84,8 @@
(record.timeSlot == '夜' && text > 64)
"
color="red"
>{{ text }}</a-tag
>{{ text }}
</a-tag
>
<template v-else color="#FFF">{{ text }}</template>
</template>
@@ -96,7 +96,8 @@
<script>
import _ from "lodash";
import XLSX from "xlsx";
import { pageRoadNoiseStatisticUrl } from "@/api/ecology/noise/road-sound";
import {pageRoadNoiseStatisticUrl} from "@/api/ecology/noise/road-sound";
const columns = [
{
title: "城区",
@@ -118,25 +119,25 @@ const columns = [
{
title: "LeqdB(A)",
dataIndex: "avgLeq",
slots: { customRender: "Leq" },
slots: {customRender: "Leq"},
sorter: true,
},
{
title: "SDdB(A)",
dataIndex: "avgSD",
},
{
title: "L10dB(A)",
dataIndex: "avgL10",
},
{
title: "L50dB(A)",
dataIndex: "avgL50",
},
{
title: "L90dB(A)",
dataIndex: "avgL90",
},
// {
// title: "SDdB(A)",
// dataIndex: "avgSD",
// },
// {
// title: "L10dB(A)",
// dataIndex: "avgL10",
// },
// {
// title: "L50dB(A)",
// dataIndex: "avgL50",
// },
// {
// title: "L90dB(A)",
// dataIndex: "avgL90",
// },
];
export default {
name: "StatisticSoundRoadAverage",
@@ -185,18 +186,7 @@ export default {
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: {
model: this.where.model,
timeStart:
this.timeScope.length == 2
? this.timeScope[0].format("Y-M-D")
: null,
timeEnd:
this.timeScope.length == 2
? this.timeScope[1].format("Y-M-D")
: null,
timeSlot: this.where.timeSlot,
},
where: this.where
});
let cloneColumns = _.cloneDeep(columns);
if (this.where.model == "area") {
@@ -255,4 +245,4 @@ export default {
</script>
<style scoped>
</style>
</style>