Commit cca788a9 by LJM

关闭优化

parent b035589d
......@@ -41,7 +41,7 @@
</ul>
</section>
<el-row>
<el-button @click="$router.push('/subAccount')">取消</el-button>
<el-button @click="canel()">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
</el-row>
</el-form>
......@@ -137,6 +137,45 @@ export default {
}
},
/**
* 取消
*/
canel() {
this.closetab('/subAccountadd')
},
/**
* 关闭当前页面
* @param path
*/
closetab(path) {
let tab_arr = JSON.parse(sessionStorage.getItem('tabs'))
for (var i = 0; i < tab_arr.length; i++) {
if (tab_arr[i].path == path) {
tab_arr.splice(i, 1);
sessionStorage.setItem('tabs', JSON.stringify(tab_arr));
if (path == this.$route.path) {
if (i == 0) {
this.$router.push({
path: "/"
})
} else {
if (tab_arr[i - 1].query) {
this.$router.push({
path: tab_arr[i - 1].path,
query: tab_arr[i - 1].query
})
} else {
this.$router.push({
path: tab_arr[i - 1].path,
})
}
}
}
break;
}
}
this.$router.push('/subAccount');
},
/**
* 获取当前用户的权限菜单
*/
getMenu() {
......@@ -228,7 +267,7 @@ export default {
type: 'success'
});
setTimeout(() => {
this.$router.push('/subAccount')
this.closetab('/subAccountadd')
}, 2000)
} else {
this.formParam.user_rule = JSON.parse(this.formParam.user_rule);
......
......@@ -41,7 +41,7 @@
</ul>
</section>
<el-row>
<el-button @click="$router.push('/subAccount')">取消</el-button>
<el-button @click="canel()">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
</el-row>
</el-form>
......@@ -107,6 +107,45 @@ export default {
this.getMessageMenu();
},
methods: {
/**
* 取消
*/
canel() {
this.closetab('/subAccountEdit')
},
/**
* 关闭当前页面
* @param path
*/
closetab(path) {
let tab_arr = JSON.parse(sessionStorage.getItem('tabs'))
for (var i = 0; i < tab_arr.length; i++) {
if (tab_arr[i].path == path) {
tab_arr.splice(i, 1);
sessionStorage.setItem('tabs', JSON.stringify(tab_arr));
if (path == this.$route.path) {
if (i == 0) {
this.$router.push({
path: "/"
})
} else {
if (tab_arr[i - 1].query) {
this.$router.push({
path: tab_arr[i - 1].path,
query: tab_arr[i - 1].query
})
} else {
this.$router.push({
path: tab_arr[i - 1].path,
})
}
}
}
break;
}
}
this.$router.push('/subAccount');
},
getData() {
this.$http('GET', "/api/subAccount/getSubAccountInfo", {sbat_id: this.formParam.sbat_id}).then(res => {
if (res.code === 0) {
......@@ -276,7 +315,7 @@ export default {
type: 'success'
});
setTimeout(() => {
this.$router.push('/subAccount')
this.closetab('/subAccountEdit')
}, 2000)
} else {
this.$message({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment