This commit is contained in:
yiqiuyang
2025-09-10 09:44:48 +08:00
3 changed files with 34 additions and 37 deletions

View File

@ -33,12 +33,16 @@
<el-input
v-model="form.startPoint"
@blur="pointsChange('startPoint')"
@clear="pointsChange('startPoint')"
clearable
></el-input>
</el-form-item>
<el-form-item label="终点">
<el-input
v-model="form.endPoint"
@blur="pointsChange('endPoint')"
@clear="pointsChange('endPoint')"
clearable
></el-input>
</el-form-item>
<el-form-item label="途径点">
@ -47,6 +51,8 @@
v-model="item.points"
placeholder=""
@blur="pointsChange('viaPoints', item)"
@clear="pointsChange('viaPoints', item)"
clearable
></el-input>
</div>
</el-form-item>
@ -56,17 +62,19 @@
v-model="item.points"
placeholder=""
@blur="pointsChange('avoidPoints', item)"
@clear="pointsChange('avoidPoints', item)"
clearable
></el-input>
</div>
</el-form-item>
<el-form-item label="避让区域">
<div v-for="(item, index) in form.avoidAreas" :key="index">
<el-input
type="textarea"
v-model="item.points"
:rows="4"
placeholder=""
@blur="pointsChange('avoidAreas', item)"
@clear="pointsChange('avoidAreas', item)"
clearable
></el-input>
</div>
</el-form-item>
@ -173,9 +181,9 @@ export default {
tableData: [],
multipleSelection: [],
inputform: {
width: '',
load: '',
minTurnRadius: '',
width: 0,
load: 0,
minTurnRadius: 0,
},
form: {
startPoint: '',
@ -201,7 +209,6 @@ export default {
}
},
async mounted() {
console.log('go')
this.viewer = null
await this.getMapOption()
this.$nextTick(async () => {
@ -235,6 +242,7 @@ export default {
{
...this.mapOptions,
scene: {
...this.mapOptions.scene,
// mode: Cesium.SceneMode.SCENE2D,
center: {
lat: 27.729862392917948,
@ -509,6 +517,7 @@ export default {
},
// 输入框失去焦点 反向编辑点
pointsChange(type, row) {
console.log('111', type)
if (type === 'startPoint') {
if (
(!this.form.startPoint ||
@ -953,10 +962,13 @@ export default {
const nextNode = pathNodes[j + 1]
const segment = this.roadNetworkGeoJSON.features.find(
(f) =>
(f.properties.FNODE_ == currentNode &&
((f.properties.FNODE_ == currentNode &&
f.properties.TNODE_ == nextNode) ||
(f.properties.FNODE_ == nextNode &&
f.properties.TNODE_ == currentNode)
f.properties.TNODE_ == currentNode) )&&
f.properties.载重吨 >= this.inputform.load &&
f.properties.宽度 >= this.inputform.width &&
f.properties.曲率半 <= this.inputform.minTurnRadius
)
if (segment) {
fullPath.push(...segment.geometry.coordinates[0])
@ -1014,6 +1026,7 @@ export default {
// 单独的路径绘制方法
drawPath(path) {
const positions = path
if (positions.fullPath.length == 0) return
const polyline = new window.mars3d.graphic.PolylinePrimitive({
positions: positions.fullPath,
style: {