// 假设 IEntity 接口定义如下
interface IEntity {
    ChangeToTable(): string[];
    ChangeFromTable(parms: any[]): void;
}

export class TradeForms implements IEntity {
    /**
     * 表单模板号
     */
    public FormId: string;
    /**
     * 表单模板名称
     */
    public FormName: string;
    /**
     * 权限次数
     */
    public RoleCount: number;
    /**
     * 是否启用
     */
    public IsEnabled: number;
    /**
     * 打印排序号
     */
    public SortIndex: number;
    /**
     * 可授权级别
     */
    public AuthLevel: string;

    constructor() {
        this.FormId = '';
        this.FormName = '';
        this.RoleCount = 0;
        this.IsEnabled = 0;
        this.SortIndex = 0;
        this.AuthLevel = '';
    }

    public ChangeToTable(): string[] {
        return [
            this.FormId,
            this.FormName,
            this.RoleCount.toString(),
            this.IsEnabled.toString(),
            this.SortIndex.toString(),
            this.AuthLevel
        ];
    }

    public ChangeFromTable(parms: any[]): void {
        this.FormId = parms[0].toString();
        this.FormName = parms[1].toString();
        this.RoleCount = parseInt(parms[2].toString(), 10);
        this.IsEnabled = parseInt(parms[3].toString(), 10);
        this.SortIndex = parseInt(parms[4].toString(), 10);
        this.AuthLevel = parms[5].toString();
    }
}