import _ from "lodash"; import { IUnitResponse } from "../core"; import { IWtuiColWidthResponse, TWtuiColWidthResponse } from "./IWtuiColWidthResponse"; export interface ICnfgPara { pzptListBGColor: string; //凭证平台列表.表头背景色 pzptp1BGColor: string; //凭证平台列表.分录模式凭证所在行背景色 pzptBGColor: string; //凭证平台.录入界面.表头背景色 pzptEachBGColor: string; //凭证平台.录入界面.辅助核算.表头背景色 /** 警告提示框等待时间 秒 */ warningWaitTime: number; /** 警告提示框是否可关闭 */ warningCanClose: boolean; /** 错误提示框等待时间 秒 */ errorWaitTime: number; /** 错误提示框是否可关闭 */ errorCanClose: boolean; /** 主题颜色 */ themeColor: string; } export class TCnfgPara implements ICnfgPara { pzptListBGColor: string = ""; pzptp1BGColor: string = ""; pzptBGColor: string = ""; pzptEachBGColor: string = ""; warningWaitTime: number = 10000; warningCanClose: boolean = false; errorWaitTime: number = 10000; errorCanClose: boolean = false; themeColor: string = "#2969e4"; } export interface IWtuiUserCnfgResponse { whoBuild: number; userIndx: number; cnfgIndx: number; parentID: number; hashCode: number; dataLevl: number; dataFrom: number; dataType: number; kjndKJQJ: number; isLasted: number; dataStat: number; dataOrdr: number; dataHide: number; dataDate: number; dataTime: number; dataGUID: string; mastName: string; mastGUID: string; createBy: string; createAt: number; updateBy: string; updateAt: number; deleteBy: string; deleteAt: number; queuesBy: number; entityID: string; //#唯一标识 wtuiForm: number; wtuiArea: number; cnfgName: string; cnfgMemo: string; cnfgUses: string; rowCount: number; colCount: number; realPage: number; //当前选择页签 cnfgPara: string; unitMain: number; unitText: string; cnfgFrom: string; billMain: number; colWidth: IWtuiColWidthResponse[]; listUnit: IUnitResponse[]; //虚拟字段 cnfg: TCnfgPara | undefined; } export class TWtuiUserCnfgResponse implements IWtuiUserCnfgResponse { whoBuild: number = 0; userIndx: number = 0; cnfgIndx: number = 0; parentID: number = 0; hashCode: number = 0; dataLevl: number = 0; dataFrom: number = 0; dataType: number = 0; kjndKJQJ: number = 0; isLasted: number = 0; dataStat: number = 0; dataOrdr: number = 0; dataHide: number = 0; dataDate: number = 0; dataTime: number = 0; dataGUID: string = ""; mastName: string = ""; mastGUID: string = ""; createBy: string = ""; createAt: number = 0; updateBy: string = ""; updateAt: number = 0; deleteBy: string = ""; deleteAt: number = 0; queuesBy: number = 0; entityID: string = ""; /** 打印时添加的自定义配置,用以区分纵向还是横向打印,0为纵向,1为横向 */ wtuiForm: number = 0; wtuiArea: number = 0; cnfgName: string = ""; cnfgMemo: string = ""; cnfgUses: string = ""; rowCount: number = 0; colCount: number = 0; realPage: number = 0; cnfgPara: string = ""; unitMain: number = 0; unitText: string = ""; cnfgFrom: string = ""; billMain: number = 0; colWidth: TWtuiColWidthResponse[] = []; listUnit: IUnitResponse[] = []; cnfg: TCnfgPara | undefined = undefined; constructor(response?: any) { if (response) { _.merge(this, _.pick(response, Object.keys(this))); } } public static parseJson(dictPara: string) { const defaultDictPara = new TCnfgPara(); if (_.isEmpty(dictPara)) { return defaultDictPara; } try { const obj = JSON.parse(dictPara) as TCnfgPara; return _.merge(defaultDictPara, obj); } catch (e) { } return defaultDictPara; } }