|
@@ -46,18 +46,10 @@
|
|
|
已选择<span class="checkLength">{{ checkedCities.length }}</span
|
|
|
>个
|
|
|
</div>
|
|
|
- <el-checkbox-group
|
|
|
- id="mapCheckBox"
|
|
|
- v-model="checkedCities"
|
|
|
- @change="handleCheckedCitiesChange"
|
|
|
- :min="2"
|
|
|
- :max="6"
|
|
|
- >
|
|
|
+ <el-checkbox-group id="mapCheckBox" v-model="checkedCities" @change="handleCheckedCitiesChange" :min="2" :max="6">
|
|
|
<el-checkbox
|
|
|
class="mapCheckBox"
|
|
|
- :disabled="
|
|
|
- checkedCities.length >= 6 && checkedCities.indexOf(index) == -1
|
|
|
- "
|
|
|
+ :disabled="checkedCities.length >= 6 && checkedCities.indexOf(index) == -1"
|
|
|
v-for="(city, index) in mapList"
|
|
|
:checked="city.active"
|
|
|
:label="index"
|
|
@@ -69,31 +61,68 @@
|
|
|
</div>
|
|
|
<!-- 底部文本域 -->
|
|
|
<div id="textareaBox">
|
|
|
- <div class="doPrintInfo">时间:{{ newTime }}</div>
|
|
|
- <div class="textareaTitle">描述记录:</div>
|
|
|
- <el-input
|
|
|
- type="textarea"
|
|
|
- :autosize="{ minRows: 3, maxRows: 4 }"
|
|
|
- placeholder="请输入内容"
|
|
|
- v-model="textarea1"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
+ <div class="doPrintInfo">
|
|
|
+ <div>
|
|
|
+ 时间:{{ newTime }}
|
|
|
+ <div v-if="$store.state.mapMarkInfo['行政区代码']">
|
|
|
+ 行政区代码:<span style="color: #c0c4cc">{{ $store.state.mapMarkInfo["行政区代码"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['镇域名称']">
|
|
|
+ 镇域名称:<span style="color: #c0c4cc">{{ $store.state.mapMarkInfo["镇域名称"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['数据来源']">
|
|
|
+ 数据来源:<span style="color: #c0c4cc">{{ $store.state.mapMarkInfo["数据来源"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['图斑编号']">
|
|
|
+ 图斑编号:<span style="color: #c0c4cc">{{ $store.state.mapMarkInfo["图斑编号"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['面积']">
|
|
|
+ 面积(平方米):<span style="color: #c0c4cc">{{ $store.state.mapMarkInfo["面积"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['问题描述']">
|
|
|
+ 问题描述:<span style="color: #c0c4cc">{{ $store.state.mapMarkInfo["问题描述"] }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="textareaTitle">描述:</div>
|
|
|
+ <el-input type="textarea" :autosize="{ minRows: 3, maxRows: 4 }" placeholder="请输入内容" v-model="textarea1">
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!-- 打印区域 -->
|
|
|
<div id="imgBox">
|
|
|
- <span>基本农田被侵占</span>
|
|
|
- <img
|
|
|
- src=""
|
|
|
- id="imgOut"
|
|
|
- style="
|
|
|
- width: 1240px;
|
|
|
- background-repeat: no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
- "
|
|
|
- />
|
|
|
- <div class="doPrintInfo2">时间:{{ newTime }}</div>
|
|
|
- <span><div>描述记录:</div></span>
|
|
|
- <div>{{ textarea1 }}</div>
|
|
|
+ <span>{{ $store.state.mapMarkInfo["Layer"] ? $store.state.mapMarkInfo["Layer"] : pageTitle }}</span>
|
|
|
+ <img src="" id="imgOut" style="width: 1240px; background-repeat: no-repeat; background-size: 100% 100%" />
|
|
|
+
|
|
|
+ <div class="doPrintInfo2">
|
|
|
+ <div>
|
|
|
+ 时间:{{ newTime }}
|
|
|
+ <div v-if="$store.state.mapMarkInfo['行政区代码']">
|
|
|
+ 行政区代码:<span style="color: #dcdfe6">{{ $store.state.mapMarkInfo["行政区代码"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['镇域名称']">
|
|
|
+ 镇域名称:<span style="color: #dcdfe6">{{ $store.state.mapMarkInfo["镇域名称"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['数据来源']">
|
|
|
+ 数据来源:<span style="color: #dcdfe6">{{ $store.state.mapMarkInfo["数据来源"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['图斑编号']">
|
|
|
+ 图斑编号:<span style="color: #dcdfe6">{{ $store.state.mapMarkInfo["图斑编号"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['面积']">
|
|
|
+ 面积(平方米):<span style="color: #dcdfe6">{{ $store.state.mapMarkInfo["面积"] }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="$store.state.mapMarkInfo['问题描述']">
|
|
|
+ 问题描述:<span style="color: #dcdfe6">{{ $store.state.mapMarkInfo["问题描述"] }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <hr />
|
|
|
+ <div>
|
|
|
+ <div class="textareaTitle">描述:</div>
|
|
|
+ <p>{{ textarea1 }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="clearDialogVisible()">取 消</el-button>
|
|
@@ -116,6 +145,7 @@ export default {
|
|
|
components: { Map },
|
|
|
data() {
|
|
|
return {
|
|
|
+ pageTitle: "同屏对比",
|
|
|
sortBaseMap: [],
|
|
|
doPrintLoading: false,
|
|
|
// 同屏对比弹窗显示状态
|
|
@@ -138,7 +168,7 @@ export default {
|
|
|
// 底部文本域
|
|
|
textarea1: "",
|
|
|
// 地图底图列表
|
|
|
- mapList: [],
|
|
|
+ mapList: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -177,27 +207,25 @@ export default {
|
|
|
params.append("page", 0);
|
|
|
let sortparam = [{ field: "c_year", orderByType: 1 }];
|
|
|
params.append("orderBy", JSON.stringify(sortparam));
|
|
|
- this.$Post(this.urlsCollection.selectContentList, params).then((res) => {
|
|
|
+ this.$Post(this.urlsCollection.selectContentList, params).then(res => {
|
|
|
if (res.code === 200 && res.content.data.length > 0) {
|
|
|
let data = res.content.data;
|
|
|
- data.forEach((v) => {
|
|
|
+ data.forEach(v => {
|
|
|
map2DViewer.baseMapCollection.unshift({
|
|
|
mapName: v.title,
|
|
|
- mapUrl:
|
|
|
- v.c_url +
|
|
|
- "?AccessKey=lUaEMxqqhZKLSImGuP/Ergx47orYVyIqHVgxfyGpIurKAy9kdq5uU1cWuTuIXeOM",
|
|
|
+ mapUrl: v.c_url + "?AccessKey=lUaEMxqqhZKLSImGuP/Ergx47orYVyIqHVgxfyGpIurKAy9kdq5uU1cWuTuIXeOM",
|
|
|
active: v.c_defined_show ? v.c_defined_show : false,
|
|
|
basemapType: v.basemap,
|
|
|
year: v.c_year,
|
|
|
- abbr: v.c_abbr,
|
|
|
+ abbr: v.c_abbr
|
|
|
});
|
|
|
});
|
|
|
- this.mapList = map2DViewer.baseMapCollection.map((v) => {
|
|
|
+ this.mapList = map2DViewer.baseMapCollection.map(v => {
|
|
|
return {
|
|
|
mapName: v.mapName,
|
|
|
mapUrl: v.mapUrl,
|
|
|
active: v.active,
|
|
|
- year: v.year,
|
|
|
+ year: v.year
|
|
|
};
|
|
|
});
|
|
|
}
|
|
@@ -208,6 +236,7 @@ export default {
|
|
|
changeShowBottomMenusStatus() {
|
|
|
// 打开弹窗
|
|
|
this.dialogVisible = true;
|
|
|
+ this.$store.state.mapMarkInfo = {};
|
|
|
this.$emit("changeShowBottomMenusStatus", false);
|
|
|
// 打开弹窗前首先同步一下地图定位
|
|
|
let mapCenter = map2DViewer.map.getCenter();
|
|
@@ -216,7 +245,7 @@ export default {
|
|
|
this.centerZoomInit = {
|
|
|
lat: mapCenter.lat,
|
|
|
lng: mapCenter.lng,
|
|
|
- zoom: mapZoom,
|
|
|
+ zoom: mapZoom
|
|
|
};
|
|
|
}
|
|
|
setTimeout(() => {
|
|
@@ -257,7 +286,7 @@ export default {
|
|
|
_width,
|
|
|
_height,
|
|
|
useCORS: true,
|
|
|
- allowTaint: true,
|
|
|
+ allowTaint: true
|
|
|
};
|
|
|
let that = this;
|
|
|
let parentNodeList = [];
|
|
@@ -295,45 +324,31 @@ export default {
|
|
|
});
|
|
|
// html2canvas插件实现dom转imageBase64
|
|
|
html2canvas(this.$refs.doPrint, ops).then(
|
|
|
- (canvas) => {
|
|
|
- document
|
|
|
- .getElementById("imgOut")
|
|
|
- .setAttribute("src", canvas.toDataURL("image/png"));
|
|
|
+ canvas => {
|
|
|
+ document.getElementById("imgOut").setAttribute("src", canvas.toDataURL("image/png"));
|
|
|
setTimeout(() => {
|
|
|
if (that.doPrintLoading) {
|
|
|
that.doPrint(parentNodeList, svgElemNodeList, canvasList);
|
|
|
}
|
|
|
}, 1000);
|
|
|
},
|
|
|
- (error) => {
|
|
|
+ error => {
|
|
|
that.$message.error(error);
|
|
|
- this.showMapSvgAndRemoveMapCanvas(
|
|
|
- parentNodeList,
|
|
|
- svgElemNodeList,
|
|
|
- canvasList
|
|
|
- );
|
|
|
+ this.showMapSvgAndRemoveMapCanvas(parentNodeList, svgElemNodeList, canvasList);
|
|
|
this.doPrintLoading = false;
|
|
|
}
|
|
|
);
|
|
|
setTimeout(() => {
|
|
|
if (this.doPrintLoading) {
|
|
|
this.$message.error("打印超时请稍后重试!");
|
|
|
- this.showMapSvgAndRemoveMapCanvas(
|
|
|
- parentNodeList,
|
|
|
- svgElemNodeList,
|
|
|
- canvasList
|
|
|
- );
|
|
|
+ this.showMapSvgAndRemoveMapCanvas(parentNodeList, svgElemNodeList, canvasList);
|
|
|
this.doPrintLoading = false;
|
|
|
}
|
|
|
}, 10000);
|
|
|
} catch (e) {
|
|
|
if (this.doPrintLoading) {
|
|
|
this.$message.error("打印异常,异常信息:" + e);
|
|
|
- this.showMapSvgAndRemoveMapCanvas(
|
|
|
- parentNodeList,
|
|
|
- svgElemNodeList,
|
|
|
- canvasList
|
|
|
- );
|
|
|
+ this.showMapSvgAndRemoveMapCanvas(parentNodeList, svgElemNodeList, canvasList);
|
|
|
this.doPrintLoading = false;
|
|
|
}
|
|
|
}
|
|
@@ -360,11 +375,7 @@ export default {
|
|
|
var obj = document.getElementById("imgBox");
|
|
|
doc.write(obj.innerHTML);
|
|
|
doc.close();
|
|
|
- this.showMapSvgAndRemoveMapCanvas(
|
|
|
- parentNodeList,
|
|
|
- svgElemNodeList,
|
|
|
- canvasList
|
|
|
- );
|
|
|
+ this.showMapSvgAndRemoveMapCanvas(parentNodeList, svgElemNodeList, canvasList);
|
|
|
this.doPrintLoading = false;
|
|
|
new_iframe.contentWindow.focus();
|
|
|
new_iframe.contentWindow.print();
|
|
@@ -372,12 +383,12 @@ export default {
|
|
|
},
|
|
|
// 修改选中地图
|
|
|
handleCheckedCitiesChange() {
|
|
|
- this.sortBaseMap = this.checkedCities.map((v) => {
|
|
|
+ this.sortBaseMap = this.checkedCities.map(v => {
|
|
|
return {
|
|
|
id: v,
|
|
|
mapUrl: this.mapList[v].mapUrl,
|
|
|
mapName: this.mapList[v].mapName,
|
|
|
- year: this.mapList[v].year,
|
|
|
+ year: this.mapList[v].year
|
|
|
};
|
|
|
});
|
|
|
let newSortBaseMap = this.sortBaseMap.sort((a, b) => {
|
|
@@ -420,9 +431,9 @@ export default {
|
|
|
if (!this.MouseDownStatus) {
|
|
|
this.mouseIndex = mouseIndex;
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
- watch: {},
|
|
|
+ watch: {}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
@@ -519,6 +530,7 @@ export default {
|
|
|
.textareaTitle {
|
|
|
font-size: 20px;
|
|
|
font-weight: 400;
|
|
|
+ color: #ffffff;
|
|
|
}
|
|
|
#imgBox {
|
|
|
display: none;
|
|
@@ -533,9 +545,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.doPrintInfo {
|
|
|
+ display: flex;
|
|
|
color: #ffffff;
|
|
|
+ div {
|
|
|
+ padding: 0 10px;
|
|
|
+ }
|
|
|
}
|
|
|
.doPrintInfo2 {
|
|
|
+ display: flex;
|
|
|
color: #000000;
|
|
|
+ div {
|
|
|
+ padding: 0 10px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|