@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
83 lines (82 loc) • 2.57 kB
JavaScript
import { defineComponent as c, ref as w, computed as s, openBlock as l, createElementBlock as b, Fragment as N, createBlock as p, withCtx as d, createVNode as r, createCommentVNode as f } from "vue";
import T from "../../hooks/useDrawer.mjs";
import V from "../common/flowRadioGroup.vue.mjs";
import k from "../common/flowSelect.vue.mjs";
import i from "../common/flowDrawerContent.vue.mjs";
import C from "./branch/flowBranchCondition.vue.mjs";
const L = c({ name: "flow-branch-drawer" }), E = /* @__PURE__ */ c({
...L,
props: {
node: { default: () => ({
nodeType: 3,
attr: {
priorityLevel: 1,
branchType: 1
}
}) },
routeNode: { default: () => ({}) }
},
setup(y, { expose: v }) {
const e = y, m = w(), { branchTypes: u } = T(), _ = s(() => (o) => o == 10 ? u : u.filter((t) => t.value == 1)), h = s(() => {
let o = [];
if (e.node.attr && e.node.attr.showPriorityLevel) {
const t = e.routeNode.conditionNodes || [];
for (let n = 0; n < t.length; n++) {
t[n];
let a = n + 1;
a < t.length && o.push({ name: "优先" + a, value: a });
}
}
return o;
});
return v({
valid: async () => {
var o;
return await ((o = m.value) == null ? void 0 : o.valid());
}
}), (o, t) => (l(), b(N, null, [
e.node.attr.showPriorityLevel ? (l(), p(i, {
key: 0,
name: "分支等级"
}, {
default: d(() => [
r(k, {
modelValue: e.node.attr.priorityLevel,
"onUpdate:modelValue": t[0] || (t[0] = (n) => e.node.attr.priorityLevel = n),
mode: "simple",
valueName: "value",
labelName: "name",
datas: h.value
}, null, 8, ["modelValue", "datas"])
]),
_: 1
})) : f("", !0),
r(i, { name: "分支类型" }, {
default: d(() => [
r(V, {
modelValue: e.node.attr.branchType,
"onUpdate:modelValue": t[1] || (t[1] = (n) => e.node.attr.branchType = n),
datas: _.value(e.node.nodeType)
}, null, 8, ["modelValue", "datas"])
]),
_: 1
}),
e.node.attr.branchType == 1 ? (l(), p(i, {
key: 1,
name: "条件规则"
}, {
default: d(() => [
r(C, {
ref_key: "flowBranchCondition",
ref: m,
node: e.node
}, null, 8, ["node"])
]),
_: 1
})) : f("", !0)
], 64));
}
});
export {
E as default
};