Commit 647ecc50 by 胡悦

修复群发bug

1 parent 4746046b
...@@ -281,9 +281,9 @@ export default { ...@@ -281,9 +281,9 @@ export default {
type: 'material', type: 'material',
funName: 'material', funName: 'material',
groupListApi: this.$apis.welcomeword.getGroupListApi, groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi, materialListApi: this.$apis.welcomeword.getMaterialListApi
pdfNo: 1, // pdfNo: 1
videoNo: 1 // videoNo: 1
}, },
{ {
name: '模板', name: '模板',
...@@ -378,7 +378,9 @@ export default { ...@@ -378,7 +378,9 @@ export default {
// 预览回显事件 // 预览回显事件
previewForm(val) { previewForm(val) {
console.log(val) console.log(val)
this.previewVal = val const value = this.$common.utils.deepClone(val)
if (!value[0].attContent) value.splice(0, 1)
this.previewVal = value
}, },
handleCancel() { handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) { if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
...@@ -500,7 +502,7 @@ export default { ...@@ -500,7 +502,7 @@ export default {
type: 'success', type: 'success',
message: '操作成功!' message: '操作成功!'
}) })
this.$tracker.track(Object.assign({},{pageName:'群发助手',name:'新建客户群发',params})) // this.$tracker.track(Object.assign({},{pageName:'群发助手',name:'新建客户群发',params}))
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<div class="detail-condition-item" v-if="basicInfo.condition.chatName"> <div class="detail-condition-item" v-if="basicInfo.condition.chatName">
<span class="name">所在群聊</span> <span class="name">所在群聊</span>
<span v-for="(item, index) in basicInfo.condition.chatName.split(',')" class="el-tag-item" :key="index"> <span v-for="(item, index) in basicInfo.condition.chatName.split(',')" class="el-tag-item" :key="index">
<el-tag v-if="index < 2" type="info" class="hidden-tag">{{ item }}</el-tag> <el-tag v-if="index < 2" type="info" :class="index > 2 ? 'hidden-tag' : ''">{{ item }}</el-tag>
<el-tag type="info" v-if="basicInfo.condition.chatName.split(',').length > 2 && index == 2"> <el-tag type="info" v-if="basicInfo.condition.chatName.split(',').length > 2 && index == 2">
<el-popover placement="top" width="300" trigger="hover"> <el-popover placement="top" width="300" trigger="hover">
<span slot="reference">...({{ basicInfo.condition.chatName.split(',').length }})</span> <span slot="reference">...({{ basicInfo.condition.chatName.split(',').length }})</span>
......
...@@ -22,7 +22,12 @@ ...@@ -22,7 +22,12 @@
<el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
</template> </template>
<template v-else-if="item.attType == 3"> <template v-else-if="item.attType == 3">
<video style="width: 100px" :src="item.attContent"></video> <div class="video-panel" :key="itm">
<video id="video" width="95">
<source :src="item.attContent" type="video/mp4" />
</video>
<i class="el-icon-video-play"></i>
</div>
</template> </template>
<template v-else-if="item.attType == 5"> <template v-else-if="item.attType == 5">
<div class="preview-text text preview-applet"> <div class="preview-text text preview-applet">
...@@ -33,6 +38,14 @@ ...@@ -33,6 +38,14 @@
{{ item.attContent.page }} {{ item.attContent.page }}
</div> </div>
</template> </template>
<template v-else-if="item.attType == 6">
<div class="preview-pdf">
<div class="pdf-title">{{ item.attContent.fileName }}</div>
<div class="preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt="" />
</div>
</div>
</template>
</div> </div>
</div> </div>
</div> </div>
...@@ -56,7 +69,7 @@ export default { ...@@ -56,7 +69,7 @@ export default {
val.forEach(item => { val.forEach(item => {
if (item.attType == 1) { if (item.attType == 1) {
const attContent = item.attContent const attContent = item.attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) { const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1 let index = parseInt(list.indexOf(word)) + 1
...@@ -68,9 +81,9 @@ export default { ...@@ -68,9 +81,9 @@ export default {
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">` return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
}) })
item.attContent = htm item.attContent = htm
} else if (item.attType != 2) { } else if (item.attType != 2 && item.attType != 3) {
console.log(item) console.log(item)
item.attContent = JSON.parse(item.attContent) if (!this.eventBus) item.attContent = JSON.parse(utils.deepClone(item.attContent))
console.log(item.attContent) console.log(item.attContent)
} }
}) })
...@@ -85,9 +98,11 @@ export default { ...@@ -85,9 +98,11 @@ export default {
} }
}, },
created() { created() {
if (this.eventBus) {
this.eventBus.$on('update', val => { this.eventBus.$on('update', val => {
this.previewList = val this.previewList = val
}) })
}
}, },
mounted() { mounted() {
const date = new Date() const date = new Date()
...@@ -151,14 +166,11 @@ export default { ...@@ -151,14 +166,11 @@ export default {
white-space: pre-wrap; white-space: pre-wrap;
} }
.preview-link { .preview-link {
display: inline-flex; display: flex;
word-break: break-all; justify-content: flex-end;
font-size: 14px;
padding: 8px 8px 8px 11px;
img { img {
width: 34px; width: 30px;
height: 34px; height: 30px;
margin-left: 10px;
} }
} }
.preview-text::before { .preview-text::before {
...@@ -209,6 +221,31 @@ export default { ...@@ -209,6 +221,31 @@ export default {
border-top: 1px solid #edeff3; border-top: 1px solid #edeff3;
} }
} }
.preview-pdf {
width: 158px;
height: 62px;
background-color: #fff;
padding: 5px 13px;
box-sizing: border-box;
.pdf-title {
font-size: 12px;
color: #333;
line-height: 16px;
}
}
.video-panel {
position: relative;
.el-icon-video-play {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 10;
font-size: 20px;
color: #fff;
// cursor: pointer;
}
}
} }
} }
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<div class="member-name">成员名称({{ innerTags.length }}项)</div> <div class="member-name">成员名称({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper"> <div class="input-tag-wrapper">
<div class="tag-box"> <div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)"> <el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(innerTags[idx])">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ tag.staffName }} {{ tag.staffName }}
</el-tag> </el-tag>
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
methods: { methods: {
selectionTable(val) { selectionTable(val) {
console.log(val) console.log(val)
this.innerTags = val this.innerTags = this.$common.utils.deepClone(val)
// this.$emit('selectTable', val) // this.$emit('selectTable', val)
}, },
// 清空搜索条件 // 清空搜索条件
...@@ -226,7 +226,14 @@ export default { ...@@ -226,7 +226,14 @@ export default {
} }
}, },
remove(item) { remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item) // var idx = this.innerTags.findIndex(k => k.id == item.id)
// this.innerTags.splice(idx, 1)
if (this.tableEmpData.map(k => k.id).includes(item.id)) {
var i = this.tableEmpData.findIndex(k => k.id == item.id)
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(this.tableEmpData[i])
console.log(item, this.tableEmpData[i])
}
// this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
}, },
rowClick(row) { rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row) this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!