2025-03-26
This commit is contained in:
3
src/views/articleManagement/recycle/constant/index.ts
Normal file
3
src/views/articleManagement/recycle/constant/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { FORM_DATA, RULE_FORM } from "./search";
|
||||
import { COLUMNS } from "./table";
|
||||
export { FORM_DATA, RULE_FORM, COLUMNS };
|
||||
40
src/views/articleManagement/recycle/constant/search.ts
Normal file
40
src/views/articleManagement/recycle/constant/search.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
interface FormItem {
|
||||
prop: string;
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
type: string;
|
||||
isCopy?: boolean;
|
||||
optionProps?: any;
|
||||
startPlaceholder?: string;
|
||||
endPlaceholder?: string;
|
||||
options?: any;
|
||||
isArray?: boolean;
|
||||
startDate?: string; //开始时间(传入后台需要的参数)
|
||||
endDate?: string; //结束时间(传入后台需要的参数)
|
||||
startProp?: string;
|
||||
endProp?: string;
|
||||
isInteger?: boolean;
|
||||
}
|
||||
export const FORM_DATA: FormItem[] = [
|
||||
{
|
||||
prop: "title",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
isArray: true,
|
||||
label: "文章名称: "
|
||||
},
|
||||
|
||||
{
|
||||
prop: "category_id",
|
||||
placeholder: "请选择",
|
||||
type: "select",
|
||||
isArray: true,
|
||||
label: "文章分类: ",
|
||||
options: []
|
||||
}
|
||||
];
|
||||
|
||||
export const RULE_FORM = {
|
||||
page: 1,
|
||||
size: 50
|
||||
};
|
||||
61
src/views/articleManagement/recycle/constant/table.ts
Normal file
61
src/views/articleManagement/recycle/constant/table.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import { RenderScope } from "@/components/ProTable/interface";
|
||||
const YES_OR_NO: any = {
|
||||
1: "✔️",
|
||||
0: "❌"
|
||||
};
|
||||
export const COLUMNS = [
|
||||
{ type: "selection", fixed: "left", width: 40 },
|
||||
{
|
||||
align: "center",
|
||||
fixed: true,
|
||||
label: "ID",
|
||||
prop: "id",
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
label: "图片",
|
||||
prop: "image",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "文章名称",
|
||||
prop: "title"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "文章分类",
|
||||
prop: "category_name"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "文章排序",
|
||||
prop: "sort",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "首页推荐",
|
||||
prop: "recommend",
|
||||
render: (scope: RenderScope<any>): VNode | string | any => {
|
||||
return YES_OR_NO[scope.row.recommend];
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "发布时间",
|
||||
prop: "release_time",
|
||||
width: 160
|
||||
},
|
||||
|
||||
{
|
||||
align: "center",
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
width: 80
|
||||
},
|
||||
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
||||
];
|
||||
Reference in New Issue
Block a user