import { n as e } from "./chunk-TYymryXo.mjs";
import { n as t, t as n } from "./selectedInfo-CT8ehCR8.mjs";
import { computed as r, createBlock as i, createVNode as a, defineComponent as o, inject as s, openBlock as c, reactive as l, unref as u, watch as d, withCtx as f } from "vue";
import { Form as p, FormItem as m, Input as h } from "ant-design-vue/es";
import { message as g } from "ant-design-vue";
//#region src/pages/flow-create/flow-model/createComponents/flow/right-panel/components/normal.vue?vue&type=script&setup=true&lang.ts
var _ = /* @__PURE__ */ o({
	name: "NormalComponent",
	__name: "normal",
	setup(e) {
		let o = s("lf"), _ = t(), v = n(), y = r(() => _.getElementById(v.selectId) || {}), b = l({
			id: "",
			name: ""
		});
		d(y, (e) => {
			b.id = e.id || "", b.name = e.title || "";
		}, { immediate: !0 });
		function x() {
			b.id !== y.value.id && (_.getElementById(b.id) ? g.error("id已存在") : (o.value.changeNodeId(y.value.id, b.id), _.updateElement(y.value.id, { id: b.id }), v.setSelectId(b.id)));
		}
		function S() {
			b.name !== y.value.title && (_.updateElement(b.id, { title: b.name }), o.value.updateText(b.id, b.name), o.value.setProperties(b.id, { title: b.name }));
		}
		return (e, t) => {
			let n = h, r = m, o = p;
			return c(), i(o, {
				model: u(b),
				name: "basic",
				"label-col": { style: { width: "80px" } },
				autocomplete: "off"
			}, {
				default: f(() => [a(r, {
					label: "ID",
					name: "id",
					rules: [{
						required: !0,
						message: "请输入id"
					}]
				}, {
					default: f(() => [a(n, {
						value: u(b).id,
						"onUpdate:value": t[0] ||= (e) => u(b).id = e,
						onBlur: x
					}, null, 8, ["value"])]),
					_: 1
				}), a(r, {
					label: "名称",
					name: "name",
					rules: [{
						required: !0,
						message: "请输入名称"
					}]
				}, {
					default: f(() => [a(n, {
						value: u(b).name,
						"onUpdate:value": t[1] ||= (e) => u(b).name = e,
						onBlur: S
					}, null, 8, ["value"])]),
					_: 1
				})]),
				_: 1
			}, 8, ["model"]);
		};
	}
}), v = /* @__PURE__ */ e({ default: () => y }), y = _;
//#endregion
export { v as n, y as t };
