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