review:【antd】【mp】material、message 的迁移 v2
This commit is contained in:
@@ -23,6 +23,7 @@ const { hasAccessByCodes } = useAccess();
|
||||
<div class="waterfall">
|
||||
<div v-for="item in props.list" :key="item.id" class="waterfall-item">
|
||||
<a :href="item.url" target="_blank">
|
||||
<!-- TODO @dylan:要不用 Image 组件? -->
|
||||
<img :src="item.url" class="material-img" />
|
||||
<div class="item-name">{{ item.name }}</div>
|
||||
</a>
|
||||
|
||||
@@ -25,6 +25,8 @@ const emit = defineEmits<{
|
||||
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
|
||||
// TODO @dylan:这里有个告警哈;
|
||||
// TODO @dylan:放到 data.ts 里;
|
||||
const columns: VxeTableGridOptions<any>['columns'] = [
|
||||
{
|
||||
field: 'mediaId',
|
||||
@@ -50,6 +52,7 @@ const columns: VxeTableGridOptions<any>['columns'] = [
|
||||
align: 'center',
|
||||
minWidth: 220,
|
||||
},
|
||||
// TODO @dylan:视频的样式,有点奇怪。
|
||||
{
|
||||
field: 'video',
|
||||
title: '视频',
|
||||
@@ -87,7 +90,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
isHover: true,
|
||||
},
|
||||
showOverflow: 'tooltip',
|
||||
} as VxeTableGridOptions<any>, // TODO @dylan:这里有个告警哈;
|
||||
} as VxeTableGridOptions<any>, // TODO @dylan:这里有个告警哈;
|
||||
});
|
||||
|
||||
function handleDownload(url: string) {
|
||||
@@ -121,9 +124,11 @@ watch(
|
||||
<template #video="{ row }">
|
||||
<WxVideoPlayer v-if="row.url" :url="row.url" />
|
||||
</template>
|
||||
<!-- TODO @dylan:应该 data.ts 里 formatDate 就好了。别的模块有的哈。 -->
|
||||
<template #createTime="{ row }">
|
||||
{{ formatDate2(row.createTime) }}
|
||||
</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" />
|
||||
|
||||
@@ -14,6 +14,8 @@ import { WxVoicePlayer } from '#/views/mp/components/wx-voice-play';
|
||||
|
||||
// TODO @dylan:vue 组件名小写 + 中划线
|
||||
|
||||
// TODO @dylan:组件内,尽量用 modules 哈。只有对外共享,才用 components
|
||||
|
||||
const props = defineProps<{
|
||||
list: any[];
|
||||
loading: boolean;
|
||||
@@ -25,6 +27,8 @@ const emit = defineEmits<{
|
||||
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
|
||||
// TODO @dylan:这里有个告警哈;
|
||||
// TODO @dylan:放到 data.ts 里;
|
||||
const columns: VxeTableGridOptions<any>['columns'] = [
|
||||
{
|
||||
field: 'mediaId',
|
||||
@@ -38,6 +42,7 @@ const columns: VxeTableGridOptions<any>['columns'] = [
|
||||
align: 'center',
|
||||
minWidth: 200,
|
||||
},
|
||||
// TODO @dylan:语音的样式,有点奇怪。
|
||||
{
|
||||
field: 'voice',
|
||||
title: '语音',
|
||||
@@ -109,10 +114,12 @@ watch(
|
||||
<template #voice="{ row }">
|
||||
<WxVoicePlayer v-if="row.url" :url="row.url" />
|
||||
</template>
|
||||
<!-- TODO @dylan:应该 data.ts 里 formatDate 就好了。别的模块有的哈。 -->
|
||||
<template #createTime="{ row }">
|
||||
{{ 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" />
|
||||
下载
|
||||
|
||||
@@ -85,6 +85,7 @@ function onTabChange() {
|
||||
|
||||
/** 处理删除操作 */
|
||||
async function handleDelete(id: number) {
|
||||
// TODO @dylan:参考别的模块的 dylan 哈;
|
||||
Modal.confirm({
|
||||
content: '此操作将永久删除该文件, 是否继续?',
|
||||
title: '提示',
|
||||
@@ -98,6 +99,7 @@ async function handleDelete(id: number) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- TODO @dylan:这里不太对哈,应该是 doc-alert 展示文档 -->
|
||||
<Page
|
||||
description="公众号素材"
|
||||
doc-link="https://doc.iocoder.cn/mp/material/"
|
||||
@@ -144,6 +146,7 @@ async function handleDelete(id: number) {
|
||||
</div>
|
||||
</Tabs.TabPane>
|
||||
|
||||
<!-- TODO @dylan:语音和视频的 tab 下,有了两个外框,需要优化下; -->
|
||||
<!-- tab 2:语音 -->
|
||||
<Tabs.TabPane :key="UploadType.Voice">
|
||||
<template #tab>
|
||||
@@ -190,6 +193,7 @@ async function handleDelete(id: number) {
|
||||
新建视频
|
||||
</Button>
|
||||
<!-- 新建视频的弹窗 -->
|
||||
<!-- TODO @dlyan:是不是用 Modal 自带的 api 就好啦?modal.open 哪个 -->
|
||||
<UploadVideo v-model:open="showCreateVideo" @uploaded="getList" />
|
||||
<!-- 列表 -->
|
||||
<VideoTable :list="list" :loading="loading" @delete="handleDelete" />
|
||||
|
||||
Reference in New Issue
Block a user