import { defineComponent as T, computed as p, ref as m, resolveComponent as n, openBlock as _, createElementBlock as f, createElementVNode as y, createVNode as l, withCtx as c, isRef as B, unref as k, createTextVNode as D, createCommentVNode as E } from "vue";
import { aC as L, a6 as R, _ as z } from "./index-BkxFjINf.js";
const M = { class: "table-select-form" }, O = { class: "table-select-tool" }, P = { key: 0 }, U = ["onClick"], j = /* @__PURE__ */ T({
  __name: "tableSelectDemo",
  props: {
    ...L
  },
  emits: ["update:value", "rowChange"],
  setup(v, { emit: g }) {
    const r = v;
    let s = p({
      get() {
        return r.value;
      },
      set(t) {
        d("update:value", t);
      }
    });
    const d = g, C = p(() => ({
      type: r.mode === "multiple" ? "checkbox" : "radio",
      selectedRowKeys: s.value,
      onChange: (t, e) => {
        s.value = t, d("rowChange", e);
      }
    }));
    let i = m({
      total: 0,
      current: 1,
      pageSize: 1
    }), o = m("");
    const b = [
      {
        key: "1",
        name: "胡彦斌",
        age: 32,
        address: "西湖区湖底公园1号"
      },
      {
        key: "2",
        name: "胡彦祖",
        age: 42,
        address: "西湖区湖底公园1号"
      }
    ], h = [
      {
        title: "姓名",
        dataIndex: "name",
        key: "name"
      },
      {
        title: "年龄",
        dataIndex: "age",
        key: "age"
      },
      {
        title: "住址",
        dataIndex: "address",
        key: "address"
      },
      {
        title: "操作",
        dataIndex: "action",
        key: "action"
      }
    ];
    function w(t, e) {
      i.value = t;
    }
    function x(t) {
    }
    function S() {
      s.value = [];
    }
    function V(t) {
      let e = R({
        onOk: (u) => {
          e.setConfirmLoading(!0), setTimeout(() => {
            e.setConfirmLoading(!1), e.destroy();
          }, 2e3);
        }
      });
    }
    return (t, e) => {
      const u = n("a-input-search"), I = n("a-button"), N = n("a-space"), K = n("a-table");
      return _(), f("div", M, [
        y("div", O, [
          l(N, null, {
            default: c(() => [
              l(u, {
                ref: "input",
                value: k(o),
                "onUpdate:value": e[0] || (e[0] = (a) => B(o) ? o.value = a : o = a),
                placeholder: "请输入",
                style: { width: "200px" },
                onSearch: x
              }, null, 8, ["value"]),
              l(I, {
                type: "primary",
                onClick: S
              }, {
                default: c(() => [...e[2] || (e[2] = [
                  D("重置", -1)
                ])]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        l(K, {
          columns: h,
          "data-source": b,
          pagination: k(i),
          "row-selection": C.value,
          rowKey: t.keyName,
          onChange: e[1] || (e[1] = (a) => w(a)),
          bordered: ""
        }, {
          bodyCell: c(({ column: a, record: q }) => [
            a.key == "action" ? (_(), f("span", P, [
              y("a", {
                onClick: (A) => V()
              }, "测试", 8, U)
            ])) : E("", !0)
          ]),
          _: 1
        }, 8, ["pagination", "row-selection", "rowKey"])
      ]);
    };
  }
}), H = /* @__PURE__ */ z(j, [["__scopeId", "data-v-cea0ef13"]]);
export {
  H as default
};
