@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
124 lines (123 loc) • 4.24 kB
JavaScript
import { defineComponent as y, getCurrentInstance as U, ref as r, inject as A, onMounted as $, openBlock as B, createBlock as D, unref as p, withCtx as u, createVNode as s } from "vue";
import { pluginManager as m, toUgroup as N } from "@javaguns/utils";
import q from "../../hooks/useDrawer.mjs";
import { getNodeAttrByTaskId as E, getReturnableTask as M } from "../../utils/api.mjs";
import { DataInfoKey as W } from "../../utils/injection-key.mjs";
import j from "../../flow-designer/common/flowSelect.vue.mjs";
import K from "../../flow-designer/common/flowRadioGroup.vue.mjs";
const P = y({ name: "flow-operate-back" }), Q = /* @__PURE__ */ y({
...P,
setup(R, { expose: b }) {
const w = m.getComponent("Form"), d = m.getComponent("FormItem"), I = m.getComponent("Textarea"), { appContext: h } = U(), f = h.app.config.globalProperties.$flowUI, c = r(), _ = { style: { width: "150px" } }, v = r([]), i = r([]), a = r({
destTaskId: "",
backType: "",
whisper: ""
}), V = r({
destTaskId: [{ required: !0, message: "请选择被退回人!", trigger: "change" }],
backType: [{ required: !0, message: "请选择退回后发起审批形式!", trigger: "change" }]
}), { backApprovalTypeDatas: x } = q(), k = A(W, r({})), C = async () => {
let n = {
taskId: k.value.ruTask.taskId,
instanceId: k.value.ruTask.instanceId
};
const e = await E(n), t = e.data.data.allowBackType, T = e.data.data.backApprovalType;
if (T) {
const g = N(T);
x.forEach((o) => {
g.includes(o.value) && v.value.push(o);
});
}
if (t == 2) {
const o = (await M(n)).data.data;
o && o.length > 0 && (i.value = [], o.forEach((l) => {
i.value.push({
name: l.approverWrapper,
value: l.taskId,
popovers: [
{
title: l.nodeName,
content: `任务类型:${l.taskTypeWrapper}`
},
{
content: `接收时间:${l.createTime}`
},
{
content: `审批时间:${l.updateTime}`
}
]
});
}));
}
}, F = async () => {
try {
return f == "element-plus" || f == "arco-design" ? await c.value.validate() : await c.value.validateFields(), a.value;
} catch {
}
};
return $(C), b({
valid: F
}), (n, e) => (B(), D(p(w), {
ref_key: "backForm",
ref: c,
model: a.value,
rules: V.value,
"label-col": _,
layout: "vertical",
"label-position": "top"
}, {
default: u(() => [
s(p(d), {
label: "被退回人",
name: "destTaskId",
prop: "destTaskId"
}, {
default: u(() => [
s(K, {
modelValue: a.value.destTaskId,
"onUpdate:modelValue": e[0] || (e[0] = (t) => a.value.destTaskId = t),
datas: i.value
}, null, 8, ["modelValue", "datas"])
]),
_: 1
}),
s(p(d), {
label: "退回后发起审批",
name: "backType",
prop: "backType"
}, {
default: u(() => [
s(j, {
modelValue: a.value.backType,
"onUpdate:modelValue": e[1] || (e[1] = (t) => a.value.backType = t),
datas: v.value,
mode: "simple",
placeholder: "请选择"
}, null, 8, ["modelValue", "datas"])
]),
_: 1
}),
s(p(d), {
label: "捎话",
prop: "whisper"
}, {
default: u(() => [
s(p(I), {
modelValue: a.value.whisper,
"onUpdate:modelValue": e[2] || (e[2] = (t) => a.value.whisper = t),
value: a.value.whisper,
"onUpdate:value": e[3] || (e[3] = (t) => a.value.whisper = t),
type: "textarea",
rows: 3,
placeholder: "捎话内容"
}, null, 8, ["modelValue", "value"])
]),
_: 1
})
]),
_: 1
}, 8, ["model", "rules"]));
}
});
export {
Q as default
};