优化:文章状态显示

This commit is contained in:
Liu 宇阳
2024-11-18 15:30:32 +08:00
parent 1f04f4687e
commit aab6f13b1e
2 changed files with 14 additions and 3 deletions

View File

@@ -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',

View File

@@ -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
}