/*
 * @Company: 沈阳信诚科技
 * @Email: html_venustar@163.com
 * @Author: Liuqiming
 * @Description: 生产实绩配置
 * @LastEditors: Liuqiming
 * @LastEditTime: 2024-03-28 17:13:00
 * @Date: 2024-02-26 14:16:10
 */

const materialCastingType = ref([])
export const init = ({material_casting_type}) => {
  materialCastingType.value = material_casting_type
  const searchList = ref([
    {
      label: '炉号',
      field: 'prdHeatId',
      width: '340px',
      clearable: true,
      placeholder: '请输入炉号',
    },
    {
      label: '铸坯编号',
      field: 'prdNo',
      width: '340px',
      clearable: true,
      placeholder: '请输入铸坯编号',
    },
    {
      label: '铸流号',
      field: 'prdStrandNo',
      width: '340px',
      type: 'select',
      clearable: true,
      placeholder: '请选择铸流号',
      options: materialCastingType.value
    },
    {
      label: '时间',
      field: 'msgDatetimeRange',
      width: '340px',
      type: 'date',
      enum: 'daterange', // 其他类型枚举 week, month, year, date, daterange
      placeholder: '开始日期-结束日期' // 若选择框枚举类型为daterange， 此值接受 a-b 式截取提示内容展示
    }
  ])
  const btnList = ref([])
  const columns = ref([
    {
      label: "铸坯编号",
      prop: "prdNo",
      minWidth: 120
    },
    {
      label: "时间",
      prop: "msgDatetime",
      sort: true,
      minWidth: 180
    },
    {
      label: "炉号",
      prop: "prdHeatId",
      minWidth: 100
    },
    {
      label: "钢种",
      prop: "prdGradeId",
      minWidth: 120
    },
    {
      label: "铸流号",
      prop: "prdStrandNo",
      minWidth: 110
    },
    {
      label: "浇次号",
      prop: "prdSeqId",
      minWidth: 160
    },
    {
      label: "铸坯截面尺寸（㎡）",
      prop: "prdSection",
      minWidth: 160
    },
    {
      label: "铸坯直径（㎜）",
      prop: "prdThick",
      minWidth: 160
    },
    {
      label: "铸坯长度（㎜）",
      prop: "prdLength",
      minWidth: 160
    },
    {
      label: "铸坯重量（kg）",
      prop: "prdWeight",
      minWidth: 160
    },
    {
      label: "质量等级",
      prop: "qualityLevel",
      minWidth: 160
    },
  ])
  const pageSet = ref({
    pageNum: 1,
    pageSize: 10,
    total:0
  })
  // 表格表单公共配置
  const tableOption = ref({
    checkbox: false, // 是否展示多选框
    index: true, // 是否展示序号
    fixed: "left", // 是否将多选框及序号列固定在最左侧
    stripe: true, // 是否斑马纹表格
    border: false, // 是否表格边框
    pageHidden: false, // 是否隐藏分页
    maxHeight: '70vh',
    slotFooter: function() {
      return <span></span>
    }
  })
  return {
    searchList,
    btnList,
    columns,
    pageSet,
    tableOption,
  }
}
