Commit 8a0d9b78 by 杨明

fixed

1 parent 9ef590bf
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-27 11:29:17
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-05 16:09:39
* @LastEditTime: 2024-01-05 17:44:56
* @FilePath: \scrm-micro-scene\src\views\journeyConfig\components\relatedActivity.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -15,13 +15,13 @@
<span v-else-if="item.getName">{{ item.getName(conditionInfo[item.name]) }}</span>
<span v-else>{{ conditionInfo[item.name] }}</span>
</div>
<div class="condition-panel" v-if="configInfo.length == 2">
<div class="condition-panel" v-if="configInfoList.length == 2">
<div class="flex">
<label class="condition-label" style="line-height: revert;">企微成员范围:</label>
<div class="condition-select">
<div class="m-b-10">
<el-radio-group v-model="empType">
<el-radio :label="index" v-for="(item, index) in configInfo" :key="item.id">{{ item.name }}</el-radio>
<el-radio :label="index" v-for="(item, index) in configInfoList" :key="item.id">{{ item.name }}</el-radio>
</el-radio-group>
</div>
<template v-if="empType == 0">
......@@ -42,49 +42,46 @@
</div>
</div>
<template v-if="conditionsList">
<div class="condition-panel" v-if="conditionsList.name != '页面停留'">
<div class="condition-select flex">
<div class="flex">
<label class="condition-label">进入条件:</label>
<div class="condition-select">
<div class="condition-input" v-if="conditionsList.operators">
<el-input :value="conditionsList.name"></el-input>
<template v-if="conditionsList.operators[0]">
<el-input :value="conditionsList.operators[0].name"></el-input>
<el-input :value="conditionsList.operators[0].value"></el-input>
<span>天后自动切换到此旅程阶段</span>
</template>
<el-select v-model="conditionList.flag" placeholder="请选择" :size="size" class="m-r-10" v-if="conditionList && conditionList.conditions && conditionList.conditions.length > 1">
<el-option v-for="item in conditionList.conditions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<template v-if="condition && condition.operators && condition.operators.length">
<el-select v-model="operators" @change="condition.operators[operators].value = ''" placeholder="请选择" :size="size" class="m-r-10">
<el-option v-for="(item, index) in condition.operators" :key="index" :label="item.name" :value="index"></el-option>
</el-select>
<div class="condition-input" v-if="condition.operators[operators]">
<el-input v-model="condition.operators[operators].value"></el-input>
</div>
<div class="condition-input" v-for="item in conditionsList.subConditions" :key="item.id">
<span>并且满足 {{ item.name }}</span>
<el-input :value="item.operators[item.value].name"></el-input>
<el-input :value="item.operators[item.value].value"></el-input>
</div>
</div>
<span>天&nbsp;&nbsp;切换到此旅程阶段</span>
</template>
</div>
</div>
<div class="condition-panel">
<div class="flex" v-if="conditionsList.name == '页面停留'">
<label class="condition-label">进入条件:</label>
<div class="condition-select">
<div class="condition-input" v-for="item in conditionsList.subConditions" :key="item.id">
<span>并且满足&nbsp;&nbsp;</span>
<span>页面停留时长</span>
<el-input :value="item.operators[item.value].name"></el-input>
<el-input :value="item.operators[item.value].value"></el-input>
<span>秒</span>
<div class="condition-more" v-if="condition && condition.subConditions">
<div>
<template>
<div class="flex-column-center m-t-10" v-for="(item, k) in condition.subConditions" :key="item.id">
<label>并且满足</label>
<el-select v-model="item.name" placeholder="请选择" :size="size" class="condition-1" v-if="item.operators">
<el-option v-for="itm in [item.name]" :key="itm" :label="itm" :value="itm"></el-option>
</el-select>
<el-select v-model="item.value" @change="item.operators[item.value].value = ''" placeholder="请选择" :size="size" class="condition-1" v-if="item.operators">
<el-option v-for="(itm, i) in item.operators" :key="i" :label="itm.name" :value="i"></el-option>
</el-select>
<div class="condition-input" v-if="item.operators[item.value].style == 'input'">
<el-input v-model="item.operators[item.value].value"></el-input>
</div>
<el-select v-model="item.operators[item.value].value" placeholder="请选择" :size="size" class="condition-2" v-if="item.operators[item.value].style == 'select'">
<el-option v-for="i in journeyList" :key="i" :label="i" :value="i"></el-option>
</el-select>
<i class="el-icon-delete" @click="delCondition(condition.subConditions, k)"></i>
</div>
</div>
</div>
<div class="flex-column-center" v-if="configInfo.length == 1">
<label class="require">*</label>
<label class="condition-label">页面配置:</label>
<div class="condition-select">
<div class="condition-input">
<span>当前页面营销活动为</span>
<el-input style="width: 284px;" v-model="activityName"></el-input>
<a @click="typeVisible = true">编辑页面</a>
<div class="condition-add" @click="addCondition(condition.subConditions)">
<i class="el-icon-circle-plus-outline"></i>
添加条件
</div>
</div>
</template>
</div>
</div>
</template>
......@@ -120,8 +117,10 @@ export default {
return {
typeName: '',
empType: 0,
operators: 0,
userList: [],
conditionsList: [],
condition: [],
materialList: {
name: '素材',
type: 'material',
......@@ -208,7 +207,7 @@ export default {
membersVisible: false,
typeVisible: false,
selectData: [],
configInfo: [],
configInfoList: [],
conditionItem: [
{
label: '客户旅程',
......@@ -237,24 +236,37 @@ export default {
},
computed: {
activityName() {
if (this.configInfo.length && this.configInfo[0].operators) {
if (this.configInfo[0].operators[0].value.match(/\d+\+\d+\+(.+)/)) return this.configInfo[0].operators[0].value.match(/\d+\+\d+\+(.+)/)[1]
if (this.configInfoList.length && this.configInfoList[0].operators) {
if (this.configInfoList[0].operators[0].value.match(/\d+\+\d+\+(.+)/)) return this.configInfoList[0].operators[0].value.match(/\d+\+\d+\+(.+)/)[1]
}
return ''
}
},
watch: {
'conditionList.flag'(val) {
if (!val) {
;(val = this.conditionList.conditions[0]), (this.conditionList.flag = val.id)
}
this.condition = this.conditionList.conditions.find(i => i.id == val)
}
},
mounted() {
const { index } = this.conditionInfo,
{ dataTypeCode, conditions, flag, name } = this.conditionInfo.conditionsList[index],
{ dataTypeCode, conditions, flag, name } = this.$common.utils.deepClone(this.conditionInfo.conditionsList[index]),
condition = conditions.filter(i => i.isHide)
this.configInfo = condition
this.configInfoList = this.$common.utils.deepClone(condition)
this.typeName = name
const conditionsList = conditions.filter(i => !i.isHide),
idx = conditionsList.findIndex(i => i.id == flag)
this.conditionsList = conditionsList[idx > -1 ? idx : 0]
if (this.configInfo.length == 2) {
// const conditionsList = conditions.filter(i => !i.isHide),
// idx = conditionsList.findIndex(i => i.id == flag)
// this.conditionsList = conditionsList[idx > -1 ? idx : 0]
this.conditionList = this.$common.utils.deepClone(this.conditionInfo.conditionsList[index])
this.conditionListAll = this.$common.utils.deepClone(this.conditionList)
// this.conditionList.flag = flag
if (this.conditionList.conditions) this.conditionList.conditions = this.conditionList.conditions.filter(i => !i.isHide)
this.condition = this.conditionList.conditions[0]
if (this.configInfoList.length == 2) {
this.empType = 1
this.configInfo.forEach(i => {
this.configInfoList.forEach(i => {
const desc = i.operators[0] && i.operators[0].desc
if (desc) {
this.empType = 0
......@@ -277,12 +289,12 @@ export default {
},
handleMaterialConfirm(val) {
const { objectId, objectName } = val
this.configInfo[0].operators[0].value = `8+${objectId}+${objectName}`
this.configInfoList[0].operators[0].value = `8+${objectId}+${objectName}`
},
selectActivity(val) {
const { marketingName, marketingId, miniType } = val
console.log(marketingName, marketingId, miniType)
this.configInfo[0].operators[0].value = `${miniType}+${marketingId}+${marketingName}`
this.configInfoList[0].operators[0].value = `${miniType}+${marketingId}+${marketingName}`
},
// 成员弹窗
handleConfirm() {
......@@ -298,7 +310,7 @@ export default {
}
},
handleSure() {
if (this.configInfo.length == 2) {
if (this.configInfoList.length == 2) {
if (this.empType == 0) {
const userId = this.userList.map(i => i.userId),
staffName = this.userList.map(i => i.staffName),
......@@ -306,16 +318,34 @@ export default {
for (let i = 0; i < userId.length; i++) {
desc[userId[i]] = staffName[i]
}
this.configInfo[0].operators[0].value = userId.join(',')
this.configInfo[0].operators[0].desc = desc
this.configInfoList[0].operators[0].value = userId.join(',')
this.configInfoList[0].operators[0].desc = desc
} else {
this.configInfo[1].operators = []
this.configInfo[0].operators[0].value = ''
this.configInfo[0].operators[0].desc = ''
this.configInfoList[1].operators = []
this.configInfoList[0].operators[0].value = ''
this.configInfoList[0].operators[0].desc = ''
}
}
const { editable, label, order } = this.$parent.stepItem
const { instId } = this.$route.query,
this.conditionList.conditions.forEach(i => {
this.conditionListAll.conditions.forEach(j => {
if (i.id == j.id) {
j.operators = i.operators
j.subConditions = i.subConditions
}
})
})
this.configInfoList.forEach(i => {
this.conditionListAll.conditions.forEach(j => {
if (i.id == j.id) {
j.operators = i.operators
j.subConditions = i.subConditions
}
})
})
this.conditionInfo.conditionsList[this.conditionInfo.index] = { ...this.conditionListAll, flag: this.conditionList.flag }
const { editable, label, order } = this.$parent.stepItem,
{ instId } = this.$route.query,
data = {
[`${order}`]: {
conditions: this.conditionInfo.conditionsList,
......@@ -340,6 +370,15 @@ export default {
},
handleAddEmp() {
this.membersVisible = true
},
delCondition(val, k) {
val.splice(k, 1)
},
addCondition(val) {
const l = val.length,
prop = this.$common.utils.deepClone(val[l - 1])
prop.id++
val.push(prop)
}
}
}
......@@ -356,6 +395,57 @@ export default {
align-items: center;
// width: 50%;
}
.condition-select {
margin-left: 70px;
line-height: 32px;
}
.condition-more {
margin-left: 70px;
background: #f9f9f9;
padding: 20px;
margin-top: 10px;
.condition-1 {
width: 136px;
margin: 0 10px;
}
.condition-2 {
width: 136px;
}
i {
color: #999999;
margin-left: 10px;
cursor: pointer;
}
.condition-add {
display: flex;
align-items: center;
margin-top: 10px;
cursor: pointer;
i {
font-size: 20px;
margin-right: 6px;
color: #5850ff;
}
font-size: 12px;
color: #5850ff;
}
}
.condition-input {
a {
color: #5850ff;
}
/deep/ {
.el-input {
width: 136px;
margin: 0px 4px;
}
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
}
.input-tag-wrapper {
max-height: 75px;
width: 500px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!