UNPKG

troy-flow-engine

Version:

<!-- * @Descripttion: * @version: * @Author: wangmin * @Date: 2025-04-27 15:03:16 * @LastEditors: wangmin * @LastEditTime: 2025-05-14 16:43:12 -->

102 lines (101 loc) 3.26 kB
import { ref as N, reactive as p, watch as s, resolveComponent as r, createElementBlock as b, openBlock as V, createVNode as l, withCtx as n, renderSlot as c, createTextVNode as h, unref as j } from "vue"; import { QuestionFilled as k } from "@element-plus/icons-vue"; import { _ as O } from "./index-B-BfLKSm.js"; const B = { __name: "index", props: { value: { type: Object } }, emits: ["change"], setup(u, { emit: f }) { const _ = f, a = N(null), x = u, o = p({ // 名称 displayName: "", // 表单式 conditionExpr: "" }), v = p({ conditionExpr: [ { required: !0, message: "请输入表达式" }, { pattern: /^#/, message: "表达式必须以#开头" } ] }); return s( () => x.value, (t) => { Object.keys(t).length > 0 ? Object.keys(t).forEach((e) => { e in o && (o[e] = t[e]); }) : (o.displayName = "", o.conditionExpr = ""); }, { deep: !0, immediate: !0 } ), s( () => o, (t) => { a.value.validate((e) => { e && _("change", { ...t }); }); }, { deep: !0 } ), (t, e) => { const m = r("el-input"), d = r("el-form-item"), g = r("el-icon"), E = r("el-tooltip"), y = r("el-form"); return V(), b("div", null, [ l(y, { model: o, "label-width": "100px", ref_key: "formRef", ref: a, rules: v }, { default: n(() => [ c(t.$slots, "form-item-edge-displayName", {}, () => [ l(d, { label: "名称" }, { default: n(() => [ l(m, { modelValue: o.displayName, "onUpdate:modelValue": e[0] || (e[0] = (i) => o.displayName = i), placeholder: "请输入名称" }, null, 8, ["modelValue"]) ]), _: 1 }) ], !0), c(t.$slots, "form-item-edge-conditionExpr", {}, () => [ l(d, null, { label: n(() => [ e[2] || (e[2] = h(" 表达式 ")), l(E, { content: "表达式用法说明:支持JavaScript表达式,可以使用表单数据,例如:#age > 18", placement: "top" }, { default: n(() => [ l(g, { class: "tooltip-icon" }, { default: n(() => [ l(j(k)) ]), _: 1 }) ]), _: 1 }) ]), default: n(() => [ l(m, { modelValue: o.conditionExpr, "onUpdate:modelValue": e[1] || (e[1] = (i) => o.conditionExpr = i), placeholder: "请输入表达式" }, null, 8, ["modelValue"]) ]), _: 1 }) ], !0) ]), _: 3 }, 8, ["model", "rules"]) ]); }; } }, U = /* @__PURE__ */ O(B, [["__scopeId", "data-v-4346af69"]]); export { U as default };