import { ColumnProps, SearchProps } from "@/components/LjVxeTable/interface";
import type { uSale } from "@/typings/modules/sale";
import { Table } from "@/hooks/interface/index";
import { useUserStore } from "@/stores/modules/user";
import { ref, reactive, computed, toRefs, inject } from "vue";

export const useHooks = (t: any) => {
  const state = reactive<any>({
    initParams: {}
  });

  // 表格配置项
  const columns: ColumnProps<any>[] = [
    {
      field: "line_diameter",
      search: {
        el: "input",
        key: "arg_line_diameter",
        props: {
          onChange: (val: any) => {
            state.initParams.arg_line_diameter = val;
          }
        }
      }
    },
    {
      field: "height",
      search: {
        el: "input",
        key: "arg_height",
        props: {
          onChange: (val: any) => {
            state.initParams.arg_height = val;
          }
        }
      }
    },
    {
      field: "caliber",
      search: {
        el: "input",
        key: "arg_caliber",
        props: {
          onChange: (val: any) => {
            state.initParams.arg_caliber = val;
          }
        }
      }
    },
    {
      field: "center_diameter",
      search: {
        el: "input",
        key: "arg_center_diameter",
        props: {
          onChange: (val: any) => {
            state.initParams.arg_center_diameter = val;
          }
        }
      }
    },
    {
      field: "cyclenum",
      search: {
        el: "input",
        key: "arg_cyclenum",
        props: {
          onChange: (val: any) => {
            state.initParams.arg_cyclenum = val;
          }
        }
      }
    },
    {
      field: "springtypeid",
      search: {
        el: "select",
        key: "arg_springtypeid",
        props: {
          onChange: (val: any) => {
            state.initParams.arg_springtypeid = val;
          }
        }
      }
    }
  ];

  return {
    state,
    columns
  };
};
