@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
165 lines (164 loc) • 6.7 kB
JavaScript
import { defineComponent as C, inject as H, ref as y, computed as R, openBlock as c, createBlock as r, unref as e, withCtx as t, createVNode as a, createElementVNode as s, toDisplayString as h, createElementBlock as S, Fragment as D, renderList as F, normalizeClass as K, createTextVNode as u, createCommentVNode as f } from "vue";
import "./style/index.css";
import { pluginManager as i } from "@javaguns/utils";
import { GunsSpace as L } from "@javaguns/ui";
import { NodeModifyKey as T } from "../utils/injection-key.mjs";
import $ from "../hooks/useData.mjs";
const q = { class: "guns-header-container" }, I = { class: "guns-header-name" }, J = { class: "guns-header-nav" }, O = { class: "guns-header-button-order" }, P = { class: "sub-header-container" }, Q = { class: "handle-container" }, U = C({ name: "flow-nav" }), ae = /* @__PURE__ */ C({
...U,
props: {
node: {},
nav: { type: Boolean, default: !0 },
name: { default: "" },
datas: { default: () => [] }
},
emits: ["click", "preview", "close", "refresh", "publish", "upgrade"],
setup(k, { emit: w }) {
i.getComponent("Container");
const b = i.getComponent("Header"), o = i.getComponent("Button"), x = i.getComponent("Affix"), z = i.getComponent("Row"), m = i.getComponent("Col"), n = k, d = H(T, y(!1)), g = y(1), { navDatas: B } = $(), N = R(() => n.datas && n.datas.length > 0 ? n.datas : B), l = w, G = (_) => {
g.value = _, l("click", _);
}, v = () => {
l("close");
}, V = () => {
l("preview");
}, M = () => {
l("publish"), d.value = !1;
}, j = () => {
l("refresh"), d.value = !1;
}, A = () => {
l("upgrade"), d.value = !1;
};
return (_, W) => n.nav ? (c(), r(e(x), {
key: 0,
"offset-top": 0,
offset: 0,
class: "guns-page-flow-container"
}, {
default: t(() => [
a(e(b), {
class: "guns-page-flow-header",
style: { height: "50px" }
}, {
default: t(() => [
s("div", q, [
a(e(z), null, {
default: t(() => [
a(e(m), { span: 6 }, {
default: t(() => [
s("div", { class: "guns-header-icon" }, [
s("span", {
class: "flowfont icon-jiantou-zuo-cuxiantiao",
onClick: v
})
]),
s("div", I, [
s("span", null, "正在编辑: " + h(n.name), 1)
])
]),
_: 1
}),
a(e(m), { span: 12 }, {
default: t(() => [
s("div", J, [
(c(!0), S(D, null, F(N.value, (p, E) => (c(), r(e(o), {
key: E,
onClick: (X) => G(p.value),
class: K({ "nav-active": g.value == p.value })
}, {
default: t(() => [
s("span", O, h(p.value), 1),
s("span", null, h(p.name), 1)
]),
_: 2
}, 1032, ["onClick", "class"]))), 128))
])
]),
_: 1
}),
a(e(m), { span: 6 }, {
default: t(() => [
s("div", P, [
s("div", Q, [
a(e(L), { size: "ss" }, {
default: t(() => [
a(e(o), {
type: "primary",
size: "small",
class: "main-hollow-btn",
onClick: v
}, {
default: t(() => [
u("关闭")
]),
_: 1
}),
a(e(o), {
type: "primary",
size: "small",
class: "main-hollow-btn",
onClick: V
}, {
default: t(() => [
u("预览表单")
]),
_: 1
}),
n.node.update ? (c(), r(e(o), {
key: 0,
type: "primary",
size: "small",
class: "main-hollow-btn",
onClick: j
}, {
default: t(() => [
u("刷新")
]),
_: 1
})) : f("", !0),
n.node && !n.node.update ? (c(), r(e(o), {
key: 1,
type: "primary",
size: "small",
class: "main-solid-btn",
onClick: M
}, {
default: t(() => [
u("发布")
]),
_: 1
})) : f("", !0),
e(d) && n.node && n.node.update ? (c(), r(e(o), {
key: 2,
type: "primary",
size: "small",
class: "main-solid-btn",
onClick: A
}, {
default: t(() => [
u("升级")
]),
_: 1
})) : f("", !0)
]),
_: 1
})
])
])
]),
_: 1
})
]),
_: 1
})
])
]),
_: 1
})
]),
_: 1
})) : f("", !0);
}
});
export {
ae as default
};