sadais-piui 1.2.7-beta52 → 1.2.7-beta54

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,7 +1,7 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2022-06-28 16:53:54
4
- * @LastEditTime: 2022-08-31 16:19:31
4
+ * @LastEditTime: 2022-11-24 10:35:53
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
@@ -198,7 +198,7 @@ export default {
198
198
  const firstDays = []
199
199
  const preMonthLastDay = this.getPreMonthLastDay
200
200
  const lastDay = preMonthLastDay.getDate()
201
- const firstDay = new Date(`${this.year}-${this.month}-01 00:00:00`).getDay()
201
+ const firstDay = new Date(this.year, this.month - 1, '1').getDay()
202
202
  for (let i = 0; i < firstDay; i++) {
203
203
  const day = preMonthLastDay.setDate(lastDay - firstDay + i + 1)
204
204
  firstDays.push(new Date(day))
@@ -222,6 +222,7 @@ 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)
225
226
  const nextMonthFirstDay = this.getNextMonthFirstDay
226
227
  for (let i = 1; i <= dayCount; i++) {
227
228
  let day = {
@@ -247,10 +248,9 @@ export default {
247
248
  }
248
249
  } else {
249
250
  // 当月数据
250
- const formatDay = `${this.year}-${this.month}-${i - firstDayCount}`
251
251
  day = {
252
252
  ...day,
253
- ...this.$pi.date.parseDate(new Date(formatDay))
253
+ ...this.$pi.date.parseDate(new Date(this.year, this.month - 1, i - firstDayCount))
254
254
  }
255
255
  const isDisabled = this.isDisabled(day)
256
256
  // 禁用
@@ -301,9 +301,6 @@ export default {
301
301
  [this.keyField]: 'ROOT'
302
302
  }
303
303
  ].concat(pathItems)
304
- },
305
- syncIds() {
306
- return `${this.innerItems.length}-${this.defaultValue.length}`
307
304
  }
308
305
  },
309
306
  watch: {
@@ -312,6 +309,12 @@ export default {
312
309
  handler() {
313
310
  this.rebuildItems()
314
311
  }
312
+ },
313
+ defaultValue: {
314
+ immediate: true,
315
+ handler(vals) {
316
+ this.selectedIds = [...vals]
317
+ }
315
318
  }
316
319
  },
317
320
 
@@ -395,7 +398,6 @@ export default {
395
398
  } else {
396
399
  // 选中
397
400
  this.selectedIds.push(item[this.keyField])
398
- console.log(this.selectedIds)
399
401
  }
400
402
  },
401
403
  async syncScrollLeft() {
@@ -431,6 +433,7 @@ export default {
431
433
  */
432
434
  handleCancel() {
433
435
  this.$emit('cancel')
436
+ this.selectedIds = [...this.defaultValue]
434
437
  this.getPopupSelect.onCancelClose && this.handlePopupClose()
435
438
  },
436
439
  /**
@@ -1,10 +1,10 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2021-08-13 11:31:57
4
- * @LastEditTime: 2022-11-09 09:37:45
4
+ * @LastEditTime: 2022-11-19 09:44:33
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 图片上传组件
7
- * @FilePath: \piui-awesome\src\piui\components\pi-upload-img\index.vue
7
+ * @FilePath: /dt-weitibao-console/Users/feilin/workspace/piui/piui-awesome/src/piui/components/pi-upload-img/index.vue
8
8
  -->
9
9
 
10
10
  <template>
@@ -16,7 +16,7 @@
16
16
  class="pi-rela pi-flex-column-center"
17
17
  @tap="handlePreviewImage(img)"
18
18
  >
19
- <view class="close" @tap.stop="handleDelete(index)">
19
+ <view v-if="!disabled" class="close" @tap.stop="handleDelete(index)">
20
20
  <pi-icon name="roundclosefill" color="#8e8e8e" size="36" />
21
21
  </view>
22
22
  <image
@@ -27,7 +27,7 @@
27
27
  />
28
28
  </view>
29
29
  <!-- 上传框 -->
30
- <view v-if="getUploadMaxCount">
30
+ <view v-if="getUploadMaxCount && !disabled">
31
31
  <view :style="[getUploadBtnStyle]" class="pi-flex-column-center" @tap="handleChooseImage">
32
32
  <slot name="uploadBtn">
33
33
  <!-- 添加按钮 -->
@@ -315,7 +315,7 @@ export default {
315
315
  if (this.val === null || this.val === undefined) {
316
316
  return []
317
317
  }
318
- return this.isValString ? (this.val ? [this.val] : []) : this.val.filter((img) => img)
318
+ return this.isValString ? (this.val ? [this.val] : []) : this.val.filter(img => img)
319
319
  },
320
320
  getItemStyle() {
321
321
  const style = {
@@ -382,7 +382,7 @@ export default {
382
382
  current = this.val
383
383
  urls = [this.val]
384
384
  } else {
385
- urls = this.imgField ? this.val.map((img) => img[this.imgField]) : this.val
385
+ urls = this.imgField ? this.val.map(img => img[this.imgField]) : this.val
386
386
  current = this.imgField ? img[this.imgField] : img
387
387
  }
388
388
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7beta52",
3
+ "version": "1.2.7beta54",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {