feat:【ele】【antd】代码的差异同步

This commit is contained in:
YunaiV
2025-11-14 22:23:05 +08:00
parent 1cbd4033b8
commit 02f2e90d43
8 changed files with 17 additions and 34 deletions

View File

@@ -11,7 +11,6 @@ defineOptions({ name: 'AiMusicAudioBarIndex' });
const currentSong = inject<any>('currentSong', {}); const currentSong = inject<any>('currentSong', {});
const audioRef = ref<HTMLAudioElement | null>(null); const audioRef = ref<HTMLAudioElement | null>(null);
// 音频相关属性https://www.runoob.com/tags/ref-av-dom.html
const audioProps = reactive<any>({ const audioProps = reactive<any>({
autoplay: true, autoplay: true,
paused: false, paused: false,
@@ -19,7 +18,7 @@ const audioProps = reactive<any>({
duration: '00:00', duration: '00:00',
muted: false, muted: false,
volume: 50, volume: 50,
}); }); // 音频相关属性https://www.runoob.com/tags/ref-av-dom.html
function toggleStatus(type: string) { function toggleStatus(type: string) {
audioProps[type] = !audioProps[type]; audioProps[type] = !audioProps[type];
@@ -32,7 +31,7 @@ function toggleStatus(type: string) {
} }
} }
// 更新播放位置 /** 更新播放位置 */
function audioTimeUpdate(args: any) { function audioTimeUpdate(args: any) {
audioProps.currentTime = formatPast(new Date(args.timeStamp), 'mm:ss'); audioProps.currentTime = formatPast(new Date(args.timeStamp), 'mm:ss');
} }

View File

@@ -12,19 +12,11 @@ import songInfo from './songInfo/index.vue';
defineOptions({ name: 'AiMusicListIndex' }); defineOptions({ name: 'AiMusicListIndex' });
const currentType = ref('mine'); const currentType = ref('mine');
// loading 状态 const loading = ref(false); // loading 状态
const loading = ref(false); const currentSong = ref({}); // 当前音乐
// 当前音乐
const currentSong = ref({});
const mySongList = ref<Recordable<any>[]>([]); const mySongList = ref<Recordable<any>[]>([]);
const squareSongList = ref<Recordable<any>[]>([]); const squareSongList = ref<Recordable<any>[]>([]);
/*
*@Description: 调接口生成音乐列表
*@MethodAuthor: xiaohong
*@Date: 2024-06-27 17:06:44
*/
function generateMusic(formData: Recordable<any>) { function generateMusic(formData: Recordable<any>) {
loading.value = true; loading.value = true;
setTimeout(() => { setTimeout(() => {
@@ -53,11 +45,6 @@ function generateMusic(formData: Recordable<any>) {
}, 3000); }, 3000);
} }
/*
*@Description: 设置当前播放的音乐
*@MethodAuthor: xiaohong
*@Date: 2024-07-19 11:22:33
*/
function setCurrentSong(music: Recordable<any>) { function setCurrentSong(music: Recordable<any>) {
currentSong.value = music; currentSong.value = music;
} }

View File

@@ -16,11 +16,6 @@ const generateMode = ref('lyric');
const modeRef = ref<Nullable<{ formData: Recordable<any> }>>(null); const modeRef = ref<Nullable<{ formData: Recordable<any> }>>(null);
/*
*@Description: 根据信息生成音乐
*@MethodAuthor: xiaohong
*@Date: 2024-06-27 16:40:16
*/
function generateMusic() { function generateMusic() {
emits('generateMusic', { formData: unref(modeRef)?.formData }); emits('generateMusic', { formData: unref(modeRef)?.formData });
} }

View File

@@ -1,5 +1,3 @@
import type { PageResult } from '@vben/request';
import { requestClient } from '#/api/request'; import { requestClient } from '#/api/request';
export namespace MallKefuConversationApi { export namespace MallKefuConversationApi {
@@ -28,7 +26,7 @@ export namespace MallKefuConversationApi {
/** 获得客服会话列表 */ /** 获得客服会话列表 */
export function getConversationList() { export function getConversationList() {
return requestClient.get<PageResult<MallKefuConversationApi.Conversation>>( return requestClient.get<MallKefuConversationApi.Conversation[]>(
'/promotion/kefu-conversation/list', '/promotion/kefu-conversation/list',
); );
} }

View File

@@ -5,18 +5,19 @@ import { requestClient } from '#/api/request';
export namespace MpAccountApi { export namespace MpAccountApi {
/** 公众号账号信息 */ /** 公众号账号信息 */
export interface Account { export interface Account {
id?: number; id: number;
name: string; name: string;
account: string; account?: string;
appId: string; appId?: string;
appSecret: string; appSecret?: string;
token: string; token?: string;
aesKey?: string; aesKey?: string;
qrCodeUrl?: string; qrCodeUrl?: string;
remark?: string; remark?: string;
createTime?: Date; createTime?: Date;
} }
// TODO @dylan这个直接使用 Account简化一点
export interface AccountSimple { export interface AccountSimple {
id: number; id: number;
name: string; name: string;

View File

@@ -87,6 +87,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
url="https://doc.iocoder.cn/member/level/" url="https://doc.iocoder.cn/member/level/"
/> />
</template> </template>
<FormModal @success="handleRefresh" /> <FormModal @success="handleRefresh" />
<Grid table-title="等级列表"> <Grid table-title="等级列表">
<template #toolbar-tools> <template #toolbar-tools>

View File

@@ -5,7 +5,7 @@ import type { MallFavoriteApi } from '#/api/mall/product/favorite';
import { DICT_TYPE } from '@vben/constants'; import { DICT_TYPE } from '@vben/constants';
import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { useVbenVxeGrid } from '#/adapter/vxe-table';
import * as FavoriteApi from '#/api/mall/product/favorite'; import { getFavoritePage } from '#/api/mall/product/favorite';
const props = defineProps<{ const props = defineProps<{
userId: number; userId: number;
@@ -72,7 +72,7 @@ const [Grid] = useVbenVxeGrid({
proxyConfig: { proxyConfig: {
ajax: { ajax: {
query: async ({ page }, formValues) => { query: async ({ page }, formValues) => {
return await FavoriteApi.getFavoritePage({ return await getFavoritePage({
pageNo: page.currentPage, pageNo: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
userId: props.userId, userId: props.userId,

View File

@@ -69,7 +69,7 @@ async function handleGenerateQrCode(row: MpAccountApi.Account) {
/** 清空 API 配额 */ /** 清空 API 配额 */
async function handleCleanQuota(row: MpAccountApi.Account) { async function handleCleanQuota(row: MpAccountApi.Account) {
const loadingInstance = ElLoading.service({ const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.processing', ['清空 API 配额']), text: '正在清空 API 配额',
}); });
try { try {
await clearAccountQuota(row.id!); await clearAccountQuota(row.id!);
@@ -155,6 +155,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
label: '生成二维码', label: '生成二维码',
type: 'primary', type: 'primary',
link: true, link: true,
icon: 'qrcode',
auth: ['mp:account:qr-code'], auth: ['mp:account:qr-code'],
onClick: handleGenerateQrCode.bind(null, row), onClick: handleGenerateQrCode.bind(null, row),
}, },
@@ -162,6 +163,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
label: '清空 API 配额', label: '清空 API 配额',
type: 'danger', type: 'danger',
link: true, link: true,
icon: 'clear',
auth: ['mp:account:clear-quota'], auth: ['mp:account:clear-quota'],
popConfirm: { popConfirm: {
title: '你确认要清空 API 配额', title: '你确认要清空 API 配额',