import { l as e } from "./guanlihoutailiuchengrenwushili-B2SkD7uU.mjs";
import { n as t } from "./fun-U4_ASZRs.mjs";
import { n, t as r } from "./enum-B6bAjZjy.mjs";
import { Fragment as i, createCommentVNode as a, createElementBlock as o, createTextVNode as s, createVNode as c, defineComponent as l, openBlock as u, renderList as d, toDisplayString as f, unref as p, withCtx as m, withModifiers as h } from "vue";
import { ProTable as g } from "@pubinfo/pro-components";
import { useRouter as _ } from "vue-router";
//#region src/pages/approve-center/done.vue?vue&type=script&setup=true&lang.tsx
var v = {
	"py-10px": "",
	"px-10px": "",
	"w-full": "",
	"h-full": ""
}, y = {
	key: 0,
	class: "flex flex-col"
}, b = { key: 7 }, x = ["onClick"], S = /* @__PURE__ */ l({
	name: "DoneList",
	__name: "done",
	setup(l) {
		async function S(t) {
			let { current: n, pageSize: r, ...i } = t, a = await e({
				currentPage: n,
				pageSize: r,
				doSearchTotal: !0,
				...i
			});
			return {
				success: a.success,
				data: a.data?.records ?? [],
				total: a.data?.total ?? 0
			};
		}
		let C = [
			{
				hideInSearch: !0,
				title: "流程名",
				dataIndex: "processName",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "摘要",
				dataIndex: "summary",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "发起人",
				dataIndex: "startUser",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "发起时间",
				dataIndex: "processCreateTime",
				ellipsis: !0
			},
			{
				valueType: "a-input",
				bind: "value",
				title: "当前任务",
				dataIndex: "name",
				fieldProps: {
					placeholder: "请输入任务名称",
					allowClear: !0
				}
			},
			{
				hideInSearch: !0,
				title: "任务开始时间",
				dataIndex: "createTime",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "任务结束时间",
				dataIndex: "endTime",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "审批状态",
				dataIndex: "status",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "审批建议",
				dataIndex: "reason",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "耗时",
				dataIndex: "durationInMillis",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "流程编号",
				dataIndex: "processInstanceId",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "任务编号",
				dataIndex: "id",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				width: 60,
				title: "操作",
				dataIndex: "action",
				fixed: "right"
			}
		], w = _();
		function T(e, t) {
			switch (e) {
				case r.HISTORY:
					w.push({
						name: "doneProcessDetail",
						params: { processInstanceId: t.processInstanceId },
						query: { taskId: t.id }
					});
					break;
				default: break;
			}
		}
		return (e, l) => (u(), o("div", v, [c(p(g), {
			"row-key": "id",
			request: S,
			columns: C,
			"auto-height": "",
			scroll: { x: 1400 }
		}, {
			bodyCell: m(({ column: e, record: c }) => [
				e.dataIndex === "processName" ? (u(), o(i, { key: 0 }, [s(f(c.processInstance?.name || "-"), 1)], 64)) : a("", !0),
				e.dataIndex === "summary" ? (u(), o(i, { key: 1 }, [c.processInstance.summary && c.processInstance.summary.length > 0 ? (u(), o("div", y, [(u(!0), o(i, null, d(c.processInstance.summary, (e, t) => (u(), o("div", { key: t }, f(e.key) + " : " + f(e.value), 1))), 128))])) : a("", !0)], 64)) : a("", !0),
				e.dataIndex === "startUser" ? (u(), o(i, { key: 2 }, [s(f(c.processInstance?.startUser?.nickname || "-"), 1)], 64)) : a("", !0),
				e.dataIndex === "processCreateTime" ? (u(), o(i, { key: 3 }, [s(f(c.processInstance?.createTime || "-"), 1)], 64)) : a("", !0),
				e.dataIndex === "name" ? (u(), o(i, { key: 4 }, [s(f(c.name || "-"), 1)], 64)) : a("", !0),
				e.dataIndex === "createTime" ? (u(), o(i, { key: 5 }, [s(f(c.createTime || "-"), 1)], 64)) : a("", !0),
				e.dataIndex === "endTime" ? (u(), o(i, { key: 6 }, [s(f(c.endTime || "-"), 1)], 64)) : a("", !0),
				e.dataIndex === "status" ? (u(), o("span", b, f(p(n).find((e) => e.value === c.status)?.label || "-"), 1)) : a("", !0),
				e.dataIndex === "reason" ? (u(), o(i, { key: 8 }, [s(f(c.reason || "-"), 1)], 64)) : a("", !0),
				e.dataIndex === "durationInMillis" ? (u(), o(i, { key: 9 }, [s(f(p(t)(c.durationInMillis)), 1)], 64)) : a("", !0),
				e.dataIndex === "processInstanceId" ? (u(), o(i, { key: 10 }, [s(f(c.processInstanceId || "-"), 1)], 64)) : a("", !0),
				e.dataIndex === "id" ? (u(), o(i, { key: 11 }, [s(f(c.id || "-"), 1)], 64)) : a("", !0),
				e.dataIndex === "action" ? (u(), o("a", {
					key: 12,
					onClick: h((e) => T(p(r).HISTORY, c), ["prevent"])
				}, "历史", 8, x)) : a("", !0)
			]),
			_: 1
		})]));
	}
});
//#endregion
export { S as default };
