fix: todo修复

This commit is contained in:
hw
2025-11-20 10:34:21 +08:00
237 changed files with 2791 additions and 3444 deletions

View File

@@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { Reply } from '#/views/mp/components/reply/types';
import type { Reply } from '#/views/mp/components/wx-reply/types';
import { computed, nextTick, ref } from 'vue';
@@ -10,7 +10,7 @@ import { ElMessage } from 'element-plus';
import { useVbenForm } from '#/adapter/form';
import { createAutoReply, updateAutoReply } from '#/api/mp/autoReply';
import { $t } from '#/locales';
import { ReplyType } from '#/views/mp/components/reply/types';
import { ReplyType } from '#/views/mp/components/wx-reply/types';
import { useFormSchema } from '../data';
import { MsgType } from './types';

View File

@@ -1 +0,0 @@
export { default } from './account-select.vue';

View File

@@ -1,22 +1,24 @@
// 统一导出所有模块组件
export { default as AccountSelect } from './account-select/account-select.vue';
export { default as AccountSelect } from './wx-account-select/wx-account-select.vue';
export { default as WxAccountSelect } from './wx-account-select/wx-account-select.vue';
export { default as Location } from './location/location.vue';
export { default as MaterialSelect } from './material-select/material-select.vue';
// TODO @hw还是带着 wx 前缀。。。貌似好点,我的锅!!!
export { default as Location } from './wx-location/wx-location.vue';
export * from './wx-material-select/types';
export * from './material-select/types';
export { default as MaterialSelect } from './wx-material-select/wx-material-select.vue';
export * from './msg/types';
export * from './wx-msg/types';
export { default as Music } from './music/music.vue';
export { default as Music } from './wx-music/wx-music.vue';
export { default as News } from './news/news.vue';
export { default as News } from './wx-news/wx-news.vue';
export { default as ReplySelect } from './reply/reply.vue';
export * from './wx-reply/types';
export * from './reply/types';
export { default as ReplySelect } from './wx-reply/wx-reply.vue';
export { default as VideoPlayer } from './video-play/video-play.vue';
export { default as VideoPlayer } from './wx-video-play/wx-video-play.vue';
export { default as VoicePlayer } from './voice-play/voice-play.vue';
export { default as VoicePlayer } from './wx-voice-play/wx-voice-play.vue';

View File

@@ -1 +0,0 @@
export { default } from './location.vue';

View File

@@ -1,3 +0,0 @@
export { default } from './material-select.vue';
export { MaterialType, NewsType } from './types';

View File

@@ -1,3 +0,0 @@
export { default } from './msg.vue';
export { MsgType } from './types';

View File

@@ -1 +0,0 @@
export { default } from './music.vue';

View File

@@ -1 +0,0 @@
export { default } from './news.vue';

View File

@@ -1 +0,0 @@
export { default } from './video-play.vue';

View File

@@ -1 +0,0 @@
export { default } from './voice-play.vue';

View File

@@ -0,0 +1 @@
export { default } from './wx-account-select.vue';

View File

@@ -124,7 +124,7 @@ onMounted(() => {
<ElSelect
v-model="currentId"
placeholder="请选择公众号"
class="!w-240px"
class="!w-full"
@change="onChanged"
>
<ElOption

View File

@@ -0,0 +1 @@
export { default } from './wx-location.vue';

View File

@@ -0,0 +1,3 @@
export { default } from './wx-material-select.vue';
export { MaterialType, NewsType } from './types';

View File

@@ -20,9 +20,9 @@ import {
import * as MpDraftApi from '#/api/mp/draft';
import * as MpFreePublishApi from '#/api/mp/freePublish';
import * as MpMaterialApi from '#/api/mp/material';
import News from '#/views/mp/components/news/news.vue';
import VideoPlayer from '#/views/mp/components/video-play/video-play.vue';
import VoicePlayer from '#/views/mp/components/voice-play/voice-play.vue';
import News from '#/views/mp/components/wx-news/wx-news.vue';
import VideoPlayer from '#/views/mp/components/wx-video-play/wx-video-play.vue';
import VoicePlayer from '#/views/mp/components/wx-voice-play/wx-voice-play.vue';
import { NewsType } from './types';

View File

@@ -0,0 +1,3 @@
export { default } from './wx-msg.vue';
export { MsgType } from './types';

View File

@@ -5,7 +5,7 @@ import { formatDateTime } from '@vben/utils';
import avatarWechat from '#/assets/imgs/wechat.png';
import Msg from './msg.vue';
import Msg from './wx-msg.vue';
// User 使
type PropsUser = User;

View File

@@ -1,11 +1,11 @@
<script lang="ts" setup>
import { ref } from 'vue';
import Location from '#/views/mp/components/location/location.vue';
import Music from '#/views/mp/components/music/music.vue';
import News from '#/views/mp/components/news/news.vue';
import VideoPlayer from '#/views/mp/components/video-play/video-play.vue';
import VoicePlayer from '#/views/mp/components/voice-play/voice-play.vue';
import Location from '#/views/mp/components/wx-location/wx-location.vue';
import Music from '#/views/mp/components/wx-music/wx-music.vue';
import News from '#/views/mp/components/wx-news/wx-news.vue';
import VideoPlayer from '#/views/mp/components/wx-video-play/wx-video-play.vue';
import VoicePlayer from '#/views/mp/components/wx-voice-play/wx-voice-play.vue';
import { MsgType } from '../types';
import MsgEvent from './msg-event.vue';

View File

@@ -0,0 +1 @@
export { default } from './wx-music.vue';

View File

@@ -63,5 +63,5 @@ defineExpose({
<style lang="scss" scoped>
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 card.scss */
@import url('../msg/card.scss');
@import url('../wx-msg/card.scss');
</style>

View File

@@ -0,0 +1 @@
export { default } from './wx-news.vue';

View File

@@ -120,5 +120,8 @@ defineExpose({
.material-img {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
</style>

View File

@@ -1,3 +1,3 @@
export { default } from './reply.vue';
export { createEmptyReply, type Reply, ReplyType } from './types';
export { default } from './wx-reply.vue';

View File

@@ -18,7 +18,7 @@ import {
} from 'element-plus';
import { UploadType, useBeforeUpload } from '#/utils/useUpload';
import MaterialSelect from '#/views/mp/components/material-select/material-select.vue';
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
const props = defineProps<{
modelValue: Reply;

View File

@@ -20,7 +20,7 @@ import {
import { UploadType, useBeforeUpload } from '#/utils/useUpload';
// import { getAccessToken } from '@/utils/auth'
import MaterialSelect from '#/views/mp/components/material-select/material-select.vue';
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
//

View File

@@ -7,10 +7,10 @@ import { IconifyIcon } from '@vben/icons';
import { ElButton, ElCol, ElDialog, ElRow } from 'element-plus';
import MaterialSelect from '#/views/mp/components/material-select/material-select.vue';
import News from '#/views/mp/components/news/news.vue';
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
import News from '#/views/mp/components/wx-news/wx-news.vue';
import { NewsType } from '../material-select/types';
import { NewsType } from '../wx-material-select/types';
const props = defineProps<{
modelValue: Reply;

View File

@@ -19,8 +19,8 @@ import {
} from 'element-plus';
import { UploadType, useBeforeUpload } from '#/utils/useUpload';
import MaterialSelect from '#/views/mp/components/material-select/material-select.vue';
import VideoPlayer from '#/views/mp/components/video-play/video-play.vue';
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
import VideoPlayer from '#/views/mp/components/wx-video-play/wx-video-play.vue';
const props = defineProps<{
modelValue: Reply;

View File

@@ -18,8 +18,8 @@ import {
} from 'element-plus';
import { UploadType, useBeforeUpload } from '#/utils/useUpload';
import MaterialSelect from '#/views/mp/components/material-select/material-select.vue';
import VoicePlayer from '#/views/mp/components/voice-play/voice-play.vue';
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
import VoicePlayer from '#/views/mp/components/wx-voice-play/wx-voice-play.vue';
//

View File

@@ -16,7 +16,7 @@ import { IconifyIcon } from '@vben/icons';
import { ElRow, ElTabPane, ElTabs } from 'element-plus';
import { NewsType } from '../material-select/types';
import { NewsType } from '../wx-material-select/types';
import TabImage from './tab-image.vue';
import TabMusic from './tab-music.vue';
import TabNews from './tab-news.vue';

View File

@@ -0,0 +1 @@
export { default } from './wx-video-play.vue';

View File

@@ -0,0 +1 @@
export { default } from './wx-voice-play.vue';

View File

@@ -11,7 +11,7 @@ import { useAccessStore } from '@vben/stores';
import { ElButton, ElDialog, ElImage, ElMessage, ElUpload } from 'element-plus';
import { UploadType, useBeforeUpload } from '#/utils/useUpload';
import MaterialSelect from '#/views/mp/components/material-select/material-select.vue';
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
// 设置上传的请求头部

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { Article } from './types';
import News from '#/views/mp/components/news/news.vue';
import News from '#/views/mp/components/wx-news/wx-news.vue';
defineOptions({ name: 'DraftTableCell' });

View File

@@ -14,9 +14,9 @@ import {
ElSelect,
} from 'element-plus';
import MaterialSelect from '#/views/mp/components/material-select/material-select.vue';
import News from '#/views/mp/components/news/news.vue';
import ReplySelect from '#/views/mp/components/reply/reply.vue';
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
import News from '#/views/mp/components/wx-news/wx-news.vue';
import ReplySelect from '#/views/mp/components/wx-reply/wx-reply.vue';
import menuOptions from './menuOptions';

View File

@@ -2,7 +2,7 @@ import type { MpStatisticsApi } from '#/api/mp/statistics';
/** 用户增减数据图表配置项 */
export function userSummaryOption(
data: MpStatisticsApi.UserSummary[],
data: MpStatisticsApi.StatisticsUserSummaryRespVO[],
dates: string[],
): any {
return {
@@ -41,7 +41,7 @@ export function userSummaryOption(
/** 累计用户数据图表配置项 */
export function userCumulateOption(
data: MpStatisticsApi.UserCumulate[],
data: MpStatisticsApi.StatisticsUserCumulateRespVO[],
dates: string[],
): any {
return {
@@ -71,7 +71,7 @@ export function userCumulateOption(
/** 消息发送概况数据图表配置项 */
export function upstreamMessageOption(
data: MpStatisticsApi.UpstreamMessage[],
data: MpStatisticsApi.StatisticsUpstreamMessageRespVO[],
dates: string[],
): any {
return {
@@ -111,7 +111,7 @@ export function upstreamMessageOption(
/** 接口分析况数据图表配置项 */
export function interfaceSummaryOption(
data: MpStatisticsApi.InterfaceSummary[],
data: MpStatisticsApi.StatisticsInterfaceSummaryRespVO[],
dates: string[],
): any {
return {

View File

@@ -1,29 +1,14 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { MpAccountApi } from '#/api/mp/account';
import { beginOfDay, endOfDay, formatDateTime } from '@vben/utils';
import { getSimpleAccountList } from '#/api/mp/account';
/** 关联数据 */
let accountList: MpAccountApi.AccountSimple[] = [];
getSimpleAccountList().then((data) => (accountList = data));
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'accountId',
label: '公众号',
component: 'ApiSelect',
componentProps: {
options: accountList.map((item) => ({
label: item.name,
value: item.id,
})),
placeholder: '请选择公众号',
},
defaultValue: accountList[0]?.id,
component: 'Input',
},
{
fieldName: 'dateRange',
@@ -36,7 +21,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
defaultValue: [
formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))),
formatDateTime(endOfDay(new Date(Date.now() - 3600 * 1000 * 24))),
] as [Date, Date],
],
},
];
}

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { EchartsUIType } from '@vben/plugins/echarts';
import { onMounted, ref } from 'vue';
import { ref } from 'vue';
import { ContentWrap, Page } from '@vben/common-ui';
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
@@ -16,6 +16,7 @@ import {
getUserCumulate,
getUserSummary,
} from '#/api/mp/statistics';
import { WxAccountSelect } from '#/views/mp/components';
import {
interfaceSummaryOption,
@@ -95,6 +96,12 @@ async function getSummary(values: Record<string, any>) {
);
}
/** 公众号变化时查询数据 */
function handleAccountChange(accountId: number) {
queryFormApi.setValues({ accountId });
queryFormApi.submitForm();
}
const [QueryForm, queryFormApi] = useVbenForm({
commonConfig: {
componentProps: {
@@ -106,17 +113,16 @@ const [QueryForm, queryFormApi] = useVbenForm({
wrapperClass: 'grid-cols-1 md:grid-cols-2',
handleSubmit: getSummary,
});
/** 初始化 */
onMounted(() => {
queryFormApi.submitForm();
});
</script>
<template>
<Page auto-content-height>
<ContentWrap class="h-full w-full">
<QueryForm />
<QueryForm>
<template #accountId>
<WxAccountSelect @change="handleAccountChange" />
</template>
</QueryForm>
<div class="flex h-1/3 w-full gap-4">
<ElCard class="h-full w-1/2">

View File

@@ -1,12 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeGridPropTypes } from '#/adapter/vxe-table';
import type { MpAccountApi } from '#/api/mp/account';
import { getSimpleAccountList } from '#/api/mp/account';
/** 关联数据 */
let accountList: MpAccountApi.AccountSimple[] = [];
getSimpleAccountList().then((data) => (accountList = data));
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
@@ -46,15 +39,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
{
fieldName: 'accountId',
label: '公众号',
component: 'ApiSelect',
componentProps: {
options: accountList.map((item) => ({
label: item.name,
value: item.id,
})),
placeholder: '请选择公众号',
},
defaultValue: accountList[0]?.id,
component: 'Input',
},
];
}

View File

@@ -9,6 +9,7 @@ import { ElLoading, ElMessage } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { deleteTag, getTagPage, syncTag } from '#/api/mp/tag';
import { $t } from '#/locales';
import { WxAccountSelect } from '#/views/mp/components';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
@@ -23,6 +24,12 @@ function handleRefresh() {
gridApi.query();
}
/** 公众号变化时查询数据 */
function handleAccountChange(accountId: number) {
gridApi.formApi.setValues({ accountId });
gridApi.formApi.submitForm();
}
/** 创建标签 */
async function handleCreate() {
const formValues = await gridApi.formApi.getValues();
@@ -99,6 +106,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
});
},
},
autoLoad: false,
},
rowConfig: {
keyField: 'id',
@@ -116,6 +124,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
<Page auto-content-height>
<FormModal @success="handleRefresh" />
<Grid table-title="公众号标签列表">
<template #form-accountId>
<WxAccountSelect @change="handleAccountChange" />
</template>
<template #toolbar-tools>
<TableAction
:actions="[

View File

@@ -1,11 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MpAccountApi } from '#/api/mp/account';
import { getSimpleAccountList } from '#/api/mp/account';
let accountList: MpAccountApi.AccountSimple[] = [];
getSimpleAccountList().then((data) => (accountList = data));
/** 修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
@@ -43,15 +37,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
{
fieldName: 'accountId',
label: '公众号',
component: 'Select',
componentProps: {
options: accountList.map((item) => ({
label: item.name,
value: item.id,
})),
placeholder: '请选择公众号',
},
defaultValue: accountList[0]?.id,
component: 'Input',
},
{
fieldName: 'openid',

View File

@@ -9,6 +9,7 @@ import { ElLoading, ElMessage } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getUserPage, syncUser } from '#/api/mp/user';
import { $t } from '#/locales';
import { WxAccountSelect } from '#/views/mp/components';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
@@ -25,6 +26,12 @@ function handleRefresh() {
gridApi.query();
}
/** 公众号变化时查询数据 */
function handleAccountChange(accountId: number) {
gridApi.formApi.setValues({ accountId });
gridApi.formApi.submitForm();
}
/** 编辑用户 */
function handleEdit(row: MpUserApi.User) {
formModalApi.setData({ id: row.id }).open();
@@ -72,6 +79,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
});
},
},
autoLoad: false,
},
rowConfig: {
keyField: 'id',
@@ -94,6 +102,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
<FormModal @success="handleRefresh" />
<Grid table-title="粉丝列表">
<template #form-accountId>
<WxAccountSelect @change="handleAccountChange" />
</template>
<template #toolbar-tools>
<TableAction
:actions="[