npmapps 1.0.24 → 1.0.26

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.
Files changed (210) hide show
  1. package/app/.codegraph/daemon.pid +6 -0
  2. package/app/.eslintrc.js +19 -0
  3. package/app/README.md +24 -0
  4. package/app/babel.config.js +5 -0
  5. package/app/devtool-windows-amd64.zip +0 -0
  6. package/app/docs/superpowers/plans/2026-05-29-quill-editor.md +836 -0
  7. package/app/docs/superpowers/specs/2026-05-29-quill-editor-design.md +210 -0
  8. package/app/docs/superpowers/specs/2026-06-06-lazy-cascader-design.md +400 -0
  9. package/app/jsconfig.json +19 -0
  10. package/app/package-lock.json +21347 -0
  11. package/app/package.json +63 -0
  12. package/app/postcss.config.js +10 -0
  13. package/app/public/favicon.ico +0 -0
  14. package/app/public/index.html +17 -0
  15. package/app/public//344/270/200/351/224/256/351/273/221/346/232/227.html +136 -0
  16. package/app/src/App.vue +110 -0
  17. package/app/src/assets/bpmn-camunda.jpg +0 -0
  18. package/app/src/assets/css/diagram.less +17 -0
  19. package/app/src/assets/icon/Icon.less +31 -0
  20. package/app/src/assets/icon/font/app-codes.css +26 -0
  21. package/app/src/assets/icon/font/app.eot +0 -0
  22. package/app/src/assets/icon/font/app.svg +60 -0
  23. package/app/src/assets/icon/font/app.ttf +0 -0
  24. package/app/src/assets/icon/font/app.woff +0 -0
  25. package/app/src/assets/icon/font/app.woff2 +0 -0
  26. package/app/src/assets/icon/font/config.json +248 -0
  27. package/app/src/assets/icon/font/source/raw/align-bottom-tool.svg +30 -0
  28. package/app/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +85 -0
  29. package/app/src/assets/icon/font/source/raw/align-left-tool.svg +84 -0
  30. package/app/src/assets/icon/font/source/raw/align-right-tool.svg +80 -0
  31. package/app/src/assets/icon/font/source/raw/align-top-tool.svg +84 -0
  32. package/app/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +89 -0
  33. package/app/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +95 -0
  34. package/app/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +99 -0
  35. package/app/src/assets/icon/font/source/raw/set-color-tool.svg +111 -0
  36. package/app/src/assets/icon/font/source/symbols/align-bottom-tool.svg +30 -0
  37. package/app/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +30 -0
  38. package/app/src/assets/icon/font/source/symbols/align-left-tool.svg +30 -0
  39. package/app/src/assets/icon/font/source/symbols/align-right-tool.svg +30 -0
  40. package/app/src/assets/icon/font/source/symbols/align-top-tool.svg +30 -0
  41. package/app/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +30 -0
  42. package/app/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +30 -0
  43. package/app/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +30 -0
  44. package/app/src/assets/icon/font/source/symbols/set-color-tool.svg +63 -0
  45. package/app/src/assets/logo.png +0 -0
  46. package/app/src/components/EllTable/README.md +70 -0
  47. package/app/src/components/EllTable/article.md +184 -0
  48. package/app/src/components/EllTable/index.js +213 -0
  49. package/app/src/components/FormulaEditor/FunctionSelector.vue +123 -0
  50. package/app/src/components/FormulaEditor/OperatorSelector.vue +184 -0
  51. package/app/src/components/FormulaEditor/ParameterSelector.vue +123 -0
  52. package/app/src/components/FormulaEditor/api.js +69 -0
  53. package/app/src/components/FormulaEditor/index.vue +435 -0
  54. package/app/src/components/HelloWorld.vue +58 -0
  55. package/app/src/components/PageHeader/index.vue +158 -0
  56. package/app/src/components/Splitter/README.md +144 -0
  57. package/app/src/components/Splitter/example.vue +88 -0
  58. package/app/src/components/Splitter/index.vue +203 -0
  59. package/app/src/components/diagram/ToolBar.vue +357 -0
  60. package/app/src/components/diagram/customTranslate/customTranslate.js +12 -0
  61. package/app/src/components/diagram/customTranslate/translationsGerman.js +241 -0
  62. package/app/src/components/diagram/index.vue +261 -0
  63. package/app/src/components/diagram/xmlData.js +29 -0
  64. package/app/src/directives/filldown.js +155 -0
  65. package/app/src/directives/filldownTable.js +291 -0
  66. package/app/src/main.js +40 -0
  67. package/app/src/router/index.js +63 -0
  68. package/app/src/store/index.js +23 -0
  69. package/app/src/utils/winBox.js +23 -0
  70. package/app/src/views/Extend/A.vue +12 -0
  71. package/app/src/views/Extend/B.vue +10 -0
  72. package/app/src/views/Extend/MagicalComponentsForELFormItem.vue +87 -0
  73. package/app/src/views/Extend/index.vue +59 -0
  74. package/app/src/views/Extend/tableMouseHorizontalWheel.vue +193 -0
  75. package/app/src/views/Home.vue +37 -0
  76. package/app/src/views/RouterJump.vue +155 -0
  77. package/app/src/views/css.vue +57 -0
  78. package/app/src/views/cssComponents/EllipsisText.vue +83 -0
  79. package/app/src/views/cssComponents/HoverCard.vue +79 -0
  80. package/app/src/views/cssComponents/TableHover.vue +140 -0
  81. package/app/src/views/cssComponents/inputSlo.vue +52 -0
  82. package/app/src/views/cssComponents/tableFixed.vue +158 -0
  83. package/app/src/views/echarts/echart-dome.vue +82 -0
  84. package/app/src/views/echarts/index.vue +118 -0
  85. package/app/src/views/echarts/pei3d.vue +667 -0
  86. package/app/src/views/element/bpmn/index.vue +18 -0
  87. package/app/src/views/element/components/attendanceCycle/index.vue +131 -0
  88. package/app/src/views/element/components/attendanceGroup/index.vue +147 -0
  89. package/app/src/views/element/components/attendancePersonnel/index.vue +158 -0
  90. package/app/src/views/element/components/companyCalendar/index.vue +147 -0
  91. package/app/src/views/element/components/shift/index.vue +147 -0
  92. package/app/src/views/element/components/shiftRotationSystem/index.vue +147 -0
  93. package/app/src/views/element/elTableJsx/columnManagement.vue +340 -0
  94. package/app/src/views/element/elTableJsx/dialogInput.vue +71 -0
  95. package/app/src/views/element/elTableJsx/elTableJsx.vue +1826 -0
  96. package/app/src/views/element/elTableJsx/formTable.vue +598 -0
  97. package/app/src/views/element/elTableJsx/index.vue +29 -0
  98. package/app/src/views/element/elTableJsx/simpleTable.vue +192 -0
  99. package/app/src/views/element/elTableJsx.zip +0 -0
  100. package/app/src/views/element/index.vue +44 -0
  101. package/app/src/views/element/lazyCascader/LazyCascader.vue +302 -0
  102. package/app/src/views/element/lazyCascader/data.js +205 -0
  103. package/app/src/views/element/lazyCascader/index.vue +315 -0
  104. package/app/src/views/element/quillEditor/README.md +163 -0
  105. package/app/src/views/element/quillEditor/example.vue +314 -0
  106. package/app/src/views/element/quillEditor/index.vue +409 -0
  107. package/app/src/views/element/quillEditor/toolbar.js +122 -0
  108. package/app/vue.config.js +15 -0
  109. package/package.json +1 -1
  110. package/app/wujie-vue3-child/.claude/settings.local.json +0 -8
  111. package/app/wujie-vue3-child/.vscode/extensions.json +0 -3
  112. package/app/wujie-vue3-child/PROJECT_MEMORY.md +0 -427
  113. package/app/wujie-vue3-child/README.md +0 -5
  114. package/app/wujie-vue3-child/index.html +0 -13
  115. package/app/wujie-vue3-child/package-lock.json +0 -5744
  116. package/app/wujie-vue3-child/package.json +0 -28
  117. package/app/wujie-vue3-child/public/vite.svg +0 -1
  118. package/app/wujie-vue3-child/src/App.vue +0 -130
  119. package/app/wujie-vue3-child/src/assets/vue.svg +0 -1
  120. package/app/wujie-vue3-child/src/components/HelloWorld.vue +0 -43
  121. package/app/wujie-vue3-child/src/components/tags-view.vue +0 -193
  122. package/app/wujie-vue3-child/src/components/tags-view1.vue +0 -131
  123. package/app/wujie-vue3-child/src/directives/aiLoading.js +0 -182
  124. package/app/wujie-vue3-child/src/hooks/useClickOutside.js +0 -11
  125. package/app/wujie-vue3-child/src/hooks/useTableDragSort.js +0 -28
  126. package/app/wujie-vue3-child/src/main.js +0 -18
  127. package/app/wujie-vue3-child/src/router/index.js +0 -104
  128. package/app/wujie-vue3-child/src/store/tagsViewStroe.js +0 -34
  129. package/app/wujie-vue3-child/src/style.css +0 -171
  130. package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.jsx +0 -108
  131. package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.module.scss +0 -97
  132. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/README.md +0 -836
  133. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/REFLEX_EXAMPLES.md +0 -728
  134. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.jsx +0 -687
  135. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.module.scss +0 -560
  136. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.jsx +0 -570
  137. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.module.scss +0 -330
  138. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.jsx +0 -378
  139. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.module.scss +0 -228
  140. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.jsx +0 -399
  141. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.module.scss +0 -252
  142. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.jsx +0 -585
  143. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.module.scss +0 -331
  144. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.jsx +0 -392
  145. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.module.scss +0 -39
  146. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/README.md +0 -248
  147. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/SelectorTrigger.jsx +0 -194
  148. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/index.jsx +0 -1459
  149. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/mockData.js +0 -301
  150. package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.jsx +0 -182
  151. package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.module.scss +0 -28
  152. package/app/wujie-vue3-child/src/views/aiCoach/index.jsx +0 -293
  153. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.jsx +0 -121
  154. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.module.scss +0 -76
  155. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/DonutChart/index.jsx +0 -104
  156. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.jsx +0 -75
  157. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.module.scss +0 -12
  158. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.jsx +0 -62
  159. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.module.scss +0 -43
  160. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.jsx +0 -29
  161. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.module.scss +0 -5
  162. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.jsx +0 -58
  163. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.module.scss +0 -85
  164. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.jsx +0 -92
  165. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.module.scss +0 -56
  166. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.jsx +0 -40
  167. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.module.scss +0 -53
  168. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsDonut.jsx +0 -106
  169. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsRankBar.jsx +0 -132
  170. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.jsx +0 -176
  171. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.module.scss +0 -96
  172. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.jsx +0 -162
  173. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.module.scss +0 -16
  174. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.jsx +0 -29
  175. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.module.scss +0 -25
  176. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.jsx +0 -106
  177. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.module.scss +0 -164
  178. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.jsx +0 -182
  179. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.module.scss +0 -203
  180. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.jsx +0 -145
  181. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.module.scss +0 -126
  182. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.jsx +0 -67
  183. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.module.scss +0 -105
  184. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.jsx +0 -81
  185. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.module.scss +0 -47
  186. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.jsx +0 -64
  187. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.module.scss +0 -85
  188. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.jsx +0 -39
  189. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.module.scss +0 -44
  190. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.jsx +0 -83
  191. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.module.scss +0 -101
  192. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.jsx +0 -50
  193. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.module.scss +0 -25
  194. package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.jsx +0 -196
  195. package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.module.scss +0 -41
  196. package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.jsx +0 -183
  197. package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.module.scss +0 -115
  198. package/app/wujie-vue3-child/src/views/child-to-parent.vue +0 -117
  199. package/app/wujie-vue3-child/src/views/home.vue +0 -53
  200. package/app/wujie-vue3-child/src/views/jsx/btnSelect/btnSelect.vue +0 -169
  201. package/app/wujie-vue3-child/src/views/jsx/btnSelect/index.vue +0 -69
  202. package/app/wujie-vue3-child/src/views/jsx/com.vue +0 -44
  203. package/app/wujie-vue3-child/src/views/jsx/dialog.jsx +0 -66
  204. package/app/wujie-vue3-child/src/views/jsx/index.vue +0 -72
  205. package/app/wujie-vue3-child/src/views/jsx/props.vue +0 -33
  206. package/app/wujie-vue3-child/src/views/parent-to-child.vue +0 -225
  207. package/app/wujie-vue3-child/src/views/phone-code.vue +0 -318
  208. package/app/wujie-vue3-child/src/views/router-jump.vue +0 -123
  209. package/app/wujie-vue3-child/src/views/test.vue +0 -192
  210. package/app/wujie-vue3-child/vite.config.js +0 -15
@@ -0,0 +1,144 @@
1
+ # Splitter 分隔面板组件
2
+
3
+ 一个基于Vue2的可拖拽分隔面板组件,支持水平和垂直两种布局方式,可以灵活调整面板大小。
4
+
5
+ ## 特性
6
+
7
+ - 支持水平和垂直两种布局方式
8
+ - 可拖拽调整面板大小
9
+ - 支持设置最小/最大尺寸限制
10
+ - 支持百分比和像素两种尺寸单位
11
+ - 支持多面板分隔
12
+ - 响应式设计,自动适应容器大小
13
+
14
+ ## 安装
15
+
16
+ 组件位于 `src/components/Splitter` 目录下,直接复制到你的项目中即可使用。
17
+
18
+ ## 基础用法
19
+
20
+ ```vue
21
+ <template>
22
+ <Splitter>
23
+ <template #panel-1>
24
+ <div>左侧面板</div>
25
+ </template>
26
+ <template #panel-2>
27
+ <div>右侧面板</div>
28
+ </template>
29
+ </Splitter>
30
+ </template>
31
+
32
+ <script>
33
+ import Splitter from '@/components/Splitter'
34
+
35
+ export default {
36
+ components: {
37
+ Splitter
38
+ }
39
+ }
40
+ </script>
41
+ ```
42
+
43
+ ## API
44
+
45
+ ### Props
46
+
47
+ | 参数 | 说明 | 类型 | 默认值 |
48
+ | --- | --- | --- | --- |
49
+ | layout | 布局方向,可选值:'horizontal'\|'vertical' | string | 'horizontal' |
50
+ | panels | 面板配置数组 | array | `[{ size: '50%', min: '10%', max: '90%' }, { size: '50%', min: '10%', max: '90%' }]` |
51
+
52
+ ### Panel 配置项
53
+
54
+ | 参数 | 说明 | 类型 | 默认值 |
55
+ | --- | --- | --- | --- |
56
+ | size | 面板尺寸,支持百分比或像素值 | string\|number | '50%' |
57
+ | min | 最小尺寸限制 | string\|number | '0%' |
58
+ | max | 最大尺寸限制 | string\|number | '100%' |
59
+
60
+ ### Events
61
+
62
+ | 事件名称 | 说明 | 回调参数 |
63
+ | --- | --- | --- |
64
+ | resize | 拖拽调整大小时触发 | (sizes: string[]) 当前所有面板的尺寸数组 |
65
+ | resizeEnd | 拖拽结束时触发 | (sizes: string[]) 当前所有面板的尺寸数组 |
66
+
67
+ ### Slots
68
+
69
+ | 插槽名称 | 说明 |
70
+ | --- | --- |
71
+ | panel-{n} | 面板内容插槽,n 从 1 开始,对应面板的顺序 |
72
+
73
+ ## 示例
74
+
75
+ ### 垂直布局
76
+
77
+ ```vue
78
+ <template>
79
+ <Splitter layout="vertical" :panels="[
80
+ { size: '30%', min: '20%', max: '50%' },
81
+ { size: '70%', min: '50%', max: '80%' }
82
+ ]">
83
+ <template #panel-1>
84
+ <div>上部面板</div>
85
+ </template>
86
+ <template #panel-2>
87
+ <div>下部面板</div>
88
+ </template>
89
+ </Splitter>
90
+ </template>
91
+ ```
92
+
93
+ ### 多面板分隔
94
+
95
+ ```vue
96
+ <template>
97
+ <Splitter :panels="[
98
+ { size: '200px', min: '150px', max: '300px' },
99
+ { size: '50%', min: '30%', max: '60%' },
100
+ { size: '30%', min: '20%', max: '40%' }
101
+ ]">
102
+ <template #panel-1>
103
+ <div>左侧面板</div>
104
+ </template>
105
+ <template #panel-2>
106
+ <div>中间面板</div>
107
+ </template>
108
+ <template #panel-3>
109
+ <div>右侧面板</div>
110
+ </template>
111
+ </Splitter>
112
+ </template>
113
+ ```
114
+
115
+ ## 注意事项
116
+
117
+ 1. 容器必须设置高度,组件默认占满容器的宽度和高度
118
+ 2. 面板尺寸支持百分比和像素值,建议使用百分比以获得更好的响应式效果
119
+ 3. 最小和最大尺寸限制也支持百分比和像素值
120
+ 4. 垂直布局时,拖拽条显示在面板底部;水平布局时,拖拽条显示在面板右侧
121
+
122
+ ## 样式定制
123
+
124
+ 组件使用 scoped CSS,主要的样式类名:
125
+
126
+ - `.splitter`: 容器
127
+ - `.splitter-vertical`: 垂直布局
128
+ - `.splitter-horizontal`: 水平布局
129
+ - `.splitter-panel`: 面板
130
+ - `.splitter-trigger`: 拖拽条
131
+ - `.splitter-trigger-bar`: 拖拽条中间的线条
132
+
133
+ 你可以通过覆盖这些类名来自定义样式:
134
+
135
+ ```css
136
+ /* 自定义样式示例 */
137
+ .splitter-trigger:hover {
138
+ background-color: #e6e6e6;
139
+ }
140
+
141
+ .splitter-trigger-bar {
142
+ background-color: #1890ff;
143
+ }
144
+ ```
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <div class="example-container">
3
+ <PageHeader title="Splitter 分隔面板" description="可拖拽调整大小的分栏布局组件,支持水平/垂直两种布局,可配置多个面板及各面板的最小/最大尺寸限制" usage="&lt;Splitter :layout=&quot;'horizontal'&quot; :panels=&quot;[{ size: '200px', min: '150px' }]&quot;&gt; layout 控制方向(horizontal/vertical),panels 数组定义各面板尺寸限制" />
4
+
5
+ <h3>基础分隔面板</h3>
6
+ <div class="demo-box">
7
+ <Splitter>
8
+ <template #panel-1>
9
+ <div class="panel-content">Panel 1</div>
10
+ </template>
11
+ <template #panel-2>
12
+ <div class="panel-content">Panel 2</div>
13
+ </template>
14
+ </Splitter>
15
+ </div>
16
+
17
+ <h3>垂直分隔面板</h3>
18
+ <div class="demo-box">
19
+ <Splitter layout="vertical" :panels="[
20
+ { size: '30%', min: '20%', max: '50%' },
21
+ { size: '70%', min: '50%', max: '80%' }
22
+ ]">
23
+ <template #panel-1>
24
+ <div class="panel-content">Top Panel</div>
25
+ </template>
26
+ <template #panel-2>
27
+ <div class="panel-content">Bottom Panel</div>
28
+ </template>
29
+ </Splitter>
30
+ </div>
31
+
32
+ <h3>多面板分隔</h3>
33
+ <div class="demo-box">
34
+ <Splitter :panels="[
35
+ { size: '200px', min: '150px', max: '300px' },
36
+ { size: '50%', min: '30%', max: '60%' },
37
+ { size: '30%', min: '20%', max: '40%' }
38
+ ]">
39
+ <template #panel-1>
40
+ <div class="panel-content">Left</div>
41
+ </template>
42
+ <template #panel-2>
43
+ <div class="panel-content">Center</div>
44
+ </template>
45
+ <template #panel-3>
46
+ <div class="panel-content">Right</div>
47
+ </template>
48
+ </Splitter>
49
+ </div>
50
+ </div>
51
+ </template>
52
+
53
+ <script>
54
+ import Splitter from './index.vue'
55
+ import PageHeader from '@/components/PageHeader/index.vue'
56
+
57
+ export default {
58
+ name: 'SplitterExample',
59
+ components: {
60
+ Splitter,
61
+ PageHeader
62
+ }
63
+ }
64
+ </script>
65
+
66
+ <style scoped>
67
+ .example-container {
68
+ padding: 20px;
69
+ }
70
+
71
+ .demo-box {
72
+ margin: 20px 0;
73
+ border: 1px solid #f0f0f0;
74
+ border-radius: 4px;
75
+ height: 300px;
76
+ }
77
+
78
+ .panel-content {
79
+ height: 100%;
80
+ padding: 20px;
81
+ display: flex;
82
+ justify-content: center;
83
+ align-items: center;
84
+ background-color: #fafafa;
85
+ color: #666;
86
+ font-size: 16px;
87
+ }
88
+ </style>
@@ -0,0 +1,203 @@
1
+ <template>
2
+ <div
3
+ class="splitter"
4
+ :class="{
5
+ 'splitter-vertical': layout === 'vertical',
6
+ 'splitter-horizontal': layout === 'horizontal'
7
+ }"
8
+ >
9
+ <div
10
+ v-for="(panel, index) in panels"
11
+ :key="index"
12
+ class="splitter-panel"
13
+ :style="getPanelStyle(index)"
14
+ >
15
+ <slot :name="`panel-${index + 1}`"></slot>
16
+ <div
17
+ v-if="index < panels.length - 1"
18
+ class="splitter-trigger"
19
+ :class="{
20
+ 'splitter-trigger-vertical': layout === 'vertical',
21
+ 'splitter-trigger-horizontal': layout === 'horizontal'
22
+ }"
23
+ @mousedown="handleMouseDown($event, index)"
24
+ >
25
+ <div class="splitter-trigger-bar"></div>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </template>
30
+
31
+ <script>
32
+ export default {
33
+ name: 'Splitter',
34
+ props: {
35
+ layout: {
36
+ type: String,
37
+ default: 'horizontal',
38
+ validator: value => ['horizontal', 'vertical'].includes(value)
39
+ },
40
+ panels: {
41
+ type: Array,
42
+ default: () => [
43
+ { size: '50%', min: '10%', max: '90%' },
44
+ { size: '50%', min: '10%', max: '90%' }
45
+ ],
46
+ validator: value => value.length >= 2
47
+ }
48
+ },
49
+ data() {
50
+ return {
51
+ sizes: [],
52
+ isDragging: false,
53
+ startPosition: 0,
54
+ currentPanelIndex: -1
55
+ }
56
+ },
57
+ created() {
58
+ this.initializeSizes()
59
+ },
60
+ methods: {
61
+ initializeSizes() {
62
+ this.sizes = this.panels.map(panel => {
63
+ const size = panel.size || '50%'
64
+ return size.toString().includes('%') ? size : `${size}px`
65
+ })
66
+ },
67
+ getPanelStyle(index) {
68
+ const size = this.sizes[index]
69
+ return {
70
+ [this.layout === 'horizontal' ? 'width' : 'height']: size,
71
+ [this.layout === 'horizontal' ? 'height' : 'width']: '100%'
72
+ }
73
+ },
74
+ handleMouseDown(event, index) {
75
+ this.isDragging = true
76
+ this.currentPanelIndex = index
77
+ this.startPosition = this.layout === 'horizontal' ? event.clientX : event.clientY
78
+
79
+ document.addEventListener('mousemove', this.handleMouseMove)
80
+ document.addEventListener('mouseup', this.handleMouseUp)
81
+
82
+ // 防止文本选中
83
+ event.preventDefault()
84
+ },
85
+ handleMouseMove(event) {
86
+ if (!this.isDragging) return
87
+
88
+ const currentPosition = this.layout === 'horizontal' ? event.clientX : event.clientY
89
+ const delta = currentPosition - this.startPosition
90
+
91
+ const containerSize = this.layout === 'horizontal'
92
+ ? this.$el.offsetWidth
93
+ : this.$el.offsetHeight
94
+
95
+ const panel1 = this.panels[this.currentPanelIndex]
96
+ const panel2 = this.panels[this.currentPanelIndex + 1]
97
+
98
+ let size1 = this.parseSize(this.sizes[this.currentPanelIndex], containerSize)
99
+ let size2 = this.parseSize(this.sizes[this.currentPanelIndex + 1], containerSize)
100
+
101
+ size1 += delta
102
+ size2 -= delta
103
+
104
+ // 检查最小/最大限制
105
+ const min1 = this.parseSize(panel1.min || '0%', containerSize)
106
+ const max1 = this.parseSize(panel1.max || '100%', containerSize)
107
+ const min2 = this.parseSize(panel2.min || '0%', containerSize)
108
+ const max2 = this.parseSize(panel2.max || '100%', containerSize)
109
+
110
+ if (size1 < min1 || size1 > max1 || size2 < min2 || size2 > max2) return
111
+
112
+ this.sizes.splice(this.currentPanelIndex, 2,
113
+ `${(size1 / containerSize * 100).toFixed(2)}%`,
114
+ `${(size2 / containerSize * 100).toFixed(2)}%`
115
+ )
116
+
117
+ this.startPosition = currentPosition
118
+ this.$emit('resize', this.sizes)
119
+ },
120
+ handleMouseUp() {
121
+ this.isDragging = false
122
+ this.currentPanelIndex = -1
123
+
124
+ document.removeEventListener('mousemove', this.handleMouseMove)
125
+ document.removeEventListener('mouseup', this.handleMouseUp)
126
+
127
+ this.$emit('resizeEnd', this.sizes)
128
+ },
129
+ parseSize(size, containerSize) {
130
+ if (typeof size === 'number') return size
131
+ if (size.endsWith('%')) {
132
+ return (parseFloat(size) / 100) * containerSize
133
+ }
134
+ return parseFloat(size)
135
+ }
136
+ }
137
+ }
138
+ </script>
139
+
140
+ <style scoped>
141
+ .splitter {
142
+ display: flex;
143
+ width: 100%;
144
+ height: 100%;
145
+ overflow: hidden;
146
+ }
147
+
148
+ .splitter-vertical {
149
+ flex-direction: column;
150
+ }
151
+
152
+ .splitter-horizontal {
153
+ flex-direction: row;
154
+ }
155
+
156
+ .splitter-panel {
157
+ position: relative;
158
+ flex-shrink: 0;
159
+ }
160
+
161
+ .splitter-trigger {
162
+ position: absolute;
163
+ display: flex;
164
+ justify-content: center;
165
+ align-items: center;
166
+ z-index: 1;
167
+ transition: background-color 0.2s;
168
+ }
169
+
170
+ .splitter-trigger:hover {
171
+ background-color: #f0f0f0;
172
+ }
173
+
174
+ .splitter-trigger-horizontal {
175
+ top: 0;
176
+ right: -6px;
177
+ width: 12px;
178
+ height: 100%;
179
+ cursor: col-resize;
180
+ }
181
+
182
+ .splitter-trigger-vertical {
183
+ left: 0;
184
+ bottom: -6px;
185
+ width: 100%;
186
+ height: 12px;
187
+ cursor: row-resize;
188
+ }
189
+
190
+ .splitter-trigger-bar {
191
+ background-color: #d9d9d9;
192
+ }
193
+
194
+ .splitter-trigger-horizontal .splitter-trigger-bar {
195
+ width: 2px;
196
+ height: 100%;
197
+ }
198
+
199
+ .splitter-trigger-vertical .splitter-trigger-bar {
200
+ width: 100%;
201
+ height: 2px;
202
+ }
203
+ </style>