@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
102 lines (101 loc) • 3.45 kB
JavaScript
import { defineComponent as G, computed as I, openBlock as o, createElementBlock as i, Fragment as d, createVNode as s, unref as t, withCtx as a, renderList as f, createBlock as p, createTextVNode as U, toDisplayString as $, renderSlot as v } from "vue";
import { IconDeleteOutline as m, IconPlusOutline as P } from "@javaguns/icon";
import { pluginManager as r } from "@javaguns/utils";
const S = /* @__PURE__ */ G({
__name: "flowTable",
props: {
columns: { default: () => [] },
datas: { default: () => [] }
},
emits: ["add", "remove"],
setup(_, { emit: b }) {
const c = r.getComponent("Row"), k = r.getComponent("Col"), w = r.getComponent("Input"), h = r.getComponent("Button"), x = r.getComponent("Popconfirm"), y = _, g = b, V = I(() => (l) => "请输入" + l), B = () => {
g("add");
}, C = (l) => {
g("remove", l);
};
return (l, D) => (o(), i(d, null, [
s(t(c), { style: { "margin-top": "10px" } }, {
default: a(() => [
(o(!0), i(d, null, f(y.columns, (e) => (o(), p(t(k), {
span: e.span || 6,
key: e.key,
class: "guns-flow-variable-setting-header"
}, {
default: a(() => [
U($(e.title), 1)
]),
_: 2
}, 1032, ["span"]))), 128))
]),
_: 1
}),
(o(!0), i(d, null, f(l.datas, (e) => (o(), p(t(c), {
key: e.fieldId,
gutter: 8
}, {
default: a(() => [
(o(!0), i(d, null, f(y.columns, (n) => (o(), p(t(k), {
span: n.span || 6,
key: n.key,
class: "guns-flow-variable-setting-body"
}, {
default: a(() => [
n.key != "action" ? v(l.$slots, n.key, {
key: 0,
record: e
}, () => [
s(t(w), {
value: e[n.key],
"onUpdate:value": (u) => e[n.key] = u,
modelValue: e[n.key],
"onUpdate:modelValue": (u) => e[n.key] = u,
placeholder: V.value(n.title)
}, null, 8, ["value", "onUpdate:value", "modelValue", "onUpdate:modelValue", "placeholder"])
]) : v(l.$slots, n.key, {
key: 1,
record: e
}, () => [
e.add ? (o(), p(t(m), {
key: 0,
onClick: (u) => C(e)
}, null, 8, ["onClick"])) : (o(), p(t(x), {
key: 1,
title: "确定要删除此记录吗?",
width: "200",
"ok-text": "删除",
"cancel-text": "关闭",
"confirm-button-text": "删除",
"cancel-button-text": "关闭",
onConfirm: (u) => C(e)
}, {
reference: a(() => [
s(t(m))
]),
default: a(() => [
s(t(m))
]),
_: 2
}, 1032, ["onConfirm"]))
])
]),
_: 2
}, 1032, ["span"]))), 128))
]),
_: 2
}, 1024))), 128)),
s(t(h), {
class: "guns-flow-variable-setting-butoon",
onClick: B
}, {
default: a(() => [
s(t(P))
]),
_: 1
})
], 64));
}
});
export {
S as default
};