diff --git a/apps/web-antd/.env.development b/apps/web-antd/.env.development index cff255764..fe07e867c 100644 --- a/apps/web-antd/.env.development +++ b/apps/web-antd/.env.development @@ -4,9 +4,9 @@ VITE_PORT=5666 VITE_BASE=/ # 请求路径 -VITE_BASE_URL=http://127.0.0.1:48080 +VITE_BASE_URL=http://47.103.66.220:48080 # 接口地址 -VITE_GLOB_API_URL=/admin-api +VITE_GLOB_API_URL=http://47.103.66.220:48080/admin-api # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server # 是否打开 devtools,true 为打开,false 为关闭 diff --git a/apps/web-antd/src/api/mp/draft/index.ts b/apps/web-antd/src/api/mp/draft/index.ts index 435f13e0b..9032ffd57 100644 --- a/apps/web-antd/src/api/mp/draft/index.ts +++ b/apps/web-antd/src/api/mp/draft/index.ts @@ -35,9 +35,13 @@ export function getDraftPage(params: PageParam) { /** 创建草稿 */ export function createDraft(accountId: number, articles: MpDraftApi.Article[]) { - return requestClient.post('/mp/draft/create', articles, { - params: { accountId }, - }); + return requestClient.post( + '/mp/draft/create', + { articles }, + { + params: { accountId }, + }, + ); } /** 更新草稿 */ @@ -46,9 +50,13 @@ export function updateDraft( mediaId: string, articles: MpDraftApi.Article[], ) { - return requestClient.put('/mp/draft/update', articles, { - params: { accountId, mediaId }, - }); + return requestClient.put( + '/mp/draft/update', + { articles }, + { + params: { accountId, mediaId }, + }, + ); } /** 删除草稿 */ diff --git a/apps/web-antd/src/views/mp/draft/data.ts b/apps/web-antd/src/views/mp/draft/data.ts new file mode 100644 index 000000000..89492f63e --- /dev/null +++ b/apps/web-antd/src/views/mp/draft/data.ts @@ -0,0 +1,41 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { markRaw } from 'vue'; + +import WxAccountSelect from '#/views/mp/modules/wx-account-select/main.vue'; + +/** 获取表格列配置 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'content', + title: '图文内容', + minWidth: 300, + slots: { default: 'content' }, + }, + { + field: 'updateTime', + title: '更新时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 200, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'accountId', + label: '公众号', + component: markRaw(WxAccountSelect), + }, + ]; +} diff --git a/apps/web-antd/src/views/mp/draft/index.vue b/apps/web-antd/src/views/mp/draft/index.vue index 9f1b6297b..e9ef78442 100644 --- a/apps/web-antd/src/views/mp/draft/index.vue +++ b/apps/web-antd/src/views/mp/draft/index.vue @@ -1,29 +1,316 @@ + + diff --git a/apps/web-antd/src/views/mp/draft/modules/cover-select.vue b/apps/web-antd/src/views/mp/draft/modules/cover-select.vue new file mode 100644 index 000000000..ea6e9323e --- /dev/null +++ b/apps/web-antd/src/views/mp/draft/modules/cover-select.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/apps/web-antd/src/views/mp/draft/modules/draft-table.vue b/apps/web-antd/src/views/mp/draft/modules/draft-table.vue new file mode 100644 index 000000000..36ef5b0a6 --- /dev/null +++ b/apps/web-antd/src/views/mp/draft/modules/draft-table.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/apps/web-antd/src/views/mp/draft/modules/form.vue b/apps/web-antd/src/views/mp/draft/modules/form.vue new file mode 100644 index 000000000..9b73ca3fb --- /dev/null +++ b/apps/web-antd/src/views/mp/draft/modules/form.vue @@ -0,0 +1,103 @@ + + + diff --git a/apps/web-antd/src/views/mp/draft/modules/news-form.vue b/apps/web-antd/src/views/mp/draft/modules/news-form.vue new file mode 100644 index 000000000..9dbf2bc0c --- /dev/null +++ b/apps/web-antd/src/views/mp/draft/modules/news-form.vue @@ -0,0 +1,341 @@ + + +