Commit 9d507379 by 杨明

fixed

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