diff --git a/src/views/property-marketing/media-account/account-manage/components/filter-block/index.vue b/src/views/property-marketing/media-account/account-manage/components/filter-block/index.vue index 7fb25cf..404ca9d 100644 --- a/src/views/property-marketing/media-account/account-manage/components/filter-block/index.vue +++ b/src/views/property-marketing/media-account/account-manage/components/filter-block/index.vue @@ -54,7 +54,7 @@ -
+
分组 diff --git a/src/views/property-marketing/put-account/account-manage/components/account-table/delete-account.vue b/src/views/property-marketing/put-account/account-manage/components/account-table/delete-account.vue new file mode 100644 index 0000000..f1752be --- /dev/null +++ b/src/views/property-marketing/put-account/account-manage/components/account-table/delete-account.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/src/views/property-marketing/put-account/account-manage/components/account-table/index.vue b/src/views/property-marketing/put-account/account-manage/components/account-table/index.vue index 8828433..e6e4da7 100644 --- a/src/views/property-marketing/put-account/account-manage/components/account-table/index.vue +++ b/src/views/property-marketing/put-account/account-manage/components/account-table/index.vue @@ -5,14 +5,12 @@ diff --git a/src/views/property-marketing/put-account/account-manage/components/add-account-modal/style.scss b/src/views/property-marketing/put-account/account-manage/components/add-account-modal/style.scss new file mode 100644 index 0000000..22fe718 --- /dev/null +++ b/src/views/property-marketing/put-account/account-manage/components/add-account-modal/style.scss @@ -0,0 +1,63 @@ +@import "@/views/property-marketing/component.scss"; +.add-put-account-modal { + border-radius: 8px; + .w-240px { + width: 240px !important; + } + .arco-modal-body { + .upload-block { + width: 100%; + .dt { + color: var(--Brand-Brand-6, #6d4cfe); + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; /* 157.143% */ + } + .import-row { + border-radius: 4px; + border: 1px solid var(--BG-400, #d7d7d9); + background: var(--BG-200, #f2f3f5); + .name { + color: var(--Text-1, #211f24); + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; /* 157.143% */ + } + &.error { + background: #ffe7e4; + color: #f64b31; + border: none; + .name { + color: #f64b31; + } + } + } + .arco-upload-drag { + height: 120px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + .arco-icon { + margin-bottom: 16px; + } + } + } + .upload-dragger { + border: 1px dashed #d9d9d9; + padding: 24px 0; + text-align: center; + background: #fafafa; + cursor: pointer; + } + .upload-error { + color: #f53f3f; + margin-left: 8px; + cursor: pointer; + } + } +} diff --git a/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue b/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue new file mode 100644 index 0000000..6303680 --- /dev/null +++ b/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue @@ -0,0 +1,177 @@ + + + + + + diff --git a/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/style.scss b/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/style.scss new file mode 100644 index 0000000..a476920 --- /dev/null +++ b/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/style.scss @@ -0,0 +1,49 @@ +@import '@/views/property-marketing/component.scss'; + +.authorized-account-modal { + border-radius: 8px; + .img-box { + position: relative; + .mask { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0.8; + background: #000; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + color: #fff; + .s1 { + color: var(--BG-White, #fff); + text-align: center; + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + } + } + } + .s2 { + color: var(--Text-1, #211f24); + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + } + .red-text { + overflow: hidden; + color: var(--Functional-Red-6, #f64b31); + text-overflow: ellipsis; + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + } +} diff --git a/src/views/property-marketing/put-account/account-manage/components/filter-block/index.vue b/src/views/property-marketing/put-account/account-manage/components/filter-block/index.vue index 39dc8f2..0e4ffbf 100644 --- a/src/views/property-marketing/put-account/account-manage/components/filter-block/index.vue +++ b/src/views/property-marketing/put-account/account-manage/components/filter-block/index.vue @@ -1,3 +1,4 @@ + + + + + + diff --git a/src/views/property-marketing/put-account/account-manage/components/import-prompt-modal/style.scss b/src/views/property-marketing/put-account/account-manage/components/import-prompt-modal/style.scss new file mode 100644 index 0000000..e299151 --- /dev/null +++ b/src/views/property-marketing/put-account/account-manage/components/import-prompt-modal/style.scss @@ -0,0 +1,14 @@ +@import "@/views/property-marketing/component.scss"; +.import-prompt-modal { + border-radius: 8px; + .arco-modal-body { + .tip { + color: var(--Text-1, #211f24); + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; /* 157.143% */ + } + } +} diff --git a/src/views/property-marketing/put-account/account-manage/components/status-box/index.vue b/src/views/property-marketing/put-account/account-manage/components/status-box/index.vue new file mode 100644 index 0000000..9a94451 --- /dev/null +++ b/src/views/property-marketing/put-account/account-manage/components/status-box/index.vue @@ -0,0 +1,96 @@ + + + + + + diff --git a/src/views/property-marketing/put-account/account-manage/constants.ts b/src/views/property-marketing/put-account/account-manage/constants.ts index 18c8201..703b871 100644 --- a/src/views/property-marketing/put-account/account-manage/constants.ts +++ b/src/views/property-marketing/put-account/account-manage/constants.ts @@ -20,17 +20,53 @@ export const PLATFORM_LIST = [ }, ]; +export enum EnumStatus { + NORMAL = 1, + PAUSE = 3, + UNAUTHORIZED = 0, + ABNORMAL = 2, + ABNORMAL_LOGIN = 4, + ABNORMAL_REQUEST = 5, + ABNORMAL_FREEZE = 6, +} + export const STATUS_LIST = [ { - label: '未授权', - value: 0, - }, - { + text: '正常', label: '正常', - value: 1, + value: EnumStatus.NORMAL, }, { + text: '暂停同步', + label: '暂停同步', + value: EnumStatus.PAUSE, + }, + { + text: '未授权', + label: '未授权', + value: EnumStatus.UNAUTHORIZED, + }, + { + text: '异常', label: '异常', - value: 2, + value: EnumStatus.ABNORMAL, + }, + { + text: '异常-登录状态失效', + label: '异常', + value: EnumStatus.ABNORMAL_LOGIN, + tooltip: '登录状态失效,需重新扫码授权', + }, + { + text: '异常-请求过于频繁', + label: '异常', + value: EnumStatus.ABNORMAL_REQUEST, + tooltip: '请求过于频繁,需等待24小时后重试', + }, + { + text: '异常-账号被冻结/封禁', + label: '异常', + value: EnumStatus.ABNORMAL_FREEZE, + tooltip: '账号被冻结/封禁', }, ]; diff --git a/src/views/property-marketing/put-account/account-manage/index.vue b/src/views/property-marketing/put-account/account-manage/index.vue index 44f7ff1..2b69bd9 100644 --- a/src/views/property-marketing/put-account/account-manage/index.vue +++ b/src/views/property-marketing/put-account/account-manage/index.vue @@ -4,50 +4,74 @@ --> @@ -70,11 +97,21 @@ import { ref } from 'vue'; import FilterBlock from './components/filter-block'; import AccountTable from './components/account-table'; +import AddAccountModal from './components/add-account-modal'; +import DeleteAccountModal from './components/account-table/delete-account'; + import { INITIAL_QUERY } from './constants'; +import { getMediaAccounts } from '@/api/all/propertyMarketing'; import icon1 from '@/assets/img/media-account/icon-add.png'; import icon4 from '@/assets/img/media-account/icon-success.png'; import icon5 from '@/assets/img/media-account/icon-warn.png'; +import icon6 from '@/assets/img/media-account/icon-close.png'; + +const groupManageModalRef = ref(null); +const tagsManageModalRef = ref(null); +const addAccountModalRef = ref(null); +const deleteAccountRef = ref(null); const tipStatus = ref(2); const pageInfo = reactive({ @@ -82,49 +119,103 @@ const pageInfo = reactive({ pageSize: 20, total: 100, }); - const query = ref(cloneDeep(INITIAL_QUERY)); const dataSource = ref([]); +const selectedItems = ref([]); const isNormalStatus = computed(() => tipStatus.value === 1); const isAbnormalStatus = computed(() => tipStatus.value === 2); +const checkedAll = computed(() => selectedItems.value.length === dataSource.value.length); +const indeterminate = computed( + () => selectedItems.value.length > 0 && selectedItems.value.length < dataSource.value.length, +); onMounted(() => { getData(); }); -const getData = () => { - console.log('getData', query.value, pageInfo); - dataSource.value = new Array(8).fill({ - id: 1, - name: '全球', - account_id: 1, - mobile: 1777777, - status: 1, - platform: 0, - operator: { - name: '小周', - }, - group: { - name: '美团组', - }, - tags: [ - { - name: '标签1', +const getData = async () => { + console.log('getData'); + // const { page, pageSize } = pageInfo; + // const { code, data, total } = await getMediaAccounts({ + // page, + // page_size: pageSize, + // ...query.value, + // }); + // if (code === 200) { + // dataSource.value = data.data; + // pageInfo.total = total; + // } + dataSource.value = [ + { + id: 1, + name: '全球', + account_id: 1, + mobile: 1777777, + status: 0, + platform: 0, + operator: { + name: '小周', }, - { - name: '标签2', + group: { + name: '美团组', }, - ], - }); + tags: [ + { + name: '标签1', + }, + { + name: '标签2', + }, + { + name: '标签3', + }, + { + name: '标签4', + }, + { + name: '标签5', + }, + ], + }, + { + id: 2, + name: '全球2', + account_id: 1, + mobile: 1777777, + status: 4, + platform: 0, + operator: { + name: '小周', + }, + group: { + name: '美团组', + }, + tags: [ + { + name: '标签1', + }, + { + name: '标签2', + }, + ], + }, + ]; }; -const handleSearch = (newQuery) => { - query.value = { ...newQuery }; +const reload = () => { + pageInfo.page = 1; + getData(); +}; +const handleSearch = () => { getData(); }; const handleReset = () => { + pageInfo.page = 1; + pageInfo.pageSize = 20; + pageInfo.total = 0; + selectedItems.value = []; query.value = cloneDeep(INITIAL_QUERY); - getData(); + reload(); }; const onPageChange = (current) => { @@ -133,8 +224,45 @@ const onPageChange = (current) => { }; const onPageSizeChange = (pageSize) => { pageInfo.pageSize = pageSize; - pageInfo.page = 1; - getData(); + reload(); +}; + +const handleOpenGroupModal = () => { + groupManageModalRef.value?.open(); +}; +const handleOpenAccountModal = () => { + addAccountModalRef.value?.open(); +}; + +const handleOpenEdit = (item) => { + addAccountModalRef.value?.open(item.id); +}; + +const handleSelectionChange = (val) => { + selectedItems.value = val; +}; +const handleChangeAll = (val) => { + if (val) { + selectedItems.value = cloneDeep(dataSource.value); + } else { + selectedItems.value = []; + } +}; +const handleBatchDelete = () => { + const ids = selectedItems.value.map((item) => item.id); + 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}"` }); +}; +const handleCloseTip = () => { + selectedItems.value = []; +}; +const handleOpenAbnormalAccount = () => { + query.value.status = 2; + reload(); }; diff --git a/src/views/property-marketing/put-account/account-manage/style.scss b/src/views/property-marketing/put-account/account-manage/style.scss index b0eb844..f916046 100644 --- a/src/views/property-marketing/put-account/account-manage/style.scss +++ b/src/views/property-marketing/put-account/account-manage/style.scss @@ -13,8 +13,6 @@ background: var(--BG-white, #fff); } .filter-wrap { - border-radius: 8px; - border: 1px solid #e6e6e8; .top { .title { font-family: 'Alibaba PuHuiTi'; @@ -58,6 +56,22 @@ font-weight: 400; line-height: 20px; /* 166.667% */ } + .operation-btn { + padding: 0; + cursor: pointer; + color: var(--Brand-Brand-6, #6d4cfe); + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; /* 157.143% */ + &:not(:last-child) { + margin-right: 16px; + } + &.red { + color: #F64B31; + } + } } .card-wrap { display: flex; @@ -68,6 +82,7 @@ padding: 16px 24px; justify-content: flex-end; align-items: center; + } } }