优化:文章状态显示
This commit is contained in:
@@ -9,7 +9,7 @@ import { getTagListAPI } from '@/api/Tag'
|
||||
import { delArticleDataAPI, getArticleListAPI } from '@/api/Article';
|
||||
import type { Tag as ArticleTag } from '@/types/app/tag';
|
||||
import type { Cate } from '@/types/app/cate';
|
||||
import type { Article, FilterArticle, FilterForm } from '@/types/app/article';
|
||||
import type { Article, Config, FilterArticle, FilterForm } from '@/types/app/article';
|
||||
|
||||
import { useWebStore } from '@/stores';
|
||||
|
||||
@@ -104,6 +104,18 @@ const ArticlePage = () => {
|
||||
render: (data: string) => <span>{data}</span>,
|
||||
sorter: (a: Article, b: Article) => a.comment! - b.comment!
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'config',
|
||||
key: 'config',
|
||||
align: 'center',
|
||||
render: (config: Config) => (
|
||||
config.status === "default" && <span>正常</span> ||
|
||||
config.status === "no_home" && <span>不在首页显示</span> ||
|
||||
config.status === "hide" && <span>隐藏</span> ||
|
||||
config.password.trim().length && <span>文章加密</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '发布时间',
|
||||
dataIndex: 'createTime',
|
||||
|
||||
3
src/types/app/article.d.ts
vendored
3
src/types/app/article.d.ts
vendored
@@ -1,12 +1,11 @@
|
||||
import { Cate } from "./cate"
|
||||
import { Tag } from "./tag"
|
||||
|
||||
export type Status = "show" | "no_home" | "hide"
|
||||
export type Status = "default" | "no_home" | "hide"
|
||||
|
||||
export interface Config {
|
||||
id?: number,
|
||||
articleId?: number,
|
||||
top: number,
|
||||
status: Status,
|
||||
password:string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user