Commit 4fe7b7cb by 杨明

fixed

1 parent 7f7092d1
......@@ -188,20 +188,7 @@ export default {
}
},
subText(htm) {
const list = emoji.flat(Infinity)
const cutImg = htm
.replace(/<span>([\s\S]*?)<\/span>/g, '$1')
.replace(/<img src="https:\/\/img01.glsx.com.cn\/weapp\/resource\/saas\/scrm\/emoji\//g, '')
.replace(/<wise.+?>(.+?)(?:<\/wise>)/g, '$1')
.replace(/<br>/g, '\n')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg
this.currentText = replaceImg
this.$emit('updateText', this.currentText)
this.$emit('updateText', htm)
},
insertNodeFirst(node) {
this.savedRange.deleteContents()
......
......@@ -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-13 12:43:40
* @LastEditTime: 2023-06-19 14:37:26
* @FilePath: \scrm-micro-battles\src\views\battle\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%
im
......@@ -44,36 +44,7 @@ import EmotionWords from './EmotionWords'
export default {
data() {
return {
// btnList: [
// {
// type: 1,
// name: '表情'
// },
// {
// type: 2,
// name: '销售顾问'
// },
// {
// type: 2,
// name: '客户姓名'
// },
// {
// type: 2,
// name: '车型'
// },
// {
// type: 2,
// name: '订单总金额'
// },
// {
// type: 2,
// name: '阳光激励费'
// },
// {
// type: 2,
// name: '商品名称'
// }
// ],
maxNum: 200,
emotionStatus: false
}
},
......@@ -103,6 +74,14 @@ export default {
selectTag(name) {
this.$refs.textContent.addTag(name)
},
updateText(val) {
const html = this.getTextValue(val),
text = html.replace(/\[.+?\]/g, '').replace(/\${.+?}/g, ''),
textNum = text.length
if (textNum > this.maxNum) {
this.update(val.substring(html, this.maxNum))
}
},
//展开表情
selectEmotion() {
this.emotionStatus = !this.emotionStatus
......@@ -119,8 +98,8 @@ 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
getTextValue(val) {
const html = val ? val : this.$refs.textContent.$refs.wTextareaContent.innerHTML
const _this = this
const list = emoji.flat(Infinity)
let htm =
......
......@@ -59,7 +59,7 @@
<el-button @click="handlebattleClose" size="medium">取消</el-button>
<el-button type="primary" @click="handlebattleConfirm" size="medium" :loading="loading">保存</el-button>
</GLFooter>
<component :is="dialogComponent" ref="componentRef" :switchList="switchList" @handlePreview="handlePreview"></component>
<component :is="dialogComponent" ref="componentRef" v-if="isDialogVisible" :isDialogVisible="isDialogVisible" :switchList="switchList" @handlePreview="handlePreview" @handleClose="handleClose"></component>
</div>
</template>
<script>
......@@ -84,6 +84,7 @@ export default {
},
data() {
return {
isDialogVisible: false,
merchantName: '',
paramsData: this.$route.query,
dialogComponent: '',
......@@ -169,32 +170,32 @@ export default {
],
buttetinList: [
{
label: 'SA个人喜报',
label: '.SA个人喜报',
storageList: 'saPerReportValue',
componentName: 'personalDialog'
},
{
label: 'SA喜报',
label: '.SA喜报',
storageList: 'saReportValue',
componentName: 'bulletinDialog'
},
{
label: '文字喜报',
label: '.文字喜报',
storageList: 'wordReportValue',
componentName: 'charactersDialog'
},
{
label: '早报',
label: '.早报',
storageList: 'zhanReportValue',
componentName: 'dailyDialog'
},
{
label: '客户进度消息',
label: '.客户进度消息',
storageList: 'scheduleReportValue',
componentName: 'progressDialog'
},
{
label: '补单通知',
label: '.补单通知',
storageList: 'orderReportValue',
componentName: 'replenishmentDialog'
}
......@@ -222,15 +223,18 @@ export default {
},
methods: {
handlePreview(params) {
console.log(params)
let { key, data } = params
this.switchList[key] = data
console.log(this.switchList[key])
this.isDialogVisible = false
},
handleClose() {
this.isDialogVisible = false
},
openConfigDialog(componentName) {
this.dialogComponent = componentName
this.$nextTick(() => {
this.$refs.componentRef.isDialogVisible = true
})
this.isDialogVisible = true
},
addGroup(group) {
group.push({ name: '' })
......@@ -304,13 +308,14 @@ export default {
let groupHideAttr = this.groupToType.find(k => k.type == item.actionReportType)?.attr
if (item.groupId) {
if (item.groupId.split('_R:')[1] && item.groupId.split('_R:')[1] == item.groupName) {
groupHideAttr&&this.groupCofListInput[groupHideAttr + 'Value'].push({ name: item.groupName })
groupHideAttr && this.groupCofListInput[groupHideAttr + 'Value'].push({ name: item.groupName })
this.idBefEncryption = item.groupId.split('_R:')[0]
} else if (item.groupName) {
groupHideAttr&&this.groupCofList[groupHideAttr].push({
groupId: item.groupId,
roomName: item.groupName
})
groupHideAttr &&
this.groupCofList[groupHideAttr].push({
groupId: item.groupId,
roomName: item.groupName
})
} else {
groupHideAttr && this.groupCofListInput[groupHideAttr + 'Value'].push({ name: '' })
}
......
<template>
<GLDialog :mode="mode" title="#2.SA喜报 预览配置显示字段" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="isDialogVisible = false">
<GLDialog :mode="mode" title="#2.SA喜报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
......@@ -35,10 +35,11 @@
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
isDialogVisible: false,
mode: 'big',
goodsType: {
switchType: 401
......@@ -49,29 +50,18 @@ export default {
params: ['goodsType', 'outputType']
}
},
props: {
switchList: {
type: Array,
default: () => []
}
},
created() {
this.initData()
},
methods: {
initData() {
this.switchList.saReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = i
this[data].switchStatus = this[data].switchStatus == 'Y' ? true : false
this[data] = this.$common.utils.deepClone(i)
this.$set(this[data], 'switchStatus', i.switchStatus == 'Y' || i.switchStatus === true ? true : false)
}
})
})
},
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
this.params.forEach(data => {
switchList.push(this[data])
......
<template>
<GLDialog :mode="mode" title="#3.文字喜报 预览配置显示字段" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="isDialogVisible = false">
<GLDialog :mode="mode" title="#3.文字喜报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
......@@ -28,13 +28,13 @@
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
isDialogVisible: false,
mode: 'big',
wordType: {
switchType: 701,
switchText: ''
},
......@@ -79,35 +79,19 @@ export default {
}
}
},
props: {
switchList: {
type: Array,
default: () => []
}
},
created() {
this.initData()
},
watch: {
isDialogVisible(val) {
console.log(val)
if (val) {
this.$nextTick(() => {
this.$refs.verbalRef && this.$refs.verbalRef.update(this.wordType.switchText)
})
}
}
},
methods: {
initData() {
this.switchList.wordReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = i
this[data] = this.$common.utils.deepClone(i)
}
})
})
this.$nextTick(() => {
this.$refs.verbalRef && this.$refs.verbalRef.update(this.verbalType.switchText)
})
},
handlebattleConfirm() {
this.isDialogVisible = false
......
<template>
<GLDialog :mode="mode" title="#4.早报 预览配置显示字段" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="isDialogVisible = false">
<GLDialog :mode="mode" title="#4.早报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
......@@ -29,39 +29,30 @@
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
isDialogVisible: false,
mode: 'big',
clientType: {
switchType: 201,
switchType: 201
},
params: ['clientType']
}
},
props: {
switchList: {
type: Array,
default: () => []
}
},
created() {
this.initData()
},
methods: {
initData() {
this.switchList.zhanReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = i
this[data].switchStatus = this[data].switchStatus == 'Y' ? true : false
this[data] = this.$common.utils.deepClone(i)
this.$set(this[data], 'switchStatus', i.switchStatus == 'Y' || i.switchStatus === true ? true : false)
}
})
})
},
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
this.params.forEach(data => {
switchList.push(this[data])
......
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-19 10:49:23
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-19 11:05:16
* @FilePath: \scrm-micro-battles\src\views\bulletin\components\dialogs\dialog.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export default {
props: {
switchList: {
type: Array,
default: () => []
},
isDialogVisible: Boolean
},
created() {
console.log(this.switchList,9999999)
this.initData()
},
methods: {
handlebattleClose() {
this.$emit('handleClose')
}
}
}
<template>
<GLDialog :mode="mode" title="#1.SA个人喜报 预览配置显示字段" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="isDialogVisible = false">
<GLDialog :mode="mode" title="#1.SA个人喜报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
......@@ -44,10 +44,11 @@
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
isDialogVisible: false,
mode: 'big',
vehicleType: {
switchType: 501
......@@ -69,40 +70,25 @@ export default {
params: ['vehicleType', 'goodsType', 'proceedsType', 'verbalType']
}
},
props: {
switchList: {
type: Array,
default: () => []
}
},
watch: {
isDialogVisible(val) {
if (val) {
this.$nextTick(() => {
this.$refs.verbalRef&&this.$refs.verbalRef.update(this.verbalType.switchText)
})
}
}
},
created() {
this.initData()
},
methods: {
initData() {
this.switchList.saPerReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = i
this[data].switchStatus = this[data].switchStatus == 'Y' ? true : false
this[data] = this.$common.utils.deepClone(i)
this.$set(this[data], 'switchStatus', i.switchStatus == 'Y' || i.switchStatus === true ? true : false)
}
})
})
this.$nextTick(() => {
this.$refs.verbalRef && this.$refs.verbalRef.update(this.verbalType.switchText)
})
},
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
this.params.forEach(data => {
if(data =='verbalType') this[data].switchText = this.$refs.verbalRef.getTextValue()
if (data == 'verbalType') this[data].switchText = this.$refs.verbalRef.getTextValue()
switchList.push(this[data])
})
console.log(switchList)
......@@ -190,7 +176,6 @@ export default {
/deep/ .el-form-item__content {
width: 448px;
}
}
}
</style>
<template>
<GLDialog :mode="mode" title="#5.客户进度消息 预览配置显示字段" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="isDialogVisible = false">
<GLDialog :mode="mode" title="#5.客户进度消息 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
......@@ -29,39 +29,30 @@
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
isDialogVisible: false,
mode: 'big',
businessType: {
switchType: 601,
switchType: 601
},
params: ['businessType']
}
},
props: {
switchList: {
type: Array,
default: () => []
}
},
created() {
this.initData()
},
methods: {
initData() {
this.switchList.scheduleReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = i
this[data].switchStatus = this[data].switchStatus == 'Y' ? true : false
this[data] = this.$common.utils.deepClone(i)
this.$set(this[data], 'switchStatus', i.switchStatus == 'Y' || i.switchStatus === true ? true : false)
}
})
})
},
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
this.params.forEach(data => {
switchList.push(this[data])
......
<template>
<GLDialog :mode="mode" title="#6.补单通知 预览配置显示字段" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="isDialogVisible = false">
<GLDialog :mode="mode" title="#6.补单通知 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleClose" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
......@@ -11,7 +11,7 @@
<div class="empty">
<img src="@/assets/buttetin/empty.png" />
</div>
<div class="explain">
<div class="color6 weight-6 font-14">
<i class="el-icon-warning"></i>
......@@ -25,10 +25,11 @@
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
isDialogVisible: false,
mode: 'big'
}
},
......@@ -63,7 +64,7 @@ export default {
.right-wrap {
display: 1;
position: relative;
width:100%;
width: 100%;
margin-top: 12px;
/deep/.el-form-item {
margin-bottom: 0px;
......@@ -75,12 +76,12 @@ export default {
width: 420px;
height: 260px;
position: absolute;
top:35%;
left:50%;
transform: translate(-50%,-50%);
img{
width:100%;
height:100%;
top: 35%;
left: 50%;
transform: translate(-50%, -50%);
img {
width: 100%;
height: 100%;
}
}
.explain {
......
<template>
<GLDialog :mode="mode" title="#4.收款喜报 预览配置显示字段" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="isDialogVisible = false">
<GLDialog :mode="mode" title="#4.收款喜报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
......@@ -35,10 +35,11 @@
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
isDialogVisible: true,
mode: 'big',
addType: {
switchType: 502,
......@@ -60,7 +61,6 @@ export default {
},
methods: {
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
const params = ['addType', 'payeeType']
params.forEach(data => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!