import { t as e } from "./enum-Dkr8RUaO.mjs";
import { p as t } from "./guanlihoutailiuchengrenwushili-B2SkD7uU.mjs";
import { Fragment as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, openBlock as l, renderList as u, toDisplayString as d, unref as f, withCtx as p, withModifiers as m } from "vue";
import { ProTable as h } from "@pubinfo/pro-components";
import { useRouter as g } from "vue-router";
//#region src/pages/approve-center/todo.vue?vue&type=script&setup=true&lang.tsx
var _ = {
	"py-10px": "",
	"px-10px": "",
	"w-full": "",
	"h-full": ""
}, v = {
	key: 0,
	class: "flex flex-col"
}, y = ["onClick"], b = /* @__PURE__ */ c({
	name: "TodoList",
	__name: "todo",
	setup(c) {
		async function b(e) {
			let { current: n, pageSize: r, ...i } = e, a = await t({
				currentPage: n,
				pageSize: r,
				doSearchTotal: !0,
				...i
			});
			return {
				success: a.success,
				data: a.data?.records ?? [],
				total: a.data?.total ?? 0
			};
		}
		let x = [
			{
				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",
				ellipsis: !0,
				fieldProps: {
					placeholder: "请输入任务名称",
					allowClear: !0
				}
			},
			{
				hideInSearch: !0,
				title: "任务时间",
				dataIndex: "createTime",
				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"
			}
		], S = g();
		function C(t, n) {
			switch (t) {
				case e.HANDLE:
					S.push({
						name: "todoDetail",
						params: { processInstanceId: n.processInstanceId },
						query: { taskId: n.id }
					});
					break;
				default: break;
			}
		}
		return (t, c) => (l(), i("div", _, [s(f(h), {
			"row-key": "id",
			request: b,
			columns: x,
			"auto-height": "",
			scroll: { x: 1200 }
		}, {
			bodyCell: p(({ column: t, record: s }) => [
				t.dataIndex === "processName" ? (l(), i(n, { key: 0 }, [o(d(s.processInstance?.name || "-"), 1)], 64)) : r("", !0),
				t.dataIndex === "summary" ? (l(), i(n, { key: 1 }, [s.processInstance.summary && s.processInstance.summary.length > 0 ? (l(), i("div", v, [(l(!0), i(n, null, u(s.processInstance.summary, (e, t) => (l(), i("div", { key: t }, [a("span", null, d(e.key) + " : " + d(e.value), 1)]))), 128))])) : r("", !0)], 64)) : r("", !0),
				t.dataIndex === "startUser" ? (l(), i(n, { key: 2 }, [o(d(s.processInstance?.startUser?.nickname || "-"), 1)], 64)) : r("", !0),
				t.dataIndex === "processCreateTime" ? (l(), i(n, { key: 3 }, [o(d(s.processInstance?.createTime || "-"), 1)], 64)) : r("", !0),
				t.dataIndex === "name" ? (l(), i(n, { key: 4 }, [o(d(s.name || "-"), 1)], 64)) : r("", !0),
				t.dataIndex === "createTime" ? (l(), i(n, { key: 5 }, [o(d(s.createTime || "-"), 1)], 64)) : r("", !0),
				t.dataIndex === "processInstanceId" ? (l(), i(n, { key: 6 }, [o(d(s.processInstanceId || "-"), 1)], 64)) : r("", !0),
				t.dataIndex === "id" ? (l(), i(n, { key: 7 }, [o(d(s.id || "-"), 1)], 64)) : r("", !0),
				t.dataIndex === "action" ? (l(), i("a", {
					key: 8,
					onClick: m((t) => C(f(e).HANDLE, s), ["prevent"])
				}, "办理", 8, y)) : r("", !0)
			]),
			_: 1
		})]));
	}
});
//#endregion
export { b as default };
