Appearance
模板类型
Options 参数
参娄 | 类型 | 默认值 | 描述 |
---|---|---|---|
showPageHeader | boolean | true | header 开关 |
showLayoutAnchor | boolean | true | 锚点导航开关 |
isDetail | boolean | false | 详情状态开关 |
showBackIcon | boolean | false | 退回 icon 开关 |
pageTitle | string | / | 模板标题 |
businessType | string | / | 模块业务类型 |
role | Role | 'purchase' | 当前角色 |
currentRow | CurrentRow | {} | 当前已选行数据 |
refreshMethods | (row?:CurrentRow)=>void | / | 组件刷新方法配置 |
userInfo | UserInfo | {} | 当前登录租户信息 |
token | string | / | 当前 token |
pattern | Pattern | 'vertical' | 布局模式 |
localConfig | LocalConfig | {} | 本地自定义页面数据配置 |
handleAfterRemoteConfig | HandleAfter | null | 自定义组装配置方法 |
detailApi | DetailApiFunctionType | / | 明细接口 |
handleAfterDetailApiResponse | HandleAfter | null | 钩子方法 |
pageButtons | PageButton[] | null | 页面按钮配置 |
isUseLocalData | boolean | false | 开关 |
localData | RecordString | {} | 本地页面数据 |
GlobalPageLayoutTypes.ResponseType
ts
export interface ResponseType {
code: number;
message: string;
result: RecordString;
success: boolean;
timestamp: number;
}
GlobalPageLayoutTypes.UserInfo
ts
export interface UserInfo {
elsAccount: string;
subAccount: string;
serivceUrl: string;
[key: string]: unknown;
}
GlobalPageLayoutTypes.CurrentRow
ts
export interface CurrentRow {
templateNumber: string;
templateVersion: number;
templateAccount: string;
busAccount: string;
elsAccount: string;
[key: string]: unknown;
}
GlobalPageLayoutTypes.DictCodeItem
ts
export interface DictCodeItem {
title: string;
value: string;
[key: string]: unknown;
}
GlobalPageLayoutTypes.Role
ts
// 角色信息
export type Role = "purchase" | "sale";
GlobalPageLayoutTypes.GroupType
ts
export type GroupType = "head" | "item";
GlobalPageLayoutTypes.Pattern
ts
// 数据字典 srmLayout
// 布局模式: 平铺布局 vertical (默认), Tab布局 tab, 主从布局 master
export type Pattern = "vertical" | "tab" | "master";
GlobalPageLayoutTypes.Icon
ts
export interface Icon {
type: string;
size: number;
color?: string;
}
GlobalPageLayoutTypes.PageButtonArgs
ts
export interface PageButtonArgs {
url: string;
[key: string]: unknown;
}
GlobalPageLayoutTypes.PageButton
ts
export interface PageButton {
title: string;
i18nKey?: string;
key: string | symbol;
args: PageButtonArgs | PageButtonArgsFunctionType;
authorityCode?: string;
attrs?: RecordString;
icon?: Icon;
emit?: boolean;
emitKey?: string;
showMessage?: boolean;
checkBefore?: boolean;
confirm?: {
title: string;
content: string;
};
dropdown?: boolean;
isExistFrozenSource?: boolean;
isExistFrozenSourceUrl?: string;
isExistFrozenSourceParams?: (pageData: RecordString) => RecordString;
disabled?: (pageData: RecordString) => boolean;
handleBefore?: (
args: ExposeWithPageButtons
) => Promise<ExposeWithPageButtons>;
handleAfter?: (args: ExposeWithPageButtons) => Promise<ExposeWithPageButtons>;
callback?: (payload: PageButtonPayload) => void;
}
GlobalPageLayoutTypes.PageUploadButton
ts
export interface PageUploadButton extends Omit<PageButton, "args"> {
args?: {
url?: string;
[key: string]: unknown;
};
}
GlobalPageLayoutTypes.PageDeleteFileRowButton
ts
export interface PageDeleteFileRowButton
extends Omit<PageButton, "handleBefore" | "handleAfter" | "args"> {
args?: {
url?: string;
role?: string;
[key: string]: unknown;
};
handleBefore?: (
args: ExposeWithPageDeleteFileRows
) => Promise<ExposeWithPageDeleteFileRows>;
handleAfter?: (
args: ExposeWithPageDeleteFileRows
) => Promise<ExposeWithPageDeleteFileRows>;
}
GlobalPageLayoutTypes.PageButtonPosition
ts
// 模板按钮组位置
export type PageButtonPosition = "top" | "bottom";
GlobalPageLayoutTypes.RecordString
ts
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type RecordString = Record<string, any>;
GlobalPageLayoutTypes.BeforeEditMethodParams
ts
/**
* 参数扩展
* 该方法的返回值用来决定该单元格是否允许编辑
*/
export interface BeforeEditMethodParams {
row: VxeTableDataRow;
rowIndex: number;
column: VxeTableDefines.ColumnInfo<VxeTableDataRow>;
columnIndex: number;
$table: VxeTableConstructor<VxeTableDataRow> &
VxeTablePrivateMethods<VxeTableDataRow>;
$grid: VxeGridConstructor<VxeTableDataRow> | null | undefined;
}
GlobalPageLayoutTypes.MixBeforeEditMethod
ts
export interface MixBeforeEditMethod {
(pageData: Ref<RecordString>, params: BeforeEditMethodParams): boolean;
}
GlobalPageLayoutTypes.MixEditConfig
ts
export type MixEditConfig = OmitBeforeEditMethodEditConfig & {
beforeEditMethod?: MixBeforeEditMethod;
};
GlobalPageLayoutTypes.Group
ts
export interface Group {
groupName: string;
groupNameI18nKey?: string;
groupCode: string;
groupType: GroupType;
sortOrder?: string;
buttons?: PageButton[] | UploadPageButton[];
extend?: GroupExtend;
show?: boolean;
shake?: boolean;
slot?: boolean;
master?: boolean;
enableTile?: "0" | "1";
columns?: ColumnItem[];
formFields?: FormFieldsItem[];
}
GlobalPageLayoutTypes.HeadGroupType
ts
export interface HeadGroupType extends Group {
groupType: "head";
formFields: FormFieldsItem[];
}
GlobalPageLayoutTypes.ItemGroupType
ts
export interface ItemGroupType extends Group {
groupType: "item";
columns: ColumnItem[];
}
GlobalPageLayoutTypes.GroupItem
ts
export type GroupItem = HeadGroupType | ItemGroupType;
GlobalPageLayoutTypes.Expose
ts
export interface Expose {
pageData: RecordString;
layoutConfig: LayoutConfig;
defaultValues: RecordString;
uid?: number;
}
GlobalPageLayoutTypes.ValuePayload
ts
export interface ValuePayload {
value: StringOrNumber;
label?: string | string[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
extra?: any;
data?: RecordString[];
pageData: RecordString;
layoutConfig: LayoutConfig;
userInfo?: UserInfo;
modalData?: RecordString[];
selectedOptions?: CascaderProps["options"];
customFormatItem?: CustomFormatItem;
setItemRequired?: SetItemRequired;
setItemDisabled?: SetItemDisabled;
setItemRequiredOrDisabled?: SetItemRequiredOrDisabled;
Decimal?: typeof Decimal;
topEmit?: () => void;
}
GlobalPageLayoutTypes.VxePayload
ts
export type VxePayload = {
value?: StringOrNumber;
label?: string | string[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
extra?: any;
data?: RecordString[];
pageData: RecordString;
layoutConfig: LayoutConfig;
userInfo?: UserInfo;
modalData?: RecordString[];
row: RecordString;
idx: number;
fileData?: RecordString[];
customFormatItem?: CustomFormatItem;
setItemRequired?: SetItemRequired;
setItemDisabled?: SetItemDisabled;
setItemRequiredOrDisabled?: SetItemRequiredOrDisabled;
Decimal?: typeof Decimal;
topEmit?: () => void;
};
GlobalPageLayoutTypes.FormFieldsItem
ts
export interface FormFieldsItem {
groupCode: string;
fieldType: string;
fieldLabel: string;
fieldName: string;
helpText?: string;
required?: "0" | "1";
regex?: RegExp;
alertMsg?: string;
callback?: (ctx: ComponentInternalInstance | null, payload: Payload) => void;
// extend?: Extend | UploadExtend | LadderPriceExtend
[key: string]: unknown;
}
GlobalPageLayoutTypes.ColumnItem
ts
export interface ColumnItem {
groupCode: string;
title: string;
fieldLabelI18nKey?: string;
field: string;
fieldType?: string;
helpText?: string;
required?: "0" | "1";
regex?: string | RegExp;
alertMsg?: string;
callback?: (ctx: SetupContext, payload: VxePayload) => void;
// extend?: Extend | UploadExtend | LadderPriceExtend
[key: string]: unknown;
}
GlobalPageLayoutTypes.RemoteConfig
ts
// 原始配置文件数组结构,用于组装服务端 JS配置 或 本地配置
// 服务端返回的JS配置文件的初始配置
export type RemoteConfig = {
editLayout?: string;
tempRole?: string;
examineLayout?: string;
groups: Group[];
formFields: FormFieldsItem[];
itemColumns: ColumnItem[];
};
GlobalPageLayoutTypes.LayoutConfig
ts
// 经过组装后的页面配置
// 去除 formFields, itemColumns
export type LayoutConfig = Omit<
RemoteConfig,
"groups" | "formFields" | "itemColumns"
> & {
groups: GroupItem[];
};