sadais-piui 1.2.7-beta104 → 1.2.7-beta106

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.
@@ -21,7 +21,10 @@
21
21
  >
22
22
  <view class="pi-calendar" :style="[customStyle]" :class="[customClass]">
23
23
  <!-- 标题栏 -->
24
- <view class="pi-justify-center pi-fz-32 pi-fw-500" :style="[{ padding: getTitlePadding }]">
24
+ <view
25
+ class="pi-justify-center pi-fz-32 pi-fw-500"
26
+ :style="[{ padding: getTitlePadding }]"
27
+ >
25
28
  <slot v-if="$slots.title" name="title" />
26
29
  <template v-else>{{ title }}</template>
27
30
  </view>
@@ -47,8 +50,16 @@
47
50
  />
48
51
  <!-- footer -->
49
52
  <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>
53
+ <view class="pi-flex-sub pi-fz-30 pi-fw-500">{{
54
+ getDisplayValue
55
+ }}</view>
56
+ <pi-button
57
+ type="primary"
58
+ size="medium"
59
+ :disabled="confirmDisabled"
60
+ @click="handleConfirm"
61
+ >确定</pi-button
62
+ >
52
63
  </view>
53
64
  </view>
54
65
  </pi-popup>
@@ -122,7 +133,10 @@ export default {
122
133
  }
123
134
  },
124
135
  data() {
125
- const mergeCalendarPanel = this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
136
+ const mergeCalendarPanel = this.$pi.lang.mergeDeep(
137
+ calendar.calendarPanel,
138
+ this.calendarPanel
139
+ )
126
140
  return {
127
141
  calendarValue: mergeCalendarPanel.value
128
142
  }
@@ -139,6 +153,12 @@ export default {
139
153
  },
140
154
  getDisplayValue() {
141
155
  return [].concat(this.calendarValue).join(' - ')
156
+ },
157
+ confirmDisabled() {
158
+ if (this.getCalendarPanel.type === 'range') {
159
+ return this.calendarValue.length !== 2
160
+ }
161
+ return !this.calendarValue
142
162
  }
143
163
  },
144
164
  watch: {
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2021-08-13 11:31:57
4
- * @LastEditTime: 2024-05-24 15:19:19
4
+ * @LastEditTime: 2024-05-29 10:09:04
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 图片上传组件
7
7
  * @FilePath: /piui-awesome/src/piui/components/pi-upload-img/index.vue
@@ -560,6 +560,9 @@ export default {
560
560
  current = this.imgField ? img[this.imgField] : img
561
561
  }
562
562
 
563
+ // 过滤出图片类型的文件
564
+ urls = urls.filter(url => isImageFilename(url))
565
+
563
566
  // eslint-disable-next-line no-undef
564
567
  uni.previewImage({
565
568
  urls,
@@ -759,6 +762,11 @@ export default {
759
762
  if (errMsg !== 'chooseMessageFile:ok') {
760
763
  throw new Error(errMsg)
761
764
  }
765
+ // chooseMessageFile 没有扩展名限制,这里自己做过滤
766
+ tempFiles = tempFiles.filter(file => {
767
+ const ext = file.name.split('.').pop()
768
+ return this.getChooseFileOpts.extension.includes(ext)
769
+ })
762
770
  this.handleUpload(tempFiles)
763
771
  } catch (error) {
764
772
  console.log(error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta104",
3
+ "version": "1.2.7-beta106",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {