Commit 777abd7d by 匡雅琴

新增营销素材页面

1 parent 0c6a3c0e
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</template> --> </template> -->
<!-- 选择框 --> <!-- 选择框 -->
<div v-else-if="item.type === 'select'"> <div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)"> <el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option> <el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select> </el-select>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
......
<template>
<div class="container">
<el-form ref=" " :model="materialAddForm" label-width="146px" :rules="materialAddFormRules">
<div class="creat-material">
<h4>{{ title }}</h4>
<el-divider></el-divider>
<el-form-item label="选择素材组:" prop="selectMaterialGroup">
<el-select v-model="materialAddForm.selectMaterialGroup" placeholder="请选择" :size="size">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item label="素材名称:" prop="materialName">
<el-input v-model="materialAddForm.materialName" :size="size" placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item label="素材类型:" prop="materialType">
<el-radio-group v-model="materialAddForm.materialType" @change="radioChange">
<el-radio :label="1">PDF文件</el-radio>
<el-radio :label="2">自定义链接</el-radio>
<el-radio :label="3">图文</el-radio>
</el-radio-group>
<!-- 选择PDF -->
<div v-show="materialAddForm.materialType == 1">
<el-upload action="https://jsonplaceholder.typicode.com/posts/" accept=".pdf" show-file-list :on-remove="handleRemove" :on-success="handleSuccess" :on-error="handleError" :limit="1" :on-exceed="handleExceed" :file-list="fileList">
<el-button type="info" icon="el-icon-plus" :size="size">上传PDF文件</el-button>
<span>支持10M以内的文件</span>
</el-upload>
</div>
<!-- 选择自定义链接 -->
<div v-show="materialAddForm.materialType == 2">
<el-form :model="linkForm" :rules="linkRules" ref="linkForm" label-width="100px">
<el-form-item label="链接地址" prop="link">
<el-input v-model="linkForm.link" placeholder="请填写跳转链接" maxlength="150" show-word-limit></el-input>
</el-form-item>
</el-form>
</div>
<!-- 选择图文 -->
<div v-show="materialAddForm.materialType == 3">
<textBox></textBox>
</div>
</el-form-item>
</div>
<div class="track">
<h4>追踪设置</h4>
<el-divider></el-divider>
<el-form-item label="业务类型:" prop="applicationType">
<el-checkbox-group v-model="materialAddForm.applicationType">
<el-checkbox v-for="(value, index) in businessTypes" :key="index" :label="index">{{ value }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="动态通知:" prop="notification">
<el-radio v-model="materialAddForm.notification">客户打开素材链接时通知发送人</el-radio>
<span class="track-tips track-info">(客户不包括本商户的员工)</span>
</el-form-item>
<el-form-item label="行为标签:" prop="behaviorTag">
<span class="track-behavior">客户打开素材/链接时通知发送人</span>
<span class="track-tips">(最多支持3个标签)</span>
<!-- 选择标签展示 -->
<div>
<span></span>
<el-button :size="size">
<i class="el-icon-plus"></i>
选择标签
</el-button>
</div>
</el-form-item>
</div>
<div class="share">
<div class="share-container">
<div class="share-top">
<span>分享设置</span>
<span class="share-tips">设置自定义分享内容,能提高用户体验,促进用户打开链接的概率</span>
</div>
<div class="share-unfold" @click="shareContainerShow">
<span v-if="!descVisible">
展开
<i class="el-icon-arrow-down"></i>
</span>
<span v-else>
收起
<i class="el-icon-arrow-up"></i>
</span>
</div>
</div>
<el-divider></el-divider>
<div class="share-desc" v-show="descVisible">
<el-form-item label="分享标题:">
<el-input v-model="materialAddForm.title" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义标题"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input type="textarea" v-model="materialAddForm.desc" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义描述"></el-input>
</el-form-item>
<el-form-item label="封面:">
<el-upload class="avatar-uploader" accept=".jpg, .jpeg, png" action="https://jsonplaceholder.typicode.com/posts/" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="materialAddForm.imageUrl" class="avatar" />
<div v-else class="avatar-uploader-desc">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div>
</div>
</el-upload>
<span>查看效果></span>
</el-form-item>
</div>
</div>
<div class="material-bottom">
<el-form-item>
<div class="btns">
<el-button @click="onSave" :size="size">存草稿</el-button>
<el-button :size="size" @click="handleSubmit" type="primary">确定</el-button>
<el-button :size="size" @click="handleCancel" type="primary">取消</el-button>
</div>
</el-form-item>
</div>
</el-form>
</div>
</template>
<script>
import textBox from '@/views/material/components/textBox'
export default {
name: 'addMaterialForm',
components: {
textBox
},
data() {
return {
title: '创建营销素材',
titleObj: {
1: '创建营销素材',
2: '编辑营销素材'
},
materialAddForm: {
selectMaterialGroup: '',
materialName: '',
materialType: '',
applicationType: [],
notification: '',
behaviorTag: [],
title: '',
desc: '',
imageUrl: ''
},
// 素材类型--链接
linkForm: {
link: ''
},
fileList: [],
// 分享设置显示
descVisible: false,
businessTypes: ['整车/新车', '保养', '维修', '车险', '二手车', '改装', '汽车金融', '零配件/精品', '通用(节假日等关怀素材)'],
materialAddFormRules: {
selectMaterialGroup: [{ required: true, message: '请选择素材组', trigger: 'change' }],
materialName: [
{ required: true, message: '请输入素材名称', trigger: 'change' },
{ max: 5, message: '素材名称长度不能超过30', trigger: 'blur' }
],
materialType: [{ required: true, message: '请选择素材类型', trigger: 'change' }],
applicationType: [{ required: true, message: '请选择业务类型', trigger: 'change' }]
},
linkRules: {
link: [
{ required: true, message: '请输入链接地址', trigger: 'change' },
{ max: 150, message: '链接地址长度不能超过30', trigger: 'blur' }
]
}
}
},
mounted() {
this.routeInfo = this.$route.query
this.title = this.titleObj[this.routeInfo.addOrEdit]
// this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
},
methods: {
// 素材类型切换
radioChange(value) {
console.log(value)
this.materialAddForm.materialType = value
},
// 素材类型上传PDF,移除
handleRemove() {},
// 素材类型上传PDF,上传成功
handleSuccess() {},
// 素材类型上传PDF,上传失败
handleError() {},
// 素材类型上传PDF,超出限制
handleExceed() {},
// 存草稿
onSave() {},
// 提交
handleSubmit() {
this.$refs.materialAddform.validate(valid => {
if (valid) {
alert('submit!')
} else {
console.log('error submit!!')
return false
}
})
},
// 取消
handleCancel() {
this.$router.push('/material/index')
},
// 分享设置展示
shareContainerShow() {
this.descVisible = !this.descVisible
}
}
}
</script>
<style lang="scss" scoped>
.creat-material,
.track,
.share,
.material-bottom {
background-color: #fff;
}
.creat-material,
.track {
margin-bottom: -10px;
}
.container {
h4,
.share-container {
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin: 17px 0 17px 20px;
&:first-child {
padding-top: 17px;
margin-top: 0;
}
}
}
.track {
&-tips {
font-size: 14px;
color: #999999;
}
&-info {
margin-left: -28px;
}
&-behavior {
color: #606266;
}
}
.share {
&-container {
display: flex;
justify-content: space-between;
.share-unfold {
span {
font-size: 12px;
color: #5850ff;
margin: 20px 21px 20px 0;
}
}
}
&-tips {
color: #999999;
font-size: 14px;
margin-left: 16px;
}
}
.material-bottom {
height: 78px;
position: relative;
.el-form-item {
position: absolute;
top: 25%;
left: 40%;
.el-form-item__content {
margin-left: 0;
}
}
.btns {
.el-button {
padding: 10px 24px;
margin-left: 20px;
&:nth-child(1) {
margin-left: 0;
padding: 10px 17px;
}
}
}
}
.el-input--small,
.el-select,
.el-select--small {
width: 411px;
}
.avatar-uploader,
.el-upload {
border: 1px dashed #d9d9d9;
height: 104px;
width: 104px;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader,
.el-upload:hover {
border: 1px dashed rgba(0, 0, 0, 0.15);
}
.avatar-uploader-desc {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
&-icon {
font-size: 24px;
color: #8c939d;
}
&-word {
width: 78px;
height: 22px;
font-size: 14px;
color: #666666;
}
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="!dialogVisible">
<el-form ref="materialGroupAddForm" :model="materialGroupAddForm" label-width="120px" :rules="materialGroupAddRules">
<el-form-item label="分组名称:" prop="groupName">
<el-input v-model="materialGroupAddForm.groupName" maxlength="8" show-word-limit></el-input>
</el-form-item>
<el-form-item label="业务类型:" prop="businessType">
<el-checkbox-group v-model="materialGroupAddForm.businessType" @change="handleCheckChange">
<el-checkbox v-for="value in businessTypes" :key="value" :label="value">{{ value }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
<span>添加业务类型,该素材组里面的所有素材均会添加此业务类型</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm">确定创建</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'addMaterialGroupDia',
data() {
return {
title: '新增素材组',
dialogVisible: false,
materialGroupAddForm: {
groupName: '',
businessType: []
},
businessTypes: ['整车/新车','保养','维修','车险','二手车','改装','汽车金融','零配件/精品','通用(节假日等关怀素材)'],
materialGroupAddRules: {
groupName: [
{ required: true, message: '请输入分组名称', trigger: 'blur' },
{ max: 16, message: '分组名称最长为8个字', trigger: 'blur' }
]
}
}
},
methods: {
init(value) {
// console.log(value, '~~~~');
if (value == 1) {
this.materialGroupAddForm = {
groupName: '',
businessType: []
}
}
this.dialogVisible = true
},
// 创建
submitForm() {
this.$refs.materialGroupAddForm.validate((valid) => {
if (valid) {
this.$emit('addMaterialGroup', this.materialGroupAddForm)
this.dialogVisible = false
} else {
alert('请输入分组名称')
return false;
}
});
},
handleCheckChange(val) {
console.log(val);
this.materialGroupAddForm.businessType = val
// console.log(this.materialGroupAddForm);
}
}
}
</script>
<style>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<glsx-combi-form ref="readPerDetailFormRef" :formObj="searchForm" :formData="readPerDetailFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="default" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span>
</glsx-combi-form>
<GLTable ref="readPerDetailRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="readPerDetailTableData" :pageConf="pageConf" :tableTotal="tableTotal">
</GLTable>
</div>
</template>
<script>
import url from "@/assets/empty.png"
export default {
name: 'readPerDetail',
data() {
return {
url,
searchForm: {
staffName: ''
},
readPerDetailFormData: [
{
label: '客户名称:',
name: 'cunstormName',
maxlength: 10,
type: 'input'
},
{
label: '发送人:',
name: 'staffName',
maxlength: 10,
type: 'input'
}
],
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '客户名称',
prop: 'cunstormName'
},
{
label: '发送人',
prop: 'staffName'
},
{
label: '所属企微成员',
prop: 'resdTimes'
},
{
label: '阅读次数',
prop: 'readTimes'
},
{
label: '首次阅读时间',
prop: 'firstReadTime'
},
{
label: '最后阅读时间',
prop: 'lastReadTime'
}
]
}
}
}
}
</script>
<style lang="" scoped>
</style>
<template>
<div>
<glsx-combi-form ref="staffSendFormRef" :formObj="searchForm" :formData="staffSendFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="default" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span>
</glsx-combi-form>
<GLTable ref="materialRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="staffSendTableData" :pageConf="pageConf" :tableTotal="tableTotal">
</GLTable>
</div>
</template>
<script>
import url from "@/assets/empty.png"
export default {
name: 'staffSendDetail',
data() {
return {
url,
searchForm: {
staffName: ''
},
staffSendFormData: [
{
label: '姓名:',
name: 'staffName',
type: 'input'
}
],
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '发送次数',
prop: 'sendTimes',
sortable: true
},
{
label: '阅读次数',
prop: 'resdTimes',
sortable: true
},
{
label: '阅读人数',
prop: 'readPer'
},
{
label: '打开率',
prop: 'openRate'
}
]
}
}
}
}
</script>
<style lang="" scoped>
</style>
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
content: '',
editorOption: {},
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
var editor = new E('#div-demo')
editor.config.uploadImgShowBase64 = true
editor.config.showMenuTooltips = true
editor.config.menuTooltipPosition = 'down'
editor.config.height = 400
editor.config.uploadVideoServer = '/api/upload-video'
editor.config.excludeMenus = [
'code'
]
editor.create()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
margin-top: 40px;
}
.el-form .editor{
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main-container">
<div class="top">
<el-button type="primary" @click="addMaterial(1)" :size="size">
<i class="el-icon-plus"></i>
创建营销素材
</el-button>
<span>功能介绍<i class="el-icon-arrow-right"></i></span>
</div>
<div class="container">
<div class="search-form">
<glsx-combi-form ref="materialFormRef" :isEdit="isEdit" :formObj="searchForm" :formData="materialFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span>
</glsx-combi-form>
</div>
<div class="tabelList">
<el-row>
<el-col :span="5">
<div class="left">
<el-button class="add-group" type="primary" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">创建素材组</el-button>
<div class="all-group">全部素材组 ({{ groupCounter.length }})</div>
<ul>
<!-- <li class="all-group">全部素材组({{ groupCounter.length }})</li> -->
<li>
新车素材组(默认)
<el-popover placement="right" width="20" trigger="hover">
<el-button-group>
<el-button type="text" @click="handleStick">置顶</el-button>
<el-button type="text" @click="handleAddGroup(2)">修改</el-button>
<el-button type="text" @click="handleDeleteGroup">删除</el-button>
</el-button-group>
<i slot="reference" class="el-icon-more"></i>
</el-popover>
</li>
<li v-for="(item, index) in groupCounter" :key="index">
{{ item.groupName }}
<el-popover placement="left" width="400" trigger="hover">
<el-button-group>
<el-button type="text" @click="handleStick">置顶</el-button>
<el-button type="text" @click="handleAddGroup(2)">修改</el-button>
<el-button type="text" @click="handleDeleteGroup">删除</el-button>
</el-button-group>
<i slot="reference" class="el-icon-s-tools"></i>
</el-popover>
</li>
</ul>
</div>
</el-col>
<el-col :span="19">
<div class="right">
<div class="groupTitle">新车素材组 (共{{ materialTableData.length }}条数据)</div>
<GLTable ref="materialRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange">
<!-- 素材内容 -->
<div slot="materialContent">
<!-- 素材内容为自定义文本 -->
<div v-if="materialTableData.materialType === '图文'">
<div>素材标题</div>
<div>放置图片</div>
</div>
<!-- 素材内容为PDF -->
<div v-if="materialTableData.materialType === 'PDF'">
<div>素材标题</div>
<div>PDF图片 pdf文件名.pdf</div>
</div>
<!-- 素材内容链接 -->
<div v-if="materialTableData.materialType === '自定义链接'">
<div>素材标题</div>
<div>
<div>图片</div>
<div>链接</div>
</div>
</div>
</div>
<!-- 状态 -->
<div slot="status"></div>
<span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
<el-button type="text" @click="addMaterial(2, scope.scope)">编辑</el-button>
<el-button type="text">更多</el-button>
<!-- <el-button type="text" @click="handleForbid(scope)">禁用</el-button> -->
<!-- <el-button type="text" @click="handleDelete(scope)">删除</el-button> -->
</span>
</GLTable>
</div>
</el-col>
</el-row>
</div>
</div>
<AddMaterialGroupDia ref="addMaterialGroup" :dialogVisible="materialGroupDialog" @addMaterialGroup="addGroup"></AddMaterialGroupDia>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia'
export default {
name: 'materialList',
components: {
AddMaterialGroupDia
},
data() {
return {
url,
searchForm: {
applicationType: '',
materialType: '',
status: '',
materialName: ''
},
materialTableData: [
{
id: 123,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 5,
readPer: 100,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
},
{
id: 124,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 6,
readPer: 100,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
},
{
id: 125,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 5,
readPer: 112,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
},
{
id: 126,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 5,
readPer: 30,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
}
],
materialGroupDialog: false,
// 素材组
groupCounter: [],
materialFormData: [
{
label: '业务类型:',
name: 'applicationType',
type: 'select',
placeholder: '全部'
},
{
label: '素材类型:',
name: 'materialType',
type: 'select',
placeholder: '全部类型'
},
{
label: '状态:',
name: 'status',
type: 'select',
placeholder: '全部(不包括删除)'
},
{
label: '素材名称:',
name: 'materialName',
type: 'input',
placeholder: '输入素材关键字'
}
],
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '素材内容',
prop: 'materialContent',
addHtml: 'materialContent'
},
{
label: '状态',
prop: 'status'
// addHtml: 'status'
},
{
label: '类型',
prop: 'materialType'
},
{
label: '发送次数',
prop: 'sendTimes',
sortable: true
},
{
label: '阅读人数',
prop: 'readPer',
sortable: true
},
{
label: '有效阅读人数',
prop: 'effect_readPer',
sortable: true,
width: '160px'
},
{
label: '更新时间',
prop: 'updateTime',
sortable: true
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableTotal: 4
}
},
methods: {
// 搜索
handleSearch() {
this.$refs.materialRef.refreshTable()
},
// 重置
handleReset() {
this.searchForm = {
applicationType: '',
materialType: '',
status: '',
materialName: ''
}
this.handleSearch()
},
// 素材详情
handleDetail(scope) {
console.log(scope.id)
// this.$router.push('/material/materialDetail/' + scope.id)
this.$router.push({
path: '/material/materialDetail',
query: scope.id
})
},
// 素材禁用
handleForbid() {
this.$confirm('禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', '提示', {
distinguishCancelAndClose: true,
confirmButtonText: '确定禁用',
cancelButtonText: '取消'
})
.then(() => {
this.$message({
type: 'info',
message: '禁用成功'
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消禁用'
})
})
},
// 素材删除
handleDelete() {
this.$confirm('删除素材,所有已经发送给客户的素材链接均会失效,是否继续删除?', '提示', {
distinguishCancelAndClose: true,
confirmButtonText: '确定删除',
cancelButtonText: '取消'
})
.then(() => {
this.$message({
type: 'info',
message: '删除成功'
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 打开1-新增, 2-编辑 素材组弹框
handleAddGroup(addOrEdit, value) {
console.log(addOrEdit, value)
this.materialGroupDialog = true
this.$refs.addMaterialGroup.init(addOrEdit)
},
// 新增或编辑素材组
addGroup(value) {
this.groupCounter.push(value)
console.log(this.groupCounter, '-----')
},
// 素材组置顶
handleStick() {},
// 素材组删除
handleDeleteGroup() {},
// 1-新增素材,2-编辑素材
addMaterial(addOrEdit, scope) {
console.log(addOrEdit, scope)
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 1 ? '创建营销素材' : '编辑营销素材')
}
addOrEdit != 1 && (params.id = scope.id)
this.$router.push({
path: '/material/addMaterial',
query: params
})
},
// 排序
sortChange(sort) {
console.log(sort)
// 获取字段名称和排序类型
var fieldName = sort.prop
var sortingType = sort.order
//如果字段名称为“创建时间”,将“创建时间”转换为时间戳,才能进行大小比较
// if(fieldName=="createTime"){
// this.tableData2.map(item => {
// item.createTime = this.$moment(item.createTime).valueOf()
// })
// 次数排序
if (sort.column.label === '发送次数') {
this.handleSort(sortingType, fieldName)
}
// 阅读人数排序
if (sort.column.label === '阅读人数') {
this.handleSort(sortingType, fieldName)
}
// 有效阅读人数排序
if (sort.column.label === '有效阅读人数') {
this.handleSort(sortingType, fieldName)
}
},
// 排序规则
handleSort(sortingType, fieldName) {
//按照降序排序
if (sortingType == 'descending') {
this.materialTableData = this.materialTableData.sort((a, b) => b[fieldName] - a[fieldName])
}
//按照升序排序
else {
this.materialTableData = this.materialTableData.sort((a, b) => a[fieldName] - b[fieldName])
}
}
}
}
</script>
<style lang="scss" scoped>
.search-form,
.left,
.right {
background-color: #fff;
}
.main-container {
height: 100%;
.top {
span {
margin-left: 16px;
font-size: 16px;
color: #5850FF;
}
}
}
.container {
margin-top: 10px;
height: 100%;
.search-form {
padding: 20px 68px 0 68px;
}
.tabelList {
margin-top: 10px;
height: 100%;
.left {
height: 100%;
position: relative;
border-right: 1px solid #E8E8EA;
.add-group {
margin: 20px 0 16px 16px;
}
.all-group {
font-size: 16px;
font-weight: 600;
margin: 0 0 19px 16px;
}
ul {
li {
list-style: none;
margin: 0 0 22px 18px;
position: relative;
i {
font-size: 16px;
position: absolute;
right: 16px;
transform:rotate(90deg);
}
}
}
}
.right {
.groupTitle {
padding: 20px 0 16px 19px;
font-weight: 600;
}
.glsx-table {
margin: 0 20px;
}
}
}
}
</style>>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="materialDetail">
<span class="materialDetail-title top-title">素材详情</span>
<el-divider></el-divider>
<div class="matrial-detail">
<div class="matrial-detail-left">
<span class="materialDetail-title">我是素材名称我是素材名称</span>
<span class="matrial-detail-left-pre">预览</span>
</div>
<div @click="detailShowVisible" class="matrial-detail-unfold">
<span v-if="!detailVisible">
展开
<i class="el-icon-arrow-down"></i>
</span>
<span v-else>
收起
<i class="el-icon-arrow-up"></i>
</span>
</div>
</div>
<div v-show="detailVisible" class="materialDetail-desc">
<el-descriptions>
<el-descriptions-item label="素材地址:">kooriookwehrhdfvssdgdfhtykyuirami</el-descriptions-item>
<el-descriptions-item label="创建时间:">18100000000</el-descriptions-item>
<el-descriptions-item label="素材组:">苏州市</el-descriptions-item>
<el-descriptions-item label="素材类型:">苏州市</el-descriptions-item>
<el-descriptions-item label="业务类型:">苏州市</el-descriptions-item>
<el-descriptions-item label="动态通知:">苏州市</el-descriptions-item>
<el-descriptions-item label="行为标签:">苏州市</el-descriptions-item>
<el-descriptions-item label="素材内容:">
<div>这里显示素材内容</div>
</el-descriptions-item>
<el-descriptions-item label="分享设置:">
<div>这里显示分享内容</div>
</el-descriptions-item>
</el-descriptions>
</div>
</div>
<div class="summarization">
<div class="countTime">
<span class="materialDetail-title top-title">数据概览</span>
</div>
<el-divider></el-divider>
<div>
<span>统计时间:</span>
<el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :size="size"></el-date-picker>
<el-button type="primary" :size="size">确定</el-button>
</div>
<div class="dataList">
<div>
<h5>总发送人数</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
<div>
<h5>总发送次数</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
<div>
<h5>总阅读人数</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
<div>
<h5>总阅读次数</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
<div>
<h5>打开率</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
</div>
<div class="detailTable">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="员工发送明细" name="staffSendDetail"></el-tab-pane>
<el-tab-pane label="阅读人员明细" name="readPerDetail"></el-tab-pane>
</el-tabs>
<staffSendDetail v-if="activeName == 'staffSendDetail'"></staffSendDetail>
<readPerDetail v-if="activeName == 'readPerDetail'"></readPerDetail>
</div>
</div>
</div>
</template>
<script>
import staffSendDetail from './components/staffSendDetail.vue'
import readPerDetail from './components/readPerDetail.vue'
export default {
name: 'materialDetail',
components: {
staffSendDetail,
readPerDetail
},
data() {
return {
activeName: 'staffSendDetail',
detailVisible: true
}
},
methods: {
detailShowVisible() {
this.detailVisible = !this.detailVisible
}
}
}
</script>
<style lang="scss" scoped>
.materialDetail,
.summarization {
background-color: #fff;
}
.matrial-detail {
display: flex;
justify-content: space-between;
margin: 33px 0 0 42px;
.matrial-detail-left {
padding-bottom: 16px;
&-pre {
margin-left: 10px;
font-size: 14px;
color: #5850FF;
font-weight: 600;
}
}
&-unfold {
margin-right: 23px;
font-size: 12px;
color: #5850FF;
}
}
.summarization {
margin-top: 20px;
.dataList {
margin: 16px 20px 20px 20px;
display: flex;
justify-content: space-around;
div {
width: 212px;
height: 128px;
background-color: #ccc;
margin-right: 10px;
}
:last-child {
margin-right: 0;
}
}
}
.materialDetail-title {
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
.top-title {
display: inline-block;
margin: 17px 0 0 20px;
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!