Commit cb2af55b by 胡悦

修复bug

1 parent cba23c6e
...@@ -609,8 +609,8 @@ export default { ...@@ -609,8 +609,8 @@ export default {
}, },
handleParams() { handleParams() {
const basicForm = this.clearObject(this.params.basicForm, ['backPicUrl', 'iconUrl']) const basicForm = this.clearObject(this.params.basicForm, ['backPicUrl', 'iconUrl'])
const conditionList = this.params.conditionList.map(item => this.clearObject(item, ['list', 'noValue', 'key'])) const conditionList = _.cloneDeep(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 contentList = _.cloneDeep(this.params.contentList).map(item => this.clearObject(item, ['list', 'lastList', 'key', 'orderType']))
const templateList = conditionList.concat(contentList) const templateList = conditionList.concat(contentList)
const params = _.cloneDeep(Object.assign(basicForm, this.params.scenarioRuleForm)) const params = _.cloneDeep(Object.assign(basicForm, this.params.scenarioRuleForm))
params.templateList = templateList params.templateList = templateList
...@@ -636,15 +636,14 @@ export default { ...@@ -636,15 +636,14 @@ export default {
}, },
// clearObject // clearObject
clearObject(obj, arr = []) { clearObject(obj, arr = []) {
const newObj = _.cloneDeep(obj) for (const i in obj) {
for (const i in newObj) { if (arr.indexOf(i) !== -1) delete obj[i]
if (arr.indexOf(i) !== -1) delete newObj[i] if (obj[i] instanceof Object) this.clearObject(obj[i], arr)
if (newObj[i] instanceof Object) this.clearObject(newObj[i], arr) if (!obj[i]) delete obj[i]
if (!newObj[i]) delete newObj[i]
} }
if (newObj.length === 0) return null if (obj.length === 0) return null
newObj.paramValue = JSON.stringify(newObj.paramValue) obj.paramValue = JSON.stringify(obj.paramValue)
return newObj return obj
}, },
iconChange(val) { iconChange(val) {
this.params.basicForm.iconUrl = this.iconList.find(item => item.id == val).url this.params.basicForm.iconUrl = this.iconList.find(item => item.id == val).url
......
...@@ -163,7 +163,6 @@ export default { ...@@ -163,7 +163,6 @@ export default {
this.scenarioParams = _.cloneDeep(this.defalutScenarioParams) this.scenarioParams = _.cloneDeep(this.defalutScenarioParams)
const { scenarioParams } = this const { scenarioParams } = this
for (const i in scenarioParams.basicForm) { for (const i in scenarioParams.basicForm) {
console.log(i)
if (i === 'backPicUrl') this.$set(scenarioParams, 'backPicUrl', res[i]) if (i === 'backPicUrl') this.$set(scenarioParams, 'backPicUrl', res[i])
scenarioParams.basicForm[i] = 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!