Commit 5980ebfc by 杨明

fixed

1 parent af8544c8
......@@ -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-04 14:24:58
* @LastEditTime: 2024-01-05 12:42:14
* @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
-->
......@@ -135,17 +135,17 @@ export default {
},
handleSure() {
const { conditionList, conditionListAll, condition_i } = this.$refs.conditionForm
console.log(conditionList)
console.log(conditionList, 'conditionList')
conditionList.conditions.forEach(i => {
conditionListAll.conditions.forEach(j => {
if (i.id == j.id) {
j.value = i.value
j.operators = i.operators
j.subConditions = i.subConditions
}
})
})
console.log(conditionList, conditionListAll)
this.$emit('closeActivity', { conditionList: conditionListAll, condition_i })
console.log(conditionList, conditionListAll,9)
this.$emit('closeActivity', { conditionList: {...conditionListAll,flag:conditionList.flag}, condition_i })
},
handleAddEmp() {
this.membersVisible = true
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-25 13:34:43
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-04 14:28:04
* @LastEditTime: 2024-01-05 12:39:42
* @FilePath: \scrm-micro-peregrination\src\views\journeyModel\components\condition.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -14,8 +14,8 @@
<el-option v-for="item in stepList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<div class="flex">
<el-select v-model="conditionIndex" placeholder="请选择" :size="size" class="m-r-10" v-if="this.conditionList.conditions && this.conditionList.conditions.length > 1">
<el-option v-for="(item, index) in this.conditionList.conditions" :key="index" :label="item.name" :value="index"></el-option>
<el-select v-model="conditionList.flag" placeholder="请选择" :size="size" class="m-r-10" v-if="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">
......@@ -64,17 +64,18 @@ export default {
step: '',
condition_i: null,
conditionIndex: 0,
operators: 0,
conditionList: [],
condition: '',
journeyList: [],
stepList: [],
operators: 0
stepList: []
}
},
inject: ['stepList', 'app'],
mounted() {
const stepList = this.app.stepList || []
stepList.forEach(item => {
item.flag = ''
item.conditions.forEach(i => {
if (i.subConditions)
i.subConditions.forEach(j => {
......@@ -86,12 +87,34 @@ export default {
this.journeyList = this.app.journeyList
},
watch: {
conditionIndex(i) {
this.condition = this.conditionList.conditions[i]
'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)
}
},
methods: {
// mergeArr(arr1, arr2, val) {
// // 遍历数组 arr1
// arr1.forEach(a1 => {
// // 在数组 arr2 中查找相同 id 的对象
// const obj = arr2.find(a2 => a1.id === a2.id)
// // 如果找到匹配的对象,则进行覆盖
// if (obj[val] && typeof obj[val] != 'object' && obj[val] != a1[val]) {
// Object.assign(a1, obj)
// }
// })
// },
// contrastObj(obj1, obj2) {
// for (let i in obj1) {
// if (Array.isArray(obj1[i])) {
// this.mergeArr(obj1[i], obj2[i])
// }
// }
// },
setCondition(val, index) {
console.log(val)
this.step = val.id
this.conditionListAll = this.$common.utils.deepClone(val)
this.conditionList = this.$common.utils.deepClone(val)
......@@ -116,6 +139,7 @@ export default {
this.conditionList = this.$common.utils.deepClone(conditions)
if (this.conditionList.conditions) this.conditionList.conditions = this.conditionList.conditions.filter(i => !i.isHide)
this.condition = this.conditionList.conditions[0]
console.log(this.condition)
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!