Conflicts: src/views/app/index.vue src/views/app/map.vue src/views/app/project/operate_edit.vue src/views/app/user/user.vuemaster
@@ -0,0 +1,9 @@ | |||
import request from '@/utils/request' | |||
export function homepageStatistics(query) { | |||
return request({ | |||
url: '/big/resource/homepageStatistics', | |||
method: 'get', | |||
params: query | |||
}) | |||
} |
@@ -60,3 +60,29 @@ export function printImport(query) { | |||
params: query | |||
}) | |||
} | |||
// 开始导入任务 | |||
export function startImport(id) { | |||
return request({ | |||
url: '/business/import/start/' + id, | |||
method: 'post', | |||
}) | |||
} | |||
// 导入任务日志 | |||
export function importLog(id, offset) { | |||
return request({ | |||
url: '/business/import/log/' + id, | |||
method: 'get', | |||
params: {offset} | |||
}) | |||
} | |||
// 下载导入任务日志 | |||
export function downloadLog(id) { | |||
return request({ | |||
url: '/business/import/downloadLog/' + id, | |||
method: 'get', | |||
responseType: 'blob', | |||
}) | |||
} |
@@ -75,4 +75,4 @@ export function printLand(query) { | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
} |
@@ -388,3 +388,31 @@ export function isNumberStr(str) { | |||
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) | |||
} | |||
export function save(name, src) { | |||
let a = 0; | |||
let url = null; | |||
try | |||
{ | |||
url = window.URL.createObjectURL(new Blob([src])) | |||
a = document.createElement('a'); | |||
document.body.append(a); | |||
a.style.display = 'none' | |||
a.href = url; | |||
a.setAttribute('download', name) | |||
a.click(); | |||
return true; | |||
} | |||
catch(e) | |||
{ | |||
console.error(e); | |||
return false; | |||
} | |||
finally | |||
{ | |||
if(a) | |||
a.remove(); | |||
if(url) | |||
window.URL.revokeObjectURL(url); | |||
} | |||
} | |||
@@ -14,7 +14,7 @@ | |||
<img src="../../assets/images/app/banner.png" width="100%" style="margin: 2vh 0;" alt=""> | |||
<van-notice-bar scrollable text="技术是开发它的人的共同灵魂。" color="#000000" > | |||
<van-notice-bar scrollable text="让资源调查更简单、快捷!" color="#000000" > | |||
<p slot="left-icon" class="notice_tt">通知</p> | |||
</van-notice-bar> | |||
@@ -55,7 +55,7 @@ | |||
</van-form> | |||
</div> | |||
<p class="copy">中农融信北京科技股份有限公司</p> | |||
<p class="copy">{{this.$store.getters.technicalSupport == "" ? "中农融信(北京)科技股份有限公司" : this.$store.getters.technicalSupport}}</p> | |||
</div> | |||
</template> | |||
@@ -183,13 +183,13 @@ | |||
import { deptTreeSelect } from "@/api/system/user" | |||
import {getConfigKey} from "@/api/system/config"; | |||
import {getDept,getInfoByImportCode} from "@/api/system/dept"; | |||
import MapField from "@/components/house/MapField"; | |||
import $ from "jquery"; | |||
export default { | |||
name: "contractedVillageContractor", | |||
components: { Treeselect, Splitpanes, Pane,MapField }, | |||
components: { Treeselect, Splitpanes, Pane }, | |||
data() { | |||
return { | |||
form: {}, | |||
@@ -1,39 +1,21 @@ | |||
<template> | |||
<div class="home_wrapper"> | |||
<van-nav-bar | |||
title="土地列表管理" | |||
left-arrow | |||
placeholder | |||
safe-area-inset-top | |||
@click-left="onClickLeft" | |||
/> | |||
<van-nav-bar title="土地列表管理" left-arrow placeholder safe-area-inset-top @click-left="onClickLeft"/> | |||
<div class="search_box"> | |||
<div class="left"> | |||
<p @click="showPicker = true">{{surveyStatus}}<van-icon name="play" /></p> | |||
<van-field v-model="value" @input="searchChange" @clear="searchClear" clearable left-icon="search" placeholder="请输入地块名称" /> | |||
<van-field v-model="value" @input="searchChange" @clear="searchClear" clearable left-icon="search" placeholder="地块编码" /> | |||
</div> | |||
<van-button type="primary" round @click="goSearch" >搜索</van-button> | |||
</div> | |||
<van-popup v-model="showPicker" round position="bottom"> | |||
<van-picker | |||
show-toolbar | |||
:columns="dict.type.survey_status" | |||
value-key="label" | |||
@cancel="showPicker = false" | |||
@confirm="onConfirm" | |||
/> | |||
<van-picker show-toolbar :columns="dict.type.survey_status" value-key="label" @cancel="showPicker = false" @confirm="onConfirm"/> | |||
</van-popup> | |||
<div class="list_main"> | |||
<van-list | |||
v-model="loading" | |||
:finished="finished" | |||
finished-text="没有更多了" | |||
@load="getList" | |||
> | |||
<!--1--> | |||
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getList"> | |||
<van-swipe-cell right-width="200" class="item" v-for="(item,index) in landList" :key="index"> | |||
<div class="item_box" @click="$router.push({name:'appDetail',query:{dkbm:item.dkbm}})"> | |||
<div class="head_block"> | |||
@@ -51,7 +33,6 @@ | |||
<div style="background-color: #ee0a24;height: 100%" @click="handleDelete(item)">删除</div> | |||
</template> | |||
</van-swipe-cell> | |||
</van-list> | |||
</div> | |||
@@ -59,7 +40,6 @@ | |||
</template> | |||
<script> | |||
// import { getMenuApp } from "@/api/app/index"; | |||
import { Dialog } from 'vant'; | |||
import { listLand, delLand } from "@/api/resource/land" | |||
export default { | |||
@@ -96,7 +76,7 @@ | |||
}; | |||
}, | |||
created() { | |||
console.log(this.dict.type.survey_status) | |||
this.queryParams.importCode = this.$store.getters.user.user.dept.importCode; | |||
}, | |||
methods: { | |||
onClickLeft(){ | |||
@@ -118,13 +98,12 @@ | |||
}) | |||
}, | |||
onConfirm(value) { | |||
console.log(value) | |||
this.surveyStatus = value.label; | |||
this.queryParams.surveyStatus = value.value; | |||
this.showPicker = false; | |||
}, | |||
searchChange(value) { | |||
this.queryParams.dkmc = value; | |||
this.queryParams.dkbm = value; | |||
}, | |||
goSearch(){ | |||
this.queryParams.pageNum = 1; | |||
@@ -140,7 +119,6 @@ | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const fids = row.fid || this.ids | |||
Dialog.confirm({ | |||
title: '提示', | |||
message: '是否确认删除地块属性编号为"' + fids + '"的数据项?', | |||
@@ -155,7 +133,6 @@ | |||
.catch(() => { | |||
// on cancel | |||
}); | |||
} | |||
}, | |||
}; | |||
@@ -125,7 +125,7 @@ | |||
border: 2px solid #FFFFFF; | |||
overflow: hidden; | |||
.title{ | |||
background: url("../../../assets/images/app/title_bg.png") no-repeat left 10px; | |||
background: url("../../assets/images/app/title_bg.png") no-repeat left 10px; | |||
font-size: 2.2vh; | |||
font-weight: bold; | |||
padding-bottom: 10px; | |||
@@ -105,7 +105,8 @@ | |||
<template slot-scope="scope"> | |||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleLook(scope.row)" v-hasPermi="['business:import:query']">查看</el-button> | |||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['business:import:edit']">修改</el-button> | |||
<el-button size="mini" type="text" icon="el-icon-video-play" @click="handleDo(scope.row)" v-hasPermi="['business:import:do']" v-if="scope.row.taskStatus == '1'">执行</el-button> | |||
<el-button size="mini" type="text" icon="el-icon-video-play" @click="handleDo(scope.row)" v-hasPermi="['business:import:do']" v-if="scope.row.taskStatus == '0'">执行</el-button> | |||
<el-button size="mini" type="text" icon="el-icon-tickets" @click="openLog(scope.row)" v-hasPermi="['business:import:do']">日志</el-button> | |||
<el-dropdown size="mini" v-hasPermi="['business:import:remove']"> | |||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button> | |||
@@ -134,7 +135,7 @@ | |||
<div class="el-upload__tip" slot="tip"> | |||
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的导入任务 | |||
</div> | |||
<p style="color: red">1、仅允许导入xls、xlsx格式文件;</p> | |||
<p style="color: red">1、仅允许导入zip格式文件;</p> | |||
<p style="color: red">2、覆盖导入:指先将所选区划当前在库数据删除,然后按新数据包解析导入;</p> | |||
<p style="color: red">3、增量导入:指按新数据包解析并追加导入;</p> | |||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link> | |||
@@ -201,17 +202,37 @@ | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
<el-dialog title="任务日志" :visible.sync="log.logOpen" width="800px" append-to-body> | |||
<div v-html="log.logText"> | |||
</div> | |||
<!-- 弹框操作按钮 --> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button @click="downloadLog">下 载</el-button> | |||
<el-button @click="closeLog">关 闭</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listImport, getImport, getImportDetail, delImport, addImport, updateImport, printImport } from "@/api/business/import" | |||
import { | |||
listImport, | |||
getImport, | |||
getImportDetail, | |||
delImport, | |||
addImport, | |||
updateImport, | |||
printImport, | |||
startImport, importLog, downloadLog | |||
} from "@/api/business/import" | |||
import { getToken } from "@/utils/auth" | |||
import Treeselect from "@riophae/vue-treeselect"; | |||
import {Pane, Splitpanes} from "splitpanes"; | |||
import "@riophae/vue-treeselect/dist/vue-treeselect.css" | |||
import "splitpanes/dist/splitpanes.css" | |||
import { deptTreeSelect } from "@/api/system/user" | |||
import {save} from "@/utils"; | |||
export default { | |||
name: "Import", | |||
@@ -315,7 +336,11 @@ export default { | |||
// 上传的地址 | |||
url: process.env.VUE_APP_BASE_API + "/business/import/importData" | |||
}, | |||
log: { | |||
taskId: null, | |||
logOpen: false, | |||
logText: '', | |||
}, | |||
} | |||
}, | |||
watch: { | |||
@@ -586,7 +611,60 @@ export default { | |||
this.selectDeptName = data.label | |||
this.handleQuery() | |||
}, | |||
/** 开始 */ | |||
handleDo(row) { | |||
const ids = row.id || this.ids | |||
this.$modal.confirm('是否确认开始编号为"' + ids + '"的导入任务?').then(function() { | |||
return startImport(ids) | |||
}).then((resp) => { | |||
this.getList() | |||
this.$modal.msgSuccess(resp.data == 2 ? '正在执行' : '已加入队列, 等待执行') | |||
}).catch(() => {}) | |||
}, | |||
/** 日志 */ | |||
handleLog(row, offset = 0) { | |||
if(!this.log.logOpen) | |||
return; | |||
importLog(row.id, offset).then(({data}) => { | |||
if(null == data.text) | |||
{ | |||
this.log.logText = ''; | |||
return; | |||
} | |||
this.log.logText += data.text | |||
.replaceAll('<', '<') | |||
.replaceAll('>', '>') | |||
.replaceAll('\r\n', '<br/>') | |||
.replaceAll('\r', '<br/>') | |||
.replaceAll('\n', '<br/>') | |||
; | |||
if(!data.eof && this.log.logOpen && (data.taskStatus === '1' || data.taskStatus === '2')) | |||
{ | |||
setTimeout(() => { | |||
this.handleLog(row, data.length); | |||
}, data.nextPollDelay > 0 ? data.nextPollDelay : 2000); | |||
} | |||
}); | |||
}, | |||
/** 日志 */ | |||
downloadLog() { | |||
if(!this.log.taskId) | |||
return; | |||
downloadLog(this.log.taskId).then((resp) => { | |||
save(`导入任务_${this.log.taskId}.log`, resp); | |||
}); | |||
}, | |||
openLog(row) { | |||
this.log.logText = ''; | |||
this.log.logOpen = true; | |||
this.log.taskId = row.id; | |||
this.handleLog(row); | |||
}, | |||
closeLog() { | |||
this.log.logOpen = false; | |||
this.log.taskId = null; | |||
this.log.logText = ''; | |||
}, | |||
} | |||
} | |||
</script> | |||
@@ -11,72 +11,90 @@ | |||
<div class="info-cards"> | |||
<div class="info-card"> | |||
<h3>地块总数</h3> | |||
<p class="number">12,345</p> | |||
<p class="number"><countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum1)" :duration="2000"></countTo> 宗</p> | |||
</div> | |||
<div class="info-card"> | |||
<h3>承包总金额</h3> | |||
<p class="number">¥ 456,789</p> | |||
<p class="number">¥ <countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum6)" :duration="2000"></countTo></p> | |||
</div> | |||
</div> | |||
<div class="info-cards"> | |||
<div class="info-card"> | |||
<h3>待调查总数</h3> | |||
<p class="number">8,642</p> | |||
<p class="number"><countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum2)" :duration="2000"></countTo> 宗</p> | |||
</div> | |||
<div class="info-card"> | |||
<h3>兑现总金额</h3> | |||
<p class="number">8,642</p> | |||
<p class="number">¥ <countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum7)" :duration="2000"></countTo></p> | |||
</div> | |||
</div> | |||
<div class="info-cards"> | |||
<div class="info-card"> | |||
<h3>已调查总数</h3> | |||
<p class="number">¥ 456,789</p> | |||
<p class="number"><countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum3)" :duration="2000"></countTo> 宗</p> | |||
</div> | |||
<div class="info-card"> | |||
<h3>尚欠总金额</h3> | |||
<p class="number">¥ 456,789</p> | |||
<p class="number">¥ <countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum8)" :duration="2000"></countTo></p> | |||
</div> | |||
</div> | |||
<div class="info-cards"> | |||
<div class="info-card"> | |||
<h3>地块总面积</h3> | |||
<p class="number">8,642</p> | |||
<p class="number"><countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum4)" :duration="2000"></countTo> 亩</p> | |||
</div> | |||
<div class="info-card"> | |||
<h3>经营总面积</h3> | |||
<p class="number">¥ 456,789</p> | |||
<h3>年总收益</h3> | |||
<p class="number">¥ <countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum10)" :duration="2000"></countTo></p> | |||
</div> | |||
</div> | |||
<div class="info-cards"> | |||
<div class="info-card"> | |||
<h3>机动地总面积</h3> | |||
<p class="number">¥ 456,789</p> | |||
<p class="number"><countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum5)" :duration="2000"></countTo> 亩</p> | |||
</div> | |||
<div class="info-card"> | |||
<h3>年总收益</h3> | |||
<p class="number">8,642</p> | |||
<h3>经营总面积</h3> | |||
<p class="number"><countTo v-if="homepageStatistics" :startVal="0" :endVal="Number(homepageStatistics.dataNum9)" :duration="2000"></countTo> 亩</p> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</template> | |||
<script> | |||
import * as echarts from 'echarts'; | |||
import { homepageStatistics } from "@/api/big/resource" | |||
import countTo from "vue-count-to"; | |||
export default { | |||
name: 'Dashboard', | |||
data() { | |||
return { | |||
homepageStatistics:null, | |||
progressResourceInvestigationList:[], | |||
} | |||
}, | |||
components: { countTo}, | |||
mounted() { | |||
this.progressResourceInvestigation(); | |||
this.initLineChart(); | |||
}, | |||
methods: { | |||
progressResourceInvestigation(){ | |||
homepageStatistics().then((res) => { | |||
if (res.code == 200) { | |||
this.homepageStatistics = res.data.homepageStatistics; | |||
this.progressResourceInvestigationList = res.data.progressResourceInvestigation; | |||
this.initLineChart(); | |||
} | |||
}); | |||
}, | |||
initLineChart() { | |||
const chart = echarts.init(this.$refs.lineChart); | |||
const option = { | |||
@@ -95,7 +113,7 @@ | |||
xAxis: { | |||
type: 'category', | |||
boundaryGap: false, | |||
data: ['A市', 'B市', 'C市', 'D市', 'E市', 'F市', 'G市'] | |||
data: this.progressResourceInvestigationList.map(item => item.deptName) | |||
}, | |||
yAxis: { | |||
type: 'value' | |||
@@ -104,7 +122,7 @@ | |||
{ | |||
name: '已调查', | |||
type: 'line', | |||
data: [220, 182, 191, 234, 290, 330, 310], | |||
data: this.progressResourceInvestigationList.map(item => item.dataNum1), | |||
smooth: true, | |||
lineStyle: { | |||
width: 3, | |||
@@ -117,7 +135,7 @@ | |||
{ | |||
name: '待调查', | |||
type: 'line', | |||
data: [150, 232, 201, 154, 190, 330, 410], | |||
data: this.progressResourceInvestigationList.map(item => item.dataNum2), | |||
smooth: true, | |||
lineStyle: { | |||
width: 3, | |||
@@ -191,7 +191,7 @@ export default { | |||
bottom: 0; | |||
width: 100%; | |||
text-align: center; | |||
color: #fff; | |||
color: #000000; | |||
font-family: Arial; | |||
font-size: 12px; | |||
letter-spacing: 1px; | |||
@@ -226,7 +226,7 @@ | |||
<el-descriptions-item label="实物图"> | |||
<div v-if="!!form.dkImg"> | |||
<el-tooltip effect="light" :content="item" placement="bottom" v-for="(item, index) in form.dkImg.split(',')" :key="index"> | |||
<el-image style="height: 64px; width: 64px; margin: 2px; display: inline-block;" fit="scale-down" :src="this.baseRoutingUrll + item" :preview-src-list="form.dkImg.split(',').map((x) => this.baseRoutingUrll + x)"/> | |||
<el-image style="height: 64px; width: 64px; margin: 2px; display: inline-block;" fit="scale-down" :src="baseRoutingUrll + item" :preview-src-list="form.dkImg.split(',').map((x) => baseRoutingUrll + x)"/> | |||
</el-tooltip> | |||
</div> | |||
</el-descriptions-item> | |||
@@ -332,18 +332,19 @@ | |||
<div id="mapWrap"></div> | |||
<div id='land-btn-wrap'> | |||
<el-row> | |||
<input id="drawPolygon" class="ant-btn ant-btn-red" type="button" value="画图"/> | |||
<!-- <input id="drawRemove" type="button" class="ant-btn ant-btn-red" value="取消画图"/> --> | |||
<input id="drawReset" type="button" class="ant-btn ant-btn-red" value="还原"/> | |||
<input id="drawPolygon" class="ant-btn ant-btn-red" type="button" value="开启画图"/> | |||
<!--<input id="drawRemove" type="button" class="ant-btn ant-btn-red" value="关闭画图"/> --> | |||
<input id="drawReset" type="button" class="ant-btn ant-btn-red" value="还原图层"/> | |||
</el-row> | |||
</div> | |||
</div> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" v-if="diglogStatus" @click="submitFormMap">确 定</el-button> | |||
<el-button type="primary" @click="submitFormMap">确 定</el-button> | |||
<el-button type="danger" @click="clearMapLayer">清除图层</el-button> | |||
<el-button @click="cancelMap">关 闭</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
@@ -357,14 +358,13 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css" | |||
import "splitpanes/dist/splitpanes.css" | |||
import { deptTreeSelect } from "@/api/system/user" | |||
import {getConfigKey} from "@/api/system/config"; | |||
import {getDept,getInfoByImportCode} from "@/api/system/dept"; | |||
import MapField from "@/components/house/MapField"; | |||
import {getDept, getInfoByImportCode} from "@/api/system/dept"; | |||
import $ from "jquery"; | |||
export default { | |||
name: "Land", | |||
dicts: ['ownership_type', 'land_use_type', 'survey_status', 'is_common', 'land_grade_type', 'land_type', 'land_use'], | |||
components: { Treeselect, Splitpanes, Pane,MapField }, | |||
components: { Treeselect, Splitpanes, Pane }, | |||
data() { | |||
return { | |||
// 遮罩层 | |||
@@ -407,15 +407,13 @@ export default { | |||
children: "children", | |||
label: "label" | |||
}, | |||
// 遮罩按钮新增点击状态 | |||
diglogStatus: true, | |||
//地图 | |||
//地图参数 | |||
openMap: false, | |||
mapTheGeomId: null, | |||
mapTheGeom: null, | |||
drawInsert:null, | |||
tGeoOrganizationLng: null, | |||
tGeoOrganizationLat: null, | |||
jingdu: null, | |||
weidu: null, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
@@ -447,7 +445,6 @@ export default { | |||
scmjm: [ | |||
{ required: true, message: "实测面积不能为空", trigger: "blur" } | |||
], | |||
}, | |||
// EXCEL导入 | |||
upload: { | |||
@@ -464,7 +461,6 @@ export default { | |||
// 上传的地址 | |||
url: process.env.VUE_APP_BASE_API + "/resource/land/importData" | |||
}, | |||
} | |||
}, | |||
watch: { | |||
@@ -476,6 +472,7 @@ export default { | |||
created() { | |||
this.getDeptTree() | |||
this.getList() | |||
// 获取geoserver的地址 | |||
this.getGeoServerUrl(); | |||
// 获取地块图层名称 | |||
@@ -500,7 +497,7 @@ export default { | |||
this.open = false | |||
this.reset() | |||
}, | |||
// 取消按钮 | |||
// 取消地图按钮 | |||
cancelMap() { | |||
this.openMap = false; | |||
this.reset(); | |||
@@ -517,7 +514,7 @@ export default { | |||
dkmc: null, | |||
syqxz: '30', | |||
dklb: '22', | |||
tdlylx: '011', | |||
tdlylx: '01', | |||
dldj: '01', | |||
tdyt: '1', | |||
sfjbnt: '1', | |||
@@ -535,7 +532,6 @@ export default { | |||
deptName: null, | |||
sfzwd: '2' | |||
} | |||
this.diglogStatus = true; | |||
this.resetForm("form") | |||
}, | |||
/** 搜索按钮操作 */ | |||
@@ -772,8 +768,8 @@ export default { | |||
getDept(deptId).then(response => { | |||
let insertCode = response.data; | |||
if (insertCode != null) { | |||
this.tGeoOrganizationLat = insertCode.latitude; | |||
this.tGeoOrganizationLng = insertCode.longitude; | |||
this.weidu = insertCode.latitude; | |||
this.jingdu = insertCode.longitude; | |||
} | |||
}); | |||
}, | |||
@@ -783,8 +779,8 @@ export default { | |||
getInfoByImportCode(row.importCode).then((res) => { | |||
let insertCode = res.data; | |||
if (insertCode != null) { | |||
this.tGeoOrganizationLat = insertCode.latitude; | |||
this.tGeoOrganizationLng = insertCode.longitude; | |||
this.weidu = insertCode.latitude; | |||
this.jingdu = insertCode.longitude; | |||
} | |||
const tableRow = { importCode: row.importCode }; | |||
listLandQuery(tableRow).then(response => { | |||
@@ -798,43 +794,40 @@ export default { | |||
}, | |||
/** 地图提交按钮 */ | |||
submitFormMap() { | |||
this.diglogStatus = false; | |||
if(this.drawInsert !=null && this.drawInsert !=""){ | |||
this.mapTheGeomId.theGeom = JSON.stringify(this.drawInsert); | |||
}else{ | |||
this.mapTheGeomId.theGeom = this.mapTheGeomId.theGeomText | |||
} | |||
let sysGis = { tableName: 't_resource_land',priId: 'fid',id: this.mapTheGeomId.fid,theGeom: this.mapTheGeomId.theGeom }; | |||
let sysGis = { tableName: 't_resource_land', priId: 'fid', id: this.mapTheGeomId.fid, theGeom: this.mapTheGeomId.theGeom }; | |||
if (this.mapTheGeomId != null) { | |||
areaSavePri(sysGis).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.openMap = false; | |||
this.getList(); | |||
this.diglogStatus = true; | |||
//this.getList(); | |||
}); | |||
} | |||
}, | |||
/** 清除坐标点图层 */ | |||
clearMapLayer() { | |||
let sysGis = { tableName: 't_resource_land',priId: 'fid',id: this.mapTheGeomId.fid}; | |||
let sysGis = { tableName: 't_resource_land', priId: 'fid', id: this.mapTheGeomId.fid}; | |||
cleanSavePri(sysGis).then(response => { | |||
this.$modal.msgSuccess("清除成功"); | |||
this.openMap = false; | |||
this.getList(); | |||
//this.getList(); | |||
}); | |||
}, | |||
pointDarw(resourceList) { | |||
//加载地图编辑 | |||
var that = this; | |||
var map; | |||
//var hc_land; | |||
var draw; // global so we can remove it later | |||
var draw; | |||
var vector_drawing; | |||
var startDarw =false; | |||
var openDarw = false; | |||
this.mapTheGeomId = resourceList.find((land) => { | |||
//model就是上面的数据源 | |||
return land.fid === this.mapTheGeomId.fid; //筛选出匹配数据 | |||
return land.fid === this.mapTheGeomId.fid; | |||
}); | |||
if (this.mapTheGeomId.theGeom != null && this.mapTheGeomId.theGeom != "" | |||
&& this.mapTheGeomId.theGeom != undefined) { | |||
@@ -844,9 +837,10 @@ export default { | |||
startDarw = false; | |||
openDarw = true; | |||
} | |||
if (startDarw) { | |||
document.getElementById("mapWrap").innerHTML = ''; | |||
var hc_land; | |||
var thePolygon; | |||
var draw; // global so we can remove it later | |||
var vector_drawing; | |||
var projection = new ol.proj.Projection({ | |||
@@ -855,7 +849,6 @@ export default { | |||
units: "degrees", | |||
//extent:extent | |||
}); | |||
var aerial = new ol.layer.Tile({ | |||
source: new ol.source.XYZ({ | |||
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + | |||
@@ -865,7 +858,6 @@ export default { | |||
isGroup: true, | |||
name: "卫星影像图", | |||
}); | |||
var yingxzi = new ol.layer.Tile({ | |||
source: new ol.source.XYZ({ | |||
url: "https://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067", | |||
@@ -882,8 +874,8 @@ export default { | |||
view: new ol.View({ | |||
//center: ol.proj.fromLonLat([115.452752, 31.789033]), | |||
zoom: 17.8, | |||
minZoom: 0, //地图缩小限制 | |||
maxZoom: 18.3, //地图放大限制 | |||
minZoom: 0, | |||
maxZoom: 18.3, | |||
}), | |||
}); | |||
// 添加村边界 | |||
@@ -899,7 +891,6 @@ export default { | |||
name: 'villageBorderLayer' | |||
}); | |||
map.addLayer(mapBorder); | |||
// 添加已经存在的资源图层 | |||
let vectorSource = new ol.source.Vector(); | |||
for (let resource of resourceList) { | |||
@@ -911,7 +902,6 @@ export default { | |||
vectorSource.addFeature(feature); | |||
} | |||
} | |||
let resourceLayer = new ol.layer.Vector({ | |||
source: vectorSource, | |||
style: (feature, resolution) => { | |||
@@ -929,8 +919,8 @@ export default { | |||
} | |||
}); | |||
map.addLayer(resourceLayer); | |||
//图层查询定位开始 ---------start | |||
hc_land = new ol.layer.Vector({ | |||
//当前图层查询定位 | |||
thePolygon = new ol.layer.Vector({ | |||
title: "add Layer", | |||
source: new ol.source.Vector({ | |||
projection: projection, | |||
@@ -950,24 +940,21 @@ export default { | |||
}), | |||
}), | |||
}); | |||
map.addLayer(hc_land); | |||
var maxXMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxX; | |||
var maxYMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxY; | |||
var minXMap = hc_land.values_.source.featuresRtree_.rbush_.data.minX; | |||
var minYMap = hc_land.values_.source.featuresRtree_.rbush_.data.minY; | |||
//定位查询位置 | |||
var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置 | |||
map.addLayer(thePolygon); | |||
var maxXMap = thePolygon.values_.source.featuresRtree_.rbush_.data.maxX; | |||
var maxYMap = thePolygon.values_.source.featuresRtree_.rbush_.data.maxY; | |||
var minXMap = thePolygon.values_.source.featuresRtree_.rbush_.data.minX; | |||
var minYMap = thePolygon.values_.source.featuresRtree_.rbush_.data.minY; | |||
var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); | |||
map.getView().animate({ | |||
// 只设置需要的属性即可 | |||
center: center, // 中心点 | |||
zoom: 17.8, // 缩放级别 | |||
rotation: undefined, // 缩放完成view视图旋转弧度 | |||
duration: 1000, // 缩放持续时间,默认不需要设置 | |||
center: center, | |||
zoom: 17.8, | |||
rotation: undefined, | |||
duration: 1000, | |||
}); | |||
//图层查询定位结束 ---------end | |||
//开始绘制地图 | |||
$("#drawPolygon").off("click").on("click", function () { | |||
map.removeLayer(hc_land); | |||
map.removeLayer(thePolygon); | |||
map.removeLayer(vector_drawing); | |||
that.drawInsert = null; | |||
//var source = new ol.source.Vector({wrapX: false}); | |||
@@ -975,7 +962,6 @@ export default { | |||
source: new ol.source.Vector(), | |||
}); | |||
map.addLayer(vector_drawing); | |||
function addInteraction() { | |||
draw = new ol.interaction.Draw({ | |||
source: vector_drawing.getSource(), | |||
@@ -990,12 +976,11 @@ export default { | |||
}); | |||
map.addInteraction(draw); | |||
} | |||
addInteraction(); | |||
}); | |||
//清除画图鼠标点击事件 | |||
$("#drawRemove").off("click").on("click", function () { | |||
//map.addLayer(hc_land); | |||
//map.addLayer(thePolygon); | |||
map.removeInteraction(draw); | |||
//map.removeLayer(vector_drawing); | |||
}); | |||
@@ -1003,10 +988,11 @@ export default { | |||
$("#drawReset").off("click").on("click", function () { | |||
map.removeInteraction(draw); | |||
map.removeLayer(vector_drawing); | |||
map.addLayer(hc_land); | |||
map.addLayer(thePolygon); | |||
that.drawInsert = null; | |||
}); | |||
} | |||
if (openDarw) { | |||
document.getElementById("mapWrap").innerHTML = ''; | |||
var projection = new ol.proj.Projection({ | |||
@@ -1015,7 +1001,6 @@ export default { | |||
units: "degrees", | |||
//extent:extent | |||
}); | |||
var aerial = new ol.layer.Tile({ | |||
source: new ol.source.XYZ({ | |||
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + | |||
@@ -1035,9 +1020,8 @@ export default { | |||
}); | |||
//获取坐标是否存在 | |||
var Zb; | |||
if (this.tGeoOrganizationLng != null && this.tGeoOrganizationLat != null && this.tGeoOrganizationLng !="" | |||
&& this.tGeoOrganizationLat !="" && this.tGeoOrganizationLng !=undefined && this.tGeoOrganizationLat !=undefined) { | |||
Zb = [this.tGeoOrganizationLng, this.tGeoOrganizationLat] | |||
if (this.jingdu != null && this.jingdu !="") { | |||
Zb = [this.jingdu, this.weidu] | |||
} else { | |||
Zb = [115.452752, 31.789033]; | |||
} | |||
@@ -1069,7 +1053,6 @@ export default { | |||
name: 'villageBorderLayer' | |||
}); | |||
map.addLayer(mapBorder); | |||
// 添加已经存在的资源图层 | |||
let vectorSource = new ol.source.Vector(); | |||
for (let resource of resourceList) { | |||
@@ -1081,7 +1064,6 @@ export default { | |||
vectorSource.addFeature(feature); | |||
} | |||
} | |||
let resourceLayer = new ol.layer.Vector({ | |||
source: vectorSource, | |||
style: (feature, resolution) => { | |||
@@ -1100,10 +1082,9 @@ export default { | |||
}); | |||
map.addLayer(resourceLayer); | |||
//图层查询定位结束 ---------end | |||
//开始绘制地图 | |||
$("#drawPolygon").off("click").on("click", function () { | |||
//map.removeLayer(hc_land); | |||
//map.removeLayer(thePolygon); | |||
map.removeLayer(vector_drawing); | |||
that.drawInsert = null; | |||
map.removeInteraction(draw); | |||
@@ -1130,20 +1111,21 @@ export default { | |||
}); | |||
map.addInteraction(draw); | |||
} | |||
addInteraction(); | |||
}); | |||
//清除画图鼠标点击事件 | |||
$("#drawRemove").off("click").on("click", function () { | |||
//map.addLayer(hc_land); | |||
//map.addLayer(thePolygon); | |||
map.removeInteraction(draw); | |||
//map.removeLayer(vector_drawing); | |||
}); | |||
//还原之前图层 | |||
$("#drawReset").off("click").on("click", function () { | |||
map.removeInteraction(draw); | |||
map.removeLayer(vector_drawing); | |||
//map.addLayer(hc_land); | |||
//map.addLayer(thePolygon); | |||
that.drawInsert = null; | |||
}); | |||
} | |||
@@ -1156,6 +1138,7 @@ export default { | |||
height: 75vh; | |||
overflow-y: scroll; | |||
} | |||
#land-btn-wrap { | |||
position: relative; | |||
width: 40%; | |||
@@ -1163,7 +1146,6 @@ export default { | |||
bottom: 95%; | |||
z-index: 2000; | |||
} | |||
#mapWrap { | |||
width: 100%; | |||
height: 100%; | |||