You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
export default class PageRecord {
|
|
|
|
public UUID: string;
|
|
|
|
public Name: string;
|
|
|
|
public OrgUserId: string;
|
|
|
|
public IsPublic = true;
|
|
|
|
public IsVisibleInMenu = true;
|
|
|
|
public ParentId: string;
|
|
|
|
public NodeIds: Array<string>;
|
|
|
|
public CreatedAt: Date;
|
|
|
|
public UpdatedAt: Date;
|
|
|
|
public CreatedUserId: string;
|
|
|
|
public UpdateUserId: string;
|
|
|
|
public ChildPageIds: Array<string>;
|
|
|
|
public level: 'view'|'manage'|'update'|false;
|
|
|
|
|
|
|
|
constructor(data: any = {Name: 'Click to edit...'}) {
|
|
|
|
[
|
|
|
|
'UUID',
|
|
|
|
'Name',
|
|
|
|
'OrgUserId',
|
|
|
|
'IsPublic',
|
|
|
|
'IsVisibleInMenu',
|
|
|
|
'ParentId',
|
|
|
|
'NodeIds',
|
|
|
|
'CreatedAt',
|
|
|
|
'UpdatedAt',
|
|
|
|
'CreatedUserId',
|
|
|
|
'UpdateUserId',
|
|
|
|
'ChildPageIds',
|
|
|
|
'level'
|
|
|
|
].forEach(field => {
|
|
|
|
if ( field in data ) {
|
|
|
|
this[field] = data[field];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
toSave() {
|
|
|
|
const data = {};
|
|
|
|
[
|
|
|
|
'UUID',
|
|
|
|
'Name',
|
|
|
|
'OrgUserId',
|
|
|
|
'IsPublic',
|
|
|
|
'IsVisibleInMenu',
|
|
|
|
'ParentId',
|
|
|
|
'NodeIds',
|
|
|
|
'CreatedAt',
|
|
|
|
'UpdatedAt',
|
|
|
|
'CreatedUserId',
|
|
|
|
'UpdateUserId',
|
|
|
|
'ChildPageIds'
|
|
|
|
].forEach(field => {
|
|
|
|
if ( field in this ) {
|
|
|
|
data[field] = this[field];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
isViewOnly() {
|
|
|
|
return this.level === 'view';
|
|
|
|
}
|
|
|
|
}
|