import BTable from "@/components/b_table";
import { UserDataType } from "@/model/userModel";
import { Store } from "antd/es/form/interface";
import { ColumnsType } from "antd/lib/table";
import dayjs from "dayjs";
import { inject, observer } from "mobx-react";
import { useEffect } from "react";

const GloryPlaque = (props: Store) => {
  const { gpStore } = props;
  useEffect(() => {
    gpStore.getlist();
  }, [gpStore]);
  const columns: ColumnsType<UserDataType> = [
    { title: "申请人", dataIndex: "user_name" },
    { title: "申请人手机号", dataIndex: "tel" },
    { title: "悬挂地址", dataIndex: "address" },
    { title: "申请时间", dataIndex: "created_at",render:(created_at)=>(<span>{dayjs(created_at).format("YYYY-MM-DD")}</span>) },
    { title: "申请原因", dataIndex: "abbr",render: (abbr) => <span>{abbr===2?'更换':'悬挂'}</span> },
    { title: "申请描述", dataIndex: "desc" },
  ];
  return (
    <div>
      <BTable store={gpStore} columns={columns} dataSource={gpStore.list} />
    </div>
  );
};
export default inject("gpStore")(observer(GloryPlaque));
