feat(help): 添加PDF下载功能并优化帮助页面表格显示
- 在表格中添加PDF下载按钮,支持点击下载文件 - 引入openUrl工具函数处理URL打开逻辑 - 将文章标题列重命名为标题列 - 新增立即下载列用于显示PDF链接 - 移除创建时间列的宽度限制和排序功能 - 注释掉行点击编辑事件避免重复操作 - 临时注释开发环境API地址配置
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
VITE_APP_NAME=后台管理(开发环境)
|
||||
VITE_API_URL=http://127.0.0.1:9200/api
|
||||
#VITE_API_URL=http://127.0.0.1:9200/api
|
||||
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
fallback="https://file.wsdns.cn/20230218/550e610d43334dd2a7f66d5b20bd58eb.svg"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'pdfUrl'">
|
||||
<a-button type="primary" @click="openUrl(record.pdfUrl)">立即下载</a-button>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
@@ -76,7 +79,7 @@
|
||||
import router from '@/router';
|
||||
import { toTreeData } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import { detail, getPageTitle } from '@/utils/common';
|
||||
import {detail, getPageTitle, openUrl} from '@/utils/common';
|
||||
import { listCmsNavigation } from '@/api/cms/cmsNavigation';
|
||||
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
|
||||
import { CmsArticleCategory } from '@/api/cms/cmsArticleCategory/model';
|
||||
@@ -138,10 +141,15 @@
|
||||
// align: 'center'
|
||||
// },
|
||||
{
|
||||
title: '文章标题',
|
||||
title: '标题',
|
||||
dataIndex: 'title',
|
||||
key: 'title'
|
||||
},
|
||||
{
|
||||
title: '立即下载',
|
||||
dataIndex: 'pdfUrl',
|
||||
key: 'pdfUrl'
|
||||
},
|
||||
// {
|
||||
// title: '栏目名称',
|
||||
// dataIndex: 'categoryName',
|
||||
@@ -201,9 +209,7 @@
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
width: 180,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd'),
|
||||
sorter: true
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||
}
|
||||
// {
|
||||
// title: '操作',
|
||||
@@ -309,7 +315,7 @@
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
openEdit(record);
|
||||
// openEdit(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
|
||||
Reference in New Issue
Block a user