Commit 29204cfa by 前端

恢复营销素材

1 parent e8ccf220
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<h4>{{ title }}</h4> <h4>{{ title }}</h4>
<el-divider></el-divider> <el-divider></el-divider>
<div class="m-l-20"> <div class="m-l-20">
<el-form-item v-if="routeInfo.addOrEdit == 1" label="选择素材组:" prop="groupId"> <el-form-item v-if="!notDisplayProperties" label="选择素材组:" prop="groupId">
<el-select v-model="materialAddForm.groupId" placeholder="全部" :size="size"> <el-select v-model="materialAddForm.groupId" placeholder="全部" :size="size">
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" <el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName"
:value="item.id"></el-option> :value="item.id"></el-option>
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
</el-form-item> </el-form-item>
<el-form-item label="素材名称:" prop="materialName"> <el-form-item label="素材名称:" prop="materialName">
<el-input v-model="materialAddForm.materialName" :size="size" placeholder="请输入素材名称" <el-input v-model="materialAddForm.materialName" :size="size" placeholder="请输入素材名称"
maxlength="30" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1"></el-input> maxlength="30" :disabled="notDisplayProperties"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="素材类型:" prop="materialType"> <el-form-item label="素材类型:" prop="materialType" class="materialType">
<el-radio-group v-model="materialAddForm.materialType" @change="radioChange" <el-radio-group v-model="materialAddForm.materialType" @change="radioChange"
:disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1"> :disabled="routeInfo.addOrEdit != 1">
<el-radio :label="1">PDF文件</el-radio> <el-radio :label="1">PDF文件</el-radio>
<!-- <el-radio :label="2">自定义链接</el-radio> --> <!-- <el-radio :label="2">自定义链接</el-radio> -->
<el-radio :label="3">图文</el-radio> <el-radio :label="3">图文</el-radio>
...@@ -80,22 +80,22 @@ ...@@ -80,22 +80,22 @@
<div class="avatar-uploader-desc-word">上传照片</div> <div class="avatar-uploader-desc-word">上传照片</div>
<input :class="{disableUpload:notDisplayProperties}" <input :class="{disableUpload:notDisplayProperties}"
:disabled="notDisplayProperties" type="file" style="opacity: 0" accept=".jpg, .jpeg, .png" :disabled="notDisplayProperties" type="file" style="opacity: 0" accept=".jpg, .jpeg, .png"
@change="e => handleImgChange(e,'imageUrlList')"/> @change="e => handleImgChange(e,'imageUrlList')"/>
</div> </div>
<!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> --> <!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> -->
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="视频:" class="photoWrap"> <el-form-item label="视频:" class="photoWrap">
<div class="img-div"> <div class="img-div">
<div class="put-img" v-if="materialAddForm.mediaUrl"> <div class="put-img" v-if="materialAddForm.videoUrl">
<video id="video" width="100%" height="100%" preload loop muted> <video :src="materialAddForm.videoUrl" id="video" width="100%" height="100%" preload loop muted>
<source :src="materialAddForm.videoUrl" type="video/mp4"/> <!-- <source :src="materialAddForm.videoUrl" type="video/mp4"/>-->
</video> </video>
<div class="mask"> <div class="mask">
<h3> <h3>
<img slot="reference" src="@/assets/material/view.png" alt="" @click="viewVideo"/> <img slot="reference" src="@/assets/material/view.png" alt="" @click="viewVideo"/>
<img v-if="!notDisplayProperties" class="del-img" <img v-if="!notDisplayProperties" class="del-img"
src="@/assets/material/dele.png" alt="" @click="deleteImg('mediaUrl')"/> src="@/assets/material/dele.png" alt="" @click="deleteImg('videoUrl')"/>
</h3> </h3>
</div> </div>
</div> </div>
...@@ -103,9 +103,9 @@ ...@@ -103,9 +103,9 @@
<i class="el-icon-plus avatar-uploader-desc-icon"></i> <i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传视频</div> <div class="avatar-uploader-desc-word">上传视频</div>
<input :class="{disableUpload:notDisplayProperties}" <input :class="{disableUpload:notDisplayProperties}"
:disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1" type="file" style="opacity: 0" :disabled="notDisplayProperties" type="file" style="opacity: 0"
accept="video/*" accept="video/*"
@change="e =>handleVideoChange(e,'mediaUrl')"/> @change="e =>handleVideoChange(e,'videoUrl')"/>
</div> </div>
<!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> --> <!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> -->
</div> </div>
...@@ -264,14 +264,13 @@ ...@@ -264,14 +264,13 @@
<GLFooter class="gl-footer"> <GLFooter class="gl-footer">
<el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</el-button> <el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</el-button>
<el-button @click="handleCancel" class="btn-cancle">取消</el-button> <el-button @click="handleCancel" class="btn-cancle">取消</el-button>
<el-button @click="handleSubmit" type="primary">确定</el-button> <el-button @click="handleSubmit" v-if="this.routeInfo.addOrEdit !== 3" type="primary">确定</el-button>
</GLFooter> </GLFooter>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%"> <el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="dialogSrc" :dialogType="dialogType"></big-view> <big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="dialogSrc" :dialogType="dialogType"></big-view>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import textBox from '@/views/material/components/textBox' import textBox from '@/views/material/components/textBox'
import SelectLabel from '@/views/material/components/selectLable' import SelectLabel from '@/views/material/components/selectLable'
...@@ -349,9 +348,13 @@ export default { ...@@ -349,9 +348,13 @@ export default {
mounted() { mounted() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.routeInfo.addOrEdit != 1 ? this.getMaterialInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getMaterialInfo() : ''
this.routeInfo.addOrEdit != 1 ? (this.routeInfo.status != 1 ? this.forbidEdit() : '') : '' this.routeInfo.addOrEdit == 3 ? this.forbidEdit() : ''
this.title = this.titleObj[this.routeInfo.addOrEdit] this.title = this.titleObj[this.routeInfo.addOrEdit]
this.notDisplayProperties= this.routeInfo.addOrEdit == 2 && this.routeInfo.status != 1 // this.notDisplayProperties = this.routeInfo.addOrEdit == 3 && this.routeInfo.status != 1
this.notDisplayProperties = this.routeInfo.addOrEdit == 3
console.log(this.routeInfo.status)
console.log(this.routeInfo.addOrEdit)
console.log(this.notDisplayProperties)
this.materialInsert() this.materialInsert()
this.getMaterialList() this.getMaterialList()
// this.findAllDictData('business_type') // this.findAllDictData('business_type')
...@@ -360,7 +363,7 @@ export default { ...@@ -360,7 +363,7 @@ export default {
methods: { methods: {
viewVideo() { viewVideo() {
this.dialogVisibleImg = true this.dialogVisibleImg = true
this.dialogSrc = this.materialAddForm.mediaUrl this.dialogSrc = this.materialAddForm.videoUrl
}, },
handleVideoChange(e) { handleVideoChange(e) {
let file = e.srcElement.files[0] let file = e.srcElement.files[0]
...@@ -369,7 +372,7 @@ export default { ...@@ -369,7 +372,7 @@ export default {
const limitSize = 20 const limitSize = 20
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) { if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!') this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true return true
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
...@@ -378,7 +381,7 @@ export default { ...@@ -378,7 +381,7 @@ export default {
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadVideoApi({file: base64}).then(res => { this.$apis.common.uploadVideoApi({file: base64}).then(res => {
if (res) { if (res) {
this.materialAddForm.mediaUrl = res this.materialAddForm.videoUrl = res
} }
}) })
} }
...@@ -425,6 +428,8 @@ export default { ...@@ -425,6 +428,8 @@ export default {
if (videoHtml && videoHtml.length && !imgHtml && !html.length) params.materialType = 4 if (videoHtml && videoHtml.length && !imgHtml && !html.length) params.materialType = 4
if (!imgHtml && !videoHtml) params.materialType = 5 if (!imgHtml && !videoHtml) params.materialType = 5
if (imgHtml && imgHtml.length && !videoHtml && !html.length) params.materialType = 6 if (imgHtml && imgHtml.length && !videoHtml && !html.length) params.materialType = 6
if (this.materialAddForm.vedioUrl && !this.materialAddForm.imageUrlList.length) params.materialType = 4
if (this.materialAddForm.imageUrlList.length) params.materialType = 3
this.textBoxContent = encodeURIComponent(this.textBoxContent) this.textBoxContent = encodeURIComponent(this.textBoxContent)
params.materialUrl = this.textBoxContent params.materialUrl = this.textBoxContent
} }
...@@ -432,13 +437,12 @@ export default { ...@@ -432,13 +437,12 @@ export default {
}, },
// 获取素材详情 // 获取素材详情
getMaterialInfo() { getMaterialInfo() {
var params = {} let params = {}
params.id = this.routeInfo.id params.id = this.routeInfo.id
console.log(this.routeInfo.status) params.flag = 0
if (this.routeInfo.status == -1) { // if (this.routeInfo.status == -1) {
params.flag = 0 // params.flag = 0
} // }
console.log(this.routeInfo.id)
this.$apis.material.materialDetail(params).then(res => { this.$apis.material.materialDetail(params).then(res => {
this.materialAddForm = res this.materialAddForm = res
if (res && res.businessType) { if (res && res.businessType) {
...@@ -573,12 +577,17 @@ export default { ...@@ -573,12 +577,17 @@ export default {
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({file: base64}).then(res => { this.$apis.common.pictureUpload({file: base64}).then(res => {
if (res) { if (res) {
if (Array.isArray(this.materialAddForm[params])) { if (Array.isArray(this.materialAddForm[params]) || this.materialAddForm[params] == null) {
if (this.materialAddForm[params].length > 8) { if (this.materialAddForm[params] && this.materialAddForm[params].length > 8) {
this.$message.error('图片最多可上传9张') this.$message.error('图片最多可上传9张')
return return
} else { } else {
this.materialAddForm[params].push(res) if (!this.materialAddForm[params]) {
this.materialAddForm[params] = []
this.materialAddForm[params][0] = res
} else {
this.materialAddForm[params].push(res)
}
} }
} else { } else {
this.materialAddForm[params] = res this.materialAddForm[params] = res
...@@ -637,6 +646,7 @@ export default { ...@@ -637,6 +646,7 @@ export default {
} }
// status 状态 0 启用 -1 禁用 1 存草稿 // status 状态 0 启用 -1 禁用 1 存草稿
params.status = 0 params.status = 0
params.createdType = 2
let material let material
if (params.id) { if (params.id) {
material = 'materialEdit' material = 'materialEdit'
...@@ -738,13 +748,16 @@ export default { ...@@ -738,13 +748,16 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.materialType{
/deep/.el-form-item__content{
max-width: 85%;
}
}
.disableUpload { .disableUpload {
cursor: not-allowed; cursor: not-allowed;
cursor: no-drop; cursor: no-drop;
} }
.input-tag-wrapper { .input-tag-wrapper {
max-height: 75px; max-height: 75px;
overflow: auto; overflow: auto;
...@@ -759,21 +772,18 @@ export default { ...@@ -759,21 +772,18 @@ export default {
align-items: center; align-items: center;
margin-top: 6px; margin-top: 6px;
font-size: 14px; font-size: 14px;
i { i {
color: #75acff; color: #75acff;
margin-right: 3px; margin-right: 3px;
font-size: 14px; font-size: 14px;
} }
} }
.el-tag { .el-tag {
margin-right: 4px; margin-right: 4px;
height: 26px; height: 26px;
line-height: 24px; line-height: 24px;
margin-bottom: 5px; margin-bottom: 5px;
} }
.tag-input { .tag-input {
background: transparent; background: transparent;
border: none !important; border: none !important;
...@@ -783,21 +793,17 @@ export default { ...@@ -783,21 +793,17 @@ export default {
padding-left: 0; padding-left: 0;
width: 100px; width: 100px;
} }
.creat-material, .creat-material,
.track, .track,
.share, .share,
.material-bottom { .material-bottom {
background-color: #fff; background-color: #fff;
} }
.creat-material, .creat-material,
.track { .track {
margin-bottom: -10px; margin-bottom: -10px;
.dis-in-block { .dis-in-block {
margin-left: -154px; margin-left: -154px;
.activity-img { .activity-img {
width: 104px; width: 104px;
height: 104px; height: 104px;
...@@ -806,7 +812,6 @@ export default { ...@@ -806,7 +812,6 @@ export default {
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
input { input {
cursor: pointer; cursor: pointer;
font-size: 0; font-size: 0;
...@@ -816,30 +821,25 @@ export default { ...@@ -816,30 +821,25 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.add-border { .add-border {
text-align: center; text-align: center;
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
.add-icon { .add-icon {
margin-top: 20px; margin-top: 20px;
height: 20px; height: 20px;
font-size: 17px; font-size: 17px;
} }
.add-text { .add-text {
height: 30px; height: 30px;
font-size: 12px; font-size: 12px;
} }
} }
} }
.img-btns, .img-btns,
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.video-panel { .video-panel {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -847,19 +847,16 @@ export default { ...@@ -847,19 +847,16 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
video { video {
position: absolute; position: absolute;
object-fit: fill; object-fit: fill;
} }
.el-icon-video-play { .el-icon-video-play {
z-index: 10; z-index: 10;
font-size: 20px; font-size: 20px;
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
} }
.el-icon-close { .el-icon-close {
position: absolute; position: absolute;
top: 0px; top: 0px;
...@@ -870,7 +867,6 @@ export default { ...@@ -870,7 +867,6 @@ export default {
} }
} }
} }
.container { .container {
h4, h4,
.share-container { .share-container {
...@@ -878,45 +874,36 @@ export default { ...@@ -878,45 +874,36 @@ export default {
font-weight: 600; font-weight: 600;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
margin: 17px 0 17px 20px; margin: 17px 0 17px 20px;
&:first-child { &:first-child {
padding-top: 17px; padding-top: 17px;
margin-top: 0; margin-top: 0;
} }
} }
} }
.photoWrap { .photoWrap {
margin-top: 20px; margin-top: 20px;
margin-left: -154px; margin-left: -154px;
} }
.space { .space {
margin-bottom: 32px; margin-bottom: 32px;
} }
.track { .track {
&-tips { &-tips {
font-size: 14px; font-size: 14px;
color: #999999; color: #999999;
} }
&-info { &-info {
margin-left: 8px; margin-left: 8px;
} }
&-behavior { &-behavior {
color: #606266; color: #606266;
} }
} }
.share { .share {
margin-bottom: 20px; margin-bottom: 20px;
&-container { &-container {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.share-unfold { .share-unfold {
span { span {
font-size: 12px; font-size: 12px;
...@@ -925,65 +912,54 @@ export default { ...@@ -925,65 +912,54 @@ export default {
} }
} }
} }
&-tips { &-tips {
color: #999999; color: #999999;
font-size: 14px; font-size: 14px;
margin-left: 16px; margin-left: 16px;
} }
} }
.material-bottom { .material-bottom {
height: 78px; height: 78px;
position: relative; position: relative;
.el-form-item { .el-form-item {
position: absolute; position: absolute;
top: 25%; top: 25%;
left: 40%; left: 40%;
.el-form-item__content { .el-form-item__content {
margin-left: 0; margin-left: 0;
} }
} }
} }
.el-input--small, .el-input--small,
.el-select, .el-select,
.el-select--small { .el-select--small {
width: 432px; width: 432px;
} }
.btn-cancle { .btn-cancle {
border-color: #5850ff; border-color: #5850ff;
color: #5850ff; color: #5850ff;
} }
.put-img, .put-img,
.avatar-uploader-desc, .avatar-uploader-desc,
.view-phone { .view-phone {
float: left; float: left;
margin-right: 8px; margin-right: 8px;
.task { .task {
width: 104px; width: 104px;
height: 104px; height: 104px;
border-radius: 10px; border-radius: 10px;
} }
} }
.put-img { .put-img {
width: 104px; width: 104px;
height: 104px; height: 104px;
border-radius: 10px; border-radius: 10px;
display: inline-block; display: inline-block;
position: relative; position: relative;
img { img {
width: 104px; width: 104px;
height: 104px; height: 104px;
} }
.mask { .mask {
position: absolute; position: absolute;
background: rgba(101, 101, 101, 0.6); background: rgba(101, 101, 101, 0.6);
...@@ -994,42 +970,34 @@ export default { ...@@ -994,42 +970,34 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 10px; border-radius: 10px;
h3 { h3 {
text-align: center; text-align: center;
margin-top: 40%; margin-top: 40%;
img { img {
width: 16px; width: 16px;
height: 16px; height: 16px;
} }
.del-img { .del-img {
padding-left: 12px; padding-left: 12px;
} }
} }
} }
} }
.tag-show { .tag-show {
margin-right: 8px; margin-right: 8px;
margin-top: 20px; margin-top: 20px;
.el-button { .el-button {
display: inline-flex; display: inline-flex;
color: #5850ff; color: #5850ff;
} }
} }
.put-img:hover .mask { .put-img:hover .mask {
opacity: 1; opacity: 1;
} }
.pdf-show { .pdf-show {
display: inline-flex; display: inline-flex;
position: relative; position: relative;
height: 32px; height: 32px;
input { input {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -1038,14 +1006,12 @@ export default { ...@@ -1038,14 +1006,12 @@ export default {
height: 100%; height: 100%;
} }
} }
.avatar-uploader-desc { .avatar-uploader-desc {
width: 104px; width: 104px;
height: 104px; height: 104px;
border-radius: 4px; border-radius: 4px;
border: 1px dashed rgba(0, 0, 0, 0.15); border: 1px dashed rgba(0, 0, 0, 0.15);
position: relative; position: relative;
&-icon { &-icon {
width: 16px; width: 16px;
height: 16px; height: 16px;
...@@ -1053,14 +1019,12 @@ export default { ...@@ -1053,14 +1019,12 @@ export default {
top: 28px; top: 28px;
left: 44px; left: 44px;
} }
&-word { &-word {
position: absolute; position: absolute;
top: 58px; top: 58px;
left: 24px; left: 24px;
color: #666666; color: #666666;
} }
input { input {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -1069,34 +1033,28 @@ export default { ...@@ -1069,34 +1033,28 @@ export default {
height: 100%; height: 100%;
} }
} }
.view-phone { .view-phone {
margin-top: 85px; margin-top: 85px;
color: #5850ff; color: #5850ff;
} }
.avatar { .avatar {
width: 178px; width: 178px;
height: 178px; height: 178px;
display: block; display: block;
} }
.share-desc { .share-desc {
padding-bottom: 30px; padding-bottom: 30px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
&-right-box { &-right-box {
margin-right: 50px; margin-right: 50px;
width: 290px; width: 290px;
height: 566px; height: 566px;
position: relative; position: relative;
&-phone { &-phone {
width: 290px; width: 290px;
height: 566px; height: 566px;
} }
.content-show { .content-show {
background-color: #fff; background-color: #fff;
width: 160px; width: 160px;
...@@ -1108,17 +1066,14 @@ export default { ...@@ -1108,17 +1066,14 @@ export default {
left: 71px; left: 71px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
&-img { &-img {
width: 30px; width: 30px;
height: 30px; height: 30px;
img { img {
width: 30px; width: 30px;
height: 30px; height: 30px;
} }
} }
.content-title { .content-title {
color: #333333; color: #333333;
max-width: 100px; max-width: 100px;
...@@ -1128,7 +1083,6 @@ export default { ...@@ -1128,7 +1083,6 @@ export default {
font-size: 13px; font-size: 13px;
margin-bottom: 4px; margin-bottom: 4px;
} }
.content-word { .content-word {
color: #999999; color: #999999;
line-height: 14px; line-height: 14px;
...@@ -1144,63 +1098,49 @@ export default { ...@@ -1144,63 +1098,49 @@ export default {
} }
} }
} }
.img-plus { .img-plus {
width: 200px; width: 200px;
height: 200px; height: 200px;
} }
.gl-footer { .gl-footer {
z-index: 999; z-index: 999;
} }
.form-item-container { .form-item-container {
margin-top: 32px !important; margin-top: 32px !important;
} }
.el-form-item { .el-form-item {
margin-bottom: 20px !important; margin-bottom: 20px !important;
} }
/deep/ .el-form-item__label { /deep/ .el-form-item__label {
line-height: 25px; line-height: 25px;
} }
/deep/ .el-form-item__content { /deep/ .el-form-item__content {
line-height: 25px; line-height: 25px;
} }
.label-word { .label-word {
display: inline-block; display: inline-block;
img { img {
vertical-align: middle; vertical-align: middle;
} }
} }
ul { ul {
margin-top: 5px; margin-top: 5px;
.pdf-show { .pdf-show {
// width: 200px; // width: 200px;
list-style: none; list-style: none;
align-items: center; align-items: center;
position: relative; position: relative;
padding: 0 8px; padding: 0 8px;
.pdf-name { .pdf-name {
margin-right: 20px; margin-right: 20px;
&:hover { &:hover {
color: #5850ff; color: #5850ff;
} }
} }
&:hover { &:hover {
cursor: pointer; cursor: pointer;
background-color: rgba(88, 80, 255, 0.2) !important; background-color: rgba(88, 80, 255, 0.2) !important;
} }
i { i {
position: absolute; position: absolute;
right: 5px; right: 5px;
...@@ -1208,7 +1148,6 @@ ul { ...@@ -1208,7 +1148,6 @@ ul {
} }
} }
} }
.video-dsialog { .video-dsialog {
z-index: 2001; z-index: 2001;
position: fixed; position: fixed;
...@@ -1218,7 +1157,6 @@ ul { ...@@ -1218,7 +1157,6 @@ ul {
left: 0; left: 0;
overflow: auto; overflow: auto;
background: rgba($color: #000000, $alpha: 0.5); background: rgba($color: #000000, $alpha: 0.5);
&-panel { &-panel {
background: #000000; background: #000000;
position: absolute; position: absolute;
...@@ -1230,12 +1168,10 @@ ul { ...@@ -1230,12 +1168,10 @@ ul {
box-sizing: border-box; box-sizing: border-box;
padding: 10px 20px 20px; padding: 10px 20px 20px;
overflow: hidden; overflow: hidden;
.video-close { .video-close {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
height: 40px; height: 40px;
i { i {
cursor: pointer; cursor: pointer;
font-size: 25px; font-size: 25px;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">素材组</el-button> <el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">素材组</el-button>
<div class="all-group"> <div class="all-group">
<div @click="getList"> <div @click="getList">
<img src="@/assets/material/groupIcon.png" alt="" /> <img src="@/assets/material/groupIcon.png" alt=""/>
全部素材组 ({{ groupCounter.length }}) 全部素材组 ({{ groupCounter.length }})
</div> </div>
<div @click="groupVisible = !groupVisible"> <div @click="groupVisible = !groupVisible">
...@@ -12,9 +12,10 @@ ...@@ -12,9 +12,10 @@
</div> </div>
</div> </div>
<ul v-show="groupVisible" :style="{ height: groupHeight - 110 + 'px' }"> <ul v-show="groupVisible" :style="{ height: groupHeight - 110 + 'px' }">
<li class="group-list" v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''" :key="index" @click="handleGroup(item, index)"> <li class="group-list" v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''"
:key="index" @click="handleGroup(item, index)">
<div> <div>
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle;height:24px;width:24px" /> <img src="@/assets/material/file.png" alt="" style="vertical-align: middle;height:24px;width:24px"/>
<div class="group-name">{{ item.materialGroupName }}</div> <div class="group-name">{{ item.materialGroupName }}</div>
</div> </div>
<div> <div>
...@@ -23,12 +24,17 @@ ...@@ -23,12 +24,17 @@
<!-- <GLButton class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton> <!-- <GLButton class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</GLButton> <GLButton class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</GLButton> --> <GLButton class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</GLButton> -->
<el-button class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</el-button> <el-button class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">
<el-button class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</el-button> {{ item.orderTime ? '取消置顶' : '置顶' }}
<el-button class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</el-button> </el-button>
<el-button class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改
</el-button>
<el-button class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1"
@click="handleDeleteGroup(item.id)">删除
</el-button>
</div> </div>
<div slot="reference"> <div slot="reference">
<img class="more-icon" src="@/assets/material/more.png" alt="" /> <img class="more-icon" src="@/assets/material/more.png" alt=""/>
</div> </div>
</el-popover> </el-popover>
</div> </div>
...@@ -36,12 +42,11 @@ ...@@ -36,12 +42,11 @@
</ul> </ul>
</div> </div>
</template> </template>
<script> <script>
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
name: 'materialGroup', name: 'materialGroup',
props: { eventBus: Object, groupHeight: Number }, props: {eventBus: Object, groupHeight: Number},
data() { data() {
return { return {
// 素材组数量 // 素材组数量
...@@ -102,6 +107,7 @@ export default { ...@@ -102,6 +107,7 @@ export default {
params.groupId = item.id params.groupId = item.id
params.pageNum = 1 params.pageNum = 1
params.pageSize = 1000 params.pageSize = 1000
params.createdType = 2
this.$emit('getList', params, item) this.$emit('getList', params, item)
}, },
// 打开1-新增, 2-编辑 素材组弹框 // 打开1-新增, 2-编辑 素材组弹框
...@@ -133,7 +139,7 @@ export default { ...@@ -133,7 +139,7 @@ export default {
cancelButtonText: '否', cancelButtonText: '否',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$apis.material.deleteMaterialList({ id: rowId }).then(res => { this.$apis.material.deleteMaterialList({id: rowId}).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
...@@ -176,13 +182,12 @@ export default { ...@@ -176,13 +182,12 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.status-words { .status-words {
margin-left: 5px; margin-left: 5px;
} }
.material-group { .material-group {
/deep/.el-popover { /deep/ .el-popover {
min-width: 50px; min-width: 50px;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<div id="div-demo"></div> <div id="div-demo"></div>
</div> </div>
</template> </template>
<script> <script>
import E from 'wangeditor' import E from 'wangeditor'
export default { export default {
...@@ -18,7 +17,7 @@ export default { ...@@ -18,7 +17,7 @@ export default {
props: { props: {
excludeMenus: { excludeMenus: {
type: Array, type: Array,
default: () => ['code'] default: () => ['code','video']
}, },
boxHeight:{ boxHeight:{
type: Number, type: Number,
...@@ -113,7 +112,6 @@ export default { ...@@ -113,7 +112,6 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
#div-demo { #div-demo {
// margin: 16px 300px 0 0; // margin: 16px 300px 0 0;
......
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
<VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia> <VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia>
</div> </div>
</template> </template>
<script> <script>
const materialStatus = { const materialStatus = {
'0': 'normal', '0': 'normal',
...@@ -120,7 +119,6 @@ import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia ...@@ -120,7 +119,6 @@ import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia
import MaterialGroup from '@/views/material/components/materialGroup' import MaterialGroup from '@/views/material/components/materialGroup'
import FunctionIntroduc from '@/views/material/components/functionIntroduc' import FunctionIntroduc from '@/views/material/components/functionIntroduc'
import VideoShowDia from './components/videoDia.vue' import VideoShowDia from './components/videoDia.vue'
export default { export default {
name: 'materialList', name: 'materialList',
components: { components: {
...@@ -140,7 +138,8 @@ export default { ...@@ -140,7 +138,8 @@ export default {
materialType: '', // 素材类型 materialType: '', // 素材类型
businessType: '', // 业务类型 businessType: '', // 业务类型
status: '', // 状态 status: '', // 状态
materialName: '' // 素材名称 materialName: '', // 素材名称
createdType:'2'
}, },
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'}, pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
layout: 'sizes, prev, pager, next, jumper, ->, total', layout: 'sizes, prev, pager, next, jumper, ->, total',
...@@ -265,7 +264,7 @@ export default { ...@@ -265,7 +264,7 @@ export default {
fn: '编辑' fn: '编辑'
}, },
listeners: { listeners: {
click: row => this.addMaterial(2, row) click: row => row.createdType == 1 ? this.addMaterial(3, row) : this.addMaterial(2, row)
} }
}, },
{ {
...@@ -445,14 +444,12 @@ export default { ...@@ -445,14 +444,12 @@ export default {
window.sessionStorage.setItem('firstLogin', 'true') window.sessionStorage.setItem('firstLogin', 'true')
} }
}, },
videoOpen(scope) { videoOpen(scope) {
console.log(scope) console.log(scope)
this.dialogVisibleImg = true this.dialogVisibleImg = true
let dialogSrc = scope.materialContentRpcResponse.materialUrl let dialogSrc = scope.materialContentRpcResponse.materialUrl
this.$refs.VideoShowDia.init(dialogSrc) this.$refs.VideoShowDia.init(dialogSrc)
}, },
// 重置 // 重置
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
...@@ -460,7 +457,8 @@ export default { ...@@ -460,7 +457,8 @@ export default {
materialType: '', materialType: '',
businessType: '', businessType: '',
status: '', status: '',
materialName: '' materialName: '',
createdType:'2'
} }
this.getListApi() this.getListApi()
this.$refs.materialGroup.currentIndex = null this.$refs.materialGroup.currentIndex = null
...@@ -532,7 +530,7 @@ export default { ...@@ -532,7 +530,7 @@ export default {
addMaterial(addOrEdit, scope) { addMaterial(addOrEdit, scope) {
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 1 ? '创建营销素材' : '编辑营销素材') $title: encodeURI(addOrEdit == 1 ? '创建营销素材' : addOrEdit == 2 ? '编辑营销素材' : '查看营销素材')
} }
addOrEdit != 1 && (params.id = scope.id) addOrEdit != 1 && (params.id = scope.id)
addOrEdit != 1 && (params.status = scope.status) addOrEdit != 1 && (params.status = scope.status)
...@@ -558,13 +556,13 @@ export default { ...@@ -558,13 +556,13 @@ export default {
let videoHtml = html.match(/<video.*?(?:>|\/>)/g) let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
if (imgHtml) { if (imgHtml) {
let imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"') let imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = imgSrc ? imgSrc[1] : '' item.materialContentRpcResponse.materialUrl = imgSrc[1]
item.urlType = 'img' item.urlType = 'img'
item.imgCount = imgHtml.length item.imgCount = imgHtml.length
} }
if (videoHtml) { if (videoHtml) {
let videoSrc = videoHtml[0].match('<video[^<>]*? src="([^<>]*?)"') let videoSrc = videoHtml[0].match('<video[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = videoSrc ? videoSrc[1] : '' item.materialContentRpcResponse.materialUrl = videoSrc[1]
item.urlType = 'video' item.urlType = 'video'
} }
} }
...@@ -625,7 +623,6 @@ export default { ...@@ -625,7 +623,6 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.videoMask { .videoMask {
position: absolute; position: absolute;
...@@ -636,43 +633,35 @@ export default { ...@@ -636,43 +633,35 @@ export default {
right: 0; right: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
img { img {
position: relative; position: relative;
align-self: center; align-self: center;
margin: auto; margin: auto;
} }
span { span {
position: absolute; position: absolute;
top: 12px; top: 12px;
right: 15px; right: 15px;
} }
} }
.urlContent { .urlContent {
margin-right: 8px; margin-right: 8px;
position: relative; position: relative;
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
.search-form, .search-form,
.left, .left,
.right { .right {
background-color: #fff; background-color: #fff;
} }
.el-popover { .el-popover {
min-width: 100px; min-width: 100px;
} }
.main-container { .main-container {
height: 100%; height: 100%;
.top { .top {
display: inline-flex; display: inline-flex;
span { span {
margin-left: 16px; margin-left: 16px;
font-size: 16px; font-size: 16px;
...@@ -680,55 +669,44 @@ export default { ...@@ -680,55 +669,44 @@ export default {
} }
} }
} }
ul { ul {
text-align: center; text-align: center;
li { li {
list-style: none; list-style: none;
&:first-child { &:first-child {
padding-bottom: 10px; padding-bottom: 10px;
} }
} }
} }
.container { .container {
margin-top: 10px; margin-top: 10px;
height: 100%; height: 100%;
.search-form { .search-form {
padding: 20px 0 0 20px; padding: 20px 0 0 20px;
} }
.tabelList { .tabelList {
margin-top: 10px; margin-top: 10px;
height: 100%; height: 100%;
.left { .left {
height: 100%; height: 100%;
position: relative; position: relative;
border-right: 1px solid #e8e8ea; border-right: 1px solid #e8e8ea;
} }
.right { .right {
// overflow: auto; // overflow: auto;
.groupTitle { .groupTitle {
padding: 20px 0 16px 19px; padding: 20px 0 16px 19px;
font-weight: 600; font-weight: 600;
} }
.glsx-table { .glsx-table {
margin: 0 20px; margin: 0 20px;
} }
} }
} }
} }
.btn-more { .btn-more {
margin-left: 10px; margin-left: 10px;
} }
.material-content { .material-content {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -742,49 +720,39 @@ ul { ...@@ -742,49 +720,39 @@ ul {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
img { img {
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
} }
.img-plus { .img-plus {
width: 200px; width: 200px;
height: 200px; height: 200px;
} }
.introduc-word { .introduc-word {
font-size: 14px; font-size: 14px;
margin-left: 16px; margin-left: 16px;
color: #5850ff; color: #5850ff;
} }
.pdf-title { .pdf-title {
text-align: right !important; text-align: right !important;
} }
/deep/ .el-table .ascending .sort-caret.ascending { /deep/ .el-table .ascending .sort-caret.ascending {
border-bottom-color: #5850ff; border-bottom-color: #5850ff;
} }
/deep/ .el-table .descending .sort-caret.descending { /deep/ .el-table .descending .sort-caret.descending {
border-top-color: #5850ff; border-top-color: #5850ff;
} }
.select-pro { .select-pro {
display: inline-block; display: inline-block;
padding-bottom: 20px; padding-bottom: 20px;
} }
/deep/ .el-switch__core { /deep/ .el-switch__core {
width: 32px !important; width: 32px !important;
} }
/deep/ .el-table::before { /deep/ .el-table::before {
background-color: transparent; background-color: transparent;
} }
/deep/ .el-table__fixed-right::before { /deep/ .el-table__fixed-right::before {
background-color: transparent; background-color: transparent;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!