@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
63 lines (62 loc) • 2.48 kB
JavaScript
import { defineComponent as i, getCurrentInstance as U, ref as d, inject as x, computed as G, toRaw as V, openBlock as n, createBlock as m, unref as u, withCtx as l, createElementBlock as y, Fragment as h, renderList as k, createVNode as c } from "vue";
import { pluginManager as f } from "@javaguns/utils";
import { useNode as B } from "../../hooks/useNode.mjs";
import { NodeKey as R } from "../../utils/injection-key.mjs";
import $ from "../common/flowDrawerContent.vue.mjs";
import j from "../common/flowSelect.vue.mjs";
const q = i({ name: "flow-jump-drawer" }), z = /* @__PURE__ */ i({
...q,
props: {
node: { default: () => ({}) }
},
setup(v, { expose: _ }) {
const I = f.getComponent("Form"), N = f.getComponent("FormItem"), r = v, { appContext: g } = U(), w = g.app.config.globalProperties.$flowUI, a = d(), F = x(R, d()), { getApproveNodes: b } = B(), C = G(() => {
const e = [];
return b(V(F.value), e), e.filter((p) => p.nodeId != r.node.nodeId);
});
return _({
valid: async () => {
try {
let e = null;
return w == "element-plus" ? e = await a.value.validate() : e = await a.value.validateFields(), console.log("Success:", e), !0;
} catch (e) {
return console.log("Failed:", e), !1;
}
}
}), (e, p) => (n(), m(u(I), {
ref_key: "formRef",
ref: a,
model: r.node
}, {
default: l(() => [
(n(!0), y(h, null, k(r.node.approverGroups, (o, s) => (n(), m($, { name: "选择节点" }, {
default: l(() => [
c(u(N), {
name: ["approverGroups", s, "approverIds"],
prop: "approverGroups." + s + ".approverIds",
rules: [{ required: !0, message: "不能为空" }]
}, {
default: l(() => [
c(j, {
modelValue: o.approverIds,
"onUpdate:modelValue": (t) => o.approverIds = t,
label: o.approverNames,
"onUpdate:label": (t) => o.approverNames = t,
datas: C.value,
valueName: "nodeId",
labelName: "nodeName"
}, null, 8, ["modelValue", "onUpdate:modelValue", "label", "onUpdate:label", "datas"])
]),
_: 2
}, 1032, ["name", "prop"])
]),
_: 2
}, 1024))), 256))
]),
_: 1
}, 8, ["model"]));
}
});
export {
z as default
};