Commit cb2af55b by 胡悦

修复bug

1 parent cba23c6e
......@@ -609,8 +609,8 @@ export default {
},
handleParams() {
const basicForm = this.clearObject(this.params.basicForm, ['backPicUrl', 'iconUrl'])
const conditionList = this.params.conditionList.map(item => this.clearObject(item, ['list', 'noValue', 'key']))
const contentList = this.params.contentList.map(item => this.clearObject(item, ['list', 'lastList', 'key', 'orderType']))
const conditionList = _.cloneDeep(this.params.conditionList).map(item => this.clearObject(item, ['list', 'noValue', 'key']))
const contentList = _.cloneDeep(this.params.contentList).map(item => this.clearObject(item, ['list', 'lastList', 'key', 'orderType']))
const templateList = conditionList.concat(contentList)
const params = _.cloneDeep(Object.assign(basicForm, this.params.scenarioRuleForm))
params.templateList = templateList
......@@ -636,15 +636,14 @@ export default {
},
// clearObject
clearObject(obj, arr = []) {
const newObj = _.cloneDeep(obj)
for (const i in newObj) {
if (arr.indexOf(i) !== -1) delete newObj[i]
if (newObj[i] instanceof Object) this.clearObject(newObj[i], arr)
if (!newObj[i]) delete newObj[i]
for (const i in obj) {
if (arr.indexOf(i) !== -1) delete obj[i]
if (obj[i] instanceof Object) this.clearObject(obj[i], arr)
if (!obj[i]) delete obj[i]
}
if (newObj.length === 0) return null
newObj.paramValue = JSON.stringify(newObj.paramValue)
return newObj
if (obj.length === 0) return null
obj.paramValue = JSON.stringify(obj.paramValue)
return obj
},
iconChange(val) {
this.params.basicForm.iconUrl = this.iconList.find(item => item.id == val).url
......
......@@ -163,7 +163,6 @@ export default {
this.scenarioParams = _.cloneDeep(this.defalutScenarioParams)
const { scenarioParams } = this
for (const i in scenarioParams.basicForm) {
console.log(i)
if (i === 'backPicUrl') this.$set(scenarioParams, 'backPicUrl', res[i])
scenarioParams.basicForm[i] = res[i]
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!