Files
2026-09-08 19:49:21 +08:00

247 lines
8.7 KiB
Vue

<template>
<div style="padding-bottom: 20px;">
<van-form readonly input-align="right">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
基础信息
</div>
</div>
<van-cell-group>
<van-field readonly :value="viewData.username" label="姓名"></van-field>
<van-field readonly :value="viewData.loginname" label="工资号"></van-field>
<van-field readonly :value="viewData.dwname" label="单位"></van-field>
<van-field readonly :value="viewData.ghname" label="工会"></van-field>
</van-cell-group>
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
作品信息
</div>
</div>
<van-cell-group>
<van-field readonly name="type" :value="viewData.hdname" label="作品主题"></van-field>
<van-field readonly name="type" :value="viewData.hdlbname" label="活动类别"></van-field>
<van-field readonly name="type" :value="viewData.step_count" label="健步走步数"
v-if="viewData.step_count"></van-field>
<van-field readonly name="type" :value="viewData.zname" label="作品类别" v-if="viewData.zname"></van-field>
<van-field readonly :value="viewData.hdsbzpms" label="简介"
input-align="left"
style="flex-flow: column"
rows="2" maxlength="200" type="textarea" show-word-limit autosize></van-field>
<van-field label="照片" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">&emsp;&emsp;</div>
</template>
<template #input>
<vant-file-upload :files.sync="img2List" view :del="false"
v-if="img2List&&img2List.length>0"></vant-file-upload>
<div v-if="img2List.length===0" style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有照片
</div>
</template>
</van-field>
<van-field label="视频" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">&emsp;&emsp;</div>
</template>
<template #input>
<div v-if="videoList.length>0">
<div v-for="item in videoList" class="mt10">
<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto"
width="640" height="264"
data-setup="{}" webkit-playsinline='true' playsinline='true' x-webkit-airplay='true'
x5-video-player-type='h5' x5-video-player-fullscreen='true' x5-video-ignore-metadata='true'>
<source :src="item.url" type="video/mp4">
</video>
</div>
</div>
<div v-if="videoList.length===0" style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有视频
</div>
</template>
</van-field>
<van-field label="音频" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">&emsp;&emsp;</div>
</template>
<template #input>
<div v-if="audioList&&audioList.length>0">
<div v-for="audio in audioList" class="mt10">
<audio id="amusic" preload="auto" controls>
<source :src="FILE_DOMAIN+audio.url"/>
</audio>
</div>
</div>
<div style="text-align: center;color: #c2bbbb;font-size: 10px;" v-if="audioList.length===0">
没有音频
</div>
</template>
</van-field>
<van-field label="文档" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">&emsp;&emsp;</div>
</template>
<template #input>
<div v-for="(item,index) in docList" v-if="docList&&docList.length>0">
<div class="text-nowrap color-puple"
@click="previewFile(item.filepath,item.filename,docList,index,item.id)">
{{ item.filename }}
</div>
</div>
<div v-if="docList.length===0" style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有文档
</div>
</template>
</van-field>
</van-cell-group>
<template v-if="viewData.union">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
分工会审核信息
</div>
</div>
<van-cell-group>
<van-field readonly name="type" :value="viewData.union.username" label="审核人"></van-field>
<van-field label="审核时间" :value="viewData.union.auditTime" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o"
:value="viewData.union.auditOpinion ? viewData.union.auditOpinion : '暂无'"
readonly></van-field>
<van-field name="sign" label="签字">
<template #input>
<van-image width="200" height="100" :src="viewData.union.auditSign"
v-if="viewData.union.auditSign"></van-image>
<span v-else>暂无</span>
</template>
</van-field>
</van-cell-group>
</template>
<template v-if="viewData.school">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
校工会审核信息
</div>
</div>
<van-cell-group>
<van-field readonly name="type" :value="viewData.school.username" label="审核人"></van-field>
<van-field label="审核时间" :value="viewData.school.auditTime" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o"
:value="viewData.school.auditOpinion ? viewData.school.auditOpinion : '暂无'"
readonly></van-field>
<van-field name="sign" label="签字">
<template #input>
<van-image width="200" height="100" :src="viewData.school.auditSign"
v-if="viewData.school.auditSign"></van-image>
<span v-else>暂无</span>
</template>
</van-field>
</van-cell-group>
</template>
</van-form>
<template v-if="handle">
<slot name="handle"></slot>
</template>
</div>
</template>
<script>
module.exports = {
props: {
handle: {
type: Boolean,
default: false,
},
title: {
type: String,
default: '审核'
},
id: {
type: String,
default: ''
},
},
data() {
return {
viewData: {},
videoList: [],
prevImgList: [],
img2List: [],
audioList: [],
docList: [],
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg'],
doctype: ['doc', 'docx'],
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
}
},
components: {
'vant-file-upload': httpVueLoader('/components/plugins/VantFileUpload.vue')
},
methods: {
async getInfo(id) {
const {data, code, msg} = await $.get("/platform/hd/wmhd/findOneById", {id})
const refs = await $.get("/platform/hd/wmhd/findxxById", {id})
if (refs) {
this.viewData = refs.data
console.log(refs)
data.forEach(val => {
val.fjname = val.filename
val.fjurl = val.filepath
val.id = val.filepath
val.url = FILE_DOMAIN + '/fileStreamPreview?id=' + val.filepath
let filetype = val.fjname.substring(val.fjname.lastIndexOf('.') + 1, val.fjname.length).toLowerCase();
if (this.videotype.indexOf(filetype) > -1) {
this.videoList.push(val);
} else if (this.imgtype.indexOf(filetype) > -1) {
this.prevImgList.push(val.url)
this.img2List.push(val);
} else if (this.doctype.indexOf(filetype) > -1) {
this.docList.push(val);
} else if (this.audiotype.indexOf(filetype) > -1) {
this.audioList.push(val);
}
})
} else {
this.viewData = {}
this.$toast.fail('获取信息失败');
}
},
},
async created() {
}
}
</script>
<style>
.van-cell-group__title {
padding-left: 0 !important;
}
.van-sidebar-item {
font-size: 16px !important;
text-indent: 4px !important;
}
.van-sidebar-item--select::before {
left: 5px !important;
}
</style>