From b5fb700e4e2488d1117748ccadec6ba00426c279 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Sun, 16 Apr 2023 22:30:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20mp/draft=E6=8B=86=E5=88=86=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mp/draft/components/CoverSelect.vue | 183 +++++ src/views/mp/draft/components/DraftTable.vue | 87 +++ src/views/mp/draft/components/NewsForm.vue | 302 ++++++++ src/views/mp/draft/components/index.ts | 7 + src/views/mp/draft/components/types.ts | 40 + src/views/mp/draft/index.vue | 719 +++--------------- 6 files changed, 704 insertions(+), 634 deletions(-) create mode 100644 src/views/mp/draft/components/CoverSelect.vue create mode 100644 src/views/mp/draft/components/DraftTable.vue create mode 100644 src/views/mp/draft/components/NewsForm.vue create mode 100644 src/views/mp/draft/components/index.ts create mode 100644 src/views/mp/draft/components/types.ts diff --git a/src/views/mp/draft/components/CoverSelect.vue b/src/views/mp/draft/components/CoverSelect.vue new file mode 100644 index 00000000..2c9c64b1 --- /dev/null +++ b/src/views/mp/draft/components/CoverSelect.vue @@ -0,0 +1,183 @@ + + + + + diff --git a/src/views/mp/draft/components/DraftTable.vue b/src/views/mp/draft/components/DraftTable.vue new file mode 100644 index 00000000..63cee31f --- /dev/null +++ b/src/views/mp/draft/components/DraftTable.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/src/views/mp/draft/components/NewsForm.vue b/src/views/mp/draft/components/NewsForm.vue new file mode 100644 index 00000000..a2b88a5b --- /dev/null +++ b/src/views/mp/draft/components/NewsForm.vue @@ -0,0 +1,302 @@ + + + + + diff --git a/src/views/mp/draft/components/index.ts b/src/views/mp/draft/components/index.ts new file mode 100644 index 00000000..51e843d3 --- /dev/null +++ b/src/views/mp/draft/components/index.ts @@ -0,0 +1,7 @@ +import type { Article, NewsItem, NewsItemList } from './types' +import { createEmptyNewsItem } from './types' +import DraftTable from './DraftTable.vue' +import NewsForm from './NewsForm.vue' + +export { DraftTable, NewsForm, createEmptyNewsItem } +export type { Article, NewsItem, NewsItemList } diff --git a/src/views/mp/draft/components/types.ts b/src/views/mp/draft/components/types.ts new file mode 100644 index 00000000..a8cf00c3 --- /dev/null +++ b/src/views/mp/draft/components/types.ts @@ -0,0 +1,40 @@ +interface NewsItem { + title: string + thumbMediaId: string + author: string + digest: string + showCoverPic: string + content: string + contentSourceUrl: string + needOpenComment: string + onlyFansCanComment: string + thumbUrl: string +} + +interface NewsItemList { + newsItem: NewsItem[] +} + +interface Article { + mediaId: string + content: NewsItemList + updateTime: number +} + +const createEmptyNewsItem = (): NewsItem => { + return { + title: '', + thumbMediaId: '', + author: '', + digest: '', + showCoverPic: '', + content: '', + contentSourceUrl: '', + needOpenComment: '', + onlyFansCanComment: '', + thumbUrl: '' + } +} + +export type { Article, NewsItem, NewsItemList } +export { createEmptyNewsItem } diff --git a/src/views/mp/draft/index.vue b/src/views/mp/draft/index.vue index cf0bb10d..9e188ec4 100644 --- a/src/views/mp/draft/index.vue +++ b/src/views/mp/draft/index.vue @@ -14,7 +14,13 @@ - + 新增 @@ -23,40 +29,13 @@ -
- -
+
-
- - - - -
-
-
-
- -
{{ news.title }}
-
-
- 下移 - 删除 - -
-
-
-
-
{{ news.title }}
-
- -
-
-
- 下移 - - 上移 - 删除 - -
-
-
- - - - - -
-
- -
- - - - - - - - - -

封面:

-
- - -
- - - 素材库选择 - - -
- - - -
-
- -

摘要:

- -
-
- - - - -
-
-
- -
-
+ + + + + +