Commit ac931518 by xinla

--no commit message

1 parent 11f95797
...@@ -3,6 +3,7 @@ ENV = 'development' ...@@ -3,6 +3,7 @@ ENV = 'development'
# 基础api(根据实际情况,自行配置,下为示例) # 基础api(根据实际情况,自行配置,下为示例)
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/api' VUE_APP_BASE_API = 'http://demo.linkwechat.cn/api'
VUE_APP_BASE_API = 'http://ecbf-82-156-106-202.ngrok.io'
# 路由基础路径 # 路由基础路径
VUE_APP_BASE_URL = '/' VUE_APP_BASE_URL = '/'
\ No newline at end of file \ No newline at end of file
...@@ -152,6 +152,19 @@ ...@@ -152,6 +152,19 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
<div class="content"> <div class="content">
<div v-if="editLabelType === 'person'" class="labelstyle">
<div
v-for="(unit, unique) in alllabel"
:key="unique"
class="label"
:style="addTag.some((e) => e.tagId == unit.tagId) ? isActive : ''"
@click="clickLabel(unit)"
>
{{ unit.name }}
</div>
</div>
<template v-else>
<div v-for="(item, index) in alllabel" :key="index"> <div v-for="(item, index) in alllabel" :key="index">
<div class="mb10 mt5">{{ item.gourpName }}:</div> <div class="mb10 mt5">{{ item.gourpName }}:</div>
<div class="labelstyle"> <div class="labelstyle">
...@@ -166,6 +179,7 @@ ...@@ -166,6 +179,7 @@
</div> </div>
</div> </div>
</div> </div>
</template>
</div> </div>
<div class="saveinfo"> <div class="saveinfo">
<van-button type="info" class="mt10 mb15" size="small" block round @click="saveCustomerTag"> <van-button type="info" class="mt10 mb15" size="small" block round @click="saveCustomerTag">
...@@ -501,13 +515,14 @@ export default { ...@@ -501,13 +515,14 @@ export default {
getAllTags(params) getAllTags(params)
.then(({ data }) => { .then(({ data }) => {
this.alllabel = data this.alllabel = data
if (this.editLabelType !== 'person') {
this.listTagOneArray = [] this.listTagOneArray = []
data.forEach((element) => { data.forEach((element) => {
element.weTags.forEach((d) => { element.weTags.forEach((d) => {
this.listTagOneArray.push(d) this.listTagOneArray.push(d)
}) })
}) })
}
}) })
.catch((err) => { .catch((err) => {
console.log(err) console.log(err)
...@@ -622,6 +637,42 @@ export default { ...@@ -622,6 +637,42 @@ export default {
} }
}) })
}, },
// 点击编辑按钮
async labelEdit(type) {
this.editLabelType = type
await this.getAllTags(type)
this.addTag = []
let tags = this.form[type === 'person' ? 'personTags' : 'tags']
let hasErrorTag = [] // 异常活已经删除的标签
let repeat = [] // 重复的标签
tags &&
tags.forEach((unit) => {
// 判断是否有重复标签
let isRepeat = this.listTagOneArray.some((d) => {
return d.tagId === unit.tagId
})
// 去重
if (isRepeat) {
repeat.push(unit.name)
return
}
let filter = this.listTagOneArray.find((d) => {
return d.tagId === unit.tagId
})
// 如果没有匹配到,则说明该便签处于异常状态,可能已被删除或破坏
if (!filter) {
hasErrorTag.push(unit.name)
return
}
this.addTag.push(filter)
})
this.show = true
// 获取用户当前的lable,将当前用户的lable与所有lable进行对比,相同的弹框内蓝色展示
// 弹框内的标签组选中时蓝色展示
// 弹框内的子标签与选中时蓝色展示,点击时
},
// 点击选择标签 // 点击选择标签
clickLabel(item) { clickLabel(item) {
let index = this.addTag.findIndex((e) => { let index = this.addTag.findIndex((e) => {
...@@ -662,42 +713,7 @@ export default { ...@@ -662,42 +713,7 @@ export default {
console.log(err) console.log(err)
}) })
}, },
// 点击编辑按钮
async labelEdit(type) {
this.editLabelType = type
await this.getAllTags(type)
this.addTag = []
let tags = this.form[type === 'person' ? 'personTags' : 'tags']
let hasErrorTag = [] // 异常活已经删除的标签
let repeat = [] // 重复的标签
tags &&
tags.forEach((unit) => {
// 判断是否有重复标签
let isRepeat = this.listTagOneArray.some((d) => {
return d.tagId === unit.tagId
})
// 去重
if (isRepeat) {
repeat.push(unit.name)
return
}
let filter = this.listTagOneArray.find((d) => {
return d.tagId === unit.tagId
})
// 如果没有匹配到,则说明该便签处于异常状态,可能已被删除或破坏
if (!filter) {
hasErrorTag.push(unit.name)
return
}
this.addTag.push(filter)
})
this.show = true
// 获取用户当前的lable,将当前用户的lable与所有lable进行对比,相同的弹框内蓝色展示
// 弹框内的标签组选中时蓝色展示
// 弹框内的子标签与选中时蓝色展示,点击时
},
findAddaddEmployes() { findAddaddEmployes() {
findAddaddEmployes(this.externalUserid) findAddaddEmployes(this.externalUserid)
.then(({ data }) => { .then(({ data }) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!