vue3-element-dict 2.0.8 → 2.1.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # vue3-element-dict
2
2
 
3
- vue3-element-dict是在vue3框架下对element-plus组件库的部分组件进行二开,实现更轻松使用字典数据的字典包插件。引入此包后,可轻松实现select下拉选项,radio单选框,checkbox多选框,cascader联级选项,tree树形控件,tree-select树形选项,table-column等组件。拥有多种字典相关方法及日期格式化,脱敏等方法。
3
+ vue3-element-dict是在vue3框架下对element-plus组件库的部分组件进行二开,实现更轻松使用字典数据的字典包插件。引入此包后,可轻松实现select下拉选项,radio单选框,checkbox多选框,cascader联级选项,tree树形控件,tree-select树形选项,table-column等组件。拥有多种字典相关方法及日期格式化,脱敏等方法。
4
4
 
5
5
  **示例:实现select**
6
6
 
@@ -70,7 +70,7 @@ export default {
70
70
  color: "color"
71
71
  }, // 配置字典值和显示 字段的配置项 需同时配置 不可只配一个 选传 默认值 label 及 value
72
72
  formatterDictList: (data, query) => {
73
- return data.xiaobuDictData
73
+ return data.xiaobuDictData
74
74
  }, // data为请求字典接口后返回的data数据 格式化返回字典数据,此处return的为字典数据,用于兼容返回的数据结构与默认不一致问题, 选传 默认返回 data.dictData query为请求的字典类型的参数,用于部分接口不按要求,没返回 dictType: [{},{}] 数据结构的形式,此时可利用query自行拼凑成符合的数据格式
75
75
  formatterDictVersion: (data) => {
76
76
  return data.xiaobuDictVersion
@@ -132,7 +132,6 @@ src下新建文件dict-config.ts,用于配置字典包相关配置。配置项
132
132
  | usuallyGetDictTypes | String | 否 | 经常用到的字典数据,一进项目就会对缓存字典中无此类型的字典数据进行请求,此配置项在iframe项目中能发挥更大作用,进页面就一次性将全部字典数据一个接口请求掉,避免同时请求太多字典接口 选传 默认空 多个字典以 英文逗号隔开 如 sex,personType | "" |
133
133
  | usuallyGetDictTypesByApi | Boolean | 否 | 是否必从接口中获取。 | false |
134
134
 
135
-
136
135
  isGetAll为true时,每次进入项目都将会通过接口获取所有字典数据。
137
136
 
138
137
  isGetAll为false,且usuallyGetDictTypes无配置时,则不做任何处理。
@@ -141,7 +140,6 @@ isGetAll为false,且usuallyGetDictTypes有配置字典类型时(多个时使
141
140
 
142
141
  isGetAll为false,usuallyGetDictTypes有配置字典类型时(多个时使用英文逗号分隔),且配置了usuallyGetDictTypesByApi为true时,则会统一前往请求一次性获取usuallyGetDictTypes配置的字典类型并与旧缓存合并存储在缓存中。
143
142
 
144
-
145
143
  **localDictCodes的格式及字典数据的的格式如下**
146
144
 
147
145
  ```ts
@@ -255,8 +253,6 @@ getGlobalConfigApi().then(data => {
255
253
 
256
254
  至此已全部配置完成,就可以轻松使用了。
257
255
 
258
-
259
-
260
256
  ### 使用
261
257
 
262
258
  此包拥有组件及方法在此列出来
@@ -367,8 +363,6 @@ getGlobalConfigApi().then(data => {
367
363
  > > >
368
364
  > > > getTreeItemByLabel
369
365
 
370
-
371
-
372
366
  **此处主要讲包的配置及准备工作,具体用法可前往[vue3-element-dict官网](http://xiaobusoft.com/vue3-element-dict)查看使用文档,[备用官网](https://shenxiaobu.github.io/vue3-element-dict/),如有问题可前往[问题反馈表格进行记录](https://docs.qq.com/sheet/DVmZQb0hyTk9uc1dY), 也可关注微信公众号【爆米花小布】私信进行反馈**
373
367
 
374
368
  ![公众号二维码](https://www.xiaobusoft.com/static/gongzhonghao_QR_code.png)
@@ -379,9 +373,19 @@ getGlobalConfigApi().then(data => {
379
373
 
380
374
  ![赞助码](https://www.xiaobusoft.com/static/qr-card.png)
381
375
 
376
+ ## 更新日志
382
377
 
378
+ ### 2.1.0
383
379
 
384
- ## 更新日志
380
+ 1. 【优化】FormatDate 兼容4、6、8、10、14位连续数字字符串或数字格式
381
+ 2. 【优化】修复 使用 await GetDictObjByDictTypes 方法时 无法 顺延继续获取接口的bug GetDictObjByDictTypes 新增return Promise
382
+ 3. 【优化】修复GetDictObjByDictTypes获取的字典数据会产生undefined: true/false的问题
383
+ 4. 【优化】GetLabelByCodesFilter(vals, type, options) options新增emptyText属性配置,用于options未设置defaultVal时,vals中的某一项有值则显示该值,无值显示emptyText,emptyText默认值为“--”
384
+ 5. 【优化】GetTreeLabelByCodesFilter(vals, type, options) options新增emptyText属性配置,用于options未设置defaultVal时,vals中的某一项有值则显示该值,无值显示emptyText,emptyText默认值为“--”
385
+ 6. 【优化】el-tabel-column组件新增emptyText属性配置,用于dictType类型或dictTreeType类型且未设置defaultVal时,可实现有值但是找不到对应字典类型则显示该值,为空时则显示emptyText, emptyText 默认值为“--”
386
+ 7. 【优化】姓名脱敏优化,新增复姓,慕容云海 =》 慕容+海 欧阳锋 =》 欧阳+ 沈小布 =》 沈+布 王涛 =》 王+
387
+ 8. 【优化】树形数据过滤器及方法间隔符有 , 改为 /
388
+ 9. 【优化】el-select-dict、el-radio-dict、el-radio-button-dict、el-checkbox-dict、el-checkbox-button-dict、el-tabs-dict组件新增data属性配置自定义选项数据,format属性配置自定义选项格式
385
389
 
386
390
  ### 2.0.8
387
391
 
@@ -426,16 +430,21 @@ const options = computed(() => {
426
430
  ```
427
431
 
428
432
  ### 2.0.5
433
+
429
434
  1. 【修复】修复同个页面使用同个字典类型时,只有第一个组件会渲染数据的bug
430
435
 
431
436
  ### 2.0.3 (废弃)
437
+
432
438
  1. 【修复】修复同个页面使用同个字典类型时,只有第一个组件会渲染数据的bug
433
439
 
434
440
  ### 2.0.2
441
+
435
442
  1. 【优化】新增 getDictData 和 getDictDataByKey 两个获取字典数据方法
436
443
 
437
444
  ### 2.0.1
445
+
438
446
  1. 【修复】修复字典包全局配置 filterDataFun 和 disabledDataFun配置无效问题
439
447
 
440
448
  ### 2.0.0
441
- vue3-element-dict发布
449
+
450
+ vue3-element-dict发布