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

export class TPrintData implements IEntity {
    // 编号
    public Id: string;
    // 交易实例号
    public BusinessId: string;
    // 表单所属模板号
    public Formid: string;
    // 表单所属模板名称
    public Formname: string;
    // 表单数据
    public Formdata: Uint8Array;
    // 权限次数
    public Rolecount: number;
    // 文件长度
    public FormdataLength: number;

    constructor() {
        this.Id = '';
        this.BusinessId = '';
        this.Formid = '';
        this.Formname = '';
        this.Formdata = new Uint8Array();
        this.Rolecount = 0;
        this.FormdataLength = 0;
    }

    public ChangeToTable(): string[] {
        return [
            this.Id,
            this.BusinessId,
            this.Formid,
            this.Formname,
            this.Rolecount.toString(),
            this.Formdata.length.toString()
        ];
    }

    public ChangeFromTable(parms: any[]): void {
        this.Id = parms[0].toString();
        this.BusinessId = parms[1].toString();
        this.Formid = parms[2].toString();
        this.Formname = parms[3].toString();
        this.Rolecount = parseInt(parms[4].toString(), 10);
        this.FormdataLength = parseInt(parms[5].toString(), 10);
    }
}