sadais-piui 1.2.7-beta7 → 1.2.7-beta71
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/components/pi-bottom-bar/index.vue +1 -1
- package/components/pi-calendar/index.vue +187 -182
- package/components/pi-calendar-input/index.vue +6 -2
- package/components/pi-calendar-panel/components/calendar-days/index.vue +410 -0
- package/components/pi-calendar-panel/index.vue +201 -163
- package/components/pi-cascader/index.vue +536 -0
- package/components/pi-checkbox/index.vue +3 -4
- package/components/pi-checkbox-group/index.vue +2 -8
- package/components/pi-circle-progress/index.vue +108 -21
- package/components/pi-collapse/index.vue +124 -0
- package/components/pi-collapse-item/index.vue +352 -0
- package/components/pi-date-picker/index.vue +464 -391
- package/components/pi-date-picker-input/index.vue +12 -3
- package/components/pi-dropdown/components/dropdown-tab.vue +33 -24
- package/components/pi-dropdown/index.vue +58 -22
- package/components/pi-dropdown-item/index.vue +74 -55
- package/components/pi-form-item/index.vue +9 -4
- package/components/pi-grid/index.vue +1 -1
- package/components/pi-grid-item/index.vue +4 -4
- package/components/pi-img/index.vue +0 -1
- package/components/pi-img-cropper/index.vue +110 -110
- package/components/pi-input/index.vue +21 -3
- package/components/pi-list-item/index.vue +1 -1
- package/components/pi-popup/index.vue +5 -1
- package/components/pi-radio/index.vue +5 -5
- package/components/pi-radio-group/index.vue +0 -4
- package/components/pi-regions-select/index.vue +6 -1
- package/components/pi-regions-select-input/index.vue +6 -2
- package/components/pi-search/index.vue +29 -2
- package/components/pi-section/index.vue +1 -1
- package/components/pi-select/index.vue +48 -4
- package/components/pi-select-input/index.vue +6 -2
- package/components/pi-stepper/index.vue +1 -1
- package/components/pi-steps/index.vue +115 -36
- package/components/pi-table/index.vue +351 -0
- package/components/pi-tabs/index.vue +9 -3
- package/components/pi-tag/index.vue +488 -0
- package/components/pi-upload-img/index.vue +58 -9
- package/components/pi-webview/index.vue +9 -3
- package/config/actionSheet.js +0 -1
- package/config/calendarPanel.js +4 -1
- package/config/cascader.js +22 -0
- package/config/circleProgress.js +17 -10
- package/config/collapse.js +7 -0
- package/config/collapseItem.js +11 -0
- package/config/datePicker.js +29 -24
- package/config/dropdown.js +4 -1
- package/config/input.js +1 -0
- package/config/select.js +2 -0
- package/config/steps.js +1 -1
- package/config/table.js +9 -0
- package/config/tag.js +21 -0
- package/config/uploadImg.js +3 -7
- package/package.json +5 -2
- package/scss/common.scss +11 -13
- package/scss/icon/icon.scss +2 -1
- package/scss/mixin.scss +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: zhangzhenfei
|
|
3
3
|
* @Date: 2022-05-18 11:08:49
|
|
4
|
-
* @LastEditTime:
|
|
5
|
-
* @LastEditors:
|
|
4
|
+
* @LastEditTime: 2023-08-03 16:19:44
|
|
5
|
+
* @LastEditors: liujun
|
|
6
6
|
* @Description: 日历输入
|
|
7
|
-
* @FilePath:
|
|
7
|
+
* @FilePath: \dt-opt-manage-consoled:\project-liujun\piui-awesome\src\piui\components\pi-date-picker-input\index.vue
|
|
8
8
|
-->
|
|
9
9
|
|
|
10
10
|
<template>
|
|
@@ -55,6 +55,11 @@
|
|
|
55
55
|
:end-year="getDatePicker.endYear"
|
|
56
56
|
:field="getDatePicker.field"
|
|
57
57
|
:date-type="getDatePicker.dateType"
|
|
58
|
+
:year-options="getDatePicker.yearOptions"
|
|
59
|
+
:month-options="getDatePicker.monthOptions"
|
|
60
|
+
:day-options="getDatePicker.dayOptions"
|
|
61
|
+
:hour-options="getDatePicker.hourOptions"
|
|
62
|
+
:minute-options="getDatePicker.minuteOptions"
|
|
58
63
|
:format="dateFormat"
|
|
59
64
|
:item-height="getDatePicker.itemHeight"
|
|
60
65
|
:item-style="getDatePicker.itemStyle"
|
|
@@ -64,6 +69,10 @@
|
|
|
64
69
|
:confirm-btn="getDatePicker.confirmBtn"
|
|
65
70
|
:cancel-btn="getDatePicker.cancelBtn"
|
|
66
71
|
@confirm="handleDatePickerConfirm"
|
|
72
|
+
@close="$emit('close', $event)"
|
|
73
|
+
@closed="$emit('closed', $event)"
|
|
74
|
+
@show="$emit('show', $event)"
|
|
75
|
+
@showed="$emit('showed', $event)"
|
|
67
76
|
/>
|
|
68
77
|
</view>
|
|
69
78
|
</template>
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
<!-- 注意:slot内不能使用父组件data -->
|
|
3
|
+
<view
|
|
4
|
+
class="dropdown-tab-item pi-justify-center pi-align-center"
|
|
5
|
+
:style="[getTabItemStyle]"
|
|
6
|
+
:class="[{ opened: item.opened }]"
|
|
7
|
+
@tap.stop="handleClick"
|
|
8
|
+
>
|
|
9
|
+
<pi-icon
|
|
10
|
+
v-if="item.showIcon"
|
|
11
|
+
:name="item.iconOption.name"
|
|
12
|
+
:dot="item.iconOption.dot"
|
|
13
|
+
:badge="item.iconOption.badge"
|
|
14
|
+
:color="item.iconOption.color"
|
|
15
|
+
:size="item.iconOption.size"
|
|
16
|
+
:class-prefix="item.iconOption.classPrefix"
|
|
17
|
+
:custom-style="item.iconOption.customStyle"
|
|
18
|
+
:custom-class="`pi-mg-right-8 ${item.iconOption.customClass}`"
|
|
19
|
+
/>
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</view>
|
|
21
|
+
<text class="pi-pd-right-12 pi-fz-28">
|
|
22
|
+
{{ item.text }}
|
|
23
|
+
</text>
|
|
24
|
+
<pi-icon :class="{ rotate: item.opened }" name="arrow-down_fill" size="26" color="#999" />
|
|
26
25
|
</view>
|
|
27
26
|
</template>
|
|
28
27
|
|
|
@@ -39,6 +38,15 @@ export default {
|
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
},
|
|
41
|
+
computed: {
|
|
42
|
+
getTabItemStyle() {
|
|
43
|
+
const styles = {}
|
|
44
|
+
if (this.item.opened && this.item.activeColor) {
|
|
45
|
+
styles.color = this.item.activeColor
|
|
46
|
+
}
|
|
47
|
+
return styles
|
|
48
|
+
}
|
|
49
|
+
},
|
|
42
50
|
methods: {
|
|
43
51
|
handleClick() {
|
|
44
52
|
this.$emit('click', this.item)
|
|
@@ -49,7 +57,8 @@ export default {
|
|
|
49
57
|
|
|
50
58
|
<style lang="scss" scoped>
|
|
51
59
|
.dropdown-tab-item {
|
|
52
|
-
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
53
62
|
&.opened {
|
|
54
63
|
color: $pi-primary-color;
|
|
55
64
|
}
|
|
@@ -6,18 +6,24 @@
|
|
|
6
6
|
:items="tabs"
|
|
7
7
|
:show-slider-bar="false"
|
|
8
8
|
show-item-split-line
|
|
9
|
+
:stretch="stretch"
|
|
10
|
+
:height="tabHeight"
|
|
9
11
|
active-text-color="inherit"
|
|
10
12
|
>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
<!-- 注意:slot内不能使用父组件data -->
|
|
14
|
+
<dropdown-tab
|
|
15
|
+
slot="item"
|
|
16
|
+
slot-scope="{ item, index }"
|
|
17
|
+
:item="item"
|
|
18
|
+
class="pi-w-100P pi-h-100P"
|
|
19
|
+
@click="handleClickTab(item, index)"
|
|
20
|
+
/>
|
|
15
21
|
</pi-tabs>
|
|
16
22
|
</view>
|
|
17
23
|
<!-- 展示dropdownItem下的数据 -->
|
|
18
24
|
<view
|
|
19
|
-
class="pi-dropdown-content
|
|
20
|
-
:class="[contentClass
|
|
25
|
+
class="pi-dropdown-content"
|
|
26
|
+
:class="[contentClass]"
|
|
21
27
|
:style="[contentStyle, contentCombinationStyle]"
|
|
22
28
|
>
|
|
23
29
|
<slot />
|
|
@@ -26,11 +32,12 @@
|
|
|
26
32
|
<!-- 遮罩层 -->
|
|
27
33
|
<view
|
|
28
34
|
v-if="!closed"
|
|
29
|
-
class="pi-
|
|
35
|
+
class="pi-fixed pi-dropdown-mask"
|
|
30
36
|
:class="[show ? getMask.animationShow : getMask.animationHide]"
|
|
31
37
|
:style="[
|
|
32
38
|
{
|
|
33
39
|
'z-index': getMask.zIndex,
|
|
40
|
+
'top': maskAlignTop ? containerRect.top + containerRect.height + 'px' : '-9999px',
|
|
34
41
|
'background': getMask.background,
|
|
35
42
|
'animation-duration': getDuration.css
|
|
36
43
|
}
|
|
@@ -123,6 +130,22 @@ export default {
|
|
|
123
130
|
return dropdown.activeColor
|
|
124
131
|
}
|
|
125
132
|
},
|
|
133
|
+
// 标签是否均分布局,可选值 `true`
|
|
134
|
+
stretch: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
// `false`
|
|
137
|
+
default() {
|
|
138
|
+
return dropdown.stretch
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
// 标签的高度,单位rpx
|
|
142
|
+
tabHeight: {
|
|
143
|
+
type: [String, Number],
|
|
144
|
+
// `80`
|
|
145
|
+
default() {
|
|
146
|
+
return dropdown.tabHeight
|
|
147
|
+
}
|
|
148
|
+
},
|
|
126
149
|
// -------------以下属性为子组件pi-dropdown-item继承用--------------
|
|
127
150
|
// 行高 值为数字,则单位默认rpx
|
|
128
151
|
itemHeight: {
|
|
@@ -158,11 +181,19 @@ export default {
|
|
|
158
181
|
},
|
|
159
182
|
// 选中checkbox配置
|
|
160
183
|
selectedCheckbox: {
|
|
161
|
-
type: Object,
|
|
184
|
+
type: [Object, String],
|
|
162
185
|
default() {
|
|
163
186
|
// 参照checkbox
|
|
164
187
|
return dropdown.selectedCheckbox
|
|
165
188
|
}
|
|
189
|
+
},
|
|
190
|
+
// 是否需要蒙层顶部对齐组件,可选值 `false`
|
|
191
|
+
maskAlignTop: {
|
|
192
|
+
type: Boolean,
|
|
193
|
+
// `true`
|
|
194
|
+
default() {
|
|
195
|
+
return dropdown.maskAlignTop
|
|
196
|
+
}
|
|
166
197
|
}
|
|
167
198
|
},
|
|
168
199
|
data() {
|
|
@@ -174,7 +205,8 @@ export default {
|
|
|
174
205
|
|
|
175
206
|
show: false, // 是否显示节点
|
|
176
207
|
showed: false, // 是否显示动画执行完毕
|
|
177
|
-
closed: true // 是否已关闭(用来防止val为false的情况,动画无法执行)
|
|
208
|
+
closed: true, // 是否已关闭(用来防止val为false的情况,动画无法执行)
|
|
209
|
+
submiting: false // 正在更新值(防止快速切换提交)
|
|
178
210
|
}
|
|
179
211
|
},
|
|
180
212
|
computed: {
|
|
@@ -182,8 +214,8 @@ export default {
|
|
|
182
214
|
const { containerRect, closed } = this
|
|
183
215
|
return {
|
|
184
216
|
top: `${containerRect.height}px`,
|
|
185
|
-
left:
|
|
186
|
-
width: `${
|
|
217
|
+
left: `-${containerRect.left}px`,
|
|
218
|
+
width: `${this.$pi.system.systemInfo.windowWidth}px`,
|
|
187
219
|
zIndex: !closed ? 101 : -1
|
|
188
220
|
}
|
|
189
221
|
},
|
|
@@ -218,15 +250,11 @@ export default {
|
|
|
218
250
|
// 同步父子组件的值
|
|
219
251
|
if (this.val[index] !== item.val) {
|
|
220
252
|
console.log(TAG, 'Dropdown和DropdownItem绑定值不一致,即将同步')
|
|
221
|
-
|
|
222
|
-
// 以子组件的值为准
|
|
223
|
-
hasValueChange = true
|
|
224
|
-
val[index] = item.val
|
|
225
|
-
} else if (this.val[index]) {
|
|
226
|
-
item.emitChange(this.val[index])
|
|
227
|
-
}
|
|
253
|
+
item.emitChange(this.val[index])
|
|
228
254
|
}
|
|
229
|
-
const currentOption = item.options?.find(
|
|
255
|
+
const currentOption = item.options?.find(
|
|
256
|
+
opt => !opt.clearable && opt[item.getKeyField] === this.val[index]
|
|
257
|
+
)
|
|
230
258
|
const newItem = {
|
|
231
259
|
showIcon: item.showIcon,
|
|
232
260
|
iconOption: item.getIconOption,
|
|
@@ -246,6 +274,11 @@ export default {
|
|
|
246
274
|
// 显示当前Tab
|
|
247
275
|
async handleClickTab(item) {
|
|
248
276
|
if (item.disabled) return
|
|
277
|
+
if (this.submiting) return console.log(TAG, '你点得太快了')
|
|
278
|
+
if (this.show && item.id === this.activeItem.id) {
|
|
279
|
+
this.closeMask()
|
|
280
|
+
return
|
|
281
|
+
}
|
|
249
282
|
// 更新打开的tab标志
|
|
250
283
|
this.tabs = this.tabs.map(tab => {
|
|
251
284
|
tab.opened = tab.id === item.id
|
|
@@ -255,7 +288,7 @@ export default {
|
|
|
255
288
|
// 每次点击都重新更新父容器的位置
|
|
256
289
|
this.containerRect = await this.$pi.common.queryRect(this, '.pi-dropdown', false)
|
|
257
290
|
this.openMask()
|
|
258
|
-
this._children.
|
|
291
|
+
this._children.forEach(child => {
|
|
259
292
|
child.show = child._uid === item.id
|
|
260
293
|
})
|
|
261
294
|
},
|
|
@@ -274,6 +307,9 @@ export default {
|
|
|
274
307
|
closeMask() {
|
|
275
308
|
if (!this.show || !this.showed) return
|
|
276
309
|
console.log(TAG, '隐藏下拉菜单遮罩层')
|
|
310
|
+
this._children.forEach(child => {
|
|
311
|
+
child.show = false
|
|
312
|
+
})
|
|
277
313
|
this.show = false
|
|
278
314
|
this.showed = false
|
|
279
315
|
this.tabs = this.tabs.map(tab => {
|
|
@@ -282,11 +318,13 @@ export default {
|
|
|
282
318
|
})
|
|
283
319
|
setTimeout(() => {
|
|
284
320
|
this.closed = true
|
|
321
|
+
this.submiting = false
|
|
285
322
|
this.getMask.hideTabBar && uni.showTabBar()
|
|
286
323
|
}, this.getDuration.js)
|
|
287
324
|
},
|
|
288
325
|
// 关闭弹窗并返回结果
|
|
289
326
|
submit() {
|
|
327
|
+
this.submiting = true
|
|
290
328
|
this.closeMask()
|
|
291
329
|
setTimeout(() => {
|
|
292
330
|
// 延迟执行,防止父子组件的值同步不上
|
|
@@ -304,10 +342,8 @@ export default {
|
|
|
304
342
|
.pi-dropdown-content {
|
|
305
343
|
position: absolute;
|
|
306
344
|
background: #ffffff;
|
|
307
|
-
border-radius: 12rpx;
|
|
308
345
|
}
|
|
309
346
|
.pi-dropdown-mask {
|
|
310
|
-
top: -9999px;
|
|
311
347
|
left: -9999px;
|
|
312
348
|
right: -9999px;
|
|
313
349
|
bottom: -9999px;
|
|
@@ -1,56 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
<view class="pi-dropdown-item pi-w-100P pi-flex-column" :class="[{ show }]">
|
|
3
|
+
<!-- extra slot -->
|
|
4
|
+
<slot name="extra" />
|
|
5
|
+
<scroll-view scroll-y class="pi-scroll">
|
|
6
|
+
<slot>
|
|
7
|
+
<view
|
|
8
|
+
v-for="item in options"
|
|
9
|
+
:key="item[getKeyField]"
|
|
10
|
+
class="item-wrap pi-pd-tb-24 pi-pd-lr-32 pi-w-100P pi-align-center"
|
|
11
|
+
:class="[
|
|
12
|
+
customClass,
|
|
13
|
+
item[getDisabledField] ? 'disabled' : '',
|
|
14
|
+
getSelectedCheckbox === 'none' ? 'pi-justify-center' : 'pi-justify-between'
|
|
15
|
+
]"
|
|
16
|
+
:style="[customStyle, getItemStyle]"
|
|
17
|
+
@tap="handleSelectItem(item)"
|
|
18
|
+
>
|
|
19
|
+
<view :class="[{ 'pi-primary': item[getKeyField] === val }]">
|
|
20
|
+
{{ item[getDisplayField] }}
|
|
21
|
+
</view>
|
|
22
|
+
<!-- 如果配置了图片地址,使用图片 -->
|
|
23
|
+
<pi-img
|
|
24
|
+
v-if="getSelectedImg.src && item[getKeyField] === val"
|
|
25
|
+
:src="getSelectedImg.src"
|
|
26
|
+
:mode="getSelectedImg.mode"
|
|
27
|
+
:width="getSelectedImg.width"
|
|
28
|
+
:height="getSelectedImg.height"
|
|
29
|
+
:dot="getSelectedImg.dot"
|
|
30
|
+
:dot-radius="getSelectedImg.dotRadius"
|
|
31
|
+
:badge="getSelectedImg.badge"
|
|
32
|
+
:shape="getSelectedImg.shape"
|
|
33
|
+
:border-radius="getSelectedImg.borderRadius"
|
|
34
|
+
:show-loading="getSelectedImg.showLoading"
|
|
35
|
+
:loading-color="getSelectedImg.loadingColor"
|
|
36
|
+
:loading-type="getSelectedImg.loadingType"
|
|
37
|
+
:loading-size="getSelectedImg.loadingSize"
|
|
38
|
+
:show-error="getSelectedImg.showError"
|
|
39
|
+
:webp="getSelectedImg.webp"
|
|
40
|
+
custom-class="pi-mg-left-24"
|
|
41
|
+
/>
|
|
42
|
+
<!-- 默认使用复选框 -->
|
|
43
|
+
<pi-checkbox
|
|
44
|
+
v-if="!getSelectedImg.src && getSelectedCheckbox !== 'none'"
|
|
45
|
+
readonly
|
|
46
|
+
:value="item[getKeyField] === val"
|
|
47
|
+
:name="getSelectedCheckbox.name"
|
|
48
|
+
:shape="getSelectedCheckbox.shape"
|
|
49
|
+
:border-radius="getSelectedCheckbox.borderRadius"
|
|
50
|
+
:border="getSelectedCheckbox.border"
|
|
51
|
+
:disabled="getSelectedCheckbox.disabled"
|
|
52
|
+
:size="getSelectedCheckbox.size"
|
|
53
|
+
:icon-size="getSelectedCheckbox.iconSize"
|
|
54
|
+
:active-color="getSelectedCheckbox.activeColor"
|
|
55
|
+
:active-mode="getSelectedCheckbox.activeMode"
|
|
56
|
+
custom-class="pi-mg-left-24"
|
|
57
|
+
/>
|
|
14
58
|
</view>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
:src="getSelectedImg.src"
|
|
19
|
-
:mode="getSelectedImg.mode"
|
|
20
|
-
:width="getSelectedImg.width"
|
|
21
|
-
:height="getSelectedImg.height"
|
|
22
|
-
:dot="getSelectedImg.dot"
|
|
23
|
-
:dot-radius="getSelectedImg.dotRadius"
|
|
24
|
-
:badge="getSelectedImg.badge"
|
|
25
|
-
:shape="getSelectedImg.shape"
|
|
26
|
-
:border-radius="getSelectedImg.borderRadius"
|
|
27
|
-
:show-loading="getSelectedImg.showLoading"
|
|
28
|
-
:loading-color="getSelectedImg.loadingColor"
|
|
29
|
-
:loading-type="getSelectedImg.loadingType"
|
|
30
|
-
:loading-size="getSelectedImg.loadingSize"
|
|
31
|
-
:show-error="getSelectedImg.showError"
|
|
32
|
-
:webp="getSelectedImg.webp"
|
|
33
|
-
custom-class="pi-mg-left-24"
|
|
34
|
-
/>
|
|
35
|
-
<!-- 默认使用复选框 -->
|
|
36
|
-
<pi-checkbox
|
|
37
|
-
v-if="!getSelectedImg.src"
|
|
38
|
-
readonly
|
|
39
|
-
:value="item.id === val"
|
|
40
|
-
:name="getSelectedCheckbox.name"
|
|
41
|
-
:shape="getSelectedCheckbox.shape"
|
|
42
|
-
:border-radius="getSelectedCheckbox.borderRadius"
|
|
43
|
-
:border="getSelectedCheckbox.border"
|
|
44
|
-
:disabled="getSelectedCheckbox.disabled"
|
|
45
|
-
:size="getSelectedCheckbox.size"
|
|
46
|
-
:icon-size="getSelectedCheckbox.iconSize"
|
|
47
|
-
:active-color="getSelectedCheckbox.activeColor"
|
|
48
|
-
:active-mode="getSelectedCheckbox.activeMode"
|
|
49
|
-
custom-class="pi-mg-left-24"
|
|
50
|
-
/>
|
|
51
|
-
</view>
|
|
52
|
-
</slot>
|
|
53
|
-
</scroll-view>
|
|
59
|
+
</slot>
|
|
60
|
+
</scroll-view>
|
|
61
|
+
</view>
|
|
54
62
|
</template>
|
|
55
63
|
|
|
56
64
|
<script>
|
|
@@ -148,7 +156,7 @@ export default {
|
|
|
148
156
|
},
|
|
149
157
|
// 选中checkbox配置
|
|
150
158
|
selectedCheckbox: {
|
|
151
|
-
type: Object,
|
|
159
|
+
type: [Object, String],
|
|
152
160
|
default() {
|
|
153
161
|
// 参照checkbox
|
|
154
162
|
return dropdownItem.selectedCheckbox
|
|
@@ -185,6 +193,9 @@ export default {
|
|
|
185
193
|
return this.$pi.lang.mergeDeep(selectedImg, this.selectedImg)
|
|
186
194
|
},
|
|
187
195
|
getSelectedCheckbox() {
|
|
196
|
+
if (this.inheritProps.selectedCheckbox === 'none') {
|
|
197
|
+
return this.inheritProps.selectedCheckbox
|
|
198
|
+
}
|
|
188
199
|
const selectedCheckbox = this.inheritProps.selectedCheckbox || dropdownItem.selectedCheckbox
|
|
189
200
|
return this.$pi.lang.mergeDeep(selectedCheckbox, this.selectedCheckbox)
|
|
190
201
|
},
|
|
@@ -203,7 +214,7 @@ export default {
|
|
|
203
214
|
if (item[this.getDisabledField]) {
|
|
204
215
|
return
|
|
205
216
|
}
|
|
206
|
-
this.emitChange(item.
|
|
217
|
+
this.emitChange(item[this.getKeyField])
|
|
207
218
|
setTimeout(() => {
|
|
208
219
|
this._parent.submit()
|
|
209
220
|
}, 300) // 延迟 可见按钮点击动画
|
|
@@ -216,11 +227,19 @@ export default {
|
|
|
216
227
|
@import '../../scss/mixin.scss';
|
|
217
228
|
|
|
218
229
|
.pi-dropdown-item {
|
|
219
|
-
max-height:
|
|
230
|
+
max-height: 0;
|
|
231
|
+
opacity: 0;
|
|
232
|
+
transition: opacity $pi-animation-duration $pi-animation-timing-function,
|
|
233
|
+
max-height $pi-animation-duration $pi-animation-timing-function;
|
|
234
|
+
&.show {
|
|
235
|
+
max-height: 600rpx;
|
|
236
|
+
height: 600rpx;
|
|
237
|
+
opacity: 1;
|
|
238
|
+
}
|
|
220
239
|
.item-wrap {
|
|
221
240
|
&:not(:last-child) {
|
|
222
241
|
@include pi-border;
|
|
223
|
-
&::
|
|
242
|
+
&::before {
|
|
224
243
|
border: 0 solid $pi-list-border-color;
|
|
225
244
|
border-bottom-width: $pi-list-border-width;
|
|
226
245
|
}
|
|
@@ -263,7 +263,7 @@ export default {
|
|
|
263
263
|
data() {
|
|
264
264
|
return {
|
|
265
265
|
initialValue: '', // 初始值
|
|
266
|
-
validateState: '', // 是否校验成功
|
|
266
|
+
validateState: 'success', // 是否校验成功
|
|
267
267
|
validateMessage: '' // 校验失败的提示语
|
|
268
268
|
}
|
|
269
269
|
},
|
|
@@ -400,7 +400,7 @@ export default {
|
|
|
400
400
|
// 从pi-form的rules属性中,取出当前pi-form-item的校验规则
|
|
401
401
|
getRules() {
|
|
402
402
|
// 父组件的所有规则
|
|
403
|
-
const parentRules = this._parent &&
|
|
403
|
+
const parentRules = this._parent && this._parent.validRules
|
|
404
404
|
const rules = parentRules ? parentRules[this.prop] : []
|
|
405
405
|
return [].concat(rules || [])
|
|
406
406
|
},
|
|
@@ -423,6 +423,9 @@ export default {
|
|
|
423
423
|
return new Promise((resolve, reject) => {
|
|
424
424
|
const rules = this.getFilteredRule(trigger)
|
|
425
425
|
if (!this.prop || !rules || rules.length === 0) {
|
|
426
|
+
this.validateState = 'success'
|
|
427
|
+
this.validateMessage = ''
|
|
428
|
+
console.log(TAG, '字段无需校验', this.prop)
|
|
426
429
|
return resolve(_getResolve())
|
|
427
430
|
}
|
|
428
431
|
const fieldValue = this._parent ? this._parent.model[this.prop] : undefined
|
|
@@ -490,7 +493,7 @@ export default {
|
|
|
490
493
|
}
|
|
491
494
|
&.border {
|
|
492
495
|
@include pi-border;
|
|
493
|
-
&::
|
|
496
|
+
&::before {
|
|
494
497
|
border: 0 solid $pi-form-border-color;
|
|
495
498
|
border-bottom-width: $pi-form-border-width;
|
|
496
499
|
}
|
|
@@ -498,15 +501,17 @@ export default {
|
|
|
498
501
|
.form-label {
|
|
499
502
|
font-weight: $pi-form-label-weight;
|
|
500
503
|
color: $pi-form-label-color;
|
|
504
|
+
white-space: nowrap;
|
|
501
505
|
&.border {
|
|
502
506
|
@include pi-border;
|
|
503
|
-
&::
|
|
507
|
+
&::before {
|
|
504
508
|
border: 0 solid $pi-form-border-color;
|
|
505
509
|
border-bottom-width: $pi-form-border-width;
|
|
506
510
|
}
|
|
507
511
|
}
|
|
508
512
|
}
|
|
509
513
|
.content-wrap {
|
|
514
|
+
overflow: hidden;
|
|
510
515
|
&.nowrap {
|
|
511
516
|
margin-left: 24rpx;
|
|
512
517
|
}
|
|
@@ -192,21 +192,21 @@ export default {
|
|
|
192
192
|
vertical-align: middle;
|
|
193
193
|
&.border {
|
|
194
194
|
@include pi-border;
|
|
195
|
-
&::
|
|
195
|
+
&::before {
|
|
196
196
|
border: 0 solid $pi-grid-border-color;
|
|
197
197
|
// 只生成右下边框
|
|
198
198
|
border-right-width: $pi-grid-border-width;
|
|
199
199
|
border-bottom-width: $pi-grid-border-width;
|
|
200
200
|
}
|
|
201
|
-
&.gap::
|
|
201
|
+
&.gap::before {
|
|
202
202
|
// 如果有间隔的情况下(边框全部生成)
|
|
203
203
|
border-width: $pi-grid-border-width;
|
|
204
204
|
}
|
|
205
|
-
&.first-row::
|
|
205
|
+
&.first-row::before {
|
|
206
206
|
// 首行生成上边框
|
|
207
207
|
border-top-width: $pi-grid-border-width;
|
|
208
208
|
}
|
|
209
|
-
&.first-col::
|
|
209
|
+
&.first-col::before {
|
|
210
210
|
// 首列生成左边框
|
|
211
211
|
border-left-width: $pi-grid-border-width;
|
|
212
212
|
}
|