package com.lukouguoji.mit.model

import com.alibaba.fastjson.JSONArray

class AccidentVisaInfoItemModel(
    val isMust: Boolean,//是否必选
    val isEnable: Boolean,//是否允许操作
    val titleName: String,//字段名
    val titleCode: String,//字段code名
    val isSel: Boolean,//是否下拉框

    var inputContent: String,//输入框内容

    val selList: JSONArray?,//下拉框数据集合
    var selContentCode: String,//下拉框code

    val titleCodePre: String?,
    var inputContentPre: String?,//输入框内容前缀
    val ymdhms: Boolean?, //日期格式  true： 日期格式 yyyy-MM-dd HH:mm:ss  false: yyyy-MM-dd
    val scan: Boolean?, //是否支持扫描
    val scanResultCode: Int? //扫描回调的code值  scan=false 不需要填
) {

    /**
     * 1.输入框构造
     */
    constructor(
        isMust: Boolean,
        isEnable: Boolean,
        titleName: String,
        titleCode: String,
        inputContent: String
    ) : this(
        isMust,
        isEnable,
        titleName,
        titleCode,
        false,
        inputContent,
        null,
        "",
        null,
        null,
        null,
        null,
        null
    )

    /**
     * 2.输入框构造  带扫描功能
     */
    constructor(
        isMust: Boolean,
        isEnable: Boolean,
        titleName: String,
        titleCode: String,
        inputContent: String,
        scan: Boolean,
        scanResultCode: Int
    ) : this(
        isMust,
        isEnable,
        titleName,
        titleCode,
        false,
        inputContent,
        null,
        "",
        null,
        null,
        null,
        scan,
        scanResultCode
    )

    /**
     * 3. 2个输入框构造  运单
     */
    constructor(
        isMust: Boolean,
        isEnable: Boolean,
        titleName: String,
        titleCode: String,
        inputContent: String,
        titleCodePre: String,
        inputContentPre: String
    ) : this(
        isMust,
        isEnable,
        titleName,
        titleCode,
        false,
        inputContent,
        null,
        "",
        titleCodePre,
        inputContentPre,
        null,
        null,
        null
    )

    /**
     * 4. 2个输入框构造  运单   带扫描
     */
    constructor(
        isMust: Boolean,
        isEnable: Boolean,
        titleName: String,
        titleCode: String,
        inputContent: String,
        titleCodePre: String,
        inputContentPre: String,
        scan: Boolean,
        scanResultCode: Int
    ) : this(
        isMust,
        isEnable,
        titleName,
        titleCode,
        false,
        inputContent,
        null,
        "",
        titleCodePre,
        inputContentPre,
        null,
        scan,
        scanResultCode
    )


    /**
     * 下拉框构造
     */
    constructor(
        isMust: Boolean, isEnable: Boolean, titleName: String, titleCode: String,
        selList: JSONArray,
        selContentCode: String
    ) : this(
        isMust,
        isEnable,
        titleName,
        titleCode,
        true,
        "",
        selList,
        selContentCode,
        null,
        null,
        null,
        null,
        null
    )

    /**
     * 日期下拉框构造
     * ymdhms true 日期格式 yyyy-MM-dd HH:mm:ss  false: yyyy-MM-dd
     */
    constructor(
        isMust: Boolean, isEnable: Boolean, titleName: String, titleCode: String, ymdhms: Boolean, selContentCode: String
    ) : this(
        isMust,
        isEnable,
        titleName,
        titleCode,
        true,
        "",
        null,
        selContentCode,
        null,
        null,
        ymdhms,
        null,
        null
    )

}