diff --git a/src/assets/img/media-account/icon-default-qrcode.png b/src/assets/img/media-account/icon-default-qrcode.png new file mode 100644 index 0000000..418d5e7 Binary files /dev/null and b/src/assets/img/media-account/icon-default-qrcode.png differ diff --git a/src/views/property-marketing/media-account/account-manage/components/account-table/index.vue b/src/views/property-marketing/media-account/account-manage/components/account-table/index.vue index d4cbb0b..135950c 100644 --- a/src/views/property-marketing/media-account/account-manage/components/account-table/index.vue +++ b/src/views/property-marketing/media-account/account-manage/components/account-table/index.vue @@ -149,8 +149,7 @@ const openDelete = (item) => { }; const handleReauthorize = (item) => { - // const isUnauthorized = isUnauthorizedStatus(item.status); - const isUnauthorized = false; + const isUnauthorized = isUnauthorizedStatus(item.status); if (isUnauthorized) { authorizedAccountModalRef.value?.open(item.id); } else { diff --git a/src/views/property-marketing/media-account/account-manage/components/authorized-account-modal/index.vue b/src/views/property-marketing/media-account/account-manage/components/authorized-account-modal/index.vue index 4ec6378..cb00cee 100644 --- a/src/views/property-marketing/media-account/account-manage/components/authorized-account-modal/index.vue +++ b/src/views/property-marketing/media-account/account-manage/components/authorized-account-modal/index.vue @@ -32,7 +32,20 @@ -->
- + + +

二维码失效

@@ -108,7 +121,8 @@ const isSuccess = ref(false); const failReason = ref(''); const progress = ref(0); const id = ref(''); -const imgUrl = ref(''); +const qrCodeUrl = ref(''); +const qrCodeLoading = ref(false); const taskStep = ref(TASK_STEP.default); // const hasUnsyncData = ref(false); // 含有未同步数据 @@ -143,7 +157,8 @@ const resetTaskFields = () => { isSuccess.value = false; failReason.value = ''; progress.value = 0; - imgUrl.value = ''; + qrCodeUrl.value = ''; + qrCodeLoading.value = false; isNicknameChanged.value = false; actionType.value = 1; taskStep.value = TASK_STEP.default; @@ -184,16 +199,21 @@ const startStatusPolling = () => { }; const getAuthorizedQrCode = async () => { - const { code, data } = await getAuthorizedImage(id.value); - if (code === 200) { - imgUrl.value = data.image; - overdueTimer = null; - isOverdue.value = false; + try { + qrCodeLoading.value = true; + const { code, data } = await getAuthorizedImage(id.value); + if (code === 200) { + qrCodeUrl.value = data.image; + overdueTimer = null; + isOverdue.value = false; - // 约定:后端限制40s内必须扫码,前端定30s后失效 - overdueTimer = setTimeout(() => { - isOverdue.value = true; - }, OVERDUE_TIME); + // 约定:后端限制40s内必须扫码,前端定30s后失效 + overdueTimer = setTimeout(() => { + isOverdue.value = true; + }, OVERDUE_TIME); + } + } finally { + qrCodeLoading.value = false; } }; @@ -246,8 +266,8 @@ const handleOk = () => { if (taskStep.value === TASK_STEP.default) { clearOverdueTimer(); - if (!imgUrl.value) { - AMessage.error('二维码获取中,请稍等'); + if (!qrCodeUrl.value) { + AMessage.error('二维码生成中,请稍等'); return; } if (isOverdue.value) { diff --git a/src/views/property-marketing/media-account/account-manage/constants.ts b/src/views/property-marketing/media-account/account-manage/constants.ts index 0185fde..f9f572a 100644 --- a/src/views/property-marketing/media-account/account-manage/constants.ts +++ b/src/views/property-marketing/media-account/account-manage/constants.ts @@ -36,6 +36,7 @@ export enum EnumStatus { ABNORMAL_LOGIN = 4, ABNORMAL_REQUEST = 5, ABNORMAL_FREEZE = 6, + ABNORMAL_MISSING = 7, } export const STATUS_LIST = [ @@ -59,6 +60,11 @@ export const STATUS_LIST = [ label: '异常', value: EnumStatus.ABNORMAL, }, + { + text: '数据缺失', + label: '数据缺失', + value: EnumStatus.ABNORMAL_MISSING, + }, { text: '异常-登录状态失效', label: '异常', diff --git a/src/views/property-marketing/media-account/account-manage/index.vue b/src/views/property-marketing/media-account/account-manage/index.vue index 59d1592..87e4a26 100644 --- a/src/views/property-marketing/media-account/account-manage/index.vue +++ b/src/views/property-marketing/media-account/account-manage/index.vue @@ -212,12 +212,8 @@ const handleOpenEdit = (item) => { const handleSelectionChange = (val) => { selectedItems.value = val; }; -const handleChangeAll = (val) => { - if (val) { - selectedItems.value = cloneDeep(dataSource.value); - } else { - selectedItems.value = []; - } +const handleChangeAll = (checked) => { + selectedItems.value = checked ? cloneDeep(dataSource.value) : []; }; const handleBatchDelete = () => { const ids = selectedItems.value.map((item) => item.id);