diff --git a/apps/web-antd/.env.development b/apps/web-antd/.env.development index cff2557643921373fa5e308f9113b18aedc65de3..fe07e867ccb036f849f96a1f772a991e0d4ba985 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 9032ffd572ad1a31c282fdb059120cea7a930ac9..70b7c0e83d92e762fa1bbb6bd4f9ab752a0fd470 100644 --- a/apps/web-antd/src/api/mp/draft/index.ts +++ b/apps/web-antd/src/api/mp/draft/index.ts @@ -50,13 +50,9 @@ 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/mall/promotion/combination/components/index.ts b/apps/web-antd/src/views/mall/promotion/combination/components/index.ts index 91676dbc0cba189a33ef850e805ff6ca90c0bdfc..36d56af425b522ca2f1e43bf695b71ce13017443 100644 --- a/apps/web-antd/src/views/mall/promotion/combination/components/index.ts +++ b/apps/web-antd/src/views/mall/promotion/combination/components/index.ts @@ -1,2 +1 @@ export { default as CombinationShowcase } from './showcase.vue'; - diff --git a/apps/web-antd/src/views/mall/promotion/combination/components/showcase.vue b/apps/web-antd/src/views/mall/promotion/combination/components/showcase.vue index 27b972ef5b31ad9da8d13d82e643cbec9df4452f..1e61670d6d63ae8afc8d10d012db2977e327df2b 100644 --- a/apps/web-antd/src/views/mall/promotion/combination/components/showcase.vue +++ b/apps/web-antd/src/views/mall/promotion/combination/components/showcase.vue @@ -143,4 +143,3 @@ function emitActivityChange() { @change="handleActivitySelected" /> - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/component.tsx b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/component.tsx index b09a3096650945255137d2772d61052c9f6fec0a..d889c75404a9729151a14f0bd27eaf578dad4cc1 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/component.tsx +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/component.tsx @@ -1,3 +1,5 @@ +/* eslint-disable vue/one-component-per-file */ +// TODO @YunaiV eslint检测了 import type { MallCouponTemplateApi } from '#/api/mall/promotion/coupon/couponTemplate'; import { defineComponent } from 'vue'; diff --git a/apps/web-antd/src/views/mp/autoReply/components/ReplyForm.vue b/apps/web-antd/src/views/mp/autoReply/components/ReplyForm.vue deleted file mode 100644 index 0b4cd6b11ac359f707dc2e9b972327c7bc844244..0000000000000000000000000000000000000000 --- a/apps/web-antd/src/views/mp/autoReply/components/ReplyForm.vue +++ /dev/null @@ -1,138 +0,0 @@ - - - diff --git a/apps/web-antd/src/views/mp/autoReply/data.ts b/apps/web-antd/src/views/mp/autoReply/data.ts index 727e50de76953935dd569fa47d827df0ae5e16da..18fb7105ea5db6c9813f2feda09aa32d142a48b9 100644 --- a/apps/web-antd/src/views/mp/autoReply/data.ts +++ b/apps/web-antd/src/views/mp/autoReply/data.ts @@ -1,13 +1,30 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeGridPropTypes } from '#/adapter/vxe-table'; +import type { MpAccountApi } from '#/api/mp/account'; import { markRaw } from 'vue'; import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; -import { WxAccountSelect } from '#/views/mp/components'; +import { getSimpleAccountList } from '#/api/mp/account'; +import { WxReply } from '#/views/mp/components'; -import { MsgType } from './components/types'; +import { MsgType } from './types'; + +/** 关联数据 */ +let accountList: MpAccountApi.AccountSimple[] = []; +getSimpleAccountList().then((data) => (accountList = data)); + +const RequestMessageTypes = new Set([ + 'image', + 'link', + 'location', + 'shortvideo', + 'text', + 'video', + 'voice', +]); // 允许选择的请求消息类型 /** 获取表格列配置 */ export function useGridColumns(msgType: MsgType): VxeGridPropTypes.Columns { @@ -76,13 +93,84 @@ export function useGridColumns(msgType: MsgType): VxeGridPropTypes.Columns { return columns; } +/** 新增/修改的表单 */ +export function useFormSchema(msgType: MsgType): VbenFormSchema[] { + const schema: VbenFormSchema[] = []; + + // 消息类型(仅消息回复显示) + if (msgType === MsgType.Message) { + schema.push({ + fieldName: 'requestMessageType', + label: '消息类型', + component: 'Select', + componentProps: { + placeholder: '请选择', + options: getDictOptions(DICT_TYPE.MP_MESSAGE_TYPE).filter((d) => + RequestMessageTypes.has(d.value as string), + ), + }, + }); + } + + // 匹配类型(仅关键词回复显示) + if (msgType === MsgType.Keyword) { + schema.push({ + fieldName: 'requestMatch', + label: '匹配类型', + component: 'Select', + componentProps: { + placeholder: '请选择匹配类型', + allowClear: true, + options: getDictOptions( + DICT_TYPE.MP_AUTO_REPLY_REQUEST_MATCH, + 'number', + ), + }, + rules: 'required', + }); + } + + // 关键词(仅关键词回复显示) + if (msgType === MsgType.Keyword) { + schema.push({ + fieldName: 'requestKeyword', + label: '关键词', + component: 'Input', + componentProps: { + placeholder: '请输入内容', + allowClear: true, + }, + rules: 'required', + }); + } + // 回复消息 + schema.push({ + fieldName: 'reply', + label: '回复消息', + component: markRaw(WxReply), + // componentProps: { + // modelValue: { type: 'video', content: '12456' }, + // }, + modelPropName: 'modelValue', + }); + return schema; +} + /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ { fieldName: 'accountId', label: '公众号', - component: markRaw(WxAccountSelect), + component: 'ApiSelect', + componentProps: { + options: accountList.map((item) => ({ + label: item.name, + value: item.id, + })), + placeholder: '请选择公众号', + }, + defaultValue: accountList[0]?.id, }, ]; } diff --git a/apps/web-antd/src/views/mp/autoReply/index.vue b/apps/web-antd/src/views/mp/autoReply/index.vue index 05c531d869c3f16e9913baf39a23f76e9ee084c3..f3642167ffbd17445769ac9d256ecc1d77570a7c 100644 --- a/apps/web-antd/src/views/mp/autoReply/index.vue +++ b/apps/web-antd/src/views/mp/autoReply/index.vue @@ -1,7 +1,7 @@ - - + + + + diff --git a/apps/web-ele/src/views/mp/autoReply/modules/ReplyForm.vue b/apps/web-ele/src/views/mp/autoReply/modules/ReplyForm.vue deleted file mode 100644 index f55afc36564d10350d9759b385fe7d0b9001127e..0000000000000000000000000000000000000000 --- a/apps/web-ele/src/views/mp/autoReply/modules/ReplyForm.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - - - diff --git a/apps/web-ele/src/views/mp/autoReply/modules/ReplyTable.vue b/apps/web-ele/src/views/mp/autoReply/modules/content.vue similarity index 74% rename from apps/web-ele/src/views/mp/autoReply/modules/ReplyTable.vue rename to apps/web-ele/src/views/mp/autoReply/modules/content.vue index bdfb41ade88e9abf314e2dfa3b1a2b3f86827432..339be83ab068154dc2ee0f5f658b587a37413d0f 100644 --- a/apps/web-ele/src/views/mp/autoReply/modules/ReplyTable.vue +++ b/apps/web-ele/src/views/mp/autoReply/modules/content.vue @@ -1,8 +1,5 @@ diff --git a/apps/web-ele/src/views/mp/components/news/index.ts b/apps/web-ele/src/views/mp/components/news/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..9cc5d64a679d25ad1e759a037f5e4f3c94f5653a --- /dev/null +++ b/apps/web-ele/src/views/mp/components/news/index.ts @@ -0,0 +1 @@ +export { default } from './news.vue'; diff --git a/apps/web-ele/src/views/mp/modules/wx-news/main.vue b/apps/web-ele/src/views/mp/components/news/news.vue similarity index 100% rename from apps/web-ele/src/views/mp/modules/wx-news/main.vue rename to apps/web-ele/src/views/mp/components/news/news.vue diff --git a/apps/web-ele/src/views/mp/components/reply/index.ts b/apps/web-ele/src/views/mp/components/reply/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..d2910f71d2c9c326efb8fdca3429678001c82d81 --- /dev/null +++ b/apps/web-ele/src/views/mp/components/reply/index.ts @@ -0,0 +1,3 @@ +export { default } from './reply.vue'; + +export { createEmptyReply, type Reply, ReplyType } from './types'; diff --git a/apps/web-ele/src/views/mp/modules/wx-reply/main.vue b/apps/web-ele/src/views/mp/components/reply/reply.vue similarity index 63% rename from apps/web-ele/src/views/mp/modules/wx-reply/main.vue rename to apps/web-ele/src/views/mp/components/reply/reply.vue index 929176a6fcc4b81a406cd638308d408e75b6405d..85011049e74ea08c7820b078d5a106589f07912c 100644 --- a/apps/web-ele/src/views/mp/modules/wx-reply/main.vue +++ b/apps/web-ele/src/views/mp/components/reply/reply.vue @@ -8,27 +8,28 @@ ④ 支持发送【视频】消息时,支持新建视频 -->