Commit 1bb037a9 by 前端

Merge branch 'xuyl_dev_v3.3.0' into 'v3.3.0'

更新3.3.0联调后代码

See merge request !386
2 parents 8b3fce63 544f93f4
......@@ -6,7 +6,7 @@
<h4>{{ title }}</h4>
<el-divider></el-divider>
<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-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName"
:value="item.id"></el-option>
......@@ -20,11 +20,11 @@
</el-form-item>
<el-form-item label="素材名称:" prop="materialName">
<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 label="素材类型:" prop="materialType">
<el-radio-group v-model="materialAddForm.materialType" @change="radioChange"
:disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1">
:disabled="notDisplayProperties">
<el-radio :label="1">PDF文件</el-radio>
<!-- <el-radio :label="2">自定义链接</el-radio> -->
<el-radio :label="3">图文</el-radio>
......@@ -87,7 +87,7 @@
</el-form-item>
<el-form-item label="视频:" class="photoWrap">
<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>
<source :src="materialAddForm.videoUrl" type="video/mp4"/>
</video>
......@@ -95,7 +95,7 @@
<h3>
<img slot="reference" src="@/assets/material/view.png" alt="" @click="viewVideo"/>
<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>
</div>
</div>
......@@ -103,9 +103,9 @@
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传视频</div>
<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/*"
@change="e =>handleVideoChange(e,'mediaUrl')"/>
@change="e =>handleVideoChange(e,'videoUrl')"/>
</div>
<!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> -->
</div>
......@@ -351,7 +351,11 @@ export default {
this.routeInfo.addOrEdit != 1 ? this.getMaterialInfo() : ''
this.routeInfo.addOrEdit != 1 ? (this.routeInfo.status != 1 ? this.forbidEdit() : '') : ''
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.getMaterialList()
// this.findAllDictData('business_type')
......@@ -360,7 +364,7 @@ export default {
methods: {
viewVideo() {
this.dialogVisibleImg = true
this.dialogSrc = this.materialAddForm.mediaUrl
this.dialogSrc = this.materialAddForm.videoUrl
},
handleVideoChange(e) {
let file = e.srcElement.files[0]
......@@ -369,7 +373,7 @@ export default {
const limitSize = 20
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
......@@ -378,7 +382,7 @@ export default {
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadVideoApi({file: base64}).then(res => {
if (res) {
this.materialAddForm.mediaUrl = res
this.materialAddForm.videoUrl = res
}
})
}
......@@ -432,13 +436,12 @@ export default {
},
// 获取素材详情
getMaterialInfo() {
var params = {}
let params = {}
params.id = this.routeInfo.id
console.log(this.routeInfo.status)
if (this.routeInfo.status == -1) {
params.flag = 0
}
console.log(this.routeInfo.id)
params.flag = 0
// if (this.routeInfo.status == -1) {
// params.flag = 0
// }
this.$apis.material.materialDetail(params).then(res => {
this.materialAddForm = res
if (res && res.businessType) {
......@@ -637,6 +640,7 @@ export default {
}
// status 状态 0 启用 -1 禁用 1 存草稿
params.status = 0
params.createdType = 2
let material
if (params.id) {
material = 'materialEdit'
......
......@@ -5,7 +5,9 @@
<i class="el-icon-plus"></i>
创建营销素材
</el-button> -->
<GLButton :size="size" type="primary" fn="新增营销素材" class="el-icon-plus" @click="addMaterial(1)">创建营销素材</GLButton>
<GLButton :size="size" type="primary" fn="新增营销素材" class="el-icon-plus" @click="addMaterial(1)">
创建营销素材
</GLButton>
</div>
<span @click="showIntroductionDialog" class="introduc-word">
功能介绍
......@@ -13,59 +15,64 @@
</span>
<div class="container">
<div class="search-form">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData"
@handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
</div>
<div class="tabelList">
<el-row>
<el-col :span="5">
<div class="left">
<MaterialGroup ref="materialGroup" @openAddDialog="addDialogShow" :groupHeight="boxHeight" :eventBus="eventBus" @getList="getList" @getListApi="getListApi"></MaterialGroup>
<MaterialGroup ref="materialGroup" @openAddDialog="addDialogShow" :groupHeight="boxHeight"
:eventBus="eventBus" @getList="getList" @getListApi="getListApi"></MaterialGroup>
</div>
</el-col>
<el-col :span="19">
<div class="right" :style="{ height: boxHeight + 'px' }">
<div class="groupTitle">{{ materialGroupName }}(共{{ tableTotal }}条数据)</div>
<GLTable ref="materialRef" :hasPage="false" :noDataImg="url" @refreshTable="getListApi" :layout="layout" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true" :customHeadShowList="customHeadShowList">
<GLTable ref="materialRef" :hasPage="false" :noDataImg="url" @refreshTable="getListApi" :layout="layout"
:searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData"
:pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true"
:customHeadShowList="customHeadShowList">
<!-- 素材内容 -->
<div slot="materialContentRpcResponse" slot-scope="scope">
<span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>
<!-- 素材为PDF -->
<!-- <span v-if="scope.scope.materialType == 1" class="material-content">-->
<!-- <img src="@/assets/material/pdf.png" style="margin-right:8px" alt="" />-->
<!-- <el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 12">-->
<!-- <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>-->
<!-- </el-tooltip>-->
<!-- </span>-->
<!-- <span v-if="scope.scope.materialType == 1" class="material-content">-->
<!-- <img src="@/assets/material/pdf.png" style="margin-right:8px" alt="" />-->
<!-- <el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 12">-->
<!-- <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>-->
<!-- </el-tooltip>-->
<!-- </span>-->
<!-- 素材为自定义链接 -->
<!-- <span v-if="scope.scope.materialType == 2"></span>-->
<!-- <span v-if="scope.scope.materialType == 2"></span>-->
<!-- 素材为图文 -->
<!-- <span v-if="scope.scope.materialType == 3 || scope.scope.materialType == 4 || scope.scope.materialType == 5 || scope.scope.materialType == 6" class="material-content">-->
<!-- 图片 -->
<!-- <el-popover placement="top" trigger="hover" v-if="scope.scope.urlType == 'img'">-->
<!-- <div>-->
<!-- <img class="img-plus" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" />-->
<!-- </div>-->
<!-- <div slot="reference" class="urlContent">-->
<!-- <img style="margin-right:8px" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" />-->
<!-- <div class="videoMask" v-if="scope.scope.imgCount > 1">-->
<!-- <img src="@/assets/material/multi.png" alt="" />-->
<!-- <span>{{ scope.scope.imgCount }}</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </el-popover>-->
<!-- 视频 -->
<!-- <div class="urlContent" v-if="scope.scope.urlType == 'video'" @click="videoOpen(scope.scope)">-->
<!-- <video preload loop muted width="36" height="36">-->
<!-- <source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />-->
<!-- </video>-->
<!-- <div class="videoMask">-->
<!-- <img src="@/assets/material/videoIcon.png" style="width: 22px;height: 22px;" alt="" />-->
<!-- </div>-->
<!-- </div>-->
<!-- <el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 14">-->
<!-- <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>-->
<!-- </el-tooltip>-->
<!-- </span>-->
<!-- <span v-if="scope.scope.materialType == 3 || scope.scope.materialType == 4 || scope.scope.materialType == 5 || scope.scope.materialType == 6" class="material-content">-->
<!-- 图片 -->
<!-- <el-popover placement="top" trigger="hover" v-if="scope.scope.urlType == 'img'">-->
<!-- <div>-->
<!-- <img class="img-plus" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" />-->
<!-- </div>-->
<!-- <div slot="reference" class="urlContent">-->
<!-- <img style="margin-right:8px" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" />-->
<!-- <div class="videoMask" v-if="scope.scope.imgCount > 1">-->
<!-- <img src="@/assets/material/multi.png" alt="" />-->
<!-- <span>{{ scope.scope.imgCount }}</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </el-popover>-->
<!-- 视频 -->
<!-- <div class="urlContent" v-if="scope.scope.urlType == 'video'" @click="videoOpen(scope.scope)">-->
<!-- <video preload loop muted width="36" height="36">-->
<!-- <source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />-->
<!-- </video>-->
<!-- <div class="videoMask">-->
<!-- <img src="@/assets/material/videoIcon.png" style="width: 22px;height: 22px;" alt="" />-->
<!-- </div>-->
<!-- </div>-->
<!-- <el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 14">-->
<!-- <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>-->
<!-- </el-tooltip>-->
<!-- </span>-->
</div>
<!-- 状态 -->
<div slot="status" class="dot" slot-scope="scope">
......@@ -92,8 +99,10 @@
</el-row>
</div>
</div>
<AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia>
<FunctionIntroduc :introductionDialog="introductionDialog" @closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
<AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog"
:eventBus="eventBus"></AddMaterialGroupDia>
<FunctionIntroduc :introductionDialog="introductionDialog"
@closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
<VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia>
</div>
</template>
......@@ -111,6 +120,7 @@ import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia
import MaterialGroup from '@/views/material/components/materialGroup'
import FunctionIntroduc from '@/views/material/components/functionIntroduc'
import VideoShowDia from './components/videoDia.vue'
export default {
name: 'materialList',
components: {
......@@ -132,7 +142,7 @@ export default {
status: '', // 状态
materialName: '' // 素材名称
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
layout: 'sizes, prev, pager, next, jumper, ->, total',
// 表格数据
materialTableData: [],
......@@ -147,7 +157,7 @@ export default {
businessTypes: [],
// 素材组名称
materialGroupName: '',
changeName:'编辑',
changeName: '编辑',
materialFormData: [
{
label: '业务类型',
......@@ -255,7 +265,7 @@ export default {
fn: '编辑'
},
listeners: {
click: row => this.addMaterial(2, row)
click: row => row.createdType == 1 ? this.addMaterial(3, row) : this.addMaterial(2, row)
}
},
{
......@@ -313,43 +323,43 @@ export default {
formatter: cellVal => {
return cellVal.sendNum
},
renderHeader: (h, { column, $index }) => {
renderHeader: (h, {column, $index}) => {
return h(
'div',
{
style: {
display: 'inline-flex',
'align-items': 'center',
padding: 0
}
},
[
'发送次数',
h(
'el-popover',
{
attrs: {
placement: 'top-start',
width: '240',
trigger: 'hover',
content: '统计该素材的发送次数(不包含在系统外部的转发次数)'
}
},
[
h('img', {
style: {
width: '17px',
height: '17px',
'vertical-align': 'middle'
},
attrs: {
src: iconUrl
'div',
{
style: {
display: 'inline-flex',
'align-items': 'center',
padding: 0
}
},
[
'发送次数',
h(
'el-popover',
{
attrs: {
placement: 'top-start',
width: '240',
trigger: 'hover',
content: '统计该素材的发送次数(不包含在系统外部的转发次数)'
}
},
slot: 'reference'
})
]
)
]
[
h('img', {
style: {
width: '17px',
height: '17px',
'vertical-align': 'middle'
},
attrs: {
src: iconUrl
},
slot: 'reference'
})
]
)
]
)
}
},
......@@ -361,43 +371,43 @@ export default {
formatter: cellVal => {
return cellVal.readNum
},
renderHeader: (h, { column, $index }) => {
renderHeader: (h, {column, $index}) => {
return h(
'div',
{
style: {
display: 'inline-flex',
'align-items': 'center',
padding: 0
}
},
[
'阅读人数',
h(
'el-popover',
{
attrs: {
placement: 'top-start',
width: '240',
trigger: 'hover',
content: '阅读该素材的人数,内部员工除外。'
}
},
[
h('img', {
style: {
width: '17px',
height: '17px',
'vertical-align': 'middle'
'div',
{
style: {
display: 'inline-flex',
'align-items': 'center',
padding: 0
}
},
[
'阅读人数',
h(
'el-popover',
{
attrs: {
placement: 'top-start',
width: '240',
trigger: 'hover',
content: '阅读该素材的人数,内部员工除外。'
}
},
attrs: {
src: iconUrl
},
slot: 'reference'
})
]
)
]
[
h('img', {
style: {
width: '17px',
height: '17px',
'vertical-align': 'middle'
},
attrs: {
src: iconUrl
},
slot: 'reference'
})
]
)
]
)
}
},
......@@ -516,13 +526,13 @@ export default {
},
// 素材删除
handleDelete(scope) {
this.secondConfirm('提示', '删除素材,该素材将不再可以使用,是否继续删除?', 'material', 'materialDelete', { id: scope.id })
this.secondConfirm('提示', '删除素材,该素材将不再可以使用,是否继续删除?', 'material', 'materialDelete', {id: scope.id})
},
// 1-新增素材,2-编辑素材
addMaterial(addOrEdit, scope) {
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 1 ? '创建营销素材' : '编辑营销素材')
$title: encodeURI(addOrEdit == 1 ? '创建营销素材' : addOrEdit == 2 ? '编辑营销素材' : '查看营销素材')
}
addOrEdit != 1 && (params.id = scope.id)
addOrEdit != 1 && (params.status = scope.status)
......@@ -626,35 +636,43 @@ export default {
right: 0;
width: 100%;
height: 100%;
img {
position: relative;
align-self: center;
margin: auto;
}
span {
position: absolute;
top: 12px;
right: 15px;
}
}
.urlContent {
margin-right: 8px;
position: relative;
width: 36px;
height: 36px;
}
.search-form,
.left,
.right {
background-color: #fff;
}
.el-popover {
min-width: 100px;
}
.main-container {
height: 100%;
.top {
display: inline-flex;
span {
margin-left: 16px;
font-size: 16px;
......@@ -662,44 +680,55 @@ export default {
}
}
}
ul {
text-align: center;
li {
list-style: none;
&:first-child {
padding-bottom: 10px;
}
}
}
.container {
margin-top: 10px;
height: 100%;
.search-form {
padding: 20px 0 0 20px;
}
.tabelList {
margin-top: 10px;
height: 100%;
.left {
height: 100%;
position: relative;
border-right: 1px solid #e8e8ea;
}
.right {
// overflow: auto;
.groupTitle {
padding: 20px 0 16px 19px;
font-weight: 600;
}
.glsx-table {
margin: 0 20px;
}
}
}
}
.btn-more {
margin-left: 10px;
}
.material-content {
display: flex;
align-items: center;
......@@ -713,39 +742,49 @@ ul {
overflow: hidden;
white-space: nowrap;
}
img {
width: 36px;
height: 36px;
}
}
.img-plus {
width: 200px;
height: 200px;
}
.introduc-word {
font-size: 14px;
margin-left: 16px;
color: #5850ff;
}
.pdf-title {
text-align: right !important;
}
/deep/ .el-table .ascending .sort-caret.ascending {
border-bottom-color: #5850ff;
}
/deep/ .el-table .descending .sort-caret.descending {
border-top-color: #5850ff;
}
.select-pro {
display: inline-block;
padding-bottom: 20px;
}
/deep/ .el-switch__core {
width: 32px !important;
}
/deep/ .el-table::before {
background-color: transparent;
}
/deep/ .el-table__fixed-right::before {
background-color: transparent;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!