Files
2026-09-20 15:46:34 +08:00

1034 lines
44 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 href="${base!}/assets/platform/plugins/video/css/video-js.min.css" rel="stylesheet">
<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 @change="yearChange"
placeholder="年度"
type="year"
v-model="pageForm.year"
value-format="yyyy"></el-date-picker>
</div>
<div class="btn-group tool-button mt5">
<el-select @change="hdchange" clearable placeholder="请选择活动主题"
v-model="pageForm.hdid">
<el-option :label="o.label" :value="o.value"
v-for="o in hdxxlist"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select @change="hdlbchange" clearable placeholder="请选择活动类别"
v-model="pageForm.hdlb">
<el-option :label="o.lname" :value="o.lid"
v-for="o in hdlblist"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable placeholder="请选择作品类型" v-model="pageForm.zplb">
<el-option :label="o.zname" :value="o.zid"
v-for="o in hdzplblist"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<vi-title2 title="作品列表">
<template #func>
<el-button @click="openAdd" size="small" type="primary">上传作品</el-button>
</template>
</vi-title2>
<el-table :data="tableData">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="50">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="活动主题" prop="hdname"
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 align="center" header-align="center" label="教职工姓名"
prop="sbrname"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="工号"
prop="loginname"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="单位" prop="dwname"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="分工会" prop="ghname"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="活动类别"
prop="hdlbname"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="作品类别"
prop="zplbname"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="上传时间" prop="hdsbsj"
show-overflow-tooltip>
</el-table-column>
<!--<el-table-column align="center" header-align="center" label="申请状态"
prop="auditState" sortable>
<template scope="scope">
<span :style="'color:'+scope.row.statecolor">{{scope.row.statename}}</span>
</template>
</el-table-column>-->
<!-- <el-table-column align="center" header-align="center" label="总点赞数"
prop="dz_znum" sortable>
<template scope="scope">
{{scope.row.dz_znum}}次
</template>
</el-table-column>-->
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-scope="scope">
<el-button @click="viewInfo(scope)" size="mini" type="primary">查看
</el-button>
<!-- v-if="scope.row.auditstate==='3999'||scope.row.auditstate==='4100'||scope.row.auditstate==='4250'"-->
<el-button :disabled="!isActivityTime(scope.row)"
@click="openEdit(scope)" size="mini"
type="primary">
编辑
</el-button>
<el-button :disabled="!isActivityTime(scope.row)"
@click="dodelete(scope.row)"
size="mini"
type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
:current-page="pageForm.pageNumber"
:page-size="pageForm.pageSize"
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
@size-change="pageSizeChange"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
</template>
<template #edit>
<el-form :model="AddFormData" :rules="rules" label-width="120px" ref="AddForm">
<el-divider content-position="left">基本信息</el-divider>
<div class="form-item-container">
<el-form-item label="工号" prop="loginname">
<el-input readonly
value="${@shiro.getPrincipalProperty('loginname')}"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="username">
<el-input readonly
value="${@shiro.getPrincipalProperty('username')}"></el-input>
</el-form-item>
</div>
<div class="form-item-container">
<el-form-item label="所属工会" prop="ghname">
<el-input readonly v-model="currentUserGhname"></el-input>
</el-form-item>
<el-form-item label="手机号码" prop="mobile">
<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 label="活动主题" prop="hdid">
<el-select @change="formhdchange" style="width: 100%"
v-model="AddFormData.hdid">
<el-option :key="o.hdid" :label="o.hdname" :value="o.hdid"
v-for="o in formhdxxlist">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="活动类别" prop="hdzplx">
<el-select @change="formhdlbchange" style="width: 100%"
v-model="AddFormData.hdzplx">
<el-option :label="o.lname" :value="o.lid"
v-for="o in formhdlblist"></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 label="类别" prop="hdzplx2">
<el-select @change="changeHdzplx2" style="width: 100%"
v-model="AddFormData.hdzplx2">
<el-option :key="o.zid" :label="o.zname" :value="o.zid"
v-for="o in formhdzplblist"></el-option>
</el-select>
</el-form-item>
<el-form-item label="标题" prop="zpmc">
<el-input v-model="AddFormData.zpmc"></el-input>
</el-form-item>
</div>
<el-form-item label="创作说明" prop="hdsbzpms">
<el-input :maxlength="zplb2Config.maxWordCount" show-word-limit
type="textarea" v-model="AddFormData.hdsbzpms"></el-input>
</el-form-item>
<div v-if="zplb2Config.isUploadPhoto||zplb2Config.isUploadOther||zplb2Config.isUploadZip">
<el-divider content-position="left">作品信息</el-divider>
<el-form-item label="照片" required v-if="zplb2Config.isUploadPhoto">
<el-upload
:auto-upload="false"
:file-list="picturelist"
:limit="zplb2Config.photoNum"
:on-change="pictureChange"
:on-exceed="pictureExceed"
action=""
list-type="picture-card"
name="picturefile">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="音/视频、文档" v-if="zplb2Config.isUploadOther">
<el-upload
:auto-upload="false"
:file-list="vadlist"
:limit="zplb2Config.otherFileNum"
:on-change="vadChange"
:on-exceed="vadExceed"
action=""
name="vadfile">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item label="压缩包" v-if="zplb2Config.isUploadZip">
<el-upload
:auto-upload="false"
:file-list="ziplist"
:limit="zplb2Config.zipNum"
:on-change="zipChange"
:on-exceed="zipExceed"
action=""
name="zipfile">
<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" type="primary">提 交</el-button>
</div>
</template>
<template #view>
<info @playvideo="playvideo" ref="info"></info>
</template>
<template #public>
<el-form :model="EditFormData" :rules="rules" label-width="120px" ref="EditForm">
<el-divider content-position="left">基本信息</el-divider>
<div class="form-item-container">
<el-form-item label="工号" prop="loginname">
<el-input readonly
value="${@shiro.getPrincipalProperty('loginname')}"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="username">
<el-input readonly
value="${@shiro.getPrincipalProperty('username')}"></el-input>
</el-form-item>
</div>
<div class="form-item-container">
<el-form-item label="所属工会" prop="ghname">
<el-input readonly v-model="currentUserGhname"></el-input>
</el-form-item>
<el-form-item label="手机号码" prop="mobile">
<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 label="活动主题" prop="hdid">
<el-select @change="formhdchange" style="width: 100%"
v-model="EditFormData.hdid">
<el-option :key="o.hdid" :label="o.hdname" :value="o.hdid"
v-for="o in formhdxxlist">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="活动类别" prop="hdzplx">
<el-select @change="formhdlbchange" style="width: 100%"
v-model="EditFormData.hdzplx">
<el-option :label="o.lname" :value="o.lid"
v-for="o in formhdlblist"></el-option>
</el-select>
</el-form-item>
</div>
<div class="form-item-container">
<el-form-item label="类别" prop="hdzplx2"
v-if="formhdzplblist&&formhdzplblist.length>0">
<el-select @change="changeHdzplx2" style="width: 100%"
v-model="EditFormData.hdzplx2">
<el-option :key="o.zid" :label="o.zname" :value="o.zid"
v-for="o in formhdzplblist"></el-option>
</el-select>
</el-form-item>
<el-form-item label="标题" prop="zpmc">
<el-input v-model="EditFormData.zpmc"></el-input>
</el-form-item>
</div>
<el-form-item label="创作说明" prop="hdsbzpms">
<el-input :maxlength="zplb2Config.maxWordCount" show-word-limit
type="textarea" v-model="EditFormData.hdsbzpms"></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
:auto-upload="false"
:file-list="picturelist"
:limit="zplb2Config.photoNum"
:on-change="pictureChange"
:on-exceed="pictureExceed"
:on-remove="pictureRemove"
action=""
list-type="picture-card"
name="picturefile">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="音/视频、文档" v-if="zplb2Config.isUploadOther">
<el-upload
:auto-upload="false"
:file-list="vadlist"
:limit="zplb2Config.otherFileNum"
:on-change="vadChange"
:on-remove="vadRemove"
action=""
name="vadfile">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item label="压缩包" v-if="zplb2Config.isUploadZip">
<el-upload
:auto-upload="false"
:file-list="ziplist"
:limit="zplb2Config.zipNum"
:on-change="zipChange"
:on-exceed="zipRemove"
action=""
name="zipfile">
<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" type="primary">提 交</el-button>
</div>
</template>
</guava>
<el-dialog :close-on-click-modal="false" :visible.sync="fileDialogVisible"
@close="filedialogClose"
class="filedialog">
<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'],
ziptype: ['rar', 'zip'],
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']}],
hdsbzpms: [{required: true, message: '请填写创作说明', trigger: ['blur', 'change']}],
},
EditFormData: {},
readytodelfile: [],
formhdxxlist: [],
yearActivityList: [],
zplb2Config: {},
ziplist:[]
}
},
components: {
'info': httpVueLoader('/components/hd/hdwmInfo.vue'),
},
methods: {
changeHdzplx2(id) {
this.zplb2Config = this.formhdzplblist.find(v => v.zid === id)
},
isActivityTime(row) {
if (!row || !row.hdkssj || !row.hdjssj) {
return false;
}
const startTime = new Date(row.hdkssj.replace(/-/g, '/')).getTime();
const endTime = new Date(row.hdjssj.replace(/-/g, '/')).getTime();
const nowTime = new Date().getTime();
return startTime <= nowTime && nowTime <= endTime;
},
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))
}
},
zipChange(file, fileList){
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1).toLowerCase();
const whiteList = this.zplb2Config.zipType
if (!whiteList.includes(fileSuffix)) {
this.ziplist = []
this.$message.warning('上传文件只能是' + whiteList.join(',') + '格式')
return false
}
this.ziplist = fileList;
},
zipRemove(file, fileList){
if (file.status === 'success') {
const length = file.url.lastIndexOf("=") + 1
this.readytodelfile.push(file.url.substring(length));
this.ziplist.map(v => {
const length = v.url.lastIndexOf("=") + 1
v.urlId = v.url.substring(length);
})
this.ziplist = this.ziplist.filter(v => v.urlId !== file.url.substring(length))
}
},
zipExceed(){
this.$message.warning('文件最多上传' + this.zplb2Config.zipNum + '个');
},
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.ziplist = [];
this.$refs.guava.edit()
if (this.$refs['AddForm']) {
this.$refs['AddForm'].resetFields();
}
},
doAdd() {
this.$refs['AddForm'].validate((valid) => {
if (valid) {
if (((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
(this.zplb2Config.isUploadOther && this.vadlist.length === 0) ||
(this.zplb2Config.isUploadZip && this.ziplist.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", true);
formdata.append("data", JSON.stringify(this.AddFormData));
if(this.picturelist && this.picturelist.length > 0) {
this.picturelist.forEach(val => {
formdata.append("file", val.raw);
});
}
if(this.vadlist && this.vadlist.length > 0) {
this.vadlist.forEach(val => {
formdata.append("file", val.raw);
});
}
if(this.ziplist && this.ziplist.length > 0) {
this.ziplist.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(res.msg || '上传失败');
}
loading.close();
})
}
});
},
openEdit(scope) {
if (!this.isActivityTime(scope.row)) {
this.$message.warning('不在活动时间范围内,不能编辑');
return;
}
this.readytodelfile = [];
this.picturelist = [];
this.vadlist = [];
this.ziplist = [];
$.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.ziplist = res.data.ziplist;
}
});
this.$refs.guava.public()
},
doEdit() {
this.$refs['EditForm'].validate((valid) => {
if (valid) {
if (((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
(this.zplb2Config.isUploadOther && this.vadlist.length === 0) ||
(this.zplb2Config.isUploadZip && this.ziplist.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", true);
formdata.append("data", JSON.stringify(this.EditFormData));
formdata.append("readytodelfile", JSON.stringify(this.readytodelfile));
if(this.picturelist && this.picturelist.length > 0) {
this.picturelist.forEach(val => {
if (val.status === 'ready') {
formdata.append("file", val.raw);
}
});
}
if(this.vadlist && this.vadlist.length > 0) {
this.vadlist.forEach(val => {
if (val.status === 'ready') {
formdata.append("file", val.raw);
}
});
}
if(this.ziplist && this.ziplist.length > 0) {
this.ziplist.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.ziplist = [];
this.doSearch();
this.$refs.guava.index()
this.$message.success('上传成功');
} else {
this.$message.error(res.msg || '上传失败');
}
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(row) {
if (!this.isActivityTime(row)) {
this.$message.warning('不在活动时间范围内,不能删除');
return;
}
this.$confirm('此操作将永久删除该记录, 确定吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post('/platform/hd/wmhd/doDelete', {id: row.id}).then(data => {
if (data.code == 0) {
this.doSearch();
this.$message.success(data.msg);
} else {
this.$message.error(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)
}
},
created() {
this.initHdxxlist();
this.getUserActivityGroup();
this.pageData();
this.getCurrentUserGhname();
if (this.hdid) {
setTimeout(() => {
this.openAdd()
}, 500)
}
}
});
</script>
<!--#
}
#-->