sadais-piui 1.2.7-beta67 → 1.2.7-beta69
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,186 +1,187 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<pi-popup
|
|
3
|
-
ref="popup"
|
|
4
|
-
:value="val"
|
|
5
|
-
:custom-class="getPopup.customClass"
|
|
6
|
-
:custom-style="getPopup.customStyle"
|
|
7
|
-
:position="getPopup.position"
|
|
8
|
-
:border-radius="getPopup.borderRadius"
|
|
9
|
-
:show-close-icon="showTitle && getPopup.showCloseIcon"
|
|
10
|
-
:close-icon="getPopup.closeIcon"
|
|
11
|
-
:safe-area-inset-bottom="getPopup.safeAreaInsetBottom"
|
|
12
|
-
:mask="getPopup.mask"
|
|
13
|
-
:hide-tab-bar="getPopup.hideTabBar"
|
|
14
|
-
:append-to-body="getPopup.appendToBody"
|
|
15
|
-
:z-index="getPopup.zIndex"
|
|
16
|
-
:background="getPopup.background"
|
|
17
|
-
@close="handlePopupClose"
|
|
18
|
-
@closed="$emit('closed', $event)"
|
|
19
|
-
@show="$emit('show', $event)"
|
|
20
|
-
@showed="$emit('showed', $event)"
|
|
21
|
-
>
|
|
22
|
-
<view class="pi-calendar" :style="[customStyle]" :class="[customClass]">
|
|
23
|
-
<!-- 标题栏 -->
|
|
24
|
-
<view class="pi-justify-center pi-fz-32 pi-fw-500" :style="[{ padding: getTitlePadding }]">
|
|
25
|
-
<slot v-if="$slots.title" name="title" />
|
|
26
|
-
<template v-else>{{ title }}</template>
|
|
27
|
-
</view>
|
|
28
|
-
<pi-calendar-panel
|
|
29
|
-
v-model="calendarValue"
|
|
30
|
-
:type="getCalendarPanel.type"
|
|
31
|
-
:min-year="getCalendarPanel.minYear"
|
|
32
|
-
:max-year="getCalendarPanel.maxYear"
|
|
33
|
-
:min-date="getCalendarPanel.minDate"
|
|
34
|
-
:max-date="getCalendarPanel.maxDate"
|
|
35
|
-
:show-back-today="getCalendarPanel.showBackToday"
|
|
36
|
-
:today-active-border-color="getCalendarPanel.todayActiveBorderColor"
|
|
37
|
-
:active-color="getCalendarPanel.activeColor"
|
|
38
|
-
:active-bg="getCalendarPanel.activeBg"
|
|
39
|
-
:active-border-radius="getCalendarPanel.activeBorderRadius"
|
|
40
|
-
:range-color="getCalendarPanel.rangeColor"
|
|
41
|
-
:range-bg="getCalendarPanel.rangeBg"
|
|
42
|
-
:start-text="getCalendarPanel.startText"
|
|
43
|
-
:end-text="getCalendarPanel.endText"
|
|
44
|
-
:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
import
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
*
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<pi-popup
|
|
3
|
+
ref="popup"
|
|
4
|
+
:value="val"
|
|
5
|
+
:custom-class="getPopup.customClass"
|
|
6
|
+
:custom-style="getPopup.customStyle"
|
|
7
|
+
:position="getPopup.position"
|
|
8
|
+
:border-radius="getPopup.borderRadius"
|
|
9
|
+
:show-close-icon="showTitle && getPopup.showCloseIcon"
|
|
10
|
+
:close-icon="getPopup.closeIcon"
|
|
11
|
+
:safe-area-inset-bottom="getPopup.safeAreaInsetBottom"
|
|
12
|
+
:mask="getPopup.mask"
|
|
13
|
+
:hide-tab-bar="getPopup.hideTabBar"
|
|
14
|
+
:append-to-body="getPopup.appendToBody"
|
|
15
|
+
:z-index="getPopup.zIndex"
|
|
16
|
+
:background="getPopup.background"
|
|
17
|
+
@close="handlePopupClose"
|
|
18
|
+
@closed="$emit('closed', $event)"
|
|
19
|
+
@show="$emit('show', $event)"
|
|
20
|
+
@showed="$emit('showed', $event)"
|
|
21
|
+
>
|
|
22
|
+
<view class="pi-calendar" :style="[customStyle]" :class="[customClass]">
|
|
23
|
+
<!-- 标题栏 -->
|
|
24
|
+
<view class="pi-justify-center pi-fz-32 pi-fw-500" :style="[{ padding: getTitlePadding }]">
|
|
25
|
+
<slot v-if="$slots.title" name="title" />
|
|
26
|
+
<template v-else>{{ title }}</template>
|
|
27
|
+
</view>
|
|
28
|
+
<pi-calendar-panel
|
|
29
|
+
v-model="calendarValue"
|
|
30
|
+
:type="getCalendarPanel.type"
|
|
31
|
+
:min-year="getCalendarPanel.minYear"
|
|
32
|
+
:max-year="getCalendarPanel.maxYear"
|
|
33
|
+
:min-date="getCalendarPanel.minDate"
|
|
34
|
+
:max-date="getCalendarPanel.maxDate"
|
|
35
|
+
:show-back-today="getCalendarPanel.showBackToday"
|
|
36
|
+
:today-active-border-color="getCalendarPanel.todayActiveBorderColor"
|
|
37
|
+
:active-color="getCalendarPanel.activeColor"
|
|
38
|
+
:active-bg="getCalendarPanel.activeBg"
|
|
39
|
+
:active-border-radius="getCalendarPanel.activeBorderRadius"
|
|
40
|
+
:range-color="getCalendarPanel.rangeColor"
|
|
41
|
+
:range-bg="getCalendarPanel.rangeBg"
|
|
42
|
+
:start-text="getCalendarPanel.startText"
|
|
43
|
+
:end-text="getCalendarPanel.endText"
|
|
44
|
+
:marks="getCalendarPanel.marks"
|
|
45
|
+
:date-format="getCalendarPanel.dateFormat"
|
|
46
|
+
@date-change="$emit('date-change', $event)"
|
|
47
|
+
/>
|
|
48
|
+
<!-- footer -->
|
|
49
|
+
<view class="pi-w-100P pi-align-center pi-pd-24 pi-solid-top-1">
|
|
50
|
+
<view class="pi-flex-sub pi-fz-30 pi-fw-500">{{ getDisplayValue }}</view>
|
|
51
|
+
<pi-button type="primary" size="medium" @click="handleConfirm">确定</pi-button>
|
|
52
|
+
</view>
|
|
53
|
+
</view>
|
|
54
|
+
</pi-popup>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script>
|
|
58
|
+
import ValueSync from '../../mixin/value-sync'
|
|
59
|
+
import { getConfig } from '../../config'
|
|
60
|
+
|
|
61
|
+
const TAG = 'PiCalendar'
|
|
62
|
+
const { calendar } = getConfig()
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: 'PiCalendar',
|
|
66
|
+
// 混入v-model
|
|
67
|
+
mixins: [ValueSync],
|
|
68
|
+
props: {
|
|
69
|
+
// 初始值
|
|
70
|
+
value: {
|
|
71
|
+
required: false
|
|
72
|
+
},
|
|
73
|
+
// 自定义样式,对象形式
|
|
74
|
+
customStyle: {
|
|
75
|
+
type: Object,
|
|
76
|
+
// {}
|
|
77
|
+
default() {
|
|
78
|
+
return calendar.customStyle
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
// 自定义样式类,字符串形式
|
|
82
|
+
customClass: {
|
|
83
|
+
type: String,
|
|
84
|
+
// ''
|
|
85
|
+
default() {
|
|
86
|
+
return calendar.customClass
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
// 是否显示title
|
|
90
|
+
showTitle: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
// true
|
|
93
|
+
default: calendar.showTitle
|
|
94
|
+
},
|
|
95
|
+
// 标题
|
|
96
|
+
title: {
|
|
97
|
+
type: String,
|
|
98
|
+
// '日期选择'
|
|
99
|
+
default: calendar.title
|
|
100
|
+
},
|
|
101
|
+
// 标题 padding
|
|
102
|
+
titlePadding: {
|
|
103
|
+
type: [String, Number],
|
|
104
|
+
// 24
|
|
105
|
+
default: calendar.titlePadding
|
|
106
|
+
},
|
|
107
|
+
// 日历面板参数设置
|
|
108
|
+
calendarPanel: {
|
|
109
|
+
type: Object,
|
|
110
|
+
default() {
|
|
111
|
+
// 参照calendarPanel
|
|
112
|
+
return calendar.calendarPanel
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
// 弹窗参数设置
|
|
116
|
+
popup: {
|
|
117
|
+
type: Object,
|
|
118
|
+
default() {
|
|
119
|
+
// 参照popup
|
|
120
|
+
return calendar.popup
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
data() {
|
|
125
|
+
const mergeCalendarPanel = this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
|
|
126
|
+
return {
|
|
127
|
+
calendarValue: mergeCalendarPanel.value
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
computed: {
|
|
131
|
+
getCalendarPanel() {
|
|
132
|
+
return this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
|
|
133
|
+
},
|
|
134
|
+
getPopup() {
|
|
135
|
+
return this.$pi.lang.mergeDeep(calendar.popup, this.popup)
|
|
136
|
+
},
|
|
137
|
+
getTitlePadding() {
|
|
138
|
+
return this.$pi.common.addUnit(this.titlePadding)
|
|
139
|
+
},
|
|
140
|
+
getDisplayValue() {
|
|
141
|
+
return [].concat(this.calendarValue).join(' - ')
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
watch: {
|
|
145
|
+
'getCalendarPanel.value'(val) {
|
|
146
|
+
this.calendarValue = val
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
methods: {
|
|
150
|
+
handlePopupClose() {
|
|
151
|
+
this.val = false
|
|
152
|
+
// 关闭
|
|
153
|
+
this.$emit('close')
|
|
154
|
+
this.handleEmitChange()
|
|
155
|
+
},
|
|
156
|
+
/**
|
|
157
|
+
* @vuese
|
|
158
|
+
* 确认选择
|
|
159
|
+
*/
|
|
160
|
+
handleConfirm() {
|
|
161
|
+
this.$emit('confirm', this.calendarValue)
|
|
162
|
+
this.handlePopupClose()
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
</script>
|
|
167
|
+
|
|
168
|
+
<style lang="scss" scoped>
|
|
169
|
+
.pi-calendar {
|
|
170
|
+
max-width: 960rpx;
|
|
171
|
+
margin: 0 auto;
|
|
172
|
+
}
|
|
173
|
+
.date-item {
|
|
174
|
+
position: relative;
|
|
175
|
+
z-index: 2;
|
|
176
|
+
width: calc(100% / 7);
|
|
177
|
+
overflow: hidden;
|
|
178
|
+
}
|
|
179
|
+
.back-today {
|
|
180
|
+
padding: 12rpx 24rpx;
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
font-size: 20rpx;
|
|
183
|
+
color: #ffffff;
|
|
184
|
+
background: $pi-primary-color;
|
|
185
|
+
border-radius: 50rpx 0 0 50rpx;
|
|
186
|
+
}
|
|
187
|
+
</style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: zhangzhenfei
|
|
3
3
|
* @Date: 2022-06-28 16:53:54
|
|
4
|
-
* @LastEditTime: 2023-
|
|
4
|
+
* @LastEditTime: 2023-05-12 16:02:29
|
|
5
5
|
* @LastEditors: zhangzhenfei
|
|
6
6
|
* @Description: 日历日期数据
|
|
7
|
-
* @FilePath: /
|
|
7
|
+
* @FilePath: /piui-awesome/src/piui/components/pi-calendar-panel/components/calendar-days/index.vue
|
|
8
8
|
-->
|
|
9
9
|
|
|
10
10
|
<template>
|
|
@@ -251,51 +251,51 @@ export default {
|
|
|
251
251
|
...day,
|
|
252
252
|
...this.$pi.date.parseDate(new Date(this.year, this.month - 1, i - firstDayCount))
|
|
253
253
|
}
|
|
254
|
+
}
|
|
254
255
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
const isDisabled = this.isDisabled(day)
|
|
257
|
+
// 禁用
|
|
258
|
+
if (isDisabled) {
|
|
259
|
+
day.disabled = true
|
|
260
|
+
}
|
|
261
|
+
// 单选选中样式
|
|
262
|
+
if (this.type === 'date' && this.isSameDay(this.calendarValue, day)) {
|
|
263
|
+
const activeStyle = {
|
|
264
|
+
color: this.activeColor,
|
|
265
|
+
borderRadius: this.getActiveBorderRadius
|
|
259
266
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
if (this.activeBg) activeStyle.background = this.activeBg
|
|
268
|
+
day.activeStyle = activeStyle
|
|
269
|
+
}
|
|
270
|
+
// 范围选中样式
|
|
271
|
+
if (this.type === 'range') {
|
|
272
|
+
const start = this.calendarValue[0]
|
|
273
|
+
const end = this.calendarValue[1]
|
|
274
|
+
const isBegin = this.isSameDay(start, day)
|
|
275
|
+
const isEnd = this.isSameDay(end, day)
|
|
276
|
+
const inRange =
|
|
277
|
+
start && end && day.timestamp > start.timestamp && day.timestamp < end.timestamp
|
|
278
|
+
const rangeStyle = {}
|
|
279
|
+
// 处理中间范围的样式
|
|
280
|
+
if (inRange) {
|
|
281
|
+
rangeStyle.color = this.rangeColor
|
|
282
|
+
rangeStyle.background = this.rangeBg
|
|
268
283
|
}
|
|
269
|
-
//
|
|
270
|
-
if (
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
if (isBegin || isEnd) {
|
|
285
|
-
rangeStyle.color = this.activeColor
|
|
286
|
-
rangeStyle.borderRadius = isBegin
|
|
287
|
-
? `${this.getActiveBorderRadius} 0 0 0`
|
|
288
|
-
: `0 0 ${this.getActiveBorderRadius} 0`
|
|
289
|
-
if (this.activeBg) rangeStyle.background = this.activeBg
|
|
290
|
-
}
|
|
291
|
-
day.range = true
|
|
292
|
-
day.rangeStyle = rangeStyle
|
|
293
|
-
// type 为 range 开始和结束的提示
|
|
294
|
-
if (isBegin) day.tip = this.startText
|
|
295
|
-
if (isEnd) day.tip = this.endText
|
|
296
|
-
if (isBegin && isEnd) {
|
|
297
|
-
day.tip = this.startText + '-' + this.endText
|
|
298
|
-
}
|
|
284
|
+
// 处理两端
|
|
285
|
+
if (isBegin || isEnd) {
|
|
286
|
+
rangeStyle.color = this.activeColor
|
|
287
|
+
rangeStyle.borderRadius = isBegin
|
|
288
|
+
? `${this.getActiveBorderRadius} 0 0 0`
|
|
289
|
+
: `0 0 ${this.getActiveBorderRadius} 0`
|
|
290
|
+
if (this.activeBg) rangeStyle.background = this.activeBg
|
|
291
|
+
}
|
|
292
|
+
day.range = true
|
|
293
|
+
day.rangeStyle = rangeStyle
|
|
294
|
+
// type 为 range 开始和结束的提示
|
|
295
|
+
if (isBegin) day.tip = this.startText
|
|
296
|
+
if (isEnd) day.tip = this.endText
|
|
297
|
+
if (isBegin && isEnd) {
|
|
298
|
+
day.tip = this.startText + '-' + this.endText
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
// 是否打点
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: zhouxianpan
|
|
3
3
|
* @Date: 2021-09-06 10:07:33
|
|
4
|
-
* @LastEditTime: 2023-
|
|
4
|
+
* @LastEditTime: 2023-04-20 17:11:04
|
|
5
5
|
* @LastEditors: zhangzhenfei
|
|
6
6
|
* @Description:
|
|
7
7
|
* @FilePath: \piui-awesome\src\piui\components\pi-circle-progress\index.vue
|
|
@@ -142,12 +142,16 @@ export default {
|
|
|
142
142
|
*/
|
|
143
143
|
getType() {
|
|
144
144
|
const { type, inactiveColor, activeColor, bgColor } = this
|
|
145
|
-
const typeData = this.$pi.lang.mergeDeep(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
})
|
|
150
|
-
return
|
|
145
|
+
// const typeData = this.$pi.lang.mergeDeep(this.typeList[type], {
|
|
146
|
+
// inactiveColor,
|
|
147
|
+
// activeColor,
|
|
148
|
+
// bgColor
|
|
149
|
+
// })
|
|
150
|
+
return {
|
|
151
|
+
inactiveColor: inactiveColor || this.typeList[type]['inactiveColor'],
|
|
152
|
+
activeColor: activeColor || this.typeList[type]['activeColor'],
|
|
153
|
+
bgColor: bgColor || this.typeList[type]['bgColor']
|
|
154
|
+
}
|
|
151
155
|
}
|
|
152
156
|
// 有type主题时,优先起作用(弃用)
|
|
153
157
|
// circleColor() {
|