罗广辉
2025-06-19 f27ca082eb0a839449dd50c49007b58e5ed6946f
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<template>
  <a-layout>
    <div class="width100 flex-column flex-justify-start flex-align-start" style="background-color: white;">
 
      <p class="fz16 ml10 mt15 mb10 color-text-title color-font-bold" style="color: #939393">
        启用后,照片和视频将自动上传到此服务器
      </p>
      <div
        class="flex-row flex-align-center mt20"
        style="width: 100%;"
      >
        <p class="ml10 mb0 fz16" style="margin-right: 73vw;">自动上传照片</p>
        <a-switch
          v-model:checked="enablePhotoUpload"
          @change="onPhotoUpload"
        ></a-switch>
      </div>
      <div
        class="flex-row flex-align-center flex-justify-between"
        style="width: 100%"
      >
        <a-radio-group
          class="mt10 ml20"
          v-if="enablePhotoUpload === true"
          v-model:value="photoType"
          defaultChecked="0"
          @change="onPhototype"
        >
          <a-radio :value="EPhotoType.Original">原始照片</a-radio>
          <a-radio class="ml20" :value="EPhotoType.Preview">预览照片</a-radio>
        </a-radio-group>
      </div>
      <div class="ml10 mr10" style="width: 96%; margin-top: -10px;">
        <a-divider />
      </div>
      <div
        class="flex-row flex-align-center"
        style="width: 100%; margin-top: -10px;"
      >
        <p class="ml10 mb0 fz16" style="margin-right: 73vw;">自动上传视频</p>
        <a-switch
          @change="onVideoUpload"
          v-model:checked="enableVideoUpload"
        ></a-switch>
      </div>
      <div class="ml10 mr10" style="width: 96%; margin-top: -10px;">
        <a-divider />
      </div>
      <div
        class="flex-row flex-align-center flex-justify-between mb15"
        style="width: 100%; margin-top: -10px;"
      >
        <p class="ml10 mb0 fz16 color-font-bold">
          双控模式下媒体资源上传路径
        </p>
        <a-radio-group
          class="mt0 mb0"
          v-model:value="uploadPath"
          button-style="solid"
          @change="onUploadPath"
        >
          <a-radio-button :value="EDownloadOwner.Mine">我的</a-radio-button>
          <a-radio-button :value="EDownloadOwner.Others">其他</a-radio-button>
        </a-radio-group>
      </div>
    </div>
  </a-layout>
</template>
 
<script lang="ts" setup>
import { message } from 'ant-design-vue'
import { onMounted, ref } from 'vue'
import apiPilot from '/@/api/pilot-bridge'
import { getRoot } from '/@/root'
import { EComponentName, EPhotoType, EDownloadOwner } from '/@/types'
 
const root = getRoot()
 
const enablePhotoUpload = ref<boolean>(apiPilot.getAutoUploadPhoto())
const enableVideoUpload = ref<boolean>(apiPilot.getAutoUploadVideo())
const photoType = ref<number>(apiPilot.getUploadPhotoType())
const uploadPath = ref<number>(apiPilot.getDownloadOwner())
 
const onPhotoUpload = () => {
  apiPilot.setAutoUploadPhoto(enablePhotoUpload.value)
}
const onVideoUpload = () => {
  apiPilot.setAutoUploadVideo(enableVideoUpload.value)
}
const onPhototype = () => {
  apiPilot.setUploadPhotoType(photoType.value)
}
const onUploadPath = (e: any) => {
  apiPilot.setDownloadOwner(uploadPath.value)
}
onMounted(() => {
  console.error(apiPilot.getUploadPhotoType())
  console.error(apiPilot.getAutoUploadVideo())
})
</script>
 
<style lang="scss" scoped>
// @import '/@/styles/index.scss';
</style>