snowy-designer
Version:
基于Epic-Designer-Pro版本的设计器,可视化开发页面表单
59 lines (58 loc) • 1.91 kB
JavaScript
import { defineComponent as p, ref as m, inject as s, watch as u, toRaw as f, createElementBlock as g, openBlock as _, createVNode as y, unref as n } 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 { deepEqual as N, deepCompareAndModify as E } from "../../../../../utils/src/common/data.js";
import "../../../../../hooks/src/store/index.js";
import "lodash";
import { pluginManager as h } from "../../../../../utils/src/manager/pluginManager.js";
import "monaco-editor";
import "../../../../../utils/src/request/index.js";
const v = { class: "epic-sound-code" }, z = /* @__PURE__ */ p({
__name: "index",
setup(C) {
const d = h.getComponent("monacoEditor"), i = m(null), t = s("designer"), a = s("designerProps");
let r = {};
u(
() => t.state.selectedNode,
(e) => {
var o;
N(r, f(e)) || (o = i.value) == null || o.setValue(JSON.stringify(e, null, 2));
},
{
deep: !0
}
);
const l = JSON.stringify(t.state.selectedNode, null, 2);
function c(e) {
try {
if (!t.state.selectedNode)
return !1;
r = JSON.parse(e), E(t.state.selectedNode, r);
} catch (o) {
console.warn("[Epic:源码]异常:", o);
}
}
return (e, o) => (_(), g("div", v, [
y(n(d), {
ref_key: "monacoEditorRef",
ref: i,
class: "epic-editor",
"read-only": n(a).sourceCodeReadOnly,
"model-value": n(l),
"line-numbers": "off",
"auto-toggle-theme": "",
"onUpdate:modelValue": c
}, null, 8, ["read-only", "model-value"])
]));
}
});
export {
z as default
};