Browse Source

Merge branch 'master' of http://face3d.4dage.com:7005/renyicun/ZhongMianAdmin

tangning 1 year ago
parent
commit
8cd1cf5647

+ 1 - 0
packages/app-cdfg/package.json

@@ -9,6 +9,7 @@
     "serve-prod": "vue-cli-service serve --mode prod",
     "build": "vue-cli-service build",
     "build-test": "vue-cli-service build --mode mytest",
+    "deploy-test": "npm-run-all -s build-test oss:upload-aws",
     "deploy": "npm-run-all -s build oss:upload-aws"
   },
   "dependencies": {

+ 8 - 88
packages/app-cdfg/src/components/Tags/brand-list.vue

@@ -38,14 +38,11 @@
                             <tbody>
                                 <tr v-for="(i, index) in brands" :key="index" @click="chooseItem(i)">
                                     <td>
-                                        <div class="checkbox" :class="{ active: brand?.id == i.id }">
-                                            <!-- <input type="radio" /> -->
-                                            <!-- <span></span> -->
-                                        </div>
+                                        <div class="checkbox" :class="{ active: brand?.id == i.id }"></div>
                                     </td>
                                     <td>{{ index + 1 }}</td>
                                     <td>
-                                        <span class="brand-name">{{ i.zhName }}</span>
+                                        <span class="brand-name">{{ i.ftName ? i.ftName : i.zhName ? i.zhName : i.enName }}</span>
                                     </td>
                                     <td><img style="width: 100px" :src="i.brandLogo" alt="" /></td>
                                     <td><img style="width: 100px" :src="i.outlineImage" alt="" /></td>
@@ -74,67 +71,23 @@ import { useStore } from 'vuex'
 const store = useStore()
 const showListPanel = ref(false)
 const searchKey = ref('')
-const productSource = ref(null)
 const hotData = computed(() => store.getters['tag/hotData'])
 const brands = computed(() => {
     return store.getters['tag/brandsList'] || []
 })
 const brand = ref(null)
-// const brands = ref([
-//     {
-//         id: 1,
-//         cdfBrandId: 1,
-//         zhName: '阿迪达斯',
-//         ftName: '阿迪達斯',
-//         enName: 'adidas',
-//         brandLogo: 'https://tm-image.tianyancha.com/tm/1bf31ff81eb5e59a51db1a51600693e2.jpg',
-//         outlineId: '',
-//         outlineName: '',
-//         outlineImage: 'https://pic.90sheji.com/original_origin_pic/18/12/14/8691dccadcecf039f60540135bb4a5e5.png%21/fw/315/quality/90/unsharp/true/compress/true/canvas/315x315a0a0/cvscolor/FFFFFFFF',
-//     },
-//     {
-//         id: 2,
-//         cdfBrandId: 2,
-//         zhName: '耐克',
-//         ftName: '耐克',
-//         enName: 'nike',
-//         brandLogo: 'https://pan.kanfeidie.com/wp-content/uploads/2020/08/20200809012925603.png',
-//         outlineId: '',
-//         outlineName: '',
-//         outlineImage: 'https://pic.90sheji.com/original_origin_pic/18/12/14/8691dccadcecf039f60540135bb4a5e5.png%21/fw/315/quality/90/unsharp/true/compress/true/canvas/315x315a0a0/cvscolor/FFFFFFFF',
-//     },
-//     {
-//         id: 3,
-//         cdfBrandId: 3,
-//         zhName: '李宁',
-//         ftName: '李寧',
-//         enName: 'li-ning',
-//         brandLogo: 'https://www.bjxku.com/uploads/images/img/2021/1013/1634090167152732.png',
-//         outlineId: '',
-//         outlineName: '',
-//         outlineImage: 'https://pic.90sheji.com/original_origin_pic/18/12/14/8691dccadcecf039f60540135bb4a5e5.png%21/fw/315/quality/90/unsharp/true/compress/true/canvas/315x315a0a0/cvscolor/FFFFFFFF',
-//     },
-//     {
-//         id: 4,
-//         cdfBrandId: 4,
-//         zhName: '安踏',
-//         ftName: '安踏',
-//         enName: 'ANTA',
-//         brandLogo:
-//             'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F97cc9fb1-55e4-43a6-a19e-9b29c30771ac%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1704946045&t=b6f477348b8e188ae95b0fb522395aa0',
-//         outlineId: '',
-//         outlineName: '',
-//         outlineImage: 'https://pic.90sheji.com/original_origin_pic/18/12/14/8691dccadcecf039f60540135bb4a5e5.png%21/fw/315/quality/90/unsharp/true/compress/true/canvas/315x315a0a0/cvscolor/FFFFFFFF',
-//     },
-// ])
+
 const chooseItem = item => {
     brand.value = item
 }
 const saveBrand = () => {
     hotData.value.brandId = brand.value.cdfBrandId
+    let title = brand.value.ftName ? brand.value.ftName : brand.value.zhName ? brand.value.zhName : brand.value.enName
+    hotData.value.title = title
     hotData.value.brand = brand.value
     emits('close')
 }
+
 const pageNum = ref(1)
 const getData = common.debounce(
     (reset = false) => {
@@ -162,15 +115,7 @@ const getData = common.debounce(
 const close = () => {
     emits('close')
 }
-const selectGood = (item, isSelect) => {
-    item.isCheck = isSelect
-    let index = select.value.findIndex(i => i.id == item.id)
-    if (isSelect) {
-        !~index && select.value.push(item)
-    } else {
-        ~index && select.value.splice(index, 1)
-    }
-}
+
 watch(
     () => searchKey.value,
     (newval, old) => {
@@ -179,6 +124,7 @@ watch(
     }
 )
 onMounted(() => {
+    store.commit('tag/resetBrandsList')
     showListPanel.value = true
     getData(true)
 })
@@ -191,8 +137,6 @@ onMounted(() => {
     top: 0;
     position: fixed;
     left: 0;
-    // padding: calc(var(--editor-head-height) + 20px) calc(var(--editor-toolbox-width) + 20px) 60px calc(var(--editor-menu-width) + 20px);
-    // background-color: rgba(255, 255, 255, 0.7);
     z-index: 999;
     .brand-info {
         color: #fff;
@@ -325,30 +269,6 @@ onMounted(() => {
         }
     }
 
-    // .checkbox > input,
-    // .checkbox > span {
-    //     width: 100%;
-    //     height: 100%;
-    //     position: absolute;
-    //     left: 0;
-    //     top: 0;
-    //     border: 1px solid rgba(176, 176, 176, 0.5);
-    // }
-
-    // .checkbox > input {
-    //     z-index: 1;
-    //     opacity: 0;
-    //     cursor: pointer;
-    // }
-
-    // .checkbox > span {
-    //     z-index: 2;
-    //     pointer-events: none;
-    //     border-radius: 2px;
-    // }
-
-    // .checkbox span {
-    // }
     .checkbox {
         position: absolute;
         left: 0;

+ 1 - 15
packages/app-cdfg/src/components/Tags/index.vue

@@ -5,7 +5,7 @@
                 <span @click.stop="goTag(tag, index)" class="point zoom" :style="{ 'background-image': 'url(' + getUrl(tag.icon) + ')' }"></span>
                 <!-- <div class="content"> -->
                 <div class="content">
-                    <div :id="`trans_${tag.sid}`" :style="isEdit ? transStyle : ''" class="trans" :class="{ active: (isFixed && tag.sid == hotData.sid) || showInfo }">
+                    <div :id="`trans_${tag.sid}`" class="trans" :class="{ active: (isFixed && tag.sid == hotData.sid) || showInfo }">
                         <template v-if="hotData && tag.sid == hotData.sid && !showMsg">
                             <div class="arrow" :id="`arrow_${tag.sid}`"></div>
                             <TagInfo v-if="isEdit && hotData" />
@@ -80,20 +80,6 @@ watch(
         }
     }
 )
-const transStyle = ref('')
-watch(
-    () => isEdit.value,
-    (val, old) => {
-        // console.log(val)
-        if (val) {
-            nextTick(() => {
-                // let transEle = document.getElementById(`trans_${hotData.value.sid}`)
-                // let transOffsetHeight = transEle.offsetHeight
-                // transStyle.value = `transform:translateY(0) scale(1);margin-top:-${transOffsetHeight / 2}px;transition:none;`
-            })
-        }
-    }
-)
 
 const showInfo = ref(false)
 const showMsg = ref(false)

+ 9 - 4
packages/app-cdfg/src/components/Tags/tag-info.vue

@@ -277,15 +277,20 @@ onMounted(() => {})
                     }
                 }
                 > span {
-                    width: 100px;
+                    width: 80px;
+                    // overflow: hidden;
+                    // text-overflow: ellipsis;
+                    // white-space: nowrap;
                     overflow: hidden;
+                    display: -webkit-box;
+                    -webkit-box-orient: vertical;
+                    -webkit-line-clamp: 2;
                     text-overflow: ellipsis;
-                    white-space: nowrap;
                     font-size: 12px;
                     margin-top: 6px;
                     text-align: center;
-                    display: inline-block;
-                    text-align: center;
+                    // display: inline-block;
+                    word-break: break-word;
                     color: rgba(255, 255, 255, 0.3);
                 }
             }

+ 1 - 1
packages/app-cdfg/src/locales/en.json

@@ -280,7 +280,7 @@
             "modelTips": "Before uploading the model,",
             "contorlTips": "check the operating tips.",
             "controlTips_zh": "If you wish to continue using this feature, please contact customer service by scanning the following WeChat code: This function requires the scene's original data, so please be patient.",
-            "controlTips_en": "If you wish to continue using this feature, please contact customer service at service{'@'}4dage.com, as it takes a significant amount of time to process the original scene data. We will contact you immediately after receiving the email.",
+            "controlTips_en": "If you wish to continue using this feature, please contact customer service at service{'@'}4dage.com, as it takes a significant amount of time to process the original scene data. We will contact you immediately after receiving the email."
         }
     },
     "repair.name": "场景修复",

+ 1 - 1
packages/app-cdfg/src/locales/zh.json

@@ -281,7 +281,7 @@
             "modelTips": "上傳模型前請查看",
             "contorlTips": "操作提示",
             "controlTips_zh": "該功能需要使用場景原始數據,需要較長時間等待,如需繼續使用,請微信掃碼聯系客服:",
-            "controlTips_en": "該功能需要使用場景原始數據,需要較長時間等待,如需繼續使用,請聯系客服 service{'@'}4dage.com<br/>我們將在收到郵件後第一時間聯系您。",
+            "controlTips_en": "該功能需要使用場景原始數據,需要較長時間等待,如需繼續使用,請聯系客服 service{'@'}4dage.com<br/>我們將在收到郵件後第一時間聯系您。"
         }
     },
     "repair.name": "場景修復",

+ 258 - 261
packages/app-cdfg/src/views/info/Toolbox.Content.vue

@@ -1,261 +1,258 @@
-<template>
-    <ui-editor-toolbox>
-        <ul class="edit-list">
-            <li>
-                <div class="title">
-                    <span>{{ $t('info.toolbox.music') }}</span>
-                    <label @click="onUpload">
-                        <ui-icon :tip="$t('info.toolbox.uploadMusic')" tipH="right" type="uploading" />
-                    </label>
-                </div>
-                <div>
-                    <ui-input type="select" :options="musics" width="100%" :placeholder="$t('common.none')" v-model="music" stop-el="i">
-                        <template v-slot:option="{ raw }">
-                            <div :class="{ 'music-user': raw.user }">
-                                <div>{{ raw.label }}</div>
-                                <!-- <div>{{ raw.user ? raw.value : $t(`info.musics.${raw.value}`) }}</div> -->
-                                <span v-show="raw.user" @click.stop="onDeleteUpload(raw)"><i class="iconfont icon-del"></i></span>
-                            </div>
-                        </template>
-                    </ui-input>
-                </div>
-            </li>
-            <li>
-                <div class="title">
-                    <span>{{ $t('info.toolbox.share') }}</span>
-                </div>
-                <div class="between">
-                    <ui-button width="47.5%" ref="copy" :data-clipboard-text="copyLink">{{ $t('info.toolbox.copyLink') }}</ui-button>
-                    <ui-button width="47.5%" @click="onDownloadQrCode">{{ $t('info.toolbox.downLoadCode') }}</ui-button>
-                </div>
-            </li>
-            <li>
-                <div class="between">
-                    <span>{{ $t('info.toolbox.uploadTime') }}</span>
-                    <label>{{ metadata.createTime }}</label>
-                </div>
-                <div class="between">
-                    <span>{{ $t('info.toolbox.shootPoint') }}</span>
-                    <label>{{ metadata.panoCount || 0 }}</label>
-                </div>
-                <div class="between">
-                    <span>{{ $t('info.toolbox.boxVideo') }}</span>
-                    <label>{{ metadata.videoCount || 0 }}</label>
-                </div>
-            </li>
-        </ul>
-        <ui-window v-if="showUpload" :title="$t('info.toolbox.addBackgroundMusic')" :canSubmit="file" @no="onCancel" @ok="onConfirm" :noText="$t('common.cancel')" :okText="$t('common.confirm')">
-            <template v-slot:content>
-                <div class="upload-music-box">
-                    <label for="file" :class="{ active: file }">
-                        <span v-if="!file">+ {{ $t('info.toolbox.uploadMusic') }}</span>
-                        <span v-else>{{ file.name }}</span>
-                    </label>
-                    <input type="file" accept=".mp3,.wav" id="file" @change="changeFile" />
-                    <!-- <p class="tips">{{ $t('info.toolbox.uploadTips') }}</p> -->
-                    <p class="tips">{{ $t('limit.formSize', { size: '5MB', form: 'MP3 / WAV' }) }}</p>
-                </div>
-            </template>
-        </ui-window>
-    </ui-editor-toolbox>
-</template>
-<script setup>
-import ClipboardJS from 'clipboard'
-import { ref, computed, onMounted, nextTick } from 'vue'
-import { useStore } from 'vuex'
-import { Dialog } from '@kankan/components'
-import { downloadFile } from '@/utils/download'
-import { getApp, getNum } from '@/app'
-import { useMusicPlayer } from '@/utils/sound'
-import { useI18n } from '@/i18n'
-import * as apis from '@/apis/scene-edit.js'
-import browser from '@/utils/browser'
-
-const musicPlayer = useMusicPlayer()
-const { t } = useI18n({ useScope: 'global' })
-const store = useStore()
-const metadata = computed(() => store.getters['info/metadata'])
-const music = computed({
-    get() {
-        if (metadata.value.music) {
-            // let item = /^0\d$/.test(metadata.value.music) ? metadata.value.music : metadata.value.music == 'none' || metadata.value.music == '' ? 'none' : metadata.value.musicFile
-            let item = /^0\d$/.test(metadata.value.music) ? metadata.value.music : metadata.value.music == 'none' ? 'none' : metadata.value.musicFile
-            // let item = /^0\d$/.test(metadata.value.music) ? metadata.value.music : metadata.value.musicFile
-            return item
-        } else {
-            return 'none'
-        }
-    },
-    set(music) {
-        store.commit('info/update', { music })
-        musicPlayer.play()
-    }
-})
-const musics = computed(() => {
-    let list = store.getters['info/music']
-    list.map(i => {
-        if (i.value == '') {
-            i.value = 'none'
-        }
-        let item = /^0\d$/.test(i.value) ? t(`info.musics.${i.value}`) : i.value == 'none' ? t(`info.musics.${i.value}`) : i.value
-        i.label = item
-    })
-    return list
-})
-const copy = ref(null)
-const file = ref(null)
-const showUpload = ref(false)
-const copyLink = computed(() => {
-    let domain = store.getters['scene/whichDept'] == 'HK' ? process.env.VUE_APP_SHOW_HK_URL : process.env.VUE_APP_SHOW_URL
-    return domain + `index.html?m=${browser.getURLParam('m')}`
-})
-
-const onUpload = () => {
-    if (metadata.value.musicFile) {
-        Dialog.confirm({
-            content: `${t('info.toolbox.addTips')}`,
-            title: t('common.tips'),
-            okText: t('common.confirm'),
-            noText: t('common.cancel'),
-            func: state => {
-                if (state == 'ok') {
-                    showUpload.value = true
-                }
-            }
-        })
-    } else {
-        showUpload.value = true
-    }
-}
-const onDeleteUpload = item => {
-    // store.commit('info/update', { music: '', musicFile: '', files: { music: null } })
-    console.log(item)
-    let params = {
-        musicFile: '',
-        files: { music: null }
-    }
-    if (metadata.value.music == item.value) {
-        params.music = ''
-    }
-    store.commit('info/update', params)
-}
-const changeFile = e => {
-    console.log(e.target.files[0])
-    let fileType = e.target.files[0].name
-        .split('.')
-        .pop()
-        .toLowerCase()
-    console.log(fileType)
-    if (['mp3', 'wav'].indexOf(fileType) == -1) {
-        Dialog.toast({
-            content: `${t('limit.formFile', { form: 'MP3 / WAV' })}`, //'仅支持 MP3/WAV 格式的音频',
-            type: 'error'
-        })
-        return
-    }
-
-    if (e.target.files[0].size / 1024 / 1024 > 5) {
-        Dialog.toast({
-            // content: e.target.files[0].name + '的大小超过了5MB',
-            content: `${t('limit.formSize', { form: 'MP3 / WAV', size: '5MB' })}`, //'请上传5MB以内的MP3/WAV文件',
-            type: 'error'
-        })
-        return
-    }
-    if (e.target && e.target.files[0]) {
-        file.value = e.target.files[0]
-    }
-}
-const onCancel = e => {
-    showUpload.value = false
-    file.value = null
-}
-const onConfirm = () => {
-    store.commit('info/update', { music: file.value.name, musicFile: file.value.name, files: { music: file.value } })
-    nextTick(() => {
-        musicPlayer.play()
-    })
-    onCancel()
-}
-const onDownloadQrCode = () => {
-    let a = document.createElement('a')
-    let link = `/service/scene/edit/down/qrCode?num=${browser.getURLParam('m')}`
-    a.href = link
-    a.download = `4DKanKan_share.png`
-    a.target = '_blank'
-    a.click()
-    a.remove()
-    // downloadFile(getApp().resource.getResourceURL(`downloads/scene/{num}/QRcode/{num}.png`), `4DKanKan_share.png`)
-}
-
-onMounted(() => {
-    var clipboard = new ClipboardJS(copy.value.$el)
-    clipboard.on('success', function(e) {
-        e.clearSelection()
-        Dialog.toast({ content: `${t('info.toolbox.copySuccess')}`, type: 'success' })
-    })
-})
-</script>
-<style lang="scss" scoped>
-.upload-music-box {
-    width: 400px;
-
-    input {
-        display: none;
-    }
-    label {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        width: 100%;
-        height: 34px;
-        border-radius: 4px;
-        border: 1px solid rgba(255, 255, 255, 0.2);
-        color: rgba(255, 255, 255, 0.6);
-        cursor: pointer;
-        margin-bottom: 10px;
-        &.active {
-            background: rgba(255, 255, 255, 0.1);
-            color: var(--editor-main-color);
-        }
-        &:hover {
-            border: 1px solid var(--editor-main-color);
-            color: var(--editor-main-color);
-        }
-        span {
-            width: 80%;
-            text-align: center;
-            overflow: hidden;
-            white-space: nowrap;
-            text-overflow: ellipsis;
-        }
-    }
-    p {
-        font-size: 12px;
-        font-family: MicrosoftYaHei;
-        color: rgba(255, 255, 255, 0.3);
-        line-height: 22px;
-        text-align: center;
-    }
-}
-.music-user {
-    position: relative;
-    display: flex;
-    align-items: center;
-    > div {
-        width: 100%;
-        padding-right: 35px;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-    }
-    span {
-        position: absolute;
-        display: block;
-        top: 50%;
-        right: 0px;
-        transform: translateY(-50%);
-        cursor: pointer;
-    }
-}
-</style>
+<template>
+    <ui-editor-toolbox>
+        <ul class="edit-list">
+            <li>
+                <div class="title">
+                    <span>{{ $t('info.toolbox.music') }}</span>
+                    <label @click="onUpload">
+                        <ui-icon :tip="$t('info.toolbox.uploadMusic')" tipH="right" type="uploading" />
+                    </label>
+                </div>
+                <div>
+                    <ui-input type="select" :options="musics" width="100%" :placeholder="$t('common.none')" v-model="music" stop-el="i">
+                        <template v-slot:option="{ raw }">
+                            <div :class="{ 'music-user': raw.user }">
+                                <div>{{ raw.label }}</div>
+                                <!-- <div>{{ raw.user ? raw.value : $t(`info.musics.${raw.value}`) }}</div> -->
+                                <span v-show="raw.user" @click.stop="onDeleteUpload(raw)"><i class="iconfont icon-del"></i></span>
+                            </div>
+                        </template>
+                    </ui-input>
+                </div>
+            </li>
+            <li>
+                <div class="title">
+                    <span>{{ $t('info.toolbox.share') }}</span>
+                </div>
+                <div class="between">
+                    <ui-button width="47.5%" ref="copy" :data-clipboard-text="copyLink">{{ $t('info.toolbox.copyLink') }}</ui-button>
+                    <ui-button width="47.5%" @click="onDownloadQrCode">{{ $t('info.toolbox.downLoadCode') }}</ui-button>
+                </div>
+            </li>
+            <li>
+                <div class="between">
+                    <span>{{ $t('info.toolbox.uploadTime') }}</span>
+                    <label>{{ metadata.createTime }}</label>
+                </div>
+                <div class="between">
+                    <span>{{ $t('info.toolbox.shootPoint') }}</span>
+                    <label>{{ metadata.panoCount || 0 }}</label>
+                </div>
+                <div class="between">
+                    <span>{{ $t('info.toolbox.boxVideo') }}</span>
+                    <label>{{ metadata.videoCount || 0 }}</label>
+                </div>
+            </li>
+        </ul>
+        <ui-window v-if="showUpload" :title="$t('info.toolbox.addBackgroundMusic')" :canSubmit="file" @no="onCancel" @ok="onConfirm" :noText="$t('common.cancel')" :okText="$t('common.confirm')">
+            <template v-slot:content>
+                <div class="upload-music-box">
+                    <label for="file" :class="{ active: file }">
+                        <span v-if="!file">+ {{ $t('info.toolbox.uploadMusic') }}</span>
+                        <span v-else>{{ file.name }}</span>
+                    </label>
+                    <input type="file" accept=".mp3,.wav" id="file" @change="changeFile" />
+                    <!-- <p class="tips">{{ $t('info.toolbox.uploadTips') }}</p> -->
+                    <p class="tips">{{ $t('limit.formSize', { size: '5MB', form: 'MP3 / WAV' }) }}</p>
+                </div>
+            </template>
+        </ui-window>
+    </ui-editor-toolbox>
+</template>
+<script setup>
+import ClipboardJS from 'clipboard'
+import { ref, computed, onMounted, nextTick } from 'vue'
+import { useStore } from 'vuex'
+import { Dialog } from '@kankan/components'
+import { downloadFile } from '@/utils/download'
+import { getApp, getNum } from '@/app'
+import { useMusicPlayer } from '@/utils/sound'
+import { useI18n } from '@/i18n'
+import * as apis from '@/apis/scene-edit.js'
+import browser from '@/utils/browser'
+
+const musicPlayer = useMusicPlayer()
+const { t } = useI18n({ useScope: 'global' })
+const store = useStore()
+const metadata = computed(() => store.getters['info/metadata'])
+const music = computed({
+    get() {
+        if (metadata.value.music) {
+            // let item = /^0\d$/.test(metadata.value.music) ? metadata.value.music : metadata.value.music == 'none' || metadata.value.music == '' ? 'none' : metadata.value.musicFile
+            let item = /^0\d$/.test(metadata.value.music) ? metadata.value.music : metadata.value.music == 'none' ? 'none' : metadata.value.musicFile
+            // let item = /^0\d$/.test(metadata.value.music) ? metadata.value.music : metadata.value.musicFile
+            return item
+        } else {
+            return 'none'
+        }
+    },
+    set(music) {
+        store.commit('info/update', { music })
+        musicPlayer.play()
+    },
+})
+const musics = computed(() => {
+    let list = store.getters['info/music']
+    list.map(i => {
+        if (i.value == '') {
+            i.value = 'none'
+        }
+        let item = /^0\d$/.test(i.value) ? t(`info.musics.${i.value}`) : i.value == 'none' ? t(`info.musics.${i.value}`) : i.value
+        i.label = item
+    })
+    return list
+})
+const copy = ref(null)
+const file = ref(null)
+const showUpload = ref(false)
+const copyLink = computed(() => {
+    let domain = store.getters['scene/whichDept'] == 'HK' ? process.env.VUE_APP_SHOW_HK_URL : process.env.VUE_APP_SHOW_URL
+    return domain + `index.html?m=${browser.getURLParam('m')}`
+})
+
+const onUpload = () => {
+    if (metadata.value.musicFile) {
+        Dialog.confirm({
+            content: `${t('info.toolbox.addTips')}`,
+            title: t('common.tips'),
+            okText: t('common.confirm'),
+            noText: t('common.cancel'),
+            func: state => {
+                if (state == 'ok') {
+                    showUpload.value = true
+                }
+            },
+        })
+    } else {
+        showUpload.value = true
+    }
+}
+const onDeleteUpload = item => {
+    // store.commit('info/update', { music: '', musicFile: '', files: { music: null } })
+    console.log(item)
+    let params = {
+        musicFile: '',
+        files: { music: null },
+    }
+    if (metadata.value.music == item.value) {
+        params.music = ''
+    }
+    store.commit('info/update', params)
+}
+const changeFile = e => {
+    console.log(e.target.files[0])
+    let fileType = e.target.files[0].name.split('.').pop().toLowerCase()
+    console.log(fileType)
+    if (['mp3', 'wav'].indexOf(fileType) == -1) {
+        Dialog.toast({
+            content: `${t('limit.formFile', { form: 'MP3 / WAV' })}`, //'仅支持 MP3/WAV 格式的音频',
+            type: 'error',
+        })
+        return
+    }
+
+    if (e.target.files[0].size / 1024 / 1024 > 5) {
+        Dialog.toast({
+            // content: e.target.files[0].name + '的大小超过了5MB',
+            content: `${t('limit.formSize', { form: 'MP3 / WAV', size: '5MB' })}`, //'请上传5MB以内的MP3/WAV文件',
+            type: 'error',
+        })
+        return
+    }
+    if (e.target && e.target.files[0]) {
+        file.value = e.target.files[0]
+    }
+}
+const onCancel = e => {
+    showUpload.value = false
+    file.value = null
+}
+const onConfirm = () => {
+    store.commit('info/update', { music: file.value.name, musicFile: file.value.name, files: { music: file.value } })
+    nextTick(() => {
+        musicPlayer.play()
+    })
+    onCancel()
+}
+const onDownloadQrCode = () => {
+    let a = document.createElement('a')
+    let link = `/service/scene/edit/down/qrCode?num=${browser.getURLParam('m')}`
+    a.href = link
+    a.download = `4DKanKan_share.png`
+    a.target = '_blank'
+    a.click()
+    a.remove()
+    // downloadFile(getApp().resource.getResourceURL(`downloads/scene/{num}/QRcode/{num}.png`), `4DKanKan_share.png`)
+}
+
+onMounted(() => {
+    var clipboard = new ClipboardJS(copy.value.$el)
+    clipboard.on('success', function (e) {
+        e.clearSelection()
+        Dialog.toast({ content: `${t('info.toolbox.copySuccess')}`, type: 'success' })
+    })
+})
+</script>
+<style lang="scss" scoped>
+.upload-music-box {
+    width: 400px;
+
+    input {
+        display: none;
+    }
+    label {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 100%;
+        height: 34px;
+        border-radius: 4px;
+        border: 1px solid rgba(255, 255, 255, 0.2);
+        color: rgba(255, 255, 255, 0.6);
+        cursor: pointer;
+        margin-bottom: 10px;
+        &.active {
+            background: rgba(255, 255, 255, 0.1);
+            color: var(--editor-main-color);
+        }
+        &:hover {
+            border: 1px solid var(--editor-main-color);
+            color: var(--editor-main-color);
+        }
+        span {
+            width: 80%;
+            text-align: center;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
+        }
+    }
+    p {
+        font-size: 12px;
+        font-family: MicrosoftYaHei;
+        color: rgba(255, 255, 255, 0.3);
+        line-height: 22px;
+        text-align: center;
+    }
+}
+.music-user {
+    position: relative;
+    display: flex;
+    align-items: center;
+    > div {
+        width: 100%;
+        padding-right: 35px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+    }
+    span {
+        position: absolute;
+        display: block;
+        top: 50%;
+        right: 0px;
+        transform: translateY(-50%);
+        cursor: pointer;
+    }
+}
+</style>