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

View File

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

View File

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

View File

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