diff --git a/apps/admin/src/views/goods/GoodsView.vue b/apps/admin/src/views/goods/GoodsView.vue index 3a9060e..309702e 100644 --- a/apps/admin/src/views/goods/GoodsView.vue +++ b/apps/admin/src/views/goods/GoodsView.vue @@ -7,7 +7,7 @@ import { FolderAdd, Aim, ArrowDown, } from '@element-plus/icons-vue' import type { - CategoryTree, Country, Tag, TagGroup, Good, GoodDetail, Position, + CategoryTree, Country, Tag, TagGroup, Good, GoodDetail, OriginGoodsTreeResponse, } from '@/types' import { goodsApi } from '@/api/goods' @@ -15,7 +15,6 @@ import { countriesApi } from '@/api/countries' import { categoriesApi } from '@/api/categories' import { tagsApi } from '@/api/tags' import { tagGroupsApi } from '@/api/tag-groups' -import { positionsApi } from '@/api/positions' import { originGoodsApi } from '@/api/origin-goods' import { syncApi } from '@/api/sync' @@ -365,7 +364,6 @@ const configForm = ref({ countryId: '', cascaderCategory: [] as string[], categoryId: '', tagIds: [] as string[], positionId: '', goodImage: '', }) -const configPositions = ref([]) function openConfigModal(og: any, dropTarget: any) { configOG.value = og @@ -379,7 +377,6 @@ function openConfigModal(og: any, dropTarget: any) { configForm.value.countryId = dropTarget.id } } - loadConfigPositions() configVisible.value = true } @@ -393,19 +390,8 @@ function openConfigFromRightTree(data: any) { }, null) } -async function loadConfigPositions() { - const params: any = { page: 1, pageSize: 200 } - if (configForm.value.countryId) params.countryId = configForm.value.countryId - if (configForm.value.categoryId) params.categoryId = configForm.value.categoryId - try { - const res = await positionsApi.getPositionsList(params) as any - configPositions.value = Array.isArray(res) ? res : (res.items ?? []) - } catch { configPositions.value = [] } -} - function onConfigCascaderChange(val: string[]) { configForm.value.categoryId = val.length ? val[val.length - 1] : '' - loadConfigPositions() } async function handleConfigSubmit() { @@ -434,36 +420,23 @@ async function handleConfigSubmit() { // ─── Custom Good ─── const customVisible = ref(false) const customLoading = ref(false) -const customPositions = ref([]) const customForm = ref({ goodName: '', goodImage: '', goodPrice: '', countryId: '', cascaderCategory: [] as string[], categoryId: '', tagIds: [] as string[], - positionId: '', goodPriority: 0, + goodPriority: 0, }) function openCustomCreate() { customForm.value = { goodName: '', goodImage: '', goodPrice: '', countryId: '', - cascaderCategory: [], categoryId: '', tagIds: [], positionId: '', goodPriority: 0, + cascaderCategory: [], categoryId: '', tagIds: [], goodPriority: 0, } - customPositions.value = [] customVisible.value = true } -async function loadCustomPositions() { - const params: any = { page: 1, pageSize: 200 } - if (customForm.value.countryId) params.countryId = customForm.value.countryId - if (customForm.value.categoryId) params.categoryId = customForm.value.categoryId - try { - const res = await positionsApi.getPositionsList(params) as any - customPositions.value = Array.isArray(res) ? res : (res.items ?? []) - } catch { customPositions.value = [] } -} - function onCustomCascaderChange(val: any) { const path = Array.isArray(val) ? val : [] customForm.value.categoryId = path.length ? String(path[path.length - 1]) : '' - loadCustomPositions() } async function handleCustomCreate() { @@ -479,7 +452,6 @@ async function handleCustomCreate() { countryId: Number(customForm.value.countryId), categoryId: Number(customForm.value.categoryId), tagIds: customForm.value.tagIds.map(Number), - positionId: customForm.value.positionId ? Number(customForm.value.positionId) : undefined, goodPriority: customForm.value.goodPriority, detail: {}, }) @@ -599,7 +571,6 @@ async function openEdit(g: Good) { positionId: g.positionId || '', } editVisible.value = true - loadEditPositions() editDetailLoading.value = true try { const detail = await goodsApi.getGoodById(g.id) @@ -736,17 +707,6 @@ async function handleEditSubmit() { function onEditCascaderChange(val: any) { const path = Array.isArray(val) ? val : [] editForm.value.categoryId = path.length ? String(path[path.length - 1]) : '' - loadEditPositions() -} - -async function loadEditPositions() { - const params: any = { page: 1, pageSize: 200 } - if (editForm.value.countryId) params.countryId = editForm.value.countryId - if (editForm.value.categoryId) params.categoryId = editForm.value.categoryId - try { - const res = await positionsApi.getPositionsList(params) as any - configPositions.value = Array.isArray(res) ? res : (res.items ?? []) - } catch { configPositions.value = [] } } async function handleDeleteGood(g: Good) { @@ -1760,7 +1720,7 @@ onMounted(() => loadAll())
- + @@ -1784,11 +1744,6 @@ onMounted(() => loadAll())
- - - - -