820 lines
31 KiB
JavaScript
820 lines
31 KiB
JavaScript
import {
|
|
require_jsx_dev_runtime
|
|
} from "/build/_shared/chunk-XGOTYLZ5.js";
|
|
import {
|
|
Link,
|
|
Links,
|
|
LiveReload,
|
|
Meta,
|
|
Outlet,
|
|
Scripts,
|
|
ScrollRestoration,
|
|
isRouteErrorResponse,
|
|
useLocation,
|
|
useMatches,
|
|
useRouteError
|
|
} from "/build/_shared/chunk-RG2SZ2V3.js";
|
|
import {
|
|
createHotContext
|
|
} from "/build/_shared/chunk-73ZPIOGA.js";
|
|
import "/build/_shared/chunk-UWV35TSL.js";
|
|
import "/build/_shared/chunk-U4FRFQSK.js";
|
|
import {
|
|
require_react
|
|
} from "/build/_shared/chunk-7M6SC7J5.js";
|
|
import {
|
|
__toESM
|
|
} from "/build/_shared/chunk-PNG5AS42.js";
|
|
|
|
// app/components/layout/Layout.tsx
|
|
var import_react4 = __toESM(require_react(), 1);
|
|
|
|
// app/components/layout/Sidebar.tsx
|
|
var import_react = __toESM(require_react(), 1);
|
|
var import_jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
|
|
console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
|
|
} else {
|
|
prevRefreshReg = window.$RefreshReg$;
|
|
prevRefreshSig = window.$RefreshSig$;
|
|
window.$RefreshReg$ = (type, id) => {
|
|
window.$RefreshRuntime$.register(type, '"app\\\\components\\\\layout\\\\Sidebar.tsx"' + id);
|
|
};
|
|
window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
|
|
}
|
|
var prevRefreshReg;
|
|
var prevRefreshSig;
|
|
var _s = $RefreshSig$();
|
|
if (import.meta) {
|
|
import.meta.hot = createHotContext(
|
|
//@ts-expect-error
|
|
"app\\components\\layout\\Sidebar.tsx"
|
|
);
|
|
import.meta.hot.lastModified = "1742953603315.5676";
|
|
}
|
|
function Sidebar({
|
|
onToggle,
|
|
collapsed
|
|
}) {
|
|
_s();
|
|
const location = useLocation();
|
|
const [expandedMenus, setExpandedMenus] = (0, import_react.useState)({});
|
|
const menuItems = [{
|
|
id: "home",
|
|
title: "\u9996\u9875",
|
|
path: "/",
|
|
icon: "ri-home-line"
|
|
}, {
|
|
id: "file-management",
|
|
title: "\u6587\u4EF6\u7BA1\u7406",
|
|
path: "/files",
|
|
icon: "ri-folder-line",
|
|
children: [{
|
|
id: "file-upload",
|
|
title: "\u6587\u4EF6\u4E0A\u4F20",
|
|
path: "/files/new",
|
|
icon: "ri-upload-cloud-line"
|
|
}, {
|
|
id: "file-list",
|
|
title: "\u6587\u4EF6\u5217\u8868",
|
|
path: "/files",
|
|
icon: "ri-file-list-3-line"
|
|
}]
|
|
}, {
|
|
id: "rule-management",
|
|
title: "\u8BC4\u67E5\u89C4\u5219\u5E93",
|
|
path: "/rules",
|
|
icon: "ri-book-3-line",
|
|
children: [
|
|
{
|
|
id: "rule-groups",
|
|
title: "\u8BC4\u67E5\u70B9\u5206\u7EC4",
|
|
path: "/rule-groups",
|
|
icon: "ri-folder-open-line"
|
|
},
|
|
{
|
|
id: "rule-list",
|
|
title: "\u8BC4\u67E5\u70B9\u5217\u8868",
|
|
path: "/rules",
|
|
icon: "ri-list-check-3"
|
|
}
|
|
// {
|
|
// id: 'rule-new',
|
|
// title: '新增评查点',
|
|
// path: '/rules/new',
|
|
// icon: 'ri-add-circle-line'
|
|
// }
|
|
]
|
|
}, {
|
|
id: "review-management",
|
|
title: "\u8BC4\u67E5\u7ED3\u679C",
|
|
path: "/reviews",
|
|
icon: "ri-bar-chart-box-line",
|
|
children: [{
|
|
id: "review-detail",
|
|
title: "\u8BC4\u67E5\u8BE6\u60C5",
|
|
path: "/reviews",
|
|
icon: "ri-file-chart-line"
|
|
}]
|
|
}, {
|
|
id: "system-settings",
|
|
title: "\u7CFB\u7EDF\u8BBE\u7F6E",
|
|
path: "/settings",
|
|
icon: "ri-settings-4-line",
|
|
children: [{
|
|
id: "basic-settings",
|
|
title: "\u57FA\u7840\u8BBE\u7F6E",
|
|
path: "/settings",
|
|
icon: "ri-equalizer-line"
|
|
}, {
|
|
id: "document-types",
|
|
title: "\u6587\u6863\u7C7B\u578B",
|
|
path: "/doc-types",
|
|
icon: "ri-file-list-line"
|
|
}, {
|
|
id: "prompt-management",
|
|
title: "\u63D0\u793A\u8BCD\u7BA1\u7406",
|
|
path: "/prompts",
|
|
icon: "ri-chat-1-line"
|
|
}]
|
|
}];
|
|
(0, import_react.useEffect)(() => {
|
|
const initialExpandedState = {};
|
|
menuItems.forEach((item) => {
|
|
if (item.children) {
|
|
initialExpandedState[item.id] = true;
|
|
}
|
|
});
|
|
setExpandedMenus(initialExpandedState);
|
|
}, []);
|
|
const toggleMenu = (id, e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
setExpandedMenus((prev) => ({
|
|
...prev,
|
|
[id]: !prev[id]
|
|
}));
|
|
};
|
|
const isActive = (path) => {
|
|
return location.pathname === path || location.pathname.startsWith(`${path}/`);
|
|
};
|
|
const handleToggleSidebar = (e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
onToggle();
|
|
};
|
|
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: `sidebar ${collapsed ? "collapsed" : ""}`, children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "py-6 px-4 border-b border-gray-100 flex justify-between items-center", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "flex items-center", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: "ri-file-search-line text-primary text-xl mr-2" }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 140,
|
|
columnNumber: 11
|
|
}, this),
|
|
!collapsed && /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("h2", { className: "text-lg font-medium", children: "AI\u5BA1\u6838\u7CFB\u7EDF" }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 141,
|
|
columnNumber: 26
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 139,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", { className: "sidebar-toggle", onClick: handleToggleSidebar, "aria-label": collapsed ? "\u5C55\u5F00\u4FA7\u8FB9\u680F" : "\u6298\u53E0\u4FA7\u8FB9\u680F", type: "button", children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `${collapsed ? "ri-menu-unfold-line" : "ri-menu-fold-line"}` }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 144,
|
|
columnNumber: 11
|
|
}, this) }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 143,
|
|
columnNumber: 9
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 138,
|
|
columnNumber: 7
|
|
}, this),
|
|
!collapsed && /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "user-profile p-4 border-b border-gray-100 flex items-center", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "avatar w-10 h-10 rounded-full bg-primary text-white flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { children: "\u7BA1" }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 150,
|
|
columnNumber: 13
|
|
}, this) }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 149,
|
|
columnNumber: 11
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "ml-3", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", { className: "text-sm font-medium", children: "\u7CFB\u7EDF\u7BA1\u7406\u5458" }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 153,
|
|
columnNumber: 13
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", { className: "text-xs text-gray-500", children: "\u8D85\u7EA7\u7BA1\u7406\u5458" }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 154,
|
|
columnNumber: 13
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 152,
|
|
columnNumber: 11
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 148,
|
|
columnNumber: 22
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "py-4 px-[10px]", children: menuItems.map((item) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: `${collapsed ? "px-0" : ""}`, children: !item.children ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Link, { to: item.path, className: `sidebar-menu-item ${isActive(item.path) ? "active" : ""} flex items-center ${collapsed ? "justify-center" : ""}`, children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `${item.icon} ${collapsed ? "text-xl" : "mr-3"}` }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 161,
|
|
columnNumber: 17
|
|
}, this),
|
|
!collapsed && /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { children: item.title }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 162,
|
|
columnNumber: 32
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 160,
|
|
columnNumber: 31
|
|
}, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: `sidebar-menu-item flex items-center ${collapsed ? "justify-center" : "justify-between"} cursor-pointer`, onClick: (e) => toggleMenu(item.id, e), role: "button", tabIndex: 0, "aria-expanded": expandedMenus[item.id] || false, "aria-controls": `submenu-${item.id}`, onKeyDown: (e) => {
|
|
if (e.key === "Enter" || e.key === " ") {
|
|
e.preventDefault();
|
|
toggleMenu(item.id, e);
|
|
}
|
|
}, children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "flex items-center", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `${item.icon} ${collapsed ? "text-xl" : "mr-3"}` }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 171,
|
|
columnNumber: 21
|
|
}, this),
|
|
!collapsed && /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { children: item.title }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 172,
|
|
columnNumber: 36
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 170,
|
|
columnNumber: 19
|
|
}, this),
|
|
!collapsed && /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `ri-arrow-${expandedMenus[item.id] ? "down" : "right"}-s-line` }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 174,
|
|
columnNumber: 34
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 164,
|
|
columnNumber: 17
|
|
}, this),
|
|
(expandedMenus[item.id] || collapsed) && /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: `${collapsed ? "border-l-0 pl-0" : "border-l border-gray-100 ml-4 pl-3"}`, id: `submenu-${item.id}`, children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Link, { to: child.path, className: `sidebar-menu-item ${isActive(child.path) ? "active" : ""} flex items-center ${collapsed ? "justify-center" : ""}`, children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `${child.icon} ${collapsed ? "text-xl" : "mr-3"}` }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 179,
|
|
columnNumber: 25
|
|
}, this),
|
|
!collapsed && /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { children: child.title }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 180,
|
|
columnNumber: 40
|
|
}, this)
|
|
] }, child.id, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 178,
|
|
columnNumber: 49
|
|
}, this)) }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 177,
|
|
columnNumber: 59
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 163,
|
|
columnNumber: 25
|
|
}, this) }, item.id, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 159,
|
|
columnNumber: 32
|
|
}, this)) }, void 0, false, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 158,
|
|
columnNumber: 7
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Sidebar.tsx",
|
|
lineNumber: 137,
|
|
columnNumber: 10
|
|
}, this);
|
|
}
|
|
_s(Sidebar, "+oq+XysjOmJdl7XaTxZwHB59ajw=", false, function() {
|
|
return [useLocation];
|
|
});
|
|
_c = Sidebar;
|
|
var _c;
|
|
$RefreshReg$(_c, "Sidebar");
|
|
window.$RefreshReg$ = prevRefreshReg;
|
|
window.$RefreshSig$ = prevRefreshSig;
|
|
|
|
// app/components/layout/Breadcrumb.tsx
|
|
var import_jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
|
|
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
|
|
console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
|
|
} else {
|
|
prevRefreshReg = window.$RefreshReg$;
|
|
prevRefreshSig = window.$RefreshSig$;
|
|
window.$RefreshReg$ = (type, id) => {
|
|
window.$RefreshRuntime$.register(type, '"app\\\\components\\\\layout\\\\Breadcrumb.tsx"' + id);
|
|
};
|
|
window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
|
|
}
|
|
var prevRefreshReg;
|
|
var prevRefreshSig;
|
|
var _s2 = $RefreshSig$();
|
|
if (import.meta) {
|
|
import.meta.hot = createHotContext(
|
|
//@ts-expect-error
|
|
"app\\components\\layout\\Breadcrumb.tsx"
|
|
);
|
|
import.meta.hot.lastModified = "1742888377198.358";
|
|
}
|
|
function Breadcrumb({
|
|
items = [],
|
|
className = ""
|
|
}) {
|
|
_s2();
|
|
const matches = useMatches();
|
|
const breadcrumbs = items.length > 0 ? items : matches.filter((match) => match.handle?.breadcrumb).map((match) => ({
|
|
title: typeof match.handle?.breadcrumb === "function" ? match.handle.breadcrumb(match.data) : match.handle?.breadcrumb,
|
|
to: match.pathname
|
|
}));
|
|
if (breadcrumbs.length === 0) {
|
|
return null;
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("nav", { className: `mb-4 ${className}`, "aria-label": "\u9762\u5305\u5C51\u5BFC\u822A", children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("ol", { className: "flex items-center space-x-2 text-sm text-gray-500", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("li", { children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Link, { to: "/", className: "hover:text-primary-600 flex items-center", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("i", { className: "ri-home-line mr-1" }, void 0, false, {
|
|
fileName: "app/components/layout/Breadcrumb.tsx",
|
|
lineNumber: 40,
|
|
columnNumber: 13
|
|
}, this),
|
|
"\u9996\u9875"
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Breadcrumb.tsx",
|
|
lineNumber: 39,
|
|
columnNumber: 11
|
|
}, this) }, void 0, false, {
|
|
fileName: "app/components/layout/Breadcrumb.tsx",
|
|
lineNumber: 38,
|
|
columnNumber: 9
|
|
}, this),
|
|
breadcrumbs.map((item, index) => /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("li", { className: "flex items-center", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("i", { className: "ri-arrow-right-s-line mx-1 text-gray-400" }, void 0, false, {
|
|
fileName: "app/components/layout/Breadcrumb.tsx",
|
|
lineNumber: 46,
|
|
columnNumber: 13
|
|
}, this),
|
|
index === breadcrumbs.length - 1 ? /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("span", { className: "text-gray-900 font-medium", children: item.title }, void 0, false, {
|
|
fileName: "app/components/layout/Breadcrumb.tsx",
|
|
lineNumber: 47,
|
|
columnNumber: 49
|
|
}, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Link, { to: item.to || "#", className: "hover:text-primary-600", children: item.title }, void 0, false, {
|
|
fileName: "app/components/layout/Breadcrumb.tsx",
|
|
lineNumber: 47,
|
|
columnNumber: 115
|
|
}, this)
|
|
] }, index, true, {
|
|
fileName: "app/components/layout/Breadcrumb.tsx",
|
|
lineNumber: 45,
|
|
columnNumber: 43
|
|
}, this))
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Breadcrumb.tsx",
|
|
lineNumber: 37,
|
|
columnNumber: 7
|
|
}, this) }, void 0, false, {
|
|
fileName: "app/components/layout/Breadcrumb.tsx",
|
|
lineNumber: 36,
|
|
columnNumber: 10
|
|
}, this);
|
|
}
|
|
_s2(Breadcrumb, "46X5kjpIrhuIfMTCQ4hKaOh18WA=", false, function() {
|
|
return [useMatches];
|
|
});
|
|
_c2 = Breadcrumb;
|
|
var _c2;
|
|
$RefreshReg$(_c2, "Breadcrumb");
|
|
window.$RefreshReg$ = prevRefreshReg;
|
|
window.$RefreshSig$ = prevRefreshSig;
|
|
|
|
// app/components/layout/Layout.tsx
|
|
var import_jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
|
|
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
|
|
console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
|
|
} else {
|
|
prevRefreshReg = window.$RefreshReg$;
|
|
prevRefreshSig = window.$RefreshSig$;
|
|
window.$RefreshReg$ = (type, id) => {
|
|
window.$RefreshRuntime$.register(type, '"app\\\\components\\\\layout\\\\Layout.tsx"' + id);
|
|
};
|
|
window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
|
|
}
|
|
var prevRefreshReg;
|
|
var prevRefreshSig;
|
|
var _s3 = $RefreshSig$();
|
|
if (import.meta) {
|
|
import.meta.hot = createHotContext(
|
|
//@ts-expect-error
|
|
"app\\components\\layout\\Layout.tsx"
|
|
);
|
|
import.meta.hot.lastModified = "1742899676467.7688";
|
|
}
|
|
function Layout({
|
|
children
|
|
}) {
|
|
_s3();
|
|
const [sidebarCollapsed, setSidebarCollapsed] = (0, import_react4.useState)(false);
|
|
(0, import_react4.useEffect)(() => {
|
|
const savedState = localStorage.getItem("sidebarCollapsed");
|
|
if (savedState) {
|
|
setSidebarCollapsed(savedState === "true");
|
|
}
|
|
}, []);
|
|
const toggleSidebar = () => {
|
|
const newState = !sidebarCollapsed;
|
|
setSidebarCollapsed(newState);
|
|
localStorage.setItem("sidebarCollapsed", String(newState));
|
|
};
|
|
return /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("div", { className: "layout-container", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)(Sidebar, { collapsed: sidebarCollapsed, onToggle: toggleSidebar }, void 0, false, {
|
|
fileName: "app/components/layout/Layout.tsx",
|
|
lineNumber: 44,
|
|
columnNumber: 7
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("div", { className: `main-content ${sidebarCollapsed ? "sidebar-collapsed" : ""}`, children: /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("div", { className: "content-container", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)(Breadcrumb, { className: "px-6 pt-4" }, void 0, false, {
|
|
fileName: "app/components/layout/Layout.tsx",
|
|
lineNumber: 49,
|
|
columnNumber: 11
|
|
}, this),
|
|
children
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Layout.tsx",
|
|
lineNumber: 48,
|
|
columnNumber: 9
|
|
}, this) }, void 0, false, {
|
|
fileName: "app/components/layout/Layout.tsx",
|
|
lineNumber: 46,
|
|
columnNumber: 7
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/layout/Layout.tsx",
|
|
lineNumber: 43,
|
|
columnNumber: 10
|
|
}, this);
|
|
}
|
|
_s3(Layout, "FxVX3h52uwQ1gyRn5YTJikmiifg=");
|
|
_c3 = Layout;
|
|
var _c3;
|
|
$RefreshReg$(_c3, "Layout");
|
|
window.$RefreshReg$ = prevRefreshReg;
|
|
window.$RefreshSig$ = prevRefreshSig;
|
|
|
|
// app/components/error/ErrorBoundary.tsx
|
|
var import_jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
|
|
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
|
|
console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
|
|
} else {
|
|
prevRefreshReg = window.$RefreshReg$;
|
|
prevRefreshSig = window.$RefreshSig$;
|
|
window.$RefreshReg$ = (type, id) => {
|
|
window.$RefreshRuntime$.register(type, '"app\\\\components\\\\error\\\\ErrorBoundary.tsx"' + id);
|
|
};
|
|
window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
|
|
}
|
|
var prevRefreshReg;
|
|
var prevRefreshSig;
|
|
if (import.meta) {
|
|
import.meta.hot = createHotContext(
|
|
//@ts-expect-error
|
|
"app\\components\\error\\ErrorBoundary.tsx"
|
|
);
|
|
import.meta.hot.lastModified = "1742800194231.6147";
|
|
}
|
|
function ErrorBoundary({
|
|
status,
|
|
statusText,
|
|
message
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)("div", { className: "min-h-screen flex flex-col items-center justify-center bg-gray-50 px-4", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)("div", { className: "text-center", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)("h1", { className: "text-6xl font-bold text-primary mb-4", children: status }, void 0, false, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 30,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)("p", { className: "text-xl font-medium text-gray-800 mb-6", children: statusText }, void 0, false, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 31,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)("p", { className: "text-base text-gray-600 mb-8", children: message }, void 0, false, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 32,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(Link, { to: "/", className: "ant-btn ant-btn-primary", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)("i", { className: "ri-home-line mr-1" }, void 0, false, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 34,
|
|
columnNumber: 11
|
|
}, this),
|
|
" \u8FD4\u56DE\u9996\u9875"
|
|
] }, void 0, true, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 33,
|
|
columnNumber: 9
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 29,
|
|
columnNumber: 7
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)("div", { className: "mt-12 text-center", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)("p", { className: "text-sm text-gray-500", children: "\u5982\u679C\u95EE\u9898\u6301\u7EED\u5B58\u5728\uFF0C\u8BF7\u8054\u7CFB\u7CFB\u7EDF\u7BA1\u7406\u5458" }, void 0, false, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 38,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)("p", { className: "text-sm text-gray-500 mt-1", children: "\u6280\u672F\u652F\u6301\uFF1Asupport@tobacco-ai-system.com" }, void 0, false, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 39,
|
|
columnNumber: 9
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 37,
|
|
columnNumber: 7
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/components/error/ErrorBoundary.tsx",
|
|
lineNumber: 28,
|
|
columnNumber: 10
|
|
}, this);
|
|
}
|
|
_c4 = ErrorBoundary;
|
|
var _c4;
|
|
$RefreshReg$(_c4, "ErrorBoundary");
|
|
window.$RefreshReg$ = prevRefreshReg;
|
|
window.$RefreshSig$ = prevRefreshSig;
|
|
|
|
// app/root.tsx
|
|
var import_jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
|
|
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
|
|
console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
|
|
} else {
|
|
prevRefreshReg = window.$RefreshReg$;
|
|
prevRefreshSig = window.$RefreshSig$;
|
|
window.$RefreshReg$ = (type, id) => {
|
|
window.$RefreshRuntime$.register(type, '"app\\\\root.tsx"' + id);
|
|
};
|
|
window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
|
|
}
|
|
var prevRefreshReg;
|
|
var prevRefreshSig;
|
|
var _s4 = $RefreshSig$();
|
|
if (import.meta) {
|
|
import.meta.hot = createHotContext(
|
|
//@ts-expect-error
|
|
"app\\root.tsx"
|
|
);
|
|
}
|
|
var meta = () => {
|
|
return [
|
|
{
|
|
charSet: "utf-8"
|
|
},
|
|
{
|
|
name: "viewport",
|
|
content: "width=device-width,initial-scale=1"
|
|
},
|
|
{
|
|
title: "\u4E2D\u56FD\u70DF\u8349AI\u5408\u540C\u53CA\u5377\u5B97\u5BA1\u6838\u7CFB\u7EDF"
|
|
},
|
|
{
|
|
name: "description",
|
|
content: "\u4E13\u4E1A\u7684AI\u5408\u540C\u53CA\u5377\u5B97\u8BC4\u67E5\u7CFB\u7EDF\uFF0C\u63D0\u4F9B\u667A\u80FD\u5BA1\u6838\u3001\u98CE\u9669\u8BC4\u4F30\u548C\u89C4\u8303\u5316\u5EFA\u8BAE"
|
|
},
|
|
{
|
|
name: "robots",
|
|
content: "noindex,nofollow"
|
|
}
|
|
// 内部系统,防止被搜索引擎索引
|
|
];
|
|
};
|
|
function links() {
|
|
return [
|
|
{
|
|
rel: "stylesheet",
|
|
href: "/tailwind.css"
|
|
},
|
|
// 使用构建后的Tailwind CSS
|
|
{
|
|
rel: "preconnect",
|
|
href: "https://fonts.googleapis.com"
|
|
},
|
|
{
|
|
rel: "preconnect",
|
|
href: "https://fonts.gstatic.com",
|
|
crossOrigin: "anonymous"
|
|
},
|
|
{
|
|
rel: "stylesheet",
|
|
href: "https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap"
|
|
}
|
|
];
|
|
}
|
|
function App() {
|
|
return /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("html", { lang: "zh-CN", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("head", { children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("meta", { charSet: "utf-8" }, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 79,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("meta", { name: "viewport", content: "width=device-width,initial-scale=1" }, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 80,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Meta, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 81,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Links, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 82,
|
|
columnNumber: 9
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 78,
|
|
columnNumber: 7
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("body", { className: "font-sans", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Layout, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Outlet, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 86,
|
|
columnNumber: 11
|
|
}, this) }, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 85,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(ScrollRestoration, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 88,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Scripts, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 89,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(LiveReload, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 90,
|
|
columnNumber: 9
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 84,
|
|
columnNumber: 7
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 77,
|
|
columnNumber: 10
|
|
}, this);
|
|
}
|
|
_c5 = App;
|
|
function ErrorBoundary2() {
|
|
_s4();
|
|
const error = useRouteError();
|
|
if (isRouteErrorResponse(error)) {
|
|
return /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("html", { lang: "zh-CN", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("head", { children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Meta, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 101,
|
|
columnNumber: 11
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Links, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 102,
|
|
columnNumber: 11
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("title", { children: [
|
|
"\u9519\u8BEF ",
|
|
error.status
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 103,
|
|
columnNumber: 11
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 100,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("body", { children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(ErrorBoundary, { status: error.status, statusText: error.statusText, message: error.data?.message || "\u53D1\u751F\u4E86\u4E00\u4E2A\u9519\u8BEF\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5" }, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 106,
|
|
columnNumber: 11
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Scripts, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 108,
|
|
columnNumber: 11
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 105,
|
|
columnNumber: 9
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 99,
|
|
columnNumber: 12
|
|
}, this);
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("html", { lang: "zh-CN", children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("head", { children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Meta, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 114,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Links, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 115,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("title", { children: "\u610F\u5916\u9519\u8BEF" }, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 116,
|
|
columnNumber: 9
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 113,
|
|
columnNumber: 7
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("body", { children: [
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(ErrorBoundary, { status: 500, statusText: "\u670D\u52A1\u5668\u9519\u8BEF", message: "\u670D\u52A1\u5668\u53D1\u751F\u4E86\u610F\u5916\u9519\u8BEF\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5" }, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 119,
|
|
columnNumber: 9
|
|
}, this),
|
|
/* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Scripts, {}, void 0, false, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 121,
|
|
columnNumber: 9
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 118,
|
|
columnNumber: 7
|
|
}, this)
|
|
] }, void 0, true, {
|
|
fileName: "app/root.tsx",
|
|
lineNumber: 112,
|
|
columnNumber: 10
|
|
}, this);
|
|
}
|
|
_s4(ErrorBoundary2, "oAgjgbJzsRXlB89+MoVumxMQqKM=", false, function() {
|
|
return [useRouteError];
|
|
});
|
|
_c22 = ErrorBoundary2;
|
|
var _c5;
|
|
var _c22;
|
|
$RefreshReg$(_c5, "App");
|
|
$RefreshReg$(_c22, "ErrorBoundary");
|
|
window.$RefreshReg$ = prevRefreshReg;
|
|
window.$RefreshSig$ = prevRefreshSig;
|
|
export {
|
|
ErrorBoundary2 as ErrorBoundary,
|
|
App as default,
|
|
links,
|
|
meta
|
|
};
|
|
//# sourceMappingURL=/build/root-VWXSPXQP.js.map
|