7822068d by 杨威

目录树和路由联动问题修改

1 parent fdc99e66
......@@ -69,7 +69,10 @@ export default {
provide(){
return{
getRightTree: this.getRightTree,
getRightTreeByZrzbsm:this.getRightTreeByZrzbsm
getRightTreeByZrzbsm:this.getRightTreeByZrzbsm,
getTreeByS:this.getTreeByS,
getRightTreeByDzbsm:this.getRightTreeByDzbsm,
getRightTreeByHbsm:this.getRightTreeByHbsm
}
},
data() {
......@@ -144,14 +147,14 @@ export default {
if (newPath == "/zd") {
//source为3时代表时分割后的宗地信息
if(this.$route.query.source == '3'){
this.getTreeByS(this.$store.state.zdbsms);
// this.getTreeByS(this.$store.state.zdbsms);
}else{
this.getRightTree(this.$store.state.zdbsm);
// this.getRightTree(this.$store.state.zdbsm);
}
}else if (newPath == "/zrz") {
this.getRightTreeByZrzbsm(this.$store.state.zrzbsm);
// this.getRightTreeByZrzbsm(this.$store.state.zrzbsm);
}else if(newPath == "/dz"){
this.getRightTreeByDzbsm(this.$store.state.dzbsm);
// this.getRightTreeByDzbsm(this.$store.state.dzbsm);
}else if(newPath == "/h"){
this.getRightTreeByHbsm(this.$store.state.hbsm);
} else if(newPath == "/viewMap"){
......@@ -254,7 +257,7 @@ export default {
getTreeByS(zdbsms){
getListMenu(zdbsms).then(res=>{
if (res.success) {
this.pd=res.result
this.pd=res.result;
}
})
},
......@@ -307,6 +310,7 @@ export default {
if (res.success) {
this.pd = res.result;
this.$store.state.treeData = res.result;
this.$store.state.newZdbsm = '';
}
});
}else{
......@@ -320,6 +324,7 @@ export default {
if (res.success) {
this.pd = res.result;
this.$store.state.treeData = res.result;
this.$store.state.newZdbsm = '';
}
});
}else{
......@@ -331,6 +336,7 @@ export default {
getTreeByBsm(bsm,"h").then((res) => {
if (res.success) {
this.pd = res.result;
this.$store.state.newZdbsm = '';
}
});
},
......
......@@ -331,6 +331,7 @@
export default {
name: "",
inject: ['getTreeByS'],
components: {zdQueryData,dzQueryData,hfghb},
props: {},
data() {
......@@ -619,6 +620,8 @@
zdfg(this.zdFghData).then(res => {
if (res.success) {
this.$store.state.zdbsms = res.result;
//更新目录树
this.getTreeByS(res.result);
this.$router.push({
path: '/zd',
query: {
......
......@@ -189,6 +189,7 @@
import dzHb from './../../../../components/dzHb/dzHb'
export default {
name: "",
inject: ['getRightTree'],
components: { zdQueryData, hfghb,dzHb},
props: {},
data() {
......@@ -280,7 +281,9 @@
console.log(data, '宗地合并数据')
ZdHb(data).then(res => {
if (res.success) {
this.$message.success("合并成功")
this.$message.success("合并成功");
//更新目录树
this.getRightTree(res.result);
this.$router.push({
path: '/zd',
query: {
......
......@@ -156,7 +156,7 @@ import { insertDzjbxx } from "../../../api/dz";
export default {
name: "",
components: {},
inject:['getRightTree','getRightTreeByZrzbsm'],
inject:['getRightTree','getRightTreeByZrzbsm','getRightTreeByDzbsm'],
props: ['auth'],
data() {
return {
......@@ -263,6 +263,7 @@ export default {
.then((res) => {
console.log(res.result);
if (res.code == "200") {
this.getRightTree(this.$store.state.zdbsm);
this.$message({
message: "创建成功!",
type: "success",
......@@ -270,7 +271,6 @@ export default {
this.$store.state.zdbsm = res.result;
//todo 跳转到宗地基本信息内容表页面 (预留)
this.close();
this.getRightTree(this.$store.state.zdbsm);
this.$router.push({
path: '/zd', query:{
source: 2,
......@@ -297,6 +297,8 @@ export default {
insertZrzjbxx(this.ruleForm1)
.then((res) => {
if (res.code == "200") {
//获取左侧树数据
this.getRightTreeByZrzbsm(res.result.bsm);
this.$message({
message: "创建成功!",
type: "success",
......@@ -307,8 +309,6 @@ export default {
this.$store.state.xmmc=res.result.xmmc;
this.$store.state.newZdbsm = res.result.zdbsm;
this.close();
//获取左侧树数据
this.getRightTreeByZrzbsm(this.$store.state.zdbsm);
this.$router.push({
path: '/zrz', query:{
source: 1,
......@@ -335,6 +335,7 @@ export default {
insertDzjbxx(this.ruleForm2)
.then((res) => {
if (res.code == "200") {
this.getRightTreeByDzbsm(res.result.bsm);
this.$message({
message: "创建成功!",
type: "success",
......
......@@ -60,6 +60,7 @@
export default {
name: "",
inject:['getRightTree','getRightTreeByZrzbsm','getRightTreeByDzbsm','getRightTreeByHbsm'],
components: {SearchHead},
props: {},
data() {
......@@ -122,14 +123,17 @@
switch (row.dylx) {
case "zrz":
this.$store.state.zrzbsm = row.glbsm;
this.getRightTreeByZrzbsm(row.glbsm);
path = "/zrz";
break;
case "zd":
this.$store.state.zdbsm = row.glbsm;
this.getRightTree(row.glbsm);
path = "/zd";
break;
case "dz":
this.$store.state.dzbsm = row.glbsm;
this.getRightTreeByDzbsm(row.glbsm);
path = "/dz";
break;
case "h":
......@@ -137,6 +141,7 @@
case "h1":
path="/h";
this.$store.state.hbsm=row.glbsm
this.getRightTreeByHbsm(row.glbsm);
break;
default:
break;
......