sadais-piui 1.2.7-beta135 → 1.2.7-beta137

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,10 +1,10 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2021-08-13 11:31:57
4
- * @LastEditTime: 2024-10-22 10:42:41
4
+ * @LastEditTime: 2025-04-18 16:28:01
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 图片上传组件
7
- * @FilePath: /piui-awesome/src/piui/components/pi-upload-img/index.vue
7
+ * @FilePath: \piui\components\pi-upload-img\index.vue
8
8
  -->
9
9
 
10
10
  <template>
@@ -415,6 +415,15 @@ export default {
415
415
  }
416
416
  },
417
417
  computed: {
418
+ // 判断是否为企业微信
419
+ isQYWX() {
420
+ let isQYWX = false
421
+ // #ifdef H5
422
+ const ua = navigator.userAgent.toLowerCase()
423
+ isQYWX = ua.indexOf('wxwork') !== -1
424
+ // #endif
425
+ return isQYWX
426
+ },
418
427
  getDisabled() {
419
428
  const parent = this.$pi.parent(this, 'PiFormItem')
420
429
  return this.disabled || (parent && parent.getDisabled)
@@ -588,6 +597,16 @@ export default {
588
597
  return
589
598
  }
590
599
  // 文件预览
600
+ // 判断是企业微信
601
+ if (this.isQYWX) {
602
+ const form = document.createElement('form')
603
+ form.action = file
604
+ form.method = 'GET'
605
+ form.target = '_blank'
606
+ document.body.appendChild(form)
607
+ form.submit()
608
+ return
609
+ }
591
610
  uni.downloadFile({
592
611
  url: file,
593
612
  success: res => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta135",
3
+ "version": "1.2.7-beta137",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {