diry 1 month ago
parent
commit
666c5ec9e1
6 changed files with 398 additions and 50 deletions
  1. 1 1
      lib/config.json
  2. 0 0
      lib/css/style.css
  3. 339 0
      lib/js/components-doc.js
  4. 48 49
      lib/js/docs.js
  5. 0 0
      lib/js/index.js
  6. 10 0
      lib/js/index2.js

+ 1 - 1
lib/config.json

@@ -1 +1 @@
-{"_hash":1789887088908,"VITE_APP_PROJECT_NAME":"前端项目架构","VITE_APP_VERSION":"v1.0","VITE_APP_JSS_LICENSE":"","VITE_APP_TITLE":"平台","VITE_APP_BASE_URL":"/","VITE_APP_FOOTER_VISIBLE":false,"VITE_APP_LANG_ENABLE":false,"VITE_APP_LANG":"zh","VITE_APP_API_PATH":"/apig","VITE_APP_SYS_SERVER_NAME":"monitor","VITE_APP_MESSAGE_SERVER_NAME":"message","VITE_APP_PORTAL_SERVER_NAME":"portal","VITE_APP_FLOW_SERVER_NAME":"flow","VITE_APP_CLIENT_ID":"mm0001","VITE_APP_PREVIEW_ONLINE":"/filePreview/onlinePreview?url=","VITE_APP_WEB_SITE":"https://sapit.com.cn/#/home","VITE_APP_LOGIN_CASE_NAME":"辽ICP备14008719号-2","VITE_APP_BASE_CASE_NAME":"辽ICP备14008719号-2","VITE_APP_SOCKET_URL":"/","VITE_CONFIG_MODE":false,"VITE_APP_API_BASE_URL":"http://192.168.200.6:7022","VITE_APP_API_FILE_URL":"/","VITE_APP_MENU_THEME":"dark","VITE_APP_MENU_BAR":"left","VITE_APP_LOGIN_PATH_THEME":"3","VITE_APP_THEME_VALUE":"blue","VITE_APP_THEME":{"blue":{"name":"blue","color":"#1677FF","lightColor":"\t#6495ED","darkColor":"#00008B","borderColor":"#B0C4DE","bgColor":"#f0f2f5"},"green":{"name":"green","color":"#00b96b","lightColor":"#90EE90","darkColor":"#3CB371","borderColor":"#98FB98","bgColor":"#F0FFF0"},"orange":{"name":"orange","color":"#FFA500","lightColor":"\t#FFE4B5","darkColor":"#FF8C00","borderColor":"#FFDEAD","bgColor":"#FFEFD5"}},"VITE_APP_LOGIN_PATH":"/login","VITE_APP_DEFAULT_PATH":"/workplace/index","VITE_USER_NODE_ENV":"production"}
+{"_hash":1789888830563,"VITE_APP_PROJECT_NAME":"前端项目架构","VITE_APP_VERSION":"v1.0","VITE_APP_JSS_LICENSE":"","VITE_APP_TITLE":"平台","VITE_APP_BASE_URL":"/","VITE_APP_FOOTER_VISIBLE":false,"VITE_APP_LANG_ENABLE":false,"VITE_APP_LANG":"zh","VITE_APP_API_PATH":"/apig","VITE_APP_SYS_SERVER_NAME":"monitor","VITE_APP_MESSAGE_SERVER_NAME":"message","VITE_APP_PORTAL_SERVER_NAME":"portal","VITE_APP_FLOW_SERVER_NAME":"flow","VITE_APP_CLIENT_ID":"mm0001","VITE_APP_PREVIEW_ONLINE":"/filePreview/onlinePreview?url=","VITE_APP_WEB_SITE":"https://sapit.com.cn/#/home","VITE_APP_LOGIN_CASE_NAME":"辽ICP备14008719号-2","VITE_APP_BASE_CASE_NAME":"辽ICP备14008719号-2","VITE_APP_SOCKET_URL":"/","VITE_CONFIG_MODE":false,"VITE_APP_API_BASE_URL":"http://192.168.200.6:7022","VITE_APP_API_FILE_URL":"/","VITE_APP_MENU_THEME":"dark","VITE_APP_MENU_BAR":"left","VITE_APP_LOGIN_PATH_THEME":"3","VITE_APP_THEME_VALUE":"blue","VITE_APP_THEME":{"blue":{"name":"blue","color":"#1677FF","lightColor":"\t#6495ED","darkColor":"#00008B","borderColor":"#B0C4DE","bgColor":"#f0f2f5"},"green":{"name":"green","color":"#00b96b","lightColor":"#90EE90","darkColor":"#3CB371","borderColor":"#98FB98","bgColor":"#F0FFF0"},"orange":{"name":"orange","color":"#FFA500","lightColor":"\t#FFE4B5","darkColor":"#FF8C00","borderColor":"#FFDEAD","bgColor":"#FFEFD5"}},"VITE_APP_LOGIN_PATH":"/login","VITE_APP_DEFAULT_PATH":"/workplace/index","VITE_USER_NODE_ENV":"production"}

File diff suppressed because it is too large
+ 0 - 0
lib/css/style.css


+ 339 - 0
lib/js/components-doc.js

@@ -0,0 +1,339 @@
+import { resolveComponent as v, createElementBlock as i, openBlock as d, createElementVNode as e, createTextVNode as n, createVNode as m, withCtx as u, Fragment as p, renderList as y, normalizeClass as h, toDisplayString as o, withDirectives as g, vShow as k } from "vue";
+import { k as f } from "./index2.js";
+const C = {
+  name: "ComponentsDoc",
+  data() {
+    return {
+      activeKey: "",
+      shown: {},
+      list: [
+        {
+          key: "s-modal",
+          name: "SModal",
+          title: "SModal 弹窗",
+          desc: "通用模态框,支持全屏、自定义底部等。",
+          code: `<s-modal v-model:value="visible" title="标题" width="800px" @handCancel="onCancel">
+  <div>弹窗内容</div>
+</s-modal>`
+        },
+        {
+          key: "s-modal-template",
+          name: "SModalTemplate",
+          title: "SModalTemplate 列表弹窗",
+          desc: "带列表/分页的弹窗模板,常用于选择类弹窗。",
+          code: `<s-modal-template
+  v-model:value="visible"
+  title="选择"
+  :columns="columns"
+  :loadData="page"
+  @select="onSelect"
+/>`
+        },
+        {
+          key: "s-list-layout",
+          name: "SListLayout",
+          title: "SListLayout 列表布局",
+          desc: "列表页标准布局:标题、按钮、筛选区、表格、分页。",
+          code: `<s-list-layout
+  title="基础列表"
+  :columns="columns"
+  :buttons="buttons"
+  :loadData="page"
+  @btnCallback="btnCallback"
+>
+  <template #filter>
+    <s-filter-wrap>
+      <s-filter-item label="名称">
+        <a-input v-model:value="params.name" />
+      </s-filter-item>
+    </s-filter-wrap>
+  </template>
+</s-list-layout>`
+        },
+        {
+          key: "s-list-card-layout",
+          name: "SListCardLayout",
+          title: "SListCardLayout 卡片列表",
+          desc: "卡片形式的列表布局。",
+          code: '<s-list-card-layout :columns="columns" :loadData="page" title="卡片列表" />'
+        },
+        {
+          key: "s-list-table-tree-layout",
+          name: "SListTableTreeLayout",
+          title: "SListTableTreeLayout 树表布局",
+          desc: "左树右表的列表布局。",
+          code: `<s-list-table-tree-layout :columns="columns" :loadData="page" title="树表">
+  <template #tree>
+    <s-tree v-model:select="treeValue" :levelOneChildren="load" />
+  </template>
+</s-list-table-tree-layout>`
+        },
+        {
+          key: "s-super-list-layout",
+          name: "SSuperListLayout",
+          title: "SSuperListLayout 高级列表",
+          desc: "支持高级搜索、列设置的高级列表布局。",
+          code: '<s-super-list-layout :columns="columns" :loadData="page" />'
+        },
+        {
+          key: "s-tree",
+          name: "STree",
+          title: "STree 树",
+          desc: "左侧树,支持一/二级异步加载。",
+          code: `<s-tree
+  v-model:select="treeValue"
+  :levelOneChildren="levelOneChildren"
+  :levelTwoChildren="levelTwoChildren"
+  @select:modelValue="handSelect"
+/>`
+        },
+        {
+          key: "s-tree-select",
+          name: "STreeSelect",
+          title: "STreeSelect 树选择",
+          desc: "树形下拉选择,支持搜索高亮、多选。",
+          code: `<s-tree-select
+  v-model:value="value"
+  :recursionChildren="loadChildren"
+  :multiple="false"
+/>`
+        },
+        {
+          key: "s-cascader",
+          name: "SCascader",
+          title: "SCascader 级联选择",
+          desc: "级联选择器。",
+          code: '<s-cascader v-model:value="value" :options="options" />'
+        },
+        {
+          key: "s-user-select",
+          name: "SUserSelect",
+          title: "SUserSelect 人员选择",
+          desc: "人员选择弹窗,返回选中人员。",
+          code: '<s-user-select v-model:value="ids" @change="onChange" />'
+        },
+        {
+          key: "s-office-select",
+          name: "SOfficeSelect",
+          title: "SOfficeSelect 岗位/组织选择",
+          desc: "岗位/组织选择弹窗。",
+          code: '<s-office-select v-model:value="ids" @change="onChange" />'
+        },
+        {
+          key: "s-file-upload",
+          name: "SFileUpload",
+          title: "SFileUpload 文件上传",
+          desc: "文件上传,支持图片墙与列表两种形态。",
+          code: `<s-file-upload
+  listType="picture-card"
+  label="附件"
+  :list="fileList"
+  :sizeLimit="50"
+  @handChange="onChange"
+/>`
+        },
+        {
+          key: "s-dragger-upload",
+          name: "SDraggerUpload",
+          title: "SDraggerUpload 拖拽上传",
+          desc: "拖拽上传区域。",
+          code: '<s-dragger-upload :list="fileList" @handChange="onChange" />'
+        },
+        {
+          key: "s-copper-upload",
+          name: "SCopperUpload",
+          title: "SCopperUpload 头像裁剪上传",
+          desc: "图片裁剪后上传。",
+          code: '<s-copper-upload @handChange="onChange" />'
+        },
+        {
+          key: "s-editor",
+          name: "SEditor",
+          title: "SEditor 富文本",
+          desc: "基于 jodit 的富文本编辑器。",
+          code: '<s-editor v-model:value="html" />'
+        },
+        {
+          key: "s-filter-wrap",
+          name: "SFilterWrap / SFilterItem",
+          title: "SFilterWrap 筛选区",
+          desc: "列表筛选条件布局容器与表单项。",
+          code: `<s-filter-wrap>
+  <s-filter-item label="名称">
+    <a-input v-model:value="params.name" allowClear />
+  </s-filter-item>
+</s-filter-wrap>`
+        },
+        {
+          key: "s-form-layout",
+          name: "SFormLayout",
+          title: "SFormLayout 表单布局",
+          desc: "表单页布局,配合 SForm / SFormItem。",
+          code: `<s-form-layout :model="form" :rules="rules" @submit="submit">
+  <s-form-item label="名称" name="name">
+    <a-input v-model:value="form.name" />
+  </s-form-item>
+</s-form-layout>`
+        },
+        {
+          key: "s-panel-layout",
+          name: "SPanelLayout",
+          title: "SPanelLayout 面板",
+          desc: "内容面板容器。",
+          code: `<s-panel-layout title="面板标题">
+  <div>内容</div>
+</s-panel-layout>`
+        },
+        {
+          key: "s-collapses",
+          name: "SCollapses / SCollapsesItem",
+          title: "SCollapses 折叠面板",
+          desc: "折叠分组容器与分组项。",
+          code: `<s-collapses>
+  <s-collapses-item title="分组一">
+    <div>内容</div>
+  </s-collapses-item>
+</s-collapses>`
+        },
+        {
+          key: "s-drawer",
+          name: "SDrawer",
+          title: "SDrawer 抽屉",
+          desc: "侧边抽屉。",
+          code: `<s-drawer v-model:value="visible" title="抽屉标题">
+  <div>内容</div>
+</s-drawer>`
+        },
+        {
+          key: "s-anchor",
+          name: "SAnchor",
+          title: "SAnchor 锚点",
+          desc: "页面锚点导航。",
+          code: '<s-anchor :items="items" />'
+        },
+        {
+          key: "s-icon",
+          name: "SIcon",
+          title: "SIcon 图标",
+          desc: "antd 图标封装,支持 size/color。",
+          code: '<s-icon name="SearchOutlined" :size="16" />'
+        },
+        {
+          key: "s-icon-select",
+          name: "SIconSelect",
+          title: "SIconSelect 图标选择",
+          desc: "图标选择器。",
+          code: '<s-icon-select v-model:value="icon" />'
+        },
+        {
+          key: "s-empty",
+          name: "SEmpty",
+          title: "SEmpty 空状态",
+          desc: "空数据占位。",
+          code: '<s-empty description="暂无数据" />'
+        },
+        {
+          key: "s-toggle-language",
+          name: "SToggleLanguage",
+          title: "SToggleLanguage 语言切换",
+          desc: "中英文切换(需 VITE_APP_LANG_ENABLE=true)。",
+          code: '<s-toggle-language blockType="dropdown" />'
+        },
+        {
+          key: "table",
+          name: "Table",
+          title: "Table 表格",
+          desc: "增强表格(.jsx,未全局注册,需手动引入)。",
+          code: `import Table from 'sapit-ui-plus/lib/js/Table.js'
+// 或按项目实际路径引入后局部注册`
+        }
+      ]
+    };
+  },
+  methods: {
+    toggle(s) {
+      this.$set ? this.$set(this.shown, s, !this.shown[s]) : this.shown[s] = !this.shown[s];
+    },
+    scrollTo(s) {
+      this.activeKey = s;
+      const t = document.getElementById("c-" + s);
+      t && t.scrollIntoView({ behavior: "smooth", block: "start" });
+    }
+  },
+  mounted() {
+    this.list.length && (this.activeKey = this.list[0].key);
+  }
+}, b = { class: "cd-page" }, _ = { class: "cd-header" }, L = { class: "nav" }, w = { class: "cd-main" }, T = { class: "cd-side" }, D = ["onClick"], I = { class: "cd-content" }, E = ["id"], F = { class: "en" }, U = { class: "desc" }, V = { class: "code-bar" }, x = ["onClick"], O = { class: "code" };
+function A(s, t, N, j, a, c) {
+  const r = v("router-link");
+  return d(), i("div", b, [
+    e("header", _, [
+      t[2] || (t[2] = e("div", { class: "brand" }, [
+        e("span", { class: "logo" }, "S"),
+        n(" sapit-ui 组件 ")
+      ], -1)),
+      e("nav", L, [
+        m(r, {
+          class: "nav-item",
+          to: "/docs"
+        }, {
+          default: u(() => t[0] || (t[0] = [
+            n("使用文档")
+          ])),
+          _: 1
+        }),
+        m(r, {
+          class: "nav-item active",
+          to: "/components"
+        }, {
+          default: u(() => t[1] || (t[1] = [
+            n("组件")
+          ])),
+          _: 1
+        })
+      ])
+    ]),
+    e("div", w, [
+      e("aside", T, [
+        t[3] || (t[3] = e("div", { class: "side-title" }, "组件", -1)),
+        e("ul", null, [
+          (d(!0), i(p, null, y(a.list, (l) => (d(), i("li", {
+            key: l.key,
+            class: h({ active: a.activeKey === l.key }),
+            onClick: (S) => c.scrollTo(l.key)
+          }, o(l.title), 11, D))), 128))
+        ])
+      ]),
+      e("section", I, [
+        t[4] || (t[4] = e("h1", { class: "doc-title" }, "组件", -1)),
+        t[5] || (t[5] = e("p", { class: "lead" }, " 基座内置组件使用文档。示例为用法示意,具体 props 以组件实现为准;组件已全局注册,模板中直接以文件名标签使用。 ", -1)),
+        (d(!0), i(p, null, y(a.list, (l) => (d(), i("div", {
+          key: l.key,
+          id: "c-" + l.key,
+          class: "cd-item"
+        }, [
+          e("h2", null, [
+            n(o(l.title) + " ", 1),
+            e("span", F, o(l.name), 1)
+          ]),
+          e("p", U, o(l.desc), 1),
+          e("div", V, [
+            e("button", {
+              class: "code-btn",
+              onClick: (S) => c.toggle(l.key)
+            }, o(a.shown[l.key] ? "收起代码" : "查看代码"), 9, x)
+          ]),
+          g(e("pre", O, [
+            e("code", null, o(l.code), 1)
+          ], 512), [
+            [k, a.shown[l.key]]
+          ])
+        ], 8, E))), 128))
+      ])
+    ])
+  ]);
+}
+const K = /* @__PURE__ */ f(C, [["render", A], ["__scopeId", "data-v-1c73fae1"]]);
+export {
+  K as default
+};

File diff suppressed because it is too large
+ 48 - 49
lib/js/docs.js


File diff suppressed because it is too large
+ 0 - 0
lib/js/index.js


+ 10 - 0
lib/js/index2.js

@@ -49515,6 +49515,16 @@ const EW = [
     ),
     // public: 免登录;hidden: 不显示在侧边菜单
     meta: { title: "文档", public: !0, hidden: !0 }
+  },
+  {
+    path: "/components",
+    name: "Components",
+    layout: !1,
+    component: () => import(
+      /* webpackChunkName: "components-doc" */
+      "./components-doc.js"
+    ),
+    meta: { title: "组件", public: !0, hidden: !0 }
   }
 ], cNe = (e = []) => e.filter((t) => t && t.path).map((t) => {
   if (t.raw || t.children) return t;

Some files were not shown because too many files changed in this diff