Commit 75dcbc9f by 王志慧

fixed

1 parent e9dce478
...@@ -81,6 +81,10 @@ export default { ...@@ -81,6 +81,10 @@ export default {
btnList: { btnList: {
type: Array, type: Array,
default: () => [] default: () => []
},
mapList: {
type: Array,
default: () => []
} }
}, },
components: { components: {
...@@ -115,9 +119,32 @@ export default { ...@@ -115,9 +119,32 @@ export default {
} }
this.$refs.textContent.addImg(`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png`) this.$refs.textContent.addImg(`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png`)
}, },
getTextValue() {
const html = this.$refs.textContent.$refs.wTextareaContent.innerHTML
const _this = this
const list = emoji.flat(Infinity)
let htm = html&&html
.replace(/<span>([\s\S]*?)<\/span>/g, '$1')
.replace(/<img.+?src="https:\/\/img01.glsx.com.cn\/weapp\/resource\/saas\/scrm\/emoji\//g, '')
.replace(/<br>/g, '\n')
htm = htm.replace(/<wise.+?>(.+?)(?:<\/wise>)/g, (str,v)=> {
return _this.mapList[v]
})
return htm&&htm.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
},
update(attContent) { update(attContent) {
attContent = attContent.replace(/\[(.+?)\]/g, '<wise id="1" contenteditable="false">$1</wise>') if(!attContent) {
let htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) { return
}
let content = attContent.replace(/(\$\{.+?\})/g,(str)=>{
console.log(str)
return
})
content = content.replace(/\[(.+?)\]/g, '<wise id="1" contenteditable="false">$1</wise>')
let htm = content&&content.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
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<div class="right-wrap"> <div class="right-wrap">
<el-form ref="form" :model="form" label-width="154px"> <el-form ref="form" :model="form" label-width="154px">
<div class="item-line"> <div class="item-line">
<el-form-item label="编辑文本:"> <el-form-item label="编辑文本:" class="verbal-wrap">
<verbal :btnList="btnList"></verbal> <verbal :btnList="btnList" :mapList="mapList" ref="verbalRef"></verbal>
</el-form-item> </el-form-item>
<span class="warn">关闭后推送的喜报不会显示客户车型</span> <span class="warn">关闭后推送的喜报不会显示客户车型</span>
</div> </div>
...@@ -42,9 +42,41 @@ export default { ...@@ -42,9 +42,41 @@ export default {
{ {
type: 1, type: 1,
name: '表情' name: '表情'
},
{
type: 2,
name: '销售顾问'
},
{
type: 2,
name: '客户姓名'
},
{
type: 2,
name: '车型'
},
{
type: 2,
name: '订单总金额'
},
{
type: 2,
name: '阳光激励费'
},
{
type: 2,
name: '商品名称'
} }
], ],
params :['wordType'] params :['wordType'],
mapList: {
'销售顾问用户名':'${销售顾问用户名}',
'客户姓名': '${customerName}',
'车型': '${carType}',
'订单总金额':'${totalPrice}' ,
'阳光激励费':'${sunshineInspiration}',
'商品名称':'${goodsNames}'
},
} }
}, },
props: { props: {
...@@ -68,12 +100,13 @@ export default { ...@@ -68,12 +100,13 @@ export default {
}) })
}, },
handlebattleConfirm() { handlebattleConfirm() {
this.isDialogVisible = false console.log(this.$refs.verbalRef.getTextValue())
let switchList = [] // this.isDialogVisible = false
this.params.forEach(data => { // let switchList = []
switchList.push(this[data]) // this.params.forEach(data => {
}) // switchList.push(this[data])
this.$emit('handlePreview', { key: 'wordReport', data: switchList }) // })
// this.$emit('handlePreview', { key: 'wordReport', data: switchList })
} }
} }
} }
...@@ -152,5 +185,17 @@ export default { ...@@ -152,5 +185,17 @@ export default {
color: #999999; color: #999999;
margin-left: 154px; margin-left: 154px;
} }
.verbal-wrap {
/deep/ .el-form-item__content {
width: 448px;
}
/deep/ .btn-group-panel .btn-group{
flex-wrap: wrap;
justify-content:none;
.add-btn{
margin-bottom:5px;
}
}
}
} }
</style> </style>
...@@ -79,13 +79,12 @@ export default { ...@@ -79,13 +79,12 @@ export default {
isDialogVisible(val) { isDialogVisible(val) {
if (val) { if (val) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.verbalRef.update('8888') this.$refs.verbalRef&&this.$refs.verbalRef.update(this.verbalType.switchText)
}) })
} }
} }
}, },
created() { created() {
console.log(222)
this.initData() this.initData()
}, },
methods: { methods: {
...@@ -100,12 +99,14 @@ export default { ...@@ -100,12 +99,14 @@ export default {
}) })
}, },
handlebattleConfirm() { handlebattleConfirm() {
this.isDialogVisible = false console.log(this.$refs.verbalRef.getTextValue)
let switchList = [] // this.isDialogVisible = false
this.params.forEach(data => { // let switchList = []
switchList.push(this[data]) // this.params.forEach(data => {
}) // if(data =='verbalType') data.switchText = this.$refs.verbalRef.getTextValue()
this.$emit('handlePreview', { key: 'saPerReport', data: switchList }) // switchList.push(this[data])
// })
// this.$emit('handlePreview', { key: 'saPerReport', data: switchList })
} }
} }
} }
...@@ -189,6 +190,7 @@ export default { ...@@ -189,6 +190,7 @@ export default {
/deep/ .el-form-item__content { /deep/ .el-form-item__content {
width: 448px; width: 448px;
} }
} }
} }
</style> </style>
...@@ -8,7 +8,10 @@ ...@@ -8,7 +8,10 @@
<p class="color-3 txt-center text-14">图示效果</p> <p class="color-3 txt-center text-14">图示效果</p>
</div> </div>
<div class="right-wrap"> <div class="right-wrap">
<!-- <p class="">暂无配置项</p> --> <div class="empty">
<img src="@/assets/buttetin/empty.png"/>
</div>
<p class="">暂无配置项</p>
<div class="explain"> <div class="explain">
<div class="color6 weight-6 font-14"> <div class="color6 weight-6 font-14">
<i class="el-icon-warning"></i> <i class="el-icon-warning"></i>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!