fix(系统设置): 统一修改弹窗更改

This commit is contained in:
xinxin.wu 2023-08-16 16:39:47 +08:00 committed by 刘瑞斌
parent 7a501fff3f
commit cd556cb5a6
5 changed files with 2 additions and 80 deletions

View File

@ -582,26 +582,17 @@
content: t('system.config.auth.enableTipContent'), content: t('system.config.auth.enableTipContent'),
okText: t('system.config.auth.enableConfirm'), okText: t('system.config.auth.enableConfirm'),
cancelText: t('system.config.auth.cancel'), cancelText: t('system.config.auth.cancel'),
cancelButtonProps: {
disabled: enableLoading.value,
},
okLoading: enableLoading.value,
maskClosable: false, maskClosable: false,
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
enableLoading.value = true;
await updateAuthStatus({ await updateAuthStatus({
id: record.id, id: record.id,
enable: true, enable: true,
}); });
Message.success(t('system.config.auth.enableSuccess')); Message.success(t('system.config.auth.enableSuccess'));
loadList(); loadList();
return true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return false;
} finally {
enableLoading.value = false;
} }
}, },
hideCancel: false, hideCancel: false,
@ -619,26 +610,17 @@
content: t('system.config.auth.disableTipContent'), content: t('system.config.auth.disableTipContent'),
okText: t('system.config.auth.disableConfirm'), okText: t('system.config.auth.disableConfirm'),
cancelText: t('system.config.auth.cancel'), cancelText: t('system.config.auth.cancel'),
cancelButtonProps: {
disabled: disableLoading.value,
},
okLoading: disableLoading.value,
maskClosable: false, maskClosable: false,
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
disableLoading.value = true;
await updateAuthStatus({ await updateAuthStatus({
id: record.id, id: record.id,
enable: false, enable: false,
}); });
Message.success(t('system.config.auth.disableSuccess')); Message.success(t('system.config.auth.disableSuccess'));
loadList(); loadList();
return true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return false;
} finally {
disableLoading.value = false;
} }
}, },
hideCancel: false, hideCancel: false,
@ -659,23 +641,14 @@
okButtonProps: { okButtonProps: {
status: 'danger', status: 'danger',
}, },
cancelButtonProps: {
disabled: delLoading.value,
},
maskClosable: false, maskClosable: false,
okLoading: delLoading.value,
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
delLoading.value = true;
await deleteAuth(record.id); await deleteAuth(record.id);
Message.success(t('system.config.auth.deleteSuccess')); Message.success(t('system.config.auth.deleteSuccess'));
loadList(); loadList();
return true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return false;
} finally {
delLoading.value = false;
} }
}, },
hideCancel: false, hideCancel: false,

View File

@ -208,8 +208,7 @@
Message.success(isEnable ? t('common.enableSuccess') : t('common.closeSuccess')); Message.success(isEnable ? t('common.enableSuccess') : t('common.closeSuccess'));
fetchData(); fetchData();
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console console.log(error);
console.error(error);
} }
}, },
hideCancel: false, hideCancel: false,

View File

@ -184,23 +184,14 @@
okButtonProps: { okButtonProps: {
status: 'danger', status: 'danger',
}, },
cancelButtonProps: {
disabled: disableLoading.value,
},
okLoading: disableLoading.value,
maskClosable: false, maskClosable: false,
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
disableLoading.value = true;
await togglePoolStatus(record.id); await togglePoolStatus(record.id);
Message.success(t('system.resourcePool.disablePoolSuccess')); Message.success(t('system.resourcePool.disablePoolSuccess'));
loadList(); loadList();
return true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return false;
} finally {
disableLoading.value = false;
} }
}, },
hideCancel: false, hideCancel: false,
@ -221,23 +212,14 @@
okButtonProps: { okButtonProps: {
status: 'danger', status: 'danger',
}, },
cancelButtonProps: {
disabled: delLoading.value,
},
maskClosable: false, maskClosable: false,
okLoading: delLoading.value,
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
delLoading.value = true;
await delPoolInfo(record.id); await delPoolInfo(record.id);
Message.success(t('system.resourcePool.deletePoolSuccess')); Message.success(t('system.resourcePool.deletePoolSuccess'));
loadList(); loadList();
return true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return false;
} finally {
delLoading.value = false;
} }
}, },
hideCancel: false, hideCancel: false,

View File

@ -333,10 +333,8 @@
try { try {
await resetUserPassword(userIdList); await resetUserPassword(userIdList);
Message.success(t('system.user.resetPswSuccess')); Message.success(t('system.user.resetPswSuccess'));
return true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return false;
} }
}, },
hideCancel: false, hideCancel: false,
@ -363,26 +361,17 @@
okButtonProps: { okButtonProps: {
status: 'danger', status: 'danger',
}, },
cancelButtonProps: {
disabled: modalLoading.value,
},
okLoading: modalLoading.value,
maskClosable: false, maskClosable: false,
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
modalLoading.value = true;
await toggleUserStatus({ await toggleUserStatus({
userIdList, userIdList,
enable: false, enable: false,
}); });
Message.success(t('system.user.disableUserSuccess')); Message.success(t('system.user.disableUserSuccess'));
loadList(); loadList();
return true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return false;
} finally {
modalLoading.value = false;
} }
}, },
hideCancel: false, hideCancel: false,
@ -405,26 +394,17 @@
content: t('system.user.enableUserContent'), content: t('system.user.enableUserContent'),
okText: t('system.user.enableUserConfirm'), okText: t('system.user.enableUserConfirm'),
cancelText: t('system.user.enableUserCancel'), cancelText: t('system.user.enableUserCancel'),
cancelButtonProps: {
disabled: modalLoading.value,
},
okLoading: modalLoading.value,
maskClosable: false, maskClosable: false,
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
modalLoading.value = true;
await toggleUserStatus({ await toggleUserStatus({
userIdList, userIdList,
enable: true, enable: true,
}); });
Message.success(t('system.user.enableUserSuccess')); Message.success(t('system.user.enableUserSuccess'));
loadList(); loadList();
return true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return false;
} finally {
modalLoading.value = false;
} }
}, },
hideCancel: false, hideCancel: false,
@ -450,25 +430,16 @@
okButtonProps: { okButtonProps: {
status: 'danger', status: 'danger',
}, },
cancelButtonProps: {
disabled: modalLoading.value,
},
okLoading: modalLoading.value,
maskClosable: false, maskClosable: false,
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
modalLoading.value = true;
await deleteUserInfo({ await deleteUserInfo({
userIdList, userIdList,
}); });
Message.success(t('system.user.deleteUserSuccess')); Message.success(t('system.user.deleteUserSuccess'));
loadList(); loadList();
return true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return false;
} finally {
modalLoading.value = false;
} }
}, },
hideCancel: false, hideCancel: false,

View File

@ -167,11 +167,8 @@
await deleteUserGroup(id); await deleteUserGroup(id);
Message.success(t('system.user.deleteUserSuccess')); Message.success(t('system.user.deleteUserSuccess'));
initData(); initData();
return true;
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console console.log(error);
console.error(error);
return false;
} }
}, },
hideCancel: false, hideCancel: false,