6fa087fa by 杨威

左侧目录树相同宗地下的幢信息双击时不再重新加载目录树数据

1 parent e245eead
......@@ -15,7 +15,7 @@
<div
class="row-flex-start basic_banner"
@click="itemClick(item)"
@dblclick="dbclick(item)"
@dblclick="dbclick(item,item.zdbsm)"
:class="{
active_color: item.expand,
}"
......@@ -48,6 +48,8 @@
active_color: item.expand,
curPage:$route.query.bsm && $route.query.bsm==item.bsm
}"
:ref="($route.query.bsm && $route.query.bsm==item.bsm)?'curZxx':''"
:data-zdbsm="item.zdbsm"
>
<img class="qsztImg" v-if="item.qszt=='0'" :src="linshi"/>
<img class="qsztImg" v-if="item.qszt=='1'" :src="zhengshi"/>
......@@ -104,7 +106,11 @@ export default {
}
},
mounted(){
// console.log(this.$refs.curZxx,'this.$refs.curZxx');
if(this.$refs.curZxx){
console.log(this.$refs.curZxx[0].dataset.zdbsm);
this.$store.state.oldZdbsm = this.$refs.curZxx[0].dataset.zdbsm;
}
},
methods: {
itemClick(item) {
......@@ -174,8 +180,9 @@ export default {
}
},
// 左键双击事件
dbclick(item,) {
dbclick(item,bsm) {
clearTimeout(this.time);
this.$store.state.newZdbsm = bsm;
//此处不要将$router移到if的外面,因为可能是双击行政区,就不知道去哪儿了
if (item.type == 'zd') {
this.$store.state.zdbsm = item.bsm;
......
......@@ -143,7 +143,7 @@ export default {
sxdrVisible:false,
selectedDetail: {},
timer: {},
formatData: [],
formatData: this.$store.state.treeData,
visible: false,
top: 0,
left: 0,
......@@ -167,9 +167,7 @@ export default {
watch: {
pd(n, o) {
this.formatData = this.preDealData(n);
console.log(this.formatData);
},
lpbvisible(value) {
if (value) {
document.body.addEventListener("click", this.closeMenu);
......@@ -194,7 +192,6 @@ export default {
// }
},
created() {
console.log("lineTree create");
this.preDealData(this.pd);
// this.expandTreeItemById(["6b5af49d803f97baf06afb897de257f5"]);
},
......@@ -302,8 +299,6 @@ export default {
},
itemClick(item) {
// item.expand = item.expand == undefined? true:!item.expand;
console.log(item,'item');
console.log(this.formatData,'this.formatData');
this.formatData.forEach(i=>{
if(i.bsm != item.bsm){
i.expand = false
......@@ -337,11 +332,9 @@ export default {
})
}
})
console.log(this.formatData,'formatData');
},
//自然幢右键点击事件
openMenu(e,item){
console.log(item,'右键item');
this.lpbleft = e.pageX;
this.lpbtop = e.pageY;
this.zdData = item;
......
......@@ -50,6 +50,8 @@ const store = new Vuex.Store({
zrzh:'', //自然幢号
dzbsm:'', // 多幢bsm
treeData:[], // 树数据
oldZdbsm:'',
newZdbsm:'',
},
modules: {
user,
......
......@@ -11,7 +11,7 @@
<span class="logo-text" v-show="!textLogo">不动产权籍调查系统</span>
</div>
<div class="treeModule" :style="{height:treeHeight+'px'}">
<LineTree :pd="pd" @itemClick="itemClick"></LineTree>
<LineTree :pd="pd" v-if="lineTreeVisible" @itemClick="itemClick"></LineTree>
</div>
</el-aside>
<el-container class="calcWidth">
......@@ -137,11 +137,12 @@ export default {
"/announcement_template": "PSH019",
"/business_management": "PSH020",
},
pd: [],
pd: this.$store.state.treeData,
dialogVisible: false,
isMap:false,
treeHeight:0,
routerInfo:null
routerInfo:null,
lineTreeVisible:false,
};
},
computed: {
......@@ -192,10 +193,15 @@ export default {
"$store.state.treeData":function (val) {
console.log(val,'val');
this.pd = val;
}
},
'$store.state.treeZdbsm':function (val) {
console.log(val,'val');
},
},
mounted(){
this.$nextTick(()=>{
this.lineTreeVisible = true
})
},
created() {
if (this.$route.meta) {
......@@ -313,24 +319,35 @@ export default {
getTree(bsm).then((res) => {
if (res.success) {
this.pd = res.result;
this.$store.state.newZdbsm = '';
}
});
},
getRightTreeByZrzbsm(bsm) {
if (this.$store.state.newZdbsm != this.$store.state.oldZdbsm) {
getTreeByBsm(bsm,"zrz").then((res) => {
if (res.success) {
this.pd = res.result;
this.$store.state.treeData = res.result;
}
});
}else{
}
},
getRightTreeByDzbsm(bsm) {
if (this.$store.state.newZdbsm != this.$store.state.oldZdbsm) {
getTreeByBsm(bsm,"dz").then((res) => {
if (res.success) {
this.pd = res.result;
this.$store.state.treeData = res.result;
}
});
}else{
}
},
getRightTreeByHbsm(bsm) {
......@@ -402,6 +419,7 @@ export default {
getTreeList(){
getTreeList().then((res)=>{
this.pd=res.result;
this.$store.state.newZdbsm = '';
})
},
goBack(){
......