feat: 优化账号管理操作部分交互
This commit is contained in:
@ -98,8 +98,8 @@ const list = ref([]);
|
||||
const loading = ref(false);
|
||||
const query = ref({
|
||||
name: '',
|
||||
sort_column: '',
|
||||
sort_order: '',
|
||||
sort_column: undefined,
|
||||
sort_order: undefined,
|
||||
});
|
||||
const pageInfo = ref({
|
||||
page: 1,
|
||||
@ -139,8 +139,8 @@ const close = () => {
|
||||
pageInfo.value.page = 1;
|
||||
pageInfo.value.pageSize = 20;
|
||||
pageInfo.value.total = 0;
|
||||
query.value.sort_column = '';
|
||||
query.value.sort_order = '';
|
||||
query.value.sort_column = undefined;
|
||||
query.value.sort_order = undefined;
|
||||
list.value = [];
|
||||
visible.value = false;
|
||||
};
|
||||
|
||||
@ -57,7 +57,7 @@ const open = (record) => {
|
||||
|
||||
async function onDelete() {
|
||||
const _fn = isBatch.value ? batchDeletePlacementAccounts : deletePlacementAccount;
|
||||
const _params = isBatch.value ? { ids: accountId.value } : accountId.value;
|
||||
const _params = isBatch.value ? { ids: accountId.value } : { id: accountId.value };
|
||||
const { code } = await _fn(_params);
|
||||
if (code === 200) {
|
||||
AMessage.success('删除成功');
|
||||
|
||||
@ -85,10 +85,13 @@ const lastSyncedAt = ref(null);
|
||||
const syncType = ref('sync'); // sync | no_sync
|
||||
const showSyncTip = ref(false);
|
||||
|
||||
const form = ref({
|
||||
const INITIAL_FORM = {
|
||||
account: '',
|
||||
password: '',
|
||||
});
|
||||
};
|
||||
|
||||
const form = ref(cloneDeep(INITIAL_FORM));
|
||||
|
||||
let progressTimer = null;
|
||||
let statusPollingTimer = null;
|
||||
|
||||
@ -118,6 +121,7 @@ const close = () => {
|
||||
formRef.value?.resetFields();
|
||||
formRef.value?.clearValidate();
|
||||
|
||||
form.value = cloneDeep(INITIAL_FORM);
|
||||
isLoading.value = false;
|
||||
isCompleted.value = false;
|
||||
isSuccess.value = false;
|
||||
|
||||
@ -230,12 +230,12 @@ const handleChangeAll = (val) => {
|
||||
};
|
||||
const handleBatchDelete = () => {
|
||||
const ids = selectedItems.value.map((item) => item.id);
|
||||
const names = selectedItems.value.map((item) => `"${item.name}"`).join(',');
|
||||
const names = selectedItems.value.map((item) => `"${item.name || '-'}"`).join(',');
|
||||
deleteAccountRef.value?.open({ id: ids, name: names });
|
||||
};
|
||||
const handleDelete = (item) => {
|
||||
const { id, name } = item;
|
||||
deleteAccountRef.value?.open({ id, name: `"${name}"` });
|
||||
deleteAccountRef.value?.open({ id, name: `"${name || '-'}"` });
|
||||
};
|
||||
const handleCloseTip = () => {
|
||||
selectedItems.value = [];
|
||||
|
||||
Reference in New Issue
Block a user