e258d481 by 杨威

合并代码

2 parents 98bae8ac 3163d413
......@@ -2,15 +2,18 @@
"label":"专题树",
"id":"1",
"type":"layerGroup",
"alpha":100,
"children":[
{
"label":"西安市阎良区",
"id":"1-1",
"type":"layerGroup",
"alpha":100,
"children":[{
"label":"行政区划",
"id":"1-1-1",
"type":"layerGroup",
"alpha":100,
"children":[
{
"label":"行政区界限",
......@@ -32,6 +35,7 @@
"label":"地籍分区",
"id":"1-1-2",
"type":"layerGroup",
"alpha":100,
"children":[
{
"label":"地籍区",
......@@ -53,6 +57,7 @@
"label":"不动产单元",
"id":"1-1-3",
"type":"layerGroup",
"alpha":100,
"children":[
{
"label":"线状定着物",
......@@ -130,6 +135,7 @@
"label":"自然地理",
"id":"1-1-4",
"type":"layerGroup",
"alpha":100,
"children":[
{
"label":"辅助面",
......
......@@ -210,7 +210,7 @@
import dzHb from '@components/dzHb/dzHb'
export default {
name: "",
inject: ['getRightTree'],
inject: ['getTreeByS','getTreeByBsm'],
components: { zdQueryData, hfghb,dzHb},
props: {},
data() {
......@@ -310,7 +310,7 @@
if (res.success) {
this.$message.success("合并成功");
//更新目录树
this.getRightTree(res.result,'2');
this.getTreeByS(res.result);
this.$router.push({
path: '/zd',
query: {
......@@ -335,6 +335,7 @@
if (res.success) {
console.log(res)
this.$message.success("多幢合并成功")
this.getTreeByBsm(res.result,'dz','0,1,2')
this.$router.push({
path: '/dz',
query: {
......
......@@ -157,6 +157,17 @@ export default {
}
}
layer.sublayers = items;
},
//设置图层透明度
setLayerOpacity(viewId,layers,value){
var view = maps[viewId],
layer = view.map.findLayerById("testLayer");
for(var i = 0;i < layers.length;i++){
var sublayer = layer.findSublayerById(layers[i].layerId);
if(sublayer){
sublayer.opacity = value/100;
}
}
}
}
}
\ No newline at end of file
......
......@@ -31,7 +31,7 @@
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span class="setOpacity" v-if="data.type == 'layerGroup'">
<el-slider v-model="data.alpha" ref="data.id" :format-tooltip="formatTooltip" @change="alphaChange(data)"></el-slider>
<el-slider v-model="data.alpha" ref="data.id" :format-tooltip="formatTooltip" @change="alphaChange(data)"></el-slider>
</span>
</span>
</el-tree>
......@@ -114,7 +114,12 @@
return val+"%";
},
alphaChange(nodeData){
if(nodeData.alpha == 0){
return;
}
var ids = [];
this.getChildrens(nodeData,ids);
this.setLayerOpacity(this.viewId,ids,nodeData.alpha);
}
}
}
......