目录树和路由联动问题修改
Showing
5 changed files
with
29 additions
and
11 deletions
| ... | @@ -69,7 +69,10 @@ export default { | ... | @@ -69,7 +69,10 @@ export default { | 
| 69 | provide(){ | 69 | provide(){ | 
| 70 | return{ | 70 | return{ | 
| 71 | getRightTree: this.getRightTree, | 71 | getRightTree: this.getRightTree, | 
| 72 | getRightTreeByZrzbsm:this.getRightTreeByZrzbsm | 72 | getRightTreeByZrzbsm:this.getRightTreeByZrzbsm, | 
| 73 | getTreeByS:this.getTreeByS, | ||
| 74 | getRightTreeByDzbsm:this.getRightTreeByDzbsm, | ||
| 75 | getRightTreeByHbsm:this.getRightTreeByHbsm | ||
| 73 | } | 76 | } | 
| 74 | }, | 77 | }, | 
| 75 | data() { | 78 | data() { | 
| ... | @@ -144,14 +147,14 @@ export default { | ... | @@ -144,14 +147,14 @@ export default { | 
| 144 | if (newPath == "/zd") { | 147 | if (newPath == "/zd") { | 
| 145 | //source为3时代表时分割后的宗地信息 | 148 | //source为3时代表时分割后的宗地信息 | 
| 146 | if(this.$route.query.source == '3'){ | 149 | if(this.$route.query.source == '3'){ | 
| 147 | this.getTreeByS(this.$store.state.zdbsms); | 150 | // this.getTreeByS(this.$store.state.zdbsms); | 
| 148 | }else{ | 151 | }else{ | 
| 149 | this.getRightTree(this.$store.state.zdbsm); | 152 | // this.getRightTree(this.$store.state.zdbsm); | 
| 150 | } | 153 | } | 
| 151 | }else if (newPath == "/zrz") { | 154 | }else if (newPath == "/zrz") { | 
| 152 | this.getRightTreeByZrzbsm(this.$store.state.zrzbsm); | 155 | // this.getRightTreeByZrzbsm(this.$store.state.zrzbsm); | 
| 153 | }else if(newPath == "/dz"){ | 156 | }else if(newPath == "/dz"){ | 
| 154 | this.getRightTreeByDzbsm(this.$store.state.dzbsm); | 157 | // this.getRightTreeByDzbsm(this.$store.state.dzbsm); | 
| 155 | }else if(newPath == "/h"){ | 158 | }else if(newPath == "/h"){ | 
| 156 | this.getRightTreeByHbsm(this.$store.state.hbsm); | 159 | this.getRightTreeByHbsm(this.$store.state.hbsm); | 
| 157 | } else if(newPath == "/viewMap"){ | 160 | } else if(newPath == "/viewMap"){ | 
| ... | @@ -254,7 +257,7 @@ export default { | ... | @@ -254,7 +257,7 @@ export default { | 
| 254 | getTreeByS(zdbsms){ | 257 | getTreeByS(zdbsms){ | 
| 255 | getListMenu(zdbsms).then(res=>{ | 258 | getListMenu(zdbsms).then(res=>{ | 
| 256 | if (res.success) { | 259 | if (res.success) { | 
| 257 | this.pd=res.result | 260 | this.pd=res.result; | 
| 258 | } | 261 | } | 
| 259 | }) | 262 | }) | 
| 260 | }, | 263 | }, | 
| ... | @@ -307,6 +310,7 @@ export default { | ... | @@ -307,6 +310,7 @@ export default { | 
| 307 | if (res.success) { | 310 | if (res.success) { | 
| 308 | this.pd = res.result; | 311 | this.pd = res.result; | 
| 309 | this.$store.state.treeData = res.result; | 312 | this.$store.state.treeData = res.result; | 
| 313 | this.$store.state.newZdbsm = ''; | ||
| 310 | } | 314 | } | 
| 311 | }); | 315 | }); | 
| 312 | }else{ | 316 | }else{ | 
| ... | @@ -320,6 +324,7 @@ export default { | ... | @@ -320,6 +324,7 @@ export default { | 
| 320 | if (res.success) { | 324 | if (res.success) { | 
| 321 | this.pd = res.result; | 325 | this.pd = res.result; | 
| 322 | this.$store.state.treeData = res.result; | 326 | this.$store.state.treeData = res.result; | 
| 327 | this.$store.state.newZdbsm = ''; | ||
| 323 | } | 328 | } | 
| 324 | }); | 329 | }); | 
| 325 | }else{ | 330 | }else{ | 
| ... | @@ -331,6 +336,7 @@ export default { | ... | @@ -331,6 +336,7 @@ export default { | 
| 331 | getTreeByBsm(bsm,"h").then((res) => { | 336 | getTreeByBsm(bsm,"h").then((res) => { | 
| 332 | if (res.success) { | 337 | if (res.success) { | 
| 333 | this.pd = res.result; | 338 | this.pd = res.result; | 
| 339 | this.$store.state.newZdbsm = ''; | ||
| 334 | } | 340 | } | 
| 335 | }); | 341 | }); | 
| 336 | }, | 342 | }, | ... | ... | 
| ... | @@ -331,6 +331,7 @@ | ... | @@ -331,6 +331,7 @@ | 
| 331 | 331 | ||
| 332 | export default { | 332 | export default { | 
| 333 | name: "", | 333 | name: "", | 
| 334 | inject: ['getTreeByS'], | ||
| 334 | components: {zdQueryData,dzQueryData,hfghb}, | 335 | components: {zdQueryData,dzQueryData,hfghb}, | 
| 335 | props: {}, | 336 | props: {}, | 
| 336 | data() { | 337 | data() { | 
| ... | @@ -619,6 +620,8 @@ | ... | @@ -619,6 +620,8 @@ | 
| 619 | zdfg(this.zdFghData).then(res => { | 620 | zdfg(this.zdFghData).then(res => { | 
| 620 | if (res.success) { | 621 | if (res.success) { | 
| 621 | this.$store.state.zdbsms = res.result; | 622 | this.$store.state.zdbsms = res.result; | 
| 623 | //更新目录树 | ||
| 624 | this.getTreeByS(res.result); | ||
| 622 | this.$router.push({ | 625 | this.$router.push({ | 
| 623 | path: '/zd', | 626 | path: '/zd', | 
| 624 | query: { | 627 | query: { | ... | ... | 
| ... | @@ -189,6 +189,7 @@ | ... | @@ -189,6 +189,7 @@ | 
| 189 | import dzHb from './../../../../components/dzHb/dzHb' | 189 | import dzHb from './../../../../components/dzHb/dzHb' | 
| 190 | export default { | 190 | export default { | 
| 191 | name: "", | 191 | name: "", | 
| 192 | inject: ['getRightTree'], | ||
| 192 | components: { zdQueryData, hfghb,dzHb}, | 193 | components: { zdQueryData, hfghb,dzHb}, | 
| 193 | props: {}, | 194 | props: {}, | 
| 194 | data() { | 195 | data() { | 
| ... | @@ -280,7 +281,9 @@ | ... | @@ -280,7 +281,9 @@ | 
| 280 | console.log(data, '宗地合并数据') | 281 | console.log(data, '宗地合并数据') | 
| 281 | ZdHb(data).then(res => { | 282 | ZdHb(data).then(res => { | 
| 282 | if (res.success) { | 283 | if (res.success) { | 
| 283 | this.$message.success("合并成功") | 284 | this.$message.success("合并成功"); | 
| 285 | //更新目录树 | ||
| 286 | this.getRightTree(res.result); | ||
| 284 | this.$router.push({ | 287 | this.$router.push({ | 
| 285 | path: '/zd', | 288 | path: '/zd', | 
| 286 | query: { | 289 | query: { | ... | ... | 
| ... | @@ -156,7 +156,7 @@ import { insertDzjbxx } from "../../../api/dz"; | ... | @@ -156,7 +156,7 @@ import { insertDzjbxx } from "../../../api/dz"; | 
| 156 | export default { | 156 | export default { | 
| 157 | name: "", | 157 | name: "", | 
| 158 | components: {}, | 158 | components: {}, | 
| 159 | inject:['getRightTree','getRightTreeByZrzbsm'], | 159 | inject:['getRightTree','getRightTreeByZrzbsm','getRightTreeByDzbsm'], | 
| 160 | props: ['auth'], | 160 | props: ['auth'], | 
| 161 | data() { | 161 | data() { | 
| 162 | return { | 162 | return { | 
| ... | @@ -263,6 +263,7 @@ export default { | ... | @@ -263,6 +263,7 @@ export default { | 
| 263 | .then((res) => { | 263 | .then((res) => { | 
| 264 | console.log(res.result); | 264 | console.log(res.result); | 
| 265 | if (res.code == "200") { | 265 | if (res.code == "200") { | 
| 266 | this.getRightTree(this.$store.state.zdbsm); | ||
| 266 | this.$message({ | 267 | this.$message({ | 
| 267 | message: "创建成功!", | 268 | message: "创建成功!", | 
| 268 | type: "success", | 269 | type: "success", | 
| ... | @@ -270,7 +271,6 @@ export default { | ... | @@ -270,7 +271,6 @@ export default { | 
| 270 | this.$store.state.zdbsm = res.result; | 271 | this.$store.state.zdbsm = res.result; | 
| 271 | //todo 跳转到宗地基本信息内容表页面 (预留) | 272 | //todo 跳转到宗地基本信息内容表页面 (预留) | 
| 272 | this.close(); | 273 | this.close(); | 
| 273 | this.getRightTree(this.$store.state.zdbsm); | ||
| 274 | this.$router.push({ | 274 | this.$router.push({ | 
| 275 | path: '/zd', query:{ | 275 | path: '/zd', query:{ | 
| 276 | source: 2, | 276 | source: 2, | 
| ... | @@ -297,6 +297,8 @@ export default { | ... | @@ -297,6 +297,8 @@ export default { | 
| 297 | insertZrzjbxx(this.ruleForm1) | 297 | insertZrzjbxx(this.ruleForm1) | 
| 298 | .then((res) => { | 298 | .then((res) => { | 
| 299 | if (res.code == "200") { | 299 | if (res.code == "200") { | 
| 300 | //获取左侧树数据 | ||
| 301 | this.getRightTreeByZrzbsm(res.result.bsm); | ||
| 300 | this.$message({ | 302 | this.$message({ | 
| 301 | message: "创建成功!", | 303 | message: "创建成功!", | 
| 302 | type: "success", | 304 | type: "success", | 
| ... | @@ -307,8 +309,6 @@ export default { | ... | @@ -307,8 +309,6 @@ export default { | 
| 307 | this.$store.state.xmmc=res.result.xmmc; | 309 | this.$store.state.xmmc=res.result.xmmc; | 
| 308 | this.$store.state.newZdbsm = res.result.zdbsm; | 310 | this.$store.state.newZdbsm = res.result.zdbsm; | 
| 309 | this.close(); | 311 | this.close(); | 
| 310 | //获取左侧树数据 | ||
| 311 | this.getRightTreeByZrzbsm(this.$store.state.zdbsm); | ||
| 312 | this.$router.push({ | 312 | this.$router.push({ | 
| 313 | path: '/zrz', query:{ | 313 | path: '/zrz', query:{ | 
| 314 | source: 1, | 314 | source: 1, | 
| ... | @@ -335,6 +335,7 @@ export default { | ... | @@ -335,6 +335,7 @@ export default { | 
| 335 | insertDzjbxx(this.ruleForm2) | 335 | insertDzjbxx(this.ruleForm2) | 
| 336 | .then((res) => { | 336 | .then((res) => { | 
| 337 | if (res.code == "200") { | 337 | if (res.code == "200") { | 
| 338 | this.getRightTreeByDzbsm(res.result.bsm); | ||
| 338 | this.$message({ | 339 | this.$message({ | 
| 339 | message: "创建成功!", | 340 | message: "创建成功!", | 
| 340 | type: "success", | 341 | type: "success", | ... | ... | 
| ... | @@ -60,6 +60,7 @@ | ... | @@ -60,6 +60,7 @@ | 
| 60 | 60 | ||
| 61 | export default { | 61 | export default { | 
| 62 | name: "", | 62 | name: "", | 
| 63 | inject:['getRightTree','getRightTreeByZrzbsm','getRightTreeByDzbsm','getRightTreeByHbsm'], | ||
| 63 | components: {SearchHead}, | 64 | components: {SearchHead}, | 
| 64 | props: {}, | 65 | props: {}, | 
| 65 | data() { | 66 | data() { | 
| ... | @@ -122,14 +123,17 @@ | ... | @@ -122,14 +123,17 @@ | 
| 122 | switch (row.dylx) { | 123 | switch (row.dylx) { | 
| 123 | case "zrz": | 124 | case "zrz": | 
| 124 | this.$store.state.zrzbsm = row.glbsm; | 125 | this.$store.state.zrzbsm = row.glbsm; | 
| 126 | this.getRightTreeByZrzbsm(row.glbsm); | ||
| 125 | path = "/zrz"; | 127 | path = "/zrz"; | 
| 126 | break; | 128 | break; | 
| 127 | case "zd": | 129 | case "zd": | 
| 128 | this.$store.state.zdbsm = row.glbsm; | 130 | this.$store.state.zdbsm = row.glbsm; | 
| 131 | this.getRightTree(row.glbsm); | ||
| 129 | path = "/zd"; | 132 | path = "/zd"; | 
| 130 | break; | 133 | break; | 
| 131 | case "dz": | 134 | case "dz": | 
| 132 | this.$store.state.dzbsm = row.glbsm; | 135 | this.$store.state.dzbsm = row.glbsm; | 
| 136 | this.getRightTreeByDzbsm(row.glbsm); | ||
| 133 | path = "/dz"; | 137 | path = "/dz"; | 
| 134 | break; | 138 | break; | 
| 135 | case "h": | 139 | case "h": | 
| ... | @@ -137,6 +141,7 @@ | ... | @@ -137,6 +141,7 @@ | 
| 137 | case "h1": | 141 | case "h1": | 
| 138 | path="/h"; | 142 | path="/h"; | 
| 139 | this.$store.state.hbsm=row.glbsm | 143 | this.$store.state.hbsm=row.glbsm | 
| 144 | this.getRightTreeByHbsm(row.glbsm); | ||
| 140 | break; | 145 | break; | 
| 141 | default: | 146 | default: | 
| 142 | break; | 147 | break; | ... | ... | 
- 
Please register or sign in to post a comment