<template>
  <BasicModal
    v-bind="$attrs"
    :title="title"
    @register="registerInnerModal"
    @ok="handleSubmit"
    @cancel="resetForm"
    :width="1000"
  >
    <template #footer>
      <div v-if="isUpdate !== 3">
        <a-button type="default" @click="handleCancle">取消</a-button>
        <a-button type="primary" @click="handleSubmit">确认</a-button>
      </div>
    </template>
    <BasicTable @register="registerTable">
      <template #toolbar> </template>
      <template #bodyCell="{ column, record }">
        <template v-if="column.key === 'action'"> </template>
      </template>
    </BasicTable>
  </BasicModal>
</template>

<script setup lang="ts">
import { BasicModal, useModalInner } from "@/components/Modal";

import { computed, ref, unref } from "vue";
import { infoInfo, infoAdd, infoUpdate, infoList } from "@/api/basicInfo/tenement";
import { modalSchemas, tenementColumns } from "./info.data";
import { BasicTable, useTable, TableAction } from "@/components/Table";
import { employInfoList } from "@/api/basicInfo/userEmploy";

defineOptions({ name: "InfoModal" });

const emit = defineEmits(["register", "reload"]);

const isUpdate = ref<number>(1);
const title = computed<string>(() => {
  return "添加使用单位";
});
const [registerTable, {}] = useTable({
  rowSelection: {
    type: "checkbox",
  },
  title: "",
  api: employInfoList,
  showIndexColumn: false,
  showTableSetting: false,
  rowKey: "id",
  useSearchForm: false,

  columns: tenementColumns,
});
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner(
  async (data: { record?: Recordable; update: number }) => {
    modalLoading(true);

    modalLoading(false);
  }
);

async function handleSubmit() {}
function handleCancle() {
  closeModal();
}
</script>

<style scoped></style>
