fangguo-component 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/README.md +70 -36
- package/dist/ArgHover.css +1 -0
- package/dist/ArgHover.vue_vue_type_style_index_0_lang-CMhRP09M.js +54 -0
- package/dist/ButtonGroup-C0yZEkxK.js +103 -0
- package/dist/ButtonGroup.css +1 -0
- package/dist/CitySelect.vue_vue_type_script_setup_true_lang-8EbHD3Nt.js +159 -0
- package/dist/ContentTitle-mqrusLjx.js +24 -0
- package/dist/ContentTitle.css +1 -0
- package/dist/CustomInputV2-uARhbFc8.js +135 -0
- package/dist/CustomInputV2.css +1 -0
- package/dist/CustomMultipleInput-DDaqoHVU.js +109 -0
- package/dist/CustomMultipleInput.css +1 -0
- package/dist/DragResizable.css +1 -0
- package/dist/DragResizable.vue_vue_type_style_index_0_lang-CHv0gJmo.js +179 -0
- package/dist/DragSort-CfDeFAIG.js +66 -0
- package/dist/DragSort.css +1 -0
- package/dist/ErrorImage-CTP_5sal.js +32 -0
- package/dist/ErrorImage.css +1 -0
- package/dist/FgCascader.css +1 -0
- package/dist/FgCascader.vue_vue_type_style_index_0_lang-DXwP88Bn.js +1655 -0
- package/dist/HSelect-Drf6YBwO.js +468 -0
- package/dist/HSelect.css +1 -0
- package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-Blq9xpfa.js +36 -0
- package/dist/HSelectSJ-D3GrXmvj.js +462 -0
- package/dist/HSelectSJ.css +1 -0
- package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BJheMI1q.js +4743 -0
- package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BlX4VbRi.js +79 -0
- package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-vNk68D8E.js +82 -0
- package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-DcOrcH0T.js +33 -0
- package/dist/LoadingBtn-BhbhNboo.js +66 -0
- package/dist/LoadingBtn.css +1 -0
- package/dist/{MInput-CO6YUVuZ.js → MInput-CpoW17Wh.js} +6 -6
- package/dist/MInput.css +1 -1
- package/dist/MyTable-DmwyEVJb.js +68 -0
- package/dist/MyTable.css +1 -0
- package/dist/NoRender.vue_vue_type_script_setup_true_lang-Do36nSsV.js +30 -0
- package/dist/SelectAddress-B4oK5erq.js +173 -0
- package/dist/SelectAddress.css +1 -0
- package/dist/SelectAll.vue_vue_type_script_setup_true_lang-BC3q2U8f.js +79 -0
- package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CaET5eli.js +74 -0
- package/dist/SelectCustomAll.css +1 -0
- package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-_wCRO217.js +83 -0
- package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Bj0KMOKv.js +45 -0
- package/dist/SelectTree-Dm5259kY.js +911 -0
- package/dist/SelectTree.css +1 -0
- package/dist/SvgIcon-C2ah8E0Z.js +30 -0
- package/dist/TextCopy-hOj-Wj2H.js +41 -0
- package/dist/TextCopy.css +1 -0
- package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-aZbEQmbM.js +112 -0
- package/dist/VirtualTable-BWugJiQ5.js +349 -0
- package/dist/VirtualTable.css +1 -0
- package/dist/_commonjsHelpers-ByYUsBRP.js +33 -0
- package/dist/common-BIEgCXbl.js +7030 -0
- package/dist/components/VirtualTable/VirtualTable.vue.d.ts +127 -0
- package/dist/components/VirtualTable/index.d.ts +2 -0
- package/dist/components/VirtualTable/index.js +4 -0
- package/dist/components/argHover/ArgHover.vue.d.ts +51 -0
- package/dist/components/argHover/index.d.ts +1 -0
- package/dist/components/argHover/index.js +4 -0
- package/dist/components/buttonGroup/ButtonGroup.vue.d.ts +17 -0
- package/dist/components/buttonGroup/index.d.ts +1 -0
- package/dist/components/buttonGroup/index.js +4 -0
- package/dist/components/cascader/cascader/{cascader.vue.d.ts → ElCascader.vue.d.ts} +46 -43
- package/dist/components/cascader/cascader/FgCascader.vue.d.ts +4204 -0
- package/dist/components/cascader/cascader/cascader.d.ts +1 -0
- package/dist/components/cascader/cascader/index.d.ts +1 -3
- package/dist/components/cascader/cascader-panel/index.vue.d.ts +8 -8
- package/dist/components/cascader/cascader-panel/menu.vue.d.ts +3 -3
- package/dist/components/cascader/cascader-panel/node.vue.d.ts +2 -2
- package/dist/components/cascader/index.d.ts +1 -3
- package/dist/components/cascader/index.js +1 -1
- package/dist/components/cascader/utils/vue/props/util.d.ts +0 -1
- package/dist/components/cascader/utils/vue/size.d.ts +1 -1
- package/dist/components/citySelect/CitySelect.vue.d.ts +21 -0
- package/dist/components/citySelect/demos/mockAddressTree.d.ts +8 -0
- package/dist/components/citySelect/index.d.ts +1 -0
- package/dist/components/citySelect/index.js +4 -0
- package/dist/components/contentTitle/ContentTitle.vue.d.ts +20 -0
- package/dist/components/contentTitle/index.d.ts +1 -0
- package/dist/components/contentTitle/index.js +4 -0
- package/dist/components/customInputV2/CustomInputV2.vue.d.ts +47 -0
- package/dist/components/customInputV2/index.d.ts +1 -0
- package/dist/components/customInputV2/index.js +4 -0
- package/dist/components/customMultipleInput/CustomMultipleInput.vue.d.ts +46 -0
- package/dist/components/customMultipleInput/index.d.ts +1 -0
- package/dist/components/customMultipleInput/index.js +4 -0
- package/dist/components/dragResizable/DragResizable.vue.d.ts +59 -0
- package/dist/components/dragResizable/index.d.ts +1 -0
- package/dist/components/dragResizable/index.js +4 -0
- package/dist/components/dragSort/DragSort.vue.d.ts +34 -0
- package/dist/components/dragSort/index.d.ts +1 -0
- package/dist/components/dragSort/index.js +4 -0
- package/dist/components/errorImage/ErrorImage.vue.d.ts +23 -0
- package/dist/components/errorImage/index.d.ts +1 -0
- package/dist/components/errorImage/index.js +4 -0
- package/dist/components/hSelect/HSelect.vue.d.ts +103 -0
- package/dist/components/hSelect/demos/mockApi.d.ts +12 -0
- package/dist/components/hSelect/index.d.ts +1 -0
- package/dist/components/hSelect/index.js +4 -0
- package/dist/components/hSelectAll/HSelectAll.vue.d.ts +10 -0
- package/dist/components/hSelectAll/demos/mockApi.d.ts +10 -0
- package/dist/components/hSelectAll/index.d.ts +1 -0
- package/dist/components/hSelectAll/index.js +4 -0
- package/dist/components/hSelectSJ/HSelectSJ.vue.d.ts +105 -0
- package/dist/components/hSelectSJ/demos/mockApi.d.ts +11 -0
- package/dist/components/hSelectSJ/index.d.ts +1 -0
- package/dist/components/hSelectSJ/index.js +4 -0
- package/dist/components/identifyAddress/IdentifyAddress.vue.d.ts +10 -0
- package/dist/components/identifyAddress/index.d.ts +1 -0
- package/dist/components/identifyAddress/index.js +4 -0
- package/dist/components/imageLoupe/ImageLoupe.vue.d.ts +35 -0
- package/dist/components/imageLoupe/index.d.ts +1 -0
- package/dist/components/imageLoupe/index.js +4 -0
- package/dist/components/index.d.ts +29 -0
- package/dist/components/index.js +62 -4
- package/dist/components/lazyComponent/LazyComponent.vue.d.ts +37 -0
- package/dist/components/lazyComponent/index.d.ts +1 -0
- package/dist/components/lazyComponent/index.js +4 -0
- package/dist/components/lazyPopover/LazyPopover.vue.d.ts +31 -0
- package/dist/components/lazyPopover/index.d.ts +1 -0
- package/dist/components/lazyPopover/index.js +4 -0
- package/dist/components/loadingBtn/LoadingBtn.vue.d.ts +34 -0
- package/dist/components/loadingBtn/index.d.ts +1 -0
- package/dist/components/loadingBtn/index.js +4 -0
- package/dist/components/mInput/index.js +1 -1
- package/dist/components/myTable/MyTable.vue.d.ts +46 -0
- package/dist/components/myTable/index.d.ts +1 -0
- package/dist/components/myTable/index.js +4 -0
- package/dist/components/noRender/NoRender.vue.d.ts +23 -0
- package/dist/components/noRender/index.d.ts +1 -0
- package/dist/components/noRender/index.js +4 -0
- package/dist/components/selectAddress/SelectAddress.vue.d.ts +106 -0
- package/dist/components/selectAddress/demos/mockAddressTree.d.ts +7 -0
- package/dist/components/selectAddress/index.d.ts +1 -0
- package/dist/components/selectAddress/index.js +4 -0
- package/dist/components/selectAll/SelectAll.vue.d.ts +124 -0
- package/dist/components/selectAll/index.d.ts +1 -0
- package/dist/components/selectAll/index.js +4 -0
- package/dist/components/selectAll2/SelectAll2.vue.d.ts +81 -0
- package/dist/components/selectAll2/index.d.ts +1 -0
- package/dist/components/selectAll2/index.js +4 -0
- package/dist/components/selectCustomAll/SelectCustomAll.vue.d.ts +77 -0
- package/dist/components/selectCustomAll/index.d.ts +1 -0
- package/dist/components/selectCustomAll/index.js +4 -0
- package/dist/components/selectTimePicker/SelectTimePicker.vue.d.ts +24 -0
- package/dist/components/selectTimePicker/index.d.ts +1 -0
- package/dist/components/selectTimePicker/index.js +4 -0
- package/dist/components/selectTree/SelectTree.vue.d.ts +39 -0
- package/dist/components/selectTree/demos/treeData.d.ts +9 -0
- package/dist/components/selectTree/index.d.ts +1 -0
- package/dist/components/selectTree/index.js +4 -0
- package/dist/components/svgIcon/index.d.ts +1 -0
- package/dist/components/svgIcon/index.js +4 -0
- package/dist/components/textCopy/TextCopy.vue.d.ts +21 -0
- package/dist/components/textCopy/index.d.ts +1 -0
- package/dist/components/textCopy/index.js +4 -0
- package/dist/components/textEllipsisTooltip/TextEllipsisTooltip.vue.d.ts +19 -0
- package/dist/components/textEllipsisTooltip/index.d.ts +1 -0
- package/dist/components/textEllipsisTooltip/index.js +4 -0
- package/dist/dateShortcuts-DDPtAhDI.js +26 -0
- package/dist/index-CQzFbjNL.js +68 -0
- package/dist/index-DIX8TpoT.js +118 -0
- package/dist/index-epuVZjZV.js +103 -0
- package/dist/index-uf7oyYDF.js +16847 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +164 -6
- package/dist/index.js +193 -46
- package/dist/shims.d.ts +53 -13
- package/dist/tools/ImageParserUtils/common.d.ts +117 -0
- package/dist/tools/ImageParserUtils/etagBrowser.d.ts +4 -0
- package/dist/tools/ImageParserUtils/index.d.ts +7 -0
- package/dist/tools/ImageParserUtils/index.js +13116 -0
- package/dist/tools/ImageParserUtils/parseImage.d.ts +18 -0
- package/dist/tools/ImageParserUtils/parsePSD.d.ts +22 -0
- package/dist/tools/ImageParserUtils/parseTIFF.d.ts +18 -0
- package/dist/tools/common/common.d.ts +335 -23
- package/dist/tools/common/dateShortcuts.d.ts +5 -0
- package/dist/tools/common/index.d.ts +1 -0
- package/dist/tools/common/index.js +86 -5085
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +97 -8
- package/dist/vue-virtual-scroller.esm-CH-jx4ri.js +1051 -0
- package/package.json +92 -81
- package/dist/cascader.css +0 -1
- package/dist/cascader.vue_vue_type_script_setup_true_lang-HFhhhQva.js +0 -2268
- package/dist/index-DihzpZcR.js +0 -14
- package/dist/index-wUcQXc_Z.js +0 -10
- package/dist/tools/Grid/Grid.d.ts +0 -48
- package/dist/tools/Grid/index.d.ts +0 -1
- package/dist/tools/Grid/index.js +0 -217
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
本文件记录 **fangguo-component** 各 npm 版本变更;文档站通过 `@include` 同步展示。
|
|
4
|
+
|
|
5
|
+
## [1.1.0] - 2026-05-20
|
|
6
|
+
|
|
7
|
+
### 破坏性变更
|
|
8
|
+
|
|
9
|
+
- 💥 移除 **`SortTransfer`**、**`TipInput`** 组件及导出。
|
|
10
|
+
|
|
11
|
+
### 新增
|
|
12
|
+
|
|
13
|
+
- ✨ 文档站组件 **可预览 Demo**(内嵌 + StackBlitz),目前所有组件都新增了示例demo。
|
|
14
|
+
|
|
15
|
+
### 优化
|
|
16
|
+
|
|
17
|
+
- ♻️ 文档路由改为 **`src/docConfig.ts` 手动维护**,侧栏按 Basic / Form / Select 等二级分类。
|
|
18
|
+
- ♻️ **`pnpm docs:gen`** 不再自动生成 VitePress 路由,仅保留文档生成相关能力。
|
|
19
|
+
- ♻️ 补全并优化多组件文档 Demo(含 **SelectTree**、**SvgIcon**、**TextCopy** 等)。
|
|
20
|
+
- ♻️ **`FgDragResizable`**:新增 `maxWidth` / `maxHeight`(可选);非悬浮 + `parentSelector` 不再强制 `absolute` 叠层。
|
|
21
|
+
|
|
22
|
+
### 修复
|
|
23
|
+
|
|
24
|
+
- 🐛 文档站构建 **TSX 组件**(如 VirtualTable)报 `React is not defined`,补齐 Vue JSX 与 VitePress 配置。
|
|
25
|
+
- 🐛 文档站 **SelectTree** 等 Demo 在 VitePress 下缺少自动导入/虚拟滚动依赖的问题。
|
|
26
|
+
- 🐛 文档站样式问题修复
|
|
27
|
+
|
|
28
|
+
### 文档
|
|
29
|
+
|
|
30
|
+
- 📝 新增/完善 **部分组件** 组件说明与示例。
|
|
31
|
+
- 📝 更新 **COMPONENT_DOC_SKILL**、skill 更加完善。
|
|
32
|
+
|
|
33
|
+
### 构建与工程
|
|
34
|
+
|
|
35
|
+
- 🔧 版本号升至 **1.1.0**;调整 Vite / `tsconfig`、**lint-staged** 分批 oxlint。
|
|
36
|
+
- 🔧 Jenkins 文档构建流程验证与依赖安装说明调整。
|
|
37
|
+
|
|
38
|
+
## [1.0.0] - 2026-05-13
|
|
39
|
+
|
|
40
|
+
### 新增
|
|
41
|
+
|
|
42
|
+
- **Hooks**:`usePagination`(内存列表分页)及 `src/hooks` 文档规范、`docs/hooks` 与侧栏入口。
|
|
43
|
+
- **文档站**:VitePress **本地全文搜索**;默认主题**中文**文案(大纲、侧栏菜单、回到顶部、深浅色切换、上一页/下一页、最后更新等)。
|
|
44
|
+
- **文档路由**:`/components/`、`/tools/`、`/directives/`、`/hooks/` **聚合页**(`index.md`)及侧栏「概览」;导航不再写死单个组件/工具 slug。
|
|
45
|
+
- **依赖声明**:`peerDependencies` 明确 `vue`、`element-plus`、`@element-plus/icons-vue`、`sass`、`vue-virtual-scroller`、`tailwindcss`(**optional**,由业务按需安装,不打入本库发布产物);`dependencies` 保留 `crypto-js`、`lodash-unified`。
|
|
46
|
+
|
|
47
|
+
### 优化
|
|
48
|
+
|
|
49
|
+
- **`pnpm docs:gen`**:扫描并生成 Hooks 文档入口;重写 VitePress 配置(导航、侧栏、主题、搜索、版本号);工具文档目录清理时保留 `docs/tools/index.md`。
|
|
50
|
+
- **指南**:安装页精简为依赖表 + 注意说明;库概览补充 Hooks、指令与文档区域说明。
|
package/README.md
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
## 特性
|
|
6
6
|
|
|
7
|
-
- **Vue 3 + Element Plus**:组件与 Element Plus 同栈;`vue`、`element-plus` 等在本包 `peerDependencies` 中声明,由业务工程显式安装,构建时作 external
|
|
7
|
+
- **Vue 3 + Element Plus**:组件与 Element Plus 同栈;`vue`、`element-plus`、`tailwindcss` 等在本包 `peerDependencies` 中声明,由业务工程显式安装,构建时作 external,减小包体;其中 `tailwindcss` 为 **optional peer**(仅在使用 Tailwind 时安装),不随本库打入 `dist`,使用方需自行配置 PostCSS(见文档站 [安装](docs/guide/installation.md))。
|
|
8
8
|
- **双形态交付**:`export *` 暴露组件、工具、指令与组合式函数(Hooks);`default` 上提供 `install(app, options?)` 用于按需全局注册组件/指令,并将工具与 Hooks 命名空间展开在 `default` 上(与 `src/index.ts` 一致);仅注册组件或仅注册指令时可使用命名导出的 `installComponents` / `installDirectives`。Hooks 始终建议按需命名导出使用,**无需**为 Hooks 单独 `app.use`。构建为多入口 ES 模块,可按需 `import` 子路径(见 `package.json` 的 `exports` 与 `vite` 多入口配置)。
|
|
9
9
|
- **类型与构建**:`vite-plugin-dts` 生成 `dist` 下 `.d.ts`;`vite-plugin-lib-inject-css` 将组件样式注入对应 chunk,配合 `sideEffects` 声明,便于打包器做 Tree Shaking。
|
|
10
|
-
- **文档与开发体验**:内置 VitePress
|
|
10
|
+
- **文档与开发体验**:内置 VitePress 文档站;各模块正文与在线示例(`demos/*.vue`)均在 `src` 对应目录维护;`pnpm docs:gen` 生成 `docs` 下的 `@include` 入口;工具模块在无手写 md 时可从源码与 JSDoc 自动生成 API 说明。
|
|
11
11
|
|
|
12
12
|
## 项目结构
|
|
13
13
|
|
|
@@ -18,59 +18,86 @@
|
|
|
18
18
|
│ ├── components/ # 组件:每个子目录为一个组件
|
|
19
19
|
│ │ └── <单个组件目录>/
|
|
20
20
|
│ │ ├── index.ts # 对外导出
|
|
21
|
-
│ │ ├── *.vue
|
|
22
|
-
│ │ ├── *.
|
|
23
|
-
│ │ └──
|
|
21
|
+
│ │ ├── *.vue / *.ts # 实现(按需)
|
|
22
|
+
│ │ ├── *.md # 组件文档正文(手写或 AI;docs:gen 只生成 docs 薄入口)
|
|
23
|
+
│ │ └── demos/ # 文档站在线示例(可多个 .vue,在 .md 里用 <demo vue="demos/…" />)
|
|
24
24
|
│ ├── tools/ # 工具函数:每个子目录为一个工具包
|
|
25
25
|
│ │ ├── index.ts # 聚合各工具包导出
|
|
26
26
|
│ │ └── <单个工具目录>/
|
|
27
|
-
│ │ ├── index.ts # 该包对外 export
|
|
27
|
+
│ │ ├── index.ts # 该包对外 export
|
|
28
28
|
│ │ ├── *.ts # 实现文件
|
|
29
|
-
│ │
|
|
29
|
+
│ │ ├── *.md # 可选:手写文档
|
|
30
|
+
│ │ └── demos/ # 可选:在线示例(约定同上)
|
|
30
31
|
│ ├── directive/ # 自定义指令:每个子目录一条指令包
|
|
31
32
|
│ │ ├── index.ts # 聚合导出
|
|
32
33
|
│ │ └── <指令子目录>/
|
|
33
34
|
│ │ ├── *.ts # 指令实现
|
|
34
|
-
│ │
|
|
35
|
+
│ │ ├── *.md # 可选:指令文档
|
|
36
|
+
│ │ └── demos/ # 可选:在线示例(约定同上)
|
|
35
37
|
│ ├── hooks/ # 组合式函数:每个子目录一个 Hook 包
|
|
36
38
|
│ │ ├── index.ts # 聚合导出
|
|
37
39
|
│ │ └── <hook 子目录>/
|
|
38
40
|
│ │ ├── *.ts # 实现与 re-export
|
|
39
|
-
│ │
|
|
40
|
-
│
|
|
41
|
-
│
|
|
41
|
+
│ │ ├── *.md # 可选:Hook 文档
|
|
42
|
+
│ │ └── demos/ # 可选:在线示例(约定同上)
|
|
43
|
+
│ ├── pages/ # 本地 Playground(`pnpm dev`):页面与 mock
|
|
44
|
+
│ └── docConfig.ts # 文档站侧边路由分组(人工维护,由 docs/.vitepress/config.ts 引入)
|
|
42
45
|
├── docs/ # VitePress 文档站
|
|
43
|
-
│ ├── .vitepress/
|
|
44
|
-
│ │
|
|
46
|
+
│ ├── .vitepress/
|
|
47
|
+
│ │ ├── config.ts # 站点配置入口
|
|
48
|
+
│ │ ├── vueDemoSandboxShared.ts # StackBlitz 等外链沙箱共用依赖
|
|
49
|
+
│ │ ├── stackblitzVueTemplates.ts / codesandboxVueTemplates.ts
|
|
50
|
+
│ │ ├── theme/ # 主题扩展(如 Element Plus)
|
|
51
|
+
│ │ └── dist/ # `pnpm docs:build` 静态站输出
|
|
45
52
|
│ ├── guide/ # 指南(安装、快速开始等)
|
|
46
|
-
│ ├── index.md #
|
|
47
|
-
│ ├── components/ #
|
|
48
|
-
│ ├── tools/ #
|
|
49
|
-
│ ├── directives/ #
|
|
50
|
-
│ └── hooks/ #
|
|
53
|
+
│ ├── index.md # 文档首页(docs:gen 会同步 features 链接)
|
|
54
|
+
│ ├── components/ # 脚本生成的 @include 薄入口(勿当作正文仓库)
|
|
55
|
+
│ ├── tools/ # 脚本生成的工具文档入口@include 薄入口(勿当作正文仓库)
|
|
56
|
+
│ ├── directives/ # 脚本生成的指令文档 @include 薄入口(勿当作正文仓库)
|
|
57
|
+
│ └── hooks/ # 脚本生成的 Hooks 文档 @include 薄入口(勿当作正文仓库)
|
|
58
|
+
├── CHANGELOG.md # 版本变更记录(文档站「更新日志」页 @include 此文件)
|
|
59
|
+
├── ai-skill-docs/ # 给 AI 的撰写规范(Skill 式 Markdown,含组件/工具函数/指令/Hooks/更新日志等约定)
|
|
51
60
|
├── scripts/
|
|
52
|
-
│
|
|
61
|
+
│ ├── gen-docs.ts # 同步组件/工具/指令/Hooks 文档
|
|
62
|
+
│ └── colocatedDemoPlugin.ts # 文档站:将 vue="demos/…" 解析到 src 同目录 demos
|
|
53
63
|
└── dist/ # npm 包构建产物:pnpm build:npm 生成,用于发布到 npm(与 docs/.vitepress/dist 不同)
|
|
54
64
|
```
|
|
55
65
|
|
|
56
|
-
|
|
66
|
+
<span style="color:#c62828"><strong>注意</strong></span>:以下两段分别为「目录说明」与「文档说明」,参与本库开发前请务必阅读。
|
|
67
|
+
|
|
68
|
+
**目录说明**:`src/` 下 **`components`、`tools`、`directive`、`hooks` 为平级目录**,用途区分如下:`components` 放 Vue 组件及**仅服务于该组件**的实现(类型、子模块、工具函数等一律收在对应组件子目录内);`tools` 放**可复用**的纯工具函数/算法类代码;`directive` 放**可复用**的自定义指令;`hooks` 放**可复用**的组合式函数。**请勿**把某个组件专用才会用到的方法或辅助逻辑塞进 `tools` 或其它平级目录,避免与对外可复用能力混淆。
|
|
69
|
+
|
|
70
|
+
**文档说明**:`docs/components`、`docs/tools`、`docs/directives`、`docs/hooks` 下的 `.md` 多为脚本生成的薄入口(一行 `@include`);**正文与在线示例**写在 `src` 对应子目录的 `*.md` 与 `demos/*.vue` 中。Markdown 里用 `<demo vue="demos/示例.vue" />` 引用同目录 demo;因 VitePress 实际渲染的是 `docs` 入口,由 `scripts/colocatedDemoPlugin.ts` 在构建时把路径改写到 `src` 下的真实文件。新增侧栏条目时需同步维护 `src/docConfig.ts`。
|
|
71
|
+
|
|
72
|
+
## 开发流程(面向组件、工具、指令与 Hooks 的开发者)
|
|
73
|
+
|
|
74
|
+
1. **`pnpm install`**:安装依赖;运行与类型版本以 `package.json` 的 `peerDependencies` 为准。
|
|
75
|
+
2. **新建目录与导出**:在 `src/components/`、`src/tools/`(子包须含 `index.ts`)、`src/directive/`、`src/hooks/` 各建一级子目录并实现,自子包 `index.ts` 到对应聚合 `index.ts` 完成导出,风格与现有一致。(导出名目前未作强制约定,建议对外导出以 `fg` 或 `Fg` 开头,与库内既有命名习惯一致。)
|
|
76
|
+
3. **开发与调试**:组件(工具)开发完成后,可在对应子目录下新建 `demos/` 目录,该目录既是后续编写 `.md` 文档时的在线示例 demo。也可作为调试和测试组件功能用途,也可作为可以在 `src/pages/` 对应目录下新建 `.vue` mock 页面进行单独调试(`pnpm dev` 启动 Playground)。
|
|
77
|
+
4. **编写组件文档**:正文写在对应子目录的 `*.md`(约定见上文「文档说明」与下文「文档生成说明」)。用 AI 时到 **`ai-skill-docs/`**,按模块类型 **`@` 对应 Skill** 后再写。
|
|
78
|
+
5. **添加文档路由**:在 `src/docConfig.ts` 中手动添加对应模块的侧边栏路由地址(文档侧边路由需手动维护,不再由脚本自动生成)。
|
|
79
|
+
6. **编写在线示例 demo**:在同目录 `demos/*.vue` 中编写,在 `.md` 中用 `<demo vue="demos/xxx.vue" title="…" stackblitz />` 引用;StackBlitz 外链依赖 `docs/.vitepress` 下沙箱模板。可参考 `src/components/cascader/demos/` 与 `cascader.md`。
|
|
80
|
+
7. **`pnpm docs:gen`**:同步生成/更新 `docs` 下各 `@include` 入口与首页 `features` 链接;
|
|
81
|
+
8. **编写更新日志**:在根目录下 **`CHANGELOG.md`**;用 AI 时在 **`ai-skill-docs/`** 选用变更日志相关 Skill 后撰写或者手动编写。
|
|
82
|
+
9. **`pnpm build:npm`**:构建 npm 发布产物到根目录 `dist/`(发版前执行)。
|
|
83
|
+
10. **Jenkins 构建文档站**:在 Jenkins dev 栏目下 `fangguo-component` 项目执行构建,发布最新文档站。
|
|
57
84
|
|
|
58
85
|
## 文档站(VitePress)与相关命令
|
|
59
86
|
|
|
60
|
-
文档根目录为 `docs
|
|
87
|
+
文档根目录为 `docs/`;**`docs/.vitepress/config.ts`** 与 **`src/docConfig.ts`(侧栏)** 由人工维护,`pnpm docs:gen` 不会覆盖。站点集成 [vitepress-demo-plugin](https://vitepress-demo.fe-dev.cn/) 与 **`colocatedDemoPlugin`**(解析 `vue="demos/…"`)。**更新日志**正文在根目录 **`CHANGELOG.md`**,`docs/guide/changelog.md` 仅 `@include` 引入。
|
|
61
88
|
|
|
62
|
-
| 命令 | 说明
|
|
63
|
-
| ------------------- |
|
|
64
|
-
| `pnpm docs:dev` | 本地启动 VitePress,热更新预览文档
|
|
65
|
-
| `pnpm docs:build` | 构建静态站点,输出到 `docs/.vitepress/dist`(默认)
|
|
66
|
-
| `pnpm docs:preview` | 预览已构建的文档站
|
|
67
|
-
| `pnpm docs:gen` |
|
|
89
|
+
| 命令 | 说明 |
|
|
90
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
91
|
+
| `pnpm docs:dev` | 本地启动 VitePress,热更新预览文档 |
|
|
92
|
+
| `pnpm docs:build` | 构建静态站点,输出到 `docs/.vitepress/dist`(默认) |
|
|
93
|
+
| `pnpm docs:preview` | 预览已构建的文档站 |
|
|
94
|
+
| `pnpm docs:gen` | 扫描 `src` 四类目录,生成/更新 `docs` 下 `@include` 入口并同步首页 `features` 链接(见下一节;侧栏见 `src/docConfig.ts`) |
|
|
68
95
|
|
|
69
96
|
典型流程:改完组件、工具、指令、Hooks 源码或手写 md 后执行 `pnpm docs:gen`,再 `pnpm docs:dev` 查看效果;发布文档前执行 `pnpm docs:build`。
|
|
70
97
|
|
|
71
98
|
## 文档生成说明(`pnpm docs:gen`)
|
|
72
99
|
|
|
73
|
-
脚本入口:`scripts/gen-docs.ts
|
|
100
|
+
脚本入口:`scripts/gen-docs.ts`。在 `docs/components/`、`docs/tools/`、`docs/directives/`、`docs/hooks/` 下写入或更新各条目的 `@include` 或(工具无手写 md 时)自动生成 API 式 Markdown;**不再**生成上述目录下的 `index.md` 聚合页;并更新首页 `docs/index.md` 中 `features` 的链接,使其指向各分类**按目录名排序后的第一篇**文档。**不**修改 `docs/.vitepress/config.ts` 与 `src/docConfig.ts`。
|
|
74
101
|
|
|
75
102
|
### 组件文档
|
|
76
103
|
|
|
@@ -78,15 +105,15 @@
|
|
|
78
105
|
- **组件正文 Markdown 不会由脚本从 `.vue`/`.ts` 自动生成**,需在组件目录下维护 `.md`(可手写或借助 AI 生成),再由 `docs:gen` 生成 `docs/components` 中的 `@include` 入口。
|
|
79
106
|
- 在每个组件目录内按优先级查找文档文件:`README.md` → `index.md` → `<组件目录名>.md` → 否则取该目录下任意一个 `.md`(按文件名排序取第一个)。
|
|
80
107
|
- 在 `docs/components/<组件名>.md` 中生成一行 VitePress 引入,例如:`<!--@include: ../../src/components/<组件名>/<上述选中的 md 文件名>-->`。
|
|
81
|
-
-
|
|
82
|
-
- 正文请在**源码目录**下的对应 `.md` 中维护;`docs/components`
|
|
108
|
+
- 侧栏在存在组件时列出各组件条目(无单独的「概览」页);**首页** `features` 中「组件」链接与**导航栏「组件」**均指向排序后的第一个组件路由(如 `/components/cascader`)。
|
|
109
|
+
- 正文请在**源码目录**下的对应 `.md` 中维护;`docs/components` 内上述 `*.md` 入口由脚本覆盖,不要当作唯一正文仓库。
|
|
83
110
|
|
|
84
111
|
### 工具文档
|
|
85
112
|
|
|
86
113
|
- 扫描 `src/tools/` 下含 `index.ts` 的一级子目录(排除脚本中 `TOOLS_EXCLUDE_DIRS`)。
|
|
87
114
|
- **若该工具目录内存在**可被上述同样规则选中的 `.md`(`README.md` / `index.md` / `<工具包名>.md` / 其它 `.md`):在 `docs/tools/<工具包名>.md` 中生成 `@include`,指向 `src/tools/<工具包名>/` 下选中的那个文件。
|
|
88
115
|
- **若不存在**任何符合条件的 `.md`:脚本会根据 `index.ts` 中的 `export … from './…'` 收集对外暴露的 `.ts` 源码,自动解析 JSDoc / 类型并生成整页 API 式文档(无手写 md 时走此分支)。
|
|
89
|
-
-
|
|
116
|
+
- 侧栏列出各工具包;**不**生成 `docs/tools/index.md`。导航「工具」与首页 `features` 中「工具函数」指向排序后的第一个工具路由;清理 `docs/tools` 下已移除工具对应的旧 `.md` 时**会**一并删除历史遗留的 `index.md`。
|
|
90
117
|
|
|
91
118
|
工具侧栏标题会尽量使用手写 md 的一级标题 `# …`;若无则回退到源码中的 `@file`、`@Description` 等注释。
|
|
92
119
|
|
|
@@ -94,16 +121,16 @@
|
|
|
94
121
|
|
|
95
122
|
- 扫描 `src/directive/` 下一级子目录(排除脚本中 `DIRECTIVE_EXCLUDE_DIRS`,默认含 `_template`)。
|
|
96
123
|
- 与组件相同,在子目录内按 `README.md` → `index.md` → `<子目录名>.md` → 其它 `.md` 优先级查找正文;在 `docs/directives/<子目录名>.md` 中生成 `@include`,指向 `src/directive/<子目录名>/` 下选中的文件。
|
|
97
|
-
-
|
|
98
|
-
-
|
|
124
|
+
- **不**生成 `docs/directives/index.md`;侧栏仅列各指令;导航「指令」与首页对应链接指向排序后的第一条指令路由。若无任何带 md 的子目录,则不会生成指令相关导航与侧栏。
|
|
125
|
+
- 用 AI 撰写正文时:到 **`ai-skill-docs/`** 选用与本节(指令)对应的 Skill,在对话中 **`@`** 该文件后再生成。
|
|
99
126
|
|
|
100
127
|
### Hooks(组合式函数)文档
|
|
101
128
|
|
|
102
129
|
- 扫描 `src/hooks/` 下一级子目录(排除脚本中 `HOOK_EXCLUDE_DIRS`,默认含 `_template`)。
|
|
103
130
|
- 与指令相同,在子目录内按 `README.md` → `index.md` → `<子目录名>.md` → 其它 `.md` 优先级查找正文;在 `docs/hooks/<子目录名>.md` 中生成 `@include`,指向 `src/hooks/<子目录名>/` 下选中的文件。
|
|
104
|
-
-
|
|
131
|
+
- **不**生成 `docs/hooks/index.md`;侧栏仅列各 Hook;导航「Hooks」与首页对应链接指向排序后的第一个 Hook 路由。若无任何带 md 的子目录,则不会生成 Hooks 相关导航与侧栏。
|
|
105
132
|
- Hooks **不需要**全局安装:业务项目按需 `import { useXxx } from 'fangguo-component'` 即可(与 `src/index.ts` 命名导出一致)。
|
|
106
|
-
-
|
|
133
|
+
- 用 AI 撰写正文时:到 **`ai-skill-docs/`** 选用与本节(Hooks)对应的 Skill,在对话中 **`@`** 该文件后再生成。
|
|
107
134
|
|
|
108
135
|
面向在本仓库内开发、构建与维护文档的说明。业务项目如何安装、引入本包,请见文档站内的 [安装](docs/guide/installation.md) 与 [快速开始](docs/guide/quickstart.md)。
|
|
109
136
|
|
|
@@ -119,10 +146,17 @@ pnpm fmt # 格式化(oxfmt)
|
|
|
119
146
|
开发与类型检查建议环境:
|
|
120
147
|
|
|
121
148
|
- Vue 版本以本仓库 `package.json` 中 **`peerDependencies`** 为准(当前为 `^3.5.3`)
|
|
122
|
-
- Element Plus、`@element-plus/icons-vue`、`sass`、`
|
|
149
|
+
- Element Plus、`@element-plus/icons-vue`、`sass`、`tailwindcss`(**optional peer**,仅在使用 Tailwind 时安装)等同上,以 **`peerDependencies`** 为准;(`tailwindcss` 不参与本库产物打包,业务侧自管构建链)
|
|
123
150
|
|
|
124
151
|
文档相关命令见上文「文档站(VitePress)与相关命令」。
|
|
125
152
|
|
|
153
|
+
## 目前遇到的问题(待团队结论)
|
|
154
|
+
|
|
155
|
+
1. **组件库怎么发**:走 [npm](https://www.npmjs.com/) 公共包(`npm publish`),还是走私有 org(一般要掏钱)?要不业务直接用 **`git+https` / `git+ssh`** 指定仓库、某个 tag 装(目前先发布npm)?
|
|
156
|
+
2. **带业务的组件**:涉及 **store、接口、等等**,需要讨论是放到组件库还是?以及如何放到组件库(目前不放业务组件)?
|
|
157
|
+
3. 哪些组件,工具,指令,hook等可以放到组件库里,如何界定?,不能为了使用组件库而过渡放到组件库
|
|
158
|
+
4. 静态文档dist包需要放到服务器,加上jekins配置,方便使用者查看文档(已完成)
|
|
159
|
+
|
|
126
160
|
## 许可证
|
|
127
161
|
|
|
128
162
|
[ISC](./LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.arghover{white-space:pre-wrap}.arghover .fg-arg-hover-trigger{color:#9198a8;cursor:pointer;vertical-align:middle}.arghover.el-popper.is-light>.el-popper__arrow:before{right:0;background:#f5f9ff;border:1px solid rgba(68,133,245,.5803921569)}.arghover.el-popper.is-light{background:#f5f9ff;border:1px solid rgba(68,133,245,.5803921569)}.arghover.el-popover.el-popper.is-light{box-shadow:none}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineComponent as s, resolveComponent as l, openBlock as f, createBlock as i, withCtx as o, renderSlot as n, createVNode as r, normalizeStyle as m, normalizeClass as d, unref as p } from "vue";
|
|
2
|
+
import { QuestionFilled as u } from "@element-plus/icons-vue";
|
|
3
|
+
import './ArgHover.css';const w = /* @__PURE__ */ s({
|
|
4
|
+
__name: "ArgHover",
|
|
5
|
+
props: {
|
|
6
|
+
text: String,
|
|
7
|
+
placement: {
|
|
8
|
+
default: "top"
|
|
9
|
+
},
|
|
10
|
+
effect: {
|
|
11
|
+
default: "light"
|
|
12
|
+
},
|
|
13
|
+
width: {
|
|
14
|
+
default: 200
|
|
15
|
+
},
|
|
16
|
+
color: {
|
|
17
|
+
default: "#9198A8"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(e) {
|
|
21
|
+
return (t, h) => {
|
|
22
|
+
const c = l("el-icon"), a = l("el-popover");
|
|
23
|
+
return f(), i(a, {
|
|
24
|
+
"popper-class": "arghover",
|
|
25
|
+
placement: e.placement,
|
|
26
|
+
effect: e.effect,
|
|
27
|
+
width: e.width,
|
|
28
|
+
content: e.text
|
|
29
|
+
}, {
|
|
30
|
+
reference: o(() => [
|
|
31
|
+
n(t.$slots, "default", {}, () => [
|
|
32
|
+
r(c, {
|
|
33
|
+
class: d(["fg-arg-hover-trigger", t.$attrs.class]),
|
|
34
|
+
style: m({ color: e.color }),
|
|
35
|
+
size: 16
|
|
36
|
+
}, {
|
|
37
|
+
default: o(() => [
|
|
38
|
+
r(p(u))
|
|
39
|
+
]),
|
|
40
|
+
_: 1
|
|
41
|
+
}, 8, ["class", "style"])
|
|
42
|
+
])
|
|
43
|
+
]),
|
|
44
|
+
default: o(() => [
|
|
45
|
+
n(t.$slots, "content")
|
|
46
|
+
]),
|
|
47
|
+
_: 3
|
|
48
|
+
}, 8, ["placement", "effect", "width", "content"]);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
w as _
|
|
54
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import './ButtonGroup.css';var p = (_, b, a) => new Promise((i, r) => {
|
|
2
|
+
var u = (t) => {
|
|
3
|
+
try {
|
|
4
|
+
n(a.next(t));
|
|
5
|
+
} catch (s) {
|
|
6
|
+
r(s);
|
|
7
|
+
}
|
|
8
|
+
}, l = (t) => {
|
|
9
|
+
try {
|
|
10
|
+
n(a.throw(t));
|
|
11
|
+
} catch (s) {
|
|
12
|
+
r(s);
|
|
13
|
+
}
|
|
14
|
+
}, n = (t) => t.done ? i(t.value) : Promise.resolve(t.value).then(u, l);
|
|
15
|
+
n((a = a.apply(_, b)).next());
|
|
16
|
+
});
|
|
17
|
+
import { defineComponent as $, ref as d, onMounted as x, onUnmounted as B, watch as C, openBlock as m, createElementBlock as y, createElementVNode as w, normalizeClass as h, Fragment as R, renderList as G, toDisplayString as L, normalizeStyle as S, nextTick as E } from "vue";
|
|
18
|
+
import { _ as I } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
19
|
+
const M = ["onClick"], z = /* @__PURE__ */ $({
|
|
20
|
+
__name: "ButtonGroup",
|
|
21
|
+
props: {
|
|
22
|
+
data: {}
|
|
23
|
+
},
|
|
24
|
+
emits: ["change"],
|
|
25
|
+
setup(_, { emit: b }) {
|
|
26
|
+
const a = d(null), i = _, r = b, u = d([]), l = d({
|
|
27
|
+
width: 0,
|
|
28
|
+
left: 0
|
|
29
|
+
}), n = d([]);
|
|
30
|
+
let t = null;
|
|
31
|
+
function s() {
|
|
32
|
+
return p(this, null, function* () {
|
|
33
|
+
yield E();
|
|
34
|
+
const e = n.value.findIndex((c) => c.active);
|
|
35
|
+
if (e < 0) {
|
|
36
|
+
l.value = { width: 0, left: 0 };
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const o = u.value[e];
|
|
40
|
+
if (!o) {
|
|
41
|
+
l.value = { width: 0, left: 0 };
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
l.value = {
|
|
45
|
+
width: o.clientWidth,
|
|
46
|
+
left: o.offsetLeft
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const g = (e, o) => {
|
|
51
|
+
const c = e.target.clientWidth || 0, f = e.target.offsetLeft || 0;
|
|
52
|
+
l.value = {
|
|
53
|
+
width: c,
|
|
54
|
+
left: f
|
|
55
|
+
}, n.value.forEach((v, k) => {
|
|
56
|
+
k === o ? v.active = !0 : v.active = !1;
|
|
57
|
+
}), r("change", n.value[o]);
|
|
58
|
+
};
|
|
59
|
+
return x(() => p(null, null, function* () {
|
|
60
|
+
n.value = i.data, yield s(), a.value && (t = new ResizeObserver(() => {
|
|
61
|
+
s();
|
|
62
|
+
}), t.observe(a.value));
|
|
63
|
+
})), B(() => {
|
|
64
|
+
t == null || t.disconnect(), t = null;
|
|
65
|
+
}), C(
|
|
66
|
+
() => i.data,
|
|
67
|
+
(e) => p(null, null, function* () {
|
|
68
|
+
n.value = e, yield s();
|
|
69
|
+
})
|
|
70
|
+
), (e, o) => (m(), y("div", {
|
|
71
|
+
ref_key: "btnGroupRef",
|
|
72
|
+
ref: a,
|
|
73
|
+
class: "flex"
|
|
74
|
+
}, [
|
|
75
|
+
w("div", {
|
|
76
|
+
class: h([e.$style["but-group-wrap"], "pattern-box"])
|
|
77
|
+
}, [
|
|
78
|
+
(m(!0), y(R, null, G(n.value, (c, f) => (m(), y("span", {
|
|
79
|
+
key: f,
|
|
80
|
+
class: h([e.$style["btn-items"], { [e.$style.active]: c.active }, { "pattern-active": c.active }, "pattern-box-btn"]),
|
|
81
|
+
ref_for: !0,
|
|
82
|
+
ref_key: "btnRefs",
|
|
83
|
+
ref: u,
|
|
84
|
+
onClick: (v) => g(v, f)
|
|
85
|
+
}, L(c.label), 11, M))), 128)),
|
|
86
|
+
w("div", {
|
|
87
|
+
class: h([e.$style["slide-bg"], "pattern-box-bg"]),
|
|
88
|
+
style: S({ width: `${l.value.width}px`, left: `${l.value.left}px` })
|
|
89
|
+
}, null, 6)
|
|
90
|
+
], 2)
|
|
91
|
+
], 512));
|
|
92
|
+
}
|
|
93
|
+
}), D = "_active_127vp_22", T = {
|
|
94
|
+
"but-group-wrap": "_but-group-wrap_127vp_1",
|
|
95
|
+
"btn-items": "_btn-items_127vp_10",
|
|
96
|
+
active: D,
|
|
97
|
+
"slide-bg": "_slide-bg_127vp_25"
|
|
98
|
+
}, W = {
|
|
99
|
+
$style: T
|
|
100
|
+
}, U = /* @__PURE__ */ I(z, [["__cssModules", W]]);
|
|
101
|
+
export {
|
|
102
|
+
U as B
|
|
103
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._but-group-wrap_127vp_1{position:relative;display:flex;align-items:center;overflow:hidden;font-size:14px;background:#f5f7fa;border-radius:19px}._but-group-wrap_127vp_1 ._btn-items_127vp_10{z-index:1;display:inline-block;padding:0 8px;text-align:center;color:#9198a8;line-height:36px;cursor:pointer}._but-group-wrap_127vp_1 ._btn-items_127vp_10:hover{color:var(--el-color-primary)}._but-group-wrap_127vp_1 ._btn-items_127vp_10._active_127vp_22{color:#fff}._but-group-wrap_127vp_1 ._slide-bg_127vp_25{position:absolute;top:0;width:0;height:36px;background:var(--el-color-primary);border-radius:19px;transition-property:width,left;transition-duration:.3s,.3s;transition-timing-function:ease}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { defineComponent as M, ref as c, onMounted as B, watch as U, resolveComponent as k, openBlock as r, createElementBlock as p, createVNode as j, withCtx as y, Fragment as f, renderList as K, createBlock as v, createCommentVNode as w } from "vue";
|
|
2
|
+
const F = { class: "flex w-full" }, q = /* @__PURE__ */ M({
|
|
3
|
+
__name: "CitySelect",
|
|
4
|
+
props: {
|
|
5
|
+
provinceCode: {},
|
|
6
|
+
cityCode: {},
|
|
7
|
+
areaCode: {},
|
|
8
|
+
parentKey: { default: "parentCode" },
|
|
9
|
+
source: {},
|
|
10
|
+
valueKey: { default: "code" },
|
|
11
|
+
nameKey: { default: "name" },
|
|
12
|
+
level: { default: 3 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["success"],
|
|
15
|
+
setup(N, { emit: A }) {
|
|
16
|
+
const t = N, m = A, u = c(null), s = c(null), i = c(null), L = c([]), h = c([]), g = c([]), d = c(/* @__PURE__ */ new Map()), V = (e) => {
|
|
17
|
+
if (!e.source.length)
|
|
18
|
+
return !1;
|
|
19
|
+
t.valueKey === "code" && (i.value = e.areaCode || "", s.value = e.cityCode || "", u.value = e.provinceCode || "");
|
|
20
|
+
const o = [];
|
|
21
|
+
e.source.forEach((l) => {
|
|
22
|
+
const n = {
|
|
23
|
+
name: l[e.nameKey],
|
|
24
|
+
code: l[e.valueKey],
|
|
25
|
+
parentCode: l[e.parentKey],
|
|
26
|
+
areasList: /* @__PURE__ */ new Map()
|
|
27
|
+
};
|
|
28
|
+
o.push({
|
|
29
|
+
name: l[e.nameKey],
|
|
30
|
+
code: l[e.valueKey],
|
|
31
|
+
parentCode: l[e.parentKey]
|
|
32
|
+
}), Array.isArray(l.areasList) && l.areasList.forEach((a) => {
|
|
33
|
+
const b = {
|
|
34
|
+
name: a[e.nameKey],
|
|
35
|
+
code: a[e.valueKey],
|
|
36
|
+
parentCode: a[e.parentKey],
|
|
37
|
+
areasList: /* @__PURE__ */ new Map()
|
|
38
|
+
};
|
|
39
|
+
Array.isArray(a.areasList) && a.areasList.forEach((C) => {
|
|
40
|
+
const x = {
|
|
41
|
+
name: C[e.nameKey],
|
|
42
|
+
code: C[e.valueKey],
|
|
43
|
+
parentCode: C[e.parentKey]
|
|
44
|
+
};
|
|
45
|
+
b.areasList.set(x.code, x);
|
|
46
|
+
}), n.areasList.set(a.code, b);
|
|
47
|
+
}), d.value.set(l.code, n);
|
|
48
|
+
}), L.value = o, e.provinceCode && (u.value = e.provinceCode, _(e.provinceCode)), e.cityCode && (s.value = e.cityCode, D(e.cityCode)), e.areaCode && (i.value = e.areaCode);
|
|
49
|
+
}, _ = (e) => {
|
|
50
|
+
const o = d.value.get(e);
|
|
51
|
+
if (!o) return;
|
|
52
|
+
const l = [];
|
|
53
|
+
o.areasList.forEach((n) => {
|
|
54
|
+
l.push({
|
|
55
|
+
name: n.name,
|
|
56
|
+
code: n.code,
|
|
57
|
+
parentCode: n.parentCode
|
|
58
|
+
});
|
|
59
|
+
}), s.value = null, i.value = null, h.value = l, t.level === 1 && m("success", {
|
|
60
|
+
level: 1,
|
|
61
|
+
provinceName: o.name || "",
|
|
62
|
+
provinceCode: o.code || ""
|
|
63
|
+
});
|
|
64
|
+
}, D = (e) => {
|
|
65
|
+
const o = d.value.get(u.value);
|
|
66
|
+
if (!o || !o.areasList) return;
|
|
67
|
+
const l = o.areasList.get(e), n = [];
|
|
68
|
+
!l || !l.areasList || (l.areasList.forEach((a) => {
|
|
69
|
+
n.push({
|
|
70
|
+
name: a.name,
|
|
71
|
+
code: a.code,
|
|
72
|
+
parentCode: a.parentCode
|
|
73
|
+
});
|
|
74
|
+
}), i.value = null, g.value = n, t.level === 2 && m("success", {
|
|
75
|
+
level: 2,
|
|
76
|
+
provinceName: o.name || "",
|
|
77
|
+
provinceCode: o.code || "",
|
|
78
|
+
cityName: l.name || "",
|
|
79
|
+
cityCode: l.code || ""
|
|
80
|
+
}));
|
|
81
|
+
}, E = (e) => {
|
|
82
|
+
const o = d.value.get(u.value), l = o.areasList.get(s.value), n = l.areasList.get(e), a = {
|
|
83
|
+
level: 3,
|
|
84
|
+
provinceName: o.name || "",
|
|
85
|
+
provinceCode: o.code || "",
|
|
86
|
+
cityName: l.name || "",
|
|
87
|
+
cityCode: l.code || "",
|
|
88
|
+
areaName: n.name || "",
|
|
89
|
+
areaCode: n.code || ""
|
|
90
|
+
};
|
|
91
|
+
m("success", a);
|
|
92
|
+
};
|
|
93
|
+
return B(() => {
|
|
94
|
+
V(t);
|
|
95
|
+
}), U(t, (e) => {
|
|
96
|
+
V(e);
|
|
97
|
+
}), (e, o) => {
|
|
98
|
+
const l = k("el-option"), n = k("el-select");
|
|
99
|
+
return r(), p("div", F, [
|
|
100
|
+
j(n, {
|
|
101
|
+
placeholder: "省",
|
|
102
|
+
class: "mr-[10px] flex-1",
|
|
103
|
+
modelValue: u.value,
|
|
104
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => u.value = a),
|
|
105
|
+
filterable: "",
|
|
106
|
+
onChange: _
|
|
107
|
+
}, {
|
|
108
|
+
default: y(() => [
|
|
109
|
+
(r(!0), p(f, null, K(L.value, (a) => (r(), v(l, {
|
|
110
|
+
key: a.code,
|
|
111
|
+
value: a.code,
|
|
112
|
+
label: a.name
|
|
113
|
+
}, null, 8, ["value", "label"]))), 128))
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["modelValue"]),
|
|
117
|
+
t.level >= 2 ? (r(), v(n, {
|
|
118
|
+
key: 0,
|
|
119
|
+
placeholder: "市",
|
|
120
|
+
class: "mr-[10px] flex-1",
|
|
121
|
+
modelValue: s.value,
|
|
122
|
+
"onUpdate:modelValue": o[1] || (o[1] = (a) => s.value = a),
|
|
123
|
+
filterable: "",
|
|
124
|
+
onChange: D
|
|
125
|
+
}, {
|
|
126
|
+
default: y(() => [
|
|
127
|
+
(r(!0), p(f, null, K(h.value, (a) => (r(), v(l, {
|
|
128
|
+
key: a.code,
|
|
129
|
+
value: a.code,
|
|
130
|
+
label: a.name
|
|
131
|
+
}, null, 8, ["value", "label"]))), 128))
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
}, 8, ["modelValue"])) : w("", !0),
|
|
135
|
+
t.level >= 3 ? (r(), v(n, {
|
|
136
|
+
key: 1,
|
|
137
|
+
placeholder: "区/县",
|
|
138
|
+
modelValue: i.value,
|
|
139
|
+
"onUpdate:modelValue": o[2] || (o[2] = (a) => i.value = a),
|
|
140
|
+
class: "flex-1",
|
|
141
|
+
filterable: "",
|
|
142
|
+
onChange: E
|
|
143
|
+
}, {
|
|
144
|
+
default: y(() => [
|
|
145
|
+
(r(!0), p(f, null, K(g.value.filter((a) => a.parentCode === s.value), (a) => (r(), v(l, {
|
|
146
|
+
key: a[t.valueKey],
|
|
147
|
+
value: a[t.valueKey],
|
|
148
|
+
label: a[t.nameKey]
|
|
149
|
+
}, null, 8, ["value", "label"]))), 128))
|
|
150
|
+
]),
|
|
151
|
+
_: 1
|
|
152
|
+
}, 8, ["modelValue"])) : w("", !0)
|
|
153
|
+
]);
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
export {
|
|
158
|
+
q as _
|
|
159
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineComponent as o, openBlock as n, createElementBlock as l, createElementVNode as c, normalizeClass as i, toDisplayString as r, renderSlot as a } from "vue";
|
|
2
|
+
import { _ as p } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
import './ContentTitle.css';const _ = { class: "flex items-baseline gap-x-[4px]" }, m = /* @__PURE__ */ o({
|
|
4
|
+
__name: "ContentTitle",
|
|
5
|
+
props: {
|
|
6
|
+
title: {}
|
|
7
|
+
},
|
|
8
|
+
setup(e) {
|
|
9
|
+
const s = e;
|
|
10
|
+
return (t, u) => (n(), l("div", _, [
|
|
11
|
+
c("h3", {
|
|
12
|
+
class: i(t.$style["content-title"])
|
|
13
|
+
}, r(s.title), 3),
|
|
14
|
+
a(t.$slots, "default")
|
|
15
|
+
]));
|
|
16
|
+
}
|
|
17
|
+
}), d = {
|
|
18
|
+
"content-title": "_content-title_1dl6y_1"
|
|
19
|
+
}, f = {
|
|
20
|
+
$style: d
|
|
21
|
+
}, x = /* @__PURE__ */ p(m, [["__cssModules", f]]);
|
|
22
|
+
export {
|
|
23
|
+
x as C
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._content-title_1dl6y_1{font-size:18px;font-family:MicrosoftYaHei,sans-serif;color:#0b0c24;font-weight:700}
|