snowy-designer
Version:
基于Epic-Designer-Pro版本的设计器,可视化开发页面表单
68 lines (67 loc) • 2.4 kB
JavaScript
import { defineComponent as v, inject as p, computed as b, useModel as N, watch as d, createBlock as V, openBlock as k, unref as x } from "vue";
/* empty css */
import "radix-vue";
import "clsx";
import "tailwind-merge";
import "lucide-vue-next";
import "../../../../base-ui/src/shadch-ui/button/index.js";
import "@vueuse/core";
import "../../../../base-ui/src/shadch-ui/toast/index.js";
import "vuedraggable";
import "../../../../../hooks/src/store/index.js";
import "lodash";
import { pluginManager as M } from "../../../../../utils/src/manager/pluginManager.js";
import "monaco-editor";
import "../../../../../utils/src/request/index.js";
const q = /* @__PURE__ */ v({
__name: "index",
props: {
modelValue: {},
modelModifiers: {}
},
emits: ["update:modelValue"],
setup(s) {
const c = M.getComponent("select"), n = p("designerProps"), l = p("designer"), u = b(() => {
var o;
const t = (o = n == null ? void 0 : n.value) == null ? void 0 : o.tableJson;
return t != null && t.length ? t.filter((e) => e.tableType === "child").map((e) => ({
label: e.tableRemark || e.tableName,
value: e.tableName
})) : [];
}), r = N(s, "modelValue"), f = (t) => {
var o;
return (o = u.value.find((e) => e.value === t)) == null ? void 0 : o.label;
}, i = (t, o) => {
var a;
const e = (a = l == null ? void 0 : l.state) == null ? void 0 : a.selectedNode;
e && (e.field = t, e.label = o, r.value = t);
};
return d(r, (t) => {
var a;
if (!t || !((a = l == null ? void 0 : l.state) != null && a.selectedNode) || l.state.selectedNode.field === t) return;
const e = f(t);
i(t, e);
}), d(
u,
(t) => {
var a, m;
const o = (a = l == null ? void 0 : l.state) == null ? void 0 : a.selectedNode;
if (!t.length || !o || (m = o.componentProps) != null && m.tableName)
return;
const [e] = t;
i(e.value, e.label);
},
{ immediate: !0 }
), (t, o) => (k(), V(x(c), {
modelValue: r.value,
"onUpdate:modelValue": o[0] || (o[0] = (e) => r.value = e),
value: r.value,
"onUpdate:value": o[1] || (o[1] = (e) => r.value = e),
options: u.value,
placeholder: "请选择"
}, null, 8, ["modelValue", "value", "options"]));
}
});
export {
q as default
};