Commit 5980ebfc by 杨明

fixed

1 parent af8544c8
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-27 11:29:17 * @Date: 2023-09-27 11:29:17
* @LastEditors: yangming yangming@didihu.com.cn * @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 * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -135,17 +135,17 @@ export default { ...@@ -135,17 +135,17 @@ export default {
}, },
handleSure() { handleSure() {
const { conditionList, conditionListAll, condition_i } = this.$refs.conditionForm const { conditionList, conditionListAll, condition_i } = this.$refs.conditionForm
console.log(conditionList) console.log(conditionList, 'conditionList')
conditionList.conditions.forEach(i => { conditionList.conditions.forEach(i => {
conditionListAll.conditions.forEach(j => { conditionListAll.conditions.forEach(j => {
if (i.id == j.id) { if (i.id == j.id) {
j.value = i.value j.operators = i.operators
j.subConditions = i.subConditions j.subConditions = i.subConditions
} }
}) })
}) })
console.log(conditionList, conditionListAll) console.log(conditionList, conditionListAll,9)
this.$emit('closeActivity', { conditionList: conditionListAll, condition_i }) this.$emit('closeActivity', { conditionList: {...conditionListAll,flag:conditionList.flag}, condition_i })
}, },
handleAddEmp() { handleAddEmp() {
this.membersVisible = true this.membersVisible = true
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-25 13:34:43 * @Date: 2023-12-25 13:34:43
* @LastEditors: yangming yangming@didihu.com.cn * @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 * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<el-option v-for="item in stepList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in stepList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<div class="flex"> <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-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, index) in this.conditionList.conditions" :key="index" :label="item.name" :value="index"></el-option> <el-option v-for="item in conditionList.conditions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<template v-if="condition && condition.operators && condition.operators.length"> <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-select v-model="operators" @change="condition.operators[operators].value = ''" placeholder="请选择" :size="size" class="m-r-10">
...@@ -64,17 +64,18 @@ export default { ...@@ -64,17 +64,18 @@ export default {
step: '', step: '',
condition_i: null, condition_i: null,
conditionIndex: 0, conditionIndex: 0,
operators: 0,
conditionList: [], conditionList: [],
condition: '', condition: '',
journeyList: [], journeyList: [],
stepList: [], stepList: []
operators: 0
} }
}, },
inject: ['stepList', 'app'], inject: ['stepList', 'app'],
mounted() { mounted() {
const stepList = this.app.stepList || [] const stepList = this.app.stepList || []
stepList.forEach(item => { stepList.forEach(item => {
item.flag = ''
item.conditions.forEach(i => { item.conditions.forEach(i => {
if (i.subConditions) if (i.subConditions)
i.subConditions.forEach(j => { i.subConditions.forEach(j => {
...@@ -86,12 +87,34 @@ export default { ...@@ -86,12 +87,34 @@ export default {
this.journeyList = this.app.journeyList this.journeyList = this.app.journeyList
}, },
watch: { watch: {
conditionIndex(i) { 'conditionList.flag'(val) {
this.condition = this.conditionList.conditions[i] if (!val) {
;(val = this.conditionList.conditions[0]), (this.conditionList.flag = val.id)
}
this.condition = this.conditionList.conditions.find(i => i.id == val)
} }
}, },
methods: { 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) { setCondition(val, index) {
console.log(val)
this.step = val.id this.step = val.id
this.conditionListAll = this.$common.utils.deepClone(val) this.conditionListAll = this.$common.utils.deepClone(val)
this.conditionList = this.$common.utils.deepClone(val) this.conditionList = this.$common.utils.deepClone(val)
...@@ -116,6 +139,7 @@ export default { ...@@ -116,6 +139,7 @@ export default {
this.conditionList = this.$common.utils.deepClone(conditions) this.conditionList = this.$common.utils.deepClone(conditions)
if (this.conditionList.conditions) this.conditionList.conditions = this.conditionList.conditions.filter(i => !i.isHide) if (this.conditionList.conditions) this.conditionList.conditions = this.conditionList.conditions.filter(i => !i.isHide)
this.condition = this.conditionList.conditions[0] 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!