sadais-piui 1.2.7-beta65 → 1.2.7-beta67
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-calendar-panel/components/calendar-days/index.vue +2 -2
- package/components/pi-circle-progress/index.vue +42 -15
- package/components/pi-dropdown/index.vue +5 -1
- package/components/pi-table/index.vue +12 -1
- package/config/circleProgress.js +12 -4
- package/config/table.js +1 -0
- package/package.json +1 -1
- package/scss/common.scss +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: zhangzhenfei
|
|
3
3
|
* @Date: 2022-06-28 16:53:54
|
|
4
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditTime: 2023-02-02 09:58:06
|
|
5
5
|
* @LastEditors: zhangzhenfei
|
|
6
6
|
* @Description: 日历日期数据
|
|
7
7
|
* @FilePath: /dt-weitibao-console/Users/feilin/workspace/piui/piui-awesome/src/piui/components/pi-calendar-panel/components/calendar-days/index.vue
|
|
@@ -222,7 +222,6 @@ export default {
|
|
|
222
222
|
const dayCount = 7 * 6 // 固定显示6周
|
|
223
223
|
const monthDays = new Date(this.year, this.month, 0).getDate()
|
|
224
224
|
const firstDayCount = this.firstDay.length
|
|
225
|
-
console.log(this.firstDay)
|
|
226
225
|
const nextMonthFirstDay = this.getNextMonthFirstDay
|
|
227
226
|
for (let i = 1; i <= dayCount; i++) {
|
|
228
227
|
let day = {
|
|
@@ -252,6 +251,7 @@ export default {
|
|
|
252
251
|
...day,
|
|
253
252
|
...this.$pi.date.parseDate(new Date(this.year, this.month - 1, i - firstDayCount))
|
|
254
253
|
}
|
|
254
|
+
|
|
255
255
|
const isDisabled = this.isDisabled(day)
|
|
256
256
|
// 禁用
|
|
257
257
|
if (isDisabled) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: zhouxianpan
|
|
3
3
|
* @Date: 2021-09-06 10:07:33
|
|
4
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditTime: 2023-03-21 12:43:29
|
|
5
5
|
* @LastEditors: zhangzhenfei
|
|
6
6
|
* @Description:
|
|
7
7
|
* @FilePath: \piui-awesome\src\piui\components\pi-circle-progress\index.vue
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
<view
|
|
11
11
|
class="circle-progress"
|
|
12
12
|
:style="{
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
15
|
-
backgroundColor: bgColor
|
|
13
|
+
width: parentWidthPx + 'px',
|
|
14
|
+
height: parentWidthPx + 'px',
|
|
15
|
+
backgroundColor: getType.bgColor,
|
|
16
|
+
borderRadius: '50%'
|
|
16
17
|
}"
|
|
17
18
|
>
|
|
18
19
|
<canvas
|
|
@@ -84,7 +85,17 @@ export default {
|
|
|
84
85
|
// 主题类型
|
|
85
86
|
type: {
|
|
86
87
|
type: String,
|
|
87
|
-
default: circleProgress.type
|
|
88
|
+
default: circleProgress.type,
|
|
89
|
+
validator: function(value) {
|
|
90
|
+
return ['success', 'error', 'info', 'primary', 'warning'].includes(value)
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
// 主题列表
|
|
94
|
+
typeList: {
|
|
95
|
+
type: Object,
|
|
96
|
+
default() {
|
|
97
|
+
return circleProgress.typeList
|
|
98
|
+
}
|
|
88
99
|
},
|
|
89
100
|
|
|
90
101
|
// 字体大小
|
|
@@ -106,7 +117,7 @@ export default {
|
|
|
106
117
|
},
|
|
107
118
|
data() {
|
|
108
119
|
return {
|
|
109
|
-
|
|
120
|
+
// #ifdef MP-WEIXIN
|
|
110
121
|
elBgId: 'pCircleProgressBgId', // 微信小程序中不能使用this.$pi形式动态生成id值,否则会报错
|
|
111
122
|
elId: 'pCircleProgressElId',
|
|
112
123
|
// #endif
|
|
@@ -117,6 +128,7 @@ export default {
|
|
|
117
128
|
progressContext: null,
|
|
118
129
|
// 开始的角度
|
|
119
130
|
widthPx: uni.upx2px(this.width), // 转成px后的整个组件的背景宽度
|
|
131
|
+
parentWidthPx: uni.upx2px(this.width - this.borderWidth), // 转成px后容器的宽度
|
|
120
132
|
borderWidthPx: uni.upx2px(this.borderWidth), // 转成px后的圆环的宽度
|
|
121
133
|
startAngle: -Math.PI / 2, // canvas画圆的起始角度,默认为3点钟方向,定位到12点钟方向
|
|
122
134
|
newPercent: 0, // 当动态修改进度值的时候,保存进度值的变化前后值,用于比较用
|
|
@@ -124,12 +136,25 @@ export default {
|
|
|
124
136
|
}
|
|
125
137
|
},
|
|
126
138
|
computed: {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
139
|
+
/**
|
|
140
|
+
* 默认使用type配套样式success
|
|
141
|
+
* 如果有传入 进度条底部颜色、进度条颜色、背景颜色时就使用它们的
|
|
142
|
+
*/
|
|
143
|
+
getType() {
|
|
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
|
|
132
151
|
}
|
|
152
|
+
// 有type主题时,优先起作用(弃用)
|
|
153
|
+
// circleColor() {
|
|
154
|
+
// if (['success', 'error', 'info', 'primary', 'warning'].indexOf(this.type) >= 0)
|
|
155
|
+
// return this.$u.color[this.type]
|
|
156
|
+
// else return this.activeColor
|
|
157
|
+
// }
|
|
133
158
|
},
|
|
134
159
|
watch: {
|
|
135
160
|
// 深度监听进度
|
|
@@ -160,10 +185,11 @@ export default {
|
|
|
160
185
|
},
|
|
161
186
|
methods: {
|
|
162
187
|
drawProgressBg() {
|
|
163
|
-
console.log(this)
|
|
188
|
+
// console.log(this)
|
|
164
189
|
let ctx = uni.createCanvasContext(this.elBgId, this)
|
|
165
190
|
ctx.setLineWidth(this.borderWidthPx) // 设置圆环宽度
|
|
166
|
-
ctx.setStrokeStyle(this.inactiveColor) // 线条颜色
|
|
191
|
+
// ctx.setStrokeStyle(this.inactiveColor) // 线条颜色
|
|
192
|
+
ctx.setStrokeStyle(this.getType.inactiveColor) // 线条颜色
|
|
167
193
|
ctx.beginPath() // 开描绘路径
|
|
168
194
|
// 设置一个原点(110,110),半径为100的圆的路径到当前路径
|
|
169
195
|
let radius = this.widthPx / 2
|
|
@@ -205,7 +231,8 @@ export default {
|
|
|
205
231
|
ctx.stroke()
|
|
206
232
|
}
|
|
207
233
|
} else {
|
|
208
|
-
ctx.setStrokeStyle(this.circleColor)
|
|
234
|
+
// ctx.setStrokeStyle(this.circleColor)
|
|
235
|
+
ctx.setStrokeStyle(this.getType.activeColor)
|
|
209
236
|
// 结束角的计算依据为:将2π分为100份,乘以当前的进度值,得出终止点的弧度值,加起始角,为整个圆从默认的
|
|
210
237
|
// 3点钟方向开始画图,转为更好理解的12点钟方向开始作图,这需要起始角和终止角同时加上this.startAngle值
|
|
211
238
|
let endAngle = ((2 * Math.PI) / 100) * progress + this.startAngle
|
|
@@ -240,7 +267,7 @@ export default {
|
|
|
240
267
|
this.drawCircleByProgress(progress)
|
|
241
268
|
}, time)
|
|
242
269
|
},
|
|
243
|
-
|
|
270
|
+
createColorData() {
|
|
244
271
|
let canvas
|
|
245
272
|
let ctx
|
|
246
273
|
// #ifndef MP-WEIXIN
|
|
@@ -205,7 +205,8 @@ export default {
|
|
|
205
205
|
|
|
206
206
|
show: false, // 是否显示节点
|
|
207
207
|
showed: false, // 是否显示动画执行完毕
|
|
208
|
-
closed: true // 是否已关闭(用来防止val为false的情况,动画无法执行)
|
|
208
|
+
closed: true, // 是否已关闭(用来防止val为false的情况,动画无法执行)
|
|
209
|
+
submiting: false // 正在更新值(防止快速切换提交)
|
|
209
210
|
}
|
|
210
211
|
},
|
|
211
212
|
computed: {
|
|
@@ -273,6 +274,7 @@ export default {
|
|
|
273
274
|
// 显示当前Tab
|
|
274
275
|
async handleClickTab(item) {
|
|
275
276
|
if (item.disabled) return
|
|
277
|
+
if (this.submiting) return console.log(TAG, '你点得太快了')
|
|
276
278
|
if (this.show && item.id === this.activeItem.id) {
|
|
277
279
|
this.closeMask()
|
|
278
280
|
return
|
|
@@ -316,11 +318,13 @@ export default {
|
|
|
316
318
|
})
|
|
317
319
|
setTimeout(() => {
|
|
318
320
|
this.closed = true
|
|
321
|
+
this.submiting = false
|
|
319
322
|
this.getMask.hideTabBar && uni.showTabBar()
|
|
320
323
|
}, this.getDuration.js)
|
|
321
324
|
},
|
|
322
325
|
// 关闭弹窗并返回结果
|
|
323
326
|
submit() {
|
|
327
|
+
this.submiting = true
|
|
324
328
|
this.closeMask()
|
|
325
329
|
setTimeout(() => {
|
|
326
330
|
// 延迟执行,防止父子组件的值同步不上
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="table-wrap">
|
|
2
|
+
<view class="table-wrap" :class="{ bounce }">
|
|
3
3
|
<view class="table">
|
|
4
4
|
<view class="row">
|
|
5
5
|
<view
|
|
@@ -116,6 +116,13 @@ const { table: tableConfig } = getConfig();
|
|
|
116
116
|
export default {
|
|
117
117
|
name: "PiTable",
|
|
118
118
|
props: {
|
|
119
|
+
// 是否开启滚动反弹效果
|
|
120
|
+
bounce: {
|
|
121
|
+
// `Boolean`
|
|
122
|
+
type: Boolean,
|
|
123
|
+
// `false`
|
|
124
|
+
default: tableConfig.bounce,
|
|
125
|
+
},
|
|
119
126
|
// 列配置项
|
|
120
127
|
columns: {
|
|
121
128
|
type: Array,
|
|
@@ -232,6 +239,10 @@ export default {
|
|
|
232
239
|
position: relative;
|
|
233
240
|
width: 100%;
|
|
234
241
|
overflow: auto hidden;
|
|
242
|
+
overscroll-behavior: none;
|
|
243
|
+
&.bounce {
|
|
244
|
+
overscroll-behavior: auto;
|
|
245
|
+
}
|
|
235
246
|
}
|
|
236
247
|
.table {
|
|
237
248
|
display: table;
|
package/config/circleProgress.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
percent: 50, // 环形进度条,限制0-100之间,数字形式,默认值:50
|
|
3
|
-
bgColor: '
|
|
4
|
-
inactiveColor: '
|
|
5
|
-
activeColor: '
|
|
3
|
+
bgColor: '', // 环形进度区域背景色,字符串形式,默认值:'#ffffff'
|
|
4
|
+
inactiveColor: '', // 环形进度条底色,字符串形式,默认值:'#ececec'
|
|
5
|
+
activeColor: '', // 环形进度条激活的颜色,字符串形式,默认值:'#19be6b'
|
|
6
6
|
borderWidth: 14, // 环形进度条的线条宽度,字符串/数字形式,默认值:14
|
|
7
7
|
width: 200, // 环形进度条整个圆的宽度,字符串/数字形式,默认值:200
|
|
8
8
|
duration: 1500, // 整个圆环执行至进度条所需的时间,单位ms,字符串/数字形式,默认值:1500
|
|
9
|
-
type: '', // 环形进度条的主题
|
|
9
|
+
type: 'success', // 环形进度条的主题 'success', 'error', 'info', 'primary', 'warning'
|
|
10
|
+
// 主题列表
|
|
11
|
+
typeList: {
|
|
12
|
+
success: { bgColor: '#ffffff', activeColor: '#67c23a', inactiveColor: '#ececec' },
|
|
13
|
+
error: { bgColor: '#fef0f0', activeColor: '#f56c6c', inactiveColor: '#fbc4c4' },
|
|
14
|
+
info: { bgColor: '#f4f4f5', activeColor: '#909399', inactiveColor: '#ececec' },
|
|
15
|
+
primary: { bgColor: '#ecf5ff', activeColor: '#409eff', inactiveColor: '#b3d8ff' },
|
|
16
|
+
warning: { bgColor: '#fdf6ec', activeColor: '#e6a23c', inactiveColor: '#f5dab1' }
|
|
17
|
+
},
|
|
10
18
|
fontSize: '16px', // 环形进度条中间显示文字的大小,字符串形式,默认值:'16px'
|
|
11
19
|
text: '' // 环形进度条中间显示的文字,字符串形式,默认值:''
|
|
12
20
|
}
|
package/config/table.js
CHANGED
package/package.json
CHANGED
package/scss/common.scss
CHANGED