930 lines
39 KiB
HTML
930 lines
39 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
<style>
|
|
|
|
.tpa {
|
|
padding: 10px;
|
|
text-align: center;
|
|
width: 12%;
|
|
color: #a0a9b4;
|
|
background-color: rgb(250, 250, 250);
|
|
border: 1px solid rgb(220, 220, 220);
|
|
}
|
|
|
|
.tpb {
|
|
padding: 10px;
|
|
text-align: center;
|
|
color: #4f576b;
|
|
width: 15%;
|
|
border: 1px solid rgb(220, 220, 220);
|
|
}
|
|
|
|
input[type=file] {
|
|
display: none;
|
|
}
|
|
|
|
.filedialog .el-dialog__header i {
|
|
font-size: 30px;
|
|
}
|
|
|
|
.filedialog .el-dialog__body {
|
|
padding: 20px 0 0 0;
|
|
}
|
|
|
|
/*video{
|
|
width: 100%!important;
|
|
height: 500px!important;
|
|
outline:none;
|
|
}*/
|
|
.video-js {
|
|
width: 100%;
|
|
height: 450px;
|
|
outline: none;
|
|
}
|
|
|
|
.vjs-tech, .video-js button {
|
|
outline: none;
|
|
}
|
|
|
|
#app .el-table th.gutter {
|
|
display: table-cell !important
|
|
}
|
|
|
|
.filedialog .el-dialog {
|
|
min-height: 500px;
|
|
}
|
|
|
|
|
|
.video-js .vjs-big-play-button { /* 中间大的播放按钮 */
|
|
font-size: 2.5em;
|
|
line-height: 2.3em;
|
|
height: 2.5em;
|
|
width: 2.5em;
|
|
-webkit-border-radius: 2.5em;
|
|
-moz-border-radius: 2.5em;
|
|
border-radius: 2.5em;
|
|
background-color: rgba(115, 133, 159, .5);
|
|
border-width: 0.12em;
|
|
margin-top: -1.25em;
|
|
margin-left: -1.75em;
|
|
}
|
|
|
|
.video-js.vjs-paused .vjs-big-play-button { /* 视频暂停时显示播放按钮 */
|
|
display: block;
|
|
}
|
|
|
|
.video-js.vjs-error .vjs-big-play-button { /* 视频加载出错时隐藏播放按钮 */
|
|
display: none;
|
|
}
|
|
|
|
.vjs-loading-spinner { /* 加载圆圈 */
|
|
font-size: 2.5em;
|
|
width: 2em;
|
|
height: 2em;
|
|
border-radius: 1em;
|
|
margin-top: -1em;
|
|
margin-left: -1.5em;
|
|
}
|
|
|
|
.el-image {
|
|
margin-right: 10px;
|
|
}
|
|
|
|
.el-divider__text {
|
|
color: #abc5df;
|
|
}
|
|
|
|
.el-divider {
|
|
background-color: #e5edf6;
|
|
}
|
|
|
|
.view-myvideo-tab {
|
|
width: 100px;
|
|
height: 100px;
|
|
background-color: #C0C4CC;
|
|
text-align: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.video-toggle-i:hover .el-icon-video-camera-solid {
|
|
display: none;
|
|
}
|
|
|
|
.video-toggle-i:hover .el-icon-video-play {
|
|
display: inline-block;
|
|
}
|
|
|
|
|
|
.view-myvideo-tab .el-icon-video-camera-solid, .view-myvideo-tab .el-icon-video-play, .view-myvideo-tab .el-icon-document {
|
|
color: #000000;
|
|
line-height: 80px;
|
|
font-size: 40px;
|
|
}
|
|
|
|
|
|
.view-myvideo-tab .el-icon-download {
|
|
width: 100px;
|
|
}
|
|
|
|
.el-icon-video-play {
|
|
display: none;
|
|
}
|
|
|
|
.ckdialogclass .el-dialog__body {
|
|
padding-top: 10px;
|
|
}
|
|
|
|
.el-icon-download {
|
|
color: white;
|
|
}
|
|
|
|
.file-down-span {
|
|
background: black;
|
|
opacity: 0.5;
|
|
z-index: 1000;
|
|
width: 100px;
|
|
text-align: center;
|
|
/*position: absolute;*/
|
|
position: relative;
|
|
bottom: -100px;
|
|
|
|
cursor: pointer;
|
|
}
|
|
|
|
.file-down-span:hover {
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.ckdialogclass .el-icon-circle-close {
|
|
color: white;
|
|
}
|
|
|
|
.form-item-container {
|
|
display: flex;
|
|
}
|
|
|
|
.form-item-container .el-form-item {
|
|
width: 50%;
|
|
}
|
|
|
|
.el-upload--picture-card {
|
|
width: 100px;
|
|
height: 100px;
|
|
line-height: 98px;
|
|
}
|
|
|
|
.el-upload-list--picture-card .el-upload-list__item {
|
|
width: 100px;
|
|
height: 100px;
|
|
}
|
|
|
|
.el-loading-mask.is-fullscreen .el-loading-spinner {
|
|
font-size: 40px;
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
<link rel="stylesheet" href="${base!}/assets/platform/plugins/video/css/video-js.min.css">
|
|
<script src="${base!}/assets/platform/plugins/video/js/video.min.js"></script>
|
|
<div id="app" v-cloak>
|
|
<guava ref="guava">
|
|
<template>
|
|
<el-card shadow="never">
|
|
<div class="btn-group tool-button mt5">
|
|
<el-date-picker v-model="pageForm.year"
|
|
placeholder="年度"
|
|
type="year"
|
|
@change="yearChange"
|
|
value-format="yyyy"></el-date-picker>
|
|
</div>
|
|
<div class="btn-group tool-button mt5">
|
|
<el-select v-model="pageForm.hdid" clearable @change="hdchange"
|
|
placeholder="请选择活动主题">
|
|
<el-option v-for="o in hdxxlist" :label="o.label"
|
|
:value="o.value"></el-option>
|
|
</el-select>
|
|
</div>
|
|
|
|
<div class="btn-group tool-button mt5">
|
|
<el-select v-model="pageForm.hdlb" placeholder="请选择活动类别" clearable
|
|
@change="hdlbchange">
|
|
<el-option v-for="o in hdlblist" :label="o.lname"
|
|
:value="o.lid"></el-option>
|
|
</el-select>
|
|
</div>
|
|
|
|
<div class="btn-group tool-button mt5">
|
|
<el-select v-model="pageForm.zplb" placeholder="请选择作品类型" clearable>
|
|
<el-option v-for="o in hdzplblist" :label="o.zname"
|
|
:value="o.zid"></el-option>
|
|
</el-select>
|
|
</div>
|
|
|
|
<div class="btn-group tool-button mt5">
|
|
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
|
</div>
|
|
|
|
|
|
</el-card>
|
|
|
|
<el-card class="mt20" shadow="never">
|
|
<vi-title2 title="作品列表">
|
|
<template #func>
|
|
<el-button @click="openAdd" type="primary" size="small">上传作品</el-button>
|
|
</template>
|
|
</vi-title2>
|
|
<el-table :data="tableData">
|
|
<el-table-column label="序号" type="index" header-align="center" align="center"
|
|
width="50">
|
|
<template scope="scope">
|
|
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="hdname" label="活动主题" header-align="center" align="center"
|
|
show-overflow-tooltip></el-table-column>
|
|
<!-- <el-table-column prop="hdsbzpzt" label="作品主题" header-align="center" align="center"-->
|
|
<!-- show-overflow-tooltip></el-table-column>-->
|
|
<el-table-column prop="sbrname" label="教职工姓名" header-align="center"
|
|
align="center"
|
|
show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="loginname" label="工资号" header-align="center"
|
|
align="center"
|
|
show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="dwname" label="单位" header-align="center" align="center"
|
|
show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="ghname" label="分工会" header-align="center" align="center"
|
|
show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="hdlbname" label="活动类别" header-align="center"
|
|
align="center"
|
|
show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="zplbname" label="作品类别" header-align="center" align="center"
|
|
show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="hdsbsj" label="上传时间" header-align="center" align="center"
|
|
show-overflow-tooltip>
|
|
</el-table-column>
|
|
<el-table-column align="center" prop="auditState" header-align="center"
|
|
label="申请状态" sortable>
|
|
<template scope="scope">
|
|
<span :style="'color:'+scope.row.statecolor">{{scope.row.statename}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" header-align="center" align="center" width="300">
|
|
<template slot-scope="scope">
|
|
<el-button size="mini" @click="viewInfo(scope)">查看</el-button>
|
|
<!-- v-if="scope.row.auditstate==='3999'||scope.row.auditstate==='4100'||scope.row.auditstate==='4250'"-->
|
|
<el-button
|
|
|
|
type="primary" size="mini"
|
|
@click="openEdit(scope)">
|
|
编辑
|
|
</el-button>
|
|
<el-button v-if="scope.row.auditstate==='3999'" type="danger"
|
|
size="mini"
|
|
@click="dodelete(scope.row.id)">删除
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<el-row class="el-pagination-container">
|
|
<el-pagination
|
|
@size-change="pageSizeChange"
|
|
@current-change="pageNumberChange"
|
|
:current-page="pageForm.pageNumber"
|
|
:page-sizes="[10, 20, 30, 50]"
|
|
:page-size="pageForm.pageSize"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
:total="pageForm.totalCount">
|
|
</el-pagination>
|
|
</el-row>
|
|
</el-card>
|
|
|
|
|
|
</template>
|
|
|
|
<template #edit>
|
|
<el-form :model="AddFormData" label-width="120px" :rules="rules" ref="AddForm">
|
|
<el-divider content-position="left">基本信息</el-divider>
|
|
<div class="form-item-container">
|
|
<el-form-item prop="loginname" label="工资号">
|
|
<el-input value="${@shiro.getPrincipalProperty('loginname')}"
|
|
readonly></el-input>
|
|
</el-form-item>
|
|
<el-form-item prop="username" label="姓名">
|
|
<el-input value="${@shiro.getPrincipalProperty('username')}"
|
|
readonly></el-input>
|
|
</el-form-item>
|
|
</div>
|
|
<div class="form-item-container">
|
|
<el-form-item prop="ghname" label="所属工会">
|
|
<el-input v-model="currentUserGhname" readonly></el-input>
|
|
</el-form-item>
|
|
<el-form-item prop="mobile" label="手机号码">
|
|
<el-input v-model="AddFormData.mobile"></el-input>
|
|
</el-form-item>
|
|
</div>
|
|
<el-divider content-position="left">活动信息</el-divider>
|
|
<div class="form-item-container">
|
|
<el-form-item prop="hdid" label="活动主题">
|
|
<el-select v-model="AddFormData.hdid" style="width: 100%"
|
|
@change="formhdchange">
|
|
<el-option v-for="o in formhdxxlist" :label="o.hdname" :value="o.hdid"
|
|
:key="o.hdid">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item prop="hdzplx" label="活动类别">
|
|
<el-select v-model="AddFormData.hdzplx" style="width: 100%"
|
|
@change="formhdlbchange">
|
|
<el-option v-for="o in formhdlblist" :label="o.lname"
|
|
:value="o.lid"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</div>
|
|
<div class="form-item-container">
|
|
|
|
<!-- <el-form-item prop="step_count" label="健步走步数">
|
|
<el-input-number style="width: 100%" v-model="AddFormData.step_count"></el-input-number>
|
|
</el-form-item>-->
|
|
<el-form-item prop="hdzplx2" label="类别">
|
|
<el-select v-model="AddFormData.hdzplx2" style="width: 100%"
|
|
@change="changeHdzplx2">
|
|
<el-option v-for="o in formhdzplblist" :label="o.zname" :value="o.zid"
|
|
:key="o.zid"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item prop="zpmc" label="标题">
|
|
<el-input v-model="AddFormData.zpmc"></el-input>
|
|
</el-form-item>
|
|
</div>
|
|
<el-form-item prop="hdsbzpms" label="作品描述/介绍">
|
|
<el-input type="textarea" v-model="AddFormData.hdsbzpms"
|
|
:maxlength="zplb2Config.maxWordCount" show-word-limit></el-input>
|
|
</el-form-item>
|
|
<div v-if="zplb2Config.isUploadPhoto||zplb2Config.isUploadOther">
|
|
<el-divider content-position="left">作品信息</el-divider>
|
|
<el-form-item label="照片" required v-if="zplb2Config.isUploadPhoto">
|
|
<el-upload
|
|
name="picturefile"
|
|
:file-list="picturelist"
|
|
:auto-upload="false"
|
|
action=""
|
|
list-type="picture-card"
|
|
:limit="zplb2Config.photoNum"
|
|
:on-exceed="pictureExceed"
|
|
:on-change="pictureChange">
|
|
<i class="el-icon-plus"></i>
|
|
</el-upload>
|
|
</el-form-item>
|
|
<el-form-item label="音/视频、文档" v-if="zplb2Config.isUploadOther">
|
|
<el-upload
|
|
name="vadfile"
|
|
:file-list="vadlist"
|
|
:auto-upload="false"
|
|
action=""
|
|
:limit="zplb2Config.otherFileNum"
|
|
:on-exceed="vadExceed"
|
|
:on-change="vadChange">
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
</el-upload>
|
|
</el-form-item>
|
|
</div>
|
|
|
|
</el-form>
|
|
<div style="float: right;margin: 20px 0">
|
|
<el-button @click="doAdd(false)">保 存</el-button>
|
|
<el-button type="primary" @click="doAdd(true)">提 交</el-button>
|
|
</div>
|
|
</template>
|
|
|
|
<template #view>
|
|
<info ref="info" @playvideo="playvideo"></info>
|
|
</template>
|
|
|
|
<template #public>
|
|
<el-form :model="EditFormData" label-width="120px" :rules="rules" ref="EditForm">
|
|
<el-divider content-position="left">基本信息</el-divider>
|
|
<div class="form-item-container">
|
|
<el-form-item prop="loginname" label="工资号">
|
|
<el-input value="${@shiro.getPrincipalProperty('loginname')}"
|
|
readonly></el-input>
|
|
</el-form-item>
|
|
<el-form-item prop="username" label="姓名">
|
|
<el-input value="${@shiro.getPrincipalProperty('username')}"
|
|
readonly></el-input>
|
|
</el-form-item>
|
|
</div>
|
|
<div class="form-item-container">
|
|
<el-form-item prop="ghname" label="所属工会">
|
|
<el-input v-model="currentUserGhname" readonly></el-input>
|
|
</el-form-item>
|
|
<el-form-item prop="mobile" label="手机号码">
|
|
<el-input v-model="EditFormData.mobile"></el-input>
|
|
</el-form-item>
|
|
</div>
|
|
<el-divider content-position="left">活动信息</el-divider>
|
|
|
|
<div class="form-item-container">
|
|
<el-form-item prop="hdid" label="活动主题">
|
|
<el-select v-model="EditFormData.hdid" style="width: 100%"
|
|
@change="formhdchange">
|
|
<el-option v-for="o in formhdxxlist" :label="o.hdname" :value="o.hdid"
|
|
:key="o.hdid">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item prop="hdzplx" label="活动类别">
|
|
<el-select v-model="EditFormData.hdzplx" style="width: 100%"
|
|
@change="formhdlbchange">
|
|
<el-option v-for="o in formhdlblist" :label="o.lname"
|
|
:value="o.lid"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</div>
|
|
<div class="form-item-container">
|
|
<el-form-item prop="hdzplx2" label="类别"
|
|
v-if="formhdzplblist&&formhdzplblist.length>0">
|
|
<el-select v-model="EditFormData.hdzplx2" style="width: 100%"
|
|
@change="changeHdzplx2">
|
|
<el-option v-for="o in formhdzplblist" :label="o.zname" :value="o.zid"
|
|
:key="o.zid"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item prop="zpmc" label="标题">
|
|
<el-input v-model="EditFormData.zpmc"></el-input>
|
|
</el-form-item>
|
|
</div>
|
|
<el-form-item prop="hdsbzpms" label="作品描述/介绍">
|
|
<el-input type="textarea" v-model="EditFormData.hdsbzpms"
|
|
:maxlength="zplb2Config.maxWordCount" show-word-limit></el-input>
|
|
</el-form-item>
|
|
<div v-if="zplb2Config.isUploadPhoto||zplb2Config.isUploadOther">
|
|
<el-divider content-position="left">作品信息</el-divider>
|
|
<el-form-item label="照片" required v-if="zplb2Config.isUploadPhoto">
|
|
<el-upload
|
|
name="picturefile"
|
|
:file-list="picturelist"
|
|
:auto-upload="false"
|
|
action=""
|
|
list-type="picture-card"
|
|
:limit="zplb2Config.photoNum"
|
|
:on-remove="pictureRemove"
|
|
:on-exceed="pictureExceed"
|
|
:on-change="pictureChange">
|
|
<i class="el-icon-plus"></i>
|
|
</el-upload>
|
|
</el-form-item>
|
|
<el-form-item label="音/视频、文档" v-if="zplb2Config.isUploadOther">
|
|
<el-upload
|
|
name="vadfile"
|
|
:file-list="vadlist"
|
|
:auto-upload="false"
|
|
action=""
|
|
:limit="zplb2Config.otherFileNum"
|
|
:on-remove="vadRemove"
|
|
:on-change="vadChange">
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
</el-upload>
|
|
</el-form-item>
|
|
</div>
|
|
|
|
</el-form>
|
|
<div style="float: right;margin: 20px 0">
|
|
<el-button @click="doEdit(false)">保 存</el-button>
|
|
<el-button type="primary" @click="doEdit(true)">提 交</el-button>
|
|
</div>
|
|
</template>
|
|
|
|
</guava>
|
|
|
|
|
|
<el-dialog :visible.sync="fileDialogVisible" class="filedialog" @close="filedialogClose"
|
|
:close-on-click-modal="false">
|
|
<div id="videoContainer"></div>
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
const vue = new Vue({
|
|
el: "#app",
|
|
mixins: [initTableMixins],
|
|
data() {
|
|
return {
|
|
hdid: GetQueryString("hdid"),
|
|
editDialogVisible: false,
|
|
picturelist: [],
|
|
PicturedialogVisible: false,
|
|
vadlist: [],
|
|
currentUserGhname: '',
|
|
currenttime: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
hasSuperAdminRole: "${@shiro.hasRole('sysadmin')}" === 'true' ? true : false,
|
|
tableData: [],
|
|
pageForm: {
|
|
year: new Date().getFullYear() + '',
|
|
hdid: '',
|
|
hdlb: '',
|
|
zplb: '',
|
|
searchName: '',
|
|
searchKeyword: '',
|
|
pageNumber: 1,
|
|
pageSize: 10,
|
|
totalCount: 0,
|
|
},
|
|
videoSrc: '',
|
|
viewDialogVisible: false,
|
|
fileDialogVisible: false,
|
|
imgSrc: '',
|
|
fileList: [],
|
|
viewData: {},
|
|
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
|
|
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg'],
|
|
doctype: ['doc', 'docx', 'xlsx', 'xls', 'txt'],
|
|
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
|
|
prevImgList: [],
|
|
img2List: [],
|
|
videoList: [],
|
|
docList: [],
|
|
audioList: [],
|
|
hdxxlist: [],
|
|
hdlblist: [],
|
|
hdzplblist: [],
|
|
addDialogVisible: false,
|
|
AddFormData: {},
|
|
formhdlblist: [],
|
|
formhdzplblist: [],
|
|
rules: {
|
|
hdid: [{required: true, message: '请选择活动主题', trigger: ['blur', 'change']}],
|
|
hdzplx: [{required: true, message: '请选择活动类别', trigger: ['blur', 'change']}],
|
|
hdzplx2: [{required: true, message: '请选择作品类别', trigger: ['blur', 'change']}],
|
|
zpmc: [{required: true, message: '请填写作品类别', trigger: ['blur', 'change']}],
|
|
hdsbzpzt: [{required: true, message: '请填写作品主题', trigger: ['blur', 'change']}],
|
|
},
|
|
EditFormData: {},
|
|
readytodelfile: [],
|
|
formhdxxlist: [],
|
|
yearActivityList: [],
|
|
zplb2Config: {},
|
|
}
|
|
},
|
|
components: {
|
|
'info': httpVueLoader('/components/hd/hdwmInfo.vue'),
|
|
},
|
|
methods: {
|
|
|
|
changeHdzplx2(id) {
|
|
this.zplb2Config = this.formhdzplblist.find(v => v.zid === id)
|
|
},
|
|
yearChange(val) {
|
|
let activityList = []
|
|
if (val === null) {
|
|
this.yearActivityList.map(v => {
|
|
activityList = activityList.concat(v.children)
|
|
})
|
|
} else {
|
|
let enen = this.yearActivityList.filter(v => v.value == val)
|
|
enen.map(v => {
|
|
activityList = activityList.concat(v.children)
|
|
})
|
|
}
|
|
|
|
this.hdxxlist = activityList
|
|
this.$set(this.pageForm, "hdid", null)
|
|
this.$set(this.pageForm, "hdlb", null)
|
|
this.$set(this.pageForm, "zplb", null)
|
|
},
|
|
formhdchange(id) {
|
|
this.$set(this.AddFormData, 'hdzplx', null);
|
|
this.$set(this.AddFormData, 'hdzplx2', null);
|
|
this.$set(this.EditFormData, 'hdzplx', null);
|
|
this.$set(this.EditFormData, 'hdzplx2', null);
|
|
$.post('/platform/hd/childhd/zpxx/gethdlblist', {id: id}).then(data => {
|
|
if (data.code == 0) {
|
|
this.formhdlblist = data.data;
|
|
}
|
|
});
|
|
},
|
|
formhdlbchange(id) {
|
|
this.$set(this.AddFormData, 'hdzplx2', null);
|
|
$.post('/platform/hd/jzghd/sczp/gethdzplblist', {id: id}).then(data => {
|
|
if (data.code == 0) {
|
|
this.formhdzplblist = data.data;
|
|
}
|
|
});
|
|
},
|
|
pictureExceed() {
|
|
this.$message.warning('照片最多上传' + this.zplb2Config.photoNum + '张');
|
|
},
|
|
vadExceed() {
|
|
this.$message.warning('音/视频、文档最多上传' + this.zplb2Config.otherFileNum + '个');
|
|
},
|
|
pictureChange(file, fileList) {
|
|
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1).toLowerCase();
|
|
const whiteList = this.zplb2Config.photoType
|
|
if (!whiteList.includes(fileSuffix)) {
|
|
this.picturelist = []
|
|
this.$message.warning('上传照片只能是' + whiteList.join(',') + '格式')
|
|
return false
|
|
}
|
|
this.picturelist = fileList
|
|
},
|
|
pictureRemove(file, fileList) {
|
|
if (file.status === 'success') {
|
|
const length = file.url.lastIndexOf("=") + 1
|
|
this.readytodelfile.push(file.url.substring(length));
|
|
this.picturelist.map(v => {
|
|
const length = v.url.lastIndexOf("=") + 1
|
|
v.urlId = v.url.substring(length);
|
|
})
|
|
this.picturelist = this.picturelist.filter(v => v.urlId !== file.url.substring(length))
|
|
}
|
|
},
|
|
vadChange(file, fileList) {
|
|
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1).toLowerCase();
|
|
const whiteList = this.zplb2Config.otherType
|
|
if (!whiteList.includes(fileSuffix)) {
|
|
this.vadlist = []
|
|
this.$message.warning('上传音/视频、文档只能是' + whiteList.join(',') + '格式')
|
|
return false
|
|
}
|
|
this.vadlist = fileList;
|
|
},
|
|
vadRemove(file, fileList) {
|
|
if (file.status === 'success') {
|
|
const length = file.url.lastIndexOf("=") + 1
|
|
this.readytodelfile.push(file.url.substring(length));
|
|
this.vadlist.map(v => {
|
|
const length = v.url.lastIndexOf("=") + 1
|
|
v.urlId = v.url.substring(length);
|
|
})
|
|
this.vadlist = this.vadlist.filter(v => v.urlId !== file.url.substring(length))
|
|
}
|
|
},
|
|
openAdd() {
|
|
this.AddFormData = {}
|
|
this.zplb2Config = {}
|
|
this.AddFormData.mobile = "${@shiro.getPrincipalProperty('mobile')}";
|
|
if (this.formhdxxlist.find(v => v.hdid === this.hdid)) {
|
|
this.AddFormData.hdid = this.hdid;
|
|
} else if (this.pageForm.hdid) {
|
|
this.AddFormData.hdid = this.pageForm.hdid;
|
|
}
|
|
this.formhdchange(this.AddFormData.hdid)
|
|
this.picturelist = [];
|
|
this.vadlist = [];
|
|
this.$refs.guava.edit()
|
|
if (this.$refs['AddForm']) {
|
|
this.$refs['AddForm'].resetFields();
|
|
}
|
|
},
|
|
doAdd(flag) {
|
|
this.$refs['AddForm'].validate((valid) => {
|
|
if (valid) {
|
|
if (flag && ((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
|
|
(this.zplb2Config.isUploadOther && this.vadlist.length === 0))) {
|
|
this.$message.warning('请上传您的作品');
|
|
return;
|
|
}
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: '上传中',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
});
|
|
let formdata = new FormData();
|
|
formdata.append("flag", flag);
|
|
formdata.append("data", JSON.stringify(this.AddFormData));
|
|
this.picturelist.forEach(val => {
|
|
formdata.append("file", val.raw);
|
|
});
|
|
this.vadlist.forEach(val => {
|
|
formdata.append("file", val.raw);
|
|
});
|
|
$.ajax({
|
|
url: "/platform/hd/jzghd/sczp/doSubmit",
|
|
type: "post",
|
|
data: formdata,
|
|
processData: false,
|
|
contentType: false
|
|
}).then((res) => {
|
|
if (res.code == 0) {
|
|
// this.addDialogVisible = false;
|
|
this.doSearch();
|
|
this.$refs.guava.index()
|
|
this.$message.success('上传成功');
|
|
} else {
|
|
this.$message.error('上传失败');
|
|
}
|
|
loading.close();
|
|
})
|
|
}
|
|
});
|
|
},
|
|
openEdit(scope) {
|
|
this.readytodelfile = [];
|
|
this.picturelist = [];
|
|
this.vadlist = [];
|
|
|
|
$.post('/platform/hd/wmhd/findOne', {id: scope.row.id}).then(res => {
|
|
if (res.code == 0) {
|
|
this.formhdlblist = res.data.hdlblist;
|
|
this.formhdzplblist = res.data.hdzplblist;
|
|
this.EditFormData = res.data;
|
|
this.EditFormData.hdzplx = res.data.hdzplx ? res.data.hdzplx.toString() : "";
|
|
this.EditFormData.hdzplx2 = res.data.hdzplx2 ? res.data.hdzplx2.toString() : "";
|
|
this.changeHdzplx2(this.EditFormData.hdzplx2)
|
|
res.data.piclist.forEach(v => {
|
|
this.picturelist.push({url: APP_DOMAIN + '/file_server/fileStreamPreview?id=' + v.id})
|
|
})
|
|
this.vadlist = res.data.vadlist;
|
|
}
|
|
});
|
|
this.$refs.guava.public()
|
|
|
|
|
|
},
|
|
doEdit(flag) {
|
|
this.$refs['EditForm'].validate((valid) => {
|
|
if (valid) {
|
|
if (flag && ((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
|
|
(this.zplb2Config.isUploadOther && this.vadlist.length === 0))) {
|
|
this.$message.warning('请上传您的作品');
|
|
return;
|
|
}
|
|
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: '上传中',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
});
|
|
let formdata = new FormData();
|
|
formdata.append("flag", flag);
|
|
formdata.append("data", JSON.stringify(this.EditFormData));
|
|
formdata.append("readytodelfile", JSON.stringify(this.readytodelfile));
|
|
this.picturelist.forEach(val => {
|
|
if (val.status === 'ready') {
|
|
formdata.append("file", val.raw);
|
|
}
|
|
});
|
|
this.vadlist.forEach(val => {
|
|
if (val.status === 'ready') {
|
|
formdata.append("file", val.raw);
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "/platform/hd/jzghd/sczp/doEdit",
|
|
type: "post",
|
|
data: formdata,
|
|
processData: false,
|
|
contentType: false
|
|
}).then((res) => {
|
|
if (res.code == 0) {
|
|
this.picturelist = [];
|
|
this.vadlist = [];
|
|
this.doSearch();
|
|
this.$refs.guava.index()
|
|
this.$message.success('上传成功');
|
|
} else {
|
|
this.$message.error('上传失败');
|
|
}
|
|
loading.close();
|
|
|
|
})
|
|
}
|
|
});
|
|
},
|
|
pageData() {
|
|
sublime.showLoadingbar();
|
|
$.post('/platform/hd/jzghd/sczp/pageData', this.pageForm).then(res => {
|
|
sublime.closeLoadingbar();
|
|
if (res.code == 0) {
|
|
this.tableData = res.data.list;
|
|
this.pageForm.totalCount = res.data.totalCount;
|
|
}
|
|
});
|
|
},
|
|
pageSizeChange: function (val) {
|
|
this.pageForm.pageSize = val;
|
|
this.pageData();
|
|
},
|
|
pageNumberChange: function (val) {
|
|
this.pageForm.pageNumber = val;
|
|
this.pageData();
|
|
},
|
|
doSearch: function () {
|
|
this.pageForm.pageNumber = 1;
|
|
this.pageData();
|
|
},
|
|
viewInfo(scope) {
|
|
this.$refs.info.getInfo(scope.row.id)
|
|
this.$refs.guava.view()
|
|
},
|
|
playvideo(fjurl) {
|
|
this.fileDialogVisible = true;
|
|
this.videoShow = true;
|
|
this.$nextTick(function () {
|
|
let vc = document.getElementById('videoContainer');
|
|
let newVideo = document.createElement("div");//创建一个标签
|
|
newVideo.innerHTML = '<video id="my-video" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto"></video>';
|
|
vc.appendChild(newVideo);
|
|
let option = {autoplay: false, language: 'zh-CN'};
|
|
let myPlayer = videojs('my-video', option, function onPlayerReady() {
|
|
let myPlayer = this;
|
|
myPlayer.src({src: fjurl, type: "video/mp4"});
|
|
/*videojs.log("播放器已经准备好了!");*/
|
|
//this.play();
|
|
});
|
|
})
|
|
},
|
|
filedialogClose() {
|
|
//关闭的时候需要销毁video 但是随之dom元素也会被删除!!!!
|
|
this.imgShow = false;
|
|
this.videoShow = false;
|
|
videojs('my-video').dispose();
|
|
},
|
|
downLoad: function (item) {
|
|
window.open('/platform/hd/wmhd/download?filepath=' + item.fjurl + '&filename=' + item.fjname + "&username=" + this.ckusername);
|
|
},
|
|
YlDoc: function (item) {
|
|
var self = this;
|
|
window.open('/platform/hd/wmhd/YlDoc?fjurl=' + item.fjurl);
|
|
},
|
|
initHdxxlist() {
|
|
$.post(base + '/platform/hd/wmhd/initHdxxlist').then(data => {
|
|
if (data.code == 0) {
|
|
this.yearActivityList = data.data
|
|
let activityList = []
|
|
data.data.map(v => {
|
|
activityList = activityList.concat(v.children)
|
|
})
|
|
this.hdxxlist = activityList
|
|
}
|
|
});
|
|
},
|
|
hdchange(id) {
|
|
this.$set(this.pageForm, 'hdlb', '');
|
|
this.$set(this.pageForm, 'zplb', '');
|
|
$.post('/platform/hd/childhd/zpxx/gethdlblist', {id: id}).then(data => {
|
|
if (data.code == 0) {
|
|
|
|
this.hdlblist = data.data;
|
|
}
|
|
});
|
|
},
|
|
hdlbchange(id) {
|
|
this.$set(this.pageForm, 'zplb', '');
|
|
$.post('/platform/hd/childhd/zpxx/gethdzplblist', {id: id}).then(data => {
|
|
if (data.code == 0) {
|
|
this.hdzplblist = data.data;
|
|
}
|
|
});
|
|
},
|
|
dodelete(id) {
|
|
this.$confirm('此操作将永久删除该记录, 确定吗?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
$.post('/platform/hd/wmhd/doDelete', {id: id}).then(data => {
|
|
if (data.code == 0) {
|
|
this.doSearch();
|
|
this.$message.success(data.msg);
|
|
}
|
|
});
|
|
}).catch(() => {
|
|
|
|
});
|
|
},
|
|
getCurrentUserGhname() {
|
|
$.post('/platform/hd/childhd/sczp/getGhname').then(data => {
|
|
this.currentUserGhname = data;
|
|
});
|
|
},
|
|
async getUserActivityGroup() {
|
|
const {data} = await $.post("/platform/hd/wmhdMange/getUserActivityGroup")
|
|
this.formhdxxlist = data.filter(v => v.hdflag)
|
|
|
|
/*$.post('/platform/hd/wmhd/initHdxxlist').then(data => {
|
|
this.formhdxxlist = data.data[0].children;
|
|
});*/
|
|
}
|
|
},
|
|
created() {
|
|
this.initHdxxlist();
|
|
this.getUserActivityGroup();
|
|
this.pageData();
|
|
this.getCurrentUserGhname();
|
|
if (this.hdid) {
|
|
setTimeout(() => {
|
|
this.openAdd()
|
|
}, 500)
|
|
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
<!--#
|
|
}
|
|
#--> |