diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/components/PddShopColPage.vue b/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/components/PddShopColPage.vue new file mode 100644 index 00000000..eb6b932f --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/components/PddShopColPage.vue @@ -0,0 +1,79 @@ + + + diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/components/PddShopSidebarList.vue b/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/components/PddShopSidebarList.vue new file mode 100644 index 00000000..6e537c4e --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/components/PddShopSidebarList.vue @@ -0,0 +1,389 @@ + + + + + diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods-ad-fee/components/PddShopSidebarList.vue b/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods-ad-fee/components/PddShopSidebarList.vue deleted file mode 100644 index 0a1b8afc..00000000 --- a/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods-ad-fee/components/PddShopSidebarList.vue +++ /dev/null @@ -1,240 +0,0 @@ - - - diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods-ad-fee/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods-ad-fee/index.vue index ca87ee32..a5725e35 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods-ad-fee/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods-ad-fee/index.vue @@ -1,18 +1,17 @@ diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods/index.vue index 6946a059..e91c3820 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/channel/pdd/goods/index.vue @@ -4,11 +4,9 @@ import type { PddGoodsDTO, PddGoodsVO } from '#/api/channel/pdd/goods'; import type { PddShopVO } from '#/api/channel/pdd/shop'; import type { PageQueryDTO } from '#/types/common'; -import { computed, onMounted, ref } from 'vue'; +import { computed, onMounted, ref, watch } from 'vue'; -import { Page } from '@vben/common-ui'; - -import { Button, Image, Popconfirm, Space, Tag, message } from 'ant-design-vue'; +import { Button, Card, Image, Popconfirm, Space, Tag, message } from 'ant-design-vue'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { @@ -16,18 +14,20 @@ import { getPddGoodsPageApi, } from '#/api/channel/pdd/goods'; import { getPddShopPageApi } from '#/api/channel/pdd/shop'; - -import PddGoodsDetailDrawer from './components/PddGoodsDetailDrawer.vue'; +import PddShopColPage from '#/views/channel/pdd/components/PddShopColPage.vue'; import PddShopDetailModal from '#/views/channel/pdd/shop/components/PddShopDetailModal.vue'; import ProductDetailDrawer from '#/views/ec/product/list/components/ProductDetailDrawer.vue'; +import PddGoodsDetailDrawer from './components/PddGoodsDetailDrawer.vue'; + defineOptions({ name: 'PddGoodsManagement' }); const loading = ref(false); const detailDrawerRef = ref>(); const shopDetailModalRef = ref>(); const productDetailDrawerRef = ref>(); -const shopOptions = ref<{ label: string; value: number }[]>([]); +/** 左侧选中的拼多多渠道店铺 ID */ +const selectedShopId = ref(undefined); const shopNameById = ref>({}); const searchForm = ref({ @@ -39,35 +39,34 @@ const searchForm = ref({ const gridReloadRef = ref void)>(null); -async function loadShops() { +async function loadShopNames() { try { const data = await getPddShopPageApi({ page: 1, pageSize: 500, filters: {}, }); - const list = data.records ?? []; - shopOptions.value = list.map((s: PddShopVO.Info) => ({ - label: s.mallName || `店铺#${s.id}`, - value: s.id, - })); const map: Record = {}; - for (const s of list) { + for (const s of data.records ?? []) { map[s.id] = s.mallName || `店铺#${s.id}`; } shopNameById.value = map; - - await gridApi.formApi?.updateSchema([ - { - fieldName: 'shopId', - componentProps: { options: shopOptions.value }, - }, - ]); } catch { message.error('获取渠道店铺失败'); } } +function onShopSelect(shop: PddShopVO.Info | null) { + if (!shop) { + selectedShopId.value = undefined; + searchForm.value.shopId = undefined; + return; + } + selectedShopId.value = shop.id; + searchForm.value.shopId = shop.id; + shopNameById.value[shop.id] = shop.mallName || `店铺#${shop.id}`; +} + const gridOptions: VxeGridProps = { columns: [ { type: 'seq' as const, width: 56, title: '序号' }, @@ -134,7 +133,7 @@ const gridOptions: VxeGridProps = { slots: { default: 'action' }, }, ], - height: 'auto', + height: '100%', border: true, stripe: true, rowConfig: { isHover: true, height: 72 }, @@ -203,22 +202,6 @@ const gridOptions: VxeGridProps = { const formOptions = computed(() => ({ schema: [ - { - component: 'Select', - componentProps: { - placeholder: '全部店铺', - options: shopOptions.value, - allowClear: true, - showSearch: true, - optionFilterProp: 'label', - onChange: (val: number | undefined) => { - searchForm.value.shopId = val; - gridReloadRef.value?.(); - }, - }, - fieldName: 'shopId', - label: '渠道店铺', - }, { component: 'Input', componentProps: { @@ -283,11 +266,15 @@ const [Grid, gridApi] = useVbenVxeGrid({ gridOptions, formOptions: formOptions.value, showSearchForm: true, - tableTitle: '拼多多渠道商品', + tableTitle: '', }); gridReloadRef.value = () => gridApi.reload(); +watch(selectedShopId, () => { + gridApi.reload(); +}); + function openDetail(row: PddGoodsVO.Info) { const shopLabel = row.shopId ? shopNameById.value[row.shopId] @@ -322,13 +309,30 @@ async function handleDelete(row: PddGoodsVO.Info) { } onMounted(async () => { - await loadShops(); + await loadShopNames(); }); diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/company/components/CompanySidebarList.vue b/ecom-dmb-frontend/apps/web-antd/src/views/company/components/CompanySidebarList.vue new file mode 100644 index 00000000..f4930a4b --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/views/company/components/CompanySidebarList.vue @@ -0,0 +1,330 @@ + + + + + diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/company/menu/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/company/menu/index.vue index 274835bb..9737505e 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/company/menu/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/company/menu/index.vue @@ -1,19 +1,13 @@ diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/company/permission/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/company/permission/index.vue index 31d0a8fc..4291b586 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/company/permission/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/company/permission/index.vue @@ -4,17 +4,11 @@ import type { PermissionVO } from '#/api/sys/permission/types'; import { computed, onMounted, ref } from 'vue'; -import { Page } from '@vben/common-ui'; -import { createIconifyIcon } from '@vben/icons'; - import { Button, Card, Empty, - Flex, - Input, message, - Select, Space, Spin, Tag, @@ -25,13 +19,11 @@ import { batchUpdateCompanyPermissionsApi, getCompanyPermissionIdsApi, } from '#/api/company/permission/apis'; -import { getCompanyPageApi } from '#/api/company'; import { getPermissionTreeApi } from '#/api/sys/permission'; +import CompanyColPage from '#/views/company/components/CompanyColPage.vue'; defineOptions({ name: 'CompanyPermissionManagePage' }); -const BuildingIcon = createIconifyIcon('lucide:building-2'); - type PermissionTreeNode = { key: number; title: string; @@ -40,15 +32,7 @@ type PermissionTreeNode = { children?: PermissionTreeNode[]; }; -const companySearchForm = ref({ - name: '', - status: undefined as number | undefined, -}); - -const companyList = ref([]); -const companyLoading = ref(false); -const companyPagination = ref({ current: 1, pageSize: 20, total: 0 }); - +const selectedCompanyId = ref(undefined); const currentCompany = ref(null); const permissionTree = ref([]); @@ -57,13 +41,6 @@ const companyPermissionIds = ref([]); const selectedPermissionIds = ref([]); const expandedKeys = ref([]); -const selectedCompanyLabel = computed(() => { - if (!currentCompany.value) { - return '请先选择公司'; - } - return currentCompany.value.name; -}); - const permissionTreeData = computed(() => mapPermissionToTreeData(permissionTree.value), ); @@ -118,29 +95,10 @@ function collectExpandableKeys(nodes: PermissionVO.PermissionInfoVO[]): number[] return keys; } -async function searchCompanies() { - companyLoading.value = true; - try { - const result = await getCompanyPageApi({ - page: companyPagination.value.current, - pageSize: companyPagination.value.pageSize, - filters: { - name: companySearchForm.value.name || undefined, - status: companySearchForm.value.status, - }, - }); - companyList.value = result.records; - companyPagination.value.total = result.total; - } catch (error: any) { - message.error(error?.message || '获取公司列表失败'); - } finally { - companyLoading.value = false; - } -} - -async function selectCompany(company: CompanyVO.CompanyInfoVO) { +function onCompanySelect(company: CompanyVO.CompanyInfoVO) { currentCompany.value = company; - await loadCompanyPermissions(); + selectedCompanyId.value = company.id; + void loadCompanyPermissions(); } async function loadCompanyPermissions() { @@ -191,31 +149,6 @@ async function handleSave() { } } -function resetCompanySearch() { - companySearchForm.value = { name: '', status: undefined }; - companyPagination.value.current = 1; - searchCompanies(); -} - -function handleCompanyPageChange(page: number, pageSize: number) { - companyPagination.value.current = page; - companyPagination.value.pageSize = pageSize; - searchCompanies(); -} - -const companyTotalPages = computed(() => { - const { total, pageSize } = companyPagination.value; - return Math.max(1, Math.ceil(total / pageSize) || 1); -}); - -function goCompanyPage(page: number) { - const next = Math.min(companyTotalPages.value, Math.max(1, page)); - if (next === companyPagination.value.current) { - return; - } - handleCompanyPageChange(next, companyPagination.value.pageSize); -} - function countLeafPermissions(nodes: PermissionVO.PermissionInfoVO[]): number { let count = 0; for (const node of nodes) { @@ -246,237 +179,101 @@ function selectNone() { } onMounted(() => { - searchCompanies(); - loadPermissionTree(); + void loadPermissionTree(); }); diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ec/ad-fee/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ec/ad-fee/index.vue index 0d343f0b..cd6e782c 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ec/ad-fee/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ec/ad-fee/index.vue @@ -1,32 +1,25 @@ diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ec/brush-order/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ec/brush-order/index.vue index 92bef178..2b9ecc5e 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ec/brush-order/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ec/brush-order/index.vue @@ -2,18 +2,17 @@ import type { VxeGridProps } from '#/adapter/vxe-table'; import type { BrushOrderDTO, BrushOrderVO } from '#/api/ec/brush-order'; import type { ProductDTO, ProductVO } from '#/api/ec/product/types'; +import type { ShopVO } from '#/api/ec/shop/types'; import type { PageQueryDTO } from '#/types/common'; -import { computed, ref, watch } from 'vue'; +import { ref, watch } from 'vue'; -import { Page } from '@vben/common-ui'; import { createIconifyIcon } from '@vben/icons'; import { Button, Card, DatePicker, - Flex, InputNumber, message, Popconfirm, @@ -27,7 +26,7 @@ import { getBrushOrderPageApi, } from '#/api/ec/brush-order'; import { getProductPageApi } from '#/api/ec/product'; -import ShopSidebarList from '#/views/ec/components/ShopSidebarList.vue'; +import EcShopColPage from '#/views/ec/components/EcShopColPage.vue'; import BrushOrderFormModal from './components/BrushOrderFormModal.vue'; @@ -39,7 +38,6 @@ const loading = ref(false); /** 未选店铺:undefined 表示全部 */ const selectedShopId = ref(undefined); -const selectedShopName = ref(undefined); const formModalVisible = ref(false); const currentBrushOrderData = ref(null); @@ -114,21 +112,8 @@ function handleProductPopupScroll(e: Event) { } } -const selectedShopLabel = computed(() => { - if (selectedShopId.value == null) { - return '全部店铺'; - } - return selectedShopName.value || `店铺 #${selectedShopId.value}`; -}); - -function onShopSelect(shop: { id: number; name: string } | null) { - if (!shop) { - selectedShopId.value = undefined; - selectedShopName.value = undefined; - return; - } - selectedShopId.value = shop.id; - selectedShopName.value = shop.name; +function onShopSelect(shop: ShopVO.Info | null) { + selectedShopId.value = shop?.id; } function handleAddForShop(shopId: number) { @@ -254,7 +239,7 @@ function refreshTable() { const [Grid, gridApi] = useVbenVxeGrid({ gridOptions, showSearchForm: false, - tableTitle: '刷单记录', + tableTitle: '', }); watch(selectedShopId, () => { @@ -301,136 +286,118 @@ const formatAmount = (amount: number) => `¥${amount.toFixed(2)}`; -