import { r as e } from "./bpMliuchengdingyidexinxibiaokongzhiqi-DHqibwmz.mjs";
import { t } from "./enum-B85EHrfY.mjs";
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, onBeforeMount as d, openBlock as f, ref as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
import { ProTable as _ } from "@pubinfo/pro-components";
import { useRoute as v, useRouter as y } from "vue-router";
import { Space as b, Tooltip as x } from "ant-design-vue/es";
//#region src/pages/flow-create/flow-model/definition.vue?vue&type=script&setup=true&lang.ts
var S = {
	"py-10px": "",
	"px-10px": "",
	"w-full": "",
	"h-full": ""
}, C = { key: 0 }, w = { key: 1 }, T = { key: 2 }, E = { key: 3 }, D = { key: 4 }, O = {
	key: 0,
	class: "blue"
}, k = {
	key: 1,
	class: "green"
}, A = { key: 2 }, j = ["onClick"], M = { class: "ml-4px" }, N = /* @__PURE__ */ u({
	name: "FlowDefinition",
	__name: "definition",
	setup(u) {
		let N = y(), P = v(), F = p("");
		d(() => {
			F.value = P.params.flowKey;
		});
		let I = p();
		async function L(t) {
			let { current: n, pageSize: r, ...i } = t, a = await e({
				doSearchTotal: !0,
				currentPage: n,
				pageSize: r,
				key: F.value,
				...i
			});
			return {
				success: a.success,
				data: a.data?.records ?? [],
				total: a.data?.total ?? 0
			};
		}
		let R = r(() => [
			{
				hideInSearch: !0,
				title: "定义编号",
				dataIndex: "id",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "流程名称",
				dataIndex: "name",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "可见范围",
				dataIndex: "visibleRange",
				key: "visibleRange"
			},
			{
				hideInSearch: !0,
				title: "流程类型",
				dataIndex: "flowType",
				key: "flowType"
			},
			{
				hideInSearch: !0,
				title: "表单信息",
				dataIndex: "formName",
				key: "formName"
			},
			{
				hideInSearch: !0,
				title: "流程版本",
				dataIndex: "version",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				title: "部署时间",
				dataIndex: "deploymentTime",
				ellipsis: !0
			},
			{
				hideInSearch: !0,
				width: 100,
				title: "操作",
				dataIndex: "action",
				fixed: "right"
			}
		]);
		function z(e, n) {
			switch (e) {
				case t.RECOVERY:
					N.push({
						name: "flowmodelUpdate",
						params: {
							type: "recovery",
							id: n.id
						}
					});
					break;
			}
		}
		return (e, r) => {
			let u = x, d = b;
			return f(), o("div", S, [l(h(_), {
				ref_key: "tableRef",
				ref: I,
				"row-key": "id",
				search: !1,
				request: L,
				columns: h(R),
				"auto-height": "",
				scroll: { x: 1100 }
			}, {
				bodyCell: g(({ column: e, record: r }) => [
					e.dataIndex === "visibleRange" ? (f(), o(n, { key: 0 }, [!r.startUsers?.length && !r.startDepts?.length ? (f(), o("span", C, " 全部可见 ")) : r.startUsers.length === 1 ? (f(), o("span", w, m(r.startUsers[0].nickname), 1)) : r.startDepts?.length === 1 ? (f(), o("span", T, m(r.startDepts[0].name), 1)) : r.startDepts?.length > 1 ? (f(), o("span", E, [l(u, null, {
						title: g(() => [c(m(`${r.startDepts.map((e) => e.name).join("、")}`), 1)]),
						default: g(() => [c(" " + m(r.startDepts[0].name) + "等 " + m(r.startDepts.length) + " 个部门可见 ", 1)]),
						_: 2
					}, 1024)])) : (f(), o("span", D, [l(u, null, {
						title: g(() => [c(m(`${r.startUsers.map((e) => e.nickname).join("、")}`), 1)]),
						default: g(() => [c(" " + m(r.startUsers[0].nickname) + "等 " + m(r.startUsers.length) + " 人可见 ", 1)]),
						_: 2
					}, 1024)]))], 64)) : a("", !0),
					e.dataIndex === "flowType" ? (f(), o(n, { key: 1 }, [r.modelType === 10 ? (f(), o("span", O, " BPMN 设计器 ")) : a("", !0), r.modelType === 20 ? (f(), o("span", k, " SIMPLE 设计器 ")) : a("", !0)], 64)) : a("", !0),
					e.dataIndex === "version" ? (f(), o("span", A, m(`v${r.version}`), 1)) : a("", !0),
					e.dataIndex === "action" ? (f(), i(d, { key: 3 }, {
						default: g(() => [s("a", {
							class: "flex items-center",
							onClick: (e) => z(h(t).RECOVERY, r)
						}, [s("span", M, m(h(t).RECOVERY), 1)], 8, j)]),
						_: 2
					}, 1024)) : a("", !0)
				]),
				_: 1
			}, 8, ["columns"])]);
		};
	}
});
//#endregion
export { N as default };
