const headerArrVal = ref(null)
const teamArrVal = ref(null)
const classesArrVal = ref(null)
export const init = ({ headerArr,teamArr,classesArr}) => {
  headerArrVal.value = headerArr
  teamArrVal.value = teamArr
  classesArrVal.value = classesArr
  const columns = headerArrVal.value
  const pageSet = ref({
    page: 1,
    size: 10,
    total:0
  })
  const tableOption = ref({
    checkbox: false, // 是否展示多选框
    index: false, // 是否展示序号
    fixed: "left", // 是否将多选框及序号列固定在最左侧
    stripe: false, // 是否斑马纹表格
    border: false, // 是否表格边框
    pageHidden: true, // 是否隐藏分页
    hidToolBar:true
  })
    // form表单组件
    const fieldList = ref([
      {
        label: '首班班次',
        field: 'oneClasses',
        type: 'select',
        filterable: true, 
        width:'28%',
        clearable: true,
        disabled:true,
        rules: [{required: true,message: '请选择',trigger: 'change'}],
        placeholder: '请选择',
        options: classesArrVal.value
      },
      {
        label: '首班班组',
        field: 'oneClass',
        type: 'select',
        filterable: true, 
        width:'28%',
        clearable: true,
        rules: [{required: true,message: '请选择',trigger: 'change'}],
        placeholder: '请选择',
        options: teamArrVal.value
      },
      {
        label: '首班开始时间',
        field: 'oneTime',
        format:"YYYY/MM/DD HH:mm",
        valueFormat:"YYYY-MM-DD HH:mm",
        type: 'date',
        width:'28%',
        enum: 'date', // 其他类型枚举 week, month, year, date, daterange
        rules: [{required: true,message: '请选择',trigger: 'blur'}],
        placeholder: '开始时间' // 若选择框枚举类型为daterange， 此值接受 a-b 式截取提示内容展示
      },
      {
        label: '二班班次',
        field: 'twoClasses',
        type: 'select',
        filterable: true, 
        width:'28%',
        clearable: true,
        disabled:true,
        rules: [{required: true,message: '请选择',trigger: 'change'}],
        placeholder: '请选择',
        options: classesArrVal.value
      },
      {
        label: '二班班组',
        field: 'twoClass',
        type: 'select',
        filterable: true, 
        width:'28%',
        clearable: true,
        rules: [{required: true,message: '请选择',trigger: 'change'}],
        placeholder: '请选择',
        options: teamArrVal.value
      },
      {
        label: '二班开始时间',
        field: 'twoTime',
        type: 'date',
        width:'28%',
        format:"YYYY/MM/DD HH:mm",
        valueFormat:"YYYY-MM-DD HH:mm",
        disabled:true,
        enum: 'date', // 其他类型枚举 week, month, year, date, daterange
        rules: [{required: true,message: '请选择',trigger: 'blur'}],
        placeholder: '开始时间' // 若选择框枚举类型为daterange， 此值接受 a-b 式截取提示内容展示
      },
      {
        label: '三班班次',
        field: 'threeClasses',
        type: 'select',
        filterable: true, 
        width:'28%',
        clearable: true,
        disabled:true,
        rules: [{required: true,message: '请选择',trigger: 'change'}],
        placeholder: '请选择',
        options: classesArrVal.value
      },
      {
        label: '三班班组',
        field: 'threeClass',
        type: 'select',
        filterable: true, 
        width:'28%',
        clearable: true,
        rules: [{required: true,message: '请选择',trigger: 'change'}],
        placeholder: '请选择',
        options: teamArrVal.value
      },
      {
        label: '三班开始时间',
        field: 'threeTime',
        type: 'date',
        width:'28%',
        format:"YYYY/MM/DD HH:mm",
        valueFormat:"YYYY-MM-DD HH:mm",
        disabled:true,
        enum: 'date', // 其他类型枚举 week, month, year, date, daterange
        rules: [{required: true,message: '请选择',trigger: 'blur'}],
        placeholder: '开始时间' // 若选择框枚举类型为daterange， 此值接受 a-b 式截取提示内容展示
      },
      {
        label: '休息',
        field: 'fourClasses',
        type: 'select',
        filterable: true, 
        width:'28%',
        clearable: true,
        disabled:true,
        // rules: [{required: true,message: '请选择',trigger: 'change'}],
        placeholder: '休',
        options: classesArrVal.value
      },
      {
        label: '四班班组',
        field: 'fourClass',
        type: 'select',
        filterable: true, 
        width:'28%',
        clearable: true,
        rules: [{required: true,message: '请选择',trigger: 'change'}],
        placeholder: '请选择',
        options: teamArrVal.value
      },
      {
        label: '休息开始时间',
        field: 'fourTime',
        type: 'date',
        width:'28%',
        format:"YYYY/MM/DD HH:mm",
        valueFormat:"YYYY-MM-DD HH:mm",
        disabled:true,
        enum: 'date', // 其他类型枚举 week, month, year, date, daterange
        rules: [{required: true,message: '请选择',trigger: 'blur'}],
        placeholder: '开始时间' // 若选择框枚举类型为daterange， 此值接受 a-b 式截取提示内容展示
      },
      {
        label: '排班截至日期',
        field: 'deadLine',
        type: 'date',
        width:'28%',
        format:"YYYY/MM/DD",
        valueFormat:"YYYY-MM-DD",
        enum: 'date', // 其他类型枚举 week, month, year, date, daterange
        rules: [{required: true,message: '请选择',trigger: 'blur'}],
        placeholder: '截至日期' // 若选择框枚举类型为daterange， 此值接受 a-b 式截取提示内容展示
      },
    ])
      // 表单配置项目
      const formOption = ref({
        inline: true,  // 是否行内模式表单
        labelPosition: 'top', // label标签展示位置
        labelWidth: '120px',  // 表单标签宽度
        scrollToError: true,  // 自动滚动到校验失败的第一项
        btnCenter: true, // 表单的查询提交等按钮是否展示在中间，弹窗通用展示中间
        btn: ['submit', 'cancel'] // 按钮展示组
      })
  return {
    columns,
    pageSet,
    tableOption,
    fieldList,
    formOption
  }
}
