ny
22 小时以前 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
<script lang="ts" setup>
import { computed, onMounted } from 'vue';
 
import { getDataInterfaceRes } from '#/api/systemData/dataInterface';
import { getAuthMediaUrl, getParamList } from '#/utils/jnpf';
 
import CardHeader from '../CardHeader/index.vue';
 
const props = defineProps(['activeData']);
 
const getValue = computed(() => {
  const val = props.activeData.option.defaultValue;
  if (props.activeData.option.styleType == 1 && val.url) return getAuthMediaUrl(val.url);
  return val;
});
 
function initData() {
  if (props.activeData.dataType === 'dynamic') {
    props.activeData.option.defaultValue = '';
    const propsApi = props.activeData.propsApi;
    if (!propsApi) return;
    const query = { paramList: getParamList(props.activeData.templateJson) };
    getDataInterfaceRes(propsApi, query).then((res) => {
      props.activeData.option.defaultValue = res.data;
    });
  }
}
 
onMounted(() => initData());
</script>
<template>
  <a-card class="portal-card-box">
    <template #title v-if="activeData.title">
      <CardHeader :title="activeData.title" :card="activeData.card" />
    </template>
    <div class="portal-card-body h-full">
      <template v-if="getValue">
        <video
          class="h-full w-full"
          controls
          :loop="activeData.option.playNumber === 2"
          :autoplay="activeData.option.videoAutoplay"
          :muted="activeData.option.mutePlay">
          <source :src="getValue" type="video/mp4" />
        </video>
      </template>
      <div class="portal-common-noData" v-else>
        <img src="@/assets/images/portal/nodata.png" alt="" class="noData-img" />
        <p class="noData-txt">暂无视频</p>
      </div>
    </div>
  </a-card>
</template>