sadais-piui 1.2.7-beta157 → 1.2.7-beta159

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.
@@ -40,7 +40,7 @@
40
40
  'pi-solid-bottom-1': showItemBottomBorder,
41
41
  'pi-disabled': item.disabled
42
42
  }"
43
- class="pi-align-center pi-fz-30 pi-pd-lr-32"
43
+ class="pi-align-center pi-fz-32 pi-pd-lr-32"
44
44
  hover-class="pi-hover-class"
45
45
  @tap.stop="handleSelectItem(item)"
46
46
  >
@@ -56,7 +56,7 @@
56
56
  <template v-if="cancelText">
57
57
  <pi-gap height="20" />
58
58
  <view
59
- class="pi-align-center pi-fz-30 pi-pd-32 pi-light-gray"
59
+ class="pi-align-center pi-fz-32 pi-pd-32 pi-light-gray"
60
60
  hover-class="pi-hover-class"
61
61
  :style="[getItemAlignStyle]"
62
62
  @tap="handleCancel"
@@ -461,17 +461,9 @@ export default {
461
461
  )
462
462
  },
463
463
  getFieldValue(obj, keypath) {
464
- if (obj) {
465
- return keypath.split('-').reduce((prev, key) => {
466
- let tmpKey = key
467
- if (/^\[\d+\]$/.test(key)) {
468
- tmpKey = tmpKey.slice(1, -1)
469
- }
470
- prev = prev && prev[tmpKey]
471
- return prev
472
- }, obj)
473
- }
474
- return undefined
464
+ // 使用工具函数中的 getFieldValue 方法
465
+ // 支持嵌套对象和数组访问,如: a.b.c, items[0].name, users[0].addresses[1].city
466
+ return this.$pi.lang.getFieldValue(obj, keypath)
475
467
  },
476
468
  // 校验数据
477
469
  validation(trigger) {
@@ -6,7 +6,7 @@
6
6
  * @Description: 图片上传组件
7
7
  * @FilePath: \piui\components\pi-upload-img\index.vue
8
8
  -->
9
-
9
+
10
10
  <template>
11
11
  <view
12
12
  class="pi-upload-img"
@@ -439,7 +439,12 @@ export default {
439
439
  default() {
440
440
  return uploadImg.fileLimit
441
441
  }
442
- }
442
+ },
443
+ // 上传成功解析对象方法
444
+ customPreview: {
445
+ type: [Function, null],
446
+ default: null
447
+ },
443
448
  },
444
449
  data() {
445
450
  return {
@@ -721,6 +726,13 @@ export default {
721
726
  // 预览图片
722
727
  handlePreviewImage(img) {
723
728
  if (!this.previewFullImage) return
729
+
730
+ // 自定义预览功能
731
+ if (this.customPreview && this.$pi.lang.isFunction(this.customPreview)) {
732
+ this.customPreview(img)
733
+ return
734
+ }
735
+
724
736
  let urls = []
725
737
  let current = ''
726
738
 
@@ -6,7 +6,7 @@ export default {
6
6
  items: [], // 选项列表,默认([])
7
7
  keyField: 'id', // 选项id字段,默认为id
8
8
  displayField: 'text', // 选项显示字段,默认为text
9
- itemHeight: 110, // 行高(默认:'110rpx')
9
+ itemHeight: 120, // 行高(默认:'120rpx')
10
10
  itemStyle: {}, // 行样式(默认:{})
11
11
  itemAlign: 'center', // 行对齐方式,默认值:'center'
12
12
  showItemBottomBorder: true, // 是否显示底部边线
@@ -102,5 +102,6 @@ export default {
102
102
  customTakePhoto: false, // 是否自定义拍照(如果为true,则不调用相机,通过事件自己实现拍照上传)
103
103
  fileIconMap: {}, // 文件类型和图标映射关系,对象形式({PDF: 'https://xxx'})
104
104
  customUploadParams: {}, // 自定义上传参数,对象形式
105
- fileLimit: null // 文件大小限制,单位为字节,null表示不限制
105
+ fileLimit: null, // 文件大小限制,单位为字节,null表示不限制
106
+ customPreview: null, // 自定义预览功能
106
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta157",
3
+ "version": "1.2.7-beta159",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {