refactor: 优化页面刷新代码
This commit is contained in:
parent
aa620032f1
commit
ace55e4ed1
|
@ -77,6 +77,9 @@ export default {
|
|||
MsMainContainer,
|
||||
MsChangeHistory
|
||||
},
|
||||
inject: [
|
||||
'reload'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
result: {},
|
||||
|
@ -107,7 +110,7 @@ export default {
|
|||
'$route'(to) {
|
||||
// 如果是创建测试
|
||||
if (to.name === 'createPerTest') {
|
||||
window.location.reload();
|
||||
this.reload();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -120,6 +120,9 @@ export default {
|
|||
scenarios: Array,
|
||||
isReadOnly: Boolean,
|
||||
},
|
||||
inject: [
|
||||
'reload'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
loadFileVisible: false,
|
||||
|
@ -321,7 +324,7 @@ export default {
|
|||
this.getProjectFiles();
|
||||
// 刷新页面上的线程组
|
||||
if (this.tableData.filter(f => f.id === this.currentRow.id).length > 0) {
|
||||
window.location.reload();
|
||||
this.reload();
|
||||
}
|
||||
this.currentRow = null;
|
||||
});
|
||||
|
|
|
@ -232,6 +232,9 @@ export default {
|
|||
return getCurrentWorkspaceId();
|
||||
}
|
||||
},
|
||||
inject: [
|
||||
'reload'
|
||||
],
|
||||
methods: {
|
||||
create() {
|
||||
this.dialogWsAddVisible = true;
|
||||
|
@ -249,7 +252,7 @@ export default {
|
|||
this.dialogWsUpdateVisible = false;
|
||||
if (saveType == 'add') {
|
||||
Message.success(this.$t('commons.save_success'));
|
||||
window.location.reload();
|
||||
this.reload();
|
||||
} else if (saveType == 'update') {
|
||||
Message.success(this.$t('commons.modify_success'));
|
||||
this.list();
|
||||
|
|
|
@ -93,6 +93,9 @@ import {EMAIL_REGEX, PHONE_REGEX} from "@/common/js/regex";
|
|||
export default {
|
||||
name: "MsPersonSetting",
|
||||
components: {MsDialogFooter, MsTableOperatorButton},
|
||||
inject: [
|
||||
'reload'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
result: {},
|
||||
|
@ -192,7 +195,7 @@ export default {
|
|||
localStorage.setItem(TokenKey, JSON.stringify(response.data));
|
||||
this.updateVisible = false;
|
||||
this.initTableData();
|
||||
window.location.reload();
|
||||
this.reload();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
|
@ -210,7 +213,7 @@ export default {
|
|||
this.$success(this.$t('commons.modify_success'));
|
||||
this.editPasswordVisible = false;
|
||||
this.initTableData();
|
||||
window.location.reload();
|
||||
this.reload();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -142,6 +142,9 @@ export default {
|
|||
UserCascader,
|
||||
ShowMoreBtn
|
||||
},
|
||||
inject: [
|
||||
'reload'
|
||||
],
|
||||
data() {
|
||||
const validateConfirmPwd = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
|
@ -325,7 +328,7 @@ export default {
|
|||
this.$success(this.$t('commons.modify_success'));
|
||||
this.editPasswordVisible = false;
|
||||
this.search();
|
||||
window.location.reload();
|
||||
this.reload();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -298,6 +298,9 @@ export default {
|
|||
MsMainContainer, MsRolesTag,
|
||||
MsContainer, MsTableOperator, MsCreateBox, MsTablePagination, MsTableHeader, MsDialogFooter
|
||||
},
|
||||
inject: [
|
||||
'reload'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
createVisible: false,
|
||||
|
@ -431,7 +434,7 @@ export default {
|
|||
this.createVisible = false;
|
||||
Message.success(this.$t('commons.save_success'));
|
||||
if (saveType === 'add') {
|
||||
window.location.reload();
|
||||
this.reload();
|
||||
} else {
|
||||
this.list();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue