@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
174 lines (173 loc) • 6.87 kB
JavaScript
import { defineComponent as g, toRefs as B, ref as N, watch as $, openBlock as a, createBlock as d, unref as l, withCtx as u, createElementBlock as n, Fragment as A, renderList as D, createVNode as k, createCommentVNode as s, createElementVNode as G, toDisplayString as m } from "vue";
import "./style/index.css";
import { pluginManager as f } from "@javaguns/utils";
import { GunsAvatar as _, GunsSpace as R } from "@javaguns/ui";
import { getRuTaskList as U } from "../../utils/api.mjs";
import "../flow-node-addbutton/index.mjs";
import "../flow-node-delbutton/index.mjs";
import "../flow-node-delconfirm/index.mjs";
import "../flow-node-errorwarn/index.mjs";
import "../flow-node-dragtool/index.mjs";
import "../flow-node-zoom/index.mjs";
import { GunsFlowTaskStatus as V } from "../flow-task-status/index.mjs";
import "../flow-task-image/index.mjs";
import "./index.mjs";
import "../flow-task-user/index.mjs";
const E = ["innerHTML"], F = ["innerHTML"], j = ["innerHTML"], q = ["innerHTML"], J = ["innerHTML"], K = {
key: 5,
class: "guns-flow-task-timeline-item"
}, O = {
key: 6,
class: "guns-flow-task-timeline-item"
}, P = {
key: 7,
class: "guns-flow-task-timeline-item"
}, Q = {
key: 8,
class: "guns-approval-remark"
}, X = {
key: 9,
class: "guns-flow-task-timeline-item"
}, Y = {
key: 10,
class: "guns-approval-remark"
}, Z = g({ name: "flow-task-timeline" }), _e = /* @__PURE__ */ g({
...Z,
props: {
size: { default: "m" },
gap: { type: Boolean, default: !0 },
datas: { default: () => [] }
},
emits: ["load"],
setup(T, { expose: b, emit: I }) {
const h = f.getComponent("Timeline"), w = f.getComponent("TimelineItem"), y = f.getComponent("Row"), v = f.getComponent("Col"), M = f.getComponent("Badge"), r = T, { datas: L } = B(r), o = N(L.value || []);
$(
() => r.datas,
() => {
r.datas && (o.value = r.datas);
}
);
const C = (t) => `收到 <b>${t.turnWrapper}</b> 的 <b>转交</b> 任务`, H = (t) => `收到 <b>${t.returnerWrapper}</b> 的 <b>退回</b> 任务`, W = (t) => {
const i = o.value;
for (let e = 0; e < i.length; e++) {
const p = i[e];
if (p.taskId == t.addSignTaskId) {
let c = "";
return p.beforeAddSignTaskId == t.taskId ? c = "前" : t.beforeAddSignTaskId && (c = "后"), ` 收到 <b>${p.approverWrapper}</b> 的 <b>${c}加签</b> 任务`;
}
}
return "";
}, x = (t) => {
const i = o.value;
for (let e = 0; e < i.length; e++) {
const p = i[e];
if (p.taskId == t.consultTaskId)
return ` 收到 <b>${p.approverWrapper}</b> 的 <b>征询</b> 任务`;
}
return "";
}, z = (t) => `收到 <b>${t.revokeUserIdWrapper}</b> 的 <b>撤回</b> 任务`, S = I;
return b({
setData: async (t) => {
if (t.instanceId) {
const i = await U({
instanceId: t.instanceId
});
i && i.data && (o.value = i.data.data), S("load", o.value);
} else
t.datas && (o.value = t.datas);
},
getData: () => o.value
}), (t, i) => (a(), d(l(h), null, {
default: u(() => [
(a(!0), n(A, null, D(o.value, (e) => (a(), d(l(w), {
key: e.taskId
}, {
dot: u(() => [
[2, 3, 4].includes(e.approvalMode) ? (a(), d(l(M), {
key: 0,
value: e.approvalMode == 4 ? "或签" : "会签",
count: e.approvalMode == 4 ? "或签" : "会签",
text: e.approvalMode == 4 ? "或签" : "会签"
}, {
default: u(() => [
k(l(_), {
src: e.approverAvatarUrl,
alt: e.approverWrapper,
size: r.size
}, null, 8, ["src", "alt", "size"])
]),
_: 2
}, 1032, ["value", "count", "text"])) : (a(), d(l(_), {
key: 1,
src: e.approverAvatarUrl,
alt: e.approverWrapper,
size: r.size
}, null, 8, ["src", "alt", "size"]))
]),
default: u(() => [
k(l(y), null, {
default: u(() => [
r.gap ? (a(), d(l(v), {
key: 0,
span: 1
})) : s("", !0),
k(l(v), { span: 22 }, {
default: u(() => [
k(l(R), {
dir: "vertical",
size: "ss"
}, {
default: u(() => [
G("b", null, m(e.ruNodeName) + ": " + m(e.approverWrapper), 1),
k(l(V), { task: e }, null, 8, ["task"]),
e.turnWrapper ? (a(), n("div", {
key: 0,
class: "guns-flow-task-timeline-item",
innerHTML: C(e)
}, null, 8, E)) : s("", !0),
e.backTaskId ? (a(), n("div", {
key: 1,
class: "guns-flow-task-timeline-item",
innerHTML: H(e)
}, null, 8, F)) : s("", !0),
e.addSignTaskId ? (a(), n("div", {
key: 2,
class: "guns-flow-task-timeline-item",
innerHTML: W(e)
}, null, 8, j)) : s("", !0),
e.consultTaskId ? (a(), n("div", {
key: 3,
class: "guns-flow-task-timeline-item",
innerHTML: x(e)
}, null, 8, q)) : s("", !0),
e.revokeTaskId ? (a(), n("div", {
key: 4,
class: "guns-flow-task-timeline-item",
innerHTML: z(e)
}, null, 8, J)) : s("", !0),
e.createTime ? (a(), n("div", K, "接收时间:" + m(e.createTime), 1)) : s("", !0),
e.updateTime ? (a(), n("div", O, "审批时间:" + m(e.updateTime), 1)) : s("", !0),
e.whisper ? (a(), n("div", P, "捎来一话:")) : s("", !0),
e.whisper ? (a(), n("div", Q, m(e.whisper), 1)) : s("", !0),
e.remark ? (a(), n("div", X, "审批意见:")) : s("", !0),
e.remark ? (a(), n("div", Y, m(e.remark), 1)) : s("", !0)
]),
_: 2
}, 1024)
]),
_: 2
}, 1024)
]),
_: 2
}, 1024)
]),
_: 2
}, 1024))), 128))
]),
_: 1
}));
}
});
export {
_e as default
};