chore: 合并远程 dev 分支代码

This commit is contained in:
YunaiV
2025-11-13 20:45:00 +08:00
108 changed files with 542 additions and 3074 deletions

View File

@@ -36,7 +36,7 @@ const { hasAccessByCodes } = useAccess();
@click="emit('delete', item.id)"
>
<template #icon>
<IconifyIcon icon="mdi:delete" />
<IconifyIcon icon="lucide:trash-2" />
</template>
</Button>
</div>

View File

@@ -89,7 +89,7 @@ const customRequest: UploadProps['customRequest'] = async function (options) {
class="mb-4"
>
<Button type="primary">
<IconifyIcon icon="mdi:upload" class="mr-1" />
<IconifyIcon icon="lucide:upload" class="mr-1" />
点击上传
</Button>
<template #itemRender="{ file, actions }">

View File

@@ -126,7 +126,7 @@ const customRequest: UploadProps['customRequest'] = async function (options) {
class="mb-4"
>
<Button type="primary">
<IconifyIcon icon="mdi:video-plus" class="mr-1" />
<IconifyIcon icon="lucide:video" class="mr-1" />
选择视频
</Button>
</Upload>

View File

@@ -5,12 +5,12 @@ import { watch } from 'vue';
import { useAccess } from '@vben/access';
import { IconifyIcon } from '@vben/icons';
import { formatDate2 } from '@vben/utils';
import { formatDate2, openWindow } from '@vben/utils';
import { Button } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { WxVideoPlayer } from '#/views/mp/components/wx-video-play';
import { WxVideoPlayer } from '#/views/mp/components';
// TODO @dylanvue 组件名小写 + 中划线
@@ -93,10 +93,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
} as VxeTableGridOptions<any>, // TODO @dylan这里有个告警哈
});
function handleDownload(url: string) {
window.open(url, '_blank');
}
watch(
() => props.list,
(list: any[]) => {
@@ -130,8 +126,8 @@ watch(
</template>
<!-- TODO @dylan tableaction yudao-ui-admin-vben-v5/apps/web-antd/src/views/system/user/index.vue -->
<template #actions="{ row }">
<Button type="link" @click="handleDownload(row.url)">
<IconifyIcon icon="mdi:download" />
<Button type="link" @click="openWindow(row.url)">
<IconifyIcon icon="lucide:download" />
下载
</Button>
<Button
@@ -140,7 +136,7 @@ watch(
type="link"
@click="emit('delete', row.id)"
>
<IconifyIcon icon="mdi:delete" />
<IconifyIcon icon="lucide:trash-2" />
删除
</Button>
</template>

View File

@@ -5,12 +5,12 @@ import { watch } from 'vue';
import { useAccess } from '@vben/access';
import { IconifyIcon } from '@vben/icons';
import { formatDate2 } from '@vben/utils';
import { formatDate2, openWindow } from '@vben/utils';
import { Button } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { WxVoicePlayer } from '#/views/mp/components/wx-voice-play';
import { WxVoicePlayer } from '#/views/mp/components';
// TODO @dylanvue 组件名小写 + 中划线
@@ -83,10 +83,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
} as VxeTableGridOptions<any>, // TODO @dylan这里有个告警哈
});
function handleDownload(url: string) {
window.open(url, '_blank');
}
watch(
() => props.list,
(list: any[]) => {
@@ -119,9 +115,8 @@ watch(
{{ formatDate2(row.createTime) }}
</template>
<template #actions="{ row }">
<!-- TODO @dylan tableaction yudao-ui-admin-vben-v5/apps/web-antd/src/views/system/user/index.vue -->
<Button type="link" @click="handleDownload(row.url)">
<IconifyIcon icon="mdi:download" />
<Button type="link" @click="openWindow(row.url)">
<IconifyIcon icon="lucide:download" />
下载
</Button>
<Button
@@ -130,7 +125,7 @@ watch(
type="link"
@click="emit('delete', row.id)"
>
<IconifyIcon icon="mdi:delete" />
<IconifyIcon icon="lucide:trash-2" />
删除
</Button>
</template>

View File

@@ -2,7 +2,7 @@
import { provide, reactive, ref } from 'vue';
import { useAccess } from '@vben/access';
import { Page } from '@vben/common-ui';
import { DocAlert, Page } from '@vben/common-ui';
import { IconifyIcon } from '@vben/icons';
import {
@@ -15,8 +15,8 @@ import {
Tabs,
} from 'ant-design-vue';
import * as MpMaterialApi from '#/api/mp/material';
import { WxAccountSelect } from '#/views/mp/components/wx-account-select';
import { deletePermanentMaterial, getMaterialPage } from '#/api/mp/material';
import { WxAccountSelect } from '#/views/mp/components';
import ImageTable from './components/ImageTable.vue';
import { UploadType } from './components/upload';
@@ -57,7 +57,7 @@ function onAccountChanged(id: number) {
async function getList() {
loading.value = true;
try {
const data = await MpMaterialApi.getMaterialPage({
const data = await getMaterialPage({
...queryParams,
type: type.value,
});
@@ -90,7 +90,7 @@ async function handleDelete(id: number) {
content: '此操作将永久删除该文件, 是否继续?',
title: '提示',
async onOk() {
await MpMaterialApi.deletePermanentMaterial(id);
await deletePermanentMaterial(id);
message.success('删除成功');
await getList();
},
@@ -99,117 +99,127 @@ async function handleDelete(id: number) {
</script>
<template>
<!-- TODO @dylan这里不太对哈应该是 doc-alert 展示文档 -->
<Page
description="公众号素材"
doc-link="https://doc.iocoder.cn/mp/material/"
title="公众号素材"
>
<!-- 搜索工作栏 -->
<Card class="mb-4" :bordered="false">
<Form :model="queryParams" layout="inline">
<Form.Item label="公众号">
<WxAccountSelect @change="onAccountChanged" />
</Form.Item>
</Form>
</Card>
<Page auto-content-height>
<template #doc>
<DocAlert title="公众号素材" url="https://doc.iocoder.cn/mp/material/" />
</template>
<div class="h-full">
<!-- 搜索工作栏 -->
<Card class="h-[10%]" :bordered="false">
<Form :model="queryParams" layout="inline">
<Form.Item label="公众号">
<WxAccountSelect @change="onAccountChanged" />
</Form.Item>
</Form>
</Card>
<Card :bordered="false">
<Tabs v-model:active-key="type" @change="onTabChange">
<!-- tab 1图片 -->
<Tabs.TabPane :key="UploadType.Image">
<template #tab>
<span class="flex items-center">
<IconifyIcon icon="mdi:image" class="mr-1" />
图片
</span>
</template>
<UploadFile
v-if="hasAccessByCodes(['mp:material:upload-permanent'])"
:type="UploadType.Image"
@uploaded="getList"
>
支持 bmp/png/jpeg/jpg/gif 格式大小不超过 2M
</UploadFile>
<!-- 列表 -->
<ImageTable :list="list" :loading="loading" @delete="handleDelete" />
<!-- 分页组件 -->
<div class="mt-4 flex justify-end">
<Pagination
v-model:current="queryParams.pageNo"
v-model:page-size="queryParams.pageSize"
:total="total"
show-size-changer
@change="getList"
@show-size-change="getList"
<Card :bordered="false" class="mt-4 h-[88%]">
<Tabs v-model:active-key="type" @change="onTabChange">
<!-- tab 1图片 -->
<Tabs.TabPane :key="UploadType.Image">
<template #tab>
<span class="flex items-center">
<IconifyIcon icon="lucide:image" class="mr-1" />
图片
</span>
</template>
<UploadFile
v-if="hasAccessByCodes(['mp:material:upload-permanent'])"
:type="UploadType.Image"
@uploaded="getList"
>
支持 bmp/png/jpeg/jpg/gif 格式大小不超过 2M
</UploadFile>
<!-- 列表 -->
<ImageTable
:list="list"
:loading="loading"
@delete="handleDelete"
/>
</div>
</Tabs.TabPane>
<!-- 分页组件 -->
<div class="mt-4 flex justify-end">
<Pagination
v-model:current="queryParams.pageNo"
v-model:page-size="queryParams.pageSize"
:total="total"
show-size-changer
@change="getList"
@show-size-change="getList"
/>
</div>
</Tabs.TabPane>
<!-- TODO @dylan语音和视频的 tab 有了两个外框需要优化下 -->
<!-- tab 2语音 -->
<Tabs.TabPane :key="UploadType.Voice">
<template #tab>
<span class="flex items-center">
<IconifyIcon icon="mdi:microphone" class="mr-1" />
语音
</span>
</template>
<UploadFile
v-if="hasAccessByCodes(['mp:material:upload-permanent'])"
:type="UploadType.Voice"
@uploaded="getList"
>
格式支持 mp3/wma/wav/amr文件大小不超过 2M播放长度不超过 60s
</UploadFile>
<!-- 列表 -->
<VoiceTable :list="list" :loading="loading" @delete="handleDelete" />
<!-- 分页组件 -->
<div class="mt-4 flex justify-end">
<Pagination
v-model:current="queryParams.pageNo"
v-model:page-size="queryParams.pageSize"
:total="total"
show-size-changer
@change="getList"
@show-size-change="getList"
<!-- tab 2语音 -->
<Tabs.TabPane :key="UploadType.Voice">
<template #tab>
<span class="flex items-center">
<IconifyIcon icon="lucide:mic" class="mr-1" />
语音
</span>
</template>
<UploadFile
v-if="hasAccessByCodes(['mp:material:upload-permanent'])"
:type="UploadType.Voice"
@uploaded="getList"
>
格式支持 mp3/wma/wav/amr文件大小不超过 2M播放长度不超过 60s
</UploadFile>
<!-- 列表 -->
<VoiceTable
:list="list"
:loading="loading"
@delete="handleDelete"
/>
</div>
</Tabs.TabPane>
<!-- 分页组件 -->
<div class="mt-4 flex justify-end">
<Pagination
v-model:current="queryParams.pageNo"
v-model:page-size="queryParams.pageSize"
:total="total"
show-size-changer
@change="getList"
@show-size-change="getList"
/>
</div>
</Tabs.TabPane>
<!-- tab 3视频 -->
<Tabs.TabPane :key="UploadType.Video">
<template #tab>
<span class="flex items-center">
<IconifyIcon icon="mdi:video" class="mr-1" />
视频
</span>
</template>
<Button
v-if="hasAccessByCodes(['mp:material:upload-permanent'])"
type="primary"
@click="showCreateVideo = true"
>
新建视频
</Button>
<!-- 新建视频的弹窗 -->
<!-- TODO @dlyan是不是用 Modal 自带的 api 就好啦modal.open 哪个 -->
<UploadVideo v-model:open="showCreateVideo" @uploaded="getList" />
<!-- 列表 -->
<VideoTable :list="list" :loading="loading" @delete="handleDelete" />
<!-- 分页组件 -->
<div class="mt-4 flex justify-end">
<Pagination
v-model:current="queryParams.pageNo"
v-model:page-size="queryParams.pageSize"
:total="total"
show-size-changer
@change="getList"
@show-size-change="getList"
<!-- tab 3视频 -->
<Tabs.TabPane :key="UploadType.Video">
<template #tab>
<span class="flex items-center">
<IconifyIcon icon="lucide:video" class="mr-1" />
视频
</span>
</template>
<Button
v-if="hasAccessByCodes(['mp:material:upload-permanent'])"
type="primary"
@click="showCreateVideo = true"
>
新建视频
</Button>
<!-- 新建视频的弹窗 -->
<UploadVideo v-model:open="showCreateVideo" @uploaded="getList" />
<!-- 列表 -->
<VideoTable
:list="list"
:loading="loading"
@delete="handleDelete"
/>
</div>
</Tabs.TabPane>
</Tabs>
</Card>
<!-- 分页组件 -->
<div class="mt-4 flex justify-end">
<Pagination
v-model:current="queryParams.pageNo"
v-model:page-size="queryParams.pageSize"
:total="total"
show-size-changer
@change="getList"
@show-size-change="getList"
/>
</div>
</Tabs.TabPane>
</Tabs>
</Card>
</div>
</Page>
</template>