import { n as e } from "./chunk-TYymryXo.mjs";
import { t } from "./dist-BWeVpZNn.mjs";
import { r as n } from "./bpMliuchengbiaodashibiaokongzhiqi-mDhV8ugm.mjs";
import { createBlock as r, createTextVNode as i, createVNode as a, defineComponent as o, isRef as s, openBlock as c, ref as l, unref as u, withCtx as d } from "vue";
import { Button as f, Drawer as p, Space as m, Table as h } from "ant-design-vue/es";
//#region src/pages/flow-create/flow-model/createComponents/flow/right-panel/components/drawer/drawerExpression.vue?vue&type=script&setup=true&lang.ts
var g = /* @__PURE__ */ o({
	name: "DrawerExpression",
	__name: "drawerExpression",
	emits: ["submit"],
	setup(e, { expose: o, emit: g }) {
		let _ = g, v = l(), [y, b] = t(!1), x = [{
			title: "名称",
			dataIndex: "name",
			key: "name",
			ellipsis: !0
		}, {
			title: "表达式",
			dataIndex: "expression",
			key: "expression",
			ellipsis: !0
		}], S = l();
		async function C() {
			v.value = void 0, n({
				currentPage: 1,
				pageSize: 1e3
			}).then((e) => {
				e.success && (S.value = e.data?.records ?? []);
			}), b(!0);
		}
		let [w, T] = t(!1);
		function E() {
			T(!0), _("submit", v.value?.expression), T(!1), b(!1);
		}
		function D() {
			b(!1);
		}
		return o({ open: C }), (e, t) => {
			let n = h, o = f, l = m, g = p;
			return c(), r(g, {
				open: u(y),
				"onUpdate:open": t[0] ||= (e) => s(y) ? y.value = e : null,
				title: "请选择表达式",
				placement: "right",
				width: 520,
				"destroy-on-close": "",
				"footer-style": { textAlign: "right" },
				onClose: D
			}, {
				footer: d(() => [a(l, null, {
					default: d(() => [a(o, { onClick: D }, {
						default: d(() => [...t[1] ||= [i(" 取消 ", -1)]]),
						_: 1
					}), a(o, {
						type: "primary",
						loading: u(w),
						onClick: E
					}, {
						default: d(() => [...t[2] ||= [i(" 提交 ", -1)]]),
						_: 1
					}, 8, ["loading"])]),
					_: 1
				})]),
				default: d(() => [a(n, {
					columns: x,
					"data-source": u(S),
					pagination: !1,
					"row-key": "key",
					"row-class-name": (e) => u(v)?.id === e.id ? "ant-table-row-selected" : "",
					"custom-row": (e) => ({ onClick: () => {
						v.value = e;
					} })
				}, null, 8, [
					"data-source",
					"row-class-name",
					"custom-row"
				])]),
				_: 1
			}, 8, ["open"]);
		};
	}
}), _ = /* @__PURE__ */ e({ default: () => v }), v = g;
//#endregion
export { _ as n, v as t };
