Commit 9d507379 by 杨明

fixed

1 parent 75dcbc9f
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-04-20 15:15:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-10 15:19:23
* @LastEditTime: 2023-06-13 12:43:40
* @FilePath: \scrm-micro-battles\src\views\battle\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%
im
......@@ -123,28 +123,37 @@ export default {
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}]`
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) {
if(!attContent) {
update(attContent) {
if (!attContent) {
return
}
let content = attContent.replace(/(\$\{.+?\})/g,(str)=>{
console.log(str)
return
let content = attContent.replace(/(\$\{.+?\})/g, str => {
for (let i in this.mapList) {
if (this.mapList[i] == str) {
return `<wise id="1" contenteditable="false">${i}</wise>`
}
}
})
content = content.replace(/\[(.+?)\]/g, '<wise id="1" contenteditable="false">$1</wise>')
let htm = content&&content.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
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
......@@ -155,12 +164,12 @@ export default {
}
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
if (htm.substr(-1, 1) == '>' && navigator.userAgent.indexOf('Firefox') > 0) {
htm += '&nbsp;'
}
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm
}, 100)
if (htm.substr(-1, 1) == '>' && navigator.userAgent.indexOf('Firefox') > 0) {
htm += '&nbsp;'
}
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm
}, 100)
}
}
}
......@@ -184,7 +193,7 @@ export default {
display: flex;
justify-content: space-around;
column-gap: 20px;
line-height:20px;
line-height: 20px;
.add-btn {
display: inline-flex;
position: relative;
......
......@@ -32,13 +32,13 @@
export default {
data() {
return {
isDialogVisible: false,
isDialogVisible: false,
mode: 'big',
wordType: {
switchType: 701,
switchText: ''
},
btnList: [
btnList: [
{
type: 1,
name: '表情'
......@@ -68,15 +68,15 @@ export default {
name: '商品名称'
}
],
params :['wordType'],
mapList: {
'销售顾问用户名':'${销售顾问用户名}',
'客户姓名': '${customerName}',
'车型': '${carType}',
'订单总金额':'${totalPrice}' ,
'阳光激励费':'${sunshineInspiration}',
'商品名称':'${goodsNames}'
},
params: ['wordType'],
mapList: {
销售顾问: '${销售顾问用户名}',
客户姓名: '${customerName}',
车型: '${carType}',
订单总金额: '${totalPrice}',
阳光激励费: '${sunshineInspiration}',
商品名称: '${goodsNames}'
}
}
},
props: {
......@@ -88,6 +88,17 @@ export default {
created() {
this.initData()
},
watch: {
isDialogVisible(val) {
console.log(val)
if (val) {
this.$nextTick(() => {
this.$refs.verbalRef && this.$refs.verbalRef.update('${销售顾问用户名}7')
})
}
}
},
methods: {
initData() {
this.switchList.wordReport.forEach(i => {
......@@ -100,13 +111,13 @@ export default {
})
},
handlebattleConfirm() {
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 })
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 })
}
}
}
......@@ -185,16 +196,16 @@ export default {
color: #999999;
margin-left: 154px;
}
.verbal-wrap {
.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;
}
/deep/ .btn-group-panel .btn-group {
flex-wrap: wrap;
justify-content: none;
.add-btn {
margin-bottom: 5px;
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!