import { ref } from "vue"; import dayjs from "dayjs"; export function useColumns() { const columns = ref([ { type: "selection", width: 55, align: "left", hide: ({ checkList }) => !checkList.includes("勾选列") }, { label: "序号", type: "index", width: 60, align: "left", hide: ({ checkList }) => !checkList.includes("序号列") }, { label: "部门名称", prop: "name", width: 180, align: "left" }, { label: "排序", prop: "sort", width: 60 }, { label: "状态", prop: "status", width: 80, cellRenderer: ({ row, props }) => ( {row.status === 0 ? "关闭" : "开启"} ) }, { label: "创建时间", width: 180, prop: "createTime", formatter: ({ createTime }) => dayjs(createTime).format("YYYY-MM-DD HH:mm:ss") }, { label: "备注", prop: "remark" }, { label: "操作", fixed: "right", width: 140, slot: "operation" } ]); return { columns }; }