/*
 * @Company: 沈阳信诚科技
 * @Email: html_venustar@163.com
 * @Author: Liuqiming
 * @Description: 铸坯生产对标配置
 * @LastEditors: Liuqiming
 * @LastEditTime: 2024-03-28 12:00:46
 * @Date: 2024-02-26 14:16:10
 */

import { reactive } from "vue"

export const init = () => {

  const searchList = ref([
    {
      label: '铸坯编号',
      field: 'prdNo',
      width: '340px',
      searchBtn: true,
      clearable: true,
      placeholder: '请输入铸坯编号',
    },
  ])
  const btnList = ref([
    { label: '生产对标', type: 'primary', met: 'produceBenchmark' },
  ])
  const columns = ref([
    {
      label: "铸坯编号",
      prop: "prdNo",
      minWidth: 120
    },
    {
      label: "铸坯截面尺寸（㎡）",
      prop: "prdSection",
      minWidth: 100
    },
    {
      label: "铸坯直径（㎜）",
      prop: "prdThick",
      minWidth: 100
    },
    {
      label: "铸坯长度（m）",
      prop: "prdLength",
      minWidth: 120
    },
    {
      label: "班组",
      prop: "teamIds",
      minWidth: 110
    },
    {
      label: "生产开始时间",
      prop: "prdStartTime",
      sort: true,
      minWidth: 160
    },
    {
      label: "生产结束时间",
      prop: "prdEndTime",
      sort: true,
      minWidth: 160
    },
  ])
  const pageSet = ref({
    pageNum: 1,
    pageSize: 10,
    total:0
  })
  // 表格表单公共配置
  const tableOption = ref({
    checkbox: true, // 是否展示多选框
    checkList: true,
    checkKey: 'prdNo',
    checkMax: 3,
    checkMaxMsg: '最多只能选择3个铸坯进行对比',
    rowKey: 'prdNo',
    index: false, // 是否展示序号
    fixed: "left", // 是否将多选框及序号列固定在最左侧
    stripe: true, // 是否斑马纹表格
    border: false, // 是否表格边框
    pageHidden: false, // 是否隐藏分页
    maxHeight: '62vh'
  })

  const barData = ref({
    title:'加料信息',
    loading: false,
    //Y轴单位
    Yname:'单位：kg',
    //数据是否从0开始  true不从0开始  false从0开始  如果是柱形图设计到两个量 一定要true 否则 样式回丢失
    boundaryGap:true,
    //横轴X 数据
    XAxle: [],
    //实际数据如果多条数据 数组里传入两个对象
    actualData:[],
    // 是否显示右上角下拉框  ture显示 false不显示
    swtichSelect: false,
    //又上角下拉默认值
    optionsDefault:'2',
    //又上角下拉选着数组
    options:[]
  })
  const DBD0024 = ref({
    title:'表面温度',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'2',
    options:[]
  })
  const DBD48 = ref({
    title:'中包重量',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD28 = ref({
    title:'中包温度',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD32 = ref({
    title:'过热度',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD3008 = ref({
    title:'拉速',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD2016 = ref({
    title:'铸流电搅-电流',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD3040 = ref({
    title:'铸流电搅-电压',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD2020 = ref({
    title:'铸流电搅-频率',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD2060 = ref({
    title:'末端电搅-电流',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD3048 = ref({
    title:'末端电搅-电压',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD2064 = ref({
    title:'末端电搅-频率',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD3056 = ref({
    title:'末端电搅-位置',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD2116 = ref({
    title:'坯尾感应加热-温度',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD2132 = ref({
    title:'坯尾感应加热-功率',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD1726 = ref({
    title:'振动台-振幅',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const DBD1730 = ref({
    title:'振动台-频率',
    Yname:'',
    dataZoom: true,
    boundaryGap:false,
    XAxle: [],
    actualData:[],
    swtichSelect: false,
    optionsDefault:'1',
    options:[]
  })
  const state = reactive({
    DBD0024, DBD48, DBD28, DBD32, DBD3008, DBD2016, DBD3040, DBD2020,
    DBD2060, DBD3048, DBD2064, DBD3056, DBD2116, DBD2132, DBD1726, DBD1730,
  })
  return {
    searchList,
    btnList,
    columns,
    pageSet,
    tableOption,
    barData,
    state
  }
}
