Commit 080932a7 by 匡雅琴

营销素材话书库

1 parent 498064e8
This diff could not be displayed because it is too large.
......@@ -13,7 +13,7 @@
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.4.3",
"glsx-components": "^1.4.2",
"lodash": "^4.17.21",
"node-sass": "^4.0.0",
"vue": "^2.6.10",
......

790 Bytes | W: | H:

594 Bytes | W: | H:

src/assets/material/pdf.png
src/assets/material/pdf.png
src/assets/material/pdf.png
src/assets/material/pdf.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -30,7 +30,13 @@
<input type="file" style="opacity: 0" accept=".pdf" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1" @change="e => handlePdfChange(e)" />
<el-button icon="el-icon-plus" :size="size" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1">选择文件</el-button>
</div>
<div v-if="pdfUrl">{{ pdfUrl }}</div>
<!-- <div v-if="pdfUrl">{{ pdfUrl }}</div> -->
<ul v-if="pdfName || materialAddForm.materialUrl">
<li class="pdf-show">
<span class="pdf-name" @click="openPdfDia">{{ pdfName || materialAddForm.materialUrl }}</span>
<i v-if="routeInfo.addOrEdit == 1" class="el-icon-close" @click="delPdf"></i>
</li>
</ul>
</div>
<!-- 选择自定义链接 -->
<!-- <div v-show="materialAddForm.materialType == 2">
......@@ -76,7 +82,7 @@
:
</span>
</span>
<el-checkbox v-model="materialAddForm.isNotifySender" :checked="checked" @change="notifyChange">客户打开素材链接时通知发送人</el-checkbox>
<el-checkbox :value="materialAddForm.isNotifySender" :checked="checked" @change="notifyChange">客户打开素材链接时通知发送人</el-checkbox>
<span class="track-tips track-info">(客户不包括本商户的员工)</span>
</el-form-item>
<el-form-item prop="tagJson">
......@@ -176,6 +182,7 @@
</div>
</el-form>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :dialogVisible="dialogVisible"></SelectLabel>
<!-- <pdfReviewDia ref="pdfReviewDia" :pdfName="pdfName" :pdfUrl="pdfUrl" :dialogVisible="dialogPdfVisible"></pdfReviewDia> -->
<GLFooter class="gl-footer">
<el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</el-button>
<el-button @click="handleCancel" class="btn-cancle">取消</el-button>
......@@ -187,11 +194,13 @@
<script>
import textBox from '@/views/material/components/textBox'
import SelectLabel from '@/views/material/components/selectLable'
// import pdfReviewDia from './components/pdfReviewDia.vue'
export default {
name: 'addMaterialForm',
components: {
textBox,
SelectLabel
// pdfReviewDia
},
data() {
return {
......@@ -205,6 +214,8 @@ export default {
tagging: [],
urlSrc: '',
pdfUrl: '',
pdfName: '',
dialogPdfVisible: false,
textBoxContent: '',
materialAddForm: {
groupId: '', // 素材组id
......@@ -244,7 +255,6 @@ export default {
},
mounted() {
this.routeInfo = this.$route.query
console.log(this.routeInfo)
this.routeInfo.addOrEdit != 1 ? this.getMaterialInfo() : ''
this.routeInfo.addOrEdit != 1 ? (this.routeInfo.status != 1 ? this.forbidEdit() : '') : ''
this.title = this.titleObj[this.routeInfo.addOrEdit]
......@@ -396,6 +406,12 @@ export default {
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.pdfUrl = res
this.pdfName = file.name
this.$notify({
title: '成功',
message: '文件上传成功',
type: 'success'
})
}
})
}
......@@ -428,6 +444,13 @@ export default {
this.$refs.materialAddForm.validate(valid => {
if (valid) {
var params = this.getParams()
if (!params.materialUrl) {
this.$message({
message: '素材类型不能为空',
type: 'warning'
})
return
}
params.status = 1
let material
if (params.id) {
......@@ -471,6 +494,13 @@ export default {
// }
// })
var params = this.getParams()
if (!params.materialUrl) {
this.$message({
message: '素材类型不能为空',
type: 'warning'
})
return
}
// status 状态 0 启用 -1 禁用 1 存草稿
params.status = 0
// params.isNotifySender = -1
......@@ -568,6 +598,15 @@ export default {
// 删除上传图片
deleteImg() {
this.materialAddForm.titleUrl = ''
},
// 删除pdf
delPdf() {
this.pdfUrl = ''
this.pdfName = ''
},
openPdfDia() {
this.dialogPdfVisible = true
this.$refs.pdfReviewDia.init()
}
}
}
......@@ -751,7 +790,6 @@ export default {
.pdf-show {
display: inline-flex;
position: relative;
width: 109px;
height: 32px;
input {
position: absolute;
......@@ -878,4 +916,29 @@ export default {
vertical-align: middle;
}
}
ul {
margin-top: 5px;
.pdf-show {
// width: 200px;
list-style: none;
align-items: center;
position: relative;
padding: 0 8px;
.pdf-name {
margin-right: 20px;
&:hover {
color: #5850ff;
}
}
&:hover {
cursor: pointer;
background-color: rgba(88, 80, 255, 0.2) !important;
}
i {
position: absolute;
right: 5px;
top: 10px;
}
}
}
</style>
<template>
<div class="material-group">
<div class="material-group" :style="{ height: groupHeight + 'px' }">
<el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">素材组</el-button>
<div class="all-group">
<div class="all-group-word" @click="getList">全部素材组 ({{ groupCounter.length }})</div>
<div>
<el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">素材组</el-button>
<div @click="getList">
<img src="@/assets/material/groupIcon.png" alt="" />
全部素材组 ({{ groupCounter.length }})
</div>
<div @click="groupVisible = !groupVisible">
<i class="el-icon-arrow-down" v-show="groupVisible"></i>
<i class="el-icon-arrow-up" v-show="!groupVisible"></i>
</div>
</div>
<ul>
<ul v-show="groupVisible" :style="{ height: groupHeight - 110 + 'px' }">
<li v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''" :key="index" @click="handleGroup(item, index)">
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle" />
<div class="group-name">{{ item.materialGroupName }}</div>
......@@ -27,7 +32,7 @@
import * as dayjs from 'dayjs'
export default {
name: 'materialGroup',
props: { eventBus: Object },
props: { eventBus: Object, groupHeight: Number },
data() {
return {
// 素材组数量
......@@ -38,7 +43,8 @@ export default {
orderValue: '',
isDefault: '' // 默认素材组 0 是 -1 否(进入页面如果素材组数量为0,就会创建默认素材组,默认素材组不可删除)
},
currentIndex: null
currentIndex: null,
groupVisible: true
}
},
mounted() {
......@@ -165,6 +171,7 @@ export default {
<style lang="scss" scoped>
.el-popover {
min-width: 50px;
max-width: 150px;
&:hover {
cursor: pointer;
}
......@@ -172,18 +179,23 @@ export default {
.material-group {
.all-group {
font-size: 16px;
font-weight: 600;
padding: 24px 16px 8px 16px;
height: 44px;
line-height: 44px;
padding: 0 17px 0 16px;
display: flex;
justify-content: space-between;
.el-button {
margin-top: -13px;
cursor: pointer;
img {
width: 24px;
height: 24px;
vertical-align: middle;
}
&-word {
cursor: pointer;
i {
color: #999999;
}
}
ul {
overflow: auto;
li {
cursor: pointer;
text-align: left;
......@@ -210,17 +222,20 @@ ul {
list-style: none;
position: relative;
vertical-align: middle;
margin: 0 10px;
&:nth-child(-n + 2) {
padding-bottom: 10px;
}
&:hover {
color: #5850ff;
// color: #5850ff;
background-color: #ebeaff;
}
}
}
.add_btn {
color: #5850ff;
border-color: #5850ff;
margin: 20px 0 12px 16px;
}
.group-name {
display: inline-flex;
......
<template>
<div>
<el-dialog :title="pdfName" :visible.sync="dialogPdfVisible" width="90%" top="20px">
<iframe ref="iframeRef" :src="pdfUrl"></iframe>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'pdfReviewDia',
props: ['pdfUrl', 'pdfName'],
data() {
return {
dialogPdfVisible: false
}
},
methods: {
init() {
this.dialogPdfVisible = true
}
}
}
</script>
<style lang="scss" scoped>
.el-dialog {
.el-dialog__body {
display: flex;
justify-content: center;
padding: 0;
iframe {
width: 88vw;
height: 80vh;
}
}
}
</style>
......@@ -7,11 +7,24 @@
</span>
</glsx-combi-form>
<GLTable ref="readPerDetailRef" @setTableFinishFun="setTableFinishFun" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<div slot="departName" slot-scope="scope">
<el-tag type="info" v-for="item in scope.scope.departName" effect="plain" :key="item">
<i class="el-icon-user-solid" style="color: #75acff"></i>
{{ item }}
</el-tag>
<div slot="departName" slot-scope="scope" style="display:flex">
<div v-for="(item, index) in scope.scope.departName" :key="index">
<el-tag type="info" :size="size" effect="plain" v-if="index < 3" style="margin-right:4px">
<i class="el-icon-user-solid" style="color: #75acff"></i>
{{ item }}
</el-tag>
<el-tag type="info" :size="size" v-if="scope.scope.departName.length > 3 && index == 3">
<el-popover placement="top" width="500" trigger="hover">
<span slot="reference">...({{ scope.scope.departName.length }})</span>
<div class="entmicro-hover">
<el-tag class="toptip" type="info" v-for="(i, index) in scope.scope.departName" :size="size" :key="index">
<i class="el-icon-user-solid" style="color: #75acff"></i>
{{ i }}
</el-tag>
</div>
</el-popover>
</el-tag>
</div>
</div>
</GLTable>
</div>
......@@ -76,7 +89,8 @@ export default {
{
label: '所属企微成员',
prop: 'departName',
addHtml: 'departName'
addHtml: 'departName',
width: 350
},
{
label: '阅读次数',
......@@ -111,10 +125,17 @@ export default {
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.readPerDetailRef.data.length ? (this.$refs.readPerDetailRef.tableHeightValues = '') : this.$refs.readPerDetailRef.setTableHeightFun()
this.$refs.readPerDetailRef.data.length ? (this.$refs.readPerDetailRef.tableHeightValues = '') : (this.$refs.readPerDetailRef.tableHeightValues = '280px')
}
}
}
</script>
<style lang="" scoped></style>
<style lang="scss" scoped>
.toptip {
margin-right: 4px;
&:nth-last-of-type(-n + 4) {
margin-bottom: 0;
}
}
</style>
......@@ -149,7 +149,8 @@ export default {
if (this.selectNum > 3) {
this.$message({
message: '最多选择三个标签',
type: 'warning'
type: 'warning',
customClass: 'dialog-tips'
})
return
}
......
......@@ -101,7 +101,7 @@ export default {
this.$apis.material.sendDetailPage(params).then(res => {
this.sendStaffTableData = res
// 计算表格高度,数据10条以下自适应,10条以上固定高度,表格内滚动,无数据调用方法计算高度
res.length ? (res.length > 10 ? (this.$refs.staffSendDetailRef.tableHeightValues = '425px') : (this.$refs.staffSendDetailRef.tableHeightValues = '')) : this.$refs.staffSendDetailRef.setTableHeightFun()
res.length ? (res.length > 10 ? (this.$refs.staffSendDetailRef.tableHeightValues = '425px') : (this.$refs.staffSendDetailRef.tableHeightValues = '')) : (this.$refs.staffSendDetailRef.tableHeightValues = '325px')
// res.length > 10 ? (this.$refs.staffSendDetailRef.tableHeightValues = '425px') : (this.$refs.staffSendDetailRef.tableHeightValues = '')
})
}
......
......@@ -27,13 +27,13 @@ export default {
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400
this.editor.config.width = 500
this.editor.config.uploadVideoServer = '/api/upload-video'
this.editor.config.excludeMenus = ['code', 'video']
this.editor.config.excludeMenus = ['code']
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
// 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
......@@ -59,6 +59,32 @@ export default {
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
......
......@@ -24,7 +24,12 @@
</div>
<div class="materialDetail-desc-item" v-if="detailInfo.materialType == 1">
<div class="materialDetail-item-name">素材地址:</div>
{{ detailInfo.materialUrl }}
<span class="copy-img">
<span id="materialUrl">
{{ detailInfo.materialUrl }}
</span>
<img @click="copyUrl" src="@/assets/material/copy.png" alt="" />
</span>
<span class="item-name-info">(备注:直接复制素材地址发送给客户无法接受通知提醒)</span>
</div>
<div class="materialDetail-desc-row">
......@@ -155,7 +160,7 @@
</div>
</div>
</el-dialog>
<GLFooter>
<GLFooter class="gl-footer">
<el-button @click="goback" type="primary">返回</el-button>
</GLFooter>
</div>
......@@ -220,14 +225,17 @@ export default {
this.detailInfo.materialUrl = decodeURIComponent(this.detailInfo.materialUrl)
let html = this.detailInfo.materialUrl
let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
// for (let i = 0; i < imgHtml.length; i++) {
// html = html.replace(imgHtml[i], '')
// }
let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
if (imgHtml) {
for (let i = 0; i < imgHtml.length; i++) {
html = html.replace(imgHtml[i], '')
}
}
if (videoHtml) {
for (let i = 0; i < videoHtml.length; i++) {
html = html.replace(videoHtml[i], '')
}
}
this.htmlContent = html
if (imgHtml) {
this.imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"')
......@@ -266,6 +274,18 @@ export default {
},
goback() {
this.$router.go(-1)
},
copyUrl() {
const range = document.createRange()
range.selectNode(document.getElementById('materialUrl'))
const selection = window.getSelection()
if (selection.rangeCount > 0) selection.removeAllRanges()
selection.addRange(range)
document.execCommand('copy')
this.$message({
message: '复制成功',
type: 'success'
})
}
}
}
......@@ -322,16 +342,18 @@ export default {
flex: 1;
.content-item-title {
color: #333333;
max-width: 210px;
font-family: PingFangSC-Regular, PingFang SC;
max-width: 185px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 20px;
margin-bottom: 6px;
}
.content-item-desc {
color: #999999;
line-height: 20px;
max-width: 210px;
max-width: 185px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
......@@ -459,6 +481,7 @@ export default {
font-size: 14px;
color: #999999;
line-height: 20px;
margin-left: 10px;
}
.phone-view {
height: 600px;
......@@ -481,15 +504,18 @@ export default {
padding: 8px;
box-sizing: border-box;
border-radius: 13px;
box-shadow: -2px 4px 3px #ccc;
&-title {
width: 100%;
height: 30px;
height: 35px;
border-bottom: 1px solid #ccc;
color: #333;
}
&-word {
color: #666;
line-height: 20px;
/deep/img {
width: 100% !important;
}
}
}
}
......@@ -509,4 +535,17 @@ p {
.tag-show {
margin-bottom: -10px;
}
.gl-footer {
z-index: 1000;
}
.copy-img {
display: flex;
align-items: center;
img {
width: 16px;
height: 16px;
margin-left: 4px;
cursor: pointer;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!