UNPKG

@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

138 lines (137 loc) 5.52 kB
import { defineComponent as g, ref as h, openBlock as r, createElementBlock as p, Fragment as y, createVNode as c, withCtx as _, unref as u, createElementVNode as o, renderList as M, createTextVNode as s, toDisplayString as l, createCommentVNode as N } from "vue"; import "../../style/option.css"; import "../../style/job.css"; import { pluginManager as f } from "@javaguns/utils"; import { IconPlusOutline as O } from "@javaguns/icon"; import V from "../../../hooks/useDrawer.mjs"; import { findJobList as U, deleteJob as L } from "../../../utils/jobApi.mjs"; import $ from "../../common/flowDrawerContent.vue.mjs"; import B from "../../common/flowDrawerOption.vue.mjs"; import S from "./flowApproverAddJob.vue.mjs"; const E = { key: 0, class: "action-type-container" }, W = { class: "approval-limit-guide-1" }, z = { class: "action-type-icon" }, D = ["src"], F = { class: "action-type-content" }, G = { class: "action-type-content-title" }, P = { class: "action-type-content-hightlight" }, q = { class: "action-type-operate" }, A = { class: "action-type-operate-flex approval-limit-guide-3" }, H = ["onClick"], K = ["onClick"], Q = g({ name: "flow-approver-timeLimit" }), ae = /* @__PURE__ */ g({ ...Q, props: { node: {} }, setup(k) { const j = f.getComponent("Switch"), x = f.getComponent("Button"); f.getComponent("Dialog"); const t = k, { jobItems: w } = V(), m = h(), v = h(!1), C = [ { buttonName: "限时审批", content: "限时审批支持自动提醒、转交等,为每条审批流设一个智能闹钟" } ], b = async () => { const a = { modelId: t.node.modelId, definitionId: t.node.definitionId, nodeId: t.node.nodeId }, i = await U(a); if (i.data) { const n = i.data.data; t.node.jobs = []; for (var e = 0; e < n.length; e++) t.node.jobs.push(n[e]); } else t.node.jobs = []; }, I = () => { m.value.addLimitJob(t.node); }, J = (a) => { m.value.editLimitJob(a, t.node.jobs); }, T = async (a) => { try { v.value = !0, await L(a), b(); } finally { v.value = !1; } }; return (a, i) => (r(), p(y, null, [ c($, { name: "审批限时处理" }, { default: _(() => [ c(B, { datas: C }, { default: _(({ item: e, slotData: n }) => [ c(u(j), { modelValue: t.node.attr.jobOpen, "onUpdate:modelValue": i[0] || (i[0] = (d) => t.node.attr.jobOpen = d), checked: t.node.attr.jobOpen, "onUpdate:checked": i[1] || (i[1] = (d) => t.node.attr.jobOpen = d), "checked-children": n.activeText, "un-checked-children": n.inactiveText, "active-text": n.activeText, "inactive-text": n.inactiveText, "inline-prompt": "" }, null, 8, ["modelValue", "checked", "checked-children", "un-checked-children", "active-text", "inactive-text"]) ]), _: 1 }), t.node.attr.jobOpen ? (r(), p("div", E, [ o("div", null, [ o("div", W, [ (r(!0), p(y, null, M(t.node.jobs, (e, n) => (r(), p("div", { class: "action-type", key: e.reJobId }, [ o("div", z, [ o("img", { src: u(w).filter((d) => d.index == e.jobMode)[0].iconImg, alt: "" }, null, 8, D) ]), o("div", F, [ o("div", G, [ s(" 流程到达当前审批人处 "), o("span", null, [ s("  超过  "), o("span", P, l(e.jobDuration) + " " + l(e.lengthUnit == 1 ? "天" : e.lengthUnit == 2 ? "小时" : "分钟"), 1), s("  ") ]), s(" 未处理时将" + l(e.jobMode == 1 ? "自动提醒" : e.jobMode == 2 ? "自动转交" : e.jobMode == 3 ? "自动同意" : "自动拒绝"), 1) ]), o("div", null, "被提醒人:当前审批人,发起人" + l(e.noticeUserNames ? "," + e.noticeUserNames.join(",") : ""), 1), o("div", null, "提醒方式:" + l(e.warnTypeWrapper ? e.warnTypeWrapper.name : e.warnType), 1) ]), o("div", q, [ o("div", A, [ o("div", { class: "action-type-edit", onClick: (d) => J(e) }, null, 8, H), o("div", { class: "action-type-delete", onClick: (d) => T(e) }, null, 8, K) ]) ]) ]))), 128)) ]), c(u(x), { size: "large", block: "", onClick: I, class: "w-full" }, { default: _(() => [ c(u(O)), s("处理方式 ") ]), _: 1 }) ]) ])) : N("", !0) ]), _: 1 }), c(S, { ref_key: "addJobModal", ref: m, onOk: b }, null, 512) ], 64)); } }); export { ae as default };