tableConfig.js 2.61 KB
export const tableAttr = {
  border: true,
  loadingTable: false,
  isDragSort: false, // 拖拽tableData数据一定要加id字段
  maxHeight: 0,
  btnCofig: {
    isBtn: true,
    btnGroup: [
      {
        type: "primary", // text、primary、danger
        icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
        btnName: "搜索",
        size: "mini", // medium / small / mini
        round: false,
        loading: false,
        event: "search",
      },
      {
        type: "primary",
        icon: "el-icon-download",
        btnName: "下载模板",
        size: "mini",
        round: false,
        loading: false,
        event: "download",
      },
      {
        type: "primary",
        icon: "el-icon-upload",
        btnName: "增加",
        size: "mini",
        round: false,
        loading: false,
        event: "upLoad",
        action: "/goods/uploadGoodsExcel",
        fileName: "name",
        limit: 1,
        accept: ".xlsx",
      },
      {
        type: "primary",
        icon: "el-icon-download",
        btnName: "导出",
        size: "mini",
        round: false,
        loading: false,
        event: "export",
      },
      {
        type: "danger",
        icon: "el-icon-delete",
        btnName: "删除",
        size: "mini",
        round: false,
        loading: false,
        event: "delete",
      },
    ],
  },
};
export const columnHeader = (deleteRow) => [
  {
    type: "selection",
    align: "center",
    prop: "selection",
    width: "50",
  },
  {
    type: "index",
    label: "序号",
    prop: "id",
    align: "center",
    width: "50",
  },
  {
    label: "HSCODE",
    prop: "blackValue",
    align: "center",
    minWidth: 100,
  },
  {
    label: "创建时间",
    prop: "createTime",
    align: "center",
    minWidth: 100,
  },
  {
    label: "创建人",
    prop: "createUserName",
    align: "center",
    minWidth: 100,
  },
  {
    label: "文件名",
    prop: "uploadFileName",
    align: "center",
    minWidth: 100,
  },

  {
    label: "操作",
    prop: "operate",
    align: "center",
    minWidth: 120,
    fixed: "right",
    render: (h, params) => {
      return h("div", [
        h(
          "el-button",
          {
            style: {
              color: "#ff4949",
            },
            props: {
              type: "text",
              size: "mini",
              icon: "el-icon-delete",
            },
            on: {
              click() {
                deleteRow(params);
              },
            },
          },
          "删除"
        ),
      ]);
    },
  },
];