From 031a96b14e4b6a916b44e375cf3438b95c722d42 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Mon, 6 Jul 2026 11:11:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85md=E8=BD=AChtml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop/shopGoods/index.ts | 46 ++++++++++++ .../shop/shopGoods/components/search.vue | 34 ++++++++- .../shopGoods/components/shopGoodsEdit.vue | 17 +++-- src/views/shop/shopGoods/index.vue | 75 +++++++++++++++++-- 4 files changed, 158 insertions(+), 14 deletions(-) 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 @@