@@ -60,3 +60,29 @@ export function printImport(query) { | |||||
params: 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', | |||||
}) | |||||
} |
@@ -10,6 +10,7 @@ const getters = { | |||||
id: state => state.user.id, | id: state => state.user.id, | ||||
name: state => state.user.name, | name: state => state.user.name, | ||||
nickName: state => state.user.nickName, | nickName: state => state.user.nickName, | ||||
user: state => state.user, | |||||
introduction: state => state.user.introduction, | introduction: state => state.user.introduction, | ||||
roles: state => state.user.roles, | roles: state => state.user.roles, | ||||
permissions: state => state.user.permissions, | permissions: state => state.user.permissions, | ||||
@@ -12,6 +12,7 @@ const user = { | |||||
name: '', | name: '', | ||||
nickName: '', | nickName: '', | ||||
avatar: '', | avatar: '', | ||||
user: {}, | |||||
roles: [], | roles: [], | ||||
permissions: [], | permissions: [], | ||||
//获取登录页相关标题 | //获取登录页相关标题 | ||||
@@ -42,13 +43,15 @@ const user = { | |||||
SET_AVATAR: (state, avatar) => { | SET_AVATAR: (state, avatar) => { | ||||
state.avatar = avatar | state.avatar = avatar | ||||
}, | }, | ||||
SET_USER: (state, user) => { | |||||
state.user = user | |||||
}, | |||||
SET_ROLES: (state, roles) => { | SET_ROLES: (state, roles) => { | ||||
state.roles = roles | state.roles = roles | ||||
}, | }, | ||||
SET_PERMISSIONS: (state, permissions) => { | SET_PERMISSIONS: (state, permissions) => { | ||||
state.permissions = permissions | state.permissions = permissions | ||||
}, | }, | ||||
SET_STSTEMCONFIGlIST: (state, systemConfigList) => { | SET_STSTEMCONFIGlIST: (state, systemConfigList) => { | ||||
state.systemConfigList = systemConfigList | state.systemConfigList = systemConfigList | ||||
}, | }, | ||||
@@ -103,6 +106,7 @@ const user = { | |||||
commit('SET_NAME', user.userName) | commit('SET_NAME', user.userName) | ||||
commit('SET_NICK_NAME', user.nickName) | commit('SET_NICK_NAME', user.nickName) | ||||
commit('SET_AVATAR', avatar) | commit('SET_AVATAR', avatar) | ||||
commit('SET_USER', user) | |||||
/* 初始密码提示 */ | /* 初始密码提示 */ | ||||
if(res.isDefaultModifyPwd) { | if(res.isDefaultModifyPwd) { | ||||
MessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { | MessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { | ||||
@@ -388,3 +388,31 @@ export function isNumberStr(str) { | |||||
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(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); | |||||
} | |||||
} | |||||
@@ -42,10 +42,10 @@ | |||||
<van-field readonly v-model="form.cbje" label="承包金额(元)" placeholder="请输入" input-align="right" label-width="auto" /> | <van-field readonly v-model="form.cbje" label="承包金额(元)" placeholder="请输入" input-align="right" label-width="auto" /> | ||||
<van-field readonly v-model="form.surveyStatus" label="调查状态" placeholder="请输入" input-align="right" label-width="auto" /> | <van-field readonly v-model="form.surveyStatus" label="调查状态" placeholder="请输入" input-align="right" label-width="auto" /> | ||||
<van-field readonly v-model="form.bz" label="备注信息" placeholder="请输入" input-align="right" label-width="auto" /> | <van-field readonly v-model="form.bz" label="备注信息" placeholder="请输入" input-align="right" label-width="auto" /> | ||||
<van-field readonly v-model="form.jymj" label="实物图" placeholder="请输入" input-align="right" label-width="auto" /> | |||||
<van-field readonly label="实物图" placeholder="" input-align="right" label-width="auto" /> | |||||
<div v-if="!!form.dkImg"> | <div v-if="!!form.dkImg"> | ||||
<el-tooltip effect="light" :content="item" placement="bottom" v-for="(item, index) in form.dkImg.split(',')" :key="index"> | <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> | </el-tooltip> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -61,6 +61,8 @@ | |||||
data() { | data() { | ||||
return { | return { | ||||
value:'', | value:'', | ||||
// 项目路径 | |||||
baseRoutingUrll: '/api',//process.env.VUE_APP_BASE_API | |||||
form:{} | form:{} | ||||
}; | }; | ||||
}, | }, | ||||
@@ -5,8 +5,8 @@ | |||||
<div class="left"> | <div class="left"> | ||||
<div class="avatar"><img src="../../assets/images/app/user_header.png" alt=""></div> | <div class="avatar"><img src="../../assets/images/app/user_header.png" alt=""></div> | ||||
<div class="info"> | <div class="info"> | ||||
<p>张晋升</p> | |||||
<p>常家围子村委会</p> | |||||
<p>{{ nickName }}</p> | |||||
<p>{{ deptName }}</p> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<van-icon name="setting" size="25" @click="$router.push({ path: '/app/user' })" /> | <van-icon name="setting" size="25" @click="$router.push({ path: '/app/user' })" /> | ||||
@@ -14,7 +14,7 @@ | |||||
<img src="../../assets/images/app/banner.png" width="100%" style="margin: 2vh 0;" alt=""> | <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> | <p slot="left-icon" class="notice_tt">通知</p> | ||||
</van-notice-bar> | </van-notice-bar> | ||||
@@ -43,6 +43,8 @@ | |||||
}, | }, | ||||
created() { | created() { | ||||
this.getMenuApp(); | this.getMenuApp(); | ||||
this.nickName = this.$store.getters.user.user.nickName; | |||||
this.deptName = this.$store.getters.user.user.dept.deptName; | |||||
}, | }, | ||||
methods: { | methods: { | ||||
getMenuApp(){ | getMenuApp(){ | ||||
@@ -1,12 +1,6 @@ | |||||
<template> | <template> | ||||
<div class="home_wrapper"> | <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="search_box"> | ||||
<div class="left"> | <div class="left"> | ||||
@@ -17,23 +11,11 @@ | |||||
</div> | </div> | ||||
<van-popup v-model="showPicker" round position="bottom"> | <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> | </van-popup> | ||||
<div class="list_main"> | <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"> | <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="item_box" @click="$router.push({name:'appDetail',query:{dkbm:item.dkbm}})"> | ||||
<div class="head_block"> | <div class="head_block"> | ||||
@@ -51,7 +33,6 @@ | |||||
<div style="background-color: #ee0a24;height: 100%" @click="handleDelete(item)">删除</div> | <div style="background-color: #ee0a24;height: 100%" @click="handleDelete(item)">删除</div> | ||||
</template> | </template> | ||||
</van-swipe-cell> | </van-swipe-cell> | ||||
</van-list> | </van-list> | ||||
</div> | </div> | ||||
@@ -59,7 +40,6 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
// import { getMenuApp } from "@/api/app/index"; | |||||
import { Dialog } from 'vant'; | import { Dialog } from 'vant'; | ||||
import { listLand, delLand } from "@/api/resource/land" | import { listLand, delLand } from "@/api/resource/land" | ||||
export default { | export default { | ||||
@@ -96,7 +76,7 @@ | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
console.log(this.dict.type.survey_status) | |||||
this.queryParams.importCode = this.$store.getters.user.user.dept.importCode; | |||||
}, | }, | ||||
methods: { | methods: { | ||||
onClickLeft(){ | onClickLeft(){ | ||||
@@ -118,7 +98,6 @@ | |||||
}) | }) | ||||
}, | }, | ||||
onConfirm(value) { | onConfirm(value) { | ||||
console.log(value) | |||||
this.surveyStatus = value.label; | this.surveyStatus = value.label; | ||||
this.queryParams.surveyStatus = value.value; | this.queryParams.surveyStatus = value.value; | ||||
this.showPicker = false; | this.showPicker = false; | ||||
@@ -140,7 +119,6 @@ | |||||
/** 删除按钮操作 */ | /** 删除按钮操作 */ | ||||
handleDelete(row) { | handleDelete(row) { | ||||
const fids = row.fid || this.ids | const fids = row.fid || this.ids | ||||
Dialog.confirm({ | Dialog.confirm({ | ||||
title: '提示', | title: '提示', | ||||
message: '是否确认删除地块属性编号为"' + fids + '"的数据项?', | message: '是否确认删除地块属性编号为"' + fids + '"的数据项?', | ||||
@@ -155,7 +133,6 @@ | |||||
.catch(() => { | .catch(() => { | ||||
// on cancel | // on cancel | ||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
}; | }; | ||||
@@ -55,7 +55,7 @@ | |||||
</van-form> | </van-form> | ||||
</div> | </div> | ||||
<p class="copy">中农融信北京科技股份有限公司</p> | |||||
<p class="copy">{{this.$store.getters.technicalSupport == "" ? "中农融信(北京)科技股份有限公司" : this.$store.getters.technicalSupport}}</p> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
@@ -0,0 +1,916 @@ | |||||
<template> | |||||
<div class="app-container"> | |||||
<van-nav-bar | |||||
title="土地列表管理" | |||||
left-arrow | |||||
placeholder | |||||
safe-area-inset-top | |||||
@click-left="onClickLeft" | |||||
/> | |||||
<div class="search_box"> | |||||
<div class="left"> | |||||
<van-field v-model="value" left-icon="search" placeholder="请输入用户名" /> | |||||
</div> | |||||
<van-button type="primary" round >搜索</van-button> | |||||
</div> | |||||
<div class="location"> | |||||
<img src="../../assets/images/app/location.png" alt=""> | |||||
</div> | |||||
<div id="full-screen-acceptance" style="width: 100%;height:100vh;"> | |||||
<!--<div id="landMapDiv"></div>--> | |||||
<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="还原"/>--> | |||||
<!-- </el-row>--> | |||||
<!-- </div>--> | |||||
</div> | |||||
<!-- <div slot="footer" class="dialog-footer">--> | |||||
<!-- <el-button type="primary" @click="submitFormMap">确 定</el-button>--> | |||||
<!-- <el-button type="danger" @click="clearMapLayer">清除图层</el-button>--> | |||||
<!-- </div>--> | |||||
<!-- <van-popup v-model="open" position="bottom" round >--> | |||||
<!-- <div class="landPopup">--> | |||||
<!-- <p class="landPopup_title">属性数据 <img src="../../assets/images/app/edit.png" width="25" alt=""></p>--> | |||||
<!-- <van-form ref="landForm">--> | |||||
<!-- <van-field v-model="form.dkbm" label="地块代码:" placeholder="<自动生成>" :border="false" input-align="right" label-width="auto" maxlength="19" :disabled="true" >--> | |||||
<!-- <!– <template #button v-if="!isDisabled">--> | |||||
<!-- <van-button size="mini" type="primary" native-type="button" @click="generateCode">生成代码</van-button>--> | |||||
<!-- </template> –>--> | |||||
<!-- </van-field>--> | |||||
<!-- <van-field v-model="form.dkmc" label="地块名称:" placeholder="请输入地块名称" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="syqxzText" label="所有权性质:"--> | |||||
<!-- placeholder="请选择所有权性质"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="showOwnership = true"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showOwnership" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="syqxzOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmOwnershipOptions"--> | |||||
<!-- @cancel="showOwnership = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="dklbText" label="地块类别:"--> | |||||
<!-- placeholder="请选择地块类别"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="openLandCategoryPopup"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showLandCategory" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="dklbOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmLandCategoryOptions"--> | |||||
<!-- @cancel="showLandCategory = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="tdlylxText" label="土地利用类型:"--> | |||||
<!-- placeholder="请选择土地利用类型"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="showLandType = true"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showLandType" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="tdlylxOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmLandTypeOptions"--> | |||||
<!-- @cancel="showLandType = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="dldjText" label="地力等级:"--> | |||||
<!-- placeholder="请选择地力等级"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="showLandGrade = true"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showLandGrade" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="dldjOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmLandGradeOptions"--> | |||||
<!-- @cancel="showLandGrade = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="tdytText" label="土地用途:"--> | |||||
<!-- placeholder="请选择土地用途"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="showLandPurpose = true"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showLandPurpose" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="tdytOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmLandPurposeOptions"--> | |||||
<!-- @cancel="showLandPurpose = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="form.sfjbnt" label="基本农田:" required :rules="[{ required: true }]" :border="false" input-align="right" >--> | |||||
<!-- <template #input>--> | |||||
<!-- <van-radio-group v-model="form.sfjbnt" direction="horizontal">--> | |||||
<!-- <!– <van-radio name="1">是</van-radio>--> | |||||
<!-- <van-radio name="2">否</van-radio> –>--> | |||||
<!-- <van-radio v-for="dict in sfjbntOptions" :ke="dict.dictValue" :name="dict.dictValue">{{ dict.dictLabel }}</van-radio>--> | |||||
<!-- </van-radio-group>--> | |||||
<!-- </template>--> | |||||
<!-- </van-field>--> | |||||
<!-- <van-field v-model="form.scmjm" type="number" label="实测面积(亩):" placeholder="请输入实测面积(亩)" required :rules="[{ required: true }]" :border="false" input-align="right" />--> | |||||
<!-- <van-field v-model="form.zjrxm" label="指界人姓名:" placeholder="请输入指界人姓名" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="100" />--> | |||||
<!-- <van-field v-model="form.dkdz" label="地块东至:" placeholder="请输入地块东至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="form.dkxz" label="地块西至:" placeholder="请输入地块西至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="form.dknz" label="地块南至:" placeholder="请输入地块南至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="form.dkbz" label="地块北至:" placeholder="请输入地块北至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="form.dkbzxx" label="地块备注信息:" placeholder="请输入地块备注信息" type="textarea" rows="3" :border="false" input-align="right" maxlength="250" />--> | |||||
<!-- </van-form>--> | |||||
<!-- <div class="footer_main">--> | |||||
<!-- <van-button type="default" hairline size="large">关闭弹窗</van-button>--> | |||||
<!-- <van-button type="danger" hairline size="large">删除地块</van-button>--> | |||||
<!-- <van-button type="info" hairline size="large">保存信息</van-button>--> | |||||
<!-- </div>--> | |||||
<!-- </div>--> | |||||
<!-- </van-popup>--> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { listLand, listLandQuery,getLand, getLandDetail, getLandDetailByDkbm, delLand, addLand, updateLand, printLand } from "@/api/resource/land" | |||||
import { areaSavePri, cleanSavePri } from "@/api/gis/map" | |||||
import { getToken } from "@/utils/auth" | |||||
import Treeselect from "@riophae/vue-treeselect"; | |||||
import { Splitpanes, Pane } from "splitpanes" | |||||
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 $ from "jquery"; | |||||
export default { | |||||
name: "contractedVillageContractor", | |||||
components: { Treeselect, Splitpanes, Pane }, | |||||
data() { | |||||
return { | |||||
form: {}, | |||||
open:true, | |||||
showLegend:true, | |||||
value:'', | |||||
landCategory: ['10'], // 地块类别 | |||||
landLayerName:'' | |||||
}; | |||||
}, | |||||
created() { | |||||
// 获取geoserver的地址 | |||||
this.getGeoServerUrl(); | |||||
// 获取地块图层名称 | |||||
this.getLandLayerName(); | |||||
// 获取村边界的图层名称 | |||||
this.getVillageBorderLayerName(); | |||||
this.handleMap(); | |||||
}, | |||||
mounted() { | |||||
}, | |||||
methods: { | |||||
onClickLeft(){ | |||||
history.back(-1); | |||||
}, | |||||
// 获取geoserver的地址 | |||||
getGeoServerUrl() { | |||||
getConfigKey("system.geoServer.url").then(response => { | |||||
this.mapGeoServerUrl = response.msg; | |||||
}); | |||||
}, | |||||
// 获取地块图层名称 | |||||
getLandLayerName() { | |||||
getConfigKey("geoserver.layer.resourceLand").then(response => { | |||||
this.landLayerName = response.msg; | |||||
}); | |||||
}, | |||||
// 获取村边界的图层名称 | |||||
getVillageBorderLayerName() { | |||||
getConfigKey("geoserver.layer.villageBorder").then(response => { | |||||
this.villageBorderLayerName = response.msg; | |||||
}); | |||||
}, | |||||
/** 地图修改按钮操作 */ | |||||
handleMap() { | |||||
// this.mapTheGeomId = row; | |||||
listLandQuery().then(response => { | |||||
this.openMap = true; | |||||
this.title = "修改地图"; | |||||
setTimeout(() => { | |||||
this.pointDarw(response.rows); | |||||
}, 500); | |||||
}); | |||||
// getLandDetail(row.fid).then((res) => { | |||||
// getInfoByImportCode(row.importCode).then((res) => { | |||||
// let insertCode = res.data; | |||||
// if (insertCode != null) { | |||||
// this.tGeoOrganizationLat = insertCode.latitude; | |||||
// this.tGeoOrganizationLng = insertCode.longitude; | |||||
// } | |||||
// const tableRow = { importCode: row.importCode }; | |||||
// listLandQuery(tableRow).then(response => { | |||||
// this.openMap = true; | |||||
// this.title = "修改地图"; | |||||
// setTimeout(() => { | |||||
// this.pointDarw(response.rows); | |||||
// }, 500); | |||||
// }); | |||||
// }); | |||||
// }); | |||||
}, | |||||
/** 地图提交按钮 */ | |||||
submitFormMap() { | |||||
this.diglogStatus = false; | |||||
if(this.drawInsert !=null && this.drawInsert !=""){ | |||||
this.mapTheGeomId.theGeom = JSON.stringify(this.drawInsert); | |||||
} | |||||
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; | |||||
}); | |||||
} | |||||
}, | |||||
/** 清除坐标点图层 */ | |||||
clearMapLayer() { | |||||
let sysGis = { tableName: 't_resource_land',priId: 'fid',id: this.mapTheGeomId.fid}; | |||||
cleanSavePri(sysGis).then(response => { | |||||
this.$modal.msgSuccess("清除成功"); | |||||
this.openMap = false; | |||||
this.getList(); | |||||
}); | |||||
}, | |||||
pointDarw(resourceList) { | |||||
//加载地图编辑 | |||||
var that = this; | |||||
var map; | |||||
//var hc_land; | |||||
var draw; // global so we can remove it later | |||||
var vector_drawing; | |||||
var startDarw = true; | |||||
var openDarw = false; | |||||
if (startDarw) { | |||||
document.getElementById("mapWrap").innerHTML = ''; | |||||
var hc_land; | |||||
var draw; // global so we can remove it later | |||||
var vector_drawing; | |||||
var projection = new ol.proj.Projection({ | |||||
//地图投影类型 | |||||
code: "EPSG:3857", | |||||
units: "degrees", | |||||
//extent:extent | |||||
}); | |||||
var aerial = new ol.layer.Tile({ | |||||
source: new ol.source.XYZ({ | |||||
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + | |||||
"SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" + | |||||
"&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=cc4aba6e967096098249efa069733067", | |||||
}), | |||||
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", | |||||
}), | |||||
isGroup: true, | |||||
name: "天地图文字标注--卫星影像图", | |||||
}); | |||||
//加载地图 | |||||
map = new ol.Map({ | |||||
controls: ol.control.defaults({attribution: false, zoom: false, rotate: false}).extend([]), //隐藏放大缩小按钮 | |||||
layers: [aerial, yingxzi], | |||||
projection: projection, | |||||
target: "mapWrap", | |||||
view: new ol.View({ | |||||
//center: ol.proj.fromLonLat([115.452752, 31.789033]), | |||||
zoom: 11, | |||||
minZoom: 0, //地图缩小限制 | |||||
maxZoom: 18.3, //地图放大限制 | |||||
}), | |||||
}); | |||||
// 添加村边界 | |||||
let mapBorder = new ol.layer.Image({ | |||||
source: new ol.source.ImageWMS({ | |||||
url: this.mapGeoServerUrl + '/wms', | |||||
params: { | |||||
LAYERS: this.villageBorderLayerName, | |||||
cql_filter: "dept_id = '" + 100 + "'", | |||||
SRID: 3857, | |||||
}, | |||||
}), | |||||
name: 'villageBorderLayer' | |||||
}); | |||||
map.addLayer(mapBorder); | |||||
let landLayer = new ol.layer.Image({ | |||||
source: new ol.source.ImageWMS({ | |||||
url: this.mapGeoServerUrl + '/wms', | |||||
params: { | |||||
LAYERS: this.landLayerName, | |||||
cql_filter: "dept_id = '" + 100 + "'", | |||||
SRID: 3857, | |||||
abc: Math.random() // 无效参数,保证每次发送的请求都不一样 | |||||
} | |||||
}), | |||||
name: 'landLayer' | |||||
}); | |||||
map.getLayers().insertAt(3, landLayer); | |||||
// 添加已经存在的资源图层 | |||||
let vectorSource = new ol.source.Vector(); | |||||
for (let resource of resourceList) { | |||||
let feature = new ol.Feature({ | |||||
geometry: new ol.geom.MultiPolygon(JSON.parse(resource.theGeom).coordinates), | |||||
// permanentName: permanent.name | |||||
}); | |||||
feature.set('detail', resource); | |||||
vectorSource.addFeature(feature); | |||||
} | |||||
// let resourceLayer = new ol.layer.Vector({ | |||||
// source: vectorSource, | |||||
// style: (feature, resolution) => { | |||||
// return new ol.style.Style({ | |||||
// fill: new ol.style.Fill({ | |||||
// //矢量图层填充颜色,以及透明度 | |||||
// color: "rgba(0, 218, 255, 0.3)", | |||||
// }), | |||||
// stroke: new ol.style.Stroke({ | |||||
// //边界样式 | |||||
// color: "#00DAFF", | |||||
// width: 3, | |||||
// }), | |||||
// }) | |||||
// } | |||||
// }); | |||||
// map.addLayer(resourceLayer); | |||||
//图层查询定位开始 ---------start | |||||
hc_land = new ol.layer.Vector({ | |||||
title: "add Layer", | |||||
source: new ol.source.Vector({ | |||||
projection: projection, | |||||
features: new ol.format.GeoJSON().readFeatures("{\n" + | |||||
" \"type\": \"Feature\",\n" + | |||||
" \"geometry\":" + resourceList[0].theGeom + "}"), | |||||
}), | |||||
style: new ol.style.Style({ | |||||
fill: new ol.style.Fill({ | |||||
//矢量图层填充颜色,以及透明度 | |||||
color: "rgba(0, 218, 255, 0.3)", | |||||
}), | |||||
stroke: new ol.style.Stroke({ | |||||
//边界样式 | |||||
color: "#00DAFF", | |||||
width: 3, | |||||
}), | |||||
}), | |||||
}); | |||||
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.getView().animate({ | |||||
// 只设置需要的属性即可 | |||||
center: center, // 中心点 | |||||
zoom: 13, // 缩放级别 | |||||
rotation: undefined, // 缩放完成view视图旋转弧度 | |||||
duration: 1000, // 缩放持续时间,默认不需要设置 | |||||
}); | |||||
//图层查询定位结束 ---------end | |||||
//开始绘制地图 | |||||
$("#drawPolygon").off("click").on("click", function () { | |||||
map.removeLayer(hc_land); | |||||
map.removeLayer(vector_drawing); | |||||
that.drawInsert = null; | |||||
//var source = new ol.source.Vector({wrapX: false}); | |||||
vector_drawing = new ol.layer.Vector({ | |||||
source: new ol.source.Vector(), | |||||
}); | |||||
map.addLayer(vector_drawing); | |||||
function addInteraction() { | |||||
draw = new ol.interaction.Draw({ | |||||
source: vector_drawing.getSource(), | |||||
type: "Polygon" | |||||
}); | |||||
draw.on('drawend', function (evt) { | |||||
map.removeInteraction(draw); | |||||
var feature = evt.feature; | |||||
var geometry = feature.getGeometry(); | |||||
var coordinate = geometry.getCoordinates(); | |||||
that.drawInsert = coordinate; | |||||
}); | |||||
map.addInteraction(draw); | |||||
} | |||||
addInteraction(); | |||||
}); | |||||
//清除画图鼠标点击事件 | |||||
$("#drawRemove").off("click").on("click", function () { | |||||
//map.addLayer(hc_land); | |||||
map.removeInteraction(draw); | |||||
//map.removeLayer(vector_drawing); | |||||
}); | |||||
//还原之前图层 | |||||
$("#drawReset").off("click").on("click", function () { | |||||
map.removeInteraction(draw); | |||||
map.removeLayer(vector_drawing); | |||||
map.addLayer(hc_land); | |||||
that.drawInsert = null; | |||||
}); | |||||
// 地图点击事件 | |||||
map.on("click", (evt) => { | |||||
let feature = map.forEachFeatureAtPixel( | |||||
evt.pixel, | |||||
(feature) => feature | |||||
); | |||||
if (feature) { | |||||
// 镇级:加载村级坐标点 | |||||
var ifConsole = feature.values_.detail; | |||||
console.log(feature); | |||||
} | |||||
}); | |||||
} | |||||
if (openDarw) { | |||||
document.getElementById("mapWrap").innerHTML = ''; | |||||
var projection = new ol.proj.Projection({ | |||||
//地图投影类型 | |||||
code: "EPSG:3857", | |||||
units: "degrees", | |||||
//extent:extent | |||||
}); | |||||
var aerial = new ol.layer.Tile({ | |||||
source: new ol.source.XYZ({ | |||||
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + | |||||
"SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" + | |||||
"&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=cc4aba6e967096098249efa069733067", | |||||
}), | |||||
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", | |||||
}), | |||||
isGroup: true, | |||||
name: "天地图文字标注--卫星影像图", | |||||
}); | |||||
//获取坐标是否存在 | |||||
var Zb; | |||||
if (this.tGeoOrganizationLng != null && this.tGeoOrganizationLat != null && this.tGeoOrganizationLng !="" | |||||
&& this.tGeoOrganizationLat !="" && this.tGeoOrganizationLng !=undefined && this.tGeoOrganizationLat !=undefined) { | |||||
Zb = [this.tGeoOrganizationLng, this.tGeoOrganizationLat] | |||||
} else { | |||||
Zb = [115.452752, 31.789033]; | |||||
} | |||||
//加载地图 | |||||
map = new ol.Map({ | |||||
controls: ol.control.defaults({attribution: false, zoom: false, rotate: false}).extend([]), //隐藏放大缩小按钮 | |||||
layers: [aerial, yingxzi], | |||||
projection: projection, | |||||
logo: 'false', | |||||
target: "mapWrap", | |||||
view: new ol.View({ | |||||
center: ol.proj.fromLonLat(Zb), | |||||
//center: ol.proj.fromLonLat([115.452752, 31.789033]), | |||||
zoom: 17.8, | |||||
minZoom: 0, //地图缩小限制 | |||||
maxZoom: 18, //地图放大限制 | |||||
}), | |||||
}); | |||||
// 添加村边界 | |||||
let mapBorder = new ol.layer.Image({ | |||||
source: new ol.source.ImageWMS({ | |||||
url: this.mapGeoServerUrl + '/wms', | |||||
params: { | |||||
LAYERS: this.villageBorderLayerName, | |||||
cql_filter: "import_code = '" + resourceList[0].importCode + "'", | |||||
SRID: 3857, | |||||
}, | |||||
}), | |||||
name: 'villageBorderLayer' | |||||
}); | |||||
map.addLayer(mapBorder); | |||||
// 添加已经存在的资源图层 | |||||
let vectorSource = new ol.source.Vector(); | |||||
for (let resource of resourceList) { | |||||
if (resource.theGeom) { | |||||
console.log('1') | |||||
let feature = new ol.Feature({ | |||||
geometry: new ol.geom.MultiPolygon(JSON.parse(resource.theGeom).coordinates), | |||||
// permanentName: permanent.name | |||||
}); | |||||
vectorSource.addFeature(feature); | |||||
} | |||||
} | |||||
let resourceLayer = new ol.layer.Vector({ | |||||
source: vectorSource, | |||||
style: (feature, resolution) => { | |||||
return new ol.style.Style({ | |||||
fill: new ol.style.Fill({ | |||||
//矢量图层填充颜色,以及透明度 | |||||
color: "rgba(0, 218, 255, 0.3)", | |||||
}), | |||||
stroke: new ol.style.Stroke({ | |||||
//边界样式 | |||||
color: "#00DAFF", | |||||
width: 3, | |||||
}), | |||||
}) | |||||
} | |||||
}); | |||||
map.addLayer(resourceLayer); | |||||
//图层查询定位结束 ---------end | |||||
//开始绘制地图 | |||||
$("#drawPolygon").off("click").on("click", function () { | |||||
//map.removeLayer(hc_land); | |||||
map.removeLayer(vector_drawing); | |||||
that.drawInsert = null; | |||||
map.removeInteraction(draw); | |||||
var source = new ol.source.Vector({wrapX: false}); | |||||
vector_drawing = new ol.layer.Vector({ | |||||
source: source, | |||||
}); | |||||
map.addLayer(vector_drawing); | |||||
var typeSelect = "Polygon"; | |||||
function addInteraction() { | |||||
var value = typeSelect; | |||||
draw = new ol.interaction.Draw({ | |||||
source: source, | |||||
type: typeSelect | |||||
}); | |||||
draw.on('drawend', function (evt) { | |||||
//map.removeLayer(vector_drawing); | |||||
var feature = evt.feature; | |||||
var geometry = feature.getGeometry(); | |||||
var coordinate = geometry.getCoordinates(); | |||||
that.drawInsert = coordinate; | |||||
map.removeInteraction(draw); | |||||
}); | |||||
map.addInteraction(draw); | |||||
} | |||||
addInteraction(); | |||||
}); | |||||
//清除画图鼠标点击事件 | |||||
$("#drawRemove").off("click").on("click", function () { | |||||
//map.addLayer(hc_land); | |||||
map.removeInteraction(draw); | |||||
//map.removeLayer(vector_drawing); | |||||
}); | |||||
//还原之前图层 | |||||
$("#drawReset").off("click").on("click", function () { | |||||
map.removeInteraction(draw); | |||||
map.removeLayer(vector_drawing); | |||||
//map.addLayer(hc_land); | |||||
that.drawInsert = null; | |||||
}); | |||||
} | |||||
}, | |||||
}, | |||||
}; | |||||
</script> | |||||
<style scoped lang="scss"> | |||||
::v-deep .van-nav-bar{ | |||||
background: linear-gradient( 173deg, #91E2D3 0%, #CDFCF0 100%); | |||||
::v-deep.van-icon{ | |||||
color: #000000; | |||||
} | |||||
} | |||||
.location{ | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: center; | |||||
width: 50px; | |||||
height: 50px; | |||||
margin: 2vh; | |||||
position: absolute; | |||||
top: 12vh; | |||||
right: 0vw; | |||||
z-index: 9; | |||||
background-color: rgba(0,0,0,0.5); | |||||
border-radius: 10px; | |||||
img{ | |||||
width: 30px; | |||||
height: 30px; | |||||
border: 1px dashed #ffffff; | |||||
} | |||||
} | |||||
.van-popup{ | |||||
background: linear-gradient( 180deg, #E5FFF4 0%, #ffffff 100%); | |||||
.landPopup{ | |||||
width: 94%; | |||||
margin: 0 auto; | |||||
.landPopup_title{ | |||||
color: #29D2AF; | |||||
font-size: 20px; | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: space-between; | |||||
} | |||||
} | |||||
} | |||||
.app-container{ | |||||
/*background: #fff url("../../../../../static/images/contracted/contracted_index_bg.png") no-repeat center;*/ | |||||
background-size: 100% 100%; | |||||
height: 100vh; | |||||
padding: 0; | |||||
overflow: hidden; | |||||
} | |||||
::v-deep .van-hairline--bottom::after{ | |||||
border: none; | |||||
} | |||||
::v-deep .van-field--disabled .van-field__label { | |||||
color: #646566; | |||||
} | |||||
::v-deep .landPopup .van-dialog { | |||||
width: 90%; | |||||
height: 85%; | |||||
overflow-y: auto; | |||||
} | |||||
::v-deep .landPopup .van-field__label { | |||||
width: 7em; | |||||
} | |||||
.head{ | |||||
padding: 0 4vw; | |||||
} | |||||
.tap_block{ | |||||
width: 100%; | |||||
display: flex; | |||||
justify-content: space-between; | |||||
background: #ebfaf2; | |||||
padding: 2PX 4PX; | |||||
border-radius: 10PX; | |||||
margin-top: 1vh; | |||||
.active{ | |||||
background-image: linear-gradient(to right,#c6fe8b,#48e5a2); | |||||
box-shadow: 0 0 10PX #cccccc; | |||||
color: #333333; | |||||
} | |||||
p{ | |||||
width: 25%; | |||||
text-align: center; | |||||
padding: 5PX 0; | |||||
border-radius: 10PX; | |||||
color: #666666; | |||||
} | |||||
} | |||||
.legend_main{ | |||||
position: absolute; | |||||
top: 2vh; | |||||
right: 2vw; | |||||
} | |||||
.openLegend{ | |||||
position: absolute; | |||||
top: 2vh; | |||||
right: 0vw; | |||||
background-color: rgba(255,255,255,.5); | |||||
width: 20PX; | |||||
height: 70PX; | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: center; | |||||
border-top-left-radius: 10PX; | |||||
border-bottom-left-radius: 10PX; | |||||
.sanjiao-left { | |||||
display: inline-block; | |||||
border-right: 8PX solid #999999; | |||||
border-right-color: initial; | |||||
border-top: 5PX solid transparent; | |||||
border-bottom: 5PX solid transparent; | |||||
} | |||||
} | |||||
.legend_second{ | |||||
background: rgba(255,255,255,.5); | |||||
padding: 2vh; | |||||
border-radius: 10PX; | |||||
margin-top: 2vh; | |||||
} | |||||
.legend_tt{ | |||||
font-size: 16PX; | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: space-between; | |||||
img{ | |||||
width: 20PX; | |||||
} | |||||
} | |||||
.legend{ | |||||
background: rgba(255,255,255,.5); | |||||
padding: 2vh; | |||||
border-radius: 10PX; | |||||
.van-checkbox{ | |||||
margin-top: 2vh; | |||||
&:nth-child(1){ | |||||
::v-deep .van-checkbox__icon .van-icon{ | |||||
/*border-color: rgba(22,233,15,1);*/ | |||||
border: 4px solid #16E90F; | |||||
} | |||||
} | |||||
&:nth-child(2){ | |||||
::v-deep .van-checkbox__icon .van-icon{ | |||||
/*border-color: rgba(1,198,222,1);*/ | |||||
border: 4px solid #01C6DE; | |||||
} | |||||
} | |||||
&:nth-child(3){ | |||||
::v-deep .van-checkbox__icon .van-icon{ | |||||
/*border-color: rgba(238,238,0,1);*/ | |||||
border: 4px solid #EEEE00; | |||||
} | |||||
} | |||||
&:nth-child(4){ | |||||
::v-deep .van-checkbox__icon .van-icon{ | |||||
/*border-color: rgba(238,60,60,1);*/ | |||||
border: 4px solid #EE3C3C; | |||||
} | |||||
} | |||||
&:nth-child(5){ | |||||
::v-deep .van-checkbox__icon .van-icon{ | |||||
/*border-color: rgba(235,134,0,1);*/ | |||||
border: 4px solid #EB8600; | |||||
} | |||||
} | |||||
} | |||||
.van-checkbox-group { | |||||
.van-checkbox__label{ | |||||
i{ | |||||
display: block; | |||||
width: 15PX; | |||||
height: 15PX; | |||||
border: 1px solid; | |||||
border-radius: 3PX; | |||||
margin-left: 10PX; | |||||
} | |||||
.i1{ | |||||
background: rgba(22,233,15,.7); | |||||
border-color: rgba(22,233,15,1); | |||||
} | |||||
.i2{ | |||||
background: rgba(1,198,222,.7); | |||||
border-color: rgba(1,198,222,1); | |||||
} | |||||
.i3{ | |||||
background: rgba(238,238,0,.7); | |||||
border-color: rgba(238,238,0,1); | |||||
} | |||||
.i4{ | |||||
background: rgba(238,60,60,.7); | |||||
border-color: rgba(238,60,60,1); | |||||
} | |||||
.i5{ | |||||
background: rgba(235,134,0,.7); | |||||
border-color: rgba(235,134,0,1); | |||||
} | |||||
div{ | |||||
display: flex; | |||||
align-items: center; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
.mapBox{ | |||||
height: 100vh; | |||||
width: 100%; | |||||
} | |||||
.footer_main { | |||||
flex: 0 0 120px; | |||||
background: #ccc; | |||||
display: flex; | |||||
justify-content: center; /* 相对父元素水平居中 */ | |||||
align-items: center; /* 子元素相对父元素垂直居中 */ | |||||
} | |||||
.search_box{ | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: space-between; | |||||
width: 94%; | |||||
margin: 2vh auto; | |||||
position: absolute; | |||||
left: 3vw; | |||||
z-index: 9; | |||||
.left{ | |||||
display: flex; | |||||
align-items: center; | |||||
flex: 1; | |||||
background-color: #ffffff; | |||||
border-radius: 50vh; | |||||
overflow: hidden; | |||||
margin-right: 3vw; | |||||
} | |||||
p{ | |||||
flex-shrink: 0; | |||||
} | |||||
button{ | |||||
flex-shrink: 0; | |||||
background: linear-gradient( 271deg, #53E4A5 0%, #24DBDB 100%); | |||||
border: none; | |||||
width: 20vw; | |||||
} | |||||
} | |||||
#land-btn-wrap { | |||||
position: relative; | |||||
width: 40%; | |||||
left: 60%; | |||||
bottom: 95%; | |||||
z-index: 2000; | |||||
} | |||||
#mapWrap { | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
.ant-btn-red { | |||||
position: relative; | |||||
display: inline-block; | |||||
background: #D0EEFF; | |||||
border: 1px solid #99D3F5; | |||||
border-radius: 4px; | |||||
padding: 4px 12px; | |||||
overflow: hidden; | |||||
color: #1E88C7; | |||||
text-decoration: none; | |||||
text-indent: 0; | |||||
line-height: 20px; | |||||
right: -36%; | |||||
} | |||||
</style> |
@@ -13,182 +13,183 @@ | |||||
</div> | </div> | ||||
<van-button type="primary" round >搜索</van-button> | <van-button type="primary" round >搜索</van-button> | ||||
</div> | </div> | ||||
<div style="position:relative;"> | |||||
<div class="mapBox" id="landMapBox"></div> | |||||
<div class="legend_main" v-if="showLegend"> | |||||
<!-- <div class="legend">--> | |||||
<!-- <p class="legend_tt">图例--> | |||||
<!--<!– <img src="../../../../../static/images/contracted/map_icon_01.png" @click="showLegend = false" alt="">–>--> | |||||
<!-- </p>--> | |||||
<!-- <van-checkbox-group v-model="landCategory" @change="filterLandLayer">--> | |||||
<!-- <van-checkbox name="10" shape="square" checked-color="#16e90f" icon-size="18px"><div><p>承包地</p><i class="i1"></i></div></van-checkbox>--> | |||||
<!-- <van-checkbox name="21" shape="square" checked-color="#01c6de" icon-size="18px"><div><p>自留地</p><i class="i2"></i></div></van-checkbox>--> | |||||
<!-- <van-checkbox name="22" shape="square" checked-color="#eeee00" icon-size="18px"><div><p>机动地</p><i class="i3"></i></div></van-checkbox>--> | |||||
<!-- <van-checkbox name="23" shape="square" checked-color="#ee3c3c" icon-size="18px"><div><p>开荒地</p><i class="i4"></i></div></van-checkbox>--> | |||||
<!-- <van-checkbox name="99" shape="square" checked-color="#eb8600" icon-size="18px"><div><p>其他地</p><i class="i5"></i></div></van-checkbox>--> | |||||
<!-- </van-checkbox-group>--> | |||||
<!-- </div>--> | |||||
<div class="legend_second" v-if="taskStatus === '2'"> | |||||
<p class="legend_tt" id="drawLandPolygon"> | |||||
<!-- <img src="../../../../../static/images/contracted/map_icon_02.png" alt="">画图--> | |||||
</p> | |||||
</div> | |||||
</div> | |||||
<div class="openLegend" v-if="!showLegend" @click="showLegend = true"> | |||||
<span class="sanjiao-left"></span> | |||||
</div> | |||||
<div class="location"> | |||||
<img src="../../assets/images/app/location.png" alt=""> | |||||
</div> | |||||
<div id="full-screen-acceptance" style="width: 100%;height:100vh;"> | |||||
<!--<div id="landMapDiv"></div>--> | |||||
<div id="landMapBox"></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="还原"/>--> | |||||
<!-- </el-row>--> | |||||
<!-- </div>--> | |||||
</div> | </div> | ||||
<van-popup v-model="open" position="bottom" round > | |||||
<div class="landPopup"> | |||||
<p class="landPopup_title">属性数据 <img src="../../assets/images/app/edit.png" width="25" alt=""></p> | |||||
<van-form ref="landForm"> | |||||
<van-field v-model="form.dkbm" label="地块代码:" placeholder="<自动生成>" :border="false" input-align="right" label-width="auto" maxlength="19" :disabled="true" > | |||||
<!-- <template #button v-if="!isDisabled"> | |||||
<van-button size="mini" type="primary" native-type="button" @click="generateCode">生成代码</van-button> | |||||
</template> --> | |||||
</van-field> | |||||
<van-field v-model="form.dkmc" label="地块名称:" placeholder="请输入地块名称" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" /> | |||||
<van-field v-model="syqxzText" label="所有权性质:" | |||||
placeholder="请选择所有权性质" | |||||
required | |||||
:rules="[{ required: true }]" | |||||
:border="false" | |||||
input-align="right" | |||||
right-icon="arrow-down" | |||||
readonly | |||||
clickable | |||||
@click="showOwnership = true" | |||||
/> | |||||
<van-popup v-model="showOwnership" position="bottom" get-container=".app-container"> | |||||
<van-picker | |||||
show-toolbar | |||||
:columns="syqxzOptions" | |||||
value-key="dictLabel" | |||||
@confirm="onConfirmOwnershipOptions" | |||||
@cancel="showOwnership = false" | |||||
/> | |||||
</van-popup> | |||||
<van-field v-model="dklbText" label="地块类别:" | |||||
placeholder="请选择地块类别" | |||||
required | |||||
:rules="[{ required: true }]" | |||||
:border="false" | |||||
input-align="right" | |||||
right-icon="arrow-down" | |||||
readonly | |||||
clickable | |||||
@click="openLandCategoryPopup" | |||||
/> | |||||
<van-popup v-model="showLandCategory" position="bottom" get-container=".app-container"> | |||||
<van-picker | |||||
show-toolbar | |||||
:columns="dklbOptions" | |||||
value-key="dictLabel" | |||||
@confirm="onConfirmLandCategoryOptions" | |||||
@cancel="showLandCategory = false" | |||||
/> | |||||
</van-popup> | |||||
<van-field v-model="tdlylxText" label="土地利用类型:" | |||||
placeholder="请选择土地利用类型" | |||||
required | |||||
:rules="[{ required: true }]" | |||||
:border="false" | |||||
input-align="right" | |||||
right-icon="arrow-down" | |||||
readonly | |||||
clickable | |||||
@click="showLandType = true" | |||||
/> | |||||
<van-popup v-model="showLandType" position="bottom" get-container=".app-container"> | |||||
<van-picker | |||||
show-toolbar | |||||
:columns="tdlylxOptions" | |||||
value-key="dictLabel" | |||||
@confirm="onConfirmLandTypeOptions" | |||||
@cancel="showLandType = false" | |||||
/> | |||||
</van-popup> | |||||
<van-field v-model="dldjText" label="地力等级:" | |||||
placeholder="请选择地力等级" | |||||
required | |||||
:rules="[{ required: true }]" | |||||
:border="false" | |||||
input-align="right" | |||||
right-icon="arrow-down" | |||||
readonly | |||||
clickable | |||||
@click="showLandGrade = true" | |||||
/> | |||||
<van-popup v-model="showLandGrade" position="bottom" get-container=".app-container"> | |||||
<van-picker | |||||
show-toolbar | |||||
:columns="dldjOptions" | |||||
value-key="dictLabel" | |||||
@confirm="onConfirmLandGradeOptions" | |||||
@cancel="showLandGrade = false" | |||||
/> | |||||
</van-popup> | |||||
<van-field v-model="tdytText" label="土地用途:" | |||||
placeholder="请选择土地用途" | |||||
required | |||||
:rules="[{ required: true }]" | |||||
:border="false" | |||||
input-align="right" | |||||
right-icon="arrow-down" | |||||
readonly | |||||
clickable | |||||
@click="showLandPurpose = true" | |||||
/> | |||||
<van-popup v-model="showLandPurpose" position="bottom" get-container=".app-container"> | |||||
<van-picker | |||||
show-toolbar | |||||
:columns="tdytOptions" | |||||
value-key="dictLabel" | |||||
@confirm="onConfirmLandPurposeOptions" | |||||
@cancel="showLandPurpose = false" | |||||
/> | |||||
</van-popup> | |||||
<van-field v-model="form.sfjbnt" label="基本农田:" required :rules="[{ required: true }]" :border="false" input-align="right" > | |||||
<template #input> | |||||
<van-radio-group v-model="form.sfjbnt" direction="horizontal"> | |||||
<!-- <van-radio name="1">是</van-radio> | |||||
<van-radio name="2">否</van-radio> --> | |||||
<van-radio v-for="dict in sfjbntOptions" :ke="dict.dictValue" :name="dict.dictValue">{{ dict.dictLabel }}</van-radio> | |||||
</van-radio-group> | |||||
</template> | |||||
</van-field> | |||||
<van-field v-model="form.scmjm" type="number" label="实测面积(亩):" placeholder="请输入实测面积(亩)" required :rules="[{ required: true }]" :border="false" input-align="right" /> | |||||
<van-field v-model="form.zjrxm" label="指界人姓名:" placeholder="请输入指界人姓名" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="100" /> | |||||
<van-field v-model="form.dkdz" label="地块东至:" placeholder="请输入地块东至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" /> | |||||
<van-field v-model="form.dkxz" label="地块西至:" placeholder="请输入地块西至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" /> | |||||
<van-field v-model="form.dknz" label="地块南至:" placeholder="请输入地块南至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" /> | |||||
<van-field v-model="form.dkbz" label="地块北至:" placeholder="请输入地块北至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" /> | |||||
<van-field v-model="form.dkbzxx" label="地块备注信息:" placeholder="请输入地块备注信息" type="textarea" rows="3" :border="false" input-align="right" maxlength="250" /> | |||||
</van-form> | |||||
<div class="footer_main"> | |||||
<van-button type="default" hairline size="large" @click="closePopup">关闭弹窗</van-button> | |||||
<van-button type="danger" hairline size="large" @click="deleteLand(form.id)" v-if="taskStatus === '2' && showDeleteBtn">删除地块</van-button> | |||||
<van-button type="info" hairline size="large" @click="saveLand" v-if="showSaveBtn">保存信息</van-button> | |||||
</div> | |||||
</div> | |||||
</van-popup> | |||||
<!-- <van-popup v-model="open" position="bottom" round >--> | |||||
<!-- <div class="landPopup">--> | |||||
<!-- <p class="landPopup_title">属性数据 <img src="../../assets/images/app/edit.png" width="25" alt=""></p>--> | |||||
<!-- <van-form ref="landForm">--> | |||||
<!-- <van-field v-model="form.dkbm" label="地块代码:" placeholder="<自动生成>" :border="false" input-align="right" label-width="auto" maxlength="19" :disabled="true" >--> | |||||
<!-- <!– <template #button v-if="!isDisabled">--> | |||||
<!-- <van-button size="mini" type="primary" native-type="button" @click="generateCode">生成代码</van-button>--> | |||||
<!-- </template> –>--> | |||||
<!-- </van-field>--> | |||||
<!-- <van-field v-model="form.dkmc" label="地块名称:" placeholder="请输入地块名称" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="syqxzText" label="所有权性质:"--> | |||||
<!-- placeholder="请选择所有权性质"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="showOwnership = true"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showOwnership" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="syqxzOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmOwnershipOptions"--> | |||||
<!-- @cancel="showOwnership = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="dklbText" label="地块类别:"--> | |||||
<!-- placeholder="请选择地块类别"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="openLandCategoryPopup"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showLandCategory" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="dklbOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmLandCategoryOptions"--> | |||||
<!-- @cancel="showLandCategory = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="tdlylxText" label="土地利用类型:"--> | |||||
<!-- placeholder="请选择土地利用类型"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="showLandType = true"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showLandType" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="tdlylxOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmLandTypeOptions"--> | |||||
<!-- @cancel="showLandType = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="dldjText" label="地力等级:"--> | |||||
<!-- placeholder="请选择地力等级"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="showLandGrade = true"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showLandGrade" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="dldjOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmLandGradeOptions"--> | |||||
<!-- @cancel="showLandGrade = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="tdytText" label="土地用途:"--> | |||||
<!-- placeholder="请选择土地用途"--> | |||||
<!-- required--> | |||||
<!-- :rules="[{ required: true }]"--> | |||||
<!-- :border="false"--> | |||||
<!-- input-align="right"--> | |||||
<!-- right-icon="arrow-down"--> | |||||
<!-- readonly--> | |||||
<!-- clickable--> | |||||
<!-- @click="showLandPurpose = true"--> | |||||
<!-- />--> | |||||
<!-- <van-popup v-model="showLandPurpose" position="bottom" get-container=".app-container">--> | |||||
<!-- <van-picker--> | |||||
<!-- show-toolbar--> | |||||
<!-- :columns="tdytOptions"--> | |||||
<!-- value-key="dictLabel"--> | |||||
<!-- @confirm="onConfirmLandPurposeOptions"--> | |||||
<!-- @cancel="showLandPurpose = false"--> | |||||
<!-- />--> | |||||
<!-- </van-popup>--> | |||||
<!-- <van-field v-model="form.sfjbnt" label="基本农田:" required :rules="[{ required: true }]" :border="false" input-align="right" >--> | |||||
<!-- <template #input>--> | |||||
<!-- <van-radio-group v-model="form.sfjbnt" direction="horizontal">--> | |||||
<!-- <!– <van-radio name="1">是</van-radio>--> | |||||
<!-- <van-radio name="2">否</van-radio> –>--> | |||||
<!-- <van-radio v-for="dict in sfjbntOptions" :ke="dict.dictValue" :name="dict.dictValue">{{ dict.dictLabel }}</van-radio>--> | |||||
<!-- </van-radio-group>--> | |||||
<!-- </template>--> | |||||
<!-- </van-field>--> | |||||
<!-- <van-field v-model="form.scmjm" type="number" label="实测面积(亩):" placeholder="请输入实测面积(亩)" required :rules="[{ required: true }]" :border="false" input-align="right" />--> | |||||
<!-- <van-field v-model="form.zjrxm" label="指界人姓名:" placeholder="请输入指界人姓名" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="100" />--> | |||||
<!-- <van-field v-model="form.dkdz" label="地块东至:" placeholder="请输入地块东至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="form.dkxz" label="地块西至:" placeholder="请输入地块西至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="form.dknz" label="地块南至:" placeholder="请输入地块南至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="form.dkbz" label="地块北至:" placeholder="请输入地块北至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />--> | |||||
<!-- <van-field v-model="form.dkbzxx" label="地块备注信息:" placeholder="请输入地块备注信息" type="textarea" rows="3" :border="false" input-align="right" maxlength="250" />--> | |||||
<!-- </van-form>--> | |||||
<!-- <div class="footer_main">--> | |||||
<!-- <van-button type="default" hairline size="large">关闭弹窗</van-button>--> | |||||
<!-- <van-button type="danger" hairline size="large">删除地块</van-button>--> | |||||
<!-- <van-button type="info" hairline size="large">保存信息</van-button>--> | |||||
<!-- </div>--> | |||||
<!-- </div>--> | |||||
<!-- </van-popup>--> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import Cookies from "js-cookie"; | |||||
import { getConfigKey } from "@/api/system/config"; | |||||
import { getDept } from "@/api/contracted"; | |||||
import { getDk, addDk, updateDk, deleteDk, generateLandCode } from "@/api/contracted/dk"; | |||||
import { listLand, listLandQuery,getLand, getLandDetail, getLandDetailByDkbm, delLand, addLand, updateLand, printLand } from "@/api/resource/land" | |||||
import { areaSavePri, cleanSavePri } from "@/api/gis/map" | |||||
import { getToken } from "@/utils/auth" | |||||
import Treeselect from "@riophae/vue-treeselect"; | |||||
import { Splitpanes, Pane } from "splitpanes" | |||||
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 $ from "jquery"; | import $ from "jquery"; | ||||
export default { | export default { | ||||
name: "contractedVillageContractor", | name: "contractedVillageContractor", | ||||
components: { Treeselect, Splitpanes, Pane }, | |||||
data() { | data() { | ||||
return { | return { | ||||
form: {}, // 地块信息表单参数 | |||||
fform: {}, // 地块信息表单参数 | |||||
map: "", // 地图 | map: "", // 地图 | ||||
mapGeoServerUrl: "", // geoserver地址 | mapGeoServerUrl: "", // geoserver地址 | ||||
mapCenterLocation: [], // 地图中心坐标 | mapCenterLocation: [], // 地图中心坐标 | ||||
@@ -199,7 +200,7 @@ | |||||
vectorLayer: "", // 绘制的矢量图层 | vectorLayer: "", // 绘制的矢量图层 | ||||
title: "", // 弹出层标题 | title: "", // 弹出层标题 | ||||
open: true, // 是否显示地块弹出层 | |||||
open: false, // 是否显示地块弹出层 | |||||
syqxzOptions: [], // 所有权性质字典 | syqxzOptions: [], // 所有权性质字典 | ||||
syqxzText: null, // 所有权性质标签名 | syqxzText: null, // 所有权性质标签名 | ||||
showOwnership: false, // 控制所有权性质字典弹出层的显示和隐藏 | showOwnership: false, // 控制所有权性质字典弹出层的显示和隐藏 | ||||
@@ -223,32 +224,16 @@ | |||||
landCategory: ['10'], // 地块类别 | landCategory: ['10'], // 地块类别 | ||||
showLegend:true, | showLegend:true, | ||||
value:'' | |||||
value:'', | |||||
deptId:100, | |||||
importCode:'', | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
this.taskStatus = Cookies.get('taskStatus'); | |||||
this.getDicts("land_ownership").then(response => { | |||||
this.syqxzOptions = response.data; | |||||
}); | |||||
this.getDicts("land_type").then(response => { | |||||
this.dklbOptions = response.data; | |||||
// 去除地块类别中的承包地块选项 | |||||
let index = this.dklbOptions.findIndex(item => item.dictValue === '10'); | |||||
this.dklbOptions.splice(index, 1); | |||||
}); | |||||
this.getDicts("land_grade").then(response => { | |||||
this.dldjOptions = response.data; | |||||
}); | |||||
this.getDicts("use_code").then(response => { | |||||
this.tdytOptions = response.data; | |||||
}); | |||||
this.getDicts("land_use").then(response => { | |||||
this.tdlylxOptions = response.data; | |||||
}); | |||||
this.getDicts("is_common").then(response => { | |||||
this.sfjbntOptions = response.data; | |||||
}); | |||||
console.log(this.$store.getters.user.user.dept.deptId) | |||||
this.deptId = this.$store.getters.user.user.dept.deptId; | |||||
this.importCode = this.$store.getters.user.user.dept.importCode; | |||||
// 获取geoserver的地址 | // 获取geoserver的地址 | ||||
this.getGeoServerUrl(); | this.getGeoServerUrl(); | ||||
// 获取地块图层名称 | // 获取地块图层名称 | ||||
@@ -286,12 +271,10 @@ | |||||
}, | }, | ||||
// 初始化地图 | // 初始化地图 | ||||
initMap() { | initMap() { | ||||
// this.$route.query.deptId | |||||
// getDept(100).then(response => { | |||||
// let dept = response.data; | |||||
let dept = {}; | |||||
if (dept.lng && dept.lat) { | |||||
this.mapCenterLocation = [dept.lng, dept.lat]; | |||||
getDept(this.deptId).then(response => { | |||||
let dept = response.data; | |||||
if (dept.longitude && dept.latitude) { | |||||
this.mapCenterLocation = [dept.longitude, dept.latitude]; | |||||
} else { | } else { | ||||
this.mapCenterLocation = [116.391458, 39.902377]; | this.mapCenterLocation = [116.391458, 39.902377]; | ||||
} | } | ||||
@@ -311,6 +294,7 @@ | |||||
isGroup: true, | isGroup: true, | ||||
name: "卫星影像图", | name: "卫星影像图", | ||||
}); | }); | ||||
let yingxzi = new ol.layer.Tile({ | let yingxzi = new ol.layer.Tile({ | ||||
source: new ol.source.XYZ({ | source: new ol.source.XYZ({ | ||||
url: "http://t{0-7}.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067", | url: "http://t{0-7}.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067", | ||||
@@ -434,7 +418,7 @@ | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
// }); | |||||
}); | |||||
}, | }, | ||||
filterLandLayer() { | filterLandLayer() { | ||||
if (this.landLayer) { | if (this.landLayer) { | ||||
@@ -450,7 +434,7 @@ | |||||
url: this.mapGeoServerUrl + '/wms', | url: this.mapGeoServerUrl + '/wms', | ||||
params: { | params: { | ||||
LAYERS: this.landLayerName, | LAYERS: this.landLayerName, | ||||
cql_filter: "dept_id = '" + this.$route.query.deptId + "' and DKLB in (" + this.landCategory + ")", | |||||
cql_filter: "import_code = '" + this.importCode + "'", | |||||
SRID: 3857, | SRID: 3857, | ||||
abc: Math.random() // 无效参数,保证每次发送的请求都不一样 | abc: Math.random() // 无效参数,保证每次发送的请求都不一样 | ||||
} | } | ||||
@@ -467,7 +451,7 @@ | |||||
url: this.mapGeoServerUrl + '/wms', | url: this.mapGeoServerUrl + '/wms', | ||||
params: { | params: { | ||||
LAYERS: this.villageBorderLayerName, | LAYERS: this.villageBorderLayerName, | ||||
cql_filter: "dept_id = '" + this.$route.query.deptId + "'", | |||||
cql_filter: "import_code = '" + this.importCode + "'", | |||||
SRID: 3857, | SRID: 3857, | ||||
}, | }, | ||||
}), | }), | ||||
@@ -493,7 +477,7 @@ | |||||
} | } | ||||
}); | }); | ||||
} else { | } else { | ||||
this.form.deptId = this.$route.query.deptId; | |||||
this.form.deptId = this.deptId; | |||||
this.showSaveBtn = false; | this.showSaveBtn = false; | ||||
addDk(this.form).then(response => { | addDk(this.form).then(response => { | ||||
if (response.code == 200) { | if (response.code == 200) { | ||||
@@ -573,7 +557,7 @@ | |||||
this.showLandPurpose = false; | this.showLandPurpose = false; | ||||
}, | }, | ||||
generateCode() { | generateCode() { | ||||
generateLandCode({deptId: this.$route.query.deptId}).then(response => { | |||||
generateLandCode({deptId: this.deptId}).then(response => { | |||||
this.$set(this.form, 'dkbm', response.data); | this.$set(this.form, 'dkbm', response.data); | ||||
}); | }); | ||||
}, | }, | ||||
@@ -624,6 +608,7 @@ | |||||
} | } | ||||
this.showLandCategory = true; | this.showLandCategory = true; | ||||
} | } | ||||
}, | }, | ||||
}; | }; | ||||
</script> | </script> | ||||
@@ -634,6 +619,25 @@ | |||||
color: #000000; | color: #000000; | ||||
} | } | ||||
} | } | ||||
.location{ | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: center; | |||||
width: 50px; | |||||
height: 50px; | |||||
margin: 2vh; | |||||
position: absolute; | |||||
top: 12vh; | |||||
right: 0vw; | |||||
z-index: 9; | |||||
background-color: rgba(0,0,0,0.5); | |||||
border-radius: 10px; | |||||
img{ | |||||
width: 30px; | |||||
height: 30px; | |||||
border: 1px dashed #ffffff; | |||||
} | |||||
} | |||||
.van-popup{ | .van-popup{ | ||||
background: linear-gradient( 180deg, #E5FFF4 0%, #ffffff 100%); | background: linear-gradient( 180deg, #E5FFF4 0%, #ffffff 100%); | ||||
.landPopup{ | .landPopup{ | ||||
@@ -860,4 +864,31 @@ | |||||
width: 20vw; | width: 20vw; | ||||
} | } | ||||
} | } | ||||
#land-btn-wrap { | |||||
position: relative; | |||||
width: 40%; | |||||
left: 60%; | |||||
bottom: 95%; | |||||
z-index: 2000; | |||||
} | |||||
#landMapBox { | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
.ant-btn-red { | |||||
position: relative; | |||||
display: inline-block; | |||||
background: #D0EEFF; | |||||
border: 1px solid #99D3F5; | |||||
border-radius: 4px; | |||||
padding: 4px 12px; | |||||
overflow: hidden; | |||||
color: #1E88C7; | |||||
text-decoration: none; | |||||
text-indent: 0; | |||||
line-height: 20px; | |||||
right: -36%; | |||||
} | |||||
</style> | </style> |
@@ -7,8 +7,8 @@ | |||||
<div class="left"> | <div class="left"> | ||||
<div class="avatar"><img src="../../assets/images/app/user_header.png" alt=""></div> | <div class="avatar"><img src="../../assets/images/app/user_header.png" alt=""></div> | ||||
<div class="info"> | <div class="info"> | ||||
<p>张晋升</p> | |||||
<p>常家围子村委会</p> | |||||
<p>{{ nickName }}</p> | |||||
<p>{{ deptName }}</p> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -24,7 +24,7 @@ | |||||
<img src="../../assets/images/app/user_icon_02.png" width="25" alt=""> | <img src="../../assets/images/app/user_icon_02.png" width="25" alt=""> | ||||
</template> | </template> | ||||
</van-cell> | </van-cell> | ||||
<van-cell title="退出登录" is-link center :border="false"> | |||||
<van-cell title="退出登录" is-link center :border="false" @click = "logOut"> | |||||
<template slot="icon"> | <template slot="icon"> | ||||
<img src="../../assets/images/app/user_icon_03.png" width="25" alt=""> | <img src="../../assets/images/app/user_icon_03.png" width="25" alt=""> | ||||
</template> | </template> | ||||
@@ -40,16 +40,23 @@ | |||||
name: "appUser", | name: "appUser", | ||||
data() { | data() { | ||||
return { | return { | ||||
nickName: null, | |||||
deptName: null | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
this.nickName = this.$store.getters.user.user.nickName; | |||||
this.deptName = this.$store.getters.user.user.dept.deptName; | |||||
}, | }, | ||||
methods: { | methods: { | ||||
goBack(){ | goBack(){ | ||||
history.go(-1) | history.go(-1) | ||||
} | |||||
}, | |||||
logOut() { | |||||
this.$store.dispatch('LogOut').then(() => { | |||||
location.href = '/app/index' | |||||
}) | |||||
}, | |||||
}, | }, | ||||
}; | }; | ||||
</script> | </script> | ||||
@@ -105,7 +105,8 @@ | |||||
<template slot-scope="scope"> | <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-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-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-dropdown size="mini" v-hasPermi="['business:import:remove']"> | ||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button> | <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"> | <div class="el-upload__tip" slot="tip"> | ||||
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的导入任务 | <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的导入任务 | ||||
</div> | </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">2、覆盖导入:指先将所选区划当前在库数据删除,然后按新数据包解析导入;</p> | ||||
<p style="color: red">3、增量导入:指按新数据包解析并追加导入;</p> | <p style="color: red">3、增量导入:指按新数据包解析并追加导入;</p> | ||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link> | <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> | <el-button @click="cancel">取 消</el-button> | ||||
</div> | </div> | ||||
</el-dialog> | </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> | </div> | ||||
</template> | </template> | ||||
<script> | <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 { getToken } from "@/utils/auth" | ||||
import Treeselect from "@riophae/vue-treeselect"; | import Treeselect from "@riophae/vue-treeselect"; | ||||
import {Pane, Splitpanes} from "splitpanes"; | import {Pane, Splitpanes} from "splitpanes"; | ||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css" | import "@riophae/vue-treeselect/dist/vue-treeselect.css" | ||||
import "splitpanes/dist/splitpanes.css" | import "splitpanes/dist/splitpanes.css" | ||||
import { deptTreeSelect } from "@/api/system/user" | import { deptTreeSelect } from "@/api/system/user" | ||||
import {save} from "@/utils"; | |||||
export default { | export default { | ||||
name: "Import", | name: "Import", | ||||
@@ -315,7 +336,11 @@ export default { | |||||
// 上传的地址 | // 上传的地址 | ||||
url: process.env.VUE_APP_BASE_API + "/business/import/importData" | url: process.env.VUE_APP_BASE_API + "/business/import/importData" | ||||
}, | }, | ||||
log: { | |||||
taskId: null, | |||||
logOpen: false, | |||||
logText: '', | |||||
}, | |||||
} | } | ||||
}, | }, | ||||
watch: { | watch: { | ||||
@@ -586,7 +611,60 @@ export default { | |||||
this.selectDeptName = data.label | this.selectDeptName = data.label | ||||
this.handleQuery() | 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> | </script> | ||||
@@ -191,7 +191,7 @@ export default { | |||||
bottom: 0; | bottom: 0; | ||||
width: 100%; | width: 100%; | ||||
text-align: center; | text-align: center; | ||||
color: #fff; | |||||
color: #000000; | |||||
font-family: Arial; | font-family: Arial; | ||||
font-size: 12px; | font-size: 12px; | ||||
letter-spacing: 1px; | letter-spacing: 1px; | ||||
@@ -226,7 +226,7 @@ | |||||
<el-descriptions-item label="实物图"> | <el-descriptions-item label="实物图"> | ||||
<div v-if="!!form.dkImg"> | <div v-if="!!form.dkImg"> | ||||
<el-tooltip effect="light" :content="item" placement="bottom" v-for="(item, index) in form.dkImg.split(',')" :key="index"> | <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> | </el-tooltip> | ||||
</div> | </div> | ||||
</el-descriptions-item> | </el-descriptions-item> | ||||
@@ -332,18 +332,19 @@ | |||||
<div id="mapWrap"></div> | <div id="mapWrap"></div> | ||||
<div id='land-btn-wrap'> | <div id='land-btn-wrap'> | ||||
<el-row> | <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> | </el-row> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div slot="footer" class="dialog-footer"> | <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 type="danger" @click="clearMapLayer">清除图层</el-button> | ||||
<el-button @click="cancelMap">关 闭</el-button> | <el-button @click="cancelMap">关 闭</el-button> | ||||
</div> | </div> | ||||
</el-dialog> | </el-dialog> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
@@ -357,14 +358,13 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css" | |||||
import "splitpanes/dist/splitpanes.css" | import "splitpanes/dist/splitpanes.css" | ||||
import { deptTreeSelect } from "@/api/system/user" | import { deptTreeSelect } from "@/api/system/user" | ||||
import {getConfigKey} from "@/api/system/config"; | 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"; | import $ from "jquery"; | ||||
export default { | export default { | ||||
name: "Land", | name: "Land", | ||||
dicts: ['ownership_type', 'land_use_type', 'survey_status', 'is_common', 'land_grade_type', 'land_type', 'land_use'], | 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() { | data() { | ||||
return { | return { | ||||
// 遮罩层 | // 遮罩层 | ||||
@@ -407,15 +407,13 @@ export default { | |||||
children: "children", | children: "children", | ||||
label: "label" | label: "label" | ||||
}, | }, | ||||
// 遮罩按钮新增点击状态 | |||||
diglogStatus: true, | |||||
//地图 | |||||
//地图参数 | |||||
openMap: false, | openMap: false, | ||||
mapTheGeomId: null, | mapTheGeomId: null, | ||||
mapTheGeom: null, | mapTheGeom: null, | ||||
drawInsert:null, | drawInsert:null, | ||||
tGeoOrganizationLng: null, | |||||
tGeoOrganizationLat: null, | |||||
jingdu: null, | |||||
weidu: null, | |||||
// 查询参数 | // 查询参数 | ||||
queryParams: { | queryParams: { | ||||
pageNum: 1, | pageNum: 1, | ||||
@@ -447,7 +445,6 @@ export default { | |||||
scmjm: [ | scmjm: [ | ||||
{ required: true, message: "实测面积不能为空", trigger: "blur" } | { required: true, message: "实测面积不能为空", trigger: "blur" } | ||||
], | ], | ||||
}, | }, | ||||
// EXCEL导入 | // EXCEL导入 | ||||
upload: { | upload: { | ||||
@@ -464,7 +461,6 @@ export default { | |||||
// 上传的地址 | // 上传的地址 | ||||
url: process.env.VUE_APP_BASE_API + "/resource/land/importData" | url: process.env.VUE_APP_BASE_API + "/resource/land/importData" | ||||
}, | }, | ||||
} | } | ||||
}, | }, | ||||
watch: { | watch: { | ||||
@@ -476,6 +472,7 @@ export default { | |||||
created() { | created() { | ||||
this.getDeptTree() | this.getDeptTree() | ||||
this.getList() | this.getList() | ||||
// 获取geoserver的地址 | // 获取geoserver的地址 | ||||
this.getGeoServerUrl(); | this.getGeoServerUrl(); | ||||
// 获取地块图层名称 | // 获取地块图层名称 | ||||
@@ -500,7 +497,7 @@ export default { | |||||
this.open = false | this.open = false | ||||
this.reset() | this.reset() | ||||
}, | }, | ||||
// 取消按钮 | |||||
// 取消地图按钮 | |||||
cancelMap() { | cancelMap() { | ||||
this.openMap = false; | this.openMap = false; | ||||
this.reset(); | this.reset(); | ||||
@@ -535,7 +532,6 @@ export default { | |||||
deptName: null, | deptName: null, | ||||
sfzwd: '2' | sfzwd: '2' | ||||
} | } | ||||
this.diglogStatus = true; | |||||
this.resetForm("form") | this.resetForm("form") | ||||
}, | }, | ||||
/** 搜索按钮操作 */ | /** 搜索按钮操作 */ | ||||
@@ -772,8 +768,8 @@ export default { | |||||
getDept(deptId).then(response => { | getDept(deptId).then(response => { | ||||
let insertCode = response.data; | let insertCode = response.data; | ||||
if (insertCode != null) { | 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) => { | getInfoByImportCode(row.importCode).then((res) => { | ||||
let insertCode = res.data; | let insertCode = res.data; | ||||
if (insertCode != null) { | if (insertCode != null) { | ||||
this.tGeoOrganizationLat = insertCode.latitude; | |||||
this.tGeoOrganizationLng = insertCode.longitude; | |||||
this.weidu = insertCode.latitude; | |||||
this.jingdu = insertCode.longitude; | |||||
} | } | ||||
const tableRow = { importCode: row.importCode }; | const tableRow = { importCode: row.importCode }; | ||||
listLandQuery(tableRow).then(response => { | listLandQuery(tableRow).then(response => { | ||||
@@ -798,43 +794,40 @@ export default { | |||||
}, | }, | ||||
/** 地图提交按钮 */ | /** 地图提交按钮 */ | ||||
submitFormMap() { | submitFormMap() { | ||||
this.diglogStatus = false; | |||||
if(this.drawInsert !=null && this.drawInsert !=""){ | if(this.drawInsert !=null && this.drawInsert !=""){ | ||||
this.mapTheGeomId.theGeom = JSON.stringify(this.drawInsert); | this.mapTheGeomId.theGeom = JSON.stringify(this.drawInsert); | ||||
}else{ | }else{ | ||||
this.mapTheGeomId.theGeom = this.mapTheGeomId.theGeomText | 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) { | if (this.mapTheGeomId != null) { | ||||
areaSavePri(sysGis).then(response => { | areaSavePri(sysGis).then(response => { | ||||
this.$modal.msgSuccess("修改成功"); | this.$modal.msgSuccess("修改成功"); | ||||
this.openMap = false; | this.openMap = false; | ||||
this.getList(); | |||||
this.diglogStatus = true; | |||||
//this.getList(); | |||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
/** 清除坐标点图层 */ | /** 清除坐标点图层 */ | ||||
clearMapLayer() { | 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 => { | cleanSavePri(sysGis).then(response => { | ||||
this.$modal.msgSuccess("清除成功"); | this.$modal.msgSuccess("清除成功"); | ||||
this.openMap = false; | this.openMap = false; | ||||
this.getList(); | |||||
//this.getList(); | |||||
}); | }); | ||||
}, | }, | ||||
pointDarw(resourceList) { | pointDarw(resourceList) { | ||||
//加载地图编辑 | //加载地图编辑 | ||||
var that = this; | var that = this; | ||||
var map; | var map; | ||||
//var hc_land; | |||||
var draw; // global so we can remove it later | |||||
var draw; | |||||
var vector_drawing; | var vector_drawing; | ||||
var startDarw =false; | var startDarw =false; | ||||
var openDarw = false; | var openDarw = false; | ||||
this.mapTheGeomId = resourceList.find((land) => { | this.mapTheGeomId = resourceList.find((land) => { | ||||
//model就是上面的数据源 | //model就是上面的数据源 | ||||
return land.fid === this.mapTheGeomId.fid; //筛选出匹配数据 | |||||
return land.fid === this.mapTheGeomId.fid; | |||||
}); | }); | ||||
if (this.mapTheGeomId.theGeom != null && this.mapTheGeomId.theGeom != "" | if (this.mapTheGeomId.theGeom != null && this.mapTheGeomId.theGeom != "" | ||||
&& this.mapTheGeomId.theGeom != undefined) { | && this.mapTheGeomId.theGeom != undefined) { | ||||
@@ -844,9 +837,10 @@ export default { | |||||
startDarw = false; | startDarw = false; | ||||
openDarw = true; | openDarw = true; | ||||
} | } | ||||
if (startDarw) { | if (startDarw) { | ||||
document.getElementById("mapWrap").innerHTML = ''; | document.getElementById("mapWrap").innerHTML = ''; | ||||
var hc_land; | |||||
var thePolygon; | |||||
var draw; // global so we can remove it later | var draw; // global so we can remove it later | ||||
var vector_drawing; | var vector_drawing; | ||||
var projection = new ol.proj.Projection({ | var projection = new ol.proj.Projection({ | ||||
@@ -855,7 +849,6 @@ export default { | |||||
units: "degrees", | units: "degrees", | ||||
//extent:extent | //extent:extent | ||||
}); | }); | ||||
var aerial = new ol.layer.Tile({ | var aerial = new ol.layer.Tile({ | ||||
source: new ol.source.XYZ({ | source: new ol.source.XYZ({ | ||||
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + | url: "http://t0.tianditu.gov.cn/img_w/wmts?" + | ||||
@@ -865,7 +858,6 @@ export default { | |||||
isGroup: true, | isGroup: true, | ||||
name: "卫星影像图", | name: "卫星影像图", | ||||
}); | }); | ||||
var yingxzi = new ol.layer.Tile({ | var yingxzi = new ol.layer.Tile({ | ||||
source: new ol.source.XYZ({ | source: new ol.source.XYZ({ | ||||
url: "https://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067", | 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({ | view: new ol.View({ | ||||
//center: ol.proj.fromLonLat([115.452752, 31.789033]), | //center: ol.proj.fromLonLat([115.452752, 31.789033]), | ||||
zoom: 17.8, | zoom: 17.8, | ||||
minZoom: 0, //地图缩小限制 | |||||
maxZoom: 18.3, //地图放大限制 | |||||
minZoom: 0, | |||||
maxZoom: 18.3, | |||||
}), | }), | ||||
}); | }); | ||||
// 添加村边界 | // 添加村边界 | ||||
@@ -899,7 +891,6 @@ export default { | |||||
name: 'villageBorderLayer' | name: 'villageBorderLayer' | ||||
}); | }); | ||||
map.addLayer(mapBorder); | map.addLayer(mapBorder); | ||||
// 添加已经存在的资源图层 | // 添加已经存在的资源图层 | ||||
let vectorSource = new ol.source.Vector(); | let vectorSource = new ol.source.Vector(); | ||||
for (let resource of resourceList) { | for (let resource of resourceList) { | ||||
@@ -911,7 +902,6 @@ export default { | |||||
vectorSource.addFeature(feature); | vectorSource.addFeature(feature); | ||||
} | } | ||||
} | } | ||||
let resourceLayer = new ol.layer.Vector({ | let resourceLayer = new ol.layer.Vector({ | ||||
source: vectorSource, | source: vectorSource, | ||||
style: (feature, resolution) => { | style: (feature, resolution) => { | ||||
@@ -929,8 +919,8 @@ export default { | |||||
} | } | ||||
}); | }); | ||||
map.addLayer(resourceLayer); | map.addLayer(resourceLayer); | ||||
//图层查询定位开始 ---------start | |||||
hc_land = new ol.layer.Vector({ | |||||
//当前图层查询定位 | |||||
thePolygon = new ol.layer.Vector({ | |||||
title: "add Layer", | title: "add Layer", | ||||
source: new ol.source.Vector({ | source: new ol.source.Vector({ | ||||
projection: projection, | 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({ | 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 () { | $("#drawPolygon").off("click").on("click", function () { | ||||
map.removeLayer(hc_land); | |||||
map.removeLayer(thePolygon); | |||||
map.removeLayer(vector_drawing); | map.removeLayer(vector_drawing); | ||||
that.drawInsert = null; | that.drawInsert = null; | ||||
//var source = new ol.source.Vector({wrapX: false}); | //var source = new ol.source.Vector({wrapX: false}); | ||||
@@ -975,7 +962,6 @@ export default { | |||||
source: new ol.source.Vector(), | source: new ol.source.Vector(), | ||||
}); | }); | ||||
map.addLayer(vector_drawing); | map.addLayer(vector_drawing); | ||||
function addInteraction() { | function addInteraction() { | ||||
draw = new ol.interaction.Draw({ | draw = new ol.interaction.Draw({ | ||||
source: vector_drawing.getSource(), | source: vector_drawing.getSource(), | ||||
@@ -990,12 +976,11 @@ export default { | |||||
}); | }); | ||||
map.addInteraction(draw); | map.addInteraction(draw); | ||||
} | } | ||||
addInteraction(); | addInteraction(); | ||||
}); | }); | ||||
//清除画图鼠标点击事件 | //清除画图鼠标点击事件 | ||||
$("#drawRemove").off("click").on("click", function () { | $("#drawRemove").off("click").on("click", function () { | ||||
//map.addLayer(hc_land); | |||||
//map.addLayer(thePolygon); | |||||
map.removeInteraction(draw); | map.removeInteraction(draw); | ||||
//map.removeLayer(vector_drawing); | //map.removeLayer(vector_drawing); | ||||
}); | }); | ||||
@@ -1003,10 +988,11 @@ export default { | |||||
$("#drawReset").off("click").on("click", function () { | $("#drawReset").off("click").on("click", function () { | ||||
map.removeInteraction(draw); | map.removeInteraction(draw); | ||||
map.removeLayer(vector_drawing); | map.removeLayer(vector_drawing); | ||||
map.addLayer(hc_land); | |||||
map.addLayer(thePolygon); | |||||
that.drawInsert = null; | that.drawInsert = null; | ||||
}); | }); | ||||
} | } | ||||
if (openDarw) { | if (openDarw) { | ||||
document.getElementById("mapWrap").innerHTML = ''; | document.getElementById("mapWrap").innerHTML = ''; | ||||
var projection = new ol.proj.Projection({ | var projection = new ol.proj.Projection({ | ||||
@@ -1015,7 +1001,6 @@ export default { | |||||
units: "degrees", | units: "degrees", | ||||
//extent:extent | //extent:extent | ||||
}); | }); | ||||
var aerial = new ol.layer.Tile({ | var aerial = new ol.layer.Tile({ | ||||
source: new ol.source.XYZ({ | source: new ol.source.XYZ({ | ||||
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + | url: "http://t0.tianditu.gov.cn/img_w/wmts?" + | ||||
@@ -1035,9 +1020,8 @@ export default { | |||||
}); | }); | ||||
//获取坐标是否存在 | //获取坐标是否存在 | ||||
var Zb; | 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 { | } else { | ||||
Zb = [115.452752, 31.789033]; | Zb = [115.452752, 31.789033]; | ||||
} | } | ||||
@@ -1069,7 +1053,6 @@ export default { | |||||
name: 'villageBorderLayer' | name: 'villageBorderLayer' | ||||
}); | }); | ||||
map.addLayer(mapBorder); | map.addLayer(mapBorder); | ||||
// 添加已经存在的资源图层 | // 添加已经存在的资源图层 | ||||
let vectorSource = new ol.source.Vector(); | let vectorSource = new ol.source.Vector(); | ||||
for (let resource of resourceList) { | for (let resource of resourceList) { | ||||
@@ -1081,7 +1064,6 @@ export default { | |||||
vectorSource.addFeature(feature); | vectorSource.addFeature(feature); | ||||
} | } | ||||
} | } | ||||
let resourceLayer = new ol.layer.Vector({ | let resourceLayer = new ol.layer.Vector({ | ||||
source: vectorSource, | source: vectorSource, | ||||
style: (feature, resolution) => { | style: (feature, resolution) => { | ||||
@@ -1100,10 +1082,9 @@ export default { | |||||
}); | }); | ||||
map.addLayer(resourceLayer); | map.addLayer(resourceLayer); | ||||
//图层查询定位结束 ---------end | |||||
//开始绘制地图 | //开始绘制地图 | ||||
$("#drawPolygon").off("click").on("click", function () { | $("#drawPolygon").off("click").on("click", function () { | ||||
//map.removeLayer(hc_land); | |||||
//map.removeLayer(thePolygon); | |||||
map.removeLayer(vector_drawing); | map.removeLayer(vector_drawing); | ||||
that.drawInsert = null; | that.drawInsert = null; | ||||
map.removeInteraction(draw); | map.removeInteraction(draw); | ||||
@@ -1130,20 +1111,21 @@ export default { | |||||
}); | }); | ||||
map.addInteraction(draw); | map.addInteraction(draw); | ||||
} | } | ||||
addInteraction(); | addInteraction(); | ||||
}); | }); | ||||
//清除画图鼠标点击事件 | //清除画图鼠标点击事件 | ||||
$("#drawRemove").off("click").on("click", function () { | $("#drawRemove").off("click").on("click", function () { | ||||
//map.addLayer(hc_land); | |||||
//map.addLayer(thePolygon); | |||||
map.removeInteraction(draw); | map.removeInteraction(draw); | ||||
//map.removeLayer(vector_drawing); | //map.removeLayer(vector_drawing); | ||||
}); | }); | ||||
//还原之前图层 | //还原之前图层 | ||||
$("#drawReset").off("click").on("click", function () { | $("#drawReset").off("click").on("click", function () { | ||||
map.removeInteraction(draw); | map.removeInteraction(draw); | ||||
map.removeLayer(vector_drawing); | map.removeLayer(vector_drawing); | ||||
//map.addLayer(hc_land); | |||||
//map.addLayer(thePolygon); | |||||
that.drawInsert = null; | that.drawInsert = null; | ||||
}); | }); | ||||
} | } | ||||
@@ -1156,6 +1138,7 @@ export default { | |||||
height: 75vh; | height: 75vh; | ||||
overflow-y: scroll; | overflow-y: scroll; | ||||
} | } | ||||
#land-btn-wrap { | #land-btn-wrap { | ||||
position: relative; | position: relative; | ||||
width: 40%; | width: 40%; | ||||
@@ -1163,7 +1146,6 @@ export default { | |||||
bottom: 95%; | bottom: 95%; | ||||
z-index: 2000; | z-index: 2000; | ||||
} | } | ||||
#mapWrap { | #mapWrap { | ||||
width: 100%; | width: 100%; | ||||
height: 100%; | height: 100%; | ||||
@@ -10,7 +10,7 @@ const CompressionPlugin = require('compression-webpack-plugin') | |||||
const name = process.env.VUE_APP_TITLE | const name = process.env.VUE_APP_TITLE | ||||
//const baseUrl = 'http://localhost:8080' // 后端接口 | //const baseUrl = 'http://localhost:8080' // 后端接口 | ||||
const baseUrl = 'http://192.168.0.109:8080' // 后端接口 zzl | |||||
const baseUrl = 'http://192.168.0.106:8080' // 后端接口 zzl | |||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口 | const port = process.env.port || process.env.npm_config_port || 80 // 端口 | ||||