This commit is contained in:
xingyu4j
2025-11-13 16:57:06 +08:00
parent ccab033c4b
commit 8a4af8c55b
4 changed files with 15 additions and 17 deletions

View File

@@ -25,7 +25,7 @@ import {
Typography,
} from 'ant-design-vue';
import * as CouponTemplateApi from '#/api/mall/promotion/coupon/couponTemplate';
import { getCouponTemplateList } from '#/api/mall/promotion/coupon/couponTemplate';
import UploadImg from '#/components/upload/image-upload.vue';
import { ColorInput } from '#/views/mall/promotion/components';
import CouponSelect from '#/views/mall/promotion/coupon/components/select.vue';
@@ -66,9 +66,7 @@ watch(
() => formData.value.couponIds,
async () => {
if (formData.value.couponIds?.length > 0) {
couponList.value = await CouponTemplateApi.getCouponTemplateList(
formData.value.couponIds,
);
couponList.value = await getCouponTemplateList(formData.value.couponIds);
}
},
{

View File

@@ -5,7 +5,7 @@ import type { MallFavoriteApi } from '#/api/mall/product/favorite';
import { DICT_TYPE } from '@vben/constants';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import * as FavoriteApi from '#/api/mall/product/favorite';
import { getFavoritePage } from '#/api/mall/product/favorite';
const props = defineProps<{
userId: number;
@@ -72,7 +72,7 @@ const [Grid] = useVbenVxeGrid({
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
return await FavoriteApi.getFavoritePage({
return await getFavoritePage({
pageNo: page.currentPage,
pageSize: page.pageSize,
userId: props.userId,

View File

@@ -9,9 +9,9 @@ import { IconifyIcon } from '@vben/icons';
import { Button, Pagination, Row, Spin } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import * as MpDraftApi from '#/api/mp/draft';
import * as MpFreePublishApi from '#/api/mp/freePublish';
import * as MpMaterialApi from '#/api/mp/material';
import { getDraftPage } from '#/api/mp/draft';
import { getFreePublishPage } from '#/api/mp/freePublish';
import { getMaterialPage } from '#/api/mp/material';
import { WxNews, WxVideoPlayer, WxVoicePlayer } from '#/views/mp/components';
import { NewsType } from '../constants';
@@ -140,7 +140,7 @@ const [VoiceGrid, voiceGridApi] = useVbenVxeGrid({
return { list: [], total: 0 };
}
// TODO @dylan不要带 MpMaterialApi
return await MpMaterialApi.getMaterialPage({
return await getMaterialPage({
pageNo: page.currentPage,
pageSize: page.pageSize,
accountId: finalAccountId,
@@ -176,7 +176,7 @@ const [VideoGrid, videoGridApi] = useVbenVxeGrid({
if (finalAccountId === undefined || finalAccountId === null) {
return { list: [], total: 0 };
}
return await MpMaterialApi.getMaterialPage({
return await getMaterialPage({
pageNo: page.currentPage,
pageSize: page.pageSize,
accountId: finalAccountId,
@@ -200,7 +200,7 @@ function selectMaterialFun(item: any) {
}
async function getMaterialPageFun() {
const data = await MpMaterialApi.getMaterialPage({
const data = await getMaterialPage({
...queryParams,
type: props.type,
});
@@ -209,7 +209,7 @@ async function getMaterialPageFun() {
}
async function getFreePublishPageFun() {
const data = await MpFreePublishApi.getFreePublishPage(queryParams);
const data = await getFreePublishPage(queryParams);
data.list.forEach((item: any) => {
const articles = item.content.newsItem;
articles.forEach((article: any) => {
@@ -221,7 +221,7 @@ async function getFreePublishPageFun() {
}
async function getDraftPageFun() {
const data = await MpDraftApi.getDraftPage(queryParams);
const data = await getDraftPage(queryParams);
data.list.forEach((draft: any) => {
const articles = draft.content.newsItem;
articles.forEach((article: any) => {

View File

@@ -15,7 +15,7 @@ import {
Tabs,
} from 'ant-design-vue';
import * as MpMaterialApi from '#/api/mp/material';
import { deletePermanentMaterial, getMaterialPage } from '#/api/mp/material';
import { WxAccountSelect } from '#/views/mp/components';
import ImageTable from './components/ImageTable.vue';
@@ -57,7 +57,7 @@ function onAccountChanged(id: number) {
async function getList() {
loading.value = true;
try {
const data = await MpMaterialApi.getMaterialPage({
const data = await getMaterialPage({
...queryParams,
type: type.value,
});
@@ -89,7 +89,7 @@ async function handleDelete(id: number) {
content: '此操作将永久删除该文件, 是否继续?',
title: '提示',
async onOk() {
await MpMaterialApi.deletePermanentMaterial(id);
await deletePermanentMaterial(id);
message.success('删除成功');
await getList();
},