import { t as e } from "./_plugin-vue_export-helper-C_T2la-V.mjs";
import { n as t } from "./bpMliuchengdingyidexinxibiaokongzhiqi-DHqibwmz.mjs";
import { Fragment as n, computed as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, normalizeClass as c, onMounted as l, openBlock as u, ref as d, renderList as f, toDisplayString as p } from "vue";
import { useRouter as m } from "vue-router";
import './startProcess.css';//#region src/pages/flow-center/startProcess/index.vue?vue&type=script&setup=true&lang.ts
var h = {
	"py-10px": "",
	"px-10px": "",
	"w-full": "",
	"h-full": ""
}, g = {
	"w-full": "",
	"h-full": "",
	bg: "#fff",
	"rd-8px": "",
	flex: "",
	"flex-col": "",
	"p-10px": ""
}, _ = {
	"flex-1": "",
	"h-0px": "",
	flex: "",
	"border-1px": "",
	"border-solid": "",
	"border-gray-200": "",
	"rd-8px": ""
}, v = {
	"w-400px": "",
	"h-full": "",
	"p-12px": ""
}, y = ["onClick"], b = ["id"], x = { "text-18px": "" }, S = {
	grid: "",
	"grid-cols-3": "",
	"gap-4": "",
	"mt-10px": "",
	"mb-10px": ""
}, C = ["onClick"], w = {
	flex: "",
	"items-center": "",
	"justify-center": "",
	"w-32px": "",
	"h-32px": "",
	bg: "#409eff",
	"rd-4px": "",
	"text-12px": "",
	class: "text-[#fff]",
	"mr-6px": ""
}, T = /* @__PURE__ */ e(/* @__PURE__ */ s({
	name: "StartProcess",
	__name: "index",
	setup(e) {
		let s = d(0), T = d(""), E = d([]), D = d(null);
		function O(e) {
			s.value = e;
			let t = D.value;
			if (!t) return;
			let n = t.querySelector(`#category-${e}`);
			if (!n) return;
			let r = n.getBoundingClientRect().top - t.getBoundingClientRect().top + t.scrollTop;
			t.scrollTo({
				top: r - 10,
				behavior: "smooth"
			});
		}
		let k = r(() => {
			let e = [];
			return E.value.forEach((t) => {
				t.name.includes(T.value) && (e.findIndex((e) => e.category === t.category) === -1 && e.push({
					category: t.category,
					categoryName: t.categoryName,
					items: []
				}), e.find((e) => e.category === t.category)?.items.push(t));
			}), e;
		}), A = r(() => {
			let e = [];
			return k.value.forEach((t) => {
				e.some((e) => e.value === t.category) || e.push({
					label: t.categoryName ?? "",
					value: t.category ?? ""
				});
			}), e;
		});
		function j() {
			t({ suspensionState: 1 }).then((e) => {
				e.success && (E.value = e.data ?? []);
			});
		}
		let M = m();
		function N(e) {
			e.formType === 20 ? M.push({
				name: "YewuProcessCreate",
				query: {
					key: e.key,
					createPath: e.formCustomCreatePath
				}
			}) : M.push({
				name: "QingJia",
				params: { id: e.id }
			});
		}
		return l(() => {
			j();
		}), (e, t) => (u(), i("div", h, [a("div", g, [a("div", _, [a("div", v, [(u(!0), i(n, null, f(A.value, (e, t) => (u(), i("div", {
			key: e.value,
			"h-40x": "",
			"lh-40px": "",
			"pl-10px": "",
			"mb-6px": "",
			class: c(["category", { selected: s.value === t }]),
			onClick: (e) => O(t)
		}, p(e.label), 11, y))), 128))]), a("div", {
			ref_key: "rightContainer",
			ref: D,
			"flex-1": "",
			"h-full": "",
			"border-0px": "",
			"border-l-1px": "",
			"border-solid": "",
			"border-gray-200": "",
			"p-12px": "",
			"overflow-y-auto": ""
		}, [(u(!0), i(n, null, f(k.value, (e, t) => (u(), i("div", {
			id: `category-${t}`,
			key: e.category,
			"mb-20px": ""
		}, [a("div", x, p(e.categoryName), 1), a("div", S, [(u(!0), i(n, null, f(e.items, (e) => (u(), i("div", {
			key: e.id,
			flex: "",
			"items-center": "",
			class: "bg-item",
			onClick: (t) => N(e)
		}, [a("span", w, p(e.name.substring(0, 1)), 1), o(" " + p(e.name), 1)], 8, C))), 128))])], 8, b))), 128))], 512)])])]));
	}
}), [["__scopeId", "data-v-091582b2"]]);
//#endregion
export { T as default };
