fix:病害管理修改
This commit is contained in:
parent
50d6b6f857
commit
7536b188ae
62
src/api/xj/disease.js
Normal file
62
src/api/xj/disease.js
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* @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 09:26:24
|
||||||
|
* @LastEditors: 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
|
||||||
|
* @LastEditTime: 2024-10-08 18:06:36
|
||||||
|
* @FilePath: \znxjxt-ui\src\api\xj\disease.js
|
||||||
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询病害日志列表
|
||||||
|
export function listDefect(query) {
|
||||||
|
return request({
|
||||||
|
url: '/xj/defect/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询病害日志详细
|
||||||
|
export function getDefect(id) {
|
||||||
|
return request({
|
||||||
|
url: '/xj/defect/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增病害日志
|
||||||
|
export function addDefect(data) {
|
||||||
|
return request({
|
||||||
|
url: '/xj/defect',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改病害日志
|
||||||
|
export function updateDefect(data) {
|
||||||
|
return request({
|
||||||
|
url: '/xj/defect',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除病害日志
|
||||||
|
export function delDefect(id) {
|
||||||
|
return request({
|
||||||
|
url: '/xj/defect/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 病害类型下拉数据
|
||||||
|
export function getDefectTypes() {
|
||||||
|
return request({
|
||||||
|
url: '/metadata/defectTypes',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
closeDialog() {
|
closeDialog() {
|
||||||
console.log(this.formData)
|
// console.log(this.formData)
|
||||||
this.$refs.xForm.validate().then(() => {
|
this.$refs.xForm.validate().then(() => {
|
||||||
this.updateElement()
|
this.updateElement()
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
|
|||||||
@ -170,7 +170,7 @@ export const constantRoutes = [
|
|||||||
meta: { title: '表单配置', icon: '' }
|
meta: { title: '表单配置', icon: '' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
// 动态路由,基于用户权限动态去加载
|
// 动态路由,基于用户权限动态去加载
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export default {
|
|||||||
}
|
}
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
let a = document.getElementsByName('[data-layerid="128"]');
|
let a = document.getElementsByName('[data-layerid="128"]');
|
||||||
console.log(a)
|
// console.log(a)
|
||||||
}, 2000)
|
}, 2000)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -198,7 +198,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$set(variables, "approval", this.checkValues);
|
this.$set(variables, "approval", this.checkValues);
|
||||||
}
|
}
|
||||||
console.log(variables,"流程发起提交表单数据")
|
// console.log(variables,"流程发起提交表单数据")
|
||||||
// 启动流程并将表单数据加入流程变量
|
// 启动流程并将表单数据加入流程变量
|
||||||
definitionStart(this.procDefId, JSON.stringify(variables)).then(res => {
|
definitionStart(this.procDefId, JSON.stringify(variables)).then(res => {
|
||||||
this.$modal.msgSuccess(res.msg);
|
this.$modal.msgSuccess(res.msg);
|
||||||
|
|||||||
@ -215,7 +215,7 @@ export default {
|
|||||||
listMetadata().then(response => {
|
listMetadata().then(response => {
|
||||||
|
|
||||||
this.typeList = this.transformToDeepCategorizedListLabelValue(JSON.parse(response.data))
|
this.typeList = this.transformToDeepCategorizedListLabelValue(JSON.parse(response.data))
|
||||||
console.log(this.typeList)
|
// console.log(this.typeList)
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@ -487,8 +487,8 @@ export default {
|
|||||||
},
|
},
|
||||||
getTypeInfo() {
|
getTypeInfo() {
|
||||||
listMetadata().then(response => {
|
listMetadata().then(response => {
|
||||||
console.log(response)
|
// console.log(response)
|
||||||
console.log(this.transformToDeepCategorizedLabelValue(JSON.parse(response.data)));
|
// console.log(this.transformToDeepCategorizedLabelValue(JSON.parse(response.data)));
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
1012
src/views/xj/inspection/disease-management/index.vue
Normal file
1012
src/views/xj/inspection/disease-management/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,22 @@
|
|||||||
|
<!--
|
||||||
|
* @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 09:26:24
|
||||||
|
* @LastEditors: Please set LastEditors
|
||||||
|
* @LastEditTime: 2024-10-08 10:46:17
|
||||||
|
* @FilePath: \znxjxt-ui\src\views\xj\route\index.vue
|
||||||
|
* @Description: 路线管理-道路线
|
||||||
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="路线编码" prop="routeCode">
|
<el-form-item label="路线编码" prop="routeCode">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.routeCode"
|
v-model="queryParams.routeCode"
|
||||||
@ -26,8 +42,16 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -78,10 +102,17 @@
|
|||||||
>导出
|
>导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="routeList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="routeList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="路线编码" align="center" prop="routeCode" />
|
<el-table-column label="路线编码" align="center" prop="routeCode" />
|
||||||
<el-table-column label="路线名称" align="center" prop="routeName" />
|
<el-table-column label="路线名称" align="center" prop="routeName" />
|
||||||
@ -92,19 +123,33 @@
|
|||||||
<el-table-column label="起点桩号" align="center" prop="startMilepost" />
|
<el-table-column label="起点桩号" align="center" prop="startMilepost" />
|
||||||
<el-table-column label="止点桩号" align="center" prop="endMilepost" />
|
<el-table-column label="止点桩号" align="center" prop="endMilepost" />
|
||||||
<el-table-column label="创建人" align="center" prop="createdBy" />
|
<el-table-column label="创建人" align="center" prop="createdBy" />
|
||||||
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createdAt"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createdAt, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="修改人" align="center" prop="updatedBy" />
|
<el-table-column label="修改人" align="center" prop="updatedBy" />
|
||||||
<el-table-column label="修改时间" align="center" prop="updatedAt" width="180">
|
<el-table-column
|
||||||
|
label="修改时间"
|
||||||
|
align="center"
|
||||||
|
prop="updatedAt"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.updatedAt, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -135,12 +180,16 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改道路线对话框 -->
|
<!-- 添加或修改道路线对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="80%" append-to-body>
|
<el-dialog
|
||||||
<div style="display: flex;">
|
:title="title"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="80%"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<div style="display: flex">
|
||||||
<!-- 左侧表单部分 -->
|
<!-- 左侧表单部分 -->
|
||||||
<div style="flex: 1; padding-right: 40px;">
|
<div style="flex: 1; padding-right: 40px">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="70px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="70px">
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -159,14 +208,21 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="路线类型">
|
<el-form-item label="路线类型">
|
||||||
<el-input v-model="form.routeType"></el-input>
|
<el-select
|
||||||
|
v-model="form.routeType"
|
||||||
|
placeholder="请选择路线类型"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.bas_road_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12"> </el-col>
|
||||||
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-row :gutter="5">
|
<el-row :gutter="5">
|
||||||
@ -177,7 +233,18 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="方向">
|
<el-form-item label="方向">
|
||||||
<el-input v-model="form.direction"></el-input>
|
<el-select
|
||||||
|
v-model="queryParams.direction"
|
||||||
|
placeholder="请选择方向"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.bas_direction"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -214,10 +281,14 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="坐标点">
|
<el-form-item label="坐标点">
|
||||||
<el-input type="textarea" :disabled="true" v-model="form.coordinates" rows="4"></el-input>
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:disabled="true"
|
||||||
|
v-model="form.coordinates"
|
||||||
|
rows="4"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@ -227,15 +298,13 @@
|
|||||||
<el-input v-model="form.remarks"></el-input>
|
<el-input v-model="form.remarks"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 右侧地图部分 -->
|
<!-- 右侧地图部分 -->
|
||||||
<div style="flex: 1; position: relative;">
|
<div style="flex: 1; position: relative">
|
||||||
<div id="add_map" ref="mapContainer" class="no-hand-cursor"></div>
|
<div id="add_map" ref="mapContainer" class="no-hand-cursor"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -248,26 +317,33 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listRoute, getRoute, delRoute, addRoute, updateRoute} from "@/api/xj/route";
|
import {
|
||||||
|
listRoute,
|
||||||
|
getRoute,
|
||||||
|
delRoute,
|
||||||
|
addRoute,
|
||||||
|
updateRoute,
|
||||||
|
} from "@/api/xj/route";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Route",
|
name: "Route",
|
||||||
|
dicts: ["bas_road_type", "bas_direction"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
menuOpen: false,
|
menuOpen: false,
|
||||||
markers: [],
|
markers: [],
|
||||||
dialogVisible: false, // 控制dialog显示
|
dialogVisible: false, // 控制dialog显示
|
||||||
routeForm: {
|
routeForm: {
|
||||||
routeCode: '',
|
routeCode: "",
|
||||||
routeName: '',
|
routeName: "",
|
||||||
routeFullName: '',
|
routeFullName: "",
|
||||||
direction: '',
|
direction: "",
|
||||||
startPoint: '',
|
startPoint: "",
|
||||||
endPoint: '',
|
endPoint: "",
|
||||||
startStake: '',
|
startStake: "",
|
||||||
endStake: '',
|
endStake: "",
|
||||||
coordinates: '',
|
coordinates: "",
|
||||||
remark: ''
|
remark: "",
|
||||||
},
|
},
|
||||||
lines: [], // 保存所有添加的连线
|
lines: [], // 保存所有添加的连线
|
||||||
map: null,
|
map: null,
|
||||||
@ -302,21 +378,24 @@ export default {
|
|||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
coordinates: '',
|
coordinates: "",
|
||||||
|
|
||||||
},
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
routeCode: [
|
routeCode: [
|
||||||
{required: true, message: "路线编码,唯一不能为空", trigger: "blur"}
|
{
|
||||||
|
required: true,
|
||||||
|
message: "路线编码,唯一不能为空",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
routeName: [
|
routeName: [
|
||||||
{required: true, message: "路线名称不能为空", trigger: "blur"}
|
{ required: true, message: "路线名称不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
routeType: [
|
routeType: [
|
||||||
{required: true, message: "路线类型不能为空", trigger: "change"}
|
{ required: true, message: "路线类型不能为空", trigger: "change" },
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -338,17 +417,20 @@ export default {
|
|||||||
}
|
}
|
||||||
this.markers.pop();
|
this.markers.pop();
|
||||||
// 更新上一个点为撤销后的点
|
// 更新上一个点为撤销后的点
|
||||||
this.previousPoint = this.markers.length > 0 ? this.markers[this.markers.length - 1].getLngLat() : null;
|
this.previousPoint =
|
||||||
|
this.markers.length > 0
|
||||||
|
? this.markers[this.markers.length - 1].getLngLat()
|
||||||
|
: null;
|
||||||
|
|
||||||
// 更新坐标点 textarea
|
// 更新坐标点 textarea
|
||||||
const coordArr = this.form.coordinates.split(';');
|
const coordArr = this.form.coordinates.split(";");
|
||||||
coordArr.pop(); // 移除最后一个坐标
|
coordArr.pop(); // 移除最后一个坐标
|
||||||
this.form.coordinates = coordArr.join(';');
|
this.form.coordinates = coordArr.join(";");
|
||||||
},
|
},
|
||||||
|
|
||||||
resetMap() {
|
resetMap() {
|
||||||
// 清空坐标点、地图上的所有覆盖物
|
// 清空坐标点、地图上的所有覆盖物
|
||||||
this.form.coordinates = '';
|
this.form.coordinates = "";
|
||||||
this.previousPoint = null;
|
this.previousPoint = null;
|
||||||
this.map.clearOverLays();
|
this.map.clearOverLays();
|
||||||
this.markers = [];
|
this.markers = [];
|
||||||
@ -358,7 +440,7 @@ export default {
|
|||||||
if (!this.map) {
|
if (!this.map) {
|
||||||
// 初始化天地图
|
// 初始化天地图
|
||||||
|
|
||||||
this.map = new T.Map('add_map');
|
this.map = new T.Map("add_map");
|
||||||
this.map.centerAndZoom(new T.LngLat(116.40769, 39.89945), 12); // 设置中心点和缩放级别
|
this.map.centerAndZoom(new T.LngLat(116.40769, 39.89945), 12); // 设置中心点和缩放级别
|
||||||
|
|
||||||
// 添加双击事件
|
// 添加双击事件
|
||||||
@ -367,10 +449,8 @@ export default {
|
|||||||
// 添加右键菜单
|
// 添加右键菜单
|
||||||
this.map.on("contextmenu", this.onMapRightClick);
|
this.map.on("contextmenu", this.onMapRightClick);
|
||||||
} else {
|
} else {
|
||||||
this.resetMap()
|
this.resetMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onMapClick(e) {
|
onMapClick(e) {
|
||||||
if (this.menuOpen) {
|
if (this.menuOpen) {
|
||||||
@ -382,7 +462,7 @@ export default {
|
|||||||
|
|
||||||
// 追加经纬度到textarea
|
// 追加经纬度到textarea
|
||||||
if (this.form.coordinates == null) {
|
if (this.form.coordinates == null) {
|
||||||
this.form.coordinates = '';
|
this.form.coordinates = "";
|
||||||
}
|
}
|
||||||
this.form.coordinates += this.form.coordinates ? `;${point}` : point;
|
this.form.coordinates += this.form.coordinates ? `;${point}` : point;
|
||||||
|
|
||||||
@ -390,31 +470,32 @@ export default {
|
|||||||
|
|
||||||
const marker = new T.Marker(latLng);
|
const marker = new T.Marker(latLng);
|
||||||
|
|
||||||
|
|
||||||
this.markers.push(marker); // 保存点
|
this.markers.push(marker); // 保存点
|
||||||
// 连线
|
// 连线
|
||||||
if (this.previousPoint) {
|
if (this.previousPoint) {
|
||||||
const line = new T.Polyline([this.previousPoint, latLng], {
|
const line = new T.Polyline([this.previousPoint, latLng], {
|
||||||
strokeColor: "blue",
|
strokeColor: "blue",
|
||||||
strokeWeight: 3,
|
strokeWeight: 3,
|
||||||
strokeOpacity: 0.7
|
strokeOpacity: 0.7,
|
||||||
});
|
});
|
||||||
this.map.addOverLay(line);
|
this.map.addOverLay(line);
|
||||||
this.lines.push(line)
|
this.lines.push(line);
|
||||||
}
|
}
|
||||||
if (this.lines.length == 0) {
|
if (this.lines.length == 0) {
|
||||||
this.map.addOverLay(marker)
|
this.map.addOverLay(marker);
|
||||||
}
|
}
|
||||||
this.previousPoint = latLng; // 记录上一个点
|
this.previousPoint = latLng; // 记录上一个点
|
||||||
},
|
},
|
||||||
drawExistingCoordinates() {
|
drawExistingCoordinates() {
|
||||||
// 如果有保存的坐标点数据
|
// 如果有保存的坐标点数据
|
||||||
|
// console.log(this.form.coordinates, "this.form.coordinates");
|
||||||
|
|
||||||
if (this.form.coordinates) {
|
if (this.form.coordinates) {
|
||||||
const coordArr = this.form.coordinates.split(';');
|
const coordArr = this.form.coordinates.split(";");
|
||||||
let previousLatLng = null;
|
let previousLatLng = null;
|
||||||
|
|
||||||
coordArr.forEach((coord, index) => {
|
coordArr.forEach((coord, index) => {
|
||||||
const [lng, lat] = coord.split(',').map(Number);
|
const [lng, lat] = coord.split(",").map(Number);
|
||||||
const latLng = new T.LngLat(lng, lat);
|
const latLng = new T.LngLat(lng, lat);
|
||||||
|
|
||||||
// 绘制点
|
// 绘制点
|
||||||
@ -426,7 +507,7 @@ export default {
|
|||||||
const line = new T.Polyline([previousLatLng, latLng], {
|
const line = new T.Polyline([previousLatLng, latLng], {
|
||||||
strokeColor: "blue",
|
strokeColor: "blue",
|
||||||
strokeWeight: 3,
|
strokeWeight: 3,
|
||||||
strokeOpacity: 0.7
|
strokeOpacity: 0.7,
|
||||||
});
|
});
|
||||||
this.map.addOverLay(line);
|
this.map.addOverLay(line);
|
||||||
this.lines.push(line);
|
this.lines.push(line);
|
||||||
@ -443,7 +524,7 @@ export default {
|
|||||||
onMapRightClick(e) {
|
onMapRightClick(e) {
|
||||||
this.menuOpen = true;
|
this.menuOpen = true;
|
||||||
var menu = new T.ContextMenu({
|
var menu = new T.ContextMenu({
|
||||||
width: 50
|
width: 50,
|
||||||
});
|
});
|
||||||
var _MenuItem1 = new T.MenuItem("撤销", this.undoLastAction);
|
var _MenuItem1 = new T.MenuItem("撤销", this.undoLastAction);
|
||||||
|
|
||||||
@ -458,7 +539,7 @@ export default {
|
|||||||
/** 查询道路线列表 */
|
/** 查询道路线列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listRoute(this.queryParams).then(response => {
|
listRoute(this.queryParams).then((response) => {
|
||||||
this.routeList = response.rows;
|
this.routeList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -492,7 +573,7 @@ export default {
|
|||||||
deletedBy: null,
|
deletedBy: null,
|
||||||
deletedAt: null,
|
deletedAt: null,
|
||||||
isDeleted: null,
|
isDeleted: null,
|
||||||
companyId: null
|
companyId: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@ -508,9 +589,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map((item) => item.id);
|
||||||
this.single = selection.length !== 1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@ -521,14 +602,13 @@ export default {
|
|||||||
let that = this;
|
let that = this;
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
that.initMap();
|
that.initMap();
|
||||||
}, 100)
|
}, 100);
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids;
|
||||||
getRoute(id).then(response => {
|
getRoute(id).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
this.title = "修改道路线";
|
this.title = "修改道路线";
|
||||||
@ -536,23 +616,22 @@ export default {
|
|||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
that.initMap();
|
that.initMap();
|
||||||
that.drawExistingCoordinates()
|
that.drawExistingCoordinates();
|
||||||
},200)
|
}, 200);
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateRoute(this.form).then(response => {
|
updateRoute(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addRoute(this.form).then(response => {
|
addRoute(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
@ -564,26 +643,31 @@ export default {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除道路线编号为"' + ids + '"的数据项?').then(function () {
|
this.$modal
|
||||||
|
.confirm('是否确认删除道路线编号为"' + ids + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
return delRoute(ids);
|
return delRoute(ids);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {
|
})
|
||||||
});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('xj/route/export', {
|
this.download(
|
||||||
...this.queryParams
|
"xj/route/export",
|
||||||
}, `route_${new Date().getTime()}.xlsx`)
|
{
|
||||||
}
|
...this.queryParams,
|
||||||
}
|
},
|
||||||
|
`route_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
|
|
||||||
.no-hand-cursor {
|
.no-hand-cursor {
|
||||||
cursor: default !important;
|
cursor: default !important;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@ -35,6 +35,7 @@ module.exports = {
|
|||||||
proxy: {
|
proxy: {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
|
// target: `http://192.168.1.188:8080`
|
||||||
target: `http://localhost:8080`,
|
target: `http://localhost:8080`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user