Compare commits
3 Commits
ffe45a240d
...
yqy
| Author | SHA1 | Date | |
|---|---|---|---|
| faae591f4c | |||
| da4b440b0e | |||
| d8bf6fd1b5 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -21,3 +21,4 @@ pnpm-debug.log*
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
*.zip
|
||||||
@ -6,11 +6,11 @@ import residentAnalysis from '@/views/residentAnalysis/index.vue'
|
|||||||
Vue.use(VueRouter)
|
Vue.use(VueRouter)
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
// {
|
{
|
||||||
// path: '/',
|
path: '/home',
|
||||||
// name: 'home',
|
name: 'home',
|
||||||
// component: HomeView,
|
component: HomeView,
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'residentAnalysis',
|
name: 'residentAnalysis',
|
||||||
|
|||||||
@ -46,13 +46,7 @@
|
|||||||
<div class="main-container">
|
<div class="main-container">
|
||||||
<div class="control-panel">
|
<div class="control-panel">
|
||||||
<div class="title">参数</div>
|
<div class="title">参数</div>
|
||||||
<el-form
|
<el-form @submit.native.prevent="calculateShortestPath" label-position="left" size="mini" :model="form">
|
||||||
@submit.native.prevent="calculateShortestPath"
|
|
||||||
label-width="140px"
|
|
||||||
label-position="left"
|
|
||||||
size="mini"
|
|
||||||
:model="form"
|
|
||||||
>
|
|
||||||
<el-form-item label="起点:">
|
<el-form-item label="起点:">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.startPoint"
|
v-model="form.startPoint"
|
||||||
@ -108,7 +102,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="control-panel">
|
<div class="control-panel">
|
||||||
<div class="title">隐蔽添加</div>
|
<div class="title">隐蔽添加</div>
|
||||||
<el-form label-width="140px" label-position="left" size="mini">
|
<el-form label-position="left" size="mini">
|
||||||
<el-form-item label="缓冲半径(m):">
|
<el-form-item label="缓冲半径(m):">
|
||||||
<el-input v-model="hideform.radius"></el-input>
|
<el-input v-model="hideform.radius"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -125,7 +119,7 @@
|
|||||||
<span>参与路线规划</span>
|
<span>参与路线规划</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-form @submit.native.prevent="calculateShortestPath" label-width="140px" label-position="left" size="mini">
|
<el-form @submit.native.prevent="calculateShortestPath" label-position="left" size="mini">
|
||||||
<el-form-item label="宽度(m):">
|
<el-form-item label="宽度(m):">
|
||||||
<el-input v-model="inputform.width"></el-input>
|
<el-input v-model="inputform.width"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
@ -5,19 +5,19 @@
|
|||||||
<el-tooltip effect="dark" content="绘制矩形区域">
|
<el-tooltip effect="dark" content="绘制矩形区域">
|
||||||
<img :src="item.src" @click="drawRectangle" />
|
<img :src="item.src" @click="drawRectangle" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-button class="form-btn" type="primary" size="mini" @click="analyzeAverageSlope">确定</el-button>
|
<div class="sure" @click="analyzeAverageSlope">确定</div>
|
||||||
<div class="right">
|
<div class="right flex a-c">
|
||||||
<el-button class="form-btn" type="primary" size="mini" :disabled="showExport" @click="clickExport">
|
<div class="sure" :style="!showExport ? {cursor: 'pointer'} : {cursor: 'not-allowed'}" @click="clickExport">
|
||||||
导出
|
导出
|
||||||
</el-button>
|
</div>
|
||||||
<el-button class="form-btn" type="primary" size="mini" @click="handleExportJosn"> json编辑 </el-button>
|
<div class="sure" @click="handleExportJosn">json编辑</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content flex j-s a-c">
|
<div class="content flex j-s a-c">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<el-form label-width="140px" label-position="left" size="small">
|
<el-form label-position="left" size="mini">
|
||||||
<!-- 范围 -->
|
<!-- 范围 -->
|
||||||
<div class="control-panel">
|
<div class="control-panel">
|
||||||
<div class="title">范围</div>
|
<div class="title">范围</div>
|
||||||
@ -68,7 +68,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 地图 -->
|
<!-- 地图 -->
|
||||||
<div class="center" id="cesiumContainer" v-loading="mapLoading" :element-loading-text="mapLoadText"></div>
|
<div
|
||||||
|
class="center"
|
||||||
|
id="cesiumContainer"
|
||||||
|
v-loading="mapLoading"
|
||||||
|
:element-loading-text="mapLoadText"
|
||||||
|
element-loading-spinner="el-icon-loading"
|
||||||
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
||||||
|
></div>
|
||||||
|
|
||||||
<div class="right flex column" v-loading="showLoading" element-loading-text="数据加载中">
|
<div class="right flex column" v-loading="showLoading" element-loading-text="数据加载中">
|
||||||
<!-- 路点 -->
|
<!-- 路点 -->
|
||||||
@ -149,8 +156,8 @@
|
|||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column title="操作" width="100">
|
<vxe-column title="操作" width="100">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
<el-button v-if="!row.editing" type="text" size="mini" @click="handleEdit(row)">编辑</el-button>
|
<el-button type="text" size="mini" v-if="!row.editing" @click="handleEdit(row)">编辑</el-button>
|
||||||
<el-button v-else type="text" size="mini" @click="handleSave(row)">保存</el-button>
|
<el-button type="text" size="mini" v-else @click="handleSave(row)">保存</el-button>
|
||||||
<el-button type="text" size="mini" @click="handleDelete('roadPointList', row)">删除</el-button>
|
<el-button type="text" size="mini" @click="handleDelete('roadPointList', row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
@ -192,8 +199,8 @@
|
|||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column title="操作" width="100">
|
<vxe-column title="操作" width="100">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
<el-button v-if="!row.editing" type="text" size="mini" @click="handleEdit(row)">编辑</el-button>
|
<el-button type="text" size="mini" v-if="!row.editing" @click="handleEdit(row)">编辑</el-button>
|
||||||
<el-button v-else type="text" size="mini" @click="handleSave(row)">保存</el-button>
|
<el-button type="text" size="mini" v-else @click="handleSave(row)">保存</el-button>
|
||||||
<el-button type="text" size="mini" @click="handleDelete('roadLineList', row)">删除</el-button>
|
<el-button type="text" size="mini" @click="handleDelete('roadLineList', row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
@ -237,8 +244,8 @@
|
|||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column title="操作" width="100">
|
<vxe-column title="操作" width="100">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
<el-button v-if="!row.editing" type="text" size="mini" @click="handleEdit(row)">编辑</el-button>
|
<el-button type="text" size="mini" v-if="!row.editing" @click="handleEdit(row)">编辑</el-button>
|
||||||
<el-button v-else type="text" size="mini" @click="handleSave(row)">保存</el-button>
|
<el-button type="text" size="mini" v-else @click="handleSave(row)">保存</el-button>
|
||||||
<el-button type="text" size="mini" @click="handleDelete('waterPointList', row)">删除</el-button>
|
<el-button type="text" size="mini" @click="handleDelete('waterPointList', row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
@ -280,8 +287,8 @@
|
|||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column title="操作" width="100">
|
<vxe-column title="操作" width="100">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
<el-button v-if="!row.editing" type="text" size="mini" @click="handleEdit(row)">编辑</el-button>
|
<el-button type="text" size="mini" v-if="!row.editing" @click="handleEdit(row)">编辑</el-button>
|
||||||
<el-button v-else type="text" size="mini" @click="handleSave(row)">保存</el-button>
|
<el-button type="text" size="mini" v-else @click="handleSave(row)">保存</el-button>
|
||||||
<el-button type="text" size="mini" @click="handleDelete('waterLineList', row)">删除</el-button>
|
<el-button type="text" size="mini" @click="handleDelete('waterLineList', row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
@ -293,7 +300,7 @@
|
|||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" @click="dialogVisible = false">取消</el-button>
|
<el-button size="mini" @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" size="mini" @click="exportJSON">导出</el-button>
|
<el-button type="primary" size="mini" @click="exportJSON">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
@ -318,7 +325,6 @@
|
|||||||
import {getStorage} from '@/utils/localStorage'
|
import {getStorage} from '@/utils/localStorage'
|
||||||
import plantJson from '/public/config/plant.json'
|
import plantJson from '/public/config/plant.json'
|
||||||
import soilJson from '/public/config/soil.json'
|
import soilJson from '/public/config/soil.json'
|
||||||
import FileSaver from 'file-saver'
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import iniParser from 'ini-parser'
|
import iniParser from 'ini-parser'
|
||||||
|
|
||||||
@ -685,19 +691,13 @@ export default {
|
|||||||
|
|
||||||
// 判断矩形与 mars3d GeoJSON 图层是否相交(不转 GeoJSON)
|
// 判断矩形与 mars3d GeoJSON 图层是否相交(不转 GeoJSON)
|
||||||
getIntersectId(position, layer) {
|
getIntersectId(position, layer) {
|
||||||
console.log('position===>', position, layer)
|
|
||||||
if (!position || !layer || !layer.graphics) return null
|
if (!position || !layer || !layer.graphics) return null
|
||||||
|
|
||||||
const rectCoords = position.concat([position[0]]) // 闭合
|
const rectCoords = position.concat([position[0]]) // 闭合
|
||||||
|
|
||||||
console.log('rectCoords===>', rectCoords)
|
|
||||||
|
|
||||||
const rectPoly = turf.polygon([rectCoords])
|
const rectPoly = turf.polygon([rectCoords])
|
||||||
console.log('rectPoly===>', rectPoly)
|
|
||||||
const [minX, minY, maxX, maxY] = turf.bbox(rectPoly) // 矩形 bbox
|
const [minX, minY, maxX, maxY] = turf.bbox(rectPoly) // 矩形 bbox
|
||||||
|
|
||||||
console.log('minX, minY, maxX, maxY===>', minX, minY, maxX, maxY)
|
|
||||||
|
|
||||||
let fc = this._polyCache.get(layer)
|
let fc = this._polyCache.get(layer)
|
||||||
|
|
||||||
if (!fc) {
|
if (!fc) {
|
||||||
@ -1256,6 +1256,8 @@ export default {
|
|||||||
|
|
||||||
// 点击导出按钮
|
// 点击导出按钮
|
||||||
clickExport() {
|
clickExport() {
|
||||||
|
if (this.showExport) return
|
||||||
|
|
||||||
this.rectangles.forEach((rectGraphic) => {
|
this.rectangles.forEach((rectGraphic) => {
|
||||||
this.selectRectangle(rectGraphic)
|
this.selectRectangle(rectGraphic)
|
||||||
})
|
})
|
||||||
@ -1282,7 +1284,6 @@ export default {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.$message.success(res)
|
|
||||||
this.$message.success('导出成功!')
|
this.$message.success('导出成功!')
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@ -1327,7 +1328,7 @@ export default {
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.jsonInfo = {
|
this.jsonInfo = {
|
||||||
path: response.data.path,
|
path: response.data.path,
|
||||||
json: JSON.stringify(response.data.json, null, 2),
|
json: JSON.stringify(this.decodeEscapedJson(response.data.json), null, 2),
|
||||||
}
|
}
|
||||||
this.jsonLoading = false
|
this.jsonLoading = false
|
||||||
})
|
})
|
||||||
@ -1431,34 +1432,26 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
::v-deep .el-button--primary {
|
.sure {
|
||||||
background-color: #176363;
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
background: #176363;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
&:hover {
|
min-width: 14px;
|
||||||
background-color: #176363;
|
padding: 0 10px;
|
||||||
}
|
height: 24px;
|
||||||
&:active {
|
color: #ffffff;
|
||||||
background-color: #176363;
|
font-weight: 400;
|
||||||
}
|
font-size: 14px;
|
||||||
&:focus {
|
margin-right: 10px;
|
||||||
background-color: #176363;
|
cursor: pointer;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .el-form-item--mini.el-form-item,
|
|
||||||
.el-form-item--small.el-form-item {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .el-button--primary.is-disabled,
|
|
||||||
.el-button--primary.is-disabled:active,
|
|
||||||
.el-button--primary.is-disabled:focus,
|
|
||||||
.el-button--primary.is-disabled:hover {
|
|
||||||
background-color: #176363;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#page {
|
#page {
|
||||||
width: 100%;
|
width: 340px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@ -1473,15 +1466,12 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
cursor: pointer;
|
|
||||||
margin-left: 32px;
|
margin-left: 32px;
|
||||||
img {
|
img {
|
||||||
margin-right: 10px;
|
margin-right: 30px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.form-btn {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
.btn {
|
.btn {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
@ -1504,14 +1494,14 @@ export default {
|
|||||||
background-color: #d4e5db;
|
background-color: #d4e5db;
|
||||||
.control-panel {
|
.control-panel {
|
||||||
width: 340px;
|
width: 340px;
|
||||||
padding: 5px 20px;
|
padding: 20px 26px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background: #d4e5db;
|
background: #d4e5db;
|
||||||
.title {
|
.title {
|
||||||
font-size: 16px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
color: #1c1c1c;
|
color: #1c1c1c;
|
||||||
|
font-size: 16px;
|
||||||
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1523,7 +1513,8 @@ export default {
|
|||||||
height: 24px;
|
height: 24px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 3px 0;
|
margin-left: 20px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1548,9 +1539,9 @@ export default {
|
|||||||
}
|
}
|
||||||
.table-title {
|
.table-title {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
color: #1c1c1c;
|
||||||
letter-spacing: 0.1em;
|
letter-spacing: 0.1em;
|
||||||
margin-bottom: 10px;
|
margin: 20px 0 10px 0;
|
||||||
span {
|
span {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,25 +21,25 @@ module.exports = defineConfig({
|
|||||||
})
|
})
|
||||||
|
|
||||||
/* 2. 追加 ES5 规则(只转 src,不转 node_modules) */
|
/* 2. 追加 ES5 规则(只转 src,不转 node_modules) */
|
||||||
config.module.rules.push({
|
// config.module.rules.push({
|
||||||
test: /\.js$/,
|
// test: /\.js$/,
|
||||||
include: path.resolve(__dirname, 'src'),
|
// include: path.resolve(__dirname, 'src'),
|
||||||
use: {
|
// use: {
|
||||||
loader: 'babel-loader',
|
// loader: 'babel-loader',
|
||||||
options: {
|
// options: {
|
||||||
presets: [
|
// presets: [
|
||||||
[
|
// [
|
||||||
'@babel/preset-env',
|
// '@babel/preset-env',
|
||||||
{
|
// {
|
||||||
targets: {ie: '11'}, // 强制 ES5
|
// targets: {ie: '11'}, // 强制 ES5
|
||||||
corejs: 3,
|
// corejs: 3,
|
||||||
useBuiltIns: 'entry',
|
// useBuiltIns: 'entry',
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
})
|
// })
|
||||||
},
|
},
|
||||||
|
|
||||||
css: {
|
css: {
|
||||||
|
|||||||
Reference in New Issue
Block a user