UNPKG

epic-designer-dev

Version:

基于vue3的设计器,可视化开发页面表单。在epic-designer的基础上新增了字典选择器

50 lines (49 loc) 1.61 kB
import { defineComponent as p, ref as m, inject as d, watch as u, toRaw as f, createElementBlock as g, openBlock as _, createVNode as y, unref as r } from "vue"; /* empty css */ import "vuedraggable"; import { deepEqual as N, deepCompareAndModify as E } from "../../../../../utils/src/common/data.js"; import "@vueuse/core"; import "../../../../../hooks/src/store/index.js"; import { pluginManager as h } from "../../../../../utils/src/manager/pluginManager.js"; const v = { class: "epic-sound-code" }, J = /* @__PURE__ */ p({ __name: "index", setup(C) { const a = h.getComponent("monacoEditor"), s = m(null), t = d("designer"), l = d("designerProps"); let n = {}; u( () => t.state.selectedNode, (e) => { var o; N(n, f(e)) || (o = s.value) == null || o.setValue(JSON.stringify(e, null, 2)); }, { deep: !0 } ); const c = JSON.stringify(t.state.selectedNode, null, 2); function i(e) { try { if (!t.state.selectedNode) return !1; n = JSON.parse(e), E(t.state.selectedNode, n); } catch (o) { console.warn("[Epic:源码]异常:", o); } } return (e, o) => (_(), g("div", v, [ y(r(a), { ref_key: "monacoEditorRef", ref: s, "auto-toggle-theme": "", class: "epic-editor", "read-only": r(l).sourceCodeReadOnly, "model-value": r(c), "line-numbers": "off", "onUpdate:modelValue": i }, null, 8, ["read-only", "model-value"]) ])); } }); export { J as default };