diff --git a/src/api/shop/shopGoods/index.ts b/src/api/shop/shopGoods/index.ts index f2e503b..a52d0af 100644 --- a/src/api/shop/shopGoods/index.ts +++ b/src/api/shop/shopGoods/index.ts @@ -3,6 +3,12 @@ import type { ApiResult, PageResult } from '@/api'; import type { ShopGoods, ShopGoodsParam } from './model'; import { MODULES_API_URL } from '@/config/setting'; +export interface ConvertGoodsContentResult { + total: number; + success: number; + updatedGoodsIds: number[]; +} + /** * 分页查询商品 */ @@ -115,6 +121,30 @@ export async function getCount(params: ShopGoodsParam) { return Promise.reject(new Error(res.data.message)); } +/** + * 商品详情Markdown图片转HTML + */ +export async function convertMarkdownImagesToHtml(params?: { + tenantId?: number; + goodsId?: number; + code?: string; +}) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-goods/content/markdown-images/to-html', + null, + { + params + } + ); + if (res.data.code === 0) { + return { + message: res.data.message, + data: res.data.data + }; + } + return Promise.reject(new Error(res.data.message)); +} + /** * 导入商品 */ @@ -146,3 +176,19 @@ export async function importShopGoodsImages(file: File) { } return Promise.reject(new Error(res.data.message)); } + +/** + * 导入商品详情 + */ +export async function importShopGoodsDetails(file: File) { + const formData = new FormData(); + formData.append('file', file); + const res = await request.post>( + MODULES_API_URL + '/shop/shop-goods/import/details', + formData + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/views/shop/shopGoods/components/search.vue b/src/views/shop/shopGoods/components/search.vue index 155f7d1..dc73773 100644 --- a/src/views/shop/shopGoods/components/search.vue +++ b/src/views/shop/shopGoods/components/search.vue @@ -31,6 +31,23 @@ 导入图片 + + + 导入详情 + + + + 转换详情 + 导出xls @@ -70,7 +87,12 @@