<template>
|
<div>
|
<!--头部按钮-->
|
<div class="avue-crud__menu">
|
<!-- 头部左侧按钮模块 -->
|
<div class="avue-crud__left">
|
<el-button size="small" class="button" icon="el-icon-back" @click="backModules">返回模块列表</el-button>
|
</div>
|
</div>
|
<div class="content-view">
|
<div v-if="currentIndex==1" class="start">
|
<img class="start-img" :src="startPage.fileUrl[0].value">
|
<div class="start-button-group">
|
<el-button size="small" v-for="data in contentFunList" :index="data.id" :key="data.id" @click="jumpToContent(data)">
|
{{ data.name }}
|
</el-button>
|
</div>
|
</div>
|
|
<div style="height: 100%;width: 100%" v-if="currentIndex==2" class="content">
|
|
<!--flash-->
|
<div v-if="content.type == 1">
|
|
</div>
|
|
<!--图册-->
|
<Flipbook v-if="content.type == 2" class="flipbook"
|
:pages="flipConfig.pages"
|
:startPage="flipConfig.pageNum"
|
v-slot="flipbook"
|
ref="flipbook">
|
<div class="action-bar">
|
<left-icon
|
class="btn left"
|
:class="{ disabled: !flipbook.canFlipLeft }"
|
@click="flipbook.flipLeft"
|
/>
|
<plus-icon
|
class="btn plus"
|
:class="{ disabled: !flipbook.canZoomIn }"
|
@click="flipbook.zoomIn"
|
/>
|
<span class="page-num">
|
Page {{ flipbook.page }} of {{ flipbook.numPages }}
|
</span>
|
<minus-icon
|
class="btn minus"
|
:class="{ disabled: !flipbook.canZoomOut }"
|
@click="flipbook.zoomOut"
|
/>
|
<right-icon
|
class="btn right"
|
:class="{ disabled: !flipbook.canFlipRight }"
|
@click="flipbook.flipRight"
|
/>
|
</div>
|
</Flipbook>
|
|
<!--视频-->
|
<iframe v-if="content.type == 3" style="height: 100%;width: 100%" class="view-iframe" :src="iframePath"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
</template>
|
|
<script>
|
import {getAll} from "@/api/modules/function";
|
// import Flipbook from 'flipbook-vue/vue2'
|
import LeftIcon from 'vue-material-design-icons/ChevronLeftCircle'
|
import RightIcon from 'vue-material-design-icons/ChevronRightCircle'
|
import PlusIcon from 'vue-material-design-icons/PlusCircle'
|
import MinusIcon from 'vue-material-design-icons/MinusCircle'
|
|
export default {
|
name: "modulesView",
|
props:['modules'],
|
components: {LeftIcon, RightIcon, PlusIcon, MinusIcon},
|
data() {
|
return {
|
funList:[],
|
startPage:{},
|
contentFunList:[],
|
endPage:[],
|
currentIndex:1,
|
content:{},
|
iframePath:"",
|
flipConfig: {
|
pages: [
|
'http://dev.jxpskj.com:9000/multimedia/upload/20230316/4de7aac224ce2a8f4ed8b025740405d4.png'
|
],
|
pagesHiRes: [],
|
hasMouse: true,
|
pageNum: null,
|
},
|
}
|
},
|
mounted() {
|
this.getAllFunc()
|
},
|
methods: {
|
//返回模块列表页
|
backModules() {
|
this.$emit('backModules')
|
},
|
//获取当前模块id下的所有子功能
|
getAllFunc() {
|
let params = {
|
modulesId: this.modules.id
|
}
|
getAll(params).then(res => {
|
if (res.data.code == 200) {
|
let data = res.data.data
|
this.funList = data
|
data.forEach(e=>{
|
if (e.property == 1){
|
this.startPage = e
|
}else if (e.property == 2){
|
this.contentFunList.push(e)
|
}else if (e.property == 3){
|
this.endPage = e
|
}
|
})
|
}
|
})
|
},
|
jumpToContent(data){
|
this.currentIndex = 2
|
this.content = data
|
if (data.type == 1) {
|
|
} else if (data.type == 2) {
|
let fileArray = data.fileUrl
|
fileArray.forEach(e => {
|
this.flipConfig.pages.push(e.value)
|
})
|
} else if (data.type == 3) {
|
let url = data.fileUrl[0].value
|
this.iframePath = 'http://192.168.0.200:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
|
}
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.content-view{
|
width: 100%;
|
height: 77vh;
|
}
|
|
.start{
|
width: 100%;
|
height: 100%;
|
}
|
|
.start-img, .end-img {
|
width: 100%;
|
height: 100%;
|
}
|
|
.start-button-group {
|
position: relative;
|
top: -25%;
|
left: 42%;
|
}
|
</style>
|