import { defineComponent as x, computed as u, ref as p, resolveComponent as n, openBlock as S, createElementBlock as V, createElementVNode as N, createVNode as l, withCtx as i, isRef as I, unref as m, createTextVNode as K } from "vue";
import { aC as B } from "./index-Dj8XQXvF.js";
const E = { class: "table-select-form" }, R = { class: "table-select-tool" }, D = /* @__PURE__ */ x({
  __name: "tableSelectDemo2",
  props: {
    ...B
  },
  emits: ["update:value", "rowChange"],
  setup(_, { emit: g }) {
    const s = _;
    let r = u({
      get() {
        return s.value;
      },
      set(t) {
        d("update:value", t);
      }
    });
    const d = g, y = u(() => ({
      type: s.mode === "multiple" ? "checkbox" : "radio",
      selectedRowKeys: r.value,
      onChange: (t, e) => {
        r.value = t, d("rowChange", e);
      }
    }));
    let a = p(""), c = p({
      total: 0,
      current: 1,
      pageSize: 1
    });
    const f = [
      {
        key: "1",
        name2: "胡彦斌",
        age2: 32,
        address2: "西湖区湖底公园1号"
      },
      {
        key: "2",
        name2: "胡彦祖",
        age2: 42,
        address2: "西湖区湖底公园1号"
      },
      {
        key: "3",
        name2: "胡祖",
        age2: 4,
        address2: "西湖区湖底公园1号"
      }
    ], v = [
      {
        title: "姓名2",
        dataIndex: "name2",
        key: "name2"
      },
      {
        title: "年龄2",
        dataIndex: "age2",
        key: "age2"
      },
      {
        title: "住址2",
        dataIndex: "address2",
        key: "address2"
      }
    ];
    function b(t, e) {
      c.value = t;
    }
    return (t, e) => {
      const k = n("a-input-search"), w = n("a-button"), h = n("a-space"), C = n("a-table");
      return S(), V("div", E, [
        N("div", R, [
          l(h, null, {
            default: i(() => [
              l(k, {
                ref: "input",
                value: m(a),
                "onUpdate:value": e[0] || (e[0] = (o) => I(a) ? a.value = o : a = o),
                placeholder: "请输入",
                style: { width: "200px" }
              }, null, 8, ["value"]),
              l(w, { type: "primary" }, {
                default: i(() => [...e[2] || (e[2] = [
                  K("重置", -1)
                ])]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        l(C, {
          columns: v,
          "data-source": f,
          pagination: m(c),
          "row-selection": y.value,
          rowKey: t.keyName,
          onChange: e[1] || (e[1] = (o) => b(o)),
          bordered: ""
        }, null, 8, ["pagination", "row-selection", "rowKey"])
      ]);
    };
  }
});
export {
  D as default
};
