|
|
@@ -0,0 +1,215 @@
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ title="视频配置"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :append-to-body="true"
|
|
|
+ width="50%"
|
|
|
+ v-if="visible"
|
|
|
+ @close="closeDialog"
|
|
|
+ :visible.sync="visible">
|
|
|
+ <el-form :model="dataForm" size="small" label-width="100px">
|
|
|
+ <el-divider>基础配置</el-divider>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="屏幕方向" prop="screenOrientation">
|
|
|
+ <el-radio-group v-model="dataForm.screenOrientation">
|
|
|
+ <el-radio label="landscape">横屏展示</el-radio>
|
|
|
+ <el-radio label="portrait">竖屏展示</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-divider>视频配置</el-divider>
|
|
|
+ <el-row
|
|
|
+ v-if="videoList"
|
|
|
+ v-for="(video, videoIndex) in videoList">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="选择视频资源" prop="newReceiverInfo">
|
|
|
+ <el-select
|
|
|
+ size="large"
|
|
|
+ style="width: 300px"
|
|
|
+ v-model="video.videoId"
|
|
|
+ placeholder="请选择资源"
|
|
|
+ :remote-method="getAssetsListByName"
|
|
|
+ @change="handleChange"
|
|
|
+ clearable filterable remote>
|
|
|
+ <el-option
|
|
|
+ style="height: 156px"
|
|
|
+ v-for="assets in assetsList"
|
|
|
+ :key="assets.assetsId"
|
|
|
+ :label="assets.assetsName"
|
|
|
+ :value="assets.assetsId">
|
|
|
+ <span style="float: left; height: 104px; line-height: 156px">{{ assets.assetsName }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 13px">
|
|
|
+ <video
|
|
|
+ :src="resourcesUrl + assets.assetsUrl"
|
|
|
+ controls="controls"
|
|
|
+ style="width: 111px; height: 156px"
|
|
|
+ />
|
|
|
+ </span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span>{{video.videoName}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-button size="medium" type="danger" @click.prevent="removeVideo(videoIndex)">删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-button size="medium" type="primary" @click="addVideo">新增视频</el-button>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button class="default-btn" @click="visible = false">{{$t("crud.filter.cancelBtn")}}</el-button>
|
|
|
+ <el-button class="default-btn primary-btn" type="primary" @click="dataFormSubmit()">{{$t("crud.filter.submitBtn")}}</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ assetsList:[],
|
|
|
+ prodId: null,
|
|
|
+ videoList: [],
|
|
|
+ resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
|
|
|
+ dataForm:{
|
|
|
+ issueId: null,
|
|
|
+ assetsType: null,
|
|
|
+ screenOrientation: null,
|
|
|
+ assetsPackageObj:{
|
|
|
+ frameUrl: null,
|
|
|
+ videoList: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ handleChange(value){
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl('/ar/arAssets/info/' + value),
|
|
|
+ method: 'get'
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.assetsList = data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ init (issuePicId, issueId) {
|
|
|
+ this.dataForm.issuePicId = issuePicId || null
|
|
|
+ this.dataForm.issueId = issueId || null
|
|
|
+ this.visible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.dataForm.issuePicId) {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl('/ar/arIssuePicAssetsConfig/infoByPicId/' + this.dataForm.issuePicId),
|
|
|
+ method: 'get',
|
|
|
+ params: this.$http.adornParams()
|
|
|
+ }).then(({data}) => {
|
|
|
+ if(data){
|
|
|
+ this.dataForm.issueId = data.issueId
|
|
|
+ this.dataForm.issuePicId = data.issuePicId
|
|
|
+ this.dataForm.configId = data.configId
|
|
|
+ this.dataForm.assetsType = data.assetsType
|
|
|
+ this.dataForm.screenOrientation = data.screenOrientation
|
|
|
+ this.dataForm.assetsPackageObj = data.assetsPackageObj
|
|
|
+ this.videoList = data.assetsPackageObj.videoList
|
|
|
+ if(this.videoList.length > 0){
|
|
|
+ this.getAssetsListById(this.dataForm.issueId, this.videoList[0].videoId)
|
|
|
+ }else{
|
|
|
+ this.getAssetsListById(this.dataForm.issueId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
+ dataFormSubmit () {
|
|
|
+ let url = '/ar/arIssuePicAssetsConfig/saveConfig'
|
|
|
+ if(this.dataForm.configId){
|
|
|
+ url = '/ar/arIssuePicAssetsConfig/updateConfig'
|
|
|
+ }
|
|
|
+ this.dataForm.assetsPackageObj.videoList = this.videoList
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(url),
|
|
|
+ method: 'post',
|
|
|
+ data: this.$http.adornData(this.dataForm)
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.$message({
|
|
|
+ message: this.$i18n.t('publics.operation'),
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.closeDialog()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getAssetsListByName(assetsName){
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl('/ar/arAssets/listByName'),
|
|
|
+ method: 'get',
|
|
|
+ params: this.$http.adornParams({assetsName: assetsName})
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.assetsList = data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getAssetsListById(issueId, assetsId){
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl('/ar/arAssets/listByName'),
|
|
|
+ method: 'get',
|
|
|
+ params: this.$http.adornParams({issueId: this.dataForm.issueId, assetsId: assetsId})
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.assetsList = data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addVideo(){
|
|
|
+ if(!this.videoList){
|
|
|
+ this.videoList = []
|
|
|
+ }
|
|
|
+ this.videoList.push({
|
|
|
+ videoId: null
|
|
|
+ });
|
|
|
+ this.getAssetsListById();
|
|
|
+ },
|
|
|
+ removeVideo(videoIndex){
|
|
|
+ this.videoList.splice(videoIndex, 1)
|
|
|
+ },
|
|
|
+ addOptions(videoIndex){
|
|
|
+ const video = this.videoList[videoIndex]
|
|
|
+ const endOption = {optionName: '', jumpToVideoId: null}
|
|
|
+ if(video.endOptions){
|
|
|
+ let endOptions = video.endOptions
|
|
|
+ endOptions.push(endOption)
|
|
|
+ this.$set(this.videoList[videoIndex], "endOptions", endOptions);
|
|
|
+ }else{
|
|
|
+ let endOptions = [endOption]
|
|
|
+ this.$set(this.videoList[videoIndex], "endOptions", endOptions);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ removeOptions(assetsIndex, optionIndex){
|
|
|
+ let video = this.videoList[assetsIndex]
|
|
|
+ video.endOptions.splice(optionIndex, 1)
|
|
|
+ },
|
|
|
+ closeDialog(){
|
|
|
+ this.visible = false
|
|
|
+ this.videoList = []
|
|
|
+ this.dataForm = {
|
|
|
+ assetsType: null,
|
|
|
+ screenOrientation: null,
|
|
|
+ assetsPackageObj:{
|
|
|
+ frameUrl: null,
|
|
|
+ videoList: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|