@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
122 lines (121 loc) • 4.7 kB
JavaScript
import { defineComponent as N, ref as f, openBlock as d, createElementBlock as p, Fragment as _, renderList as I, createElementVNode as o, toDisplayString as C, createCommentVNode as x, renderSlot as F, createVNode as m, unref as c, createBlock as L, withCtx as v, createTextVNode as V } from "vue";
import "../style/option.css";
import { pluginManager as r } from "@javaguns/utils";
const M = { class: "flow-drawer-option-item" }, O = { class: "flow-drawer-option-item-left" }, j = /* @__PURE__ */ o("img", { src: "https://foruda.gitee.com/images/1692100214237181251/57f637a4_9837676.png" }, null, -1), q = { class: "flow-drawer-option-desc" }, z = { class: "drawer-option-title" }, A = ["onClick"], H = { class: "drawer-option-desc" }, J = { class: "flow-drawer-option-item-switch" }, K = { class: "dialog-footer" }, P = N({ name: "flow-drawer-option" }), X = /* @__PURE__ */ N({
...P,
props: {
activeText: { default: "开" },
inactiveText: { default: "关" },
node: {},
datas: {}
},
emits: ["change"],
setup(y, { emit: U }) {
const B = r.getComponent("Switch"), T = r.getComponent("Dialog"), S = r.getComponent("Input"), h = r.getComponent("Button");
r.getComponent("GunsSpace");
const l = y, k = f({}), n = f(""), s = f(!1), $ = U, D = (t) => {
n.value = t.aliasName ? t.aliasName : t.buttonName, k.value = t, s.value = !0;
}, u = (t) => {
s.value = t;
}, E = (t) => {
$("change", t);
}, g = () => {
k.value.aliasName = n.value, u(!1);
};
return (t, a) => {
var w;
return d(), p(_, null, [
(d(!0), p(_, null, I(((w = l.node) == null ? void 0 : w.buttons) || l.datas, (e, G) => (d(), p("div", {
class: "flow-drawer-option",
key: G
}, [
o("div", M, [
o("div", O, [
j,
o("div", q, [
o("p", z, [
o("span", null, C(e.aliasName ? e.aliasName : e.buttonName), 1),
e.checked ? (d(), p("span", {
key: 0,
class: "alias-set",
onClick: (i) => D(e)
}, "别名设置", 8, A)) : x("", !0)
]),
o("p", H, C(e.content), 1)
])
]),
o("div", J, [
F(t.$slots, "default", {
item: e,
slotData: l
}, () => [
m(c(B), {
modelValue: e.checked,
"onUpdate:modelValue": (i) => e.checked = i,
checked: e.checked,
"onUpdate:checked": (i) => e.checked = i,
"checked-children": l.activeText,
"un-checked-children": l.inactiveText,
"active-text": l.activeText,
"inactive-text": l.inactiveText,
"inline-prompt": "",
onChange: (i) => E(e)
}, null, 8, ["modelValue", "onUpdate:modelValue", "checked", "onUpdate:checked", "checked-children", "un-checked-children", "active-text", "inactive-text", "onChange"])
])
])
])
]))), 128)),
s.value ? (d(), L(c(T), {
key: 0,
modelValue: s.value,
"onUpdate:modelValue": a[3] || (a[3] = (e) => s.value = e),
visible: s.value,
width: 600,
title: "别名设置",
"body-style": { paddingBottom: "8px" },
"onUpdate:visible": u,
onClose: a[4] || (a[4] = (e) => u(!1)),
maskClosable: !0,
onOk: g
}, {
footer: v(() => [
o("div", K, [
m(c(h), {
onClick: a[2] || (a[2] = (e) => u(!1))
}, {
default: v(() => [
V("取消")
]),
_: 1
}),
m(c(h), {
type: "primary",
onClick: g
}, {
default: v(() => [
V(" 确定 ")
]),
_: 1
})
])
]),
default: v(() => [
m(c(S), {
type: "text",
"allow-clear": "",
modelValue: n.value,
"onUpdate:modelValue": a[0] || (a[0] = (e) => n.value = e),
value: n.value,
"onUpdate:value": a[1] || (a[1] = (e) => n.value = e),
autofocus: "autofocus"
}, null, 8, ["modelValue", "value"])
]),
_: 1
}, 8, ["modelValue", "visible"])) : x("", !0)
], 64);
};
}
});
export {
X as default
};