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,102 @@
1
+ ---
2
+ lang: zh-CN
3
+ title: pit-business-ui 业务组件库文档
4
+ ---
5
+
6
+ # 注册与接入
7
+
8
+ 本文档说明 `pit-business-ui` 在业务项目中的注册方式、依赖前提与副作用。
9
+
10
+ ## 1. 安装
11
+
12
+ ```bash
13
+ npm i pit-business-ui
14
+ ```
15
+
16
+ ## 2. 全量注册
17
+
18
+ ```js
19
+ import Vue from 'vue'
20
+ import PitBusinessUI from 'pit-business-ui'
21
+ import 'pit-business-ui/lib/theme-chalk/index.css'
22
+
23
+ Vue.use(PitBusinessUI, {
24
+ i18n, // 可选:vue-i18n 实例
25
+ store, // 可选:Vuex store(权限指令依赖)
26
+ router, // 可选:VueRouter 实例
27
+
28
+ // 业务配置(可选)
29
+ uploadSecretText: '',
30
+ textareaMaxlength: 50,
31
+ inputMaxlength: 50,
32
+ inputNumberMax: 9999,
33
+ textareaRow: 2,
34
+ positiveDefaultNumber: undefined,
35
+ uploadBlackList: undefined,
36
+ uploadDefaultDrag: undefined,
37
+ selectBidListStyle: null,
38
+ drawerSize: '700px'
39
+ })
40
+ ```
41
+
42
+ ## 3. 样式引入策略
43
+
44
+ ### 3.1 全量样式
45
+
46
+ ```js
47
+ import 'pit-business-ui/lib/theme-chalk/index.css'
48
+ ```
49
+
50
+ ### 3.2 按需样式
51
+
52
+ ```js
53
+ import 'pit-business-ui/lib/theme-chalk/table.css'
54
+ import 'pit-business-ui/lib/theme-chalk/pagination.css'
55
+ ```
56
+
57
+ ## 4. install options 说明
58
+
59
+ 安装后会在 `Vue.prototype.$Business` 注入全局业务配置,主要用于组件默认行为控制。
60
+
61
+ | 字段 | 类型 | 默认值 | 说明 |
62
+ | --- | --- | --- | --- |
63
+ | uploadSecretText | string | `""` | 上传相关密文提示 |
64
+ | textareaMaxlength | number | `50` | 文本域默认最大长度 |
65
+ | inputMaxlength | number | `50` | 输入框默认最大长度 |
66
+ | inputNumberMax | number | `9999` | 数字输入默认上限 |
67
+ | textareaRow | number | `2` | 文本域默认行数 |
68
+ | positiveDefaultNumber | any | `undefined` | 正数输入默认值 |
69
+ | uploadBlackList | any | `undefined` | 上传黑名单配置 |
70
+ | uploadDefaultDrag | any | `undefined` | 上传默认拖拽样式 |
71
+ | selectBidListStyle | any | `null` | 选择招标列表样式配置 |
72
+ | drawerSize | string | `"700px"` | 抽屉默认宽度 |
73
+
74
+ ## 5. 注入的原型方法
75
+
76
+ 安装时会注入以下方法:
77
+
78
+ - `this.$openFilePreview`
79
+ - `this.$downloadFile`
80
+ - `this.$downloadZip`
81
+ - `this.$downloadBlob`
82
+ - `this.$downloadUrl`
83
+ - `this.$exportMeted`
84
+ - `this.$openBaseImport`
85
+
86
+ ## 6. 依赖前提与副作用
87
+
88
+ ### 6.1 i18n 依赖
89
+
90
+ 若传入 `i18n`,会合并 `en`、`zh` 语言包。
91
+
92
+ ### 6.2 store 依赖
93
+
94
+ 权限指令依赖 `store.state.user.permissionList`。若业务侧 store 结构不一致,需适配后再启用。
95
+
96
+ ### 6.3 router 副作用
97
+
98
+ 安装时会尝试添加以下路由:
99
+
100
+ - path: `/previewOffice_0X1`
101
+
102
+ 若未传入 `router`,库会尝试读取 `window._router`。
@@ -0,0 +1,57 @@
1
+ # pit-add-date-picker 新增日期选择器
2
+
3
+ 专为新增/编辑表单设计的日期区间选择器,内置"未来 N 天"快捷选项(如合同工期、计划周期)。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | value / v-model | 绑定值(日期字符串数组 `[start, end]`) | Array | `[]` |
10
+ | type | 选择器类型 | String | `"daterange"` |
11
+ | valueFormat | 绑定值格式 | String | `"yyyy-MM-dd"` |
12
+ | startPlaceholder | 开始日期占位文本 | String | `"开始日期"` |
13
+ | endPlaceholder | 结束日期占位文本 | String | `"结束日期"` |
14
+ | clearable | 是否可清空 | Boolean | `true` |
15
+ | startTime | 开始时间,支持 `.sync` | String | `""` |
16
+ | endTime | 结束时间,支持 `.sync` | String | `""` |
17
+ | isExcludeInternationalize | 是否跳过国际化时区转换 | Boolean | `false` |
18
+
19
+ > 其余 `el-date-picker` 属性通过 `v-bind="$attrs"` 透传。
20
+
21
+ ## Events
22
+
23
+ | 事件名 | 说明 | 参数 |
24
+ | --- | --- | --- |
25
+ | input | 值变化(v-model) | `Array` `[startStr, endStr]` |
26
+ | update:startTime | 开始时间变化,配合 `.sync` | `String` |
27
+ | update:endTime | 结束时间变化,配合 `.sync` | `String` |
28
+
29
+ ## 内置快捷选项
30
+
31
+ 未来 1 周、未来 2 周、未来 1 月、未来 3 月、未来半年、未来 1 年
32
+
33
+ ## 示例
34
+
35
+ ### 基础用法(新增合同工期)
36
+
37
+ ```vue
38
+ <pit-add-date-picker
39
+ v-model="form.periodRange"
40
+ :start-time.sync="form.startDate"
41
+ :end-time.sync="form.endDate" />
42
+ ```
43
+
44
+ ### 同时初始化开始结束值
45
+
46
+ ```vue
47
+ <!-- startTime / endTime 有值时,会自动回填 value -->
48
+ <pit-add-date-picker
49
+ v-model="form.range"
50
+ :start-time.sync="form.start"
51
+ :end-time.sync="form.end" />
52
+ ```
53
+
54
+ ## 注意事项
55
+
56
+ - 与 `PitSearchDatePicker` 区别:本组件快捷选项面向"未来"日期,`editable` 固定为 `false`。
57
+ - 若 `startTime` 和 `endTime` 有初始值但 `value` 为空,组件会自动合并并触发 `input` 初始化。
@@ -0,0 +1,64 @@
1
+ # pit-add-operation 新增操作栏
2
+
3
+ 列表页顶部操作区,默认包含"新建"按钮,支持权限控制,提供左侧与右侧插槽扩展。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | addText | 新建按钮文案 | String | `"新建"` |
10
+ | addPerCode | 新建按钮权限标识 | String | `"btn_add"` |
11
+ | isJudgePer | 是否启用权限判断 | Boolean | `false` |
12
+
13
+ ## Events
14
+
15
+ | 事件名 | 说明 | 参数 |
16
+ | --- | --- | --- |
17
+ | add | 点击新建按钮时触发 | — |
18
+
19
+ ## Slots
20
+
21
+ | 插槽名 | 说明 |
22
+ | --- | --- |
23
+ | left | 新建按钮左侧区域 |
24
+ | default | 新建按钮右侧区域(默认插槽) |
25
+
26
+ ## 示例
27
+
28
+ ### 基础用法
29
+
30
+ ```vue
31
+ <pit-add-operation @add="handleAdd" />
32
+ ```
33
+
34
+ ### 开启权限控制
35
+
36
+ ```vue
37
+ <pit-add-operation
38
+ :is-judge-per="true"
39
+ add-per-code="project:add"
40
+ @add="handleAdd" />
41
+ ```
42
+
43
+ ### 自定义按钮文案 + 右侧扩展按钮
44
+
45
+ ```vue
46
+ <pit-add-operation add-text="导入" @add="handleImport">
47
+ <el-button @click="handleExport">导出</el-button>
48
+ </pit-add-operation>
49
+ ```
50
+
51
+ ### 左侧扩展
52
+
53
+ ```vue
54
+ <pit-add-operation @add="handleAdd">
55
+ <template slot="left">
56
+ <span class="data-tip">共 {{ total }} 条</span>
57
+ </template>
58
+ </pit-add-operation>
59
+ ```
60
+
61
+ ## 注意事项
62
+
63
+ - 权限判断依赖全局 `v-has` 指令(通过 `Vue.use(PitBusinessUI, { store })` 注入)。
64
+ - `isJudgePer` 为 `false` 时,`addPerCode` 不生效,按钮始终显示。
@@ -0,0 +1,44 @@
1
+ # pit-batch-download 批量下载按钮
2
+
3
+ 带权限控制的批量下载按钮,点击后调用 OSS 批量下载接口,需要传入文件 ID 数组。
4
+
5
+ ## 前置依赖
6
+
7
+ - `pit.hasBtnP(pit.hasCode.btn_batchXZ)` — 权限控制,无权限时按钮不渲染
8
+ - `pit-business-utils` — `downloadFileFromOss`
9
+
10
+ ## Props
11
+
12
+ | 参数 | 说明 | 类型 | 默认值 |
13
+ | --- | --- | --- | --- |
14
+ | ids | 需要下载的文件 OSS Record ID 数组 | Array | `[]` |
15
+ | type | 按钮类型(同 `el-button` type) | String | `"colour-3"` |
16
+
17
+ > 其余 `el-button` 属性通过 `v-bind="$attrs"` 透传。
18
+
19
+ ## 示例
20
+
21
+ ### 结合表格选中行
22
+
23
+ ```vue
24
+ <pit-batch-download :ids="selectedFileIds" />
25
+
26
+ <script>
27
+ computed: {
28
+ selectedFileIds() {
29
+ return this.selectedRows.map(row => row.fileId)
30
+ }
31
+ }
32
+ </script>
33
+ ```
34
+
35
+ ### 自定义按钮大小
36
+
37
+ ```vue
38
+ <pit-batch-download :ids="fileIds" size="mini" type="primary" />
39
+ ```
40
+
41
+ ## 注意事项
42
+
43
+ - 未选择任何数据(`ids.length === 0`)时点击按钮会弹出警告提示,不触发下载。
44
+ - 按钮通过 `pit.hasBtnP` 权限方法控制显示,无对应权限时整个按钮不渲染(非禁用)。
@@ -0,0 +1,82 @@
1
+ # pit-bill-tree-dialog 台账树选择弹窗
2
+
3
+ 通过配置接口 URL 动态加载树形台账数据,支持单节点点击选择和勾选框多选两种模式,提供 `open()` 方法以编程方式打开弹窗。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | title | 弹窗标题 | String | `"台账树"` |
10
+ | queryBillTreeInterface | 树数据接口 URL(`/api/path`,**必填**) | String | — |
11
+ | queryBillTreeInterfaceMethod | 接口请求方法 | String | `"GET"` |
12
+ | queryBillTreeParams | 接口额外请求参数 | Object | `{}` |
13
+ | nodeKey | 节点唯一键字段名 | String | `"id"` |
14
+ | label | 节点显示文字字段名 | String | `"label"` |
15
+ | showCheckbox | 是否显示复选框(多选模式) | Boolean | `false` |
16
+ | checkedIds | 预选中节点 id 数组(须传 `nodeKey` 对应字段值) | Array | `[]` |
17
+ | treeHeight | 树容器高度 | String | `"500px"` |
18
+ | showExpandIcon | 是否显示展开/折叠全部的快捷按钮 | Boolean | `false` |
19
+
20
+ ## Methods
21
+
22
+ | 方法名 | 说明 |
23
+ | --- | --- |
24
+ | `open()` | 打开弹窗(同时根据 `checkedIds` 设置勾选状态) |
25
+
26
+ ## Events
27
+
28
+ | 事件名 | 说明 | 参数 |
29
+ | --- | --- | --- |
30
+ | node-click | 单击节点时触发(单选场景) | `data`(节点数据对象) |
31
+ | check | 勾选框变化时触发(多选场景) | `(checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys)` |
32
+
33
+ ## 示例
34
+
35
+ ### 单选(点击选择)
36
+
37
+ ```vue
38
+ <pit-bill-tree-dialog
39
+ ref="billTree"
40
+ title="选择台账"
41
+ query-bill-tree-interface="/api/project/billTree"
42
+ :query-bill-tree-params="{ projectId: currentProjectId }"
43
+ @node-click="handleNodeClick" />
44
+
45
+ <el-button @click="$refs.billTree.open()">选择台账</el-button>
46
+
47
+ <script>
48
+ methods: {
49
+ handleNodeClick(data) {
50
+ this.form.billId = data.id
51
+ this.form.billName = data.label
52
+ }
53
+ }
54
+ </script>
55
+ ```
56
+
57
+ ### 多选(勾选框)
58
+
59
+ ```vue
60
+ <pit-bill-tree-dialog
61
+ ref="billTree"
62
+ title="选择台账"
63
+ :show-checkbox="true"
64
+ query-bill-tree-interface="/api/project/billTree/all"
65
+ :checked-ids="form.selectedBillIds"
66
+ @check="handleCheck" />
67
+
68
+ <script>
69
+ methods: {
70
+ handleCheck(checkedNodes, checkedKeys) {
71
+ this.form.selectedBillIds = checkedKeys
72
+ this.form.selectedBills = checkedNodes
73
+ }
74
+ }
75
+ </script>
76
+ ```
77
+
78
+ ## 注意事项
79
+
80
+ - `queryBillTreeInterface` 为**必填**项,组件内部通过 `this.request({ url })` 动态调用,需确保接口存在于消费项目的请求拦截器中。
81
+ - `check` 事件参数与 `el-tree` 的 `check` 事件一致,第二个参数 `checkedKeys` 为**当前所有勾选节点的 key 数组**(含层级内叶子节点)。
82
+ - `open()` 调用时若传入了 `checkedIds`,会自动更新树的勾选状态,无需额外操作。
@@ -0,0 +1,88 @@
1
+ # pit-collapse 折叠面板
2
+
3
+ 带标题栏的内容折叠/展开容器,支持工具栏插槽扩展,折叠状态变化时触发事件。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | title | 面板标题 | String | `"标题"` |
10
+ | status | 初始展开状态(`true` 展开,`false` 折叠) | Boolean | `true` |
11
+ | contentStyle | 内容区域自定义样式 | Object | `{}` |
12
+ | el | 外部图表/组件实例,展开时自动调用其 `layout()` 方法(用于表格/图表重绘) | Object | `{}` |
13
+
14
+ ## Events
15
+
16
+ | 事件名 | 说明 | 参数 |
17
+ | --- | --- | --- |
18
+ | change | 展开/折叠状态变化时触发(含初始化时) | `Boolean`(`true` 展开,`false` 折叠) |
19
+
20
+ ## Slots
21
+
22
+ | 插槽名 | 说明 |
23
+ | --- | --- |
24
+ | default | 面板内容区 |
25
+ | toolbar | 标题栏右侧工具区(如按钮、筛选器) |
26
+
27
+ ## 示例
28
+
29
+ ### 基础用法
30
+
31
+ ```vue
32
+ <pit-collapse title="基本信息">
33
+ <el-form :model="form" label-width="100px">
34
+ <el-form-item label="项目名称">
35
+ <pit-input v-model="form.name" />
36
+ </el-form-item>
37
+ </el-form>
38
+ </pit-collapse>
39
+ ```
40
+
41
+ ### 默认折叠
42
+
43
+ ```vue
44
+ <pit-collapse title="附件列表" :status="false">
45
+ <pit-upload-file v-model="form.attachments" />
46
+ </pit-collapse>
47
+ ```
48
+
49
+ ### 工具栏插槽
50
+
51
+ ```vue
52
+ <pit-collapse title="进度计划">
53
+ <template slot="toolbar">
54
+ <el-button size="mini" @click="exportPlan">导出</el-button>
55
+ </template>
56
+ <gantt-chart ref="gantt" />
57
+ </pit-collapse>
58
+ ```
59
+
60
+ ### 配合图表自动 layout
61
+
62
+ ```vue
63
+ <!-- 展开时自动调用 this.$refs.myChart.layout() -->
64
+ <pit-collapse title="数据图表" :el="$refs.myChart">
65
+ <my-chart ref="myChart" />
66
+ </pit-collapse>
67
+ ```
68
+
69
+ ### 监听展开/折叠事件
70
+
71
+ ```vue
72
+ <pit-collapse title="详情" @change="onCollapseChange">
73
+ <detail-content />
74
+ </pit-collapse>
75
+
76
+ <script>
77
+ methods: {
78
+ onCollapseChange(expanded) {
79
+ console.log('当前状态:', expanded ? '展开' : '折叠')
80
+ }
81
+ }
82
+ </script>
83
+ ```
84
+
85
+ ## 注意事项
86
+
87
+ - `change` 事件在组件初始化时会立即触发一次(`immediate: true`),可用于首次状态同步。
88
+ - `el` prop 目前仅在标题为"进度计划"时生效(源码硬编码),如需通用,建议监听 `change` 事件自行调用 `layout()`。
@@ -0,0 +1,74 @@
1
+ # pit-date-time-picker 日期时间选择器
2
+
3
+ 对 `el-date-picker` 的封装,统一各类型的默认格式,支持区间选择拆分双字段绑定。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | value / v-model | 绑定值 | String / Array / Date / Number | — |
10
+ | type | 选择器类型 | String | `"date"` |
11
+ | format | 显示格式(空则按 type 自动推断) | String | `""` |
12
+ | valueFormat | 绑定值格式(空则按 type 自动推断) | String | `""` |
13
+ | placeholder | 单选占位文本 | String | `"请选择日期"` |
14
+ | startPlaceholder | 区间开始占位文本 | String | `"开始日期"` |
15
+ | endPlaceholder | 区间结束占位文本 | String | `"结束日期"` |
16
+ | startVal | 区间开始值,支持 `.sync` | String / Number / Date | — |
17
+ | endVal | 区间结束值,支持 `.sync` | String / Number / Date | — |
18
+
19
+ **type 可选值及默认格式**
20
+
21
+ | type | 格式 |
22
+ | --- | --- |
23
+ | `date` | `yyyy-MM-dd` |
24
+ | `datetime` | `yyyy-MM-dd HH:mm:ss` |
25
+ | `month` | `yyyy-MM` |
26
+ | `year` | `yyyy` |
27
+ | `daterange` | `yyyy-MM-dd` |
28
+ | `datetimerange` | `yyyy-MM-dd HH:mm:ss` |
29
+ | `monthrange` | `yyyy-MM` |
30
+
31
+ > 其余 `el-date-picker` 属性通过 `v-bind="$attrs"` 透传,事件通过 `v-on="$listeners"` 透传。
32
+
33
+ ## Events
34
+
35
+ | 事件名 | 说明 | 参数 |
36
+ | --- | --- | --- |
37
+ | input | 值变化(v-model) | 同 value 类型 |
38
+ | update:startVal | 区间模式下,开始时间变化 | `String` |
39
+ | update:endVal | 区间模式下,结束时间变化 | `String` |
40
+
41
+ ## 示例
42
+
43
+ ### 日期选择(date)
44
+
45
+ ```vue
46
+ <pit-date-time-picker v-model="form.date" />
47
+ ```
48
+
49
+ ### 日期时间选择(datetime)
50
+
51
+ ```vue
52
+ <pit-date-time-picker v-model="form.datetime" type="datetime" />
53
+ ```
54
+
55
+ ### 日期区间(daterange) + 拆分字段
56
+
57
+ ```vue
58
+ <pit-date-time-picker
59
+ v-model="form.dateRange"
60
+ type="daterange"
61
+ :start-val.sync="form.startDate"
62
+ :end-val.sync="form.endDate" />
63
+ ```
64
+
65
+ ### 年月选择
66
+
67
+ ```vue
68
+ <pit-date-time-picker v-model="form.month" type="month" />
69
+ ```
70
+
71
+ ## 注意事项
72
+
73
+ - `daterange` / `datetimerange` 模式下 `value` 应传 Array,同时可用 `startVal.sync` + `endVal.sync` 拆分绑定。
74
+ - 组件内部依赖 `this.pit.toDate` 工具方法(通过全局混入注入),无需额外配置。
@@ -0,0 +1,47 @@
1
+ # pit-design-report-explain 设计报告填报说明
2
+
3
+ 自包含组件,无需传入任何 Props,自动从接口获取 HTML 格式的填报说明内容并渲染,内容超高时自动折叠,提供展开/收起功能。
4
+
5
+ ## 前置依赖
6
+
7
+ - 接口:`getFillingInstructions({ projectId })` — 返回 `{ fillingInstructions: '<p>...</p>' }`
8
+ - `localStorage.projectId` — 组件内部自动读取,用于接口请求参数
9
+
10
+ ## Props
11
+
12
+ 本组件无 Props,所有数据均从接口自动获取。
13
+
14
+ ## Events
15
+
16
+ | 事件名 | 说明 | 参数 |
17
+ | --- | --- | --- |
18
+ | toggleExpand | 展开/折叠状态变化时触发 | `Boolean`(true = 已展开) |
19
+
20
+ ## 示例
21
+
22
+ ### 直接使用
23
+
24
+ ```vue
25
+ <!-- 确保 localStorage.projectId 已设置 -->
26
+ <pit-design-report-explain @toggleExpand="onExpandChange" />
27
+
28
+ <script>
29
+ methods: {
30
+ onExpandChange(isExpanded) {
31
+ console.log('说明区域', isExpanded ? '已展开' : '已折叠')
32
+ }
33
+ }
34
+ </script>
35
+ ```
36
+
37
+ ## 交互说明
38
+
39
+ 1. `mounted` 时自动调接口,接口成功后将 HTML 内容通过 `v-html` 渲染。
40
+ 2. 若渲染内容高度 > 容器限制(默认约 3 行),显示"展开"按钮。
41
+ 3. 用户点击展开/折叠按钮,触发 `toggleExpand` 事件。
42
+
43
+ ## 注意事项
44
+
45
+ - 内容使用 `v-html` 渲染,请确保接口返回的 HTML 已经过服务端 XSS 处理。
46
+ - `localStorage.projectId` 由业务系统在进入项目后写入,本组件直接读取,无需父组件传入。
47
+ - 若当前项目没有配置填报说明,接口返回空字符串时组件不显示展开按钮。
@@ -0,0 +1,89 @@
1
+ # pit-dialog 弹窗
2
+
3
+ 对 `el-dialog` 的封装,默认关闭点击蒙层关闭、支持 `visible.sync`、`beforeClose` 拦截。
4
+
5
+ ## Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | visible | 控制显隐,支持 `.sync` | Boolean | `false` |
10
+ | title | 标题 | String | `"标题"` |
11
+ | width | 弹窗宽度 | String | `"35%"` |
12
+ | top | 弹窗距顶部距离(CSS 值) | String | `""` |
13
+ | fullscreen | 是否全屏 | Boolean | `false` |
14
+ | center | 是否居中布局 | Boolean | `false` |
15
+ | modal | 是否显示遮罩 | Boolean | `true` |
16
+ | showClose | 是否显示关闭按钮 | Boolean | `true` |
17
+ | closeOnClickModal | 点击蒙层是否关闭 | Boolean | `false` |
18
+ | destroyOnClose | 关闭时销毁内容 | Boolean | `false` |
19
+ | customClass | 自定义类名 | String | `""` |
20
+ | beforeClose | 关闭前回调,接管关闭逻辑 | Function | `null` |
21
+
22
+ ## Events
23
+
24
+ | 事件名 | 说明 | 参数 |
25
+ | --- | --- | --- |
26
+ | update:visible | 关闭时由组件触发,配合 `.sync` 使用 | `false` |
27
+
28
+ ## Slots
29
+
30
+ | 插槽名 | 说明 |
31
+ | --- | --- |
32
+ | default | 弹窗主体内容 |
33
+ | footer | 底部操作区 |
34
+
35
+ ## 示例
36
+
37
+ ### 基础用法
38
+
39
+ ```vue
40
+ <template>
41
+ <div>
42
+ <el-button @click="visible = true">打开弹窗</el-button>
43
+ <pit-dialog :visible.sync="visible" title="新增记录" width="40%">
44
+ <p>弹窗内容</p>
45
+ <template slot="footer">
46
+ <el-button @click="visible = false">取消</el-button>
47
+ <el-button type="primary" @click="onConfirm">确认</el-button>
48
+ </template>
49
+ </pit-dialog>
50
+ </div>
51
+ </template>
52
+
53
+ <script>
54
+ export default {
55
+ data() {
56
+ return { visible: false }
57
+ },
58
+ methods: {
59
+ onConfirm() {
60
+ // 业务逻辑
61
+ this.visible = false
62
+ }
63
+ }
64
+ }
65
+ </script>
66
+ ```
67
+
68
+ ### 使用 beforeClose 拦截
69
+
70
+ ```vue
71
+ <pit-dialog :visible.sync="visible" :before-close="handleBeforeClose">
72
+ <p>编辑中,关闭前确认?</p>
73
+ </pit-dialog>
74
+
75
+ <script>
76
+ methods: {
77
+ handleBeforeClose() {
78
+ this.$confirm('确定关闭吗?').then(() => {
79
+ this.visible = false
80
+ })
81
+ }
82
+ }
83
+ </script>
84
+ ```
85
+
86
+ ## 注意事项
87
+
88
+ - `beforeClose` 传入后,关闭按钮不会自动同步 `visible`,需在回调内手动处理。
89
+ - 按需引入时注意同时引入 `dialog.css`。