Commit e735e9b7 authored by ninglx's avatar ninglx

wj-smartcity 数据查询导出添加loading,优化部分页面数据聚合逻辑

parent 96d4b262
......@@ -46,7 +46,14 @@
<div>
(备注:{{ locationType1 === "laneSort" ? "车道" : "转向" }}可多选)
</div>
<div class="rightExport" @click="exportLaneExcel()">导出</div>
<el-button
:loading = 'exportLoading'
@click="exportLaneExcel()"
size="mini"
type="primary"
class="rightExport"
>导出</el-button
>
</div>
<div style="margin-bottom: 10px" class="custom-table">
<el-table
......@@ -125,6 +132,7 @@ export default {
props: ["crossData"],
data() {
return {
exportLoading:false,
loading: true,
laneTableColumn: [],
locationType1: "laneSort",
......@@ -250,21 +258,25 @@ export default {
exportLaneExcel() {
// 车道级excel导出下载
if (this.locationType1 === "laneSort") {
this.exportLoading = true
exportLane({
crossId: this.crossData.crossId,
end: this.dateTimeRange[1].toLocaleString().replaceAll("/", "-"),
start: this.dateTimeRange[0].toLocaleString().replaceAll("/", "-"),
}).then((response) => {
this.exportLoading = false
this.downloadFileExcel(response)
});
}
// 转向级
else{
this.exportLoading = true
exportTurn({
crossId: this.crossData.crossId,
end: this.dateTimeRange[1].toLocaleString().replaceAll("/", "-"),
start: this.dateTimeRange[0].toLocaleString().replaceAll("/", "-"),
}).then((response) => {
this.exportLoading = false
this.downloadFileExcel(response)
});
}
......@@ -824,6 +836,7 @@ label:first-child {
height: 28px;
position: absolute;
right: 0;
border: none;
top: 50%;
font-size: 14px;
cursor: pointer;
......@@ -851,4 +864,19 @@ label:first-child {
flex-direction: column;
padding: 0 10px;
}
.custom-export-button {
position: absolute;
right: 0;
border-radius: 0;
background-color: #294372;
color: white;
letter-spacing: 1px;
border: none;
width: 78px;
font-size: 14px;
height: 28px;
}
.custom-export-button:hover {
background-color: #355287;
}
</style>
......@@ -159,7 +159,12 @@
:row-class-name="getRowClassName"
style="width: 100%"
>
<el-table-column align="center" prop="index" label="序号" show-overflow-tooltip>
<el-table-column
align="center"
prop="index"
label="序号"
show-overflow-tooltip
>
<!-- <template slot-scope="scope">
{{ occupancyValue(scope.row.xxx) }}
</template> -->
......@@ -193,7 +198,11 @@
</el-table-column>
<el-table-column align="center" label="位置" show-overflow-tooltip>
<template slot-scope="scope">
{{ occupancyValue(`${scope.row.dirName&&(scope.row.dirName+'进口')}`) }}
{{
occupancyValue(
`${scope.row.dirName && scope.row.dirName + "进口"}`
)
}}
</template>
</el-table-column>
<el-table-column
......@@ -284,9 +293,9 @@ export default {
},
methods: {
exportLaneExcel() {
if(!this.eventTypeValue) {
this.$message('请选择要导出数据的事件类型')
return
if (!this.eventTypeValue) {
this.$message("请选择要导出数据的事件类型");
return;
}
// excel导出下载
// exportLane({
......@@ -331,13 +340,13 @@ export default {
start: this.dateTimeRange[0].toLocaleString().replaceAll("/", "-"),
// end: '2024-06-24 18:00:00',
// start: '2024-06-24 00:00:00',
overFlow: true
overFlow: true,
}).then((res) => {
console.log("溢出 (复用快照", res);
this.overTableData = res.content.map((item,index) =>{
item.index = index+1
return item
})
this.overTableData = res.content.map((item, index) => {
item.index = index + 1;
return item;
});
});
},
getRowClassName(e) {
......
......@@ -39,7 +39,7 @@ export default {
tabs: [
{'1': '周期数据'},
{'2': '快照数据'},
{'3': '事件数据'},
// {'3': '事件数据'},
],
}
},
......
......@@ -31,7 +31,14 @@
</el-option>
</el-select>
<div class="custom-form-label">(备注:车道可多选)</div>
<div class="rightExport" @click="exportLaneExcel()">导出</div>
<el-button
:loading="exportLoading"
@click="exportLaneExcel()"
size="mini"
type="primary"
class="rightExport"
>导出</el-button
>
</div>
<div
v-loading="loading"
......@@ -123,6 +130,7 @@ export default {
props: ["crossData"],
data() {
return {
exportLoading: false,
currentPage: 0,
indexOptionValue: [],
loading: true,
......@@ -353,6 +361,7 @@ export default {
a.remove();
},
exportLaneExcel() {
this.exportLoading = true;
// excel导出下载
exportSnapshot({
crossId: this.crossData.crossId,
......@@ -360,6 +369,7 @@ export default {
start: this.dateTimeRange[0].toLocaleString().replaceAll("/", "-"),
laneId: this.value1.join(","),
}).then((response) => {
this.exportLoading = false;
this.downloadFileExcel(response);
});
},
......@@ -597,6 +607,7 @@ label:first-child {
display: flex;
align-items: center;
justify-content: center;
border: none;
transform: translateY(-50%);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment