sadais-piui 1.2.7-beta160 → 1.2.7-beta162
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.
|
@@ -15,7 +15,12 @@
|
|
|
15
15
|
class="date-item"
|
|
16
16
|
style="cursor: pointer;"
|
|
17
17
|
:class="[
|
|
18
|
-
{
|
|
18
|
+
{
|
|
19
|
+
'pi-disabled':
|
|
20
|
+
day.disabled ||
|
|
21
|
+
day.type === 'disabled-prev' ||
|
|
22
|
+
day.type === 'disabled-next'
|
|
23
|
+
},
|
|
19
24
|
{ range: day.range },
|
|
20
25
|
{ marked: day.marked }
|
|
21
26
|
]"
|
|
@@ -234,7 +239,7 @@ export default {
|
|
|
234
239
|
day = {
|
|
235
240
|
...day,
|
|
236
241
|
...this.$pi.date.parseDate(this.firstDay[i - 1]),
|
|
237
|
-
type: this.weekView ? '' : 'disabled'
|
|
242
|
+
type: this.weekView ? '' : 'disabled-prev'
|
|
238
243
|
}
|
|
239
244
|
} else if (i > monthDays + firstDayCount) {
|
|
240
245
|
// 下月数据
|
|
@@ -243,7 +248,7 @@ export default {
|
|
|
243
248
|
...this.$pi.date.parseDate(
|
|
244
249
|
new Date(nextMonthFirstDay.setDate(i - monthDays - firstDayCount))
|
|
245
250
|
),
|
|
246
|
-
type: this.weekView ? '' : 'disabled'
|
|
251
|
+
type: this.weekView ? '' : 'disabled-next'
|
|
247
252
|
}
|
|
248
253
|
} else {
|
|
249
254
|
// 当月数据
|
|
@@ -360,7 +365,24 @@ export default {
|
|
|
360
365
|
this.$emit('change', value)
|
|
361
366
|
},
|
|
362
367
|
handleSelectDate(date) {
|
|
363
|
-
if (date.disabled)
|
|
368
|
+
if (date.disabled) {
|
|
369
|
+
if (/disabled/.test(date.type)) {
|
|
370
|
+
if (date.type === 'disabled-prev') {
|
|
371
|
+
this.$emit('change-prev-month')
|
|
372
|
+
} else if (date.type === 'disabled-next') {
|
|
373
|
+
this.$emit('change-next-month')
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return
|
|
377
|
+
}
|
|
378
|
+
if (/disabled/.test(date.type)) {
|
|
379
|
+
if (date.type === 'disabled-prev') {
|
|
380
|
+
this.$emit('change-prev-month')
|
|
381
|
+
} else if (date.type === 'disabled-next') {
|
|
382
|
+
this.$emit('change-next-month')
|
|
383
|
+
}
|
|
384
|
+
return
|
|
385
|
+
}
|
|
364
386
|
if (this.type === 'date') {
|
|
365
387
|
// 单选方式
|
|
366
388
|
this.handleChange(date)
|
|
@@ -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"
|
|
@@ -447,6 +447,13 @@ export default {
|
|
|
447
447
|
return uploadImg.customPreviewImage
|
|
448
448
|
}
|
|
449
449
|
},
|
|
450
|
+
// 是否禁止preview预览
|
|
451
|
+
disablePreview: {
|
|
452
|
+
type: Boolean,
|
|
453
|
+
default() {
|
|
454
|
+
return uploadImg.disablePreview
|
|
455
|
+
}
|
|
456
|
+
},
|
|
450
457
|
},
|
|
451
458
|
data() {
|
|
452
459
|
return {
|
|
@@ -689,6 +696,7 @@ export default {
|
|
|
689
696
|
this.handleEmitChange()
|
|
690
697
|
},
|
|
691
698
|
handlePreview(img) {
|
|
699
|
+
if (this.disablePreview) return
|
|
692
700
|
const file = this.imgField ? img[this.imgField] : img
|
|
693
701
|
if (isImageFilename(file)) {
|
|
694
702
|
this.handlePreviewImage(file)
|
package/config/uploadImg.js
CHANGED
|
@@ -65,7 +65,7 @@ export default {
|
|
|
65
65
|
camera: 'back', // 前置或后置摄像头,默认back
|
|
66
66
|
extension: [] // 允许上传的文件类型,不填则不限制
|
|
67
67
|
},
|
|
68
|
-
parseResultFn: function(result) {
|
|
68
|
+
parseResultFn: function (result) {
|
|
69
69
|
try {
|
|
70
70
|
return JSON.parse(result.data)?.data.url
|
|
71
71
|
} catch (error) {
|
|
@@ -104,4 +104,5 @@ export default {
|
|
|
104
104
|
customUploadParams: {}, // 自定义上传参数,对象形式
|
|
105
105
|
fileLimit: null, // 文件大小限制,单位为字节,null表示不限制
|
|
106
106
|
customPreviewImage: false, // 是否自定义预览图片(如果为true,则不调用预览,通过事件自己实现预览)
|
|
107
|
+
disablePreview: false, // 是否禁止preview预览
|
|
107
108
|
}
|