// 假设 Transit 类型定义如下
type Transit = string; 

export class TradeParames {
    // 8583报文类型标识串
    public static MsgType: string = "01001";
    // 加减密字符串
    public static KeyStr: string = "dhccnew";
    // 交易数据日志配置节点名称
    public static TradeDataLog: string = "TradeData";
    // 1参数：渠道callserver,callagn,calltips
    // 2参数：对应渠道的详细报文类型信息
    public static MsgFormat: { [key in Transit]: { [key: string]: object } } | null = null;

    // 交易参数字典
    private static _tradeParames: Map<string, string> = new Map<string, string>();

    // 机构号
    public static get KinbrNo(): string {
        return this.getValue("KinbrNo");
    }
    // 机构名称
    public static get KinbrName(): string {
        return this.getValue("KinbrName");
    }
    // 柜员号
    public static get TellerNo(): string {
        return this.getValue("TellerNo");
    }
    // 柜员姓名
    public static get TellerName(): string {
        return this.getValue("TellerName");
    }
    // 终端号
    public static get TtyName(): string {
        return this.getValue("TtyName");
    }
    // 交易日期
    public static get TradeDate(): string {
        return this.getValue("TradeDate");
    }
    // 权限
    public static get Rights(): string {
        return this.getValue("Rights");
    }
    // 开户局号
    public static get Opnbr(): string {
        return this.getValue("Opnbr");
    }
    // 密码
    public static get Passwd(): string {
        return this.getValue("Passwd");
    }
    // 柜员级别
    public static get Tlrlvl(): string {
        return this.getValue("Tlrlvl");
    }

    // 获取key对应的value
    private static getValue(key: string): string {
        if (!this._tradeParames.has(key)) {
            this._tradeParames.set(key, "");
        }
        return this._tradeParames.get(key)!;
    }

    // 设置交易参数
    public static setValue(key: string, value: string): boolean {
        this._tradeParames.set(key, value);
        return true;
    }
}