sadais-piui 1.2.4-beta5 → 1.2.4-beta6
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.
|
@@ -175,7 +175,7 @@ export default {
|
|
|
175
175
|
return formItem.labelAlign
|
|
176
176
|
},
|
|
177
177
|
validator: function(value) {
|
|
178
|
-
return ['left', 'center', 'right'].includes(value)
|
|
178
|
+
return [null, 'left', 'center', 'right'].includes(value)
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
181
|
// 表单输入区域 label 对齐方式
|
|
@@ -187,7 +187,7 @@ export default {
|
|
|
187
187
|
return formItem.inputAlign
|
|
188
188
|
},
|
|
189
189
|
validator: function(value) {
|
|
190
|
-
return ['left', 'center', 'right'].includes(value)
|
|
190
|
+
return [null, 'left', 'center', 'right'].includes(value)
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
193
|
// 是否以换行样式显示表单
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</view>
|
|
23
23
|
|
|
24
24
|
<!-- 标题和描述 -->
|
|
25
|
-
<view v-if="title || desc">
|
|
25
|
+
<view v-if="title || desc" class="title-wrap">
|
|
26
26
|
<view v-if="title" :style="[titleStyle]" class="list-item-title">{{ title }}</view>
|
|
27
27
|
<view v-if="desc" :style="[descStyle]" class="list-item-desc">{{ desc }}</view>
|
|
28
28
|
</view>
|
|
@@ -307,6 +307,10 @@ export default {
|
|
|
307
307
|
.pi-list-item {
|
|
308
308
|
height: $pi-form-item-height;
|
|
309
309
|
line-height: 1;
|
|
310
|
+
.title-wrap {
|
|
311
|
+
max-width: 100%;
|
|
312
|
+
overflow: hidden;
|
|
313
|
+
}
|
|
310
314
|
.list-item-title {
|
|
311
315
|
font-size: $pi-list-title-fontsize;
|
|
312
316
|
color: $pi-list-title-color;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: zhangzhenfei
|
|
3
3
|
* @Date: 2021-08-13 11:31:57
|
|
4
|
-
* @LastEditTime: 2022-04-
|
|
4
|
+
* @LastEditTime: 2022-04-12 09:11:41
|
|
5
5
|
* @LastEditors: zhangzhenfei
|
|
6
6
|
* @Description: 图片上传组件
|
|
7
|
-
* @FilePath: \piui-awesome\src\piui\components\pi-upload-img\index.vue
|
|
7
|
+
* @FilePath: \hfmp-checkin-frontc:\Users\feilin\workspace\sadais\piui-awesome\src\piui\components\pi-upload-img\index.vue
|
|
8
8
|
-->
|
|
9
9
|
|
|
10
10
|
<template>
|
|
@@ -345,6 +345,7 @@ export default {
|
|
|
345
345
|
} else {
|
|
346
346
|
val = this.isValString ? '' : this.val.filter((_, i) => i !== index)
|
|
347
347
|
}
|
|
348
|
+
this.$emit('remove', index)
|
|
348
349
|
this.val = val
|
|
349
350
|
this.handleEmitChange()
|
|
350
351
|
},
|
|
@@ -428,15 +429,18 @@ export default {
|
|
|
428
429
|
},
|
|
429
430
|
handleCrop(res) {
|
|
430
431
|
console.log(TAG, '处理剪裁')
|
|
432
|
+
this.$emit('crop', res.img)
|
|
431
433
|
this.cropedPic = res.img
|
|
432
434
|
},
|
|
433
435
|
handleCancelCrop() {
|
|
434
436
|
console.log(TAG, '取消剪裁')
|
|
437
|
+
this.$emit('cancelCrop')
|
|
435
438
|
this.showCrop = false
|
|
436
439
|
this.cropPic = ''
|
|
437
440
|
},
|
|
438
441
|
handleCompelteCrop() {
|
|
439
442
|
console.log(TAG, '完成剪裁')
|
|
443
|
+
this.$emit('croped', [this.cropedPic])
|
|
440
444
|
this.showCrop = false
|
|
441
445
|
this.handleUpload([this.cropedPic])
|
|
442
446
|
},
|
package/config/form.js
CHANGED
|
@@ -9,16 +9,16 @@ export default {
|
|
|
9
9
|
height: null, // 高度
|
|
10
10
|
padding: null, // padding
|
|
11
11
|
labelWidth: 120, // 表单项 label 宽度,默认单位为rpx
|
|
12
|
-
labelAlign:
|
|
12
|
+
labelAlign: 'left', // 表单项 label 对齐方式,可选值为 left center right
|
|
13
13
|
labelStyle: null, // 表单项 label样式
|
|
14
|
-
inputAlign:
|
|
15
|
-
wrap:
|
|
16
|
-
labelWrapBorder:
|
|
17
|
-
colon:
|
|
18
|
-
disabled:
|
|
19
|
-
border:
|
|
14
|
+
inputAlign: 'right', // 表单输入区域 label 对齐方式,可选值为 left center right
|
|
15
|
+
wrap: false, // 是否以换行样式显示表单
|
|
16
|
+
labelWrapBorder: false, // wrap样式label是否显示边框
|
|
17
|
+
colon: false, // 是否在 label 后面添加冒号
|
|
18
|
+
disabled: false, // 是否禁用
|
|
19
|
+
border: false, // 是否显示边框
|
|
20
20
|
errorType: 'message',
|
|
21
|
-
showRightIcon:
|
|
21
|
+
showRightIcon: false, // 是否显示右边icon,默认是箭头(可以自定义设置成其他图标)
|
|
22
22
|
rightIcon: {
|
|
23
23
|
...icon,
|
|
24
24
|
name: 'right',
|
package/config/formItem.js
CHANGED
|
@@ -8,15 +8,15 @@ export default {
|
|
|
8
8
|
height: 100, // 表单项高度
|
|
9
9
|
padding: '32rpx', // padding
|
|
10
10
|
labelWidth: null, // 表单项 label 宽度,默认单位为rpx
|
|
11
|
-
labelAlign:
|
|
11
|
+
labelAlign: null, // 表单项 label 对齐方式,可选值为 left center right
|
|
12
12
|
labelStyle: {}, // 表单项 label样式
|
|
13
|
-
inputAlign:
|
|
14
|
-
wrap:
|
|
15
|
-
labelWrapBorder:
|
|
16
|
-
colon:
|
|
17
|
-
disabled:
|
|
18
|
-
border:
|
|
19
|
-
showRightIcon:
|
|
13
|
+
inputAlign: null, // 表单输入区域 label 对齐方式,可选值为 left center right
|
|
14
|
+
wrap: null, // 是否以换行样式显示表单
|
|
15
|
+
labelWrapBorder: null, // wrap样式label是否显示边框
|
|
16
|
+
colon: null, // 是否在 label 后面添加冒号
|
|
17
|
+
disabled: null, // 是否禁用
|
|
18
|
+
border: null, // 是否显示边框
|
|
19
|
+
showRightIcon: null, // 是否显示右边icon,默认是箭头(可以自定义设置成其他图标)
|
|
20
20
|
rightIcon: {
|
|
21
21
|
...icon,
|
|
22
22
|
name: 'right',
|
package/package.json
CHANGED
package/tools/index.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import tool from '@sadais/piui-tool'
|
|
2
2
|
|
|
3
3
|
tool.expand = {
|
|
4
|
+
/**
|
|
5
|
+
* 获取属性值
|
|
6
|
+
* @param {Object} inheritProp 继承属性
|
|
7
|
+
* @param {Object} prop 属性
|
|
8
|
+
* @returns 目标属性值
|
|
9
|
+
*/
|
|
4
10
|
getPropValue(inheritProp, prop) {
|
|
5
|
-
|
|
11
|
+
// 如果属性不存在,则返回继承属性值
|
|
12
|
+
if (prop === null && inheritProp !== null) return inheritProp
|
|
13
|
+
// 如果属性值和继承属性不一致,以属性值为准
|
|
6
14
|
else if (inheritProp !== prop) return prop
|
|
7
15
|
return inheritProp
|
|
8
16
|
}
|