sohelp-eleplus 1.1.26 → 1.1.28

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 (205) hide show
  1. package/components.js +1 -0
  2. package/icons/flag/README.md +2 -2
  3. package/icons/flag/index.js +0 -1
  4. package/package.json +1 -1
  5. package/sohelp-ace-editor/README.md +32 -42
  6. package/sohelp-ace-editor/index.vue +166 -156
  7. package/sohelp-api-doc/README.md +36 -0
  8. package/sohelp-api-doc/index.vue +160 -0
  9. package/sohelp-application-select/README.md +9 -7
  10. package/sohelp-application-select/index.vue +10 -13
  11. package/sohelp-autocode/README.md +14 -26
  12. package/sohelp-calendar-view/README.md +9 -7
  13. package/sohelp-calendar-view/index.vue +10 -9
  14. package/sohelp-card/README.md +15 -17
  15. package/sohelp-card/index.vue +1 -1
  16. package/sohelp-card-view/README.md +9 -7
  17. package/sohelp-card-view/index.vue +10 -9
  18. package/sohelp-condition/README.md +29 -49
  19. package/sohelp-condition/index.vue +2 -1
  20. package/sohelp-country-select/README.md +15 -123
  21. package/sohelp-country-select/index.vue +1 -1
  22. package/sohelp-cry-input/README.md +19 -195
  23. package/sohelp-cry-input/index.vue +6 -2
  24. package/sohelp-date/README.md +12 -15
  25. package/sohelp-datetime/README.md +15 -17
  26. package/sohelp-datetime-picker/README.md +18 -18
  27. package/sohelp-datetime-picker/index.vue +11 -4
  28. package/sohelp-datetime-range/README.md +20 -23
  29. package/sohelp-demo-block/README.md +43 -0
  30. package/sohelp-demo-block/index.vue +229 -0
  31. package/sohelp-dict/README.md +28 -23
  32. package/sohelp-dict/index.vue +17 -17
  33. package/sohelp-drawer/README.md +28 -26
  34. package/sohelp-drop-card/README.md +29 -28
  35. package/sohelp-drop-card/index.vue +0 -1
  36. package/sohelp-dyn-select/README.md +31 -16
  37. package/sohelp-dyn-select/index.vue +65 -67
  38. package/sohelp-dyn-tree/README.md +26 -20
  39. package/sohelp-dyn-tree/index.vue +2 -2
  40. package/sohelp-dyn-tree-select/README.md +28 -19
  41. package/sohelp-dyn-tree-select/index.vue +23 -7
  42. package/sohelp-entity-form/README.md +65 -30
  43. package/sohelp-entity-form/index.vue +3 -2
  44. package/sohelp-entity-grid/README.md +13 -11
  45. package/sohelp-entity-grid/index.vue +1 -1
  46. package/sohelp-file-upload/README.md +25 -27
  47. package/sohelp-file-upload/index.vue +1 -1
  48. package/sohelp-filter-scheme/README.md +34 -30
  49. package/sohelp-filter-scheme/index.vue +2 -2
  50. package/sohelp-grid/README.md +52 -33
  51. package/sohelp-grid/index.vue +41 -39
  52. package/sohelp-grid/js/SohelpGridConfig.js +3 -3
  53. package/sohelp-grid/js/useSohelpGridConfig.js +4 -6
  54. package/sohelp-grid-select/README.md +32 -27
  55. package/sohelp-grid-select/index.vue +6 -5
  56. package/sohelp-grid-view/README.md +51 -22
  57. package/sohelp-grid-view-select/README.md +33 -25
  58. package/sohelp-grid-view-select/index.vue +2 -1
  59. package/sohelp-group-view/README.md +14 -4
  60. package/sohelp-group-view/index.vue +10 -9
  61. package/sohelp-icon-select/README.md +14 -12
  62. package/sohelp-image-upload/README.md +27 -27
  63. package/sohelp-image-upload/index.vue +2 -2
  64. package/sohelp-import/README.md +25 -24
  65. package/sohelp-input/README.md +27 -11
  66. package/sohelp-input/index.vue +15 -2
  67. package/sohelp-input-tag/README.md +53 -0
  68. package/sohelp-input-tag/index.vue +337 -0
  69. package/sohelp-modal/README.md +42 -16
  70. package/sohelp-modal/index.vue +21 -4
  71. package/sohelp-modal-select/README.md +745 -0
  72. package/sohelp-modal-select/index.vue +705 -0
  73. package/sohelp-module/README.md +24 -13
  74. package/sohelp-number-input/README.md +15 -8
  75. package/sohelp-number-input/index.vue +3 -0
  76. package/sohelp-number-range/README.md +22 -12
  77. package/sohelp-number-range/index.vue +3 -11
  78. package/sohelp-org-modal-select/README.md +47 -0
  79. package/sohelp-org-modal-select/index.vue +411 -0
  80. package/sohelp-org-select/README.md +23 -10
  81. package/sohelp-org-select/index.vue +41 -24
  82. package/sohelp-org-tree/README.md +19 -7
  83. package/sohelp-org-tree/index.vue +1 -2
  84. package/sohelp-org-tree-select/README.md +22 -11
  85. package/sohelp-org-tree-select/index.vue +1 -2
  86. package/sohelp-org-user-tree/README.md +19 -7
  87. package/sohelp-org-user-tree/index.vue +1 -2
  88. package/sohelp-org-user-tree-select/README.md +8 -3
  89. package/sohelp-org-user-tree-select/index.vue +8 -7
  90. package/sohelp-page/README.md +20 -11
  91. package/sohelp-page/index.vue +1 -1
  92. package/sohelp-pagination/README.md +14 -6
  93. package/sohelp-pagination/index.vue +1 -1
  94. package/sohelp-power/README.md +34 -19
  95. package/sohelp-power/index.vue +2 -2
  96. package/sohelp-pro-form/README.md +64 -21
  97. package/sohelp-pro-layout/README.md +10 -4
  98. package/sohelp-pro-layout/index.vue +8 -7
  99. package/sohelp-pro-table/README.md +30 -6
  100. package/sohelp-process/README.md +26 -13
  101. package/sohelp-process/index.vue +6 -6
  102. package/sohelp-rate/README.md +24 -12
  103. package/sohelp-rate/index.vue +5 -1
  104. package/sohelp-relation/README.md +10 -4
  105. package/sohelp-relation/index.vue +8 -7
  106. package/sohelp-relation-modal-select/README.md +41 -0
  107. package/sohelp-relation-modal-select/index.vue +70 -0
  108. package/sohelp-rich-text/README.md +29 -11
  109. package/sohelp-rich-text/index.vue +21 -20
  110. package/sohelp-richtext/README.md +12 -2
  111. package/sohelp-richtext/index.vue +8 -6
  112. package/sohelp-role-modal-select/README.md +45 -0
  113. package/sohelp-role-modal-select/index.vue +111 -0
  114. package/sohelp-role-select/README.md +18 -10
  115. package/sohelp-role-select/index.vue +36 -27
  116. package/sohelp-search/README.md +12 -4
  117. package/sohelp-search/index.vue +2 -2
  118. package/sohelp-search-pro-form/README.md +15 -1
  119. package/sohelp-search-pro-form/index.vue +2 -1
  120. package/sohelp-select/README.md +31 -30
  121. package/sohelp-select/index.vue +79 -84
  122. package/sohelp-split-panel/README.md +17 -18
  123. package/sohelp-switch/README.md +21 -19
  124. package/sohelp-switch/index.vue +34 -33
  125. package/sohelp-table/README.md +35 -27
  126. package/sohelp-table/index.vue +110 -109
  127. package/sohelp-table-select/README.md +55 -0
  128. package/sohelp-tenant-select/README.md +19 -18
  129. package/sohelp-tenant-select/index.vue +105 -109
  130. package/sohelp-text/README.md +16 -10
  131. package/sohelp-text/index.vue +5 -5
  132. package/sohelp-textarea-input/README.md +19 -12
  133. package/sohelp-time/README.md +11 -10
  134. package/sohelp-tree/README.md +24 -19
  135. package/sohelp-tree/index.vue +21 -23
  136. package/sohelp-tree-select/README.md +23 -10
  137. package/sohelp-user-modal-select/README.md +739 -0
  138. package/sohelp-user-modal-select/index.vue +87 -0
  139. package/sohelp-user-select/README.md +26 -15
  140. package/sohelp-user-select/index.vue +6 -2
  141. package/sohelp-user-tag/README.md +5 -7
  142. package/sohelp-user-tag/index.vue +8 -8
  143. package/sohelp-user-tree/README.md +5 -8
  144. package/sohelp-user-tree/index.vue +8 -7
  145. package/sohelp-vform-drawer/README.md +36 -18
  146. package/sohelp-vform-drawer/index.vue +2 -2
  147. package/sohelp-vform-eleplus/README.md +33 -31
  148. package/sohelp-vform-eleplus/index.vue +2 -2
  149. package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +461 -461
  150. package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +418 -418
  151. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -72
  152. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -7
  153. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -67
  154. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -7
  155. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -72
  156. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -7
  157. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -68
  158. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -7
  159. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -732
  160. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -726
  161. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -7
  162. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -7
  163. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -29
  164. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -7
  165. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -3047
  166. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -7
  167. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -673
  168. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -7
  169. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -37
  170. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -7
  171. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -714
  172. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -726
  173. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -7
  174. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -7
  175. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -29
  176. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -7
  177. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -3047
  178. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -7
  179. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -673
  180. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -7
  181. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -37
  182. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -7
  183. package/sohelp-vform-modal/README.md +36 -18
  184. package/sohelp-vform-modal/index.vue +2 -2
  185. package/sohelp-vform-select/README.md +9 -7
  186. package/sohelp-vform-select/index.vue +8 -7
  187. package/sohelp-vxe-grid/DefaultGridOptions.js +5 -3
  188. package/sohelp-vxe-grid/DefaultProps.js +0 -1
  189. package/sohelp-vxe-grid/README.md +540 -35
  190. package/sohelp-vxe-grid/SohelpGridConfig.js +8 -6
  191. package/sohelp-vxe-grid/index.vue +141 -94
  192. package/sohelp-vxe-grid-select/README.md +41 -26
  193. package/sohelp-vxe-table/README.md +23 -20
  194. package/sohelp-vxe-table/index.vue +5 -4
  195. package/sohelp-workflow/README.md +21 -17
  196. package/sohelp-workflow/index.vue +25 -22
  197. package/sohelp-workflow-drawer/README.md +41 -28
  198. package/sohelp-workflow-drawer/components/table.vue +7 -1
  199. package/sohelp-workflow-drawer/index.vue +86 -71
  200. package/sohelp-workflow-drawer/js/index.js +15 -13
  201. package/style/index.scss +0 -0
  202. package/utils/safe-eval.js +89 -0
  203. package/sohelp-dyn-select/props.js +0 -67
  204. package/sohelp-user-select/index.vue~ +0 -53
  205. package/sohelp-user-select/props.js +0 -71
@@ -1,211 +1,35 @@
1
- # 货币金额输入框 (SohelpCryInput)
1
+ # SohelpCryInput 货币金额输入框
2
2
 
3
- 支持国旗前缀、千分符、币别符、保留小数位数的货币数值输入组件。
3
+ 基于 `el-input` 封装的货币金额输入组件,支持千分符格式化显示、币别国旗前缀图标、自定义小数位数,失焦时自动格式化并更新绑定值。
4
4
 
5
- ## 属性 (Props)
6
-
7
- | 属性名 | 类型 | 默认值 | 说明 |
8
- | :--- | :--- | :--- | :--- |
9
- | modelValue | Number/String | '' | 绑定值(纯数字) |
10
- | separator | String | ',' | 千分符分隔符,如 "," |
11
- | cry | String | 'cny' | 币别代码,如 'usd', 'cny', 'eur' |
12
- | digits | Number | 2 | 保留小数位数 |
13
- | showFlag | Boolean | true | 是否显示币别国旗 |
14
-
15
- **其他属性**:支持通过 `v-bind` 传递所有 el-input 的原生属性,如 `placeholder`、`disabled`、`readonly`、`clearable`、`size`、`autofocus` 等
16
-
17
- ## 事件 (Events)
18
-
19
- | 事件名 | 说明 | 回调参数 |
20
- | :--- | :--- | :--- |
21
- | update:modelValue | 失焦时触发,更新绑定值 | (value: number \| string \| '') |
22
-
23
- **其他事件**:支持通过 `v-on` 绑定所有 el-input 的原生事件,如 `focus`、`blur`、`clear`、`change` 等
24
-
25
- ## 功能特性
26
-
27
- - ✅ 支持千分符格式化显示
28
- - ✅ 自动处理浮点数精度问题
29
- - ✅ 支持自定义千分符分隔符
30
- - ✅ 支持自定义小数位数
31
- - ✅ 支持 25 种主流货币
32
- - ✅ 国旗图标动态加载
33
- - ✅ 默认自动获取焦点(可通过 `:autofocus="false"` 禁用)
34
- - ✅ 完整透传 el-input 的所有属性和事件
35
-
36
- ## 支持的币别 (Currency Codes)
37
-
38
- | 代码 | 国旗 | 货币 |
39
- | :--- | :--- | :--- |
40
- | usd | 🇺🇸 | 美元 USD |
41
- | cny | 🇨🇳 | 人民币 CNY |
42
- | eur | 🇪🇺 | 欧元 EUR |
43
- | gbp | 🇬🇧 | 英镑 GBP |
44
- | jpy | 🇯🇵 | 日元 JPY |
45
- | krw | 🇰🇷 | 韩元 KRW |
46
- | hkd | 🇭🇰 | 港币 HKD |
47
- | aud | 🇦🇺 | 澳元 AUD |
48
- | cad | 🇨🇦 | 加元 CAD |
49
- | sgd | 🇸🇬 | 新币 SGD |
50
- | myr | 🇲🇾 | 马来西亚林吉特 MYR |
51
- | thb | 🇹🇭 | 泰铢 THB |
52
- | inr | 🇮🇳 | 印度卢比 INR |
53
- | rub | 🇷🇺 | 俄罗斯卢布 RUB |
54
- | brl | 🇧🇷 | 巴西雷亚尔 BRL |
55
- | zar | 🇿🇦 | 南非兰特 ZAR |
56
- | mxn | 🇲🇽 | 墨西哥比索 MXN |
57
- | php | 🇵🇭 | 菲律宾比索 PHP |
58
- | idr | 🇮🇩 | 印尼盾 IDR |
59
- | vnd | 🇻🇳 | 越南盾 VND |
60
- | nzd | 🇳🇿 | 新西兰元 NZD |
61
- | try | 🇹🇷 | 土耳其里拉 TRY |
62
- | pln | 🇵🇱 | 波兰兹罗提 PLN |
63
- | sek | 🇸🇪 | 瑞典克朗 SEK |
64
- | nok | 🇳🇴 | 挪威克朗 NOK |
65
- | dkk | 🇩🇰 | 丹麦克朗 DKK |
66
-
67
- ## 使用示例
68
-
69
- ### 基础用法
70
-
71
- ```vue
72
- <template>
73
- <sohelp-cry-input
74
- v-model="value"
75
- separator=","
76
- cry="usd"
77
- :digits="2"
78
- />
79
- </template>
80
-
81
- <script setup>
82
- import { ref } from 'vue';
83
-
84
- const value = ref(1234567.89);
85
- </script>
86
- ```
87
-
88
- ### 不同币别
5
+ ## 基础用法
89
6
 
90
7
  ```vue
91
8
  <template>
92
- <div class="demo">
93
- <div class="item">
94
- <label>美元 (USD)</label>
95
- <sohelp-cry-input v-model="usd" separator="," cry="usd" :digits="2" />
96
- </div>
97
- <div class="item">
98
- <label>人民币 (CNY)</label>
99
- <sohelp-cry-input v-model="cny" separator="," cry="cny" :digits="2" />
100
- </div>
101
- <div class="item">
102
- <label>欧元 (EUR)</label>
103
- <sohelp-cry-input v-model="eur" separator="," cry="eur" :digits="2" />
104
- </div>
105
- <div class="item">
106
- <label>日元 (JPY)</label>
107
- <sohelp-cry-input v-model="jpy" separator="," cry="jpy" :digits="0" />
108
- </div>
109
- </div>
9
+ <sohelp-cry-input v-model="amount" cry="usd" :digits="2" />
110
10
  </template>
111
11
 
112
12
  <script setup>
113
13
  import { ref } from 'vue';
114
-
115
- const usd = ref(1234567.89);
116
- const cny = ref(1234567.89);
117
- const eur = ref(1234567.89);
118
- const jpy = ref(1234567);
14
+ const amount = ref(1234567.89);
119
15
  </script>
120
16
  ```
121
17
 
122
- ### 不显示国旗
123
-
124
- ```vue
125
- <template>
126
- <sohelp-cry-input
127
- v-model="value"
128
- separator=","
129
- cry="usd"
130
- :digits="2"
131
- :show-flag="false"
132
- />
133
- </template>
134
- ```
135
-
136
- ### 不同小数位数
137
-
138
- ```vue
139
- <template>
140
- <sohelp-cry-input
141
- v-model="value"
142
- separator=","
143
- cry="cny"
144
- :digits="4"
145
- />
146
- </template>
147
- ```
148
-
149
- ### 使用 v-bind 传递原生属性
150
-
151
- ```vue
152
- <template>
153
- <sohelp-cry-input
154
- v-model="value"
155
- v-bind="inputProps"
156
- @focus="handleFocus"
157
- @blur="handleBlur"
158
- />
159
- </template>
160
-
161
- <script setup>
162
- import { ref } from 'vue';
163
-
164
- const value = ref(0);
165
-
166
- const inputProps = {
167
- placeholder: '请输入金额',
168
- disabled: false,
169
- clearable: true,
170
- size: 'large'
171
- };
172
-
173
- const handleFocus = () => {
174
- console.log('获得焦点');
175
- };
18
+ ## 属性 (Props)
176
19
 
177
- const handleBlur = () => {
178
- console.log('失去焦点');
179
- };
180
- </script>
181
- ```
20
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
21
+ | :--- | :--- | :--- | :--- | :--- |
22
+ | modelValue | Number / String | `''` | 否 | 绑定值(纯数字,支持 v-model) |
23
+ | separator | String | `','` | 否 | 千分符分隔符 |
24
+ | cry | String | `'cny'` | 否 | 币别代码(如 `'usd'`、`'cny'`、`'eur'`),用于显示对应国旗 |
25
+ | digits | Number | `2` | 否 | 保留小数位数 |
26
+ | showFlag | Boolean | `true` | 否 | 是否在输入框前缀显示币别国旗图标 |
27
+ | autofocus | Boolean | `false` | 否 | 组件挂载后是否自动获取焦点 |
182
28
 
183
- ### 禁用自动聚焦
29
+ > 支持通过 `v-bind="$attrs"` 透传所有 `el-input` 原生属性(如 `placeholder`、`disabled`、`readonly`、`clearable`、`size` 等)。
184
30
 
185
- ```vue
186
- <template>
187
- <sohelp-cry-input
188
- v-model="value"
189
- :autofocus="false"
190
- />
191
- </template>
192
- ```
193
-
194
- ### 禁用/只读状态
31
+ ## 事件 (Events)
195
32
 
196
- ```vue
197
- <template>
198
- <div>
199
- <sohelp-cry-input
200
- v-model="value1"
201
- disabled
202
- placeholder="禁用状态"
203
- />
204
- <sohelp-cry-input
205
- v-model="value2"
206
- readonly
207
- placeholder="只读状态"
208
- />
209
- </div>
210
- </template>
211
- ```
33
+ | 事件名 | 回调参数 | 说明 |
34
+ | :--- | :--- | :--- |
35
+ | update:modelValue | `(value: Number / String)` | 输入框失焦时触发,返回解析后的纯数字值 |
@@ -10,7 +10,7 @@
10
10
 
11
11
  <script setup>
12
12
  import { ref, computed, watch, defineAsyncComponent, onMounted, nextTick } from 'vue';
13
- import { FlagMap } from '@/components/sohelp-eleplus/icons/flag';
13
+ import { FlagMap } from '../icons/flag';
14
14
 
15
15
  // 组件属性定义
16
16
  const props = defineProps({
@@ -33,6 +33,10 @@
33
33
  showFlag: {
34
34
  type: Boolean,
35
35
  default: true
36
+ },
37
+ autofocus: {
38
+ type: Boolean,
39
+ default: false
36
40
  }
37
41
  });
38
42
 
@@ -97,7 +101,7 @@
97
101
  // 组件挂载后自动获取焦点(可通过 :autofocus="false" 禁用)
98
102
  onMounted(() => {
99
103
  nextTick(() => {
100
- if (props.autofocus !== false && inputRef.value) {
104
+ if (props.autofocus && inputRef.value) {
101
105
  inputRef.value.focus();
102
106
  }
103
107
  });
@@ -1,27 +1,24 @@
1
- # 日期选择器 (Date)
1
+ # SohelpDate 日期选择器
2
2
 
3
- 基于 `el-date-picker` 封装的日期选择组件,默认格式为 `YYYY-MM-DD`。
3
+ 基于 `el-date-picker` 封装的日期选择组件,默认值格式为 `YYYY-MM-DD`,支持自动聚焦,并透传所有 `el-date-picker` 属性。
4
4
 
5
- ## 属性 (Props)
6
-
7
- | 属性名 | 类型 | 默认值 | 说明 |
8
- | :--- | :--- | :--- | :--- |
9
- | focus | Boolean | false | 组件挂载后是否自动获取焦点。 |
10
- | ... | - | - | 支持 `el-date-picker` 的所有属性。 |
11
-
12
- ## 使用示例
5
+ ## 基础用法
13
6
 
14
7
  ```vue
15
8
  <template>
16
- <sohelp-date
17
- v-model="createDate"
18
- placeholder="选择日期"
19
- />
9
+ <sohelp-date v-model="date" placeholder="请选择日期" />
20
10
  </template>
21
11
 
22
12
  <script setup>
23
13
  import { ref } from 'vue';
24
14
 
25
- const createDate = ref('');
15
+ const date = ref('');
26
16
  </script>
27
17
  ```
18
+
19
+ ## 属性 (Props)
20
+
21
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
22
+ | :--- | :--- | :--- | :--- | :--- |
23
+ | focus | Boolean | `false` | 否 | 组件挂载后是否自动获取焦点 |
24
+ | — | — | — | — | 支持 `el-date-picker` 的所有属性(通过 `v-bind="$attrs"` 透传) |
@@ -1,29 +1,27 @@
1
- # 日期时间选择器 (Datetime)
1
+ # SohelpDatetime 日期时间选择器
2
2
 
3
- 基于 `el-date-picker` 封装的日期时间选择组件,默认类型为 `datetime`。
3
+ 基于 `el-date-picker` 封装的日期时间选择组件,默认类型为 `datetime`,默认值格式为 `YYYY-MM-DD HH:mm:ss`,支持自动聚焦及透传所有 `el-date-picker` 属性。
4
4
 
5
- ## 属性 (Props)
6
-
7
- | 属性名 | 类型 | 默认值 | 说明 |
8
- | :--- | :--- | :--- | :--- |
9
- | modelValue | String/Date | '' | 绑定的日期时间值 (v-model)。 |
10
- | type | String | 'datetime' | 选择器类型。 |
11
- | valueFormat | String | 'YYYY-MM-DD HH:mm:ss' | 绑定值的格式。 |
12
- | focus | Boolean | false | 组件挂载后是否自动获取焦点。 |
13
-
14
- ## 使用示例
5
+ ## 基础用法
15
6
 
16
7
  ```vue
17
8
  <template>
18
- <sohelp-datetime
19
- v-model="meetingTime"
20
- placeholder="选择会议时间"
21
- />
9
+ <sohelp-datetime v-model="dateTime" placeholder="请选择日期时间" />
22
10
  </template>
23
11
 
24
12
  <script setup>
25
13
  import { ref } from 'vue';
26
14
 
27
- const meetingTime = ref('');
15
+ const dateTime = ref('');
28
16
  </script>
29
17
  ```
18
+
19
+ ## 属性 (Props)
20
+
21
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
22
+ | :--- | :--- | :--- | :--- | :--- |
23
+ | modelValue | String | `''` | 否 | 绑定值,支持 `v-model` 双向绑定 |
24
+ | type | String | `'datetime'` | 否 | 日期选择器类型,对应 `el-date-picker` 的 `type` |
25
+ | valueFormat | String | `'YYYY-MM-DD HH:mm:ss'` | 否 | 绑定值的格式 |
26
+ | focus | Boolean | `false` | 否 | 组件挂载后是否自动获取焦点 |
27
+ | — | — | — | — | 支持 `el-date-picker` 的所有属性(通过 `v-bind="$attrs"` 透传) |
@@ -1,28 +1,13 @@
1
- # 日期时间选择器 (Datetime Picker)
1
+ # SohelpDatetimePicker 日期时间快捷选择器
2
2
 
3
- 基于 `el-date-picker` 封装,预设了常用的日期范围快捷选项(如今天、昨天、本周、本月等)。
3
+ 基于 `el-date-picker` 封装的日期时间范围选择组件,内置常用日期快捷选项(今天、昨天、前天、本周、上周、本月、上月、本年、去年),并透传所有 `el-date-picker` 属性。
4
4
 
5
- ## 功能特性
6
-
7
- - **快捷选项**:内置今天、昨天、前天、本周、上周、本月、上月、本年、去年等快捷选择。
8
- - **灵活配置**:支持自定义类型和格式。
9
-
10
- ## 属性 (Props)
11
-
12
- | 属性名 | 类型 | 默认值 | 说明 |
13
- | :--- | :--- | :--- | :--- |
14
- | modelValue | String/Array | '' | 绑定的值 (v-model)。 |
15
- | type | String | 'datetimerange' | 选择器类型。 |
16
- | valueFormat | String | 'YYYY-MM-DD HH:mm:ss' | 绑定值的格式。 |
17
- | ... | - | - | 支持 `el-date-picker` 的其他属性。 |
18
-
19
- ## 使用示例
5
+ ## 基础用法
20
6
 
21
7
  ```vue
22
8
  <template>
23
9
  <sohelp-datetime-picker
24
10
  v-model="dateRange"
25
- type="datetimerange"
26
11
  start-placeholder="开始时间"
27
12
  end-placeholder="结束时间"
28
13
  />
@@ -34,3 +19,18 @@ import { ref } from 'vue';
34
19
  const dateRange = ref([]);
35
20
  </script>
36
21
  ```
22
+
23
+ ## 属性 (Props)
24
+
25
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
26
+ | :--- | :--- | :--- | :--- | :--- |
27
+ | modelValue | String | `''` | 否 | 绑定值,支持 `v-model` |
28
+ | type | String | `'datetimerange'` | 否 | 日期选择器类型,对应 `el-date-picker` 的 `type` |
29
+ | valueFormat | String | `'YYYY-MM-DD HH:mm:ss'` | 否 | 绑定值的格式 |
30
+ | — | — | — | — | 支持 `el-date-picker` 的所有属性(通过 `v-bind="$attrs"` 透传) |
31
+
32
+ ## 事件 (Events)
33
+
34
+ | 事件名 | 回调参数 | 说明 |
35
+ | :--- | :--- | :--- |
36
+ | update:modelValue | `value: String / Array` | 值变化时触发 |
@@ -12,8 +12,10 @@
12
12
  import { ref, reactive, watch } from 'vue';
13
13
  import dayjs from 'dayjs';
14
14
  const props = defineProps({
15
- modelValue: String,
16
- default: '',
15
+ modelValue: {
16
+ type: String,
17
+ default: ''
18
+ },
17
19
  type: {
18
20
  type: String,
19
21
  default: 'datetimerange'
@@ -24,7 +26,7 @@
24
26
  }
25
27
  });
26
28
 
27
- const emit = defineEmits('update:modelValue');
29
+ const emit = defineEmits(['update:modelValue']);
28
30
  const value = ref([]);
29
31
  const now = dayjs();
30
32
  const dateType = reactive([
@@ -73,8 +75,13 @@
73
75
  () => props.modelValue,
74
76
  (val) => {
75
77
  value.value = val;
76
- }
78
+ },
79
+ { immediate: true }
77
80
  );
81
+
82
+ watch(value, (val) => {
83
+ emit('update:modelValue', val);
84
+ });
78
85
  </script>
79
86
 
80
87
  <script>
@@ -1,35 +1,32 @@
1
- # 日期时间范围 (Datetime Range)
1
+ # SohelpDatetimeRange 日期时间范围选择器
2
2
 
3
- 由两个独立的日期时间选择器组成的范围选择组件,中间支持自定义分隔符。
3
+ 由两个 `sohelp-datetime` 组件组合而成的日期时间范围选择组件,支持自定义分隔符和日期格式。
4
4
 
5
- ## 属性 (Props)
6
-
7
- | 属性名 | 类型 | 默认值 | 说明 |
8
- | :--- | :--- | :--- | :--- |
9
- | modelValue | Array | [] | 绑定的时间范围数组 [start, end]。 |
10
- | format | String | 'YYYY-MM-DD HH:mm:ss' | 日期时间格式。 |
11
- | separator | String | '-' | 中间的分隔符。 |
12
-
13
- ## 事件 (Events)
14
-
15
- | 事件名 | 说明 | 回调参数 |
16
- | :--- | :--- | :--- |
17
- | update:modelValue | 值变化时触发。 | `value: Array` |
18
- | change | 值变化时触发。 | - |
19
-
20
- ## 使用示例
5
+ ## 基础用法
21
6
 
22
7
  ```vue
23
8
  <template>
24
- <sohelp-datetime-range
25
- v-model="range"
26
- separator="至"
27
- />
9
+ <sohelp-datetime-range v-model="range" separator="至" />
28
10
  </template>
29
11
 
30
12
  <script setup>
31
13
  import { ref } from 'vue';
32
14
 
33
- const range = ref(['2023-01-01 00:00:00', '2023-01-31 23:59:59']);
15
+ const range = ref(['2024-01-01 00:00:00', '2024-01-31 23:59:59']);
34
16
  </script>
35
17
  ```
18
+
19
+ ## 属性 (Props)
20
+
21
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
22
+ | :--- | :--- | :--- | :--- | :--- |
23
+ | modelValue | String / Number / Array | — | 否 | 绑定值,支持 `v-model`;数组时为 `[开始时间, 结束时间]` |
24
+ | format | String | `'YYYY-MM-DD HH:mm:ss'` | 否 | 日期时间的显示格式和值格式 |
25
+ | separator | String | `'-'` | 否 | 两个选择器之间的分隔符文本 |
26
+
27
+ ## 事件 (Events)
28
+
29
+ | 事件名 | 回调参数 | 说明 |
30
+ | :--- | :--- | :--- |
31
+ | update:modelValue | `value: Array` | 任一选择器值变化时触发,返回 `[开始时间, 结束时间]` 数组 |
32
+ | change | — | 任一选择器值变化时触发 |
@@ -0,0 +1,43 @@
1
+ # SohelpDemoBlock 示例展示块
2
+
3
+ 基于 `ele-card` 封装的组件演示展示块,支持展示组件示例、查看源码、复制代码和内嵌 API 文档。
4
+
5
+ ## 基础用法
6
+
7
+ ```vue
8
+ <template>
9
+ <sohelp-demo-block
10
+ title="按钮示例"
11
+ description="这是一个基础按钮的演示"
12
+ :code="codeStr"
13
+ :props="propsData"
14
+ :events="eventsData"
15
+ >
16
+ <el-button type="primary">按钮</el-button>
17
+ </sohelp-demo-block>
18
+ </template>
19
+
20
+ <script setup>
21
+ const codeStr = '<el-button type="primary">按钮</el-button>';
22
+ const propsData = [{ name: 'type', type: 'String', default: '-', required: false, desc: '按钮类型' }];
23
+ const eventsData = [{ name: 'click', params: 'event', desc: '点击事件' }];
24
+ </script>
25
+ ```
26
+
27
+ ## 属性 (Props)
28
+
29
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
30
+ | --- | --- | --- | --- | --- |
31
+ | title | String | `''` | 否 | 示例标题 |
32
+ | description | String | `''` | 否 | 示例描述 |
33
+ | code | String | `''` | 否 | 示例源码 |
34
+ | props | Array | `[]` | 否 | Props API 数据,每项含 `name/type/default/required/desc` |
35
+ | events | Array | `[]` | 否 | Events API 数据,每项含 `name/params/desc` |
36
+ | methods | Array | `[]` | 否 | Methods API 数据,每项含 `name/params/desc` |
37
+ | slots | Array | `[]` | 否 | Slots API 数据,每项含 `name/params/desc` |
38
+
39
+ ## 插槽 (Slots)
40
+
41
+ | 插槽名 | 说明 |
42
+ | --- | --- |
43
+ | default | 演示内容区域 |