sadais-piui 1.2.7-beta21 → 1.2.7-beta24
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.
|
@@ -498,6 +498,7 @@ export default {
|
|
|
498
498
|
.form-label {
|
|
499
499
|
font-weight: $pi-form-label-weight;
|
|
500
500
|
color: $pi-form-label-color;
|
|
501
|
+
white-space: nowrap;
|
|
501
502
|
&.border {
|
|
502
503
|
@include pi-border;
|
|
503
504
|
&::after {
|
|
@@ -507,6 +508,7 @@ export default {
|
|
|
507
508
|
}
|
|
508
509
|
}
|
|
509
510
|
.content-wrap {
|
|
511
|
+
overflow: hidden;
|
|
510
512
|
&.nowrap {
|
|
511
513
|
margin-left: 24rpx;
|
|
512
514
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
2
|
+
<view
|
|
3
|
+
class="pi-steps pi-of-hidden"
|
|
4
|
+
:style="[customStyle, { flexDirection: direction }]"
|
|
5
|
+
:class="customClass"
|
|
6
|
+
>
|
|
3
7
|
<view
|
|
4
8
|
v-for="(item, index) in getItems"
|
|
5
9
|
:key="index"
|
|
@@ -37,7 +41,13 @@
|
|
|
37
41
|
|
|
38
42
|
<!-- 文字 -->
|
|
39
43
|
<view :class="['pi-steps-item-text']" :style="{ color: item.style.fontColor }">
|
|
40
|
-
<slot
|
|
44
|
+
<slot
|
|
45
|
+
name="item"
|
|
46
|
+
:item="item"
|
|
47
|
+
:index="index"
|
|
48
|
+
:length="getItems.length"
|
|
49
|
+
:active="index < val"
|
|
50
|
+
>
|
|
41
51
|
<view>{{ item.name }}</view>
|
|
42
52
|
<text v-if="item.desc" class="pi-fz-20 pi-mg-top-10" style="word-break:break-all">
|
|
43
53
|
{{ item.desc }}
|
|
@@ -47,7 +57,7 @@
|
|
|
47
57
|
|
|
48
58
|
<!-- 中线 -->
|
|
49
59
|
<view
|
|
50
|
-
v-if="index < items.length - 1"
|
|
60
|
+
v-if="items.length === 1 || index < items.length - 1"
|
|
51
61
|
class="pi-steps-item-line"
|
|
52
62
|
:style="[lineStyle, item.lineStyle]"
|
|
53
63
|
>
|
|
@@ -167,7 +177,7 @@ export default {
|
|
|
167
177
|
},
|
|
168
178
|
lineStyle() {
|
|
169
179
|
const style = {}
|
|
170
|
-
const size = this.getDotMaxSize / 2 + 'rpx'
|
|
180
|
+
const size = this.getDotMaxSize / 2 - 2 + 'rpx'
|
|
171
181
|
this.direction === 'column' ? (style.left = size) : (style.top = size)
|
|
172
182
|
return style
|
|
173
183
|
},
|
|
@@ -240,15 +250,17 @@ export default {
|
|
|
240
250
|
this.direction === 'column' &&
|
|
241
251
|
this.itemsRect.length &&
|
|
242
252
|
this.iconsRect.length &&
|
|
243
|
-
index < this.itemsRect.length - 1
|
|
253
|
+
(this.itemsRect.length === 1 || index < this.itemsRect.length - 1)
|
|
244
254
|
) {
|
|
245
255
|
// 动态计算线的位置和高度
|
|
246
256
|
item.lineStyle.top = `${this.iconsRect[index].top -
|
|
247
257
|
this.itemsRect[index].top +
|
|
248
258
|
this.iconsRect[index].height +
|
|
249
259
|
2}px`
|
|
250
|
-
|
|
251
|
-
this.iconsRect[index + 1].height
|
|
260
|
+
const nextIconsRectHeight = this.iconsRect[index + 1]
|
|
261
|
+
? this.iconsRect[index + 1].height
|
|
262
|
+
: 0
|
|
263
|
+
item.lineStyle.height = `${this.itemsRect[index].height - nextIconsRectHeight}px`
|
|
252
264
|
}
|
|
253
265
|
return item
|
|
254
266
|
})
|
|
@@ -268,6 +280,7 @@ export default {
|
|
|
268
280
|
},
|
|
269
281
|
methods: {
|
|
270
282
|
async init() {
|
|
283
|
+
if (!this.items?.length) return
|
|
271
284
|
this.iconsRect = await this.$pi.common.queryRect(this, '.step-icon-inner', true)
|
|
272
285
|
this.itemsRect = await this.$pi.common.queryRect(this, '.pi-steps-item', true)
|
|
273
286
|
console.log(TAG, '计算.pi-steps布局', this.itemsRect, this.iconsRect)
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: zhangzhenfei
|
|
3
3
|
* @Date: 2021-08-13 11:31:57
|
|
4
|
-
* @LastEditTime: 2022-
|
|
4
|
+
* @LastEditTime: 2022-07-21 11:25:37
|
|
5
5
|
* @LastEditors: zhangzhenfei
|
|
6
6
|
* @Description: 图片上传组件
|
|
7
|
-
* @FilePath:
|
|
7
|
+
* @FilePath: /dt-weitibao-console/Users/feilin/workspace/piui/piui-awesome/src/piui/components/pi-upload-img/index.vue
|
|
8
8
|
-->
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
|
-
<view class="pi-upload-img" :style="[customStyle]" :class="[customClass]">
|
|
11
|
+
<view class="pi-upload-img pi-pd-top-12" :style="[customStyle]" :class="[customClass]">
|
|
12
12
|
<!-- 已上传图片展示 -->
|
|
13
13
|
<view
|
|
14
14
|
v-for="(img, index) in getImgs"
|
|
@@ -305,13 +305,29 @@ export default {
|
|
|
305
305
|
return this.$pi.lang.isString(this.val)
|
|
306
306
|
},
|
|
307
307
|
getImgs() {
|
|
308
|
+
if (this.val === null || this.val === undefined) {
|
|
309
|
+
return []
|
|
310
|
+
}
|
|
308
311
|
return this.isValString ? (this.val ? [this.val] : []) : this.val.filter(img => img)
|
|
309
312
|
},
|
|
310
313
|
getItemStyle() {
|
|
311
|
-
|
|
314
|
+
const style = {
|
|
315
|
+
width: this.getSize,
|
|
316
|
+
height: this.getSize
|
|
317
|
+
}
|
|
318
|
+
const uploadStyle = this.$pi.lang.mergeDeep(uploadImg.itemStyle, this.itemStyle)
|
|
319
|
+
return this.$pi.lang.mergeDeep(style, uploadStyle)
|
|
320
|
+
},
|
|
321
|
+
getSize() {
|
|
322
|
+
return this.$pi.common.addUnit(this.size)
|
|
312
323
|
},
|
|
313
324
|
getUploadBtnStyle() {
|
|
314
|
-
|
|
325
|
+
const style = {
|
|
326
|
+
width: this.getSize,
|
|
327
|
+
height: this.getSize
|
|
328
|
+
}
|
|
329
|
+
const uploadBtnStyle = this.$pi.lang.mergeDeep(uploadImg.uploadBtnStyle, this.uploadBtnStyle)
|
|
330
|
+
return this.$pi.lang.mergeDeep(style, uploadBtnStyle)
|
|
315
331
|
},
|
|
316
332
|
getUploadIcon() {
|
|
317
333
|
return this.$pi.lang.mergeDeep(uploadImg.uploadIcon, this.uploadIcon)
|
package/config/uploadImg.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: zhangzhenfei
|
|
3
3
|
* @Date: 2021-08-13 11:29:02
|
|
4
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditTime: 2022-07-21 11:20:15
|
|
5
5
|
* @LastEditors: zhangzhenfei
|
|
6
6
|
* @Description: 图片上传
|
|
7
|
-
* @FilePath: /piui-awesome/src/piui/config/
|
|
7
|
+
* @FilePath: /dt-weitibao-console/Users/feilin/workspace/piui/piui-awesome/src/piui/config/uploadImg.js
|
|
8
8
|
*/
|
|
9
9
|
import icon from './icon.js'
|
|
10
10
|
import cropOption from './imgCropper.js'
|
|
@@ -18,18 +18,14 @@ export default {
|
|
|
18
18
|
formData: {}, // 上传表单额外数据,对象形式(默认值:{})
|
|
19
19
|
name: 'file', // 上传的文件字段名
|
|
20
20
|
itemStyle: {
|
|
21
|
-
width: '160rpx',
|
|
22
|
-
height: '160rpx',
|
|
23
21
|
borderRadius: '8rpx'
|
|
24
22
|
}, // 单个文件额外样式,对象形式(默认值:{})
|
|
25
23
|
uploadBtnStyle: {
|
|
26
|
-
width: '160rpx',
|
|
27
|
-
height: '160rpx',
|
|
28
24
|
background: '#f3f3f3',
|
|
29
25
|
borderRadius: '8rpx'
|
|
30
26
|
},
|
|
31
27
|
imageMode: 'aspectFill', // 上传图片模式,默认值:aspectFill
|
|
32
|
-
size: '
|
|
28
|
+
size: '160', // 上传区域尺寸(半径)
|
|
33
29
|
previewFullImage: true, // 是否在点击预览图后展示全屏图片预览
|
|
34
30
|
deletable: true, // 是否可以删除上传的文件
|
|
35
31
|
disabled: false, // 是否禁用上传
|