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
- :date-format="getCalendarPanel.dateFormat"
45
- @date-change="$emit('date-change', $event)"
46
- />
47
- <!-- footer -->
48
- <view class="pi-w-100P pi-align-center pi-pd-24 pi-solid-top-1">
49
- <view class="pi-flex-sub pi-fz-30 pi-fw-500">{{ getDisplayValue }}</view>
50
- <pi-button type="primary" size="medium" @click="handleConfirm">确定</pi-button>
51
- </view>
52
- </view>
53
- </pi-popup>
54
- </template>
55
-
56
- <script>
57
- import ValueSync from '../../mixin/value-sync'
58
- import { getConfig } from '../../config'
59
-
60
- const TAG = 'PiCalendar'
61
- const { calendar } = getConfig()
62
-
63
- export default {
64
- name: 'PiCalendar',
65
- // 混入v-model
66
- mixins: [ValueSync],
67
- props: {
68
- // 初始值
69
- value: {
70
- required: false
71
- },
72
- // 自定义样式,对象形式
73
- customStyle: {
74
- type: Object,
75
- // {}
76
- default() {
77
- return calendar.customStyle
78
- }
79
- },
80
- // 自定义样式类,字符串形式
81
- customClass: {
82
- type: String,
83
- // ''
84
- default() {
85
- return calendar.customClass
86
- }
87
- },
88
- // 是否显示title
89
- showTitle: {
90
- type: Boolean,
91
- // true
92
- default: calendar.showTitle
93
- },
94
- // 标题
95
- title: {
96
- type: String,
97
- // '日期选择'
98
- default: calendar.title
99
- },
100
- // 标题 padding
101
- titlePadding: {
102
- type: [String, Number],
103
- // 24
104
- default: calendar.titlePadding
105
- },
106
- // 日历面板参数设置
107
- calendarPanel: {
108
- type: Object,
109
- default() {
110
- // 参照calendarPanel
111
- return calendar.calendarPanel
112
- }
113
- },
114
- // 弹窗参数设置
115
- popup: {
116
- type: Object,
117
- default() {
118
- // 参照popup
119
- return calendar.popup
120
- }
121
- }
122
- },
123
- data() {
124
- const mergeCalendarPanel = this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
125
- return {
126
- calendarValue: mergeCalendarPanel.value
127
- }
128
- },
129
- computed: {
130
- getCalendarPanel() {
131
- return this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
132
- },
133
- getPopup() {
134
- return this.$pi.lang.mergeDeep(calendar.popup, this.popup)
135
- },
136
- getTitlePadding() {
137
- return this.$pi.common.addUnit(this.titlePadding)
138
- },
139
- getDisplayValue() {
140
- return [].concat(this.calendarValue).join(' - ')
141
- }
142
- },
143
- watch: {
144
- 'getCalendarPanel.value'(val) {
145
- this.calendarValue = val
146
- }
147
- },
148
- methods: {
149
- handlePopupClose() {
150
- this.val = false
151
- // 关闭
152
- this.$emit('close')
153
- this.handleEmitChange()
154
- },
155
- /**
156
- * @vuese
157
- * 确认选择
158
- */
159
- handleConfirm() {
160
- this.$emit('confirm', this.calendarValue)
161
- this.handlePopupClose()
162
- }
163
- }
164
- }
165
- </script>
166
-
167
- <style lang="scss" scoped>
168
- .pi-calendar {
169
- max-width: 960rpx;
170
- margin: 0 auto;
171
- }
172
- .date-item {
173
- position: relative;
174
- z-index: 2;
175
- width: calc(100% / 7);
176
- overflow: hidden;
177
- }
178
- .back-today {
179
- padding: 12rpx 24rpx;
180
- overflow: hidden;
181
- font-size: 20rpx;
182
- color: #ffffff;
183
- background: $pi-primary-color;
184
- border-radius: 50rpx 0 0 50rpx;
185
- }
186
- </style>
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-02-02 09:58:06
4
+ * @LastEditTime: 2023-05-12 16:02:29
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 日历日期数据
7
- * @FilePath: /dt-weitibao-console/Users/feilin/workspace/piui/piui-awesome/src/piui/components/pi-calendar-panel/components/calendar-days/index.vue
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
- const isDisabled = this.isDisabled(day)
256
- // 禁用
257
- if (isDisabled) {
258
- day.disabled = true
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
- if (this.type === 'date' && this.isSameDay(this.calendarValue, day)) {
262
- const activeStyle = {
263
- color: this.activeColor,
264
- borderRadius: this.getActiveBorderRadius
265
- }
266
- if (this.activeBg) activeStyle.background = this.activeBg
267
- day.activeStyle = activeStyle
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 (this.type === 'range') {
271
- const start = this.calendarValue[0]
272
- const end = this.calendarValue[1]
273
- const isBegin = this.isSameDay(start, day)
274
- const isEnd = this.isSameDay(end, day)
275
- const inRange =
276
- start && end && day.timestamp > start.timestamp && day.timestamp < end.timestamp
277
- const rangeStyle = {}
278
- // 处理中间范围的样式
279
- if (inRange) {
280
- rangeStyle.color = this.rangeColor
281
- rangeStyle.background = this.rangeBg
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-03-21 12:43:29
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({}, this.typeList[type], {
146
- inactiveColor,
147
- activeColor,
148
- bgColor
149
- })
150
- return typeData
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() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta67",
3
+ "version": "1.2.7-beta69",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {