refactor:国际化等

This commit is contained in:
wangjiahao 2021-11-09 16:23:50 +08:00
parent c6aa9af3e7
commit 0c9c0dec48
7 changed files with 83 additions and 27 deletions

View File

@ -42,6 +42,7 @@
"tinymce": "^5.8.2",
"umy-ui": "^1.1.6",
"vcolorpicker": "^1.1.0",
"videojs-flash": "^2.2.1",
"vue": "2.6.10",
"vue-axios": "3.2.4",
"vue-clipboard2": "0.3.1",

View File

@ -2,25 +2,32 @@
<el-popover
ref="popover"
width="340"
width="400"
trigger="click"
>
<el-row>
<el-form ref="form" size="mini" label-width="70px">
<el-form-item :label="'自动播放'">
<el-switch v-model="linkInfoTemp.autoplay" size="mini" />
<span v-show="linkInfoTemp.autoplay" style="color: #909399; font-size: 8px;margin-left: 3px">
<!-- Tips:{{ $t('panel.link_open_tips') }}-->
<!-- <el-form-item :label="$t('panel.video_type')">-->
<!-- <el-radio-group v-model="linkInfoTemp.videoType">-->
<!-- <el-radio :label="'web'">{{$t('panel.online_video')}}</el-radio>-->
<!--&lt;!&ndash; <el-radio :label="'hls'">HLS 直播</el-radio>&ndash;&gt;-->
<!-- <el-radio :label="'rtmp'">{{$t('panel.streaming_media')}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item :label="$t('panel.auto_play')">
<el-switch v-model="linkInfoTemp[linkInfoTemp.videoType].autoplay" size="mini" />
<span style="color: #909399; font-size: 8px;margin-left: 3px">
Tips:{{ $t('panel.video_tips') }}
</span>
</el-form-item>
<el-form-item :label="$t('panel.open_mode')">
<el-radio-group v-model="linkInfoTemp.loop">
<el-radio :label="false">播放一次</el-radio>
<el-radio :label="true">循环播放</el-radio>
<el-form-item v-if="linkInfoTemp.videoType==='web'" :label="$t('panel.play_frequency')">
<el-radio-group v-model="linkInfoTemp[linkInfoTemp.videoType].loop">
<el-radio :label="false">{{ $t('panel.play_once') }}</el-radio>
<el-radio :label="true">{{ $t('panel.play_circle') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('panel.hyperLinks')">
<el-input v-model="linkInfoTemp.sources[0].src" />
<el-form-item :label="$t('panel.video_links')">
<el-input v-model="linkInfoTemp[linkInfoTemp.videoType].sources[0].src" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">{{ $t('panel.confirm') }}</el-button>

View File

@ -1,6 +1,6 @@
<template>
<el-row ref="mainPlayer">
<div v-if="this.element.videoLinks.sources[0].src" class="player">
<div v-if="this.element.videoLinks[this.element.videoLinks.videoType].sources[0].src" class="player">
<video-player
ref="videoPlayer"
class="vjs-custom-skin"
@ -20,7 +20,7 @@
/>
</div>
<div v-else class="info-class">
请点击添加配置视频信息...
{{ $t('panel.video_add_tips') }}
</div>
</el-row>
</template>
@ -29,6 +29,7 @@
// custom skin css
import '@/custom-theme.css'
import { mapState } from 'vuex'
// import SWF_URL from 'videojs-swf/dist/video-js.swf'
export default {
props: {
@ -65,13 +66,15 @@ export default {
return this.$refs.videoPlayer.player
},
playerOptions() {
const videoLinks = this.element.videoLinks
const videoPlayerOptions = this.element.videoLinks[this.element.videoLinks.videoType]
let playHeight = this.h
if (this.canvasStyleData.panel.gap) {
playHeight = this.h - (this.componentGap * 2)
}
videoLinks.height = playHeight
return videoLinks
videoPlayerOptions.height = playHeight
console.log('videoPlayerOptions:' + JSON.stringify(videoPlayerOptions))
return videoPlayerOptions
},
...mapState([
'componentGap',

View File

@ -23,15 +23,31 @@ export const HYPERLINKS = {
// 视频信息配置
export const VIDEOLINKS = {
autoplay: true,
muted: true,
loop: true,
language: 'zh',
controlBar: {
fullscreenToggle: false
videoType: 'web',
web: {
autoplay: true,
muted: true,
loop: true,
controlBar: {
fullscreenToggle: false
},
sources: [{
}]
},
sources: [{
}]
rtmp: {
sources: [{
type: 'rtmp/mp4'
}],
techOrder: ['flash'],
autoplay: false,
controls: true,
flash: {
hls: {
withCredentials: false
}
}
}
}
export const assistList = [

View File

@ -1385,7 +1385,17 @@ export default {
add_jump_field: 'Add Jump Field',
input_jump_link: 'Input Jump Link',
select_dimension: 'Select Dimension...',
please_select: 'Please Select'
please_select: 'Please Select',
video_type: 'Video Type',
online_video: 'Online Video',
streaming_media: 'Streaming Media',
auto_play: 'Auto Play',
video_tips: 'Video Tips',
play_frequency: 'Play Frequency',
play_once: 'Once',
play_circle: 'Circle',
video_links: 'Video Links',
video_add_tips: 'Please Add Video Info...'
},
plugin: {
local_install: 'Local installation',

View File

@ -1388,7 +1388,17 @@ export default {
add_jump_field: '追加跳转联动依赖字段',
input_jump_link: '请输入跳转连接',
select_dimension: '请选择维度...',
please_select: '请选择'
please_select: '请选择',
video_type: '视频类型',
online_video: '在线视频',
streaming_media: '流媒体',
auto_play: '自动播放',
video_tips: '非HTTPS链接可能导致无法播放',
play_frequency: '播放频率',
play_once: '播放一次',
play_circle: '循环播放',
video_links: '视频链接',
video_add_tips: '请点击添加配置视频信息...'
},
plugin: {
local_install: '本地安裝',

View File

@ -1398,7 +1398,16 @@ export default {
add_jump_field: '追加跳转联动依赖字段',
input_jump_link: '请输入跳转连接',
select_dimension: '请选择维度...',
please_select: '请选择'
video_type: '视频类型',
online_video: '在线视频',
streaming_media: '流媒体',
auto_play: '自动播放',
video_tips: '非HTTPS链接可能导致无法播放',
play_frequency: '播放频率',
play_once: '播放一次',
play_circle: '循环播放',
video_links: '视频链接',
video_add_tips: '请点击添加配置视频信息...'
},
plugin: {
local_install: '本地安装',