08c74968 by weimo934

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/zd/zddcb/index.vue
2 parents d078f4cd 9aa4e12e
......@@ -23,7 +23,15 @@
"color": "#f50325",
"width": 1
}
},
"importSymbol": {
"type": "simple-fill",
"color": [ 245,3, 37, 0.4 ],
"style": "none",
"outline": {
"color": "#006cff",
"width": 2
}
}
}
}
\ No newline at end of file
......
......@@ -284,6 +284,7 @@
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
@blur="inputBlur($event,true)"
@input="startTime(index,childIndex)"
>
</el-date-picker>
......@@ -332,6 +333,7 @@
value-format="yyyy-MM-dd"
:picker-options="childItem.pickerEnd"
placeholder="选择日期"
@blur="inputBlur($event,true)"
@input="endTime(index,childIndex)"
>
</el-date-picker>
......@@ -429,7 +431,6 @@ export default {
},
created() {},
mounted(){
console.log(this.formData,'formData');
},
methods: {
startTime(index,childIndex){
......@@ -452,7 +453,6 @@ export default {
}
},
sumTime(index,childIndex,syqx,e){
console.log(e,'eeee');
this.$refs.syqx.forEach((item,index)=>{
if(item.value == syqx){
this.$refs.tdsyjssj[index].$el.style.border=""
......@@ -567,13 +567,10 @@ export default {
});
},
getQlxzDataList() {
console.log(this.countList,'this.countList');
return this.countList;
},
getRules(){
let rules = [];
console.log(this.$refs.tdsyqssj,'this.$refs.qlxzdm');
console.log(this.countList,'this.countList');
let temp = 0;
this.countList.forEach((item,index)=>{
rules.push({
......@@ -599,9 +596,6 @@ export default {
rule: /^\s*$/g, //非空
},
)
if (ind == item.list.length-1) {
temp += item.list.length;
}
if(this.hasSyqx){
rules.push(
{
......@@ -613,6 +607,9 @@ export default {
}
)
}
if (ind == item.list.length-1) {
temp += item.list.length;
}
})
})
this.rulesResult = true;
......@@ -664,6 +661,18 @@ export default {
// },
},
watch:{
countList: {
handler : function (newVal, oldVal) {
newVal.forEach((item,ind)=>{
if(item.qlxzdm != ''){
this.$refs.qlxzdm[ind].$el.style.border=""
}
})
},
deep:true
} ,
}
};
</script>
<style lang="less">
......
......@@ -175,7 +175,27 @@ export default {
// 左键双击事件
dbclick(item) {
clearTimeout(this.time);
if(item.type == 'zd' || item.type == 'zrz' ||item.type == 'dz'){
//此处不要将$router移到if的外面,因为可能是双击行政区,就不知道去哪儿了
if (item.type == 'zd') {
this.$store.state.zdbsm = item.bsm;
this.$router.push({
path: '/'+item.type,
query:{
source: 2,
bsm:item.bsm
}
});
}else if(item.type == 'zrz'){
this.$store.state.zrzbsm = item.bsm;
this.$router.push({
path: '/'+item.type,
query:{
source: 2,
bsm:item.bsm
}
});
}else if(item.type == 'dz'){
this.$store.state.dzbsm = item.bsm;
this.$router.push({
path: '/'+item.type,
query:{
......@@ -184,22 +204,6 @@ export default {
}
});
}
// if (item.type == 'zd') {
// this.$router.push({
// path: '/zd',
// query:{
// source: 2,
// bsm:item.bsm
// }
// });
// }else if(item.type == 'zrz'){
// this.$router.push({
// path: '/zrz',
// query:{
// bsm:item.bsm
// }
// });
// }
},
closeMenu() {
this.$emit("changeVisible", false);
......
......@@ -101,7 +101,8 @@
<li v-show="zdData.type == 'zdy'" @click="deleteZdy">删除</li>
</ul>
<el-dialog title="导入图形" :visible.sync="improtDialog">
<!--@close="closeImportDialog"-->
<el-dialog title="导入图形" :modal="false" :close-on-click-modal="false" custom-class="importDialog" :visible.sync="improtDialog" width="30%" @close="closeImportDialog">
<import-geo :property-info="zdData" :timeLine="new Date().getTime()" :geo-info="currentClickZdGeo" @closeImportDialog="closeImportDialog"></import-geo>
</el-dialog>
<!-- 添加定着物弹框 -->
......@@ -263,6 +264,8 @@ export default {
this.$store.state.zdbsm = this.zdData.zdbsm;
if(this.zdData.type == 'dz'){
this.$store.state.dzbsm = this.zdData.bsm;
}else{
this.$store.state.dzbsm = '';
}
},
//关闭添加定着物弹框
......@@ -439,6 +442,7 @@ export default {
}else {
BSM = this.zdData.bsm;
}
//当确定导入图形是 跳转到图形界面
this.queryGeoByBsm(BSM,type,function (features){
if(features && features.length > 0){
if(features[0].geometry){
......@@ -447,6 +451,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
self.postionToMap();
self.improtDialog = true;
self.currentClickZdGeo = features[0];
}).catch(() => {
......@@ -456,11 +461,13 @@ export default {
});
});
}else {
self.postionToMap();
self.currentClickZdGeo = features[0];
self.improtDialog = true;
}
}else{
self.postionToMap();
self.currentClickZdGeo = null;
self.improtDialog = true;
}
......@@ -509,7 +516,6 @@ export default {
}).then(res => {
debugger
});*/
}else{
self.$message.warning("暂无空间信息!!!!");
}
......@@ -583,6 +589,7 @@ export default {
//关闭图形弹框
closeImportDialog(){
this.improtDialog = false;
this.clearOverLayer();
}
},
......@@ -731,4 +738,8 @@ export default {
center;
background-size: contain;
}
/deep/ .importDialog{
margin-top: 120px!important;
margin-left: 291px;
}
</style>
......
<template>
<div >
<div v-if="!resultDialog && !txtResultDialog" class="importDiv">
<div v-if="!resultDialog && !txtResultDialog && !dealDialog" class="importDiv">
<el-upload
class="upload-demo"
action="#"
......@@ -108,7 +108,7 @@
{ required: true, message: '请选择地块', trigger: 'change' },
]"
>
<el-select v-model="txtZd.name" filterable placeholder="请选择">
<el-select v-model="txtZd.name" filterable placeholder="请选择" @change="txtChange">
<el-option
v-for="(item,index) in txtResult"
:key="index"
......@@ -123,6 +123,30 @@
</el-form-item>
</el-form>
</div>
<div v-if="dealDialog">
<el-form :model="dealForm" ref="dealForm" label-width="100px" size="small" @submit.native.prevent class="demo-ruleForm">
<el-form-item
label="处理方法"
prop="method"
:rules="[
{ required: true, message: '请选择', trigger: 'change' },
]"
>
<el-select v-model="dealForm.method" filterable placeholder="请选择">
<el-option
v-for="(item,index) in dealMethods"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitDealForm('dealForm')">确定</el-button>
<el-button @click="cancelDealForm('dealForm')">取消</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
......@@ -157,6 +181,25 @@ export default {
txtResultDialog:null,
txtZd:{
name:""
},
overResults:[],//与导入宗地重叠的地块
currntDealGraphic:null,
dealMethods:[{
label:"不做处理",
value:"1"
},{
label:"删除叠加部分",
value:"2"
},{
label:"删除已重叠部分",
value:"3"
},{
label:"删除原图形",
value:"4"
}],
dealDialog:false,
dealForm:{
method:""
}
}
},
......@@ -167,6 +210,7 @@ export default {
timeLine(newValue,oldValue){
this.resultDialog = false;
this.txtResultDialog = false;
this.dealDialog = false;
}
},
methods:{
......@@ -268,11 +312,7 @@ export default {
attributes:null,
geometry:geometry
}
if(self.propertyInfo.type == "zd"){
self.saveZd(graphic);
}else{
self.saveZRZ(graphic);
}
self.checkGeo(graphic);
}else{
this.$message.warning(response.message);
}
......@@ -291,25 +331,95 @@ export default {
graphic.geometry.spatialReference = {
wkt:wkt
}
self.checkGeo(graphic);
}else{
console.log('error submit!!');
return false;
}
})
},
txtChange(value){
var wkt = "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]";
var graphics = self.txtResult.filter(item => {
return item.attributes.name == value;
})
var graphic = graphics[0];
graphic.geometry.type = "polygon";
graphic.geometry.spatialReference = {
wkt:wkt
}
this.addOverLayer(graphic.geometry,[]);
},
//校验空间完整性
checkGeo(graphic){
var self = this;
//校验完整性 直接调用空间方法 提交空间表
self.geoJoint(geometry,function (isJoint,message) {
self.geoJoint(graphic.geometry,function (isJoint,message) {
if(isJoint){
self.$message.warning(message)
return;
}else {
if(self.propertyInfo.type == "zd"){
var type = self.propertyInfo.type;
if(type == 'zd'){
//重叠分析
self.zdOverAnalys(self.propertyInfo.zdbsm,graphic,function (flag,results) {
if(flag){
self.$message.warning("导入的宗地与其他宗地有重叠,请处理!!");
self.dealOverData(results,graphic);
}else {
self.saveZd(graphic);
}else{
}
});
}else {
self.zrzOverAnalys(this.propertyInfo.bsm,graphic,function (flag,mes) {
if(flag){
self.$message.warning(mes);
return;
}else {
self.saveZRZ(graphic);
}
});
}
}
});
}else{
},
//选择处理方式
submitDealForm(formName){
var self = this;
this.$refs[formName].validate((valid) => {
if(valid){
//选择处理方式
var value = self.dealForm.method;
switch (value) {
case '1':self.currntDealGraphic.attributes.BGZT =1;self.saveZd(self.currntDealGraphic);break;
case "2":self.getDifference(self.currntDealGraphic,self.overResults,self.delOverGeo);break;
case "3":self.getResultsDif(self.overResults,self.currntDealGraphic,self.delOtherGeo,true);break;
case "4":self.getResultsDif(self.overResults,self.currntDealGraphic,self.delOtherGeo,false);break;
}
}else {
console.log('error submit!!');
return false;
}
})
},
//裁剪自己在保存
delOverGeo(geometry){
this.currntDealGraphic.attributes.BGZT =2;
if(geometry == null){
this.$message.warning("完全重叠,已删除图形信息!!!")
this.currntDealGraphic.geometry = geometry;
}
this.saveZd(this.currntDealGraphic);
},
//裁剪别的在保存
delOtherGeo(results){
//执行编辑操作
var layer = this.getLayerByName("ZDJBXX");
var featureUrl = layer.layerUrl.replace("MapServer","FeatureServer");
featureUrl += "/"+layer.id;
this.updateGraphic(featureUrl,results);
this.saveZd(this.currntDealGraphic);
},
//下载文档模板
downloadFile(url,fileName){
let link = document.createElement("a");
......@@ -336,25 +446,20 @@ export default {
attributes:self.currentClickZd,
geometry:geometry
}
self.geoJoint(geometry,function (isJoint,message) {
if(isJoint){
self.$message.warning(message)
return;
}else {
if(self.propertyInfo.type == "zd"){
self.saveZd(graphic);
}else{
self.saveZRZ(graphic);
}
}
});
self.checkGeo(graphic);
} else {
console.log('error submit!!');
return false;
}
});
},
dealOverData(results,graphic){
this.overResults = results;
this.currntDealGraphic = graphic;
this.resultDialog = false;
this.txtResultDialog = false;
this.dealDialog = true;
},
saveZd(graphic){
var self = this;
var points = null,lines = null,
......@@ -363,6 +468,9 @@ export default {
featureUrl += "/"+layer.id;
if(self.geoInfo){
//替换 生成图像 高亮
if(graphic.attributes && graphic.attributes.BGZT){
self.geoInfo.attributes.BGZT = graphic.attributes.BGZT;
}
self.geoInfo.attributes.BSM = this.propertyInfo.zdbsm;
self.geoInfo.attributes.ZDDM = this.propertyInfo.zddm;
self.geoInfo.attributes.XMMC = this.propertyInfo.mc;
......@@ -374,6 +482,7 @@ export default {
var updResult = res.updateFeatureResults[0];
if(updResult.objectId){
var OBJECTID = updResult.objectId;
if(graphic.geometry){
points = self.craetJZPoint(graphic);
self.savejzd(points)
//生成边框线
......@@ -381,27 +490,36 @@ export default {
lines = res;
self.saveJzx(lines);
});
}
self.$message.success("保存成功!!!");
self.goMap();
}
});
}else{
//生成图像 保存
graphic.attributes = {
var attributes = {
BSM:this.propertyInfo.zdbsm,
ZDDM:this.propertyInfo.zddm,
XMMC:this.propertyInfo.mc
};
if(graphic.attributes && graphic.attributes.BGZT){
attributes.BGZT = graphic.attributes.BGZT;
}
graphic.attributes = attributes;
self.addGraphic(featureUrl,graphic,function (res) {
var addRresult = res.addFeatureResults[0];
if(addRresult.objectId){
var OBJECTID = addRresult.objectId;
if(graphic.geometry) {
points = self.craetJZPoint(graphic);
self.savejzd(points)
//生成边框线
self.createJZLine(graphic,function (res){
self.createJZLine(graphic, function (res) {
lines = res;
self.saveJzx(lines);
});
}
self.$message.success("保存成功!!!");
self.goMap();
}
});
......@@ -459,12 +577,13 @@ export default {
var featureUrl = layer.layerUrl.replace("MapServer","FeatureServer");
featureUrl += "/"+layer.id;
if(self.geoInfo){
self.geoInfo.BSM = this.propertyInfo.bsm;
self.geoInfo.BSM = self.propertyInfo.bsm;
graphic.attributes = self.geoInfo;
//替换 生成图像 高亮
self.updateGraphic(featureUrl,graphic,function (res) {
var addRresult = res.updateFeatureResults[0];
if(addRresult.objectId) {
self.$message.success("保存成功!!!");
self.goMap();
}
});
......@@ -478,12 +597,13 @@ export default {
self.addGraphic(featureUrl,graphic,function (res) {
var addRresult = res.addFeatureResults[0];
if(addRresult.objectId) {
self.$message.success("保存成功!!!");
self.goMap();
}
});
}
},
//操作成功跳转
//操作成功不需要跳转地图 (直接定位新导入的图形)
goMap(){
var bsm = "", type = this.propertyInfo.type;
if(type == "zd"){
......@@ -492,35 +612,46 @@ export default {
bsm = this.propertyInfo.bsm;
}
this.resultDialog = false;
this.txtResultDialog = false;
this.dealDialog = false;
this.$emit("closeImportDialog");
var curretRouterInfo = {
path: this.$route.path,
query: this.$route.query
}
sessionStorage.setItem("curretRouterInfo", JSON.stringify(curretRouterInfo));
this.$router.push({
path: "/viewMap",
query: {
bsm: bsm,
type: this.propertyInfo.type
}
});
//TODO 定位当前新导入的图形
this.addGeoByBsm(bsm,type,"testMap");
},
//取消
cancel(){
this.zdForm.zdBsm = "";
this.currentClickZd = null;
this.resultDialog = false;
// 清空当前图层上显示的图形
this.clearOverLayer();
},
//取消文本选择的弹出框
cancelTxtForm(){
this.txtZd.name = "";
this.txtResultDialog = false;
// 清空当前图层上显示的图形
this.clearOverLayer();
},
//取消导入处理的结果
cancelDealForm(){
this.dealForm.method = "";
this.dealDialog = false;
this.overResults = [];
// 清空当前图层上显示的图形
this.clearOverLayer();
},
//宗地选择发生改变
zdChange(value){
this.zdForm.zdBsm = value.XMMC;
this.currentClickZd = value;
var geometry = this.parseWktToArc(this.currentClickZd.wkt);
geometry.type = "polygon";
var wkt = "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]";
geometry.spatialReference = {
wkt:wkt
}
this.addOverLayer(geometry,[]);
}
}
}
......
......@@ -10,6 +10,7 @@ import featureUpdate from "@libs/map/featureUpdate";
import arcgisParser from 'terraformer-arcgis-parser'
import wktParse from 'terraformer-wkt-parser'
import {maps} from '@/libs/map/mapUtils'
import graphicSymbol from '@/assets/json/graphicSymbol.json'
export default {
data(){
......@@ -197,8 +198,9 @@ export default {
}
for(var i = 0;i < results.length;i++){
var feature = results[i].feature;
var flag = geometryEngine.disjoint(polygon,feature.geometry);
if(flag){
var flag = geometryEngine.intersects(polygon,feature.geometry);
var withinFlag = geometryEngine.within(polygon,feature.geometry);
if(!withinFlag && flag){
isJoint = true;
layerName = results[i].layerName;
switch (layerName) {
......@@ -244,7 +246,260 @@ export default {
featureUpdate.methods.addGraphic(featureUrl,graphic,callBackFunction) ;
}
});
},
//叠加分析 同一个图层的叠加分析
zdOverAnalys(bsm,graphic,callBacFunction){
var self = this;
loadModules([
"esri/geometry/Polygon"
]).then(([
Polygon
]) => {
var zdLayer = null;
zdLayer = self.getLayerByName("ZDJBXX");
var layerIds = [];
layerIds.push(zdLayer.id);
var polygon = new Polygon(graphic.geometry);
identifyUtils.methods.identify(zdLayer.layerUrl,layerIds,polygon,function (res) {
var results = res.results;
//判断数据是否与其他数据有重叠
var flag = false;
if(results && results.length > 0){
flag = true;
//加载在图层上 原本的要导入的数据 和重叠数据
self.addOverLayer(polygon,results);
}
callBacFunction(flag,results);
},true)
}).catch(err => {
console.log(err);
throw (err);
})
},
//添加添加元素和覆盖的元素到地图上
addOverLayer(geometry,results){
var view = maps["testMap"];
loadModules([
"esri/Graphic",
"esri/layers/GraphicsLayer",
"esri/geometry/geometryEngineAsync",
"esri/geometry/Extent"
]).then(([
Graphic,
GraphicsLayer,
geometryEngineAsync,
Extent
])=>{
var graphic = new Graphic({
geometry:geometry
})
var layer = view.map.findLayerById("overLayer");
if(layer){
layer.removeAll();
}else {
layer = new GraphicsLayer({
id:"overLayer"
})
view.map.add(layer);
}
var impotSymbol = graphicSymbol.fillSymbol.importSymbol,
defaultSymbol = graphicSymbol.fillSymbol.defaultSymbol;
for(var i = 0;i < results.length;i++){
var feature = results[i].feature;
feature.symbol = defaultSymbol;
layer.add(feature);
var geo = geometryEngineAsync.intersect(feature.geometry,geometry);
geo.then(function (res) {
var interGra = new Graphic({
geometry:res,
symbol:graphicSymbol.fillSymbol.highlightSymbol
})
layer.add(interGra);
})
}
graphic.symbol = impotSymbol
layer.add(graphic);
var extent = new Extent(JSON.parse(JSON.stringify(graphic.geometry.extent)))
extent.spatialReference = view.spatialReference;
view.extent = extent;
}).catch(err => {
console.log(err);
})
},
clearOverLayer(){
var view = maps["testMap"];
var layer = view.map.findLayerById("overLayer");
if(layer){
layer.removeAll();
}
},
//自然幢叠加分析 不能跨宗地 图层本身的叠加分析
zrzOverAnalys(bsm,graphic,callBacFunction){
var self = this;
loadModules([
"esri/geometry/Polygon",
"esri/geometry/geometryEngine"
]).then(([
Polygon,
geometryEngine
]) => {
var polygon = new Polygon(graphic.geometry);
var zdLayer = null,
zrzLayer = null;
zdLayer = self.getLayerByName("ZDJBXX");
zdLayer = self.getLayerByName("ZRZ");
var layerIds = [];
layerIds.push(zdLayer.id);
layerIds.push(zrzLayer.id);
identifyUtils.methods.identify(zdLayer.layerUrl,layerIds,polygon,function (res) {
var results = res.results;
//判断数据是否与其他数据有重叠
var flag = false,
mesge = "";
if(results && results.length > 0){
for(var i = 1;i < results.length;i++){
var feature = results[i].feature,
layerName = results[i].layerName;
if(layerName == 'ZRZ'){
if(feature.attributes['标识码'] != bsm){
var interFlag = geometryEngine.intersects(polygon,feature.geometry);
if(interFlag){
flag = true;
mesge="导入的自然幢与其他自然幢重叠,不能导入!!!";
break;
}
}
}else {
var interFlag = geometryEngine.intersects(polygon,feature.geometry);
var withinFlag = geometryEngine.within(polygon,feature.geometry);
if(!withinFlag && interFlag){
flag = true;
mesge="导入的自然幢与其跨宗地,不能导入!!!";
break;
}
}
}
}
callBacFunction(flag,mesge);
},true)
}).catch( err => {
console.log(err);
})
},
//去除重叠部分
getDifference(inputGraphic,subGraphic,callBackFuncton){
loadModules([
"esri/geometry/Polygon",
"esri/geometry/geometryEngine",
"esri/Graphic"
]).then(([
Polygon,
geometryEngine,
Graphic
])=>{
var inputGeometry = new Polygon(inputGraphic.geometry);
var outGeometry = null;
for(var i = 0;i < subGraphic.length;i++){
var feature = subGraphic[i].feature;
outGeometry = geometryEngine.difference(inputGeometry,feature.geometry);
}
if(callBackFuncton && typeof callBackFuncton == 'function'){
callBackFuncton(outGeometry);
}
}).catch(err => {
console.log(err);
})
},
//业务处理 先用query方法 查询将所有属性查询 在做空间裁剪
getResultsDif(subGraphics,currntGraphic,callBackFunction,flag){
var self = this;
loadModules([
"esri/geometry/geometryEngine",
"esri/geometry/Polygon"
]).then(([
geometryEngine,
Polygon
]) => {
var objectIds = [];
subGraphics.filter(item => {
objectIds.push(item.feature.attributes.OBJECTID);
})
var inputGeometry = new Polygon(currntGraphic.geometry);
var zdLayer = self.getLayerByName("ZDJBXX");
queryUtils.methods.queryByWhere(zdLayer.layerUrl+"/"+zdLayer.id,{OBJECTID:objectIds},null,true,"",subGraphics[0].feature.geometry.spatialReference,function (result) {
var features = result.features;
if(flag){
for(var i = 0;i < features.length;i++){
features[i].geometry = geometryEngine.difference(features[i].geometry,inputGeometry);
features[i].attributes.BGZT = 3;
}
}else {
for(var i = 0;i < features.length;i++){
features[i].geometry = null;
features[i].attributes.BGZT = 4;
}
}
if(callBackFunction && typeof callBackFunction == 'function'){
callBackFunction(features);
}
})
}).catch(err=>{
console.log(err);
})
},
addGeoByBsm(bsm, type,viewId) {
var self = this;
var layer = null;
if (type == 'zd') {
layer = this.getLayerByName("ZDJBXX");
} else if (type == 'zrz') {
layer = this.getLayerByName("ZRZ");
} else {
console.log("未定义类型!!");
return;
}
if (!layer) {
console.log("没有找到图层,不能查询");
return;
}
queryUtils.methods.queryByWhere(layer.layerUrl+"/"+layer.id, {"BSM": bsm }, null, true, null, null, function (res) {
var features = res.features;
if(features && features.length > 0){
if( !features[0].geometry ){
self.$message.success("暂无图形信息!!");
return;
}
loadModules([
"esri/layers/GraphicsLayer"
]).then( ([
GraphicsLayer
]) => {
var view = maps[viewId];
var layer = view.map.findLayerById("highlightLayer");
if(layer){
layer.removeAll();
}else {
layer = new GraphicsLayer({
id:"highlightLayer"
})
view.map.add(layer,5);
}
var symbol = graphicSymbol.fillSymbol.highlightSymbol;
var graphic = features[0];
graphic.symbol = symbol;
layer.add(graphic);
view.extent = graphic.geometry.extent;
}).catch( err => {
thow(err);
})
}else {
self.$message.success("暂无图形信息!!");
return;
}
});
}
}
}
\ No newline at end of file
......
......@@ -38,14 +38,13 @@
esriMap
]) => {
var map = new esriMap({
basemap:"hybrid"
basemap:"osm"
});
//108.95 34.27
var view = new MapView({
container: self.viewId,
map: map,
zoom:10,
zoom:10,
center: [-0.154133333770497,0.6138183594020817],
spatialReference: {
wkid: 102100
......
......@@ -24,7 +24,7 @@ export default {
identifyParameters.tolerance = tolerance ? tolerance : 3;
identifyParameters.mapExtent = mapExtent ? mapExtent : geometry.extent;
identifyParameters.returnGeometry = returnGeometry ? returnGeometry : false;
//identifyParameters.returnFieldName = false;
//identifyParameters.returnFieldName = true;
identifyParameters.spatialReference = geometry.spatialReference;
identifyTask.execute(identifyParameters).then(result => {
if(callBackFunction && typeof callBackFunction == 'function'){
......
......@@ -22,20 +22,29 @@ export default {
var featureLayer = new FeatureLayer({
url:url
})
var saveGraphics = [];
if(!Array.isArray(graphic)){
graphic = [graphic];
}
for(var i = 0;i < graphic.length;i++){
var geo = null;
if(graphic.geometry.type == 'point'){
geo = new Point(graphic.geometry);
}else if(graphic.geometry.type == 'polyline'){
geo = new Polyline(graphic.geometry);
}else if(graphic.geometry.type == 'polygon'){
geo = new Polygon(graphic.geometry);
if(!graphic[i].geometry){
geo = null;
}else if(graphic[i].geometry.type == 'point'){
geo = new Point(graphic[i].geometry);
}else if(graphic[i].geometry.type == 'polyline'){
geo = new Polyline(graphic[i].geometry);
}else if(graphic[i].geometry.type == 'polygon'){
geo = new Polygon(graphic[i].geometry);
}
var saveGraphic = new Graphic({
attributes:graphic.attributes,
attributes:graphic[i].attributes,
geometry:geo
});
saveGraphics.push(saveGraphic);
}
featureLayer.applyEdits({
addFeatures:[saveGraphic]
addFeatures:saveGraphics
}).then(function (res){
if(callBackFunction && typeof callBackFunction == 'function'){
callBackFunction(res);
......@@ -62,20 +71,30 @@ export default {
var featureLayer = new FeatureLayer({
url:url
})
var updGraphics = [];
if(!Array.isArray(graphic)){
graphic = [graphic];
}
for(var i = 0;i < graphic.length;i++){
var geo = null;
if(graphic.geometry.type == 'point'){
geo = new Point(graphic.geometry);
}else if(graphic.geometry.type == 'polyline'){
geo = new Polyline(graphic.geometry);
}else if(graphic.geometry.type == 'polygon'){
geo = new Polygon(graphic.geometry);
if(!graphic[i].geometry){
geo = new Polygon();
}else if(graphic[i].geometry.type == 'point'){
geo = new Point(graphic[i].geometry);
}else if(graphic[i].geometry.type == 'polyline'){
geo = new Polyline(graphic[i].geometry);
}else if(graphic[i].geometry.type == 'polygon'){
geo = new Polygon(graphic[i].geometry);
}
var updGraphic = new Graphic({
attributes:graphic.attributes,
attributes:graphic[i].attributes,
geometry:geo
});
updGraphics.push(updGraphic);
}
featureLayer.applyEdits({
updateFeatures:[updGraphic]
updateFeatures:updGraphics
}).then(function (res){
if(callBackFunction && typeof callBackFunction == 'function'){
callBackFunction(res);
......@@ -102,21 +121,31 @@ export default {
var featureLayer = new FeatureLayer({
url:url
})
var delGraphics = [];
if(!Array.isArray(graphic)){
graphic = [graphic];
}
for(var i = 0;i < graphic.length;i++){
var geo = null;
if(graphic.geometry.type == 'point'){
geo = new Point(graphic.geometry);
}else if(graphic.geometry.type == 'polyline'){
geo = new Polyline(graphic.geometry);
}else if(graphic.geometry.type == 'polygon'){
geo = new Polygon(graphic.geometry);
if(!graphic[i].geometry){
geo = null;
}else if(graphic[i].geometry.type == 'point'){
geo = new Point(graphic[i].geometry);
}else if(graphic[i].geometry.type == 'polyline'){
geo = new Polyline(graphic[i].geometry);
}else if(graphic[i].geometry.type == 'polygon'){
geo = new Polygon(graphic[i].geometry);
}
var delGraphic = new Graphic({
attributes:graphic.attributes,
attributes:graphic[i].attributes,
geometry:geo
});
delGraphics.push(delGraphic);
}
featureLayer.applyEdits({
deleteFeatures:[delGraphic]
deleteFeatures:delGraphics
}).then(function (res){
if(callBackFunction && typeof callBackFunction == 'function'){
callBackFunction(res);
......
......@@ -28,7 +28,7 @@ export default{
where += " and ";
}
if(Array.isArray(parames[i].value)){
where += parames[i].name + " in (" + parames[i].value.toString + ")";
where += parames[i].name + " in (" + parames[i].value.toString() + ")";
}else if(typeof parames[i].value == 'number'){
where += parames[i].name + " =" + parames[i].value ;
}else{
......
......@@ -169,6 +169,8 @@ export default {
this.getRightTreeByZrzbsm(this.$store.state.zrzbsm);
}else if(newPath == "/dz"){
this.getRightTreeByDzbsm(this.$store.state.dzbsm);
}else if(newPath == "/h"){
this.getRightTreeByHbsm(this.$store.state.hbsm);
} else if(newPath == "/viewMap"){
this.isMap = true;
if(this.$route.query.type == "zd"){
......@@ -329,6 +331,14 @@ export default {
});
},
getRightTreeByHbsm(bsm) {
getTreeByBsm(bsm,"h").then((res) => {
if (res.success) {
this.pd = res.result;
}
});
},
sortNavigation(data, selectId) {
let headTop = this.headTop;
data.forEach((item, index) => {
......
......@@ -290,8 +290,9 @@ export default {
//todo 在新增时,如果是点击顶部新建里面的自然幢则不传zdbsm 如果是点击右键里面的添加定着物则传zdbsm
this.$refs['ruleForm1'].validate((valid) => {
if (valid) {
this.ruleForm1.zdbsm = this.$store.state.zdbsm != '' ? this.$store.state.zdbsm : '';
this.ruleForm1.dzbsm = this.$store.state.dzbsm != '' ? this.$store.state.dzbsm : '';
this.ruleForm1.zdbsm = this.auth ? this.$store.state.zdbsm : '';
this.ruleForm1.dzbsm = this.auth ? this.$store.state.dzbsm : '';
insertZrzjbxx(this.ruleForm1)
.then((res) => {
if (res.code == "200") {
......
......@@ -6,6 +6,7 @@
:data="tableData"
:height="tableHeight"
:row-class-name="tableRowClassName"
@row-dblclick="doubleClick"
>
<el-table-column type="index" width="80" align="center" label="序号">
</el-table-column>
......@@ -81,6 +82,9 @@
methods: {
onSubmit() {
},
doubleClick(row, column, event){
this.handleClick(row);
},
tableRowClassName({row, rowIndex}) {
if (rowIndex % 2 !== 0) {
return "even-row";
......
......@@ -76,15 +76,20 @@ export default {
},
mixins:[mapLayerManager,findTask],
mounted(){
var query = this.$route.query;
var query = this.$route.query
var self = this;
setTimeout(function () {
if(query && JSON.stringify(query) != "{}"){
//self.addGeoByBsm(query.bsm,query.type,self.viewId);
if(query.type == 'zd'){
this.getRightTree(query.bsm)
self.getRightTree(query.bsm)
}else if(query.type == 'zrz'){
this.getRightTreeByZrzbsm(query.bsm);
self.getRightTreeByZrzbsm(query.bsm);
}
}
},500);
},
methods:{
......@@ -93,9 +98,9 @@ export default {
var view = maps[this.viewId];
view.ui.remove('zoom');
loadModules([
"esri/layers/MapImageLayer",
"esri/layers/MapImageLayer"
]).then(([
MapImageLayer,
MapImageLayer
])=>{
var mapImageLayer = new MapImageLayer({
url:self.layerUrl,
......@@ -137,9 +142,11 @@ export default {
},
//图层选择事件
selectLayerChange(){
debugger
var self = this;
this.features = [];
var layerAndResult = this.results.filter(function (item) {
return item.layerId = self.selectResLayerId;
return item.layerId == self.selectResLayerId;
})
if(layerAndResult){
this.features = layerAndResult[0].features;
......
......@@ -79,12 +79,12 @@ export default {
return;
}
for(var i = 0;i < searchResult.length;i++){
var layer = view.map.findLayerById("searchResult"+searchResult.layerName);
var layer = view.map.findLayerById("searchResult"+searchResult[i].layerId);
if(layer){
layer.removeAll();
}else{
layer = new GraphicsLayer({
id:"searchResult"+searchResult.layerName
id:"searchResult"+searchResult[i].layerId
})
view.map.add(layer);
}
......
......@@ -627,7 +627,6 @@ export default {
updateZDxx(formData) {
//获取权利性质数据
this.formData.list = this.$refs.qlxzModule.getQlxzDataList();
this.$refs.qlxzModule.getRules();
console.log(this.$refs.qlxzModule.getRulesResult(),'this.$refs.qlxzModule.getRules()');
//判断容密高是否为区间值,如果是区间值,则将输入框的值赋予
this.formData.jyrjl = this.isInterval(this.formData.jyrjl) ? this.rjl : this.formData.jyrjl;
......@@ -689,14 +688,8 @@ export default {
rule: /^\s*$/g, //非空
},
]
//判断宗地代码和不动产单元号是否手动修改过(宗地代码和不动产单元号的前14位是否和底盘代码一致)
if(this.formData.zddm.substring(0,14) != this.dpdm || this.formData.bdcdyh.substring(0,14) != this.dpdm){
this.$message({
message: '宗地代码或不动产单元号有误,请核对后再试一次',
type: "warning",
});
}else{
// console.log(this.rules,'rules');
this.$refs.qlxzModule.getRules();
let flag = true;
this.rules.forEach(item=>{
if(item.rule.test(item.data) || item.data == null){
......@@ -717,10 +710,17 @@ export default {
}
})
this.$nextTick(()=>{
if(flag){
if(flag && this.$refs.qlxzModule.getRulesResult()){
//宗地面积处理
// console.log(this.formData.zdmj,'this.formData.zdmj');
// this.formData.zdmj = this.formData.zdmj.replace(/[^\d\.]/g,'')
//判断宗地代码和不动产单元号是否手动修改过(宗地代码和不动产单元号的前14位是否和底盘代码一致)
if(this.formData.zddm.substring(0,14) != this.dpdm || this.formData.bdcdyh.substring(0,14) != this.dpdm){
this.$message({
message: '宗地代码或不动产单元号有误,请核对后再试一次',
type: "warning",
});
}else{
updateQjZdjbxx(this.formData)
.then((res) => {
if (res.code == 200) {
......@@ -758,6 +758,7 @@ export default {
self.updAttributes(this.$store.state.zdbsm,'zd',this.geoAttributes,function (res) {
console.log("属性保存完成!!");
});
}
}else{
this.$message({
// message: item.name+'不能为空',
......@@ -767,11 +768,6 @@ export default {
}
})
}
},
inputBlur(e){
if(e.target.value!=''){
......@@ -886,6 +882,17 @@ export default {
this.getZdjbxxData(val)
this.curZdbsm = val;
},
"formData.bdcdyh":function (val) {
if (val != '') {
this.$refs.bdcdyh.style.border = '';
}
},
"formData.zddm":function (val) {
if (val != '') {
this.$refs.zddm.style.border = '';
}
}
},
"$store.state.sxdrType": function (val) {
debugger
this.$message.success(val);
......@@ -893,7 +900,6 @@ export default {
this.getZdjbxxData(this.$store.state.zdbsm)
}
},
},
};
</script>
<style lang="less" scoped>
......
......@@ -2,7 +2,7 @@
<div ref="lpb" class="content_box">
<el-tabs v-model="activeName" class="tabs" @tab-click="handleClick">
<el-tab-pane label="自然幢信息" name="zrzxx"><zrzxx></zrzxx></el-tab-pane>
<el-tab-pane label="业主共有" name="yzgy"><yzgy></yzgy></el-tab-pane>
<el-tab-pane label="业主共有" name="yzgy"><yzgy v-if="yzgyLoad"></yzgy></el-tab-pane>
<el-tab-pane label="登记簿" name="djb"><djb></djb></el-tab-pane>
<el-tab-pane label="楼盘表" name="lpb"><lpb v-if="lpbLoad"></lpb></el-tab-pane>
<el-tab-pane label="历史回溯" name="lshs"><lshs></lshs></el-tab-pane>
......@@ -28,6 +28,7 @@ export default {
return {
activeName: "zrzxx",
lpbLoad:false, //默认不加载楼盘表组件
yzgyLoad:false,
};
},
methods: {
......@@ -35,6 +36,9 @@ export default {
if(!this.lpbLoad){
this.lpbLoad = tab.name == 'lpb' ? true : false
}
if(!this.yzgyLoad){
this.yzgyLoad = tab.name == 'yzgy' ? true : false
}
},
},
created() {},
......
<template>
<div class="">
<div class="main">
<div class="main" ref="mainBox">
<table border="1">
<tr>
<td colspan="3">宗地代码</td>
......@@ -54,9 +53,11 @@
<td>{{sumFttdmj}}</td>
</tr>-->
</table>
<div class="pers">
<!-- <div class="pers">
<el-button @click="save" type="primary">保存</el-button>
</div>
</div> -->
<div class="header-button" :style="{width:mainBoxWidth+'px'}">
<el-button type="primary" class="saveBtn" @click="save">保存</el-button>
</div>
</div>
</template>
......@@ -83,7 +84,8 @@
fttdmj: '', //分摊土地面积
fj: ''
}]
}
},
mainBoxWidth:0
}
},
......@@ -127,10 +129,12 @@
console.log("create init...")
},
mounted() {
console.log("mounted init...")
// console.log(this.$refs.mainBox.clientWidth,"this.$refs.mainBox.clientWidth")
this.Data.glbsm = this.$store.state.zrzbsm
this.zddm = this.$store.state.zddm
this.getData(this.Data.glbsm)
this.$nextTick(() => {
this.mainBoxWidth = this.$refs.mainBox.clientWidth;
})
},
watch: {
"$store.state.zdbsm": function (bsm) {
......@@ -147,7 +151,7 @@
box-sizing: border-box;
padding: 18px;
height: auto;
width: 80%;
width: 100%;
}
table {
......@@ -186,4 +190,22 @@
.dzwsl {
width: 200px;
}
.header-button {
height: 50px;
position: fixed;
bottom: 0;
right: 0;
text-align: center;
background-color: #ffffff;
.saveBtn {
background-color: #00CACD;
border-color: #00CACD;
padding: 10px 30px;
margin-top: 8px;
}
.saveBtn:hover {
background-color: rgba(0, 202, 205, .8);
border-color: rgba(0, 202, 205, .8);
}
}
</style>
......
<template>
<div class="main">
<div class="main" ref="mainBox">
<div class="formMenu">
<Qlr ref="qlrxxModule" :bsm="bsm" :qszt="form.qszt"></Qlr>
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="zrzTable">
......@@ -43,7 +43,7 @@
<tr>
<td colspan="2" >房屋性质<i class="requisite">*</i></td>
<td colspan="4" >
<el-select class="formSelect" ref="fwxz" @blur="inputBlur($event)" :disabled="form.qszt!='0'" v-model="form.fwxzbsm" placeholder="请选择" >
<el-select class="formSelect" ref="fwxz" :disabled="form.qszt!='0'" v-model="form.fwxzbsm" placeholder="请选择" >
<el-option
v-for="item in $store.state.fwxzOptions"
:key="item.bsm"
......@@ -156,7 +156,6 @@
<td colspan="3" >
<el-select-tree style="width:100%"
ref="ghyt"
@blur="inputBlur($event)"
v-if="show"
:default-expand-all="defaultExpandAll"
:multiple="multiple"
......@@ -173,7 +172,6 @@
<td colspan="4" >
<el-select-tree style="width:100%"
ref="yt"
@blur="inputBlur($event)"
v-if="show"
:default-expand-all="defaultExpandAll"
:multiple="multiple"
......@@ -198,7 +196,7 @@
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;删除</span>
</td>
<td colspan="9" >
<el-select class="persent78" ref="fwjg" @blur="inputBlur($event)" :disabled="form.qszt!='0'" v-model="item1.fwjgzdbsm" placeholder="请选择" >
<el-select class="persent78" ref="fwjg" :disabled="form.qszt!='0'" v-model="item1.fwjgzdbsm" placeholder="请选择" >
<el-option
v-for="item in $store.state.jgOptions"
:key="item.bsm"
......@@ -266,10 +264,11 @@
</tr>
</table>
<div style="min-height: 40px;text-align: center;margin-top: 10px">
<el-button type="success" @click="onSave">保存</el-button>
<div class="header-button" :style="{width:mainBoxWidth+'px'}">
<el-button type="primary" class="saveBtn" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
<el-button type="primary" @click="registerCall">登记调用</el-button>
<!-- <el-button type="primary" class="saveBtn" @click="save">保存</el-button> -->
</div>
</div>
</div>
......@@ -398,6 +397,7 @@
BSM:"",
},
rules:[],
mainBoxWidth:0,
}
},
methods: {
......@@ -491,13 +491,13 @@
this.form.fwytList.forEach((item,index)=>{
this.rules.push(
{
data:this.form.fwytList[index].ghyt,
data:item.fwytzdbsm,
name:'规划用途',
dom:this.$refs.ghyt[index],
rule: /^\s*$/g, //非空
},
{
data:this.form.fwytList[index].yt,
data:item.fwytzdbsm,
name:'用途',
dom:this.$refs.yt[index],
rule: /^\s*$/g, //非空
......@@ -507,7 +507,7 @@
this.form.fwjgList.forEach((item,index)=>{
this.rules.push(
{
data:this.form.fwjgList[index].fwjg,
data:item.fwjgzdbsm,
name:'房屋结构',
dom:this.$refs.fwjg[index],
rule: /^\s*$/g, //非空
......@@ -519,7 +519,6 @@
this.form.qlxzList= this.$refs.qlxzModule.getQlxzDataList();
this.$refs.qlxzModule.getRules();
let flag = true;
console.log(this.rules,'this.rules');
this.rules.forEach(item=>{
if(item.rule.test(item.data) || item.data == null){
if(item.dom.$el){
......@@ -534,7 +533,7 @@
}
})
this.$nextTick(()=>{
if (flag) {
if (flag && this.$refs.qlxzModule.getRulesResult()) {
if(this.form.zrzh.substring(0,19) != this.form.zddm || this.form.bdcdyh.substring(0,19) != this.form.zddm){
this.$message({
message: '自然幢号或不动产单元号有误,请核对后再试一次',
......@@ -718,7 +717,11 @@
this.getZrzDetailByBsm(this.$route.query.bsm)
}
},
mounted() {},
mounted() {
this.$nextTick(() => {
this.mainBoxWidth = this.$refs.mainBox.clientWidth;
})
},
computed: {
zrzbsm() {
return this.$store.state.zdbsm;
......@@ -727,7 +730,46 @@
watch:{
zrzbsm:function (val) {
this.reload()
},
"form.bdcdyh":function (val) {
if (val != '') {
this.$refs.bdcdyh.style.border = '';
}
},
"form.zrzh":function (val) {
if (val != '') {
this.$refs.zrzh.style.border = '';
}
},
"form.fwxzbsm":{
handler:function (val) {
if (val != '') {
this.$refs.fwxz.$el.style.border = '';
}
},
immediate:false
},
"form.fwytList": {
handler : function (newVal, oldVal) {
newVal.forEach((item,ind)=>{
if(item.fwytzdbsm != ''){
this.$refs.ghyt[ind].$el.style.border=""
this.$refs.yt[ind].$el.style.border=""
}
})
},
deep:true
},
"form.fwjgList": {
handler : function (newVal, oldVal) {
newVal.forEach((item,ind)=>{
if(item.fwjgzdbsm != ''){
this.$refs.fwjg[ind].$el.style.border=""
}
})
},
deep:true
},
}
}
</script>
......@@ -739,6 +781,7 @@
.formMenu {
width: 100%;
margin: 0 auto;
margin-bottom: 50px;
}
.zrzTable {
margin: 10px 0;
......@@ -792,5 +835,26 @@
width: 100%;
}
}
.header-button {
height: 50px;
position: fixed;
bottom: 0;
right: 6px;
text-align: center;
background-color: #ffffff;
.el-button{
padding: 10px 30px;
margin-top: 8px;
cursor: pointer;
}
.saveBtn {
background-color: #00CACD;
border-color: #00CACD;
}
.saveBtn:hover {
background-color: rgba(0, 202, 205, .8);
border-color: rgba(0, 202, 205, .8);
}
}
}
</style>
......