fix:路面病害对比
This commit is contained in:
parent
1b6f4853ac
commit
d425319b63
@ -44,7 +44,7 @@
|
||||
"clipboard": "2.0.8",
|
||||
"core-js": "3.37.1",
|
||||
"diagram-js": "^11.4.1",
|
||||
"echarts": "5.4.0",
|
||||
"echarts": "^5.4.0",
|
||||
"element-ui": "2.15.14",
|
||||
"file-saver": "2.0.5",
|
||||
"fuse.js": "6.4.3",
|
||||
|
||||
36
src/api/xj/task.js
Normal file
36
src/api/xj/task.js
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* @Author: SunTao 328867980@qq.com
|
||||
* @Date: 2024-10-14 10:04:12
|
||||
* @LastEditors: SunTao 328867980@qq.com
|
||||
* @LastEditTime: 2024-10-14 10:27:49
|
||||
* @FilePath: \znxjxt-ui\src\api\xj\task.js
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 获取巡检任务列表数据接口
|
||||
export function getTaskTable(params) {
|
||||
return request({
|
||||
url: "/xj/xjtask/list",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 巡检路段下拉数据
|
||||
export function getSegment() {
|
||||
return request({
|
||||
url: "/api/v2/segment/selectList",
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 路产类型下拉
|
||||
export function getRoadType() {
|
||||
return request({
|
||||
url: "/metadata/equipmentEquipmentType",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
228
src/components/map/fssm-map.vue
Normal file
228
src/components/map/fssm-map.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<!--
|
||||
* @Author: SunTao 328867980@qq.com
|
||||
* @Date: 2024-10-14 10:46:23
|
||||
* @LastEditors: SunTao 328867980@qq.com
|
||||
* @LastEditTime: 2024-10-15 09:41:43
|
||||
* @FilePath: \znxjxt-ui\src\views\xj\inspection\task-management\components\fssm-map.vue
|
||||
* @Description: 公共地图
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="map-container">
|
||||
<div ref="container" :id="`map-${mapId}`"></div>
|
||||
<div ref="mapController" v-if="showZoom" class="control-container">
|
||||
<div class="bigButton">
|
||||
<i class="el-icon-plus" @click="changeZoom(1, 0.5)"></i>
|
||||
</div>
|
||||
<div class="smallButton">
|
||||
<i class="el-icon-minus" @click="changeZoom(-1, 0.5)"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Map, View } from "ol";
|
||||
import XYZ from "ol/source/XYZ";
|
||||
import { Tile as TileLayer } from "ol/layer";
|
||||
import { defaults as defaultControls } from "ol/control";
|
||||
export default {
|
||||
name: "FssmMap",
|
||||
props: {
|
||||
// 接收传过来得中心点
|
||||
centerPoint: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return { lat: 123.30297096718999, lon: 41.87942945541742 };
|
||||
},
|
||||
},
|
||||
// 接受传过来得地图层级
|
||||
zoom: {
|
||||
type: String,
|
||||
default: "10",
|
||||
},
|
||||
// 是否显示地图放大缩小
|
||||
showZoom: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
mapId: {
|
||||
type: String,
|
||||
default: "0",
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 地图实例
|
||||
instance: new Map(),
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.initMap();
|
||||
},
|
||||
methods: {
|
||||
/* 初始化openlayer地图 */
|
||||
initMap() {
|
||||
const map = new Map({
|
||||
target: `map-${this.mapId}`,
|
||||
controls: defaultControls({
|
||||
zoom: false,
|
||||
attribution: false,
|
||||
rotate: false,
|
||||
}),
|
||||
view: new View({
|
||||
center: [this.centerPoint.lat, this.centerPoint.lon], //中心点经纬度
|
||||
zoom: this.zoom, //图层缩放大小
|
||||
projection: "EPSG:4326",
|
||||
}),
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new XYZ({
|
||||
url: "http://t{0-7}.tianditu.com/DataServer?x={x}&y={y}&l={z}&T=vec_c&tk=c691040443c68cda625755c5c3e2acc3",
|
||||
projection: "EPSG:4326",
|
||||
}),
|
||||
}),
|
||||
new TileLayer({
|
||||
source: new XYZ({
|
||||
url: "http://t{0-7}.tianditu.com/DataServer?x={x}&y={y}&l={z}&T=cva_c&tk=c691040443c68cda625755c5c3e2acc3",
|
||||
projection: "EPSG:4326",
|
||||
}),
|
||||
}),
|
||||
],
|
||||
});
|
||||
// 图层点击事件
|
||||
map.on("singleclick", (e) => {
|
||||
const featureClick = map.forEachFeatureAtPixel(
|
||||
map.getEventPixel(e.originalEvent),
|
||||
(feature) => {
|
||||
return feature;
|
||||
}
|
||||
);
|
||||
// 如果有图层则返回图层点击
|
||||
if (featureClick) {
|
||||
this.$emit("feature-click", featureClick);
|
||||
} else {
|
||||
// 没有图层则返回地图点击事件
|
||||
this.$emit("map-click", e);
|
||||
}
|
||||
});
|
||||
// 图层双击事件
|
||||
map.on("dblclick", (e) => {
|
||||
const featureDblclick = map.forEachFeatureAtPixel(
|
||||
map.getEventPixel(e.originalEvent),
|
||||
(feature) => {
|
||||
return feature;
|
||||
}
|
||||
);
|
||||
if (featureDblclick) {
|
||||
this.$emit("feature-dblclick", featureDblclick);
|
||||
}
|
||||
});
|
||||
// 鼠标移入事件
|
||||
map.on("pointermove", (e) => {
|
||||
const feature = map.forEachFeatureAtPixel(
|
||||
map.getEventPixel(e.originalEvent),
|
||||
(mapFeature) => {
|
||||
return mapFeature;
|
||||
}
|
||||
);
|
||||
// 线、面要素不做鼠标移入样式修改
|
||||
if (feature) {
|
||||
if (feature.getGeometry()?.getType() === "Point") {
|
||||
map.getTargetElement().style.cursor = "pointer";
|
||||
this.$emit("pointer-move", feature);
|
||||
} else {
|
||||
map.getTargetElement().style.cursor = "auto";
|
||||
}
|
||||
} else {
|
||||
map.getTargetElement().style.cursor = "auto";
|
||||
}
|
||||
});
|
||||
this.instance.set("map", map);
|
||||
this.instance.set("overlay-list", []);
|
||||
},
|
||||
/**
|
||||
* @description: 切换当前位置
|
||||
* @param {Array} position 中心点位置
|
||||
* @param {number} zoom 地图缩放等级
|
||||
* @param {number} rotation 地图旋转角度
|
||||
* @param {number} duration 地图垂直深度
|
||||
* @return
|
||||
*/
|
||||
changePosition(position, zoom, rotation, duration) {
|
||||
const map = this.instance.get("map");
|
||||
if (map) {
|
||||
map.getView().animate({
|
||||
center: position, // 地图中心点位
|
||||
zoom: zoom || 12, // 地图缩放等级
|
||||
rotation: rotation || undefined, // 旋转角度
|
||||
duration: duration || 1000, // 动画加载时间
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 清空地图图层
|
||||
* @return
|
||||
*/
|
||||
clearMapFeature() {
|
||||
const map = this.instance.get("map");
|
||||
const [layer] = map.getAllLayers().filter((item) => item.get("type"));
|
||||
map.removeLayer(layer);
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 调整地图缩放等级
|
||||
* @return
|
||||
*/
|
||||
changeZoom(type = 1, zoomStep) {
|
||||
const map = this.instance.get("map");
|
||||
if (map) {
|
||||
const step = zoomStep || 0.5;
|
||||
// 获取当前地图缩放等级
|
||||
const currentZoom = map.getView().getZoom();
|
||||
map.getView().animate({
|
||||
zoom: currentZoom + step * type,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/* 生命周期函数 */
|
||||
beforeDestroy() {
|
||||
this.instance.clear();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.map-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
#map-0 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#map-1 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.control-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
left: 1rem;
|
||||
top: 1rem;
|
||||
|
||||
i {
|
||||
padding: 0.1rem 0;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
39
src/components/scroll/fssm-scroll.vue
Normal file
39
src/components/scroll/fssm-scroll.vue
Normal file
@ -0,0 +1,39 @@
|
||||
<!--
|
||||
* @Author: SunTao 328867980@qq.com
|
||||
* @Date: 2024-10-14 15:22:21
|
||||
* @LastEditors: SunTao 328867980@qq.com
|
||||
* @LastEditTime: 2024-10-14 15:26:52
|
||||
* @FilePath: \znxjxt-ui\src\views\xj\inspection\surface-management\components\fssm-scroll.vue
|
||||
* @Description: 滚动条封装样式
|
||||
-->
|
||||
<template>
|
||||
<div class="scroll-box">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.scroll-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
&::-webkit-scrollbar-thumb {
|
||||
border-radius: 7px;
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
background: rgba(222, 225, 230, 1);
|
||||
}
|
||||
&::-webkit-scrollbar-track {
|
||||
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 7px;
|
||||
background: rgba(220, 231, 248, 0.1);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,3 +1,12 @@
|
||||
<!--
|
||||
* @Author: SunTao 328867980@qq.com
|
||||
* @Date: 2024-10-12 13:11:05
|
||||
* @LastEditors: SunTao 328867980@qq.com
|
||||
* @LastEditTime: 2024-10-14 09:11:45
|
||||
* @FilePath: \znxjxt-ui\src\views\xj\inspection\road-management\components\road-view.vue
|
||||
* @Description: 交安事件-查看弹窗
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="view-content">
|
||||
<div>
|
||||
|
||||
@ -0,0 +1,308 @@
|
||||
<!--
|
||||
* @Author: SunTao 328867980@qq.com
|
||||
* @Date: 2024-10-14 14:49:21
|
||||
* @LastEditors: SunTao 328867980@qq.com
|
||||
* @LastEditTime: 2024-10-15 11:50:48
|
||||
* @FilePath: \znxjxt-ui\src\views\xj\inspection\surface-management\components\surface-map.vue
|
||||
* @Description: 路面病害管理-地图组件
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="div-all">
|
||||
<div class="div-map">
|
||||
<fssm-map
|
||||
ref="contentMap"
|
||||
:mapId="mapObject.id"
|
||||
@feature-click="featureClick"
|
||||
:showZoom="false"
|
||||
></fssm-map>
|
||||
<div class="map-clean">
|
||||
<i @click="cleanLayer" class="el-icon-delete-solid"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-form">
|
||||
<div
|
||||
v-if="mapObject.centerList.length > 0"
|
||||
ref="echart"
|
||||
class="echart-div"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FssmScroll from "@/components/scroll/fssm-scroll";
|
||||
import FssmMap from "@/components/map/fssm-map";
|
||||
import logo from "@/assets/xc.png";
|
||||
import { Point } from "ol/geom";
|
||||
import { Style, Icon } from "ol/style";
|
||||
import { Vector as VectorSource } from "ol/source";
|
||||
import VectorLayer from "ol/layer/Vector";
|
||||
import { Feature } from "ol";
|
||||
import * as echarts from "echarts";
|
||||
|
||||
export default {
|
||||
components: { FssmScroll, FssmMap },
|
||||
name: "SurfaceMap",
|
||||
props: {
|
||||
mapObject: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 弹窗显隐控制
|
||||
viewVisible: false,
|
||||
//
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
created() {},
|
||||
methods: {
|
||||
/* 绘制点位 */
|
||||
drawMapPoints() {
|
||||
this.$refs.contentMap.clearMapFeature();
|
||||
const features = [];
|
||||
this.mapObject.centerList.forEach((element) => {
|
||||
const point = new Point(element); // 修改坐标格式
|
||||
const feature = new Feature({
|
||||
geometry: point,
|
||||
custom: { data: "123", type: "icon", id: this.mapObject.id }, // 可以放一些自己的数据
|
||||
type: "icon", // 自己设置一个标识
|
||||
});
|
||||
feature.setStyle([
|
||||
new Style({
|
||||
image: new Icon({
|
||||
crossOrigin: "anonymous",
|
||||
src: logo,
|
||||
// size: [40, 40],
|
||||
scale: 0.05, // 图标缩放比例
|
||||
}),
|
||||
}),
|
||||
]);
|
||||
features.push(feature);
|
||||
});
|
||||
//设置地图的数据源
|
||||
const pointSource = new VectorSource({
|
||||
features,
|
||||
});
|
||||
let markLayerPoints = new VectorLayer({
|
||||
source: pointSource,
|
||||
properties: {
|
||||
type: "point",
|
||||
},
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
const map = this.$refs.contentMap.instance.get("map");
|
||||
map.addLayer(markLayerPoints);
|
||||
});
|
||||
},
|
||||
/* 清除地图图层 */
|
||||
cleanLayer() {
|
||||
this.$emit("clearId", this.mapObject.id);
|
||||
this.$refs.contentMap.clearMapFeature();
|
||||
},
|
||||
/* 图层点击事件 */
|
||||
featureClick(feature) {
|
||||
if (feature && feature.get("type")) {
|
||||
this.$emit("send-img", {
|
||||
data: feature.get("custom"),
|
||||
id: this.mapObject.id,
|
||||
});
|
||||
}
|
||||
},
|
||||
/* 绘制柱状图 */
|
||||
initEchart() {
|
||||
if (this.$refs.echart) {
|
||||
const chart = echarts.init(this.$refs.echart);
|
||||
chart.setOption({
|
||||
//图例样式
|
||||
legend: {
|
||||
icon: "circle",
|
||||
bottom: "0%",
|
||||
left: "center",
|
||||
itemHeight: 10,
|
||||
data: ["1111", "2222", "3333", "4444"],
|
||||
},
|
||||
//图表位置
|
||||
grid: {
|
||||
top: "25%",
|
||||
bottom: "17%",
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
},
|
||||
//提示框组件
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: [
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
"Fri",
|
||||
"Sat",
|
||||
"Sun",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
],
|
||||
//坐标轴刻度
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
//坐标轴轴线
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#D2D2D2",
|
||||
},
|
||||
},
|
||||
//坐标轴刻度标签
|
||||
axisLabel: {
|
||||
show: true,
|
||||
color: "#616367",
|
||||
},
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
name: "单位:家",
|
||||
nameTextStyle: {
|
||||
color: "#616367",
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#D2D2D2",
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
show: true,
|
||||
color: "#616367",
|
||||
},
|
||||
|
||||
silent: false, // 坐标轴是否是静态无法交互
|
||||
triggerEvent: true, // 坐标轴的标签是否响应和触发鼠标事件,默认不响应
|
||||
},
|
||||
{
|
||||
type: "value",
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#D2D2D2",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
//该柱状图颜色
|
||||
// color:"",
|
||||
name: "1111",
|
||||
//柱状图的粗细--可以”20%“
|
||||
barWidth: 6,
|
||||
color: "#72A1FF",
|
||||
data: [
|
||||
120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110,
|
||||
],
|
||||
type: "bar",
|
||||
},
|
||||
{
|
||||
name: "2222",
|
||||
barWidth: 6,
|
||||
color: "#73ECAF",
|
||||
data: [
|
||||
120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110,
|
||||
],
|
||||
type: "bar",
|
||||
},
|
||||
{
|
||||
name: "3333",
|
||||
barWidth: 6,
|
||||
color: "#FF7D74",
|
||||
data: [
|
||||
120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110,
|
||||
],
|
||||
type: "bar",
|
||||
},
|
||||
{
|
||||
name: "4444",
|
||||
barWidth: 6,
|
||||
color: "#FCD678",
|
||||
data: [
|
||||
120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110,
|
||||
],
|
||||
type: "bar",
|
||||
},
|
||||
],
|
||||
});
|
||||
window.addEventListener("resize", () => {
|
||||
chart.resize();
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.div-all {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.div-map {
|
||||
width: 100%;
|
||||
height: 65%;
|
||||
position: relative;
|
||||
|
||||
.map-clean {
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
right: 0.5rem;
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.div-form {
|
||||
width: 100%;
|
||||
height: 35%;
|
||||
padding: 1rem 0;
|
||||
|
||||
.echart-div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
// 弹窗图片框
|
||||
.dialog-div {
|
||||
display: flex;
|
||||
.img-div {
|
||||
width: 50%;
|
||||
height: 30rem;
|
||||
padding: 0 1rem;
|
||||
|
||||
img {
|
||||
height: 30rem;
|
||||
width: 32rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1831
src/views/xj/inspection/surface-management/index.vue
Normal file
1831
src/views/xj/inspection/surface-management/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: SunTao 328867980@qq.com
|
||||
* @Date: 2024-10-14 10:36:09
|
||||
* @LastEditors: SunTao 328867980@qq.com
|
||||
* @LastEditTime: 2024-10-14 11:10:42
|
||||
* @FilePath: \znxjxt-ui\src\views\xj\inspection\task-management\components\task-view.vue
|
||||
* @Description: 巡检任务-查看路径
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="view-content">
|
||||
<div id="view-map">
|
||||
<fssm-map
|
||||
ref="mapContent"
|
||||
@map-click="mapClick"
|
||||
@feature-dblclick="mapDbclick"
|
||||
></fssm-map>
|
||||
</div>
|
||||
<div class="footer"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FssmMap from "@/components/map/fssm-map";
|
||||
|
||||
export default {
|
||||
name: "TaskView",
|
||||
components: { FssmMap },
|
||||
props: {
|
||||
dialogItem: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
/* 地图点击事件 */
|
||||
mapClick(feature) {},
|
||||
/* 地图双击事件 */
|
||||
mapDbclick(feature) {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.view-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#view-map {
|
||||
width: 100%;
|
||||
height: 40rem;
|
||||
}
|
||||
|
||||
.footer {
|
||||
height: 5rem;
|
||||
width: 100%;
|
||||
background-color: aqua;
|
||||
}
|
||||
</style>
|
||||
375
src/views/xj/inspection/task-management/index.vue
Normal file
375
src/views/xj/inspection/task-management/index.vue
Normal file
@ -0,0 +1,375 @@
|
||||
<!--
|
||||
* @Author: SunTao 328867980@qq.com
|
||||
* @Date: 2024-10-14 09:48:43
|
||||
* @LastEditors: SunTao 328867980@qq.com
|
||||
* @LastEditTime: 2024-10-14 10:54:23
|
||||
* @FilePath: \znxjxt-ui\src\views\xj\inspection\task-management\index.vue
|
||||
* @Description: 巡检管理-巡检任务
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索表单 -->
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="任务id" prop="id">
|
||||
<el-autocomplete
|
||||
v-model="queryParams.id"
|
||||
:fetch-suggestions="querySearchAsync"
|
||||
placeholder="请输入任务id"
|
||||
@select="handleSelect"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌号码" prop="carName">
|
||||
<el-select
|
||||
v-model="queryParams.carName"
|
||||
placeholder="请选择车牌号码"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in carNameList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检路段" prop="segmentName">
|
||||
<el-select
|
||||
v-model="queryParams.segmentName"
|
||||
placeholder="请选择巡检路段"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in segmentList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检时间" prop="dateTime">
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
clearable
|
||||
/>
|
||||
</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-table
|
||||
ref="roadTable"
|
||||
v-loading="loading"
|
||||
:data="roadList"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="巡检路段" align="center" prop="segmentName" />
|
||||
<el-table-column label="巡检路段编码" align="center" prop="segmentId">
|
||||
</el-table-column>
|
||||
<el-table-column label="巡检开始时间" align="center" prop="startTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
scope.row.startTime
|
||||
? new Date(scope.row.startTime).toLocaleString()
|
||||
: ""
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="巡检起点" align="center" prop="stakeStart" />
|
||||
<el-table-column label="巡检终点" align="center" prop="stakeEnd" />
|
||||
<el-table-column label="车牌号码" align="center" prop="media">
|
||||
</el-table-column>
|
||||
<el-table-column label="任务id" align="center" prop="id" />
|
||||
|
||||
<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-s-flag"
|
||||
@click="viewDefect(scope.row)"
|
||||
>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<div class="pagination-part">
|
||||
<el-pagination
|
||||
background
|
||||
:current-page.sync="pagination.page"
|
||||
@current-change="handleCurrentChange"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size.sync="pagination.size"
|
||||
@size-change="handleSizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableTotal"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
<!-- 查看弹窗 -->
|
||||
<el-dialog
|
||||
title="路径查看"
|
||||
:visible.sync="viewVisible"
|
||||
width="90rem"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@close="viewCancel"
|
||||
>
|
||||
<task-view @cancel="viewCancel" :dialogItem="dialogItem"></task-view>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TaskView from "./components/task-view.vue";
|
||||
import { getTaskTable, getSegment, getRoadType } from "@/api/xj/task";
|
||||
|
||||
export default {
|
||||
components: { TaskView },
|
||||
data() {
|
||||
return {
|
||||
// 查询表单
|
||||
queryParams: {
|
||||
// 任务id
|
||||
id: "",
|
||||
// 车牌号码
|
||||
carName: "",
|
||||
// 巡检路段
|
||||
segmentName: "",
|
||||
},
|
||||
// 巡检时间
|
||||
dateTime: [],
|
||||
// 传查询接口表单
|
||||
searchForm: {},
|
||||
// 巡检路段下拉
|
||||
segmentList: [],
|
||||
// 车牌号码下拉
|
||||
carNameList: [],
|
||||
// 路产类型下拉
|
||||
roadType: [],
|
||||
// 列表数据绑定
|
||||
roadList: [],
|
||||
// 列表加载状态
|
||||
loading: false,
|
||||
// 列表已选数组
|
||||
checkIds: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 分页-列表总数
|
||||
tableTotal: 0,
|
||||
// 分页-页数页码
|
||||
pagination: {
|
||||
page: 1,
|
||||
size: 10,
|
||||
},
|
||||
// 传弹窗的数据
|
||||
dialogItem: {},
|
||||
// 查看弹窗显隐控制
|
||||
viewVisible: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getTaskList();
|
||||
this.getSegmentList();
|
||||
this.getRoadTypeList();
|
||||
},
|
||||
methods: {
|
||||
/* 任务id远程搜索 结果 */
|
||||
querySearchAsync(item, cb) {},
|
||||
/* 任务id选择事件 */
|
||||
handleSelect() {},
|
||||
/* 获取巡检路段下拉数据 */
|
||||
getSegmentList() {
|
||||
getSegment().then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
this.segmentList = data;
|
||||
}
|
||||
});
|
||||
},
|
||||
/* 获取路产类型下拉数据 */
|
||||
getRoadTypeList() {
|
||||
getRoadType().then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
this.roadType = data;
|
||||
}
|
||||
});
|
||||
},
|
||||
/* 点击搜索事件 */
|
||||
handleQuery() {
|
||||
const phonereg = /^K\d{4}\+\d{3}$/;
|
||||
if (this.queryParams.stakeStart) {
|
||||
if (phonereg.test(this.queryParams.stakeStart)) {
|
||||
this.pagination.page = 1;
|
||||
this.searchForm = JSON.parse(JSON.stringify(this.queryParams));
|
||||
this.getTaskList();
|
||||
} else {
|
||||
this.$modal.msgWarning("请按照格式填写公里桩进行修改");
|
||||
}
|
||||
} else if (this.queryParams.stakeEnd) {
|
||||
if (phonereg.test(this.queryParams.stakeEnd)) {
|
||||
this.pagination.page = 1;
|
||||
|
||||
this.searchForm = JSON.parse(JSON.stringify(this.queryParams));
|
||||
this.getTaskList();
|
||||
} else {
|
||||
this.$modal.msgWarning("请按照格式填写公里桩进行修改");
|
||||
}
|
||||
} else {
|
||||
this.pagination.page = 1;
|
||||
|
||||
this.searchForm = JSON.parse(JSON.stringify(this.queryParams));
|
||||
this.getTaskList();
|
||||
}
|
||||
},
|
||||
/* 点击重置事件 */
|
||||
resetQuery() {
|
||||
this.searchForm = {};
|
||||
this.queryParams = {
|
||||
segmentName: "",
|
||||
defectType: "",
|
||||
dataStatus: "",
|
||||
inspectDirection: "",
|
||||
defectType3: "",
|
||||
stakeStart: "",
|
||||
stakeEnd: "",
|
||||
state: "",
|
||||
id: "",
|
||||
};
|
||||
this.dateTime = [];
|
||||
this.getTaskList();
|
||||
},
|
||||
/* 获取列表数据 */
|
||||
getTaskList() {
|
||||
const params = {
|
||||
...this.pagination,
|
||||
...this.searchForm,
|
||||
startTime: this.dateTime ? this.dateTime[0] : "",
|
||||
endTime: this.dateTime ? this.dateTime[1] : "",
|
||||
};
|
||||
getTaskTable(params).then(({ code, rows, total }) => {
|
||||
if (code === 200) {
|
||||
this.roadList = rows;
|
||||
this.tableTotal = total;
|
||||
}
|
||||
});
|
||||
},
|
||||
/* 列表选择改变事件 */
|
||||
handleSelectionChange(selection) {
|
||||
this.checkIds = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/* 点击路径事件 */
|
||||
viewDefect(item) {
|
||||
this.viewVisible = true;
|
||||
this.dialogItem = item;
|
||||
},
|
||||
/* 切换分页 */
|
||||
handleCurrentChange(arg) {
|
||||
this.pagination.page = arg;
|
||||
this.getTaskList();
|
||||
},
|
||||
/* 切换每条/页 */
|
||||
handleSizeChange(arg) {
|
||||
this.pagination.size = arg;
|
||||
this.getTaskList();
|
||||
},
|
||||
/* 关闭查看弹窗 */
|
||||
viewCancel() {
|
||||
this.viewVisible = false;
|
||||
this.dialogItem = {};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.mb8 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.small-padding {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.fixed-width {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
/* 分页样式 */
|
||||
.pagination-part {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding-top: 1rem;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
/* 新增弹窗/编辑弹窗 */
|
||||
.addForm {
|
||||
.el-select,
|
||||
.el-cascader {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
/* 新增地图框样式 */
|
||||
.no-hand-cursor {
|
||||
cursor: default !important;
|
||||
width: 100%;
|
||||
height: 20rem;
|
||||
}
|
||||
|
||||
/* 上传文件列表样式 */
|
||||
::v-deep .el-upload-list {
|
||||
img {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* 查看弹窗-图片框样式 */
|
||||
.view-carousel {
|
||||
height: 15rem;
|
||||
// .el-carousel__item{
|
||||
// height: 12rem;
|
||||
|
||||
img {
|
||||
max-height: 15rem;
|
||||
max-width: 25rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -388,6 +388,8 @@ export default {
|
||||
segmentList: [],
|
||||
// 事件类型下拉
|
||||
eventType: [],
|
||||
// 路产类型下拉
|
||||
roadType: [],
|
||||
// 事件状态下拉
|
||||
defectStatus: [],
|
||||
// 校验状态下拉
|
||||
@ -515,7 +517,6 @@ export default {
|
||||
startTime: this.dateTime ? this.dateTime[0] : "",
|
||||
endTime: this.dateTime ? this.dateTime[1] : "",
|
||||
};
|
||||
console.log(params, "params");
|
||||
getEventTable(params).then(({ code, rows, total }) => {
|
||||
if (code === 200) {
|
||||
this.roadList = rows;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
* @Author: SunTao 328867980@qq.com
|
||||
* @Date: 2024-10-09 13:11:56
|
||||
* @LastEditors: SunTao 328867980@qq.com
|
||||
* @LastEditTime: 2024-10-11 15:01:25
|
||||
* @LastEditTime: 2024-10-14 17:05:20
|
||||
* @FilePath: \znxjxt-ui\src\views\xj\parameter\index.vue
|
||||
* @Description: 系统工具-系统参数
|
||||
-->
|
||||
@ -141,6 +141,7 @@ export default {
|
||||
/* 地图打点 */
|
||||
drawPoint(value) {
|
||||
const features = [];
|
||||
|
||||
const point = new Point(value); // 修改坐标格式
|
||||
const feature = new Feature({
|
||||
geometry: point,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user