import { resolveComponent as k, openBlock as T, createElementBlock as j, createElementVNode as p, createTextVNode as h, toDisplayString as g, createVNode as y, withCtx as v } from "vue";
import { n as $ } from "./index2.js";
const f = (t = "") => String(t).replace(/&/g, "&").replace(//g, ">"), I = (t = "") => String(t).replace(/[^\w\u4e00-\u9fa5-]/g, ""), c = (t = "") => {
const n = [], i = [];
let e = String(t);
return e = e.replace(/`([^`]+)`/g, (r, o) => (n.push(`${f(o)}`), `\0C${n.length - 1}\0`)), e = e.replace(/<\/?span[^>]*>/g, (r) => (i.push(r), `\0S${i.length - 1}\0`)), e = f(e), e = e.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '$1'), e = e.replace(/\*\*([^*]+)\*\*/g, "$1"), e = e.replace(/\u0000C(\d+)\u0000/g, (r, o) => n[+o]), e = e.replace(/\u0000S(\d+)\u0000/g, (r, o) => i[+o]), e;
}, w = (t = "") => t.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((n) => n.trim()), C = (t = "") => /^\s*\|?[\s:|-]+\|?\s*$/.test(t) && t.includes("-"), S = (t = "") => {
const n = String(t).replace(/\r\n/g, `
`).split(`
`), i = n.length;
let e = 0, r = "", o = null;
const s = () => {
o && (r += `${o}>
`, o = null);
};
for (; e < i; ) {
const a = n[e], b = a.match(/^```(\w*)\s*$/);
if (b) {
s();
const l = b[1];
e++;
const d = [];
for (; e < i && !/^```\s*$/.test(n[e]); )
d.push(n[e]), e++;
e++, r += `
${f(d.join(`
`))}
`;
continue;
}
if (/^\s*$/.test(a)) {
s(), e++;
continue;
}
if (/^-{3,}\s*$/.test(a)) {
s(), r += `
`, e++;
continue;
}
const u = a.match(/^(#{1,6})\s+(.*)$/);
if (u) {
s();
const l = u[1].length, d = u[2].trim();
r += `${c(d)}
`, e++;
continue;
}
if (/^>\s?/.test(a)) {
s();
const l = [];
for (; e < i && /^>\s?/.test(n[e]); )
l.push(n[e].replace(/^>\s?/, "")), e++;
r += `${S(l.join(`
`))}
`;
continue;
}
if (/^\s*\|/.test(a) && e + 1 < i && C(n[e + 1])) {
s();
const l = w(a);
e += 2;
const d = [];
for (; e < i && /^\s*\|/.test(n[e]); )
d.push(w(n[e])), e++;
r += "" + l.map((m) => `| ${c(m)} | `).join("") + "
" + d.map((m) => "" + m.map((x) => `| ${c(x)} | `).join("") + "
").join("") + `
`;
continue;
}
if (/^\s*[-*]\s+/.test(a)) {
o !== "ul" && (s(), r += `
`, o = "ul"), r += `- ${c(a.replace(/^\s*[-*]\s+/, ""))}
`, e++;
continue;
}
if (/^\s*\d+\.\s+/.test(a)) {
o !== "ol" && (s(), r += `
`, o = "ol"), r += `- ${c(a.replace(/^\s*\d+\.\s+/, ""))}
`, e++;
continue;
}
s(), r += `${c(a.trim())}
`, e++;
}
return s(), r;
}, _ = "# sapit-ui 基座说明与业务使用文档\r\n\r\n> 适用工程:sapit-ui-framework(基座/源码)、sapit-ui-plus(发布产物)、sapit-base-template(业务示例)\r\n>\r\n> 本文档也是基座内置文档页 `/docs` 与组件页 `/components` 的数据源。\r\n\r\n---\r\n\r\n## 目录\r\n\r\n- [一、总览](#一总览)\r\n- [二、基座提供的内容](#二基座提供的内容)\r\n- [三、布局与高度规范](#三布局与高度规范)\r\n- [四、构建与配置](#四构建与配置)\r\n- [五、业务项目接入](#五业务项目接入)\r\n- [六、注意事项](#六注意事项)\r\n- [七、常见全局方法速查](#七常见全局方法速查)\r\n- [八、在线文档入口](#八在线文档入口)\r\n\r\n---\r\n\r\n## 一、总览\r\n\r\n### 1.1 五者关系\r\n\r\n| 工程 | 角色 | 说明 |\r\n| --------------------- | ----------------------------------------------- | ----------------------------------------------------------------- |\r\n| `sapit-ui-framework` | 基座(源码) | 内置组件与常用依赖的库工程,Vite lib 模式打包 |\r\n| `sapit-ui-plus` | 发布产物 | 基座 `dist` 推送后的 git 仓库(`lib/`、`docs/`、`vite-plugins/`) |\r\n| `sapit-base-template` | 业务使用者 | 以 `sapit-ui-plus` git 依赖为底层,编写业务页面/配置 |\r\n\r\n```text\r\nsapit-ui-framework --(npm run build)--> dist/lib --(git push)--> sapit-ui-plus(git) --> sapit-base-template\r\n```\r\n\r\n### 1.2 目录结构(基座)\r\n\r\n```text\r\nsapit-ui-framework/\r\n├─ packages/ # 发布内容来源(入口依赖图)\r\n│ ├─ index.js # 库入口,导出 registerGlobalConfig\r\n│ ├─ components/ # 内置组件 S*\r\n│ ├─ layouts/ # BasicLayout / BlankLayout / UserLayout / RouteView / PageView\r\n│ ├─ router/ # 常量路由 + 动态路由 + 静态路由 + 守卫\r\n│ ├─ store/ api/ utils/ locales/ static/ style/\r\n│ └─ pages-components/ # 登录、工作台、待办、消息、404/403/500、docs 文档页\r\n├─ docs/ # 本文档(供内置 /docs 渲染)\r\n├─ vite-plugins/ # docs-viewer 插件\r\n├─ src/ # 基座自身调试壳\r\n└─ vite.config.js / package.json\r\n```\r\n\r\n---\r\n\r\n## 二、基座提供的内容\r\n\r\n### 2.1 全局组件\r\n\r\n`packages/index.js` 用 `import.meta.glob('./components/**/*.vue')` 把 `components/**/*.vue` **按文件名全局注册**,模板直接以文件名标签使用(如 ``、``)。\r\n\r\n| 分类 | 组件 |\r\n| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| 布局类 | `SSkeletonLayout`(骨架布局:标题 + 按钮组 + 内容区,见 2.16)、`SListLayout`、`SListCardLayout`、`SListTableTreeLayout`、`SSuperListLayout`、`SFormLayout`、`SPanelLayout`、`SCollapses`/`SCollapsesItem`、`SDrawer` |\r\n| 弹层类 | `SModal`、`SModalTemplate`、`ModalHeader`、`SIconModal`、`SImportModal`(批量导入,见 2.11) |\r\n| 表单/筛选 | `SForm`、`SFormItem`、`SExtendFieldsForm`/`SExtendFieldsFormItem`(动态扩展字段)、`SFilterWrap`、`SFilterItem`、`SCascader`、`STree`、`STreeSelect`、`SDataRangeTreeSelect`(数据权限范围树)、`SUserSelect`、`SUserSelectButton`、`SChooseUser`(带数据权限选人弹窗,见 2.14)、`SBelowChoosePosition`(选岗位弹窗,见 2.15)、`SOfficeSelect`、`SIconSelect`(图标选择) |\r\n| 上传类 | `SFileUpload`、`SDraggerUpload`、`SCopperUpload`、`CropperModal` |\r\n| 展示/其它 | `SEditor`、`SEmpty`、`SIcon`、`SSvg`、`SAnchor`、`SColorPicker`、`SToggleLanguage`、`SettingFilter`、`SettingColumns`、`SSideMenu`/`STopMenu` |\r\n\r\n> 组件用法见内置组件页 **`/components`**(含「s组件」「工具/配置」两个标签页;「工具/配置」列出 web-config 全部配置项与 `$utils` 全部方法)。\r\n>\r\n> 注册规则:`components/**/*.vue` 按**文件名**全局注册(`SForm.vue` → ``,**不是 kebab-case**),冲突后者覆盖。\r\n> `Table/index.jsx` 是 `.jsx`、`import.meta.glob` 匹配不到,基座在`packages/index.js` 里**单独注册为全局 `STable`**(`` 可直接用,无需 import)。\r\n> `@ant-design/icons-vue` 图标全部全局注册并挂到 `$icons`。\r\n> 另有内部辅助组件不对外使用:`ModalHeader`(SModal)、`CropperModal`(SCopperUpload)、`CustomInput`/`SettingColumns`/`SettingFilter`(SSuperListLayout)。\r\n\r\n### 2.1.1 布局组件选择\r\n\r\n| 场景 | 用哪个 |\r\n| ------------------------- | -------------------------------------------------------------------------------------------- |\r\n| 标题 + 按钮 + 自定义内容(无表格/分页/表单) | `SSkeletonLayout`(见 2.16,自带标题条与权限按钮) |\r\n| 普通列表页 | `SListLayout` |\r\n| 卡片列表 | `SListCardLayout` |\r\n| 列表 + 左侧树 | `SListTableTreeLayout`(左侧树容器类名必须是 `.side.s-side-tree`,见 3.5) |\r\n| 带高级搜索/高级表格的列表 | `SSuperListLayout` |\r\n| 新增/编辑/详情(路由式) | `SFormLayout`(`#form` 插槽放 `SForm`,`#footer-callback` 收 `save`/`cancel`/`prev`/`next`) |\r\n| 表单作为弹窗内容 | `SModal`(不要套 `SFormLayout`) |\r\n| 后端下发字段的动态表单 | `SExtendFieldsForm`(`data` + `defaultValue`,ref 调 `validate/clearValidate/getModel`) |\r\n| 数据权限范围选择 | `SDataRangeTreeSelect`(`autoSysConfig` 托管系统 `dataScope` 配置) |\r\n\r\n### 2.2 全局属性 / 方法\r\n\r\n`$registerGlobalConfig` 执行后可用(`this.$xxx` / 模板 `$xxx` / `window.$xxx`):\r\n\r\n| 名称 | 说明 |\r\n| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |\r\n| `$registerGlobalConfig(config, pages)` | 初始化入口(见 5.2) |\r\n| `$utils` | 工具类集合:`$utils.env` / `$utils.ls` / `$utils.http` 及通用方法 |\r\n| `env` | 合并后的环境配置(= `$utils.env`) |\r\n| `$i18n` / `$l(name, key)` | 国际化(见 2.7)。挂在 `globalProperties` 上:**模板里直接用** `$l('xx')`;`