sadais-piui 1.2.7-beta4 → 1.2.7-beta7

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.
@@ -13,6 +13,7 @@
13
13
  </template>
14
14
 
15
15
  <script>
16
+ import Emitter from '../../mixin/emitter'
16
17
  import ValueSync from '../../mixin/value-sync'
17
18
  import { parentInit } from '../../mixin/props-sync'
18
19
  import { getConfig } from '../../config'
@@ -24,6 +25,7 @@ export default {
24
25
  name: 'PiCheckboxGroup',
25
26
  // 混入自定义样式customStyle和customClass
26
27
  mixins: [
28
+ Emitter,
27
29
  ValueSync,
28
30
  parentInit([
29
31
  'value',
@@ -119,6 +119,13 @@ export default {
119
119
  // ''
120
120
  default: datePicker.defaultValue
121
121
  },
122
+ // 单位数组,默认值:['年', '月', '日', '时', '分', '秒']
123
+ units: {
124
+ type: Array,
125
+ default() {
126
+ return datePicker.units
127
+ }
128
+ },
122
129
  // 返回的日期格式
123
130
  format: {
124
131
  type: String,
@@ -227,33 +234,40 @@ export default {
227
234
  const itemHeight = uni.upx2px(this.itemHeight)
228
235
  return `height: ${itemHeight}px;line-height: ${itemHeight}px;`
229
236
  },
237
+ getUnits() {
238
+ return this.$pi.mergeDeep(datePicker.units, this.units, {
239
+ arrayMerge: (target, source, options) => {
240
+ return target.map((t, index) => source[index] || t)
241
+ }
242
+ })
243
+ },
230
244
  columns() {
231
245
  const monthDays = new Date(this.date.year, this.date.month, 0).getDate()
232
246
  let columns = [
233
247
  {
234
248
  field: 'year',
235
- unit: '年',
249
+ unit: this.getUnits[0],
236
250
  key: 'year',
237
251
  setMethod: 'setYear',
238
252
  items: this.$pi.common.generateArray(this.startYear, this.endYear)
239
253
  },
240
254
  {
241
255
  field: 'month',
242
- unit: '月',
256
+ unit: this.getUnits[1],
243
257
  key: 'month',
244
258
  setMethod: 'setMonth',
245
259
  items: this.$pi.common.generateArray(1, 12)
246
260
  },
247
261
  {
248
262
  field: 'day',
249
- unit: '日',
263
+ unit: this.getUnits[2],
250
264
  key: 'date',
251
265
  setMethod: 'setDate',
252
266
  items: this.$pi.common.generateArray(1, monthDays)
253
267
  },
254
268
  {
255
269
  field: 'hour',
256
- unit: '时',
270
+ unit: this.getUnits[3],
257
271
  key: 'hour',
258
272
  setMethod: 'setHours',
259
273
  type: 'time',
@@ -261,7 +275,7 @@ export default {
261
275
  },
262
276
  {
263
277
  field: 'minute',
264
- unit: '分',
278
+ unit: this.getUnits[4],
265
279
  key: 'minute',
266
280
  setMethod: 'setMinutes',
267
281
  type: 'time',
@@ -269,7 +283,7 @@ export default {
269
283
  },
270
284
  {
271
285
  field: 'second',
272
- unit: '秒',
286
+ unit: this.getUnits[5],
273
287
  key: 'second',
274
288
  setMethod: 'setSeconds',
275
289
  type: 'time',
@@ -15,6 +15,7 @@
15
15
  </template>
16
16
 
17
17
  <script>
18
+ import Emitter from '../../mixin/emitter'
18
19
  import ValueSync from '../../mixin/value-sync'
19
20
  import { parentInit } from '../../mixin/props-sync'
20
21
  import { getConfig } from '../../config'
@@ -26,6 +27,7 @@ export default {
26
27
  name: 'PiRadioGroup',
27
28
  // 混入自定义样式customStyle和customClass
28
29
  mixins: [
30
+ Emitter,
29
31
  ValueSync,
30
32
  // parentInit 混入子组件要继承的属性
31
33
  parentInit([
@@ -283,7 +283,8 @@ export default {
283
283
  width: this.getSliderBarWidth,
284
284
  height: this.getSliderBarHeight,
285
285
  borderRadius: this.getSliderBarRadius,
286
- transitionDuration: duration.css
286
+ transitionDuration: duration.css,
287
+ ...this.sliderBarStyle
287
288
  }
288
289
  let sliderScrollLeft = this.activeRect.left
289
290
  if (style.width !== 'auto') {
@@ -12,6 +12,7 @@ export default {
12
12
  field: 'day', // 选择器的粒度 year、month、day、hour、minute、second
13
13
  dateType: 'datetime', // 日期类型,date、datetime、time(默认值:datetime)
14
14
  defaultValue: '', // 日期默认值
15
+ units: ['年', '月', '日', '时', '分', '秒'], // 单位数组,默认值:['年', '月', '日', '时', '分', '秒']
15
16
  format: '', // 返回的日期格式,为空的时候,返回的是日期对象
16
17
  itemHeight: 110, // 行高(默认:'110rpx')
17
18
  itemStyle: {}, // 行样式(默认:{})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7beta4",
3
+ "version": "1.2.7beta7",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {