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