pit-docs-mcp 1.0.2

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 (203) hide show
  1. package/README.md +180 -0
  2. package/dist/codegen.d.ts +5 -0
  3. package/dist/codegen.d.ts.map +1 -0
  4. package/dist/codegen.js +112 -0
  5. package/dist/constants.d.ts +6 -0
  6. package/dist/constants.d.ts.map +1 -0
  7. package/dist/constants.js +10 -0
  8. package/dist/index.d.ts +3 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +115 -0
  11. package/dist/resources.d.ts +3 -0
  12. package/dist/resources.d.ts.map +1 -0
  13. package/dist/resources.js +80 -0
  14. package/dist/tools.d.ts +3 -0
  15. package/dist/tools.d.ts.map +1 -0
  16. package/dist/tools.js +258 -0
  17. package/dist/utils.d.ts +26 -0
  18. package/dist/utils.d.ts.map +1 -0
  19. package/dist/utils.js +198 -0
  20. package/docs/codegen/pit-simplify-web.md +686 -0
  21. package/docs/pitBusinessUi/README.md +102 -0
  22. package/docs/pitBusinessUi/add-date-picker.md +57 -0
  23. package/docs/pitBusinessUi/add-operation.md +64 -0
  24. package/docs/pitBusinessUi/batch-download.md +44 -0
  25. package/docs/pitBusinessUi/bill-tree-dialog.md +82 -0
  26. package/docs/pitBusinessUi/collapse.md +88 -0
  27. package/docs/pitBusinessUi/date-time-picker.md +74 -0
  28. package/docs/pitBusinessUi/design-report-explain.md +47 -0
  29. package/docs/pitBusinessUi/dialog.md +89 -0
  30. package/docs/pitBusinessUi/dic-radio.md +67 -0
  31. package/docs/pitBusinessUi/dic.md +78 -0
  32. package/docs/pitBusinessUi/document-preview.md +54 -0
  33. package/docs/pitBusinessUi/drawer.md +67 -0
  34. package/docs/pitBusinessUi/editor.md +63 -0
  35. package/docs/pitBusinessUi/expand-search-form.md +65 -0
  36. package/docs/pitBusinessUi/file-preview.md +56 -0
  37. package/docs/pitBusinessUi/flow-table-status.md +47 -0
  38. package/docs/pitBusinessUi/icon-box.md +74 -0
  39. package/docs/pitBusinessUi/image-preview.md +55 -0
  40. package/docs/pitBusinessUi/image.md +53 -0
  41. package/docs/pitBusinessUi/input-formatter.md +100 -0
  42. package/docs/pitBusinessUi/input-number.md +47 -0
  43. package/docs/pitBusinessUi/input-select.md +68 -0
  44. package/docs/pitBusinessUi/input.md +56 -0
  45. package/docs/pitBusinessUi/jm-preview.md +47 -0
  46. package/docs/pitBusinessUi/json-editor.md +71 -0
  47. package/docs/pitBusinessUi/loading-btn.md +64 -0
  48. package/docs/pitBusinessUi/monaco.md +82 -0
  49. package/docs/pitBusinessUi/money-input.md +59 -0
  50. package/docs/pitBusinessUi/pagination.md +70 -0
  51. package/docs/pitBusinessUi/password-strength.md +59 -0
  52. package/docs/pitBusinessUi/positive-number.md +63 -0
  53. package/docs/pitBusinessUi/preview-image.md +62 -0
  54. package/docs/pitBusinessUi/preview-office.md +50 -0
  55. package/docs/pitBusinessUi/preview.md +57 -0
  56. package/docs/pitBusinessUi/quill.md +52 -0
  57. package/docs/pitBusinessUi/runflow-btn.md +52 -0
  58. package/docs/pitBusinessUi/search-date-picker.md +60 -0
  59. package/docs/pitBusinessUi/select-bid-list.md +66 -0
  60. package/docs/pitBusinessUi/select-color.md +38 -0
  61. package/docs/pitBusinessUi/select-contract-tree.md +41 -0
  62. package/docs/pitBusinessUi/select-dept.md +38 -0
  63. package/docs/pitBusinessUi/select-project-unit.md +48 -0
  64. package/docs/pitBusinessUi/select-section-tree.md +45 -0
  65. package/docs/pitBusinessUi/select-section.md +66 -0
  66. package/docs/pitBusinessUi/select-string.md +60 -0
  67. package/docs/pitBusinessUi/select-system-unit.md +41 -0
  68. package/docs/pitBusinessUi/select-user-by-role.md +51 -0
  69. package/docs/pitBusinessUi/switch.md +43 -0
  70. package/docs/pitBusinessUi/table-contract.md +66 -0
  71. package/docs/pitBusinessUi/table-operation.md +81 -0
  72. package/docs/pitBusinessUi/table.md +75 -0
  73. package/docs/pitBusinessUi/tag.md +86 -0
  74. package/docs/pitBusinessUi/textarea.md +65 -0
  75. package/docs/pitBusinessUi/transfer-direct.md +57 -0
  76. package/docs/pitBusinessUi/transfer-user-project.md +78 -0
  77. package/docs/pitBusinessUi/transfer.md +68 -0
  78. package/docs/pitBusinessUi/tree-lazy.md +72 -0
  79. package/docs/pitBusinessUi/tree-select-name.md +59 -0
  80. package/docs/pitBusinessUi/tree-select-plus.md +106 -0
  81. package/docs/pitBusinessUi/tree-select.md +86 -0
  82. package/docs/pitBusinessUi/upload-avatar.md +60 -0
  83. package/docs/pitBusinessUi/upload-file-dialog.md +86 -0
  84. package/docs/pitBusinessUi/upload-file.md +77 -0
  85. package/docs/pitBusinessUi/upload-list-card.md +62 -0
  86. package/docs/pitBusinessUi/upload-table.md +77 -0
  87. package/docs/pitBusinessUi/user-transform.md +72 -0
  88. package/docs/pitBusinessUi/utils.md +272 -0
  89. package/docs/pitBusinessUtils/README.md +144 -0
  90. package/docs/pitBusinessUtils/auth.md +170 -0
  91. package/docs/pitBusinessUtils/clipboard.md +72 -0
  92. package/docs/pitBusinessUtils/filePreview.md +60 -0
  93. package/docs/pitBusinessUtils/formValidate.md +75 -0
  94. package/docs/pitBusinessUtils/generateTitle.md +49 -0
  95. package/docs/pitBusinessUtils/get-page-title.md +65 -0
  96. package/docs/pitBusinessUtils/i18n.md +130 -0
  97. package/docs/pitBusinessUtils/jwks.md +82 -0
  98. package/docs/pitBusinessUtils/oss.md +391 -0
  99. package/docs/pitBusinessUtils/passwordValidate.md +120 -0
  100. package/docs/pitBusinessUtils/pit.md +496 -0
  101. package/docs/pitBusinessUtils/print.md +126 -0
  102. package/docs/pitBusinessUtils/request.md +137 -0
  103. package/docs/pitBusinessUtils/scroll-to.md +68 -0
  104. package/docs/pitBusinessUtils/utils.md +762 -0
  105. package/docs/pitBusinessUtils/validate.md +224 -0
  106. package/docs/pitElementUi/alert.md +238 -0
  107. package/docs/pitElementUi/avatar.md +147 -0
  108. package/docs/pitElementUi/backtop.md +60 -0
  109. package/docs/pitElementUi/badge.md +120 -0
  110. package/docs/pitElementUi/base-tabs.md +73 -0
  111. package/docs/pitElementUi/border.md +135 -0
  112. package/docs/pitElementUi/breadcrumb.md +44 -0
  113. package/docs/pitElementUi/button.md +301 -0
  114. package/docs/pitElementUi/calendar.md +66 -0
  115. package/docs/pitElementUi/card.md +170 -0
  116. package/docs/pitElementUi/carousel.md +212 -0
  117. package/docs/pitElementUi/cascader.md +1966 -0
  118. package/docs/pitElementUi/checkbox.md +283 -0
  119. package/docs/pitElementUi/collapse.md +131 -0
  120. package/docs/pitElementUi/color-picker.md +123 -0
  121. package/docs/pitElementUi/color.md +244 -0
  122. package/docs/pitElementUi/container.md +240 -0
  123. package/docs/pitElementUi/custom-theme.md +131 -0
  124. package/docs/pitElementUi/date-picker.md +448 -0
  125. package/docs/pitElementUi/datetime-picker.md +254 -0
  126. package/docs/pitElementUi/descriptions.md +191 -0
  127. package/docs/pitElementUi/dialog-header.md +53 -0
  128. package/docs/pitElementUi/dialog.md +239 -0
  129. package/docs/pitElementUi/divider.md +61 -0
  130. package/docs/pitElementUi/drawer.md +307 -0
  131. package/docs/pitElementUi/dropdown.md +308 -0
  132. package/docs/pitElementUi/empty.md +61 -0
  133. package/docs/pitElementUi/font-family.md +90 -0
  134. package/docs/pitElementUi/form-base.md +1239 -0
  135. package/docs/pitElementUi/form-item-checkbox-group.md +48 -0
  136. package/docs/pitElementUi/form-item-date.md +60 -0
  137. package/docs/pitElementUi/form-item-dic.md +18 -0
  138. package/docs/pitElementUi/form-item-editor.md +16 -0
  139. package/docs/pitElementUi/form-item-input-money.md +19 -0
  140. package/docs/pitElementUi/form-item-input-number.md +20 -0
  141. package/docs/pitElementUi/form-item-input.md +18 -0
  142. package/docs/pitElementUi/form-item-radio-group.md +21 -0
  143. package/docs/pitElementUi/form-item-select.md +21 -0
  144. package/docs/pitElementUi/form-item-switch.md +15 -0
  145. package/docs/pitElementUi/form-item-textarea.md +20 -0
  146. package/docs/pitElementUi/form-item-tree-select.md +27 -0
  147. package/docs/pitElementUi/form-item-upload-card.md +18 -0
  148. package/docs/pitElementUi/form-item-upload.md +1 -0
  149. package/docs/pitElementUi/form-two.md +102 -0
  150. package/docs/pitElementUi/form.md +952 -0
  151. package/docs/pitElementUi/i18n.md +228 -0
  152. package/docs/pitElementUi/icon-custom.md +99 -0
  153. package/docs/pitElementUi/icon-line-custom.md +12 -0
  154. package/docs/pitElementUi/icon.md +28 -0
  155. package/docs/pitElementUi/image.md +178 -0
  156. package/docs/pitElementUi/infiniteScroll.md +87 -0
  157. package/docs/pitElementUi/input-number.md +197 -0
  158. package/docs/pitElementUi/input-select.md +1 -0
  159. package/docs/pitElementUi/input.md +800 -0
  160. package/docs/pitElementUi/installation.md +9 -0
  161. package/docs/pitElementUi/layout-column.md +376 -0
  162. package/docs/pitElementUi/layout-tree.md +715 -0
  163. package/docs/pitElementUi/layout.md +354 -0
  164. package/docs/pitElementUi/link.md +66 -0
  165. package/docs/pitElementUi/loading.md +208 -0
  166. package/docs/pitElementUi/menu.md +403 -0
  167. package/docs/pitElementUi/message-box.md +326 -0
  168. package/docs/pitElementUi/message.md +219 -0
  169. package/docs/pitElementUi/notification.md +311 -0
  170. package/docs/pitElementUi/page-header.md +40 -0
  171. package/docs/pitElementUi/pagination.md +200 -0
  172. package/docs/pitElementUi/popconfirm.md +60 -0
  173. package/docs/pitElementUi/popover.md +167 -0
  174. package/docs/pitElementUi/progress.md +178 -0
  175. package/docs/pitElementUi/quickstart.md +290 -0
  176. package/docs/pitElementUi/radio.md +211 -0
  177. package/docs/pitElementUi/rate.md +135 -0
  178. package/docs/pitElementUi/result.md +76 -0
  179. package/docs/pitElementUi/select-tree.md +661 -0
  180. package/docs/pitElementUi/select.md +586 -0
  181. package/docs/pitElementUi/skeleton.md +316 -0
  182. package/docs/pitElementUi/slider.md +237 -0
  183. package/docs/pitElementUi/steps.md +154 -0
  184. package/docs/pitElementUi/switch.md +142 -0
  185. package/docs/pitElementUi/table.md +4023 -0
  186. package/docs/pitElementUi/tabs.md +303 -0
  187. package/docs/pitElementUi/tag.md +203 -0
  188. package/docs/pitElementUi/time-picker.md +199 -0
  189. package/docs/pitElementUi/timeline.md +154 -0
  190. package/docs/pitElementUi/tooltip.md +177 -0
  191. package/docs/pitElementUi/transfer.md +249 -0
  192. package/docs/pitElementUi/transition.md +155 -0
  193. package/docs/pitElementUi/tree.md +1157 -0
  194. package/docs/pitElementUi/typography.md +151 -0
  195. package/docs/pitElementUi/upload-table.md +39 -0
  196. package/docs/pitElementUi/upload.md +392 -0
  197. package/docs/pitElementUi/virtual-list.md +154 -0
  198. package/docs/pitElementUi/virtual-select-tree.md +243 -0
  199. package/docs/pitElementUi/virtual-select.md +451 -0
  200. package/docs/pitElementUi/virtual-table-column.md +1 -0
  201. package/docs/pitElementUi/virtual-table.md +490 -0
  202. package/docs/pitElementUi/virtual-tree.md +119 -0
  203. package/package.json +33 -0
@@ -0,0 +1,100 @@
1
+ # pit-input-formatter 格式化输入框
2
+
3
+ 带单位后缀的输入框,支持内置格式化预设(距离、温度等)和自定义格式化函数,可控制数值范围、精度、是否整数等。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | value / v-model | 绑定值 | String / Number | `""` |
10
+ | unit | 后缀单位(`plain=false` 时展示) | String | `"m"` |
11
+ | plain | 是否隐藏单位后缀 | Boolean | `false` |
12
+ | formatter | 自定义格式化函数(优先于 formatterPreset) | Function | `null` |
13
+ | formatterPreset | 内置预设名称 | String | `"null"` |
14
+ | placeholder | 占位文本 | String | `"请输入"` |
15
+ | describe | 格式化参数配置(配合内置预设) | Object | `{}` |
16
+ | maxMinChange | 超出范围时是否自动修正为边界值(`false` 则恢复上次值) | Boolean | `false` |
17
+
18
+ **formatterPreset 可选值**
19
+
20
+ | 预设名 | 说明 |
21
+ | --- | --- |
22
+ | `distance` | 距离(3位小数) |
23
+ | `temperature` | 温度(3位小数,-99~99) |
24
+ | `numberLimit` | 自定义数值范围,配合 `describe` |
25
+
26
+ **describe 可配置字段**(用于 `numberLimit`)
27
+
28
+ | 字段 | 说明 | 默认值 |
29
+ | --- | --- | --- |
30
+ | int | 是否为整数 | `true` |
31
+ | fixed | 小数位数 | `0` |
32
+ | max | 最大值 | `1e10` |
33
+ | min | 最小值 | `-1e10` |
34
+ | maxLen | 整数位最大长度 | `10` |
35
+ | negative | 是否允许负数 | `true` |
36
+
37
+ ## Events
38
+
39
+ | 事件名 | 说明 | 参数 |
40
+ | --- | --- | --- |
41
+ | input | 值变化(v-model) | `String` |
42
+
43
+ ## 示例
44
+
45
+ ### 使用内置距离预设(保留 3 位小数,单位 m)
46
+
47
+ ```vue
48
+ <pit-input-formatter
49
+ v-model="form.length"
50
+ formatter-preset="distance"
51
+ unit="m" />
52
+ ```
53
+
54
+ ### 使用温度预设
55
+
56
+ ```vue
57
+ <pit-input-formatter
58
+ v-model="form.temperature"
59
+ formatter-preset="temperature"
60
+ unit="°C" />
61
+ ```
62
+
63
+ ### 自定义数值范围(2 位小数,0~999)
64
+
65
+ ```vue
66
+ <pit-input-formatter
67
+ v-model="form.ratio"
68
+ formatter-preset="numberLimit"
69
+ unit="%"
70
+ :describe="{ int: false, fixed: 2, max: 999, min: 0, negative: false }"
71
+ :max-min-change="true" />
72
+ ```
73
+
74
+ ### 自定义格式化函数
75
+
76
+ ```vue
77
+ <pit-input-formatter
78
+ v-model="form.custom"
79
+ :formatter="myFormatter"
80
+ unit="kg" />
81
+
82
+ <script>
83
+ methods: {
84
+ myFormatter(val) {
85
+ return val.replace(/[^\d.]/g, '')
86
+ }
87
+ }
88
+ </script>
89
+ ```
90
+
91
+ ### 隐藏单位(plain 模式)
92
+
93
+ ```vue
94
+ <pit-input-formatter v-model="form.value" formatter-preset="distance" plain />
95
+ ```
96
+
97
+ ## 注意事项
98
+
99
+ - `formatterPreset` 与 `formatter` 同时传时,以 `formatter` 为准。
100
+ - `maxMinChange=false` 时,超出范围输入会恢复为上次合法值;`maxMinChange=true` 时,超出范围自动修正为边界值。
@@ -0,0 +1,47 @@
1
+ # pit-input-number 数字输入框
2
+
3
+ 对 `el-input-number` 的封装,控件位置默认在右侧,最大值默认从 `$Business.inputNumberMax` 读取。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | value / v-model | 绑定值 | Number | `0` |
10
+ | min | 最小值 | Number | `0` |
11
+ | max | 最大值(未传则读取 `$Business.inputNumberMax`) | Number | — |
12
+ | controlsPosition | 控制按钮位置 | String | `"right"` |
13
+
14
+ > 其余 `el-input-number` 属性通过 `v-bind="$attrs"` 透传。
15
+
16
+ ## Events
17
+
18
+ | 事件名 | 说明 | 参数 |
19
+ | --- | --- | --- |
20
+ | input | 值变化(v-model) | `Number` |
21
+ | change | 值变化 | `Number` |
22
+
23
+ ## 示例
24
+
25
+ ### 基础用法
26
+
27
+ ```vue
28
+ <pit-input-number v-model="form.count" />
29
+ ```
30
+
31
+ ### 自定义范围
32
+
33
+ ```vue
34
+ <pit-input-number v-model="form.percent" :min="0" :max="100" />
35
+ ```
36
+
37
+ ### 修改全局最大值
38
+
39
+ ```js
40
+ // main.js 注册时配置
41
+ Vue.use(PitBusinessUI, { inputNumberMax: 99999999 })
42
+ ```
43
+
44
+ ## 注意事项
45
+
46
+ - 输入 `null` / 空时,组件内部统一置为 `0`(见源码)。
47
+ - 全局默认最大值通过 `inputNumberMax` 配置,默认为 `9999`。
@@ -0,0 +1,68 @@
1
+ # pit-input-select 输入选择框
2
+
3
+ 显示为只读输入框 + 右侧图标,用于点击后弹出自定义选择面板的场景(配合 Dialog / Drawer 使用)。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | value / v-model | 绑定值(展示文本) | String | `""` |
10
+ | suffixIcon | 右侧 icon class | String | `"el-icon-arrow-right"` |
11
+ | disabled | 是否禁用 | Boolean | `false` |
12
+ | readonly | 是否只读 | Boolean | `false` |
13
+ | clearable | 是否显示清空按钮 | Boolean | `true` |
14
+ | placeholder | 占位文本 | String | `"请选择"` |
15
+
16
+ > 其余 `el-input` 属性通过 `v-bind="$attrs"` 透传。
17
+
18
+ ## Events
19
+
20
+ | 事件名 | 说明 | 参数 |
21
+ | --- | --- | --- |
22
+ | input | 值变化时触发(v-model) | `String` |
23
+ | change | 值变化时触发 | `String` |
24
+
25
+ ## 示例
26
+
27
+ ### 基础用法(点击打开选择弹窗)
28
+
29
+ ```vue
30
+ <template>
31
+ <div>
32
+ <pit-input-select
33
+ v-model="selected"
34
+ placeholder="请选择部门"
35
+ @click.native="showDialog = true" />
36
+
37
+ <pit-dialog :visible.sync="showDialog" title="选择部门">
38
+ <!-- 部门树组件 -->
39
+ <dept-tree @select="onDeptSelect" />
40
+ </pit-dialog>
41
+ </div>
42
+ </template>
43
+
44
+ <script>
45
+ export default {
46
+ data() {
47
+ return { selected: '', showDialog: false }
48
+ },
49
+ methods: {
50
+ onDeptSelect(dept) {
51
+ this.selected = dept.name
52
+ this.showDialog = false
53
+ }
54
+ }
55
+ }
56
+ </script>
57
+ ```
58
+
59
+ ### 禁用状态
60
+
61
+ ```vue
62
+ <pit-input-select v-model="value" disabled />
63
+ ```
64
+
65
+ ## 注意事项
66
+
67
+ - 该组件本身不内置弹窗,仅提供"选择框外观",需配合弹窗/抽屉组合使用。
68
+ - 点击触发事件推荐使用 `@click.native` 绑定在组件上。
@@ -0,0 +1,56 @@
1
+ # pit-input 输入框
2
+
3
+ 对 `el-input` 的封装,统一 `maxlength`、`show-word-limit`,默认从 `$Business.inputMaxlength` 读取最大长度。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | value / v-model | 绑定值 | String / Number | `""` |
10
+ | maxlength | 最大输入长度(未传则读取 `$Business.inputMaxlength`) | Number | — |
11
+ | clearable | 是否可清空 | Boolean | `true` |
12
+ | placeholder | 占位文本 | String | — |
13
+
14
+ > 其余 `el-input` 属性通过 `v-bind="$attrs"` 透传,事件通过 `v-on="$listeners"` 透传。
15
+
16
+ ## Events
17
+
18
+ | 事件名 | 说明 | 参数 |
19
+ | --- | --- | --- |
20
+ | input | 输入时触发,用于 v-model | `String / Number` |
21
+ | change | 值变化时触发 | `String / Number` |
22
+
23
+ ## Slots
24
+
25
+ | 插槽名 | 说明 |
26
+ | --- | --- |
27
+ | prepend | 前置内容 |
28
+ | append | 后置内容 |
29
+
30
+ ## 示例
31
+
32
+ ### 基础用法
33
+
34
+ ```vue
35
+ <pit-input v-model="form.name" placeholder="请输入姓名" />
36
+ ```
37
+
38
+ ### 自定义最大长度
39
+
40
+ ```vue
41
+ <pit-input v-model="form.remark" :maxlength="200" placeholder="请输入备注" />
42
+ ```
43
+
44
+ ### 带前后缀
45
+
46
+ ```vue
47
+ <pit-input v-model="form.url">
48
+ <template slot="prepend">https://</template>
49
+ <template slot="append">.com</template>
50
+ </pit-input>
51
+ ```
52
+
53
+ ## 注意事项
54
+
55
+ - 组件已默认开启 `show-word-limit`,无需额外配置。
56
+ - 全局默认最大长度通过 `Vue.use(PitBusinessUI, { inputMaxlength: 100 })` 修改。
@@ -0,0 +1,47 @@
1
+ # pit-jm-preview 积木报表预览
2
+
3
+ 极简的积木报表(JimuReport)内嵌预览组件,将外部传入的报表 URL 渲染在 `<iframe>` 中。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | previewUrl | 积木报表完整预览 URL(含参数) | String | `""` |
10
+
11
+ ## 示例
12
+
13
+ ### 基础用法
14
+
15
+ ```vue
16
+ <pit-jm-preview :preview-url="reportUrl" />
17
+ ```
18
+
19
+ ### 动态拼接报表参数
20
+
21
+ ```vue
22
+ <template>
23
+ <pit-jm-preview :preview-url="getReportUrl()" />
24
+ </template>
25
+
26
+ <script>
27
+ export default {
28
+ computed: {
29
+ getReportUrl() {
30
+ const base = this.env.VUE_APP_JM_URL + '/jmreport/show'
31
+ const params = new URLSearchParams({
32
+ id: this.reportId,
33
+ projectId: localStorage.getItem('projectId'),
34
+ token: this.getToken()
35
+ })
36
+ return `${base}?${params}`
37
+ }
38
+ }
39
+ }
40
+ </script>
41
+ ```
42
+
43
+ ## 注意事项
44
+
45
+ - 组件不处理 URL 生成逻辑,完整 URL 需由父组件构造好后传入。
46
+ - `iframe` 宽高默认铺满父容器(`.pit-jm-preview` 使用 `width: 100%; height: 100%`),请保证父容器有明确高度。
47
+ - 若积木报表系统要求携带鉴权 Token,需在 URL 参数中自行拼接。
@@ -0,0 +1,71 @@
1
+ # pit-json-editor JSON 编辑器
2
+
3
+ 基于 `CodeMirror` 的 JSON 专用编辑器,带行号、实时 JSON lint 校验。
4
+
5
+ ## 前置依赖
6
+
7
+ - `codemirror`(含 json lint 插件)
8
+
9
+ ## Props
10
+
11
+ | 参数 | 说明 | 类型 | 默认值 |
12
+ | --- | --- | --- | --- |
13
+ | value / v-model | JSON 对象(组件内部自动 `JSON.stringify` 格式化显示) | any | — |
14
+
15
+ ## Events
16
+
17
+ | 事件名 | 说明 | 参数 |
18
+ | --- | --- | --- |
19
+ | input | 编辑器内容变化(v-model) | `String`(JSON 字符串,可能非法) |
20
+ | changed | 同 input | `String` |
21
+
22
+ ## Methods
23
+
24
+ | 方法名 | 说明 | 返回值 |
25
+ | --- | --- | --- |
26
+ | `getValue()` | 获取编辑器当前原始字符串 | `String` |
27
+
28
+ ## 示例
29
+
30
+ ### 基础用法
31
+
32
+ ```vue
33
+ <pit-json-editor v-model="jsonData" />
34
+
35
+ <script>
36
+ export default {
37
+ data() {
38
+ return {
39
+ jsonData: { name: 'test', version: 1 }
40
+ }
41
+ }
42
+ }
43
+ </script>
44
+ ```
45
+
46
+ ### 提交前解析验证
47
+
48
+ ```vue
49
+ <pit-json-editor ref="jsonEditor" v-model="rawJson" />
50
+
51
+ <el-button @click="submit">提交</el-button>
52
+
53
+ <script>
54
+ methods: {
55
+ submit() {
56
+ try {
57
+ const parsed = JSON.parse(this.$refs.jsonEditor.getValue())
58
+ this.saveConfig(parsed)
59
+ } catch (e) {
60
+ this.$message.error('JSON 格式错误,请检查后重试')
61
+ }
62
+ }
63
+ }
64
+ </script>
65
+ ```
66
+
67
+ ## 注意事项
68
+
69
+ - `value` 传入的是 **对象**,组件内部在 `mounted` 和 `watch` 中调用 `JSON.stringify(value, null, 2)` 格式化显示。
70
+ - `input`/`changed` 事件输出的是**字符串**(可能存在语法错误),提交前需 `JSON.parse` 验证。
71
+ - lint 错误以红色下划线标注(CodeMirror lint 插件),但不会阻止 `input` 事件触发。
@@ -0,0 +1,64 @@
1
+ # pit-loading-btn 加载按钮
2
+
3
+ 点击后自动进入 Loading 状态,等待传入的异步回调完成后自动恢复,避免重复点击。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | confirmCallBack | 点击后执行的异步函数,**必须返回 Promise** | Function | `null` |
10
+ | type | 按钮类型(同 `el-button` type) | String | `"colour-10"` |
11
+ | disabled | 是否禁用 | Boolean | `false` |
12
+
13
+ > 其余 `el-button` 属性通过 `v-bind="$attrs"` 透传。
14
+
15
+ ## Slots
16
+
17
+ | 插槽名 | 说明 |
18
+ | --- | --- |
19
+ | default | 按钮文字内容 |
20
+
21
+ ## 示例
22
+
23
+ ### 基础用法(提交表单)
24
+
25
+ ```vue
26
+ <pit-loading-btn :confirm-call-back="handleSubmit">保存</pit-loading-btn>
27
+
28
+ <script>
29
+ methods: {
30
+ async handleSubmit() {
31
+ await this.$api.saveForm(this.form)
32
+ this.$message.success('保存成功')
33
+ }
34
+ }
35
+ </script>
36
+ ```
37
+
38
+ ### 带错误处理(loading 无论成功失败都会恢复)
39
+
40
+ ```vue
41
+ <pit-loading-btn :confirm-call-back="handleDelete" type="danger">
42
+ 删除
43
+ </pit-loading-btn>
44
+
45
+ <script>
46
+ methods: {
47
+ async handleDelete() {
48
+ try {
49
+ await this.$api.delete(this.id)
50
+ this.$message.success('删除成功')
51
+ } catch (e) {
52
+ this.$message.error('删除失败')
53
+ throw e // 需 rethrow 以触发 finally
54
+ }
55
+ }
56
+ }
57
+ </script>
58
+ ```
59
+
60
+ ## 注意事项
61
+
62
+ - `confirmCallBack` 必须返回 `Promise`(`async` 函数天然满足)。
63
+ - 无论 Promise resolve 还是 reject,`loading` 都会在 `finally` 中重置为 `false`。
64
+ - 不使用 `@click` 事件,点击逻辑完全由 `confirmCallBack` 接管。
@@ -0,0 +1,82 @@
1
+ # pit-monaco 代码编辑器(Monaco Editor)
2
+
3
+ 基于 `monaco-editor` 封装的代码编辑器,支持语法高亮、自动换行、只读模式,通过 v-model 双向绑定内容,提供光标位置插入文本的 Methods。
4
+
5
+ ## 前置依赖
6
+
7
+ - `monaco-editor`(须在 webpack/vite 中配置 MonacoWebpackPlugin 或同等插件)
8
+
9
+ ## Props
10
+
11
+ | 参数 | 说明 | 类型 | 默认值 |
12
+ | --- | --- | --- | --- |
13
+ | value / v-model | 编辑器代码内容 | String | `""` |
14
+ | options | Monaco editor 配置项(深合并到默认配置) | Object | `{}` |
15
+
16
+ ## 默认配置
17
+
18
+ ```js
19
+ {
20
+ selectOnLineNumbers: true,
21
+ roundedSelection: false,
22
+ wordWrap: 'on', // 自动换行
23
+ language: 'java', // 语言:css/html/java/javascript/json/csharp 等
24
+ theme: 'vs', // 主题:vs / vs-dark / hc-black
25
+ formatOnPaste: true,
26
+ formatOnType: true,
27
+ glyphMargin: true,
28
+ fontSize: 14,
29
+ readOnly: false
30
+ }
31
+ ```
32
+
33
+ ## Events
34
+
35
+ | 事件名 | 说明 | 参数 |
36
+ | --- | --- | --- |
37
+ | input | 内容变化(v-model) | `String` |
38
+
39
+ ## Methods
40
+
41
+ | 方法名 | 说明 | 参数 |
42
+ | --- | --- | --- |
43
+ | `changeEditor(data)` | 同时更新内容和配置项 | `{ value: String, options: Object }` |
44
+ | `insert(text)` | 在当前光标位置插入文本 | `String` |
45
+
46
+ ## 示例
47
+
48
+ ### 基础用法(Java)
49
+
50
+ ```vue
51
+ <pit-monaco v-model="code" />
52
+ ```
53
+
54
+ ### 切换语言和主题
55
+
56
+ ```vue
57
+ <pit-monaco
58
+ v-model="code"
59
+ :options="{ language: 'javascript', theme: 'vs-dark', readOnly: true }" />
60
+ ```
61
+
62
+ ### 编程插入文本
63
+
64
+ ```vue
65
+ <pit-monaco ref="editor" v-model="code" />
66
+
67
+ <el-button @click="insertSnippet">插入模板</el-button>
68
+
69
+ <script>
70
+ methods: {
71
+ insertSnippet() {
72
+ this.$refs.editor.insert('\n// TODO: implement')
73
+ }
74
+ }
75
+ </script>
76
+ ```
77
+
78
+ ## 注意事项
79
+
80
+ - `options` prop 更新时通过 `monacoEditor.updateOptions()` 增量更新,不会重建编辑器实例。
81
+ - 组件销毁时未内置 `editor.dispose()`,若页面频繁创建/销毁本组件,建议在父组件 `beforeDestroy` 中手动调用。
82
+ - 使用 `vite` 构建时,需安装 `vite-plugin-monaco-editor` 并配置 worker。
@@ -0,0 +1,59 @@
1
+ # pit-money-input 金额输入框
2
+
3
+ 专为金额场景设计的输入框,自动千分位格式化,支持精度控制、负数、最小值限制,默认追加"元"单位后缀。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 必填 | 默认值 |
8
+ | --- | --- | --- | --- | --- |
9
+ | value / v-model | 绑定值(实际数值,不含逗号) | any | ✅ | — |
10
+ | bit | 保留小数位数 | Number | — | `2` |
11
+ | min | 最小值(设为 `0` 时会拦截负数输入) | String / Number | — | `null` |
12
+ | maxlength | 最大输入长度 | Number | — | `50` |
13
+ | placeholder | 占位文本 | String | — | `"请输入金额"` |
14
+ | showWordLimit | 是否显示字数统计 | Boolean | — | `false` |
15
+ | showComma | 是否显示千分位逗号 | Boolean | — | `true` |
16
+ | template | 单位后缀样式:`'append'` 显示"元",`'tenThousandYuan'` 显示"万元",其他值不显示 | String | — | `"append"` |
17
+ | data | 实时输入值(含逗号),支持 `.sync` 获取 | any | — | `null` |
18
+ | enterFuc | 按 Enter 键时的回调 | Function | — | `() => {}` |
19
+
20
+ ## Events
21
+
22
+ | 事件名 | 说明 | 参数 |
23
+ | --- | --- | --- |
24
+ | input | 失焦/回车后输出纯数字值(v-model) | `String`(纯数字,无逗号) |
25
+ | update:data | 实时输入值变化(含千分位格式) | `String` |
26
+
27
+ ## 示例
28
+
29
+ ### 基础用法
30
+
31
+ ```vue
32
+ <pit-money-input v-model="form.amount" />
33
+ <!-- 展示:1,234.56 元 绑定值:'1234.56' -->
34
+ ```
35
+
36
+ ### 保留 4 位小数,显示万元单位
37
+
38
+ ```vue
39
+ <pit-money-input v-model="form.totalAmount" :bit="4" template="tenThousandYuan" />
40
+ ```
41
+
42
+ ### 不允许负数、不显示千分位
43
+
44
+ ```vue
45
+ <pit-money-input v-model="form.price" :min="0" :show-comma="false" />
46
+ ```
47
+
48
+ ### 实时获取格式化后的显示值
49
+
50
+ ```vue
51
+ <pit-money-input v-model="form.amount" :data.sync="form.amountDisplay" />
52
+ <!-- form.amountDisplay 为含逗号格式的字符串,用于显示 -->
53
+ ```
54
+
55
+ ## 注意事项
56
+
57
+ - `v-model` 绑定值为**纯数字字符串**(无千分位逗号),请勿直接展示给用户。
58
+ - `data.sync` 获取的是含千分位格式的**显示值**,不能直接提交接口。
59
+ - `bit` 控制保留精度(截断,非四舍五入),请按业务场景配置。
@@ -0,0 +1,70 @@
1
+ # pit-pagination 分页
2
+
3
+ 对 `el-pagination` 的封装,支持 `page.sync` + `limit.sync` 双向绑定,自动滚动至顶部。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 必填 | 默认值 |
8
+ | --- | --- | --- | --- | --- |
9
+ | total | 总条目数 | Number | ✅ | — |
10
+ | page | 当前页码,支持 `.sync` | Number | — | `1` |
11
+ | limit | 每页条数,支持 `.sync` | Number | — | `10` |
12
+ | pageSizes | 每页条数候选列表 | Array | — | `[10, 20, 30, 50, 100]` |
13
+ | layout | 分页组件布局 | String | — | `"total, sizes, prev, pager, next, jumper"` |
14
+ | background | 是否显示背景色 | Boolean | — | `true` |
15
+ | autoScroll | 翻页后是否自动滚动至顶部 | Boolean | — | `true` |
16
+ | hidden | 是否隐藏分页组件 | Boolean | — | `false` |
17
+
18
+ ## Events
19
+
20
+ | 事件名 | 说明 | 参数 |
21
+ | --- | --- | --- |
22
+ | pagination | 翻页或切换每页条数时触发 | `{ page: Number, limit: Number }` |
23
+ | update:page | 页码变化时触发,配合 `.sync` | `Number` |
24
+ | update:limit | 每页条数变化时触发,配合 `.sync` | `Number` |
25
+
26
+ ## 示例
27
+
28
+ ### 基础用法
29
+
30
+ ```vue
31
+ <template>
32
+ <pit-pagination
33
+ :total="total"
34
+ :page.sync="queryParams.page"
35
+ :limit.sync="queryParams.limit"
36
+ @pagination="fetchList" />
37
+ </template>
38
+
39
+ <script>
40
+ export default {
41
+ data() {
42
+ return {
43
+ total: 0,
44
+ queryParams: { page: 1, limit: 10 }
45
+ }
46
+ },
47
+ methods: {
48
+ fetchList({ page, limit }) {
49
+ // 调用接口
50
+ }
51
+ }
52
+ }
53
+ </script>
54
+ ```
55
+
56
+ ### 隐藏分页(数据少于一页时)
57
+
58
+ ```vue
59
+ <pit-pagination
60
+ :total="total"
61
+ :page.sync="page"
62
+ :limit.sync="limit"
63
+ :hidden="total <= limit"
64
+ @pagination="fetchList" />
65
+ ```
66
+
67
+ ## 注意事项
68
+
69
+ - `total` 为必填项,缺少时分页无法正常计算。
70
+ - 关闭自动滚动:`:auto-scroll="false"`。