From 100f0a41b66b306a9c4c8cbd5510c28c048ffce1 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 13 Nov 2025 16:12:44 +0800 Subject: [PATCH] fix: mp --- .../web-antd/src/views/mp/autoReply/index.vue | 185 +++++++++--------- .../wx-account-select/account-select.vue | 14 +- .../src/views/mp/components/wx-msg/card.scss | 8 +- .../views/mp/components/wx-msg/comment.scss | 4 +- .../views/mp/components/wx-msg/msg-list.vue | 20 +- apps/web-antd/src/views/mp/draft/index.vue | 28 +-- apps/web-antd/src/views/mp/material/index.vue | 6 +- apps/web-antd/src/views/mp/menu/index.vue | 20 +- apps/web-antd/src/views/mp/message/index.vue | 3 +- .../mp/modules/wx-material-select/main.vue | 1 - .../src/views/mp/modules/wx-msg/card.scss | 8 +- .../src/views/mp/modules/wx-msg/comment.scss | 4 +- .../mp/modules/wx-msg/modules/msg-list.vue | 2 +- .../src/views/mp/modules/wx-music/main.vue | 13 +- 14 files changed, 150 insertions(+), 166 deletions(-) diff --git a/apps/web-antd/src/views/mp/autoReply/index.vue b/apps/web-antd/src/views/mp/autoReply/index.vue index 504f79dd7..21237b8ba 100644 --- a/apps/web-antd/src/views/mp/autoReply/index.vue +++ b/apps/web-antd/src/views/mp/autoReply/index.vue @@ -3,19 +3,17 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { computed, nextTick, onMounted, ref } from 'vue'; -import { - confirm, - ContentWrap, - DocAlert, - Page, - useVbenModal, -} from '@vben/common-ui'; +import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; import { IconifyIcon } from '@vben/icons'; import { message, Row, Tabs } from 'ant-design-vue'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; -import * as MpAutoReplyApi from '#/api/mp/autoReply'; +import { + deleteAutoReply, + getAutoReply, + getAutoReplyPage, +} from '#/api/mp/autoReply'; import { $t } from '#/locales'; import ReplyContentCell from './components/ReplyTable.vue'; @@ -25,10 +23,17 @@ import Form from './modules/form.vue'; defineOptions({ name: 'MpAutoReply' }); +/** 刷新表格 */ +function handleRefresh() { + gridApi.query().then(() => { + updateTableDataLength(); + }); +} + const msgType = ref(String(MsgType.Keyword)); // 消息类型 /** 切换回复类型 */ -async function onTabChange(tabName: string) { +async function onTabChange(tabName: any) { msgType.value = tabName; await nextTick(); // 更新 columns @@ -58,7 +63,7 @@ async function handleCreate() { /** 修改按钮操作 */ async function handleEdit(row: any) { - const data = (await MpAutoReplyApi.getAutoReply(row.id)) as any; + const data = (await getAutoReply(row.id)) as any; formModalApi .setData({ isCreating: false, @@ -76,7 +81,7 @@ async function handleDelete(row: any) { duration: 0, }); try { - await MpAutoReplyApi.deleteAutoReply(row.id); + await deleteAutoReply(row.id); message.success('删除成功'); await gridApi.query(); // 查询完成后更新数据长度 @@ -103,7 +108,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ proxyConfig: { ajax: { query: async ({ page }, formValues) => { - return await MpAutoReplyApi.getAutoReplyPage({ + return await getAutoReplyPage({ pageNo: page.currentPage, pageSize: page.pageSize, type: Number(msgType.value) as MsgType, @@ -173,89 +178,79 @@ onMounted(async () => { - - - - - - - - - - - - - - - - - - - + diff --git a/apps/web-antd/src/views/mp/components/wx-account-select/account-select.vue b/apps/web-antd/src/views/mp/components/wx-account-select/account-select.vue index 96514a1db..bb327270d 100644 --- a/apps/web-antd/src/views/mp/components/wx-account-select/account-select.vue +++ b/apps/web-antd/src/views/mp/components/wx-account-select/account-select.vue @@ -3,7 +3,7 @@ import type { SelectValue } from 'ant-design-vue/es/select'; import type { MpAccountApi } from '#/api/mp/account'; -import { onMounted, reactive, ref } from 'vue'; +import { onMounted, ref } from 'vue'; import { useRouter } from 'vue-router'; import { message, Select } from 'ant-design-vue'; @@ -18,7 +18,7 @@ const emit = defineEmits<{ const { push } = useRouter(); -const account: MpAccountApi.Account = reactive({ +const account = ref({ id: -1, name: '', }); // 当前选中的公众号 @@ -36,9 +36,9 @@ async function handleQuery() { // 默认选中第一个,如无数据则不执行 const first = accountList.value[0]; if (first) { - account.id = first.id; - account.name = first.name; - emit('change', account.id, account.name); + account.value.id = first.id; + account.value.name = first.name; + emit('change', account.value.id, account.value.name); } } @@ -46,8 +46,8 @@ async function handleQuery() { function onChanged(id: SelectValue) { const found = accountList.value.find((v) => v.id === id); if (found) { - account.name = found.name; - emit('change', account.id, account.name); + account.value.name = found.name; + emit('change', account.value.id, account.value.name); } } diff --git a/apps/web-antd/src/views/mp/components/wx-msg/card.scss b/apps/web-antd/src/views/mp/components/wx-msg/card.scss index 58fde79fd..639f4ca8e 100644 --- a/apps/web-antd/src/views/mp/components/wx-msg/card.scss +++ b/apps/web-antd/src/views/mp/components/wx-msg/card.scss @@ -1,4 +1,4 @@ -.avue-card { +.mp-card { &__item { box-sizing: border-box; height: 200px; @@ -99,18 +99,18 @@ } /** joolun 额外加的 */ -.avue-comment__main { +.mp-comment__main { flex: unset !important; margin: 0 8px !important; border-radius: 5px !important; } -.avue-comment__header { +.mp-comment__header { border-top-left-radius: 5px; border-top-right-radius: 5px; } -.avue-comment__body { +.mp-comment__body { border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; } diff --git a/apps/web-antd/src/views/mp/components/wx-msg/comment.scss b/apps/web-antd/src/views/mp/components/wx-msg/comment.scss index 219e2e5d4..98e137d4b 100644 --- a/apps/web-antd/src/views/mp/components/wx-msg/comment.scss +++ b/apps/web-antd/src/views/mp/components/wx-msg/comment.scss @@ -1,5 +1,5 @@ /* 来自 https://github.com/nmxiaowei/avue/blob/master/styles/src/element-ui/comment.scss */ -.avue-comment { +.mp-comment { display: flex; align-items: flex-start; margin-bottom: 30px; @@ -7,7 +7,7 @@ &--reverse { flex-direction: row-reverse; - .avue-comment__main { + .mp-comment__main { &::before, &::after { right: -8px; diff --git a/apps/web-antd/src/views/mp/components/wx-msg/msg-list.vue b/apps/web-antd/src/views/mp/components/wx-msg/msg-list.vue index 898ba0593..605c38103 100644 --- a/apps/web-antd/src/views/mp/components/wx-msg/msg-list.vue +++ b/apps/web-antd/src/views/mp/components/wx-msg/msg-list.vue @@ -32,23 +32,23 @@ function getNickname(sendFrom: number) {