epic-designer
Version:
基于vue3的设计器,可视化开发页面表单
68 lines (67 loc) • 2.53 kB
JavaScript
import { defineComponent as f, computed as h, createElementBlock as l, openBlock as a, Fragment as v, renderList as _, withDirectives as V, createElementVNode as n, normalizeClass as w, toDisplayString as g, createVNode as y, unref as S, vShow as b } from "vue";
/* empty css */
/* empty css */
/* empty css */
import N from "../../../../base-ui/src/node/node.vue.js";
/* empty css */
import "../../../../../git/epic/epic-designer/node_modules/.pnpm/jsep@1.4.0/node_modules/jsep/dist/jsep.js";
import "@vueuse/core";
import "../../../../../hooks/src/store/index.js";
import "../../../../../manager/src/pluginManager.js";
import "vue-draggable-plus";
const C = { class: "epic-attribute-view" }, k = ["title"], A = { class: "epic-attr-input" }, R = /* @__PURE__ */ f({
__name: "epArgsEditor",
props: {
actionArgsConfigs: {},
modelValue: {}
},
emits: ["update:modelValue"],
setup(i, { emit: p }) {
const r = i, u = p, s = h(() => r.modelValue ? JSON.parse(r.modelValue) : []);
function c(o) {
var t;
return typeof o.show == "boolean" ? o.show : typeof o.show == "function" ? (t = o.show) == null ? void 0 : t.call(o, { values: s.value }) : !0;
}
function d(o, t) {
const e = [...JSON.parse(r.modelValue ?? "[]")];
e[t] = o, u("update:modelValue", JSON.stringify(e));
}
return (o, t) => (a(), l("div", C, [
(a(!0), l(v, null, _(r.actionArgsConfigs, (e) => (a(), l("div", {
key: e.id
}, [
V(n("div", {
class: w(["epic-attr-item", e.layout])
}, [
n("div", {
class: "epic-attr-label",
title: e.label
}, g(e.label), 9, k),
n("div", A, [
y(S(N), {
"is-property": "",
"component-schema": {
...e,
props: {
...e.props,
input: !1,
field: void 0,
hidden: !1
},
show: !0,
noFormItem: !0
},
"model-value": s.value[e.field],
"onUpdate:modelValue": (m) => d(m, e.field)
}, null, 8, ["component-schema", "model-value", "onUpdate:modelValue"])
])
], 2), [
[b, c(e)]
])
]))), 128))
]));
}
});
export {
R as default
};