2025-03-26
This commit is contained in:
38
src/views/userManagement/role/constant/edit.ts
Normal file
38
src/views/userManagement/role/constant/edit.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
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;
|
||||
disabled?: boolean;
|
||||
fileList?: any;
|
||||
prompt?: any;
|
||||
isAll?: any;
|
||||
}
|
||||
export const EDIT_FORM_DATA: FormItem[] = [
|
||||
{
|
||||
prop: "name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "角色名: "
|
||||
},
|
||||
{
|
||||
prop: "desc",
|
||||
type: "textarea",
|
||||
placeholder: "请输入",
|
||||
label: "角色描述: "
|
||||
}
|
||||
];
|
||||
export const EDIT_RULE_FORM = {};
|
||||
// editRuleForm: {},
|
||||
//editFormData: [],
|
||||
5
src/views/userManagement/role/constant/index.ts
Normal file
5
src/views/userManagement/role/constant/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { FORM_DATA, RULE_FORM } from "./search";
|
||||
import { COLUMNS } from "./table";
|
||||
import { RULES } from "./rules";
|
||||
import { EDIT_FORM_DATA, EDIT_RULE_FORM } from "./edit";
|
||||
export { FORM_DATA, RULE_FORM, COLUMNS, EDIT_FORM_DATA, EDIT_RULE_FORM, RULES };
|
||||
3
src/views/userManagement/role/constant/rules.ts
Normal file
3
src/views/userManagement/role/constant/rules.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const RULES = {
|
||||
name: [{ required: true, message: "角色名称不能为空 ! ", trigger: "blur" }]
|
||||
};
|
||||
31
src/views/userManagement/role/constant/search.ts
Normal file
31
src/views/userManagement/role/constant/search.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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: "name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
isArray: true,
|
||||
label: "角色名: "
|
||||
}
|
||||
];
|
||||
|
||||
export const RULE_FORM = {
|
||||
page: 1,
|
||||
size: 50
|
||||
};
|
||||
33
src/views/userManagement/role/constant/table.ts
Normal file
33
src/views/userManagement/role/constant/table.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { RenderScope } from "@/components/ProTable/interface";
|
||||
export const COLUMNS = [
|
||||
{
|
||||
align: "center",
|
||||
fixed: true,
|
||||
label: "ID",
|
||||
prop: "id",
|
||||
width: 80
|
||||
},
|
||||
|
||||
{
|
||||
align: "center",
|
||||
fixed: true,
|
||||
label: "角色名",
|
||||
prop: "name"
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
label: "角色描述",
|
||||
prop: "desc"
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
label: "权限",
|
||||
prop: "authority",
|
||||
render: (scope: RenderScope<any>): VNode | string | any => {
|
||||
return Object.values(scope.row.authority).join("/");
|
||||
|
||||
// return scope.row.authority ? scope.row.authority.join(",") : "";
|
||||
}
|
||||
},
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
||||
];
|
||||
Reference in New Issue
Block a user