gi-component 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gi-component",
3
3
  "type": "module",
4
- "version": "0.0.14",
4
+ "version": "0.0.16",
5
5
  "description": "Vue3中基于Element Plus二次封装基础组件库",
6
6
  "author": "lin",
7
7
  "license": "MIT",
@@ -116,7 +116,8 @@ export function createDialog() {
116
116
  ...options,
117
117
  content: () => h(DialogContent, { type: 'error', content: options.content as string }),
118
118
  simple: true,
119
- style: { maxWidth: '420px', ...options.style }
119
+ style: { maxWidth: '420px', ...options.style },
120
+ lockScroll: false
120
121
  })
121
122
  }
122
123
  }
@@ -194,6 +194,36 @@ onMounted(() => {
194
194
  loadDictData()
195
195
  })
196
196
 
197
+ /** 获取占位文本 */
198
+ const getPlaceholder = (item: FormColumnItem) => {
199
+ if (!item.type) return undefined
200
+ if (['input', 'input-number', 'input-tag'].includes(item.type)) {
201
+ return `请输入${item.label}`
202
+ }
203
+ if (['textarea'].includes(item.type)) {
204
+ return `请填写${item.label}`
205
+ }
206
+ if (
207
+ [
208
+ 'select',
209
+ 'select-v2',
210
+ 'tree-select',
211
+ 'cascader',
212
+ 'time-select',
213
+ 'input-search'
214
+ ].includes(item.type)
215
+ ) {
216
+ return `请选择${item.label}`
217
+ }
218
+ if (['date-picker'].includes(item.type)) {
219
+ return `请选择日期`
220
+ }
221
+ if (['time-picker'].includes(item.type)) {
222
+ return `请选择时间`
223
+ }
224
+ return undefined
225
+ }
226
+
197
227
  // 组件的默认props配置
198
228
  function getComponentBindProps(item: FormColumnItem) {
199
229
  // 获取默认配置
@@ -263,36 +293,6 @@ const CompMap: Record<Exclude<FormColumnType, 'slot'>, any> = {
263
293
 
264
294
  const formRef = ref<FormInstance>()
265
295
 
266
- /** 获取占位文本 */
267
- const getPlaceholder = (item: FormColumnItem) => {
268
- if (!item.type) return undefined
269
- if (['input', 'input-number', 'input-tag'].includes(item.type)) {
270
- return `请输入${item.label}`
271
- }
272
- if (['textarea'].includes(item.type)) {
273
- return `请填写${item.label}`
274
- }
275
- if (
276
- [
277
- 'select',
278
- 'select-v2',
279
- 'tree-select',
280
- 'cascader',
281
- 'time-select',
282
- 'input-search'
283
- ].includes(item.type)
284
- ) {
285
- return `请选择${item.label}`
286
- }
287
- if (['date-picker'].includes(item.type)) {
288
- return `请选择日期`
289
- }
290
- if (['time-picker'].includes(item.type)) {
291
- return `请选择时间`
292
- }
293
- return undefined
294
- }
295
-
296
296
  /** 表单项校验规则 */
297
297
  function getFormItemRules(item: FormColumnItem) {
298
298
  if (item.required) {
@@ -7,30 +7,30 @@ import type { InputSearchInstance } from '../../input-search'
7
7
 
8
8
  export type FormColumnType
9
9
  = | 'input'
10
- | 'textarea'
11
- | 'input-number'
12
- | 'input-tag'
13
- | 'input-search'
14
- | 'select'
15
- | 'select-v2'
16
- | 'tree-select'
17
- | 'cascader'
18
- | 'slider'
19
- | 'switch'
20
- | 'rate'
21
- | 'checkbox-group'
22
- | 'checkbox'
23
- | 'radio-group'
24
- | 'radio'
25
- | 'date-picker'
26
- | 'time-picker'
27
- | 'time-select'
28
- | 'color-picker'
29
- | 'transfer'
30
- | 'autocomplete'
31
- | 'upload'
32
- | 'title'
33
- | 'slot'
10
+ | 'textarea'
11
+ | 'input-number'
12
+ | 'input-tag'
13
+ | 'input-search'
14
+ | 'select'
15
+ | 'select-v2'
16
+ | 'tree-select'
17
+ | 'cascader'
18
+ | 'slider'
19
+ | 'switch'
20
+ | 'rate'
21
+ | 'checkbox-group'
22
+ | 'checkbox'
23
+ | 'radio-group'
24
+ | 'radio'
25
+ | 'date-picker'
26
+ | 'time-picker'
27
+ | 'time-select'
28
+ | 'color-picker'
29
+ | 'transfer'
30
+ | 'autocomplete'
31
+ | 'upload'
32
+ | 'title'
33
+ | 'slot'
34
34
 
35
35
  /**
36
36
  * 表单列属性类型,根据组件类型使用对应的属性类型