提取ele-pro修改源码

This commit is contained in:
weicw
2021-08-06 16:12:31 +08:00
parent 97df9286bb
commit 5bc27cb0ee
153 changed files with 36553 additions and 555 deletions

View File

@@ -81,15 +81,18 @@
<template #action="{ record }">
<a-space>
<a-button @click="detail(record)" shape="round" size="small">查看</a-button>
<span v-hasPermi="['ecology:sound:verify']">
<a-popconfirm v-if="record.checked != 1" :title="`审核通过后将无法修改,确认?`" ok-text="Yes" cancel-text="No"
<span v-hasPermi="['ecology:sound:verify']" v-if="record.checked != 1">
<a-popconfirm :title="`审核通过后将无法修改,确认?`" ok-text="Yes" cancel-text="No"
@confirm="verify(record)">
<a-button type="primary" shape="round" size="small">审核</a-button>
</a-popconfirm>
</span>
<a-popconfirm :title="`确认删除${record.billName}吗?`" ok-text="Yes" cancel-text="No" @confirm="remove(record)">
<a-button type="primary" danger shape="round" size="small">删除</a-button>
</a-popconfirm>
<span v-hasPermi="['ecology:sound:remove']" v-if="record.checked != 1">
<a-popconfirm :title="`确认删除${record.billName}吗?`" ok-text="Yes" cancel-text="No" @confirm="remove(record)">
<a-button type="primary" danger shape="round" size="small">删除</a-button>
</a-popconfirm>
</span>
</a-space>
</template>
</ele-pro-table>

View File

@@ -7,12 +7,9 @@
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="统计模块:">
<a-select :options="modelOptions" v-model:value="where.model" placeholder="统计模块">
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="昼夜:">
<a-select :options="timeSlotOptions" v-model:value="where.timeSlot" placeholder="昼夜">
@@ -22,7 +19,7 @@
<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-range-picker v-model:value="timeScope" format="YYYY-MM-DD" />
</a-form-item>
</a-col>
@@ -34,11 +31,10 @@
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<ele-pro-table ref="table" row-key="id" :datasource="url" :columns="columns" :where="where"
:scroll="{x: 'max-content'}">
:scroll="{x: 'max-content'}" :rowClassName="(record, index) => (index % 2 === 1 ? 'table-striped' : null)">
</ele-pro-table>
</a-card>
@@ -48,7 +44,9 @@
<script>
import _ from "lodash";
import {pageRoadNoiseStatisticUrl} from "@/api/ecology/road-sound"
import {
pageRoadNoiseStatisticUrl
} from "@/api/ecology/road-sound"
const columns = [{
title: '测点',
dataIndex: 'place',
@@ -79,68 +77,235 @@
}) => Math.round(text)
},
{
title: '中小型车流量(辆/20分钟)',
dataIndex: 'smallTrafficFlow',
customRender: ({
text
}) => Math.round(text)
title: '20分钟中小型车流量',
children: [{
title: '平均',
dataIndex: 'avgSmallTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
{
title: '最大',
dataIndex: 'maxSmallTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
{
title: '最小',
dataIndex: 'minSmallTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
],
},
{
title: '大型车流量(辆/20分钟)',
dataIndex: 'largeTrafficFlow',
customRender: ({
text
}) => Math.round(text)
title: '20分钟大型车流量',
children: [{
title: '平均',
dataIndex: 'avgLargeTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
{
title: '最大',
dataIndex: 'maxLargeTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
{
title: '最小',
dataIndex: 'minLargeTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
]
},
{
title: 'Leq',
dataIndex: 'leq',
customRender: ({
text
}) => Number(text).toFixed(2)
title: 'LeqdB(A)',
children: [{
title: '平均',
dataIndex: 'avgLeq',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最大',
dataIndex: 'maxLeq',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minLeq',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
{
title: 'L10',
dataIndex: 'l10',
customRender: ({
text
}) => Number(text).toFixed(2)
title: "SD",
children: [{
title: '平均',
dataIndex: 'avgSD',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最大',
dataIndex: 'maxSD',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minSD',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
{
title: "L10",
children: [
{
title: '平均',
dataIndex: 'avgL10',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最大',
dataIndex: 'maxL10',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minL10',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
}, {
title: 'L50',
dataIndex: 'l50',
customRender: ({
text
}) => Number(text).toFixed(2)
children: [{
title: '平均',
dataIndex: 'avgL50',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最大',
dataIndex: 'maxL50',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minL50',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
{
title: 'L90',
dataIndex: 'l90',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: 'SD',
dataIndex: 'sd',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: 'Lmin',
dataIndex: 'lmin',
customRender: ({
text
}) => Number(text).toFixed(2)
title: "L90",
children: [
{
title: '平均',
dataIndex: 'avgL90',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最大',
dataIndex: 'maxL90',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minL90',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
{
title: "Lmin",
children: [{
title: '平均',
dataIndex: 'avgLmin',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最大',
dataIndex: 'maxLmin',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minLmin',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
}, {
title: 'Lmax',
dataIndex: 'lmax',
customRender: ({
text
}) => Number(text).toFixed(2)
children: [{
title: '平均',
dataIndex: 'avgLmax',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最大',
dataIndex: 'maxLmax',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minLmax',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
]
export default {
name: 'StatisticSoundRoad',
@@ -178,12 +343,11 @@
methods: {
/* 刷新表格 */
reload() {
console.log(this.timeScope[0].format("Y-M-D H:m:s"));
this.$refs.table.reload({
where: {
model: this.where.model,
timeStart: this.timeScope ? this.timeScope[0].format("Y-M-D") : null,
timeEnd: this.timeScope ? this.timeScope[1].format("Y-M-D") : null,
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
}
});