@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
71 lines (70 loc) • 2.44 kB
JavaScript
import { defineComponent as p, toRefs as v, ref as g, openBlock as _, createElementBlock as w, normalizeClass as x, createVNode as e, unref as s, withCtx as l, createElementVNode as C, toDisplayString as D } from "vue";
import "./style/index.css";
import { pluginManager as u } from "@javaguns/utils";
import { GunsAvatar as G } from "@javaguns/ui";
import { getRuTask as R } 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 h } from "../flow-task-status/index.mjs";
import "../flow-task-image/index.mjs";
import "../flow-task-timeline/index.mjs";
import "./index.mjs";
const y = { class: "guns-flow-task-user-context" }, B = p({ name: "flow-task-user" }), K = /* @__PURE__ */ p({
...B,
props: {
data: { default: () => {
} },
fixed: { type: Boolean, default: !1 }
},
emits: ["load"],
setup(i, { expose: c, emit: f }) {
const d = u.getComponent("Row"), n = u.getComponent("Col"), r = i, { data: m } = v(r), t = g(m.value || {}), k = f;
return c({
setData: async (a) => {
if (a.taskId) {
const o = await R({
taskId: a.taskId
});
o && o.data && (t.value = o.data.data), k("load", t.value);
} else
a.data && (t.value = a.data);
},
getData: () => t.value
}), (a, o) => (_(), w("div", {
class: x({ "guns-flow-task-user-fixed": t.value, "guns-flow-task-user": !r.fixed })
}, [
e(s(d), { gutter: 4 }, {
default: l(() => [
e(s(n), { span: 6 }, {
default: l(() => [
e(s(G), {
src: t.value.applicantAvatarUrl,
alt: t.value.applicantWrapper,
class: "guns-flow-task-user-avatar"
}, null, 8, ["src", "alt"])
]),
_: 1
}),
e(s(n), { span: 18 }, {
default: l(() => [
C("div", y, D(t.value.applicantWrapper), 1),
e(s(h), {
task: t.value,
class: "guns-flow-task-user-context"
}, null, 8, ["task"])
]),
_: 1
})
]),
_: 1
})
], 2));
}
});
export {
K as default
};