查询左侧目录树所有权类型节点下的宗地和自然幢信息
Showing
3 changed files
with
103 additions
and
8 deletions
| ... | @@ -47,6 +47,22 @@ export function getListByPbsm(pbsm) { | ... | @@ -47,6 +47,22 @@ export function getListByPbsm(pbsm) { |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| 50 | * 跟据所有权类型及其所在行政区,地籍区,地籍子区查询宗地和自然幢信息 | ||
| 51 | */ | ||
| 52 | export function getZdDetailList(data) { | ||
| 53 | return request({ | ||
| 54 | url: 'system/xzq/getZdDetailList', | ||
| 55 | method: 'get', | ||
| 56 | params: { | ||
| 57 | xzqbsm:data.xzqbsm, | ||
| 58 | djqbsm:data.djqbsm, | ||
| 59 | djzqbsm:data.djzqbsm, | ||
| 60 | syqlx:data.syqlx | ||
| 61 | } | ||
| 62 | }) | ||
| 63 | } | ||
| 64 | |||
| 65 | /** | ||
| 50 | * 通过名称获取字典 | 66 | * 通过名称获取字典 |
| 51 | */ | 67 | */ |
| 52 | export function getDdicByMC(mc) { | 68 | export function getDdicByMC(mc) { | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <div class="tree_item_box"> | 2 | <div class="tree_item_box" :class="list.length>10 ? 'ofy_scroll':''" :style="{maxHeight:(list.length > 10 ? treeXzqHeight:'unset')+'px'}"> |
| 3 | <div | 3 | <div |
| 4 | class="column-start-start linkLine_default" | 4 | class="column-start-start linkLine_default" |
| 5 | v-for="(item, s_index) in list" | 5 | v-for="(item, s_index) in list" |
| ... | @@ -34,6 +34,14 @@ | ... | @@ -34,6 +34,14 @@ |
| 34 | }" | 34 | }" |
| 35 | ></div> | 35 | ></div> |
| 36 | <div | 36 | <div |
| 37 | v-if="item.children==null" | ||
| 38 | class="reTree_icon reTree_expand_icon" | ||
| 39 | :style="{ | ||
| 40 | height: (size || 14 * 1.2) + 'px', | ||
| 41 | width: (size || 14 * 1.2) + 'px', | ||
| 42 | }" | ||
| 43 | ></div> | ||
| 44 | <div | ||
| 37 | class="layer_text nowrap" | 45 | class="layer_text nowrap" |
| 38 | @contextmenu.prevent="openMenu($event, item,list)" | 46 | @contextmenu.prevent="openMenu($event, item,list)" |
| 39 | :class="{ | 47 | :class="{ |
| ... | @@ -53,6 +61,7 @@ | ... | @@ -53,6 +61,7 @@ |
| 53 | </div> | 61 | </div> |
| 54 | </template> | 62 | </template> |
| 55 | <script> | 63 | <script> |
| 64 | import {getZdDetailList} from "../../api/common" | ||
| 56 | export default { | 65 | export default { |
| 57 | name: "line-item", | 66 | name: "line-item", |
| 58 | props: { | 67 | props: { |
| ... | @@ -62,6 +71,12 @@ export default { | ... | @@ -62,6 +71,12 @@ export default { |
| 62 | return []; | 71 | return []; |
| 63 | }, | 72 | }, |
| 64 | }, | 73 | }, |
| 74 | formatData: { | ||
| 75 | type: Array, | ||
| 76 | default: () => { | ||
| 77 | return []; | ||
| 78 | }, | ||
| 79 | }, | ||
| 65 | size: { | 80 | size: { |
| 66 | type: Number, | 81 | type: Number, |
| 67 | default: 14, | 82 | default: 14, |
| ... | @@ -77,20 +92,43 @@ export default { | ... | @@ -77,20 +92,43 @@ export default { |
| 77 | }, | 92 | }, |
| 78 | data() { | 93 | data() { |
| 79 | return { | 94 | return { |
| 80 | time:null | 95 | time:null, |
| 96 | treeXzqHeight:0, | ||
| 81 | } | 97 | } |
| 82 | }, | 98 | }, |
| 99 | mounted(){ | ||
| 100 | this.$nextTick(()=>{ | ||
| 101 | this.treeXzqHeight = this.$parent.$el.clientHeight-(this.formatData.length-1)*26+60; | ||
| 102 | }) | ||
| 103 | }, | ||
| 83 | methods: { | 104 | methods: { |
| 84 | itemClick(item) { | 105 | itemClick(item) { |
| 85 | let self = this; | 106 | let self = this; |
| 86 | // 开启延时器,300ms的间隔区分单击和双击,解决双击时执行两次单击事件 | 107 | // 开启延时器,300ms的间隔区分单击和双击,解决双击时执行两次单击事件 |
| 87 | clearTimeout(self.time); | 108 | clearTimeout(self.time); |
| 88 | self.time = setTimeout(() => { | 109 | self.time = setTimeout(() => { |
| 89 | |||
| 90 | item.expand = item.expand == undefined? true:!item.expand; | 110 | item.expand = item.expand == undefined? true:!item.expand; |
| 91 | self.$emit("itemClick", item); | 111 | // self.$emit("itemClick", item); |
| 92 | if (!item.children) { | 112 | if (!item.children) { |
| 93 | self.$emit("valClick", item); | 113 | let data = { |
| 114 | xzqbsm:item.xzq, | ||
| 115 | djqbsm:item.djq, | ||
| 116 | djzqbsm:item.djzq, | ||
| 117 | syqlx:item.dm | ||
| 118 | } | ||
| 119 | getZdDetailList(data).then((res) => { | ||
| 120 | if (res.result.length>0) { | ||
| 121 | res.result.forEach(i=>{ | ||
| 122 | if(i.children.length>0){ | ||
| 123 | i.expand = false; | ||
| 124 | } | ||
| 125 | }) | ||
| 126 | self.$emit("ownerMethod", item,res.result); | ||
| 127 | } | ||
| 128 | }) | ||
| 129 | .catch((error) => { | ||
| 130 | |||
| 131 | }); | ||
| 94 | } | 132 | } |
| 95 | }, 300); | 133 | }, 300); |
| 96 | }, | 134 | }, |
| ... | @@ -190,6 +228,10 @@ export default { | ... | @@ -190,6 +228,10 @@ export default { |
| 190 | width: 100%; | 228 | width: 100%; |
| 191 | cursor: pointer; | 229 | cursor: pointer; |
| 192 | } | 230 | } |
| 231 | .ofy_scroll{ | ||
| 232 | overflow-y: scroll; | ||
| 233 | overflow-x: hidden; | ||
| 234 | } | ||
| 193 | .basic_layer { | 235 | .basic_layer { |
| 194 | width: 100%; | 236 | width: 100%; |
| 195 | position: relative; | 237 | position: relative; |
| ... | @@ -222,7 +264,7 @@ export default { | ... | @@ -222,7 +264,7 @@ export default { |
| 222 | position: relative; | 264 | position: relative; |
| 223 | // padding-bottom: 15px; | 265 | // padding-bottom: 15px; |
| 224 | width: 100%; | 266 | width: 100%; |
| 225 | padding-left: 40px; | 267 | padding-left: 25px; |
| 226 | } | 268 | } |
| 227 | .white_layer { | 269 | .white_layer { |
| 228 | color: black!important; | 270 | color: black!important; |
| ... | @@ -243,7 +285,7 @@ export default { | ... | @@ -243,7 +285,7 @@ export default { |
| 243 | content: ""; | 285 | content: ""; |
| 244 | position: absolute; | 286 | position: absolute; |
| 245 | height: 1px; | 287 | height: 1px; |
| 246 | width: 22px; | 288 | width: 16px; |
| 247 | left: 8px; | 289 | left: 8px; |
| 248 | top: 8px; | 290 | top: 8px; |
| 249 | opacity: .5; | 291 | opacity: .5; | ... | ... |
| ... | @@ -34,6 +34,7 @@ | ... | @@ -34,6 +34,7 @@ |
| 34 | <lineItem | 34 | <lineItem |
| 35 | v-if="item.expand && item.children.length > 0" | 35 | v-if="item.expand && item.children.length > 0" |
| 36 | v-on="$listeners" | 36 | v-on="$listeners" |
| 37 | @ownerMethod="ownerMethod(arguments)" | ||
| 37 | @changeTop="changeTop" | 38 | @changeTop="changeTop" |
| 38 | @changeZdData="changeZdData" | 39 | @changeZdData="changeZdData" |
| 39 | @changeLeft="changeLeft" | 40 | @changeLeft="changeLeft" |
| ... | @@ -45,6 +46,7 @@ | ... | @@ -45,6 +46,7 @@ |
| 45 | :visible="visible" | 46 | :visible="visible" |
| 46 | :size="size" | 47 | :size="size" |
| 47 | :islpb="islpb" | 48 | :islpb="islpb" |
| 49 | :formatData="formatData" | ||
| 48 | ></lineItem> | 50 | ></lineItem> |
| 49 | </div> | 51 | </div> |
| 50 | 52 | ||
| ... | @@ -212,8 +214,42 @@ export default { | ... | @@ -212,8 +214,42 @@ export default { |
| 212 | }, | 214 | }, |
| 213 | itemClick(item) { | 215 | itemClick(item) { |
| 214 | // item.expand = item.expand == undefined? true:!item.expand; | 216 | // item.expand = item.expand == undefined? true:!item.expand; |
| 217 | console.log(item,'item'); | ||
| 218 | console.log(this.formatData,'this.formatData'); | ||
| 219 | this.formatData.forEach(i=>{ | ||
| 220 | if(i.bsm != item.bsm){ | ||
| 221 | i.expand = false | ||
| 222 | }else{ | ||
| 223 | // i.expand = !item.expand | ||
| 224 | } | ||
| 225 | }) | ||
| 215 | item.expand = !item.expand; | 226 | item.expand = !item.expand; |
| 216 | this.$emit("itemClick", item); | 227 | // this.$emit("itemClick", item); |
| 228 | }, | ||
| 229 | //给所有权类型添加子节点 | ||
| 230 | ownerMethod(arr){ | ||
| 231 | let item = arr[0]; | ||
| 232 | let list = arr[1] | ||
| 233 | this.formatData.forEach(i=>{ | ||
| 234 | if (i.bsm == item.xzq){ | ||
| 235 | i.children.forEach(j=>{ | ||
| 236 | if (j.bsm == item.djq) { | ||
| 237 | j.children.forEach(k=>{ | ||
| 238 | if(k.bsm == item.djzq){ | ||
| 239 | k.children.forEach(n=>{ | ||
| 240 | if(n.dm == item.dm){ | ||
| 241 | this.$nextTick(()=>{ | ||
| 242 | n.children = list; | ||
| 243 | }) | ||
| 244 | } | ||
| 245 | }) | ||
| 246 | } | ||
| 247 | }) | ||
| 248 | } | ||
| 249 | }) | ||
| 250 | } | ||
| 251 | }) | ||
| 252 | console.log(this.formatData,'formatData'); | ||
| 217 | }, | 253 | }, |
| 218 | //自然幢右键点击事件 | 254 | //自然幢右键点击事件 |
| 219 | openMenu(e,item){ | 255 | openMenu(e,item){ |
| ... | @@ -273,6 +309,7 @@ export default { | ... | @@ -273,6 +309,7 @@ export default { |
| 273 | flex-direction: column; | 309 | flex-direction: column; |
| 274 | justify-content: flex-start; | 310 | justify-content: flex-start; |
| 275 | align-items: center; | 311 | align-items: center; |
| 312 | |||
| 276 | } | 313 | } |
| 277 | .row-flex-start { | 314 | .row-flex-start { |
| 278 | display: flex; | 315 | display: flex; | ... | ... |
-
Please register or sign in to post a comment