feat: mp
This commit is contained in:
@@ -97,7 +97,7 @@ function onUploadError(err: Error) {
|
||||
/>
|
||||
<IconifyIcon
|
||||
v-else
|
||||
icon="ep:plus"
|
||||
icon="lucide:plus"
|
||||
class="avatar-uploader-icon"
|
||||
:class="isFirst ? 'avatar' : 'avatar1'"
|
||||
/>
|
||||
@@ -11,15 +11,9 @@ const props = defineProps<{
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="draft-content">
|
||||
<div class="p-2.5">
|
||||
<div v-if="props.row.content && props.row.content.newsItem">
|
||||
<WxNews :articles="props.row.content.newsItem" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.draft-content {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -109,7 +109,7 @@ function plusNews() {
|
||||
size="small"
|
||||
@click="() => moveDownNews(index)"
|
||||
>
|
||||
<IconifyIcon icon="ep:arrow-down-bold" />
|
||||
<IconifyIcon icon="lucide:arrow-down" />
|
||||
</Button>
|
||||
<Button
|
||||
v-if="isCreating"
|
||||
@@ -119,7 +119,7 @@ function plusNews() {
|
||||
size="small"
|
||||
@click="() => removeNews(index)"
|
||||
>
|
||||
<IconifyIcon icon="ep:delete" />
|
||||
<IconifyIcon icon="lucide:trash-2" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -143,7 +143,7 @@ function plusNews() {
|
||||
size="small"
|
||||
@click="() => moveDownNews(index)"
|
||||
>
|
||||
<IconifyIcon icon="ep:arrow-down-bold" />
|
||||
<IconifyIcon icon="lucide:arrow-down" />
|
||||
</Button>
|
||||
<Button
|
||||
v-if="index > 0"
|
||||
@@ -152,7 +152,7 @@ function plusNews() {
|
||||
size="small"
|
||||
@click="() => moveUpNews(index)"
|
||||
>
|
||||
<IconifyIcon icon="ep:arrow-up-bold" />
|
||||
<IconifyIcon icon="lucide:arrow-up" />
|
||||
</Button>
|
||||
<Button
|
||||
v-if="isCreating"
|
||||
@@ -162,7 +162,7 @@ function plusNews() {
|
||||
shape="circle"
|
||||
@click="() => removeNews(index)"
|
||||
>
|
||||
<IconifyIcon icon="ep:delete" />
|
||||
<IconifyIcon icon="lucide:trash-2" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -174,7 +174,7 @@ function plusNews() {
|
||||
@click="plusNews"
|
||||
v-if="newsList.length < 8 && isCreating"
|
||||
>
|
||||
<IconifyIcon icon="ep:plus" />
|
||||
<IconifyIcon icon="lucide:plus" />
|
||||
</Button>
|
||||
</Row>
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { Article } from './modules/types';
|
||||
import type { Article } from './components/types';
|
||||
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
|
||||
@@ -12,10 +12,10 @@ import { message } from 'ant-design-vue';
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import * as MpDraftApi from '#/api/mp/draft';
|
||||
import * as MpFreePublishApi from '#/api/mp/freePublish';
|
||||
import { createEmptyNewsItem } from '#/views/mp/draft/modules/types';
|
||||
import { createEmptyNewsItem } from '#/views/mp/draft/components/types';
|
||||
|
||||
import DraftTableCell from './components/draft-table.vue';
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import DraftTableCell from './modules/draft-table.vue';
|
||||
import Form from './modules/form.vue';
|
||||
|
||||
defineOptions({ name: 'MpDraft' });
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { NewsItem } from './types';
|
||||
import type { NewsItem } from '../components/types';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
@@ -7,9 +7,9 @@ import { confirm, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message, Spin } from 'ant-design-vue';
|
||||
|
||||
import * as MpDraftApi from '#/api/mp/draft';
|
||||
import { createDraft, updateDraft } from '#/api/mp/draft';
|
||||
|
||||
import NewsForm from './news-form.vue';
|
||||
import NewsForm from '../components/news-form.vue';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
@@ -37,10 +37,10 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.lock();
|
||||
try {
|
||||
if (formData.value.isCreating) {
|
||||
await MpDraftApi.createDraft(formData.value.accountId, newsList.value);
|
||||
await createDraft(formData.value.accountId, newsList.value);
|
||||
message.success('新增成功');
|
||||
} else if (formData.value.mediaId) {
|
||||
await MpDraftApi.updateDraft(
|
||||
await updateDraft(
|
||||
formData.value.accountId,
|
||||
formData.value.mediaId,
|
||||
newsList.value,
|
||||
|
||||
Reference in New Issue
Block a user