Commit 75dcbc9f by 王志慧

fixed

1 parent e9dce478
......@@ -81,6 +81,10 @@ export default {
btnList: {
type: Array,
default: () => []
},
mapList: {
type: Array,
default: () => []
}
},
components: {
......@@ -115,9 +119,32 @@ export default {
}
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) {
attContent = attContent.replace(/\[(.+?)\]/g, '<wise id="1" contenteditable="false">$1</wise>')
let htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
if(!attContent) {
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, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
......
......@@ -10,8 +10,8 @@
<div class="right-wrap">
<el-form ref="form" :model="form" label-width="154px">
<div class="item-line">
<el-form-item label="编辑文本:">
<verbal :btnList="btnList"></verbal>
<el-form-item label="编辑文本:" class="verbal-wrap">
<verbal :btnList="btnList" :mapList="mapList" ref="verbalRef"></verbal>
</el-form-item>
<span class="warn">关闭后推送的喜报不会显示客户车型</span>
</div>
......@@ -38,13 +38,45 @@ export default {
switchType: 701,
switchText: ''
},
btnList: [
btnList: [
{
type: 1,
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: {
......@@ -68,12 +100,13 @@ export default {
})
},
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
this.params.forEach(data => {
switchList.push(this[data])
})
this.$emit('handlePreview', { key: 'wordReport', data: switchList })
console.log(this.$refs.verbalRef.getTextValue())
// this.isDialogVisible = false
// let switchList = []
// this.params.forEach(data => {
// switchList.push(this[data])
// })
// this.$emit('handlePreview', { key: 'wordReport', data: switchList })
}
}
}
......@@ -152,5 +185,17 @@ export default {
color: #999999;
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>
......@@ -79,13 +79,12 @@ export default {
isDialogVisible(val) {
if (val) {
this.$nextTick(() => {
this.$refs.verbalRef.update('8888')
this.$refs.verbalRef&&this.$refs.verbalRef.update(this.verbalType.switchText)
})
}
}
},
created() {
console.log(222)
this.initData()
},
methods: {
......@@ -100,12 +99,14 @@ export default {
})
},
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
this.params.forEach(data => {
switchList.push(this[data])
})
this.$emit('handlePreview', { key: 'saPerReport', data: switchList })
console.log(this.$refs.verbalRef.getTextValue)
// this.isDialogVisible = false
// let switchList = []
// this.params.forEach(data => {
// if(data =='verbalType') data.switchText = this.$refs.verbalRef.getTextValue()
// switchList.push(this[data])
// })
// this.$emit('handlePreview', { key: 'saPerReport', data: switchList })
}
}
}
......@@ -189,6 +190,7 @@ export default {
/deep/ .el-form-item__content {
width: 448px;
}
}
}
</style>
......@@ -8,7 +8,10 @@
<p class="color-3 txt-center text-14">图示效果</p>
</div>
<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="color6 weight-6 font-14">
<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!