import { t as e } from "./_plugin-vue_export-helper-C_T2la-V.mjs";
import { t } from "./guanlihoutailiuchengrenwushili-B2SkD7uU.mjs";
import { n } from "./fun-U4_ASZRs.mjs";
import { n as r } from "./enum-B6bAjZjy.mjs";
import { a as i, t as a } from "./guanlihoutailiuchengshili-C0b2OnM9.mjs";
import { t as o } from "./view-uT1kRQiv.mjs";
import { t as s } from "./operateButton-B6_vdD2r.mjs";
import { t as c } from "./timeLine-DVfBWuOc.mjs";
import { t as l } from "./registerComponent-DnH71wDV.mjs";
import { Fragment as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, isRef as ee, normalizeClass as te, onMounted as v, openBlock as y, ref as b, shallowRef as x, toDisplayString as S, unref as C, withCtx as w } from "vue";
import { useRoute as T, useRouter as E } from "vue-router";
import { Button as ne, TabPane as re, Table as ie, Tabs as ae } from "ant-design-vue/es";
import './detail.css';//#region src/pages/flow-manage/detail.vue?vue&type=script&setup=true&lang.ts
var oe = {
	"py-10px": "",
	"px-10px": "",
	"w-full": "",
	"h-full": ""
}, D = {
	"size-full": "",
	bg: "#fff",
	"p-10px": "",
	flex: "",
	"flex-col": ""
}, O = {
	"text-16px": "",
	"font-bold": ""
}, k = {
	flex: "",
	"items-center": ""
}, A = { "ml-16px": "" }, j = {
	"flex-1": "",
	"overflow-auto": ""
}, M = {
	flex: "",
	"flex-row": ""
}, N = {
	key: 0,
	class: "w-40%"
}, P = {
	key: 1,
	class: "w-40%"
}, F = { "flex-1": "" }, I = { key: 0 }, L = { key: 1 }, R = /* @__PURE__ */ e(/* @__PURE__ */ _({
	name: "ProcessDetail",
	__name: "detail",
	setup(e) {
		let _ = T(), R = b(""), z = b(""), B = b(""), V = b(null), H = b("1"), U = x(null), W = b({}), G = b([]), K = b(""), q = b({}), J = b(null), Y = b({}), se = {
			sj: "事假",
			bj: "病假"
		}, X = b([]), ce = [
			{
				title: "审批节点",
				dataIndex: "name"
			},
			{
				title: "审批人",
				dataIndex: "assigneeUser"
			},
			{
				title: "开始时间",
				dataIndex: "createTime"
			},
			{
				title: "结束时间",
				dataIndex: "endTime"
			},
			{
				title: "审批状态",
				dataIndex: "status"
			},
			{
				title: "审批建议",
				dataIndex: "reason"
			},
			{
				title: "耗时",
				dataIndex: "durationInMillis"
			}
		], le = E();
		function Z() {
			i({
				processInstanceId: z.value,
				taskId: B.value
			}).then((e) => {
				if (W.value = e.data?.processInstance, G.value = e.data?.activityNodes || [], J.value = e.data?.todoTask || null, V.value?.loadTodoTask(J.value), V.value?.loadProcessInstance(e.data?.processInstance), V.value?.loadProcessDefinition(e.data?.processDefinition), Y.value = e.data?.processDefinition, Y.value.formType === 20) {
					let e = Y.value.formCustomViewPath;
					U.value = l(e);
				}
			});
		}
		function Q() {
			a({ id: z.value }).then((e) => {
				K.value = e.data?.bpmnXml || "", q.value = e.data ?? {};
			});
		}
		function $() {
			t({ processInstanceId: z.value }).then((e) => {
				X.value = e.data || [];
			});
		}
		v(() => {
			z.value = _.params.processInstanceId, B.value = _.query.taskId, R.value = _.query.type, Z(), Q(), $();
		});
		function ue() {
			Z(), Q(), $();
		}
		return (e, t) => {
			let i = re, a = ie, l = ae, _ = ne;
			return y(), p("div", oe, [m("div", D, [
				m("div", null, [
					m("div", null, "编号：" + S(C(z)), 1),
					m("div", O, S(C(W).name), 1),
					m("div", k, [m("span", null, S(C(W).startUser?.nickname), 1), m("span", A, S(C(W).startTime), 1)])
				]),
				m("div", j, [g(l, {
					"active-key": C(H),
					"onUpdate:activeKey": t[0] ||= (e) => ee(H) ? H.value = e : null,
					class: "h-full"
				}, {
					default: w(() => [
						g(i, {
							key: "1",
							tab: "审批详情"
						}, {
							default: w(() => [m("div", M, [C(Y).formType === 20 ? (y(), p("div", N, [g(C(U), { detail: C(W).formVariables }, null, 8, ["detail"])])) : (y(), p("div", P, [
								m("div", null, "请假类型：" + S(se[C(W).formVariables?.type]), 1),
								m("div", null, "请假天数：" + S(C(W).formVariables?.day), 1),
								m("div", null, "请假原因：" + S(C(W).formVariables?.reason), 1)
							])), m("div", F, [g(c, { "activity-nodes": C(G) }, null, 8, ["activity-nodes"])])])]),
							_: 1
						}),
						g(i, {
							key: "2",
							tab: "流程图"
						}, {
							default: w(() => [g(o, {
								"xml-string": C(K),
								"view-style": C(q)
							}, null, 8, ["xml-string", "view-style"])]),
							_: 1
						}),
						g(i, {
							key: "3",
							tab: "流转记录"
						}, {
							default: w(() => [g(a, {
								columns: ce,
								"data-source": C(X),
								pagination: !1
							}, {
								bodyCell: w(({ column: e, record: t }) => [
									e.dataIndex === "assigneeUser" ? (y(), p("span", I, S(t.assigneeUser?.nickname || t.ownerUser?.nickname), 1)) : f("", !0),
									e.dataIndex === "status" ? (y(), p("span", L, S(C(r).find((e) => e.value === t.status)?.label || t.status), 1)) : f("", !0),
									e.dataIndex === "durationInMillis" ? (y(), p(u, { key: 2 }, [h(S(C(n)(t.durationInMillis)), 1)], 64)) : f("", !0)
								]),
								_: 1
							}, 8, ["data-source"])]),
							_: 1
						})
					]),
					_: 1
				}, 8, ["active-key"])]),
				m("div", {
					"h-60px": "",
					flex: "",
					"items-center": "",
					"pl-20px": "",
					"border-0px": "",
					"border-t-1px": "",
					"border-solid": "",
					class: te(["border-#f0f0f0", C(R) === "view" ? "justify-end" : "justify-between"])
				}, [m("div", null, [C(R) === "view" ? f("", !0) : (y(), d(s, {
					key: 0,
					ref_key: "operationButtonRef",
					ref: V,
					onRefresh: ue
				}, null, 512))]), g(_, { onClick: t[1] ||= (e) => C(le).back() }, {
					default: w(() => [...t[2] ||= [h(" 返回 ", -1)]]),
					_: 1
				})], 2)
			])]);
		};
	}
}), [["__scopeId", "data-v-c7847fb4"]]);
//#endregion
export { R as default };
