Commit f3b01fe7 by 杨明

fixed

1 parent a6bb7aa1
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
Vue.component(component.name, component)
})
......@@ -236,21 +236,23 @@ export default {
this.$refs['codeForm'].validate(valid => {
if (valid) {
let param = Object.assign({ id: this.codeId }, this.addCodeForm)
let tagging = this.tagging.map(item => {
let tagIds = item.labelList.map(tag => {
return tag.id
if (this.tagging && this.tagging.length) {
let tagging = this.tagging.map(item => {
let tagIds = item.labelList.map(tag => {
return tag.id
})
let name = item.labelList.map(tag => {
return tag.name
})
return {
groupId: item.labelGroup.id,
tagIds: tagIds.join(','),
name: name.join(','),
labelType: item.labelGroup.name
}
})
let name = item.labelList.map(tag => {
return tag.name
})
return {
groupId: item.labelGroup.id,
tagIds: tagIds.join(','),
name: name.join(','),
labelType: item.labelGroup.name
}
})
param.tagging = JSON.stringify(tagging)
param.tagging = JSON.stringify(tagging)
}
param.autoWelcome = this.autoWelcome ? 1 : 0
param.codeSystem = 0
let staffId = []
......@@ -293,22 +295,25 @@ export default {
this.addCodeForm.autoAdd = this.addCodeForm.autoAdd == 1 ? true : false
this.staffInfo = res.staffInfo
const tagging = eval(res.tagging)
const taggingList = tagging.map(item => {
let name = item.name.split(',')
let ids = item.tagIds.split(',')
console.log(ids)
let labelList = name.map((tag, index) => {
return { id: ids[index], name: tag }
if (tagging && tagging.length) {
const taggingList = tagging.map(item => {
let name = item.name.split(',')
let ids = item.tagIds.split(',')
console.log(ids)
let labelList = name.map((tag, index) => {
return { id: ids[index], name: tag }
})
return {
labelGroup: {
id: item.groupId,
name: item.labelType
},
labelList
}
})
return {
labelGroup: {
id: item.groupId,
name: item.labelType
},
labelList
}
})
this.tagging = taggingList
this.tagging = taggingList
}
this.autoWelcome = res.autoWelcome ? true : false
if (res.welcomeInfo.length != 0) {
const previewList = res.welcomeInfo.map(item => {
......
......@@ -219,12 +219,12 @@ export default {
this.addForm.content = res.dracImMessageConResponse.content
this.imName = res.imName
this.autoWelcome = res.autoWelcome ? true : false
const previewList = res.dracScrmWelcomeConfigDTOS.map(item => {
const dracScrmWelcomeConfigDTOS = res.dracScrmWelcomeConfigDTOS ? res.dracScrmWelcomeConfigDTOS : []
const previewList = dracScrmWelcomeConfigDTOS.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
if (item.attType == 1) item.attContent = item.attContent.replaceAll('[@昵称]', '<span style="color:#5850FF">@昵称</span>').replaceAll(/\n/g, '<br>')
return item
})
console.log(previewList)
this.welcomeInfo = previewList
const tagging = eval(res.tagging)
if (tagging && tagging.length) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!