|
|
@ -5,7 +5,6 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="StatsDetail"> |
|
|
|
<!-- {{ facilityIds }} {{ facilityTableData }} --> |
|
|
|
<el-table key="table1" v-if="searchType == 2" :data="tableData" style="width: 100%" |
|
|
|
:span-method="arraySpanMethod"> |
|
|
|
<el-table-column prop="controlCauseName" label="封闭原因" width="150" align="center"> |
|
|
@ -52,7 +51,7 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="facilityInterval" label="间隔放行" align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="causeTypeName" label="合计" align="center"> |
|
|
|
<el-table-column prop="total" label="合计" align="center"> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
@ -95,6 +94,7 @@ export default { |
|
|
|
}, |
|
|
|
searchType: 1, |
|
|
|
facilityIds: [], |
|
|
|
facilityTableData: [], |
|
|
|
searchFormList: [ |
|
|
|
{ |
|
|
|
label: "查询条件:", |
|
|
@ -145,12 +145,10 @@ export default { |
|
|
|
label: "选择站点:", |
|
|
|
key: "facilityId", |
|
|
|
required: true, |
|
|
|
isAlone: true, |
|
|
|
type: "select", |
|
|
|
default: this.facilityIds, |
|
|
|
type: "Select", |
|
|
|
options: { |
|
|
|
multiple: true, |
|
|
|
placeholder: "请选择" |
|
|
|
options: [] |
|
|
|
}, |
|
|
|
visible: data => { |
|
|
|
if (data.searchType == 1) { |
|
|
@ -198,14 +196,14 @@ export default { |
|
|
|
}), |
|
|
|
]) |
|
|
|
.then((res) => { |
|
|
|
console.log(789789, res) |
|
|
|
if (res[0].status === 'fulfilled' && res[0].value.code == 200) { |
|
|
|
this.searchFormList[2].options.options = res[0].value.data.map(item => ({ |
|
|
|
key: item.id, |
|
|
|
label: item.facilityName, |
|
|
|
})) |
|
|
|
this.facilityIds = res[0].value.data.map(item => item.id) |
|
|
|
console.log(777, this.facilityIds) |
|
|
|
// this.searchFormList[2].default = res[0].value.data.map(item => item.id) |
|
|
|
|
|
|
|
let date = moment().format('YYYY-MM-DD') |
|
|
|
let data = { |
|
|
|
searchType: 1, |
|
|
@ -218,16 +216,13 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
handleSearch(data) { |
|
|
|
console.log("data555", data) |
|
|
|
this.getSelectTollStation(data) |
|
|
|
}, |
|
|
|
arraySpanMethod({ row, column, rowIndex, columnIndex }) { |
|
|
|
console.log("+++++++", row, column, rowIndex, columnIndex) |
|
|
|
|
|
|
|
if (this.searchType == 2) { |
|
|
|
|
|
|
|
if (!row.causeTypeName) { |
|
|
|
// console.log("11111111111") |
|
|
|
if (columnIndex === 0) { |
|
|
|
return [1, 2]; |
|
|
|
} |
|
|
@ -236,7 +231,6 @@ export default { |
|
|
|
} |
|
|
|
}; |
|
|
|
if (row.controlCauseName === '恶劣天气') { |
|
|
|
// console.log("222222222222") |
|
|
|
if (columnIndex === 0) { |
|
|
|
console.log(this.weatherNum.length) |
|
|
|
if (rowIndex === 0) { |
|
|
@ -273,8 +267,6 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
getSelectTollStation(data) { |
|
|
|
this.facilityTableData = [] |
|
|
|
console.log(45, data) |
|
|
|
let startTime = "" |
|
|
|
let endTime = "" |
|
|
|
if (data) { |
|
|
@ -287,10 +279,12 @@ export default { |
|
|
|
|
|
|
|
var formData = new FormData(); |
|
|
|
this.searchType = data.searchType |
|
|
|
|
|
|
|
formData.append("controlType", data.controlType); |
|
|
|
if (data.searchType == 1) { |
|
|
|
formData.append("facilityId", data.facilityId); |
|
|
|
} else { |
|
|
|
formData.append("controlType", data.controlType); |
|
|
|
} |
|
|
|
formData.append("searchType", data.searchType); |
|
|
|
formData.append("facilityId", data.facilityId); |
|
|
|
formData.append("startTime", startTime); |
|
|
|
formData.append("endTime", endTime); |
|
|
|
let weatherData = [] |
|
|
@ -308,12 +302,11 @@ export default { |
|
|
|
}); |
|
|
|
this.tableData = weatherData.concat(otherData) |
|
|
|
} else { |
|
|
|
res.data.forEach((item) => { |
|
|
|
item.total = item.facilityClose + item.facilityRestriction + item.facilityInterval |
|
|
|
}) |
|
|
|
this.facilityTableData = res.data |
|
|
|
// this.$nextTick(() => { |
|
|
|
|
|
|
|
|
|
|
|
// }) |
|
|
|
console.log("this.facilityTableData", this.facilityTableData) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|