af-mobile-client-vue3 1.3.70 → 1.3.71
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.
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import cameraIcon from '@af-mobile-client-vue3/assets/img/component/camera.png'
|
|
2
|
+
// import cameraIcon from '@af-mobile-client-vue3/assets/img/component/camera.png'
|
|
3
3
|
import { deleteFile, upload } from '@af-mobile-client-vue3/services/api/common'
|
|
4
4
|
import { mobileUtil } from '@af-mobile-client-vue3/utils/mobileUtil'
|
|
5
5
|
import {
|
|
6
6
|
ActionSheet,
|
|
7
|
+
Icon as VanIcon,
|
|
7
8
|
Uploader as vanUploader,
|
|
8
9
|
} from 'vant'
|
|
9
10
|
import { ref } from 'vue'
|
|
@@ -379,28 +380,30 @@ function handleActionSelect(option: any) {
|
|
|
379
380
|
style="display:none"
|
|
380
381
|
@change="(e:any) => handleBrowserFiles(e.target.files)"
|
|
381
382
|
>
|
|
382
|
-
<div
|
|
383
|
-
v-if="!props.readonly && props.mode !== '预览' && (imageList.length < props.attr?.acceptCount && props.attr?.addOrEdit !== 'readonly')"
|
|
384
|
-
class="custom-upload-area"
|
|
385
|
-
@click="handleUploadAreaClick"
|
|
386
|
-
>
|
|
387
|
-
<img :src="cameraIcon" alt="camera" class="upload-camera-img">
|
|
388
|
-
<div class="upload-title">
|
|
389
|
-
上传附件
|
|
390
|
-
</div>
|
|
391
|
-
<div v-if="props.attr?.acceptCount" class="upload-desc">
|
|
392
|
-
上传限制: {{ imageList.length }} / {{ props.attr?.acceptCount }}
|
|
393
|
-
</div>
|
|
394
|
-
</div>
|
|
395
383
|
<van-uploader
|
|
396
384
|
ref="uploaderRef"
|
|
397
385
|
v-model="imageList"
|
|
398
|
-
|
|
386
|
+
class="custom-trigger-uploader"
|
|
387
|
+
:show-upload="true"
|
|
399
388
|
:deletable="!props.readonly && (props.attr?.addOrEdit !== 'readonly' && props.authority === 'admin') && props.mode !== '预览'"
|
|
400
389
|
:multiple="!props.readonly && props.authority === 'admin'"
|
|
401
390
|
:preview-image="true"
|
|
402
391
|
:before-delete="!props.readonly && props.attr?.addOrEdit !== 'readonly' && props.authority === 'admin' ? deleteFileFunction : undefined"
|
|
403
|
-
|
|
392
|
+
:before-read="() => false"
|
|
393
|
+
>
|
|
394
|
+
<template #default>
|
|
395
|
+
<div
|
|
396
|
+
v-if="!props.readonly && props.mode !== '预览' && (imageList.length < props.attr?.acceptCount && props.attr?.addOrEdit !== 'readonly')"
|
|
397
|
+
class="custom-upload-area"
|
|
398
|
+
@click="handleUploadAreaClick"
|
|
399
|
+
>
|
|
400
|
+
<VanIcon name="plus" size="35" color="#d9d9d9" />
|
|
401
|
+
<div v-if="props.attr?.acceptCount" class="upload-desc">
|
|
402
|
+
{{ imageList.length }} / {{ props.attr?.acceptCount }}
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
</template>
|
|
406
|
+
</van-uploader>
|
|
404
407
|
<ActionSheet
|
|
405
408
|
v-model:show="showActionSheet"
|
|
406
409
|
:actions="actionOptions"
|
|
@@ -420,10 +423,13 @@ function handleActionSelect(option: any) {
|
|
|
420
423
|
// 该属性会影响表单布局
|
|
421
424
|
// gap: 16px;
|
|
422
425
|
}
|
|
426
|
+
/* 让自定义上传按钮可点击:关闭 Vant 覆盖在上方的透明 input 的事件捕获 */
|
|
427
|
+
:deep(.custom-trigger-uploader .van-uploader__input) {
|
|
428
|
+
pointer-events: none;
|
|
429
|
+
}
|
|
423
430
|
.custom-upload-area {
|
|
424
|
-
width:
|
|
425
|
-
height:
|
|
426
|
-
min-height: 80px;
|
|
431
|
+
width: 82px;
|
|
432
|
+
height: 82px;
|
|
427
433
|
box-sizing: border-box;
|
|
428
434
|
border: 1px dashed #d9d9d9;
|
|
429
435
|
border-radius: 10px;
|