|
|
|
@ -23,7 +23,7 @@ |
|
|
|
show-word-limit |
|
|
|
placeholder="标题"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属机构"> |
|
|
|
<el-form-item label="所属机构" prop="allDeptIdsShow"> |
|
|
|
<el-cascader |
|
|
|
v-model="dataForm.allDeptIdsShow" |
|
|
|
:options="options" |
|
|
|
@ -77,7 +77,7 @@ |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="banner位置"> |
|
|
|
<el-form-item label="banner位置" prop="position"> |
|
|
|
<el-select v-model="dataForm.position" |
|
|
|
placeholder="请选择"> |
|
|
|
<el-option v-for="item in positionList" |
|
|
|
@ -103,6 +103,21 @@ |
|
|
|
class="el-icon-plus avatar-uploader-icon"></i> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="banner视频" |
|
|
|
v-loading="loading" |
|
|
|
prop="videoUrl"> |
|
|
|
<el-upload class="avatar-uploader" |
|
|
|
:action="this.uploadUrl" |
|
|
|
:show-file-list="false" |
|
|
|
:on-success="handleVideoSuccess" |
|
|
|
:on-error="handelError" |
|
|
|
:before-upload="beforeVideoUpload"> |
|
|
|
<video class="video" v-if="dataForm.videoUrl" |
|
|
|
:src="dataForm.videoUrl" controls="controls"></video> |
|
|
|
<i v-else |
|
|
|
class="el-icon-plus avatar-uploader-icon"></i> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<template slot="footer"> |
|
|
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|
|
|
@ -132,7 +147,8 @@ export default { |
|
|
|
gridId: '', |
|
|
|
grid: '', |
|
|
|
position: '0', |
|
|
|
allDeptIdsShow: [] |
|
|
|
allDeptIdsShow: [], |
|
|
|
videoUrl: '' |
|
|
|
}, |
|
|
|
bannerOptions: [], |
|
|
|
streetList: [], |
|
|
|
@ -150,9 +166,6 @@ export default { |
|
|
|
title: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
imgUrl: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
bannerType: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
@ -241,9 +254,20 @@ export default { |
|
|
|
this.dataForm.imgUrl = res.data.url |
|
|
|
this.loading = false |
|
|
|
}, |
|
|
|
handleVideoSuccess (res, file) { |
|
|
|
this.dataForm.videoUrl = res.data.url |
|
|
|
this.loading = false |
|
|
|
}, |
|
|
|
beforeAvatarUpload (file) { |
|
|
|
this.loading = true |
|
|
|
}, |
|
|
|
beforeVideoUpload (file) { |
|
|
|
console.log(file) |
|
|
|
if (file.size > 52428800) { |
|
|
|
return this.$message.error('文件大小不能超过50M') |
|
|
|
} |
|
|
|
this.loading = true |
|
|
|
}, |
|
|
|
handelError () { |
|
|
|
this.loading = false |
|
|
|
}, |
|
|
|
|