import { u as e } from "./guanlihoutailiuchengrenwushili-B2SkD7uU.mjs";
import { n as t } from "./fun-U4_ASZRs.mjs";
import { t as n } from "./enum-B6bAjZjy.mjs";
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, openBlock as d, toDisplayString as f, unref as p, withCtx as m } from "vue";
import { ProTable as h } from "@pubinfo/pro-components";
import { useRouter as g } from "vue-router";
import { Badge as _, Space as v } from "ant-design-vue/es";
//#region src/pages/flow-manage/task/index.vue?vue&type=script&setup=true&lang.ts
var y = {
	"py-10px": "",
	"px-10px": "",
	"w-full": "",
	"h-full": ""
}, b = { key: 0 }, x = { key: 1 }, S = { key: 2 }, C = { key: 0 }, w = ["onClick"], T = { class: "ml-4px" }, E = /* @__PURE__ */ u({
	name: "FlowTask",
	__name: "index",
	setup(u) {
		async function E(t) {
			let { current: n, pageSize: r, ...i } = t, a = await e({
				doSearchTotal: !0,
				currentPage: n,
				pageSize: r,
				...i
			});
			return {
				success: a.success,
				data: a.data?.records ?? [],
				total: a.data?.total ?? 0
			};
		}
		let D = i(() => [
			{
				hideInSearch: !0,
				title: "流程名称",
				dataIndex: "processInstance",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "发起人",
				dataIndex: "startUser",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "发起时间",
				dataIndex: "createTime",
				ellipsis: !0
			},
			{
				valueType: "a-input",
				bind: "value",
				title: "当前任务",
				dataIndex: "name",
				ellipsis: !0
			},
			{
				valueType: "a-range-picker",
				bind: "value",
				title: "任务开始时间",
				dataIndex: "createTime",
				ellipsis: !0,
				fieldProps: {
					allowClear: !0,
					style: { width: "100%" }
				},
				formItemProps: { labelCol: { style: { width: "100px" } } }
			},
			{
				hideInSearch: !0,
				title: "任务结束时间",
				dataIndex: "endTime",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "审批人",
				dataIndex: "assigneeUser",
				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: 80,
				title: "操作",
				dataIndex: "action",
				fixed: "right"
			}
		]), O = g();
		function k(e, t) {
			switch (e) {
				case n.DETAIL:
					O.push({
						name: "taskDetail",
						params: { processInstanceId: t.processInstanceId },
						query: {
							type: "view",
							taskId: t.id
						}
					});
					break;
			}
		}
		return (e, i) => {
			let u = _, g = v;
			return d(), s("div", y, [l(p(h), {
				"row-key": "id",
				request: E,
				columns: p(D),
				"auto-height": "",
				scroll: { x: 1100 }
			}, {
				bodyCell: m(({ column: e, record: i }) => [
					e.dataIndex === "processInstance" ? (d(), s("span", b, f(i.processInstance?.name), 1)) : o("", !0),
					e.dataIndex === "startUser" ? (d(), s("span", x, f(i.processInstance?.startUser?.nickname ?? ""), 1)) : o("", !0),
					e.dataIndex === "assigneeUser" ? (d(), s("span", S, f(i.assigneeUser?.nickname ?? ""), 1)) : o("", !0),
					e.dataIndex === "status" ? (d(), s(r, { key: 3 }, [
						i.status === 1 ? (d(), a(u, {
							key: 0,
							status: "processing",
							text: "审批中"
						})) : o("", !0),
						i.status === 2 ? (d(), a(u, {
							key: 1,
							status: "success",
							text: "审批通过"
						})) : o("", !0),
						i.status === 3 ? (d(), a(u, {
							key: 2,
							status: "error",
							text: "审批不通过"
						})) : o("", !0),
						i.status === 4 ? (d(), a(u, {
							key: 3,
							status: "default",
							text: "已取消"
						})) : o("", !0)
					], 64)) : o("", !0),
					e.dataIndex === "durationInMillis" ? (d(), s(r, { key: 4 }, [i.durationInMillis ? (d(), s("span", C, f(p(t)(i.durationInMillis)), 1)) : o("", !0)], 64)) : o("", !0),
					e.dataIndex === "action" ? (d(), a(g, { key: 5 }, {
						default: m(() => [c("a", {
							class: "flex items-center",
							onClick: (e) => k(p(n).DETAIL, i)
						}, [c("span", T, f(p(n).DETAIL), 1)], 8, w)]),
						_: 2
					}, 1024)) : o("", !0)
				]),
				_: 1
			}, 8, ["columns"])]);
		};
	}
});
//#endregion
export { E as default };
