|
@@ -1,5 +1,9 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
|
|
+ <div v-if="errorMessage" class="facility-error">
|
|
|
|
|
+ <el-alert :title="errorMessage" type="error" show-icon :closable="false" />
|
|
|
|
|
+ <el-button type="primary" link size="small" @click="retryRequest">重试</el-button>
|
|
|
|
|
+ </div>
|
|
|
<!-- 搜索区域 -->
|
|
<!-- 搜索区域 -->
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
<el-form-item label="管网编号" prop="pipeCode">
|
|
<el-form-item label="管网编号" prop="pipeCode">
|
|
@@ -18,6 +22,12 @@
|
|
|
<el-option label="混凝土" value="混凝土" />
|
|
<el-option label="混凝土" value="混凝土" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="管径(mm)" prop="pipeDiameter">
|
|
|
|
|
+ <el-input-number v-model="queryParams.pipeDiameter" :min="0" :precision="0" controls-position="right" size="small" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="铺设年份" prop="layingYear">
|
|
|
|
|
+ <el-date-picker v-model="queryParams.layingYear" type="year" value-format="YYYY" placeholder="选择年份" size="small" />
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="状态" prop="status">
|
|
<el-form-item label="状态" prop="status">
|
|
|
<el-select v-model="queryParams.status" placeholder="管网状态" clearable size="small" style="width: 120px">
|
|
<el-select v-model="queryParams.status" placeholder="管网状态" clearable size="small" style="width: 120px">
|
|
|
<el-option
|
|
<el-option
|
|
@@ -186,8 +196,8 @@
|
|
|
<el-descriptions-item label="铺设年份">{{ detailData.layingYear }}</el-descriptions-item>
|
|
<el-descriptions-item label="铺设年份">{{ detailData.layingYear }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="设计压力(MPa)">{{ detailData.pressureRating }}</el-descriptions-item>
|
|
<el-descriptions-item label="设计压力(MPa)">{{ detailData.pressureRating }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="运行状态">
|
|
<el-descriptions-item label="运行状态">
|
|
|
- <el-tag :type="detailData.status === '0' ? 'success' : 'danger'" size="small">
|
|
|
|
|
- {{ detailData.status === '0' ? '正常' : '停用' }}
|
|
|
|
|
|
|
+ <el-tag :type="normalizePipeStatus(detailData.status) === '0' ? 'success' : 'danger'" size="small">
|
|
|
|
|
+ {{ normalizePipeStatus(detailData.status) === '0' ? '正常' : '停用' }}
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="起点位置" :span="2">{{ detailData.startPoint }}</el-descriptions-item>
|
|
<el-descriptions-item label="起点位置" :span="2">{{ detailData.startPoint }}</el-descriptions-item>
|
|
@@ -249,6 +259,7 @@ import { listPipeInfo, getPipeInfo, addPipeInfo, updatePipeInfo, delPipeInfo, li
|
|
|
import { getDicts } from '@/api/system/dict/data'
|
|
import { getDicts } from '@/api/system/dict/data'
|
|
|
import { saveAs } from 'file-saver'
|
|
import { saveAs } from 'file-saver'
|
|
|
import { exportWaterPipe } from '@/api/pipeNetwork/waterSupply'
|
|
import { exportWaterPipe } from '@/api/pipeNetwork/waterSupply'
|
|
|
|
|
+import { buildWaterFacilityQuery, getRequestErrorMessage, normalizePipeStatus } from '@/utils/waterFacilityQuery'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'WaterPipeInfo',
|
|
name: 'WaterPipeInfo',
|
|
@@ -289,6 +300,8 @@ export default {
|
|
|
recycleTotal: 0,
|
|
recycleTotal: 0,
|
|
|
// 回收站选中数组
|
|
// 回收站选中数组
|
|
|
recycleIds: [],
|
|
recycleIds: [],
|
|
|
|
|
+ errorMessage: '',
|
|
|
|
|
+ retryAction: null,
|
|
|
// 系统状态字典
|
|
// 系统状态字典
|
|
|
sysNormalDisable: [
|
|
sysNormalDisable: [
|
|
|
{ value: '0', label: '正常' },
|
|
{ value: '0', label: '正常' },
|
|
@@ -301,6 +314,8 @@ export default {
|
|
|
pipeCode: undefined,
|
|
pipeCode: undefined,
|
|
|
pipeName: undefined,
|
|
pipeName: undefined,
|
|
|
pipeMaterial: undefined,
|
|
pipeMaterial: undefined,
|
|
|
|
|
+ pipeDiameter: undefined,
|
|
|
|
|
+ layingYear: undefined,
|
|
|
status: undefined
|
|
status: undefined
|
|
|
},
|
|
},
|
|
|
// 回收站查询参数
|
|
// 回收站查询参数
|
|
@@ -333,15 +348,22 @@ export default {
|
|
|
/** 查询管网信息列表 */
|
|
/** 查询管网信息列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
- listPipeInfo(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
|
|
|
|
+ this.errorMessage = ''
|
|
|
|
|
+ this.retryAction = this.getList
|
|
|
|
|
+ listPipeInfo(buildWaterFacilityQuery(this.queryParams, this.dateRange)).then(response => {
|
|
|
this.tableData = response.data.records
|
|
this.tableData = response.data.records
|
|
|
this.total = response.data.total
|
|
this.total = response.data.total
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
console.log("入参线信息列表",this.queryParams)
|
|
console.log("入参线信息列表",this.queryParams)
|
|
|
- }).catch(() => {
|
|
|
|
|
|
|
+ }).catch(error => {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
|
|
+ this.errorMessage = getRequestErrorMessage(error, '管网信息查询失败,请稍后重试')
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ normalizePipeStatus,
|
|
|
|
|
+ retryRequest() {
|
|
|
|
|
+ if (this.retryAction) this.retryAction()
|
|
|
|
|
+ },
|
|
|
/** 管道材质标签类型 */
|
|
/** 管道材质标签类型 */
|
|
|
materialTagType(material) {
|
|
materialTagType(material) {
|
|
|
const map = { '铸铁': '', 'PE': 'success', '钢管': 'warning', '球墨铸铁': 'info', 'PVC': 'danger', '混凝土': '' }
|
|
const map = { '铸铁': '', 'PE': 'success', '钢管': 'warning', '球墨铸铁': 'info', 'PVC': 'danger', '混凝土': '' }
|
|
@@ -361,9 +383,13 @@ export default {
|
|
|
/** 多选框选中数据 */
|
|
/** 多选框选中数据 */
|
|
|
/** 导出当前筛选结果 */
|
|
/** 导出当前筛选结果 */
|
|
|
handleExport() {
|
|
handleExport() {
|
|
|
- exportWaterPipe(this.addDateRange(this.queryParams, this.dateRange)).then(blob => {
|
|
|
|
|
|
|
+ this.errorMessage = ''
|
|
|
|
|
+ this.retryAction = this.handleExport
|
|
|
|
|
+ exportWaterPipe(buildWaterFacilityQuery(this.queryParams, this.dateRange)).then(blob => {
|
|
|
saveAs(new Blob([blob]), `管网信息_${new Date().toISOString().slice(0, 10)}.xlsx`)
|
|
saveAs(new Blob([blob]), `管网信息_${new Date().toISOString().slice(0, 10)}.xlsx`)
|
|
|
- }).catch(() => {})
|
|
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ this.errorMessage = getRequestErrorMessage(error, '管网信息导出失败,请稍后重试')
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.id)
|
|
this.ids = selection.map(item => item.id)
|