左侧目录树相同宗地下的幢信息双击时不再重新加载目录树数据
Showing
4 changed files
with
50 additions
and
30 deletions
| ... | @@ -15,7 +15,7 @@ | ... | @@ -15,7 +15,7 @@ |
| 15 | <div | 15 | <div |
| 16 | class="row-flex-start basic_banner" | 16 | class="row-flex-start basic_banner" |
| 17 | @click="itemClick(item)" | 17 | @click="itemClick(item)" |
| 18 | @dblclick="dbclick(item)" | 18 | @dblclick="dbclick(item,item.zdbsm)" |
| 19 | :class="{ | 19 | :class="{ |
| 20 | active_color: item.expand, | 20 | active_color: item.expand, |
| 21 | }" | 21 | }" |
| ... | @@ -48,6 +48,8 @@ | ... | @@ -48,6 +48,8 @@ |
| 48 | active_color: item.expand, | 48 | active_color: item.expand, |
| 49 | curPage:$route.query.bsm && $route.query.bsm==item.bsm | 49 | curPage:$route.query.bsm && $route.query.bsm==item.bsm |
| 50 | }" | 50 | }" |
| 51 | :ref="($route.query.bsm && $route.query.bsm==item.bsm)?'curZxx':''" | ||
| 52 | :data-zdbsm="item.zdbsm" | ||
| 51 | > | 53 | > |
| 52 | <img class="qsztImg" v-if="item.qszt=='0'" :src="linshi"/> | 54 | <img class="qsztImg" v-if="item.qszt=='0'" :src="linshi"/> |
| 53 | <img class="qsztImg" v-if="item.qszt=='1'" :src="zhengshi"/> | 55 | <img class="qsztImg" v-if="item.qszt=='1'" :src="zhengshi"/> |
| ... | @@ -104,7 +106,11 @@ export default { | ... | @@ -104,7 +106,11 @@ export default { |
| 104 | } | 106 | } |
| 105 | }, | 107 | }, |
| 106 | mounted(){ | 108 | mounted(){ |
| 107 | 109 | // console.log(this.$refs.curZxx,'this.$refs.curZxx'); | |
| 110 | if(this.$refs.curZxx){ | ||
| 111 | console.log(this.$refs.curZxx[0].dataset.zdbsm); | ||
| 112 | this.$store.state.oldZdbsm = this.$refs.curZxx[0].dataset.zdbsm; | ||
| 113 | } | ||
| 108 | }, | 114 | }, |
| 109 | methods: { | 115 | methods: { |
| 110 | itemClick(item) { | 116 | itemClick(item) { |
| ... | @@ -174,8 +180,9 @@ export default { | ... | @@ -174,8 +180,9 @@ export default { |
| 174 | } | 180 | } |
| 175 | }, | 181 | }, |
| 176 | // 左键双击事件 | 182 | // 左键双击事件 |
| 177 | dbclick(item,) { | 183 | dbclick(item,bsm) { |
| 178 | clearTimeout(this.time); | 184 | clearTimeout(this.time); |
| 185 | this.$store.state.newZdbsm = bsm; | ||
| 179 | //此处不要将$router移到if的外面,因为可能是双击行政区,就不知道去哪儿了 | 186 | //此处不要将$router移到if的外面,因为可能是双击行政区,就不知道去哪儿了 |
| 180 | if (item.type == 'zd') { | 187 | if (item.type == 'zd') { |
| 181 | this.$store.state.zdbsm = item.bsm; | 188 | this.$store.state.zdbsm = item.bsm; | ... | ... |
| ... | @@ -137,20 +137,20 @@ export default { | ... | @@ -137,20 +137,20 @@ export default { |
| 137 | } | 137 | } |
| 138 | }, | 138 | }, |
| 139 | components: { lineItem,Create,ImportGeo,sxdr }, | 139 | components: { lineItem,Create,ImportGeo,sxdr }, |
| 140 | mixins:[geoUtils,featureUpdate], | 140 | mixins:[geoUtils,featureUpdate], |
| 141 | data() { | 141 | data() { |
| 142 | return { | 142 | return { |
| 143 | sxdrVisible:false, | 143 | sxdrVisible:false, |
| 144 | selectedDetail: {}, | 144 | selectedDetail: {}, |
| 145 | timer: {}, | 145 | timer: {}, |
| 146 | formatData: [], | 146 | formatData: this.$store.state.treeData, |
| 147 | visible: false, | 147 | visible: false, |
| 148 | top: 0, | 148 | top: 0, |
| 149 | left: 0, | 149 | left: 0, |
| 150 | isZD: true, | 150 | isZD: true, |
| 151 | zdData:{}, | 151 | zdData:{}, |
| 152 | currentClickZdGeo:"", | 152 | currentClickZdGeo:"", |
| 153 | improtDialog:false, | 153 | improtDialog:false, |
| 154 | dialogVisible:false, | 154 | dialogVisible:false, |
| 155 | //控制楼盘表 | 155 | //控制楼盘表 |
| 156 | lpbvisible: false, | 156 | lpbvisible: false, |
| ... | @@ -167,9 +167,7 @@ export default { | ... | @@ -167,9 +167,7 @@ export default { |
| 167 | watch: { | 167 | watch: { |
| 168 | pd(n, o) { | 168 | pd(n, o) { |
| 169 | this.formatData = this.preDealData(n); | 169 | this.formatData = this.preDealData(n); |
| 170 | console.log(this.formatData); | ||
| 171 | }, | 170 | }, |
| 172 | |||
| 173 | lpbvisible(value) { | 171 | lpbvisible(value) { |
| 174 | if (value) { | 172 | if (value) { |
| 175 | document.body.addEventListener("click", this.closeMenu); | 173 | document.body.addEventListener("click", this.closeMenu); |
| ... | @@ -194,7 +192,6 @@ export default { | ... | @@ -194,7 +192,6 @@ export default { |
| 194 | // } | 192 | // } |
| 195 | }, | 193 | }, |
| 196 | created() { | 194 | created() { |
| 197 | console.log("lineTree create"); | ||
| 198 | this.preDealData(this.pd); | 195 | this.preDealData(this.pd); |
| 199 | // this.expandTreeItemById(["6b5af49d803f97baf06afb897de257f5"]); | 196 | // this.expandTreeItemById(["6b5af49d803f97baf06afb897de257f5"]); |
| 200 | }, | 197 | }, |
| ... | @@ -302,8 +299,6 @@ export default { | ... | @@ -302,8 +299,6 @@ export default { |
| 302 | }, | 299 | }, |
| 303 | itemClick(item) { | 300 | itemClick(item) { |
| 304 | // item.expand = item.expand == undefined? true:!item.expand; | 301 | // item.expand = item.expand == undefined? true:!item.expand; |
| 305 | console.log(item,'item'); | ||
| 306 | console.log(this.formatData,'this.formatData'); | ||
| 307 | this.formatData.forEach(i=>{ | 302 | this.formatData.forEach(i=>{ |
| 308 | if(i.bsm != item.bsm){ | 303 | if(i.bsm != item.bsm){ |
| 309 | i.expand = false | 304 | i.expand = false |
| ... | @@ -337,11 +332,9 @@ export default { | ... | @@ -337,11 +332,9 @@ export default { |
| 337 | }) | 332 | }) |
| 338 | } | 333 | } |
| 339 | }) | 334 | }) |
| 340 | console.log(this.formatData,'formatData'); | ||
| 341 | }, | 335 | }, |
| 342 | //自然幢右键点击事件 | 336 | //自然幢右键点击事件 |
| 343 | openMenu(e,item){ | 337 | openMenu(e,item){ |
| 344 | console.log(item,'右键item'); | ||
| 345 | this.lpbleft = e.pageX; | 338 | this.lpbleft = e.pageX; |
| 346 | this.lpbtop = e.pageY; | 339 | this.lpbtop = e.pageY; |
| 347 | this.zdData = item; | 340 | this.zdData = item; | ... | ... |
| ... | @@ -50,6 +50,8 @@ const store = new Vuex.Store({ | ... | @@ -50,6 +50,8 @@ const store = new Vuex.Store({ |
| 50 | zrzh:'', //自然幢号 | 50 | zrzh:'', //自然幢号 |
| 51 | dzbsm:'', // 多幢bsm | 51 | dzbsm:'', // 多幢bsm |
| 52 | treeData:[], // 树数据 | 52 | treeData:[], // 树数据 |
| 53 | oldZdbsm:'', | ||
| 54 | newZdbsm:'', | ||
| 53 | }, | 55 | }, |
| 54 | modules: { | 56 | modules: { |
| 55 | user, | 57 | user, | ... | ... |
| ... | @@ -11,7 +11,7 @@ | ... | @@ -11,7 +11,7 @@ |
| 11 | <span class="logo-text" v-show="!textLogo">不动产权籍调查系统</span> | 11 | <span class="logo-text" v-show="!textLogo">不动产权籍调查系统</span> |
| 12 | </div> | 12 | </div> |
| 13 | <div class="treeModule" :style="{height:treeHeight+'px'}"> | 13 | <div class="treeModule" :style="{height:treeHeight+'px'}"> |
| 14 | <LineTree :pd="pd" @itemClick="itemClick"></LineTree> | 14 | <LineTree :pd="pd" v-if="lineTreeVisible" @itemClick="itemClick"></LineTree> |
| 15 | </div> | 15 | </div> |
| 16 | </el-aside> | 16 | </el-aside> |
| 17 | <el-container class="calcWidth"> | 17 | <el-container class="calcWidth"> |
| ... | @@ -137,11 +137,12 @@ export default { | ... | @@ -137,11 +137,12 @@ export default { |
| 137 | "/announcement_template": "PSH019", | 137 | "/announcement_template": "PSH019", |
| 138 | "/business_management": "PSH020", | 138 | "/business_management": "PSH020", |
| 139 | }, | 139 | }, |
| 140 | pd: [], | 140 | pd: this.$store.state.treeData, |
| 141 | dialogVisible: false, | 141 | dialogVisible: false, |
| 142 | isMap:false, | 142 | isMap:false, |
| 143 | treeHeight:0, | 143 | treeHeight:0, |
| 144 | routerInfo:null | 144 | routerInfo:null, |
| 145 | lineTreeVisible:false, | ||
| 145 | }; | 146 | }; |
| 146 | }, | 147 | }, |
| 147 | computed: { | 148 | computed: { |
| ... | @@ -192,10 +193,15 @@ export default { | ... | @@ -192,10 +193,15 @@ export default { |
| 192 | "$store.state.treeData":function (val) { | 193 | "$store.state.treeData":function (val) { |
| 193 | console.log(val,'val'); | 194 | console.log(val,'val'); |
| 194 | this.pd = val; | 195 | this.pd = val; |
| 195 | } | 196 | }, |
| 197 | '$store.state.treeZdbsm':function (val) { | ||
| 198 | console.log(val,'val'); | ||
| 199 | }, | ||
| 196 | }, | 200 | }, |
| 197 | mounted(){ | 201 | mounted(){ |
| 198 | 202 | this.$nextTick(()=>{ | |
| 203 | this.lineTreeVisible = true | ||
| 204 | }) | ||
| 199 | }, | 205 | }, |
| 200 | created() { | 206 | created() { |
| 201 | if (this.$route.meta) { | 207 | if (this.$route.meta) { |
| ... | @@ -313,24 +319,35 @@ export default { | ... | @@ -313,24 +319,35 @@ export default { |
| 313 | getTree(bsm).then((res) => { | 319 | getTree(bsm).then((res) => { |
| 314 | if (res.success) { | 320 | if (res.success) { |
| 315 | this.pd = res.result; | 321 | this.pd = res.result; |
| 322 | this.$store.state.newZdbsm = ''; | ||
| 316 | } | 323 | } |
| 317 | }); | 324 | }); |
| 318 | }, | 325 | }, |
| 319 | 326 | ||
| 320 | getRightTreeByZrzbsm(bsm) { | 327 | getRightTreeByZrzbsm(bsm) { |
| 321 | getTreeByBsm(bsm,"zrz").then((res) => { | 328 | if (this.$store.state.newZdbsm != this.$store.state.oldZdbsm) { |
| 322 | if (res.success) { | 329 | getTreeByBsm(bsm,"zrz").then((res) => { |
| 323 | this.pd = res.result; | 330 | if (res.success) { |
| 324 | } | 331 | this.pd = res.result; |
| 325 | }); | 332 | this.$store.state.treeData = res.result; |
| 333 | } | ||
| 334 | }); | ||
| 335 | }else{ | ||
| 336 | |||
| 337 | } | ||
| 326 | }, | 338 | }, |
| 327 | 339 | ||
| 328 | getRightTreeByDzbsm(bsm) { | 340 | getRightTreeByDzbsm(bsm) { |
| 329 | getTreeByBsm(bsm,"dz").then((res) => { | 341 | if (this.$store.state.newZdbsm != this.$store.state.oldZdbsm) { |
| 330 | if (res.success) { | 342 | getTreeByBsm(bsm,"dz").then((res) => { |
| 331 | this.pd = res.result; | 343 | if (res.success) { |
| 332 | } | 344 | this.pd = res.result; |
| 333 | }); | 345 | this.$store.state.treeData = res.result; |
| 346 | } | ||
| 347 | }); | ||
| 348 | }else{ | ||
| 349 | |||
| 350 | } | ||
| 334 | }, | 351 | }, |
| 335 | 352 | ||
| 336 | getRightTreeByHbsm(bsm) { | 353 | getRightTreeByHbsm(bsm) { |
| ... | @@ -402,6 +419,7 @@ export default { | ... | @@ -402,6 +419,7 @@ export default { |
| 402 | getTreeList(){ | 419 | getTreeList(){ |
| 403 | getTreeList().then((res)=>{ | 420 | getTreeList().then((res)=>{ |
| 404 | this.pd=res.result; | 421 | this.pd=res.result; |
| 422 | this.$store.state.newZdbsm = ''; | ||
| 405 | }) | 423 | }) |
| 406 | }, | 424 | }, |
| 407 | goBack(){ | 425 | goBack(){ | ... | ... |
-
Please register or sign in to post a comment