fix: 冲突
This commit is contained in:
@@ -17,12 +17,6 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
minWidth: 300,
|
||||
slots: { default: 'content' },
|
||||
},
|
||||
// {
|
||||
// field: 'updateTime',
|
||||
// title: '更新时间',
|
||||
// minWidth: 180,
|
||||
// formatter: 'formatDateTime', // TODO @YunaiV 接口返回数据不对,需要乘1000
|
||||
// },
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { $t } from '@vben/locales';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import * as MpDraftApi from '#/api/mp/draft';
|
||||
import { deleteDraft, getDraftPage } from '#/api/mp/draft';
|
||||
// DONE @hw:MpFreePublishApi 去掉,直接 import;参考别的模块哈;
|
||||
import { submitFreePublish } from '#/api/mp/freePublish';
|
||||
import { createEmptyNewsItem } from '#/views/mp/draft/modules/types';
|
||||
@@ -22,16 +22,16 @@ import Form from './modules/form.vue';
|
||||
// DONE @hw:看看这个 watch、provide 能不能简化掉;
|
||||
defineOptions({ name: 'MpDraft' });
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 新增按钮操作 */
|
||||
async function handleCreate() {
|
||||
const formValues = await gridApi.formApi.getValues();
|
||||
@@ -108,7 +108,7 @@ async function handleDelete(row: Article) {
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await MpDraftApi.deleteDraft(accountId, row.mediaId);
|
||||
await deleteDraft(accountId, row.mediaId);
|
||||
message.success('删除成功');
|
||||
handleRefresh();
|
||||
} finally {
|
||||
@@ -128,7 +128,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
const drafts = await MpDraftApi.getDraftPage({
|
||||
const drafts = await getDraftPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
@@ -169,7 +169,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<DocAlert title="公众号图文" url="https://doc.iocoder.cn/mp/article/" />
|
||||
</template>
|
||||
|
||||
<!-- DONE @hw:参考别的模块 @success 调用 refresh 方法; -->
|
||||
<FormModal @success="handleRefresh" />
|
||||
|
||||
<Grid table-title="草稿列表">
|
||||
|
||||
@@ -11,7 +11,6 @@ import { useAccessStore } from '@vben/stores';
|
||||
import { Button, Image, message, Modal, Upload } from 'ant-design-vue';
|
||||
|
||||
import { UploadType, useBeforeUpload } from '#/utils/useUpload';
|
||||
import { MaterialSelect } from '#/views/mp/components';
|
||||
|
||||
const props = defineProps<{
|
||||
isFirst: boolean;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { Article } from './types';
|
||||
|
||||
import { News } from '#/views/mp/components';
|
||||
import { WxNews } from '#/views/mp/components';
|
||||
|
||||
defineOptions({ name: 'DraftTableCell' });
|
||||
|
||||
@@ -13,7 +13,7 @@ const props = defineProps<{
|
||||
<template>
|
||||
<div class="p-2.5">
|
||||
<div v-if="props.row.content && props.row.content.newsItem">
|
||||
<News :articles="props.row.content.newsItem" />
|
||||
<WxNews :articles="props.row.content.newsItem" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -23,7 +23,7 @@ interface Article {
|
||||
updateTime: number;
|
||||
}
|
||||
|
||||
const createEmptyNewsItem = (): NewsItem => {
|
||||
function createEmptyNewsItem(): NewsItem {
|
||||
return {
|
||||
title: '',
|
||||
thumbMediaId: '',
|
||||
@@ -36,7 +36,7 @@ const createEmptyNewsItem = (): NewsItem => {
|
||||
onlyFansCanComment: 0,
|
||||
thumbUrl: '',
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export type { Article, NewsItem, NewsItemList };
|
||||
export { createEmptyNewsItem };
|
||||
|
||||
Reference in New Issue
Block a user