index.vue 1.18 KB
<template>
  <div>
    <BasicTable @register="registerTable" style="flex: auto">

    </BasicTable>
  </div>
</template>
<script lang="ts" setup>
import {getPlanList} from "/@/api/equipment/chenkPlan";
import {columns, searchFormSchema} from "./index";
import {DeviceModel} from "/@/api/device/model/deviceModel";
import {useI18n} from "/@/hooks/web/useI18n";
const { t } = useI18n();
import {BasicTable, useTable} from "/@/components/Table";

const [
  registerTable,
  { reload, setLoading, setSelectedRowKeys, getForm, getSelectRowKeys, getRowSelection },
] = useTable({
  title: t('faultReport.facility.listText'),
  api: getPlanList,
  columns,
  formConfig: {
    labelWidth: 100,
    schemas: searchFormSchema,
  },
  immediate: true,
  useSearchForm: true,
  showTableSetting: true,
  bordered: true,
  showIndexColumn: false,
  clickToRowSelect: false,
  rowKey: 'id',
  actionColumn: {
    width: 230,
    title: t('common.actionText'),
    slots: { customRender: 'action' },
    fixed: 'right',
  },
  rowSelection: {
    type: 'checkbox',
    getCheckboxProps: (record: DeviceModel) => {
      return {disabled: !!record.customerId && record.customerName !== 'Public'};
    },
  }
});
</script>