import { useDictionaryStore } from "@/store";
const { dicts } = useDictionaryStore();

const ctableRef=ref(null);
export const columns = [
  {
    label: "工位编号",
    prop: "stationCode",
    search: true,
    overHidden: true,
    rules: [{
      required: true,
      message: "请填写工位编号",
      trigger: "blur"
    }],
  },
  {
    label: "工位名称",
    prop: "name",
    overHidden: true,
    width:100,
    search: true,
    rules: [{
      required: true,
      message: "请填写工位名称",
      trigger: "blur"
    }],
  },
  {
    label: "工位类型",
    prop: "stationDictValue",
    overHidden: true,
    width:100,
    search: true,
    rules: [{
      required: true,
      message: "请选择工位类型",
      trigger: "blur"
    }],
    type: 'select',
    dicData:dicts.station_type,
    searchClearable: false, //可清空的输入框,默认为true
    filterable: true, //添加filterable属性即可启用搜索功能
    props: {
      label: "dictLabel", // 下拉菜单显示的字段
      value: "dictValue" // 下拉菜单值的字段
    },
  },
  {
    label: "操作方式",
    prop: "operateDictValue",
    width:100,
    overHidden: true,
    rules: [{
      required: true,
      message: "操作方式",
      trigger: "blur"
    }],
    type: 'select',
    dicData:dicts.station_operate_type,
    props: {
      label: "dictLabel", // 下拉菜单显示的字段
      value: "dictValue" // 下拉菜单值的字
    },
  },
  {
    label: "负责人",
    prop: "manager",
    overHidden: true,
    width:100,
    rules: [{
      required: true,
      message: "请选择负责人",
      trigger: "blur"
    }],
    click: ({ value, column }) => {
      ctableRef.value.startSelect();
    },
  },
  {
    label: "负责人id",
    prop: "managerId",
    overHidden: true,
    width:80,
    hide:true,
    display:false,

  },
  {
    label: "所属产线",
    prop: "productionLineName",
    width:100,
    overHidden: true,
    display:false
  },
  {
    label: "工位地址",
    prop: "position",
    width:100,
    overHidden: true,
    rules: [{
      required: true,
      message: "请填写工位地址",
      trigger: "blur"
    }],
  },
  {
    label: "IP地址",
    prop: "stationIp",
    overHidden: true,
    width:100,
    rules: [{
      required: true,
      message: "请填写工位IP地址",
      trigger: "blur",
    }],

  },
  {
    label: "工位描述",
    prop: "remark",
    width:100,
    overHidden: true,
    type: 'textarea',
    span: 24,
  },
  {
    label: "创建人",
    prop: "creator",
    width:100,
    overHidden: true,
    display:false
  },
  {
    label: "创建时间",
    prop: "created",
    width:100,
    overHidden: true,
    display:false
  },
]


