sadais-piui 1.2.7-beta31 → 1.2.7-beta34
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: zhangzhenfei
|
|
3
3
|
* @Date: 2022-06-28 16:53:54
|
|
4
|
-
* @LastEditTime: 2022-
|
|
4
|
+
* @LastEditTime: 2022-08-19 17:25:53
|
|
5
5
|
* @LastEditors: zhangzhenfei
|
|
6
6
|
* @Description: 日历日期数据
|
|
7
|
-
* @FilePath: /
|
|
7
|
+
* @FilePath: /dt-weitibao-console/Users/feilin/workspace/piui/piui-awesome/src/piui/components/pi-calendar-panel/components/calendar-days/index.vue
|
|
8
8
|
-->
|
|
9
9
|
|
|
10
10
|
<template>
|
|
@@ -14,14 +14,18 @@
|
|
|
14
14
|
:key="day.key"
|
|
15
15
|
class="date-item"
|
|
16
16
|
style="cursor: pointer;"
|
|
17
|
-
:class="[
|
|
17
|
+
:class="[
|
|
18
|
+
{ 'pi-disabled': day.disabled || day.type === 'disabled' },
|
|
19
|
+
{ range: day.range },
|
|
20
|
+
{ marked: day.marked }
|
|
21
|
+
]"
|
|
18
22
|
@tap.stop="handleSelectDate(day)"
|
|
19
23
|
>
|
|
20
24
|
<view class="pi-square">
|
|
21
25
|
<view class="pi-rela date-item-inner">
|
|
22
26
|
<view
|
|
23
27
|
class="pi-w-100P pi-h-100P pi-flex-column-center pi-lh-28"
|
|
24
|
-
:style="[day.
|
|
28
|
+
:style="[day.nowStyle, day.activeStyle, day.rangeStyle]"
|
|
25
29
|
>
|
|
26
30
|
<text>{{ day.date }}</text>
|
|
27
31
|
<text v-if="day.tip" class=" pi-text-nowrap pi-fz-18 pi-mg-top-6">
|
|
@@ -152,6 +156,12 @@ export default {
|
|
|
152
156
|
type: Boolean,
|
|
153
157
|
// '是否显示周视图'
|
|
154
158
|
default: calendarPanel.defalutWeekView
|
|
159
|
+
},
|
|
160
|
+
// 日期标记,数组形式,默认([])
|
|
161
|
+
marks: {
|
|
162
|
+
type: Array,
|
|
163
|
+
// []
|
|
164
|
+
default: () => calendarPanel.marks
|
|
155
165
|
}
|
|
156
166
|
},
|
|
157
167
|
data() {
|
|
@@ -201,6 +211,11 @@ export default {
|
|
|
201
211
|
getMaxDate() {
|
|
202
212
|
return this.maxDate ? this.$pi.date.parseDate(this.maxDate) : ''
|
|
203
213
|
},
|
|
214
|
+
getMarks() {
|
|
215
|
+
return this.marks.map(item => {
|
|
216
|
+
return this.$pi.date.parseDate(item)
|
|
217
|
+
})
|
|
218
|
+
},
|
|
204
219
|
// 总天数
|
|
205
220
|
days() {
|
|
206
221
|
const days = []
|
|
@@ -282,6 +297,15 @@ export default {
|
|
|
282
297
|
}
|
|
283
298
|
}
|
|
284
299
|
}
|
|
300
|
+
// 是否打点
|
|
301
|
+
if (this.getMarks.length) {
|
|
302
|
+
const mark = this.getMarks.find(item => {
|
|
303
|
+
return this.isSameDay(item, day)
|
|
304
|
+
})
|
|
305
|
+
if (mark) {
|
|
306
|
+
day.marked = mark
|
|
307
|
+
}
|
|
308
|
+
}
|
|
285
309
|
// 当天样式
|
|
286
310
|
if (this.isSameDay(this.now, day)) {
|
|
287
311
|
day.today = true
|
|
@@ -359,6 +383,20 @@ export default {
|
|
|
359
383
|
z-index: 2;
|
|
360
384
|
width: calc(100% / 7);
|
|
361
385
|
overflow: hidden;
|
|
386
|
+
&.marked {
|
|
387
|
+
&::after {
|
|
388
|
+
content: '';
|
|
389
|
+
position: absolute;
|
|
390
|
+
bottom: 18rpx;
|
|
391
|
+
left: 50%;
|
|
392
|
+
width: 8rpx;
|
|
393
|
+
height: 8rpx;
|
|
394
|
+
background: #ff0027;
|
|
395
|
+
border-radius: 50%;
|
|
396
|
+
transform: translateX(-50%);
|
|
397
|
+
overflow: hidden;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
362
400
|
.date-item-inner {
|
|
363
401
|
padding: 8rpx;
|
|
364
402
|
}
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
:end-text="endText"
|
|
61
61
|
:week-view="weekView"
|
|
62
62
|
:show-back-today="showBackToday"
|
|
63
|
+
:marks="marks"
|
|
63
64
|
@change="handleChange"
|
|
64
65
|
/>
|
|
65
66
|
</swiper-item>
|
|
@@ -219,6 +220,12 @@ export default {
|
|
|
219
220
|
type: Boolean,
|
|
220
221
|
// true
|
|
221
222
|
default: calendarPanel.defalutWeekView
|
|
223
|
+
},
|
|
224
|
+
// 日期标记,数组形式,默认([])
|
|
225
|
+
marks: {
|
|
226
|
+
type: Array,
|
|
227
|
+
// []
|
|
228
|
+
default: () => calendarPanel.marks
|
|
222
229
|
}
|
|
223
230
|
},
|
|
224
231
|
data() {
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
:style="[customStyle, getItemStyle]"
|
|
17
17
|
@tap="handleSelectItem(item)"
|
|
18
18
|
>
|
|
19
|
-
<view :class="[{ 'pi-primary': item[
|
|
19
|
+
<view :class="[{ 'pi-primary': item[getKeyField] === val }]">
|
|
20
20
|
{{ item[getDisplayField] }}
|
|
21
21
|
</view>
|
|
22
22
|
<!-- 如果配置了图片地址,使用图片 -->
|
|
23
23
|
<pi-img
|
|
24
|
-
v-if="getSelectedImg.src && item[
|
|
24
|
+
v-if="getSelectedImg.src && item[getKeyField] === val"
|
|
25
25
|
:src="getSelectedImg.src"
|
|
26
26
|
:mode="getSelectedImg.mode"
|
|
27
27
|
:width="getSelectedImg.width"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<pi-checkbox
|
|
44
44
|
v-if="!getSelectedImg.src && getSelectedCheckbox !== 'none'"
|
|
45
45
|
readonly
|
|
46
|
-
:value="item[
|
|
46
|
+
:value="item[getKeyField] === val"
|
|
47
47
|
:name="getSelectedCheckbox.name"
|
|
48
48
|
:shape="getSelectedCheckbox.shape"
|
|
49
49
|
:border-radius="getSelectedCheckbox.borderRadius"
|
|
@@ -21,6 +21,10 @@ export default {
|
|
|
21
21
|
},
|
|
22
22
|
url: {
|
|
23
23
|
type: String
|
|
24
|
+
},
|
|
25
|
+
autoAddTimestamp: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: () => true
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
data() {
|
|
@@ -47,9 +51,11 @@ export default {
|
|
|
47
51
|
}
|
|
48
52
|
if (!this.url) return
|
|
49
53
|
// H5 url 需要加时间戳,否则会有缓存问题
|
|
50
|
-
this.webviewURL = this.
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
this.webviewURL = this.autoAddTimestamp
|
|
55
|
+
? this.urlAddParam(this.url || '', {
|
|
56
|
+
sadaisTimestamp: new Date().getTime() + '-' + Math.round(Math.random(1) * 10000)
|
|
57
|
+
})
|
|
58
|
+
: this.url
|
|
53
59
|
console.log('webview页面即将打开以下URL:', this.webviewURL)
|
|
54
60
|
// #ifdef APP-PLUS
|
|
55
61
|
const wv = plus.webview.create('', 'custom-webview', {
|
package/config/calendarPanel.js
CHANGED
|
@@ -22,5 +22,6 @@ export default {
|
|
|
22
22
|
endText: '结束', // type=range时生效,结束日期自定义文案,默认('结束')
|
|
23
23
|
dateFormat: 'YYYY-MM-DD', // 已选择的时间格式化显示规则,默认('YYYY-MM-DD')
|
|
24
24
|
canChangeWeekView: false, // 是否可切换周视图,默认(false)
|
|
25
|
-
defalutWeekView: false // 是否默认显示周视图,默认(false)
|
|
25
|
+
defalutWeekView: false, // 是否默认显示周视图,默认(false)
|
|
26
|
+
marks: [] // 日期标记,数组形式,默认([])
|
|
26
27
|
}
|