interface Config {
	ref: string,
	model: string,
	rules: string,
	size: string,
	labelPosition: string,
	labelWidth: number,
	disabled: boolean,
	isMobile: boolean,
	counter: 0
}

export default class FormBuild {
	// 表单配置
	config: Config
	// 字段信息
	fields: Array<any>

	constructor() {
		this.config = {
			ref: 'formRef',
			model: 'form',
			rules: 'rules',
			size: 'default',
			labelPosition: 'right',
			labelWidth: 100,
			disabled: false,
			isMobile: false,
			counter: 0
		}
		this.fields = []
	}

	restData() {
		this.config = {
			ref: 'formRef',
			model: 'form',
			rules: 'rules',
			size: 'default',
			labelPosition: 'right',
			labelWidth: 100,
			disabled: false,
			isMobile: false,
			counter: 0
		}
		this.fields = []
	}

	initData(config: Config, fields: Array<any>) {
		this.config = config
		this.fields = fields
	}
}
