UNPKG

@javaguns/flow-ui

Version:

``` <template> <a-spin :spinning="loading"> <FlowDesigner ref="flowDesigner" top="50px"> </FlowDesigner> </a-spin> </template> <script lang="ts" setup> import { ref, provide, onMounted } from 'vue'; import { FlowDesigner, LoadingKey } from '@j

103 lines (102 loc) 3.48 kB
import { defineComponent as _, ref as i, openBlock as o, createElementBlock as f, Fragment as v, createElementVNode as g, renderList as C, createBlock as s, resolveDynamicComponent as S, unref as u, toDisplayString as D, createVNode as r, withCtx as w, createCommentVNode as m } from "vue"; import { pluginManager as V } from "@javaguns/utils"; import { IconRightOutline as $ } from "@javaguns/icon"; import R from "../../hooks/useIcon.mjs"; import B from "../drawer/drawerHeader.vue.mjs"; import N from "../drawer/drawerBody.vue.mjs"; import E from "../drawer/drawerFooter.vue.mjs"; import O from "./flowBaseSetting.vue.mjs"; import U from "./flowVariableSetting.vue.mjs"; const z = { class: "guns-flow-setting" }, F = ["onClick"], G = { class: "guns-flow-setting-item-title" }, L = _({ name: "flow-global-setting" }), X = /* @__PURE__ */ _({ ...L, props: { modelId: {}, definitionId: {} }, setup(M) { const I = V.getComponent("Drawer"), { loadIconOutline: h } = R(), c = i(), p = i(), e = i(!1), l = i(""), k = i([ { title: "流程配置", key: 1, icon: "Settings" }, { title: "变量配置", key: 2, icon: "Settings" } ]), y = async (n) => { l.value = n.title, e.value = !0; }, d = () => { e.value = !1; }, b = () => { l.value === "流程配置" ? c.value.save() : l.value === "变量配置" && p.value.save(), d(); }; return (n, a) => (o(), f(v, null, [ g("div", z, [ (o(!0), f(v, null, C(k.value, (t, j) => (o(), f("div", { class: "guns-flow-setting-item", onClick: (q) => y(t) }, [ (o(), s(S(u(h)(t)))), g("span", G, D(t.title), 1), r(u($), { class: "flow-helper-right-icon" }) ], 8, F))), 256)) ]), e.value ? (o(), s(u(I), { key: 0, open: e.value, "onUpdate:open": a[0] || (a[0] = (t) => e.value = t), modelValue: e.value, "onUpdate:modelValue": a[1] || (a[1] = (t) => e.value = t), visible: e.value, show: e.value, placement: "right", direction: "rtl", "custom-class": "flow-drawer", class: "flow-drawer", "class-name": "flow-drawer", "append-to-body": !0, "with-header": !1, "show-close": !1, header: !1, footer: !1, closable: !1, width: "50%", size: "50%", onCancel: d }, { default: w(() => [ r(B, { title: l.value }, null, 8, ["title"]), r(N, null, { default: w(() => [ l.value === "流程配置" ? (o(), s(O, { key: 0, ref_key: "baseSettingRef", ref: c, modelId: n.modelId, definitionId: n.definitionId }, null, 8, ["modelId", "definitionId"])) : m("", !0), l.value === "变量配置" ? (o(), s(U, { key: 1, ref_key: "variableSettingRef", ref: p, modelId: n.modelId, definitionId: n.definitionId }, null, 8, ["modelId", "definitionId"])) : m("", !0) ]), _: 1 }), r(E, { onSave: b, onClose: d }) ]), _: 1 }, 8, ["open", "modelValue", "visible", "show"])) : m("", !0) ], 64)); } }); export { X as default };