wui-components-v2 1.0.89 → 1.0.91
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
|
<script setup lang="ts">
|
|
2
|
-
import { computed, defineOptions, defineProps } from 'vue'
|
|
2
|
+
import { computed, defineOptions, defineProps, ref } from 'vue'
|
|
3
3
|
import type { Columns, Entities } from '../../type'
|
|
4
|
-
import {
|
|
4
|
+
import { formatItemData } from '../../utils'
|
|
5
5
|
import ControlTypeSupportor from '../../utils/control-type-supportor'
|
|
6
6
|
import videoPlay from '../video-play/video-play.vue'
|
|
7
7
|
|
|
@@ -40,10 +40,19 @@ function isControlType(item: Columns): string {
|
|
|
40
40
|
<view class="mr-2 w-20 p-1 text-gray-500 dark:text-white">
|
|
41
41
|
{{ item.title }}:
|
|
42
42
|
</view>
|
|
43
|
-
<view
|
|
43
|
+
<view
|
|
44
|
+
v-if="isControlType(item) === 'file' || isControlType(item) === 'relfile'"
|
|
45
|
+
class="flex-1 text-gray-800 dark:text-white"
|
|
46
|
+
>
|
|
44
47
|
<view v-if="data.fieldMap[item.sourceId]">
|
|
45
|
-
<view
|
|
46
|
-
|
|
48
|
+
<view
|
|
49
|
+
v-for="(uitem, uindex) in formatItemData(data.fieldMap[item.sourceId], isControlType(item))"
|
|
50
|
+
:key="uindex"
|
|
51
|
+
>
|
|
52
|
+
<wd-img
|
|
53
|
+
v-if="['png', 'jpg', 'jpeg'].includes(uitem.type)" enable-preview :width="100" :height="100"
|
|
54
|
+
:src="uitem.url"
|
|
55
|
+
>
|
|
47
56
|
<template #error>
|
|
48
57
|
<!-- <view class="error-wrap">
|
|
49
58
|
<wd-button type="text" @click="downloadFile(url)">
|
|
@@ -58,7 +67,11 @@ function isControlType(item: Columns): string {
|
|
|
58
67
|
</view>
|
|
59
68
|
</template>
|
|
60
69
|
</wd-img>
|
|
61
|
-
<view
|
|
70
|
+
<view
|
|
71
|
+
v-else-if="['mp4', 'mov', 'wmv', 'avi', 'rmvb', 'flv', 'mkv'].includes(uitem.type)"
|
|
72
|
+
style="width: 70px;height: 70px;display: flex;align-items: center;justify-content: center;border: 1px solid #ccc;border-radius: 4px;"
|
|
73
|
+
@click="openVideo(uitem)"
|
|
74
|
+
>
|
|
62
75
|
<wd-icon name="play-circle-filled" size="22px" />
|
|
63
76
|
</view>
|
|
64
77
|
</view>
|