sadais-piui 1.2.7-beta135 → 1.2.7-beta136

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,11 @@ export default {
415
415
  }
416
416
  },
417
417
  computed: {
418
+ // 判断是否为企业微信
419
+ isQYWX() {
420
+ const ua = navigator.userAgent.toLowerCase()
421
+ return ua.indexOf('wxwork') !== -1
422
+ },
418
423
  getDisabled() {
419
424
  const parent = this.$pi.parent(this, 'PiFormItem')
420
425
  return this.disabled || (parent && parent.getDisabled)
@@ -588,6 +593,16 @@ export default {
588
593
  return
589
594
  }
590
595
  // 文件预览
596
+ // 判断是企业微信
597
+ if (this.isQYWX) {
598
+ const form = document.createElement('form')
599
+ form.action = file
600
+ form.method = 'GET'
601
+ form.target = '_blank'
602
+ document.body.appendChild(form)
603
+ form.submit()
604
+ return
605
+ }
591
606
  uni.downloadFile({
592
607
  url: file,
593
608
  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-beta136",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {