<script setup lang="ts">
import {
  handleConfirm,
  dlgApiSelectShow,
  tableColumns,
  dlgWidth,
  selectable,
  handleSelectionChange,
  handleSearch,
  searchFormColumns,
  searchFormData,
  tableData
} from "@/components/ApiSelect/index";
</script>

<template>
  <PlusDialog
    v-model="dlgApiSelectShow"
    header="选择接口"
    :width="dlgWidth"
    cancel-text="取消"
    confirm-text="确定"
    @confirm="handleConfirm"
  >
    <el-card shadow="never">
      <template #header>
        <PlusSearch
          v-model="searchFormData"
          :columns="searchFormColumns"
          :show-number="2"
          label-position="right"
          :has-reset="false"
          @search="handleSearch"
        />
      </template>
      <PlusTable
        :columns="tableColumns"
        :table-data="tableData"
        :is-selection="true"
        :selectionTableColumnProps="{
          selectable: selectable
        }"
        adaptive
        @selection-change="handleSelectionChange"
      />
    </el-card>
  </PlusDialog>
</template>
