2024-10-09 11:55:13 +08:00
|
|
|
|
<!--
|
|
|
|
|
|
* @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
|
|
|
|
|
|
* @Date: 2024-10-08 10:58:25
|
2024-10-11 15:04:14 +08:00
|
|
|
|
* @LastEditors: SunTao 328867980@qq.com
|
2024-10-12 14:35:31 +08:00
|
|
|
|
* @LastEditTime: 2024-10-12 11:38:12
|
2024-10-09 11:55:13 +08:00
|
|
|
|
* @FilePath: \znxjxt-ui\src\views\xj\inspection\disease-management .vue
|
|
|
|
|
|
* @Description: 巡检信息管理-病害管理
|
|
|
|
|
|
-->
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
|
<!-- 搜索表单 -->
|
|
|
|
|
|
<el-form
|
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
|
ref="queryForm"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
:inline="true"
|
|
|
|
|
|
v-show="showSearch"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-form-item label="道路名称" prop="segmentName">
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-select
|
2024-10-09 11:55:13 +08:00
|
|
|
|
v-model="queryParams.segmentName"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
placeholder="请选择路段"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
clearable
|
2024-10-11 15:04:14 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in segmentList"
|
|
|
|
|
|
:key="item.value"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="采集时间" prop="dateTime">
|
|
|
|
|
|
<el-date-picker
|
2024-10-12 14:35:31 +08:00
|
|
|
|
v-model="dateTime"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
type="daterange"
|
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
|
format="yyyy-MM-dd"
|
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
@change="handleQuery"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="病害类型" prop="defectType">
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-select
|
2024-10-09 11:55:13 +08:00
|
|
|
|
v-model="queryParams.defectType"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
placeholder="请选择病害类型"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
clearable
|
2024-10-11 15:04:14 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in tableDefect"
|
|
|
|
|
|
:key="item.value"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="病害状态" prop="state">
|
2024-10-12 14:35:31 +08:00
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="queryParams.state"
|
|
|
|
|
|
placeholder="请选择病害状态"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<el-option
|
2024-10-11 15:04:14 +08:00
|
|
|
|
v-for="item in defectStatus"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
:key="item.value"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="上下行" prop="inspectDirection">
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="queryParams.inspectDirection"
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
>
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-option label="上行" value="0" />
|
|
|
|
|
|
<el-option label="下行" value="1" />
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="公里桩" prop="stakeRange">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="queryParams.stakeStart"
|
|
|
|
|
|
placeholder="起始公里桩"
|
|
|
|
|
|
style="width: 10rem"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
/>
|
|
|
|
|
|
<span style="margin: 0 5px">-</span>
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="queryParams.stakeEnd"
|
|
|
|
|
|
placeholder="终止公里桩"
|
|
|
|
|
|
style="width: 10rem"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
/>
|
|
|
|
|
|
<el-tooltip
|
|
|
|
|
|
class="item"
|
|
|
|
|
|
effect="dark"
|
|
|
|
|
|
content="格式为K0000+000"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
>
|
|
|
|
|
|
<i class="el-icon-info"></i>
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="预警标识" prop="warningFlag">
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="queryParams.warningFlag"
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option label="是" :value="1" />
|
|
|
|
|
|
<el-option label="否" :value="0" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="病害长度" prop="lengthRange">
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-input-number
|
2024-10-09 11:55:13 +08:00
|
|
|
|
v-model="queryParams.minLen"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
controls-position="right"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
placeholder="最小长度"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
:min="0"
|
|
|
|
|
|
></el-input-number>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<span style="margin: 0 5px">-</span>
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-input-number
|
2024-10-09 11:55:13 +08:00
|
|
|
|
v-model="queryParams.maxLen"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
controls-position="right"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
placeholder="最大长度"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
:min="0"
|
|
|
|
|
|
></el-input-number>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="病害面积" prop="areaRange">
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-input-number
|
2024-10-09 11:55:13 +08:00
|
|
|
|
v-model="queryParams.minArea"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
controls-position="right"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
placeholder="最小面积"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
:min="0"
|
|
|
|
|
|
></el-input-number>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<span style="margin: 0 5px">-</span>
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-input-number
|
2024-10-09 11:55:13 +08:00
|
|
|
|
v-model="queryParams.maxArea"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
controls-position="right"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
placeholder="最大面积"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
:min="0"
|
|
|
|
|
|
></el-input-number>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
@click="handleQuery"
|
|
|
|
|
|
>搜索</el-button
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
|
|
|
>重置</el-button
|
|
|
|
|
|
>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 操作按钮 -->
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
plain
|
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
|
v-hasPermi="['system:defect:add']"
|
|
|
|
|
|
>新增
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
type="danger"
|
|
|
|
|
|
plain
|
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
|
@click="handleDelete"
|
|
|
|
|
|
v-hasPermi="['system:defect:remove']"
|
|
|
|
|
|
>删除
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</el-col>
|
2024-10-12 14:35:31 +08:00
|
|
|
|
<!-- <el-col :span="1.5">
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<el-button
|
|
|
|
|
|
type="warning"
|
|
|
|
|
|
plain
|
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
|
v-hasPermi="['system:defect:export']"
|
|
|
|
|
|
>导出
|
|
|
|
|
|
</el-button>
|
2024-10-12 14:35:31 +08:00
|
|
|
|
</el-col> -->
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
plain
|
|
|
|
|
|
icon="el-icon-edit-outline"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
:disabled="single"
|
|
|
|
|
|
@click="handleUpdateBatch"
|
|
|
|
|
|
v-hasPermi="['system:defect:edit']"
|
|
|
|
|
|
>批量确认
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 数据表格 -->
|
|
|
|
|
|
<el-table
|
2024-10-11 15:04:14 +08:00
|
|
|
|
ref="defectTable"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
v-loading="loading"
|
|
|
|
|
|
:data="defectList"
|
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
|
<el-table-column label="路段名称" align="center" prop="segmentName" />
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-table-column label="采集时间" align="center" prop="createdTime">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<span>{{ new Date(scope.row.createdTime).toLocaleString() }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="病害类型" align="center" prop="defectType">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<span>{{ filterDefect(scope.row.defectType) }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="病害状态" align="center" prop="state">
|
|
|
|
|
|
<template slot-scope="scope">
|
2024-10-12 14:35:31 +08:00
|
|
|
|
<span>{{ filterState(scope.row.state) }}</span>
|
2024-10-11 15:04:14 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<el-table-column label="开始桩号" align="center" prop="stakeStart" />
|
|
|
|
|
|
<el-table-column label="结束桩号" align="center" prop="stakeEnd" />
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-table-column label="病害图片" align="center" prop="media">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<img style="height: 3rem" :src="scope.row.media[0].img" />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<el-table-column label="病害长度" align="center" prop="targetLen" />
|
2024-10-12 14:35:31 +08:00
|
|
|
|
<el-table-column label="病害面积" align="center" prop="targetArea" />
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<el-table-column label="预警标识" align="center" prop="warningFlag">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<el-tag :type="scope.row.warningFlag === 1 ? 'danger' : 'success'">
|
|
|
|
|
|
{{ scope.row.warningFlag === 1 ? "是" : "否" }}
|
|
|
|
|
|
</el-tag>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
label="操作"
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
class-name="small-padding fixed-width"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
|
@click="viewDefect(scope.row)"
|
|
|
|
|
|
>查看
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
|
v-hasPermi="['system:defect:edit']"
|
|
|
|
|
|
>修改
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
|
|
v-hasPermi="['system:defect:remove']"
|
|
|
|
|
|
>删除
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 分页组件 -->
|
|
|
|
|
|
<pagination
|
|
|
|
|
|
v-show="total > 0"
|
|
|
|
|
|
:total="total"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
:page.sync="queryParams.page"
|
|
|
|
|
|
:limit.sync="queryParams.size"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
@pagination="getList"
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改缺陷对话框 -->
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
|
:title="dialogTitle"
|
|
|
|
|
|
:visible.sync="dialogVisible"
|
|
|
|
|
|
width="60rem"
|
|
|
|
|
|
append-to-body
|
|
|
|
|
|
:close-on-click-modal="false"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
destroy-on-close
|
|
|
|
|
|
@close="cancel"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-form
|
2024-10-11 15:04:14 +08:00
|
|
|
|
class="addForm"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
ref="defectForm"
|
|
|
|
|
|
:model="form"
|
|
|
|
|
|
:rules="rules"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-row :gutter="24">
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-col :span="dialogTitle === '添加缺陷' ? 12 : 24">
|
|
|
|
|
|
<el-form-item label="路段" prop="segmentId">
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<el-select
|
2024-10-11 15:04:14 +08:00
|
|
|
|
v-model="form.segmentId"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
placeholder="请选择路段"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
2024-10-11 15:04:14 +08:00
|
|
|
|
v-for="item in segmentList"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
:key="item.value"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-col :span="12" v-if="dialogTitle === '添加缺陷'">
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<el-form-item label="病害类型" prop="defectType">
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-select
|
2024-10-09 11:55:13 +08:00
|
|
|
|
v-model="form.defectType"
|
2024-10-11 15:04:14 +08:00
|
|
|
|
placeholder="请选择病害类型"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
clearable
|
2024-10-11 15:04:14 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in tableDefect"
|
|
|
|
|
|
:key="item.value"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="12">
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-form-item label="校验状态" prop="dataStatus">
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<el-select
|
2024-10-11 15:04:14 +08:00
|
|
|
|
v-model="form.dataStatus"
|
|
|
|
|
|
placeholder="请选择校验状态"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
clearable
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
2024-10-11 15:04:14 +08:00
|
|
|
|
v-for="item in states"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
:key="item.value"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<el-form-item label="病害状态" prop="state">
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="form.state"
|
|
|
|
|
|
placeholder="请选择病害状态"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
2024-10-11 15:04:14 +08:00
|
|
|
|
v-for="item in defectStatus"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
:key="item.value"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<el-form-item label="开始桩号" prop="stakeStart">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="form.stakeStart"
|
|
|
|
|
|
placeholder="请输入开始桩号"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<el-form-item label="结束桩号" prop="stakeEnd">
|
|
|
|
|
|
<el-input v-model="form.stakeEnd" placeholder="请输入结束桩号" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<el-form-item label="病害长度" prop="targetLen">
|
|
|
|
|
|
<el-input-number
|
|
|
|
|
|
v-model="form.targetLen"
|
|
|
|
|
|
:min="0"
|
|
|
|
|
|
placeholder="请输入病害长度"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<el-form-item label="病害面积" prop="targetArea">
|
|
|
|
|
|
<el-input-number
|
|
|
|
|
|
v-model="form.targetArea"
|
|
|
|
|
|
:min="0"
|
|
|
|
|
|
placeholder="请输入病害面积"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="12">
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-form-item label="上下行" prop="inspectDirection">
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="form.inspectDirection"
|
|
|
|
|
|
placeholder="请选择上下行"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
clearable
|
2024-10-11 15:04:14 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-option label="上行" value="0" />
|
|
|
|
|
|
<el-option label="下行" value="1" />
|
|
|
|
|
|
</el-select>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-form-item label="病害位置">
|
2024-10-09 11:55:13 +08:00
|
|
|
|
<div ref="addMap" id="addMap" class="no-hand-cursor"></div>
|
|
|
|
|
|
</el-form-item>
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<el-form-item label="上传病害图片">
|
|
|
|
|
|
<el-upload
|
|
|
|
|
|
ref="upload"
|
|
|
|
|
|
accept=".jpg, .png"
|
|
|
|
|
|
:action="upload.url"
|
|
|
|
|
|
:headers="upload.headers"
|
|
|
|
|
|
:file-list="upload.fileList"
|
|
|
|
|
|
:on-progress="handleFileUploadProgress"
|
|
|
|
|
|
:on-success="handleFileSuccess"
|
|
|
|
|
|
:auto-upload="false"
|
|
|
|
|
|
list-type="picture"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-button slot="trigger" size="small" type="primary"
|
|
|
|
|
|
>选取文件</el-button
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
style="margin-left: 1rem"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
:loading="upload.isUploading"
|
|
|
|
|
|
@click="submitUpload"
|
|
|
|
|
|
>上传到服务器</el-button
|
|
|
|
|
|
>
|
|
|
|
|
|
<div slot="tip" class="el-upload__tip">
|
|
|
|
|
|
只能上传jpg/png文件,且不超过500kb
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-upload>
|
|
|
|
|
|
</el-form-item>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 查看病害详细信息对话框 -->
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
|
title="查看病害详细信息"
|
|
|
|
|
|
:visible.sync="openViewDialog"
|
2024-10-12 14:35:31 +08:00
|
|
|
|
width="55rem"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
append-to-body
|
2024-10-11 15:04:14 +08:00
|
|
|
|
destroy-on-close
|
|
|
|
|
|
@close="cancel"
|
2024-10-09 11:55:13 +08:00
|
|
|
|
>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<!-- 上半部分 -->
|
|
|
|
|
|
<div style="display: flex; height: 50%">
|
|
|
|
|
|
<!-- 左侧病害信息 -->
|
|
|
|
|
|
<div style="flex: 1; padding: 10px">
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<p>
|
|
|
|
|
|
上报日期:{{ new Date(viewForm.createdTime).toLocaleString() }}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<p>路段名称:{{ viewForm.segmentName }}</p>
|
|
|
|
|
|
<!-- <p>病害坐标:{{ viewForm.geometry.coordinates }}</p> -->
|
|
|
|
|
|
<p>病害类型:{{ filterDefect(viewForm.defectType) }}</p>
|
|
|
|
|
|
<p>病害长度:{{ viewForm.targetLen }} 米</p>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 右侧图片展示 -->
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<div style="width: 27rem; padding: 10px">
|
|
|
|
|
|
<el-carousel class="view-carousel" height="15rem">
|
|
|
|
|
|
<el-carousel-item
|
|
|
|
|
|
v-for="(img, index) in viewForm.media"
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
>
|
|
|
|
|
|
<img :src="img.img" alt="病害图片" />
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</el-carousel-item>
|
|
|
|
|
|
</el-carousel>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 下半部分显示天地图 -->
|
|
|
|
|
|
<div id="viewMap" style="height: 300px; margin-top: 20px"></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
<el-button @click="closeDialog">关闭</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
listDefect,
|
|
|
|
|
|
delDefect,
|
|
|
|
|
|
addDefect,
|
|
|
|
|
|
updateDefect,
|
|
|
|
|
|
getDefectTypes,
|
2024-10-11 15:04:14 +08:00
|
|
|
|
getSegment,
|
|
|
|
|
|
getDefectList,
|
|
|
|
|
|
getStatesList,
|
|
|
|
|
|
getDefectStatus,
|
|
|
|
|
|
changeDefectStatus,
|
2024-10-09 11:55:13 +08:00
|
|
|
|
} from "@/api/xj/disease";
|
2024-10-11 15:04:14 +08:00
|
|
|
|
import { getToken } from "@/utils/auth";
|
2024-10-09 11:55:13 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: "Defect",
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
typeInfo: [],
|
|
|
|
|
|
// 查看弹窗显隐控制
|
|
|
|
|
|
openViewDialog: false,
|
|
|
|
|
|
// 遮罩层
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
// 选中数组
|
|
|
|
|
|
ids: [],
|
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
|
single: true,
|
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
|
multiple: true,
|
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
|
showSearch: true,
|
|
|
|
|
|
// 总条数
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
// 缺陷表格数据
|
|
|
|
|
|
defectList: [],
|
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
|
dialogTitle: "",
|
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
|
// 查询表单参数
|
|
|
|
|
|
queryParams: {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
page: 1,
|
|
|
|
|
|
size: 10,
|
2024-10-09 11:55:13 +08:00
|
|
|
|
segmentName: "",
|
2024-10-11 15:04:14 +08:00
|
|
|
|
defectType: "",
|
2024-10-09 11:55:13 +08:00
|
|
|
|
taskId: "",
|
2024-10-11 15:04:14 +08:00
|
|
|
|
state: "",
|
|
|
|
|
|
inspectDirection: "",
|
2024-10-09 11:55:13 +08:00
|
|
|
|
stakeStart: "",
|
|
|
|
|
|
stakeEnd: "",
|
|
|
|
|
|
warningFlag: null,
|
2024-10-11 15:04:14 +08:00
|
|
|
|
minLen: undefined,
|
|
|
|
|
|
maxLen: undefined,
|
|
|
|
|
|
minArea: undefined,
|
|
|
|
|
|
maxArea: undefined,
|
2024-10-09 11:55:13 +08:00
|
|
|
|
minDistance: null,
|
|
|
|
|
|
maxDistance: null,
|
|
|
|
|
|
},
|
2024-10-12 14:35:31 +08:00
|
|
|
|
dateTime: [],
|
2024-10-09 11:55:13 +08:00
|
|
|
|
// 新增/编辑表单参数
|
|
|
|
|
|
form: {
|
|
|
|
|
|
id: null,
|
2024-10-11 15:04:14 +08:00
|
|
|
|
segmentId: "",
|
2024-10-09 11:55:13 +08:00
|
|
|
|
defectType: "",
|
2024-10-11 15:04:14 +08:00
|
|
|
|
dataStatus: "",
|
2024-10-09 11:55:13 +08:00
|
|
|
|
state: "",
|
|
|
|
|
|
stakeStart: "",
|
|
|
|
|
|
stakeEnd: "",
|
2024-10-11 15:04:14 +08:00
|
|
|
|
targetLen: undefined,
|
|
|
|
|
|
targetArea: undefined,
|
2024-10-09 11:55:13 +08:00
|
|
|
|
inspectDirection: "",
|
|
|
|
|
|
media: [],
|
|
|
|
|
|
},
|
2024-10-11 15:04:14 +08:00
|
|
|
|
// 上传图片数组
|
|
|
|
|
|
fileList: [],
|
|
|
|
|
|
// 上传参数设置
|
|
|
|
|
|
upload: {
|
|
|
|
|
|
// 是否禁用上传
|
|
|
|
|
|
isUploading: false,
|
|
|
|
|
|
// 设置上传的请求头部
|
|
|
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
|
|
// 上传的地址
|
|
|
|
|
|
url: process.env.VUE_APP_BASE_API + "/common/upload",
|
|
|
|
|
|
// 上传的文件列表
|
|
|
|
|
|
fileList: [],
|
|
|
|
|
|
},
|
2024-10-09 11:55:13 +08:00
|
|
|
|
// 表单校验规则
|
|
|
|
|
|
rules: {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
segmentId: [
|
|
|
|
|
|
{ required: true, message: "请选择路段", trigger: "change" },
|
2024-10-09 11:55:13 +08:00
|
|
|
|
],
|
|
|
|
|
|
defectType: [
|
|
|
|
|
|
{ required: true, message: "请选择病害类型", trigger: "change" },
|
|
|
|
|
|
],
|
|
|
|
|
|
state: [
|
|
|
|
|
|
{ required: true, message: "请选择病害状态", trigger: "change" },
|
|
|
|
|
|
],
|
2024-10-11 15:04:14 +08:00
|
|
|
|
dataStatus: [
|
|
|
|
|
|
{ required: true, message: "请选择校验状态", trigger: "change" },
|
2024-10-09 11:55:13 +08:00
|
|
|
|
],
|
|
|
|
|
|
stakeStart: [
|
2024-10-11 15:04:14 +08:00
|
|
|
|
{ required: true, message: "请输入开始桩号", trigger: "blur" },
|
2024-10-09 11:55:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
pattern: /^K\d{4}\+\d{3}$/,
|
|
|
|
|
|
message: "请按照K0000+000格式进行填写",
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
stakeEnd: [
|
2024-10-11 15:04:14 +08:00
|
|
|
|
{ required: true, message: "请输入结束桩号", trigger: "blur" },
|
2024-10-09 11:55:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
pattern: /^K\d{4}\+\d{3}$/,
|
|
|
|
|
|
message: "请按照K0000+000格式进行填写",
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
targetLen: [
|
2024-10-11 15:04:14 +08:00
|
|
|
|
{ required: true, message: "请填写病害长度", trigger: "blur" },
|
2024-10-09 11:55:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
type: "number",
|
|
|
|
|
|
min: 0,
|
|
|
|
|
|
message: "病害长度必须为正数",
|
|
|
|
|
|
trigger: "change",
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
targetArea: [
|
2024-10-11 15:04:14 +08:00
|
|
|
|
{ required: true, message: "请填写病害面积", trigger: "blur" },
|
2024-10-09 11:55:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
type: "number",
|
|
|
|
|
|
min: 0,
|
|
|
|
|
|
message: "病害面积必须为正数",
|
|
|
|
|
|
trigger: "change",
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
2024-10-11 15:04:14 +08:00
|
|
|
|
inspectDirection: [
|
|
|
|
|
|
{ required: true, message: "请选择上下行", trigger: "change" },
|
|
|
|
|
|
],
|
2024-10-09 11:55:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 病害类型级联下拉选项
|
|
|
|
|
|
defectTypeOptions: [],
|
2024-10-11 15:04:14 +08:00
|
|
|
|
// 路段下拉选项
|
|
|
|
|
|
segmentList: [],
|
|
|
|
|
|
// 列表病害状态数据
|
|
|
|
|
|
tableDefect: [],
|
2024-10-09 11:55:13 +08:00
|
|
|
|
defectTypes: [],
|
2024-10-11 15:04:14 +08:00
|
|
|
|
// 校验状态下拉选项
|
|
|
|
|
|
states: [],
|
2024-10-09 11:55:13 +08:00
|
|
|
|
// 病害状态下拉选项
|
2024-10-11 15:04:14 +08:00
|
|
|
|
defectStatus: [],
|
2024-10-09 11:55:13 +08:00
|
|
|
|
// 新增/编辑打点数组
|
|
|
|
|
|
markers: [],
|
2024-10-11 15:04:14 +08:00
|
|
|
|
// 查看弹窗信息绑定
|
|
|
|
|
|
viewForm: {},
|
|
|
|
|
|
// 地图中心点
|
|
|
|
|
|
centerPoint: [123.30297096718999, 41.87942945541742],
|
2024-10-09 11:55:13 +08:00
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
this.getdefectTypes();
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.getSegmentList();
|
|
|
|
|
|
this.getTableDefect();
|
|
|
|
|
|
this.getStates();
|
|
|
|
|
|
this.getDefectStatusList();
|
2024-10-09 11:55:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
// 转换为按分类、子分类的label和value格式
|
|
|
|
|
|
transformToDeepCategorizedLabelValue(data) {
|
|
|
|
|
|
const result = {};
|
|
|
|
|
|
|
|
|
|
|
|
data.items.forEach((item) => {
|
|
|
|
|
|
Object.entries(item).forEach(([categoryKey, categoryValue]) => {
|
|
|
|
|
|
if (!result[categoryKey]) {
|
|
|
|
|
|
result[categoryKey] = {};
|
|
|
|
|
|
}
|
|
|
|
|
|
categoryValue.forEach((subCategory) => {
|
|
|
|
|
|
Object.entries(subCategory).forEach(
|
|
|
|
|
|
([subCategoryKey, subCategoryValue]) => {
|
|
|
|
|
|
if (!result[categoryKey][subCategoryKey]) {
|
|
|
|
|
|
result[categoryKey][subCategoryKey] = [];
|
|
|
|
|
|
}
|
|
|
|
|
|
// 处理嵌套的对象,将其转换为 label 和 value
|
|
|
|
|
|
if (typeof subCategoryValue === "object") {
|
|
|
|
|
|
Object.entries(subCategoryValue).forEach(([key, value]) => {
|
|
|
|
|
|
result[categoryKey][subCategoryKey].push({
|
|
|
|
|
|
label: value,
|
|
|
|
|
|
value: key,
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
result[categoryKey][subCategoryKey].push({
|
|
|
|
|
|
label: subCategoryValue,
|
|
|
|
|
|
value: subCategoryKey,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
},
|
2024-10-11 15:04:14 +08:00
|
|
|
|
/* 获取路段下拉数据 */
|
|
|
|
|
|
getSegmentList() {
|
|
|
|
|
|
getSegment().then(({ code, data }) => {
|
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
|
this.segmentList = data;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 获取列表病害类型对应数据 */
|
|
|
|
|
|
getTableDefect() {
|
|
|
|
|
|
getDefectList().then(({ code, data }) => {
|
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
|
this.tableDefect = data;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 过滤列表病害类型 */
|
|
|
|
|
|
filterDefect(value) {
|
|
|
|
|
|
let a = null;
|
|
|
|
|
|
[a] = this.tableDefect.filter((item) => {
|
|
|
|
|
|
return item.value === value;
|
|
|
|
|
|
});
|
|
|
|
|
|
if (a) {
|
|
|
|
|
|
return a.label;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2024-10-12 14:35:31 +08:00
|
|
|
|
/* 过滤列表病害状态 */
|
|
|
|
|
|
filterState(value) {
|
|
|
|
|
|
let a = null;
|
|
|
|
|
|
[a] = this.defectStatus.filter((item) => {
|
|
|
|
|
|
return item.value === value;
|
|
|
|
|
|
});
|
|
|
|
|
|
if (a) {
|
|
|
|
|
|
return a.label;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2024-10-09 11:55:13 +08:00
|
|
|
|
/* 获取病害类型下拉数据 */
|
|
|
|
|
|
getdefectTypes() {
|
|
|
|
|
|
getDefectTypes().then((response) => {
|
|
|
|
|
|
this.defectTypeOptions = JSON.parse(response.msg).map((item) => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
label: item.label,
|
|
|
|
|
|
value: item.value,
|
|
|
|
|
|
children: item.childrens,
|
|
|
|
|
|
};
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2024-10-11 15:04:14 +08:00
|
|
|
|
/* 查询校验状态下拉数据 */
|
|
|
|
|
|
getStates() {
|
|
|
|
|
|
getStatesList().then(({ code, data }) => {
|
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
|
this.states = data;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 查询病害状态下拉数据 */
|
|
|
|
|
|
getDefectStatusList() {
|
|
|
|
|
|
getDefectStatus().then(({ data, code }) => {
|
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
|
this.defectStatus = data;
|
|
|
|
|
|
}
|
2024-10-09 11:55:13 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/** 查询缺陷列表 */
|
|
|
|
|
|
getList() {
|
|
|
|
|
|
// 处理日期范围
|
2024-10-12 14:35:31 +08:00
|
|
|
|
const params = {
|
|
|
|
|
|
...this.queryParams,
|
|
|
|
|
|
startTime: this.dateTime ? this.dateTime[0] : "",
|
|
|
|
|
|
endTime: this.dateTime ? this.dateTime[1] : "",
|
|
|
|
|
|
};
|
2024-10-09 11:55:13 +08:00
|
|
|
|
listDefect(params)
|
|
|
|
|
|
.then((response) => {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.defectList = response.rows;
|
2024-10-09 11:55:13 +08:00
|
|
|
|
this.total = response.total;
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 新增/编辑弹窗取消按钮 */
|
|
|
|
|
|
cancel() {
|
|
|
|
|
|
this.dialogVisible = false;
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.upload.fileList = [];
|
|
|
|
|
|
this.markers = [];
|
|
|
|
|
|
this.centerPoint = [123.30297096718999, 41.87942945541742];
|
2024-10-12 14:35:31 +08:00
|
|
|
|
this.form = {
|
|
|
|
|
|
id: null,
|
|
|
|
|
|
segmentId: "",
|
|
|
|
|
|
defectType: "",
|
|
|
|
|
|
dataStatus: "",
|
|
|
|
|
|
state: "",
|
|
|
|
|
|
stakeStart: "",
|
|
|
|
|
|
stakeEnd: "",
|
|
|
|
|
|
targetLen: undefined,
|
|
|
|
|
|
targetArea: undefined,
|
|
|
|
|
|
inspectDirection: "",
|
|
|
|
|
|
media: [],
|
|
|
|
|
|
};
|
|
|
|
|
|
this.$refs["addForm"].resetFields();
|
|
|
|
|
|
// this.resetFormData();
|
2024-10-09 11:55:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
/* 重置表单方法 */
|
|
|
|
|
|
resetForm(formName) {
|
|
|
|
|
|
this.$refs[formName].resetFields();
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 表单重置事件 */
|
|
|
|
|
|
resetQuery() {
|
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
|
this.queryParams = {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
page: 1,
|
|
|
|
|
|
size: 10,
|
2024-10-09 11:55:13 +08:00
|
|
|
|
segmentName: "",
|
|
|
|
|
|
defectType: [],
|
|
|
|
|
|
taskId: "",
|
2024-10-11 15:04:14 +08:00
|
|
|
|
state: "",
|
|
|
|
|
|
inspectDirection: "",
|
2024-10-09 11:55:13 +08:00
|
|
|
|
stakeStart: "",
|
|
|
|
|
|
stakeEnd: "",
|
|
|
|
|
|
warningFlag: null,
|
2024-10-11 15:04:14 +08:00
|
|
|
|
minLen: undefined,
|
|
|
|
|
|
maxLen: undefined,
|
|
|
|
|
|
minArea: undefined,
|
|
|
|
|
|
maxArea: undefined,
|
2024-10-09 11:55:13 +08:00
|
|
|
|
};
|
2024-10-12 14:35:31 +08:00
|
|
|
|
(this.dateTime = []), this.getList();
|
2024-10-09 11:55:13 +08:00
|
|
|
|
},
|
2024-10-11 15:04:14 +08:00
|
|
|
|
/** 点击搜索按钮操作 */
|
2024-10-09 11:55:13 +08:00
|
|
|
|
handleQuery() {
|
|
|
|
|
|
const phonereg = /^K\d{4}\+\d{3}$/;
|
|
|
|
|
|
if (this.queryParams.stakeStart) {
|
|
|
|
|
|
if (phonereg.test(this.queryParams.stakeStart)) {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.queryParams.page = 1;
|
2024-10-09 11:55:13 +08:00
|
|
|
|
this.getList();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$modal.msgWarning("请按照格式填写公里桩进行修改");
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (this.queryParams.stakeEnd) {
|
|
|
|
|
|
if (phonereg.test(this.queryParams.stakeEnd)) {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.queryParams.page = 1;
|
2024-10-09 11:55:13 +08:00
|
|
|
|
this.getList();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$modal.msgWarning("请按照格式填写公里桩进行修改");
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.queryParams.page = 1;
|
2024-10-09 11:55:13 +08:00
|
|
|
|
this.getList();
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 多选框选中数据 */
|
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
|
this.ids = selection.map((item) => item.id);
|
|
|
|
|
|
this.single = selection.length !== 1;
|
|
|
|
|
|
this.multiple = !selection.length;
|
|
|
|
|
|
},
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
|
handleAdd() {
|
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
|
this.dialogTitle = "添加缺陷";
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.initMap("addMap");
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
|
handleUpdate(row) {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
|
this.dialogTitle = "修改缺陷";
|
|
|
|
|
|
this.centerPoint = [
|
|
|
|
|
|
row.geometry.coordinates[0],
|
|
|
|
|
|
row.geometry.coordinates[1],
|
|
|
|
|
|
];
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.initMap("addMap");
|
|
|
|
|
|
const e = {
|
|
|
|
|
|
lnglat: {
|
|
|
|
|
|
lat: row.geometry.coordinates[1],
|
|
|
|
|
|
lng: row.geometry.coordinates[0],
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
this.onMapClick(e);
|
|
|
|
|
|
});
|
|
|
|
|
|
this.form = row;
|
|
|
|
|
|
this.upload.fileList = row.media.map((item) => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
...item,
|
|
|
|
|
|
url: item.img,
|
|
|
|
|
|
};
|
|
|
|
|
|
});
|
2024-10-09 11:55:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
/* 批量确认操作 */
|
|
|
|
|
|
handleUpdateBatch() {
|
|
|
|
|
|
if (this.ids.length > 0) {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
changeDefectStatus(this.ids).then(({ code, data }) => {
|
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
|
this.$modal.msgSuccess(`修改${data}`);
|
|
|
|
|
|
this.$refs.defectTable.clearSelection();
|
|
|
|
|
|
this.ids = [];
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2024-10-09 11:55:13 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.$modal.msgWarning("请选择一条记录进行修改");
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2024-10-11 15:04:14 +08:00
|
|
|
|
/* 文件提交处理 */
|
|
|
|
|
|
submitUpload() {
|
|
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 文件上传中处理 */
|
|
|
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
|
|
|
this.upload.isUploading = true;
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 文件上传成功处理 */
|
|
|
|
|
|
handleFileSuccess(response, file, fileList) {
|
|
|
|
|
|
this.fileList = fileList.map((item) => {
|
|
|
|
|
|
if (item.response) {
|
|
|
|
|
|
return { img: item.response.url };
|
|
|
|
|
|
}
|
|
|
|
|
|
return item;
|
|
|
|
|
|
});
|
|
|
|
|
|
this.upload.isUploading = false;
|
|
|
|
|
|
},
|
2024-10-09 11:55:13 +08:00
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
|
submitForm() {
|
|
|
|
|
|
this.$refs["defectForm"].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
// 验证点位
|
|
|
|
|
|
if (this.markers.length < 1) {
|
|
|
|
|
|
this.$modal.msgWarning("请选择病害位置");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2024-10-12 14:35:31 +08:00
|
|
|
|
// 验证文件上传列表
|
|
|
|
|
|
if (this.fileList.length < 1) {
|
|
|
|
|
|
this.$modal.msgWarning("请上传图片");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2024-10-11 15:04:14 +08:00
|
|
|
|
const data = {
|
|
|
|
|
|
...this.form,
|
|
|
|
|
|
media: this.fileList,
|
|
|
|
|
|
geometry: {
|
|
|
|
|
|
type: "Point",
|
|
|
|
|
|
coordinates: [this.markers[0].lng, this.markers[0].lat],
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
2024-10-09 11:55:13 +08:00
|
|
|
|
if (this.form.id) {
|
|
|
|
|
|
// 更新缺陷
|
2024-10-11 15:04:14 +08:00
|
|
|
|
updateDefect(data)
|
2024-10-09 11:55:13 +08:00
|
|
|
|
.then(() => {
|
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.$refs["defectForm"].resetFields();
|
|
|
|
|
|
this.upload.fileList = [];
|
|
|
|
|
|
this.markers = [];
|
2024-10-09 11:55:13 +08:00
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
this.$modal.msgError("修改失败");
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// 添加缺陷
|
2024-10-11 15:04:14 +08:00
|
|
|
|
addDefect(data)
|
2024-10-09 11:55:13 +08:00
|
|
|
|
.then(() => {
|
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.$refs["defectForm"].resetFields();
|
|
|
|
|
|
this.upload.fileList = [];
|
|
|
|
|
|
this.markers = [];
|
2024-10-09 11:55:13 +08:00
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
this.$modal.msgError("新增失败");
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
|
const ids = row ? [row.id] : this.ids;
|
|
|
|
|
|
if (!ids.length) {
|
|
|
|
|
|
this.$modal.msgWarning("请选择要删除的记录");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$modal
|
|
|
|
|
|
.confirm(`是否确认删除选中的${ids.length}条记录?`)
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
return delDefect(ids);
|
|
|
|
|
|
})
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
|
},
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
|
handleExport() {
|
|
|
|
|
|
this.download(
|
|
|
|
|
|
"xj/defect/export",
|
|
|
|
|
|
{
|
|
|
|
|
|
...this.queryParams,
|
|
|
|
|
|
},
|
|
|
|
|
|
`defect_${new Date().getTime()}.xlsx`
|
|
|
|
|
|
);
|
|
|
|
|
|
},
|
|
|
|
|
|
/** 重置表单数据 */
|
|
|
|
|
|
resetFormData() {
|
|
|
|
|
|
this.form = {
|
|
|
|
|
|
id: null,
|
2024-10-11 15:04:14 +08:00
|
|
|
|
segmentId: "",
|
2024-10-09 11:55:13 +08:00
|
|
|
|
defectType: "",
|
2024-10-11 15:04:14 +08:00
|
|
|
|
dataStatus: "",
|
2024-10-09 11:55:13 +08:00
|
|
|
|
state: "",
|
|
|
|
|
|
stakeStart: "",
|
|
|
|
|
|
stakeEnd: "",
|
2024-10-11 15:04:14 +08:00
|
|
|
|
targetLen: undefined,
|
|
|
|
|
|
targetArea: undefined,
|
2024-10-09 11:55:13 +08:00
|
|
|
|
inspectDirection: "",
|
|
|
|
|
|
media: [],
|
|
|
|
|
|
};
|
|
|
|
|
|
this.resetForm("defectForm");
|
|
|
|
|
|
},
|
2024-10-11 15:04:14 +08:00
|
|
|
|
/* 点击行列表查看事件 */
|
2024-10-09 11:55:13 +08:00
|
|
|
|
viewDefect(defect) {
|
2024-10-11 15:04:14 +08:00
|
|
|
|
// this.loadDefect(defect.id);
|
2024-10-09 11:55:13 +08:00
|
|
|
|
this.openViewDialog = true;
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.viewForm = defect;
|
2024-10-09 11:55:13 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.initMap("viewMap");
|
2024-10-11 15:04:14 +08:00
|
|
|
|
const e = {
|
|
|
|
|
|
lnglat: {
|
|
|
|
|
|
lat: defect.geometry.coordinates[1],
|
|
|
|
|
|
lng: defect.geometry.coordinates[0],
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
this.onMapClick(e);
|
|
|
|
|
|
// 移除点击事件
|
|
|
|
|
|
this.map.removeEventListener("click", this.onMapClick);
|
2024-10-09 11:55:13 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 初始化天地图 */
|
|
|
|
|
|
initMap(ele) {
|
|
|
|
|
|
// if (this.map) {
|
|
|
|
|
|
// this.map.remove(); // 如果已经有地图实例,先移除再重新加载
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化天地图
|
|
|
|
|
|
this.map = new T.Map(ele);
|
2024-10-11 15:04:14 +08:00
|
|
|
|
this.map.centerAndZoom(
|
|
|
|
|
|
new T.LngLat(this.centerPoint[0], this.centerPoint[1]),
|
|
|
|
|
|
9
|
|
|
|
|
|
); // 设置中心点和缩放级别
|
2024-10-09 11:55:13 +08:00
|
|
|
|
// 添加单击事件
|
|
|
|
|
|
this.map.on("click", this.onMapClick);
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 新增/编辑地图单击事件 */
|
|
|
|
|
|
onMapClick(e) {
|
|
|
|
|
|
const marker = new T.Marker(e.lnglat);
|
|
|
|
|
|
if (this.markers.length > 0) {
|
|
|
|
|
|
this.markers.shift();
|
|
|
|
|
|
this.map.clearOverLays();
|
|
|
|
|
|
this.map.addOverLay(marker);
|
|
|
|
|
|
this.markers.push(e.lnglat);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.map.addOverLay(marker);
|
|
|
|
|
|
this.markers.push(e.lnglat);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 关闭查看对话框 */
|
|
|
|
|
|
closeDialog() {
|
|
|
|
|
|
this.openViewDialog = false;
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2024-10-11 15:04:14 +08:00
|
|
|
|
<style lang="scss" scoped>
|
2024-10-09 11:55:13 +08:00
|
|
|
|
.app-container {
|
|
|
|
|
|
padding: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.mb8 {
|
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.small-padding {
|
|
|
|
|
|
padding: 0 5px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.fixed-width {
|
|
|
|
|
|
width: 120px;
|
|
|
|
|
|
}
|
2024-10-11 15:04:14 +08:00
|
|
|
|
/* 新增弹窗/编辑弹窗 */
|
|
|
|
|
|
.addForm {
|
|
|
|
|
|
.el-select,
|
|
|
|
|
|
.el-cascader {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-09 11:55:13 +08:00
|
|
|
|
/* 新增地图框样式 */
|
|
|
|
|
|
.no-hand-cursor {
|
|
|
|
|
|
cursor: default !important;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 20rem;
|
|
|
|
|
|
}
|
2024-10-11 15:04:14 +08:00
|
|
|
|
|
|
|
|
|
|
/* 上传文件列表样式 */
|
|
|
|
|
|
::v-deep .el-upload-list {
|
|
|
|
|
|
img {
|
|
|
|
|
|
width: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 查看弹窗-图片框样式 */
|
|
|
|
|
|
.view-carousel {
|
|
|
|
|
|
height: 15rem;
|
|
|
|
|
|
// .el-carousel__item{
|
|
|
|
|
|
// height: 12rem;
|
|
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
|
max-height: 15rem;
|
|
|
|
|
|
max-width: 25rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-09 11:55:13 +08:00
|
|
|
|
</style>
|