config.vue
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!-- eslint-disable vue/multi-word-component-names -->
<!-- eslint-disable vue/no-mutating-props -->
<template>
<collapse-item name="视频" expanded>
<setting-item-box name="名字" alone>
<setting-item>
<n-input disabled v-model:value="optionData.text" size="small"></n-input>
</setting-item>
</setting-item-box>
<setting-item-box name="上传" alone>
<FileUpload
:fileSizeConst="fileSizeConst"
:max="1"
:threeSupportFileFormat="supportVideoType"
@fileStaticUri="handleFileStaticUri"
/>
</setting-item-box>
<setting-item-box name="控制">
<setting-item>
<n-checkbox v-model:checked="optionData.loop" size="small">循环播放</n-checkbox>
</setting-item>
<setting-item>
<n-checkbox v-model:checked="optionData.muted" size="small">静音</n-checkbox>
</setting-item>
</setting-item-box>
<setting-item-box name="样式">
<setting-item name="类型">
<n-select v-model:value="optionData.fit" size="small" :options="fitList"></n-select>
</setting-item>
</setting-item-box>
</collapse-item>
</template>
<script setup lang="ts">
import { PropType, ref } from 'vue'
import { option } from './config'
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
import FileUpload from '../../../Composes/Mores/ThreeDimensional/components/FileUpload.vue'
import type { UploadFileInfo } from 'naive-ui'
//视频类型
const supportVideoType = ['mp4']
const fileSizeConst = ref(100)
// 适应类型
const fitList = [
{
value: 'fill',
label: 'fill'
},
{
value: 'contain',
label: 'contain'
},
{
value: 'cover',
label: 'cover'
},
{
value: 'scale-down',
label: 'scale-down'
},
{
value: 'none',
label: 'none'
}
]
const props = defineProps({
optionData: {
type: Object as PropType<typeof option>,
required: true
}
})
const handleFileStaticUri = (value: UploadFileInfo[]) => {
props.optionData.text=value[0]?.name as string
props.optionData.dataset = value[0]?.url as string
}
</script>