Commit fe2f1698 by 胡悦

添加场景验证

1 parent b3b79cbc
...@@ -266,7 +266,7 @@ export default { ...@@ -266,7 +266,7 @@ export default {
} }
this.getListApi(params).then(res => { this.getListApi(params).then(res => {
this.data = res[this.tableParams.listName] this.data = res[this.tableParams.listName]
this.total = res.totalElements this.total = res.total || res.totalElements
this.loading = false this.loading = false
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
......
...@@ -113,34 +113,35 @@ export default { ...@@ -113,34 +113,35 @@ export default {
}, },
scenarioRuleForm: { scenarioRuleForm: {
conditionRule: '', conditionRule: '',
executeCycle: '' executeCycle: '',
}, conditionList: [
conditionList: [ {
{ key: parseInt(Math.random() * 1000),
key: parseInt(Math.random() * 1000), type: 1,
type: 1, paramKey: '',
paramKey: '', paramValue: {
paramValue: { date: '',
date: '', select: '',
select: '', order: '',
order: '', value: ''
value: '' }
} }
} ],
], contentList: [
contentList: [ {
{ key: parseInt(Math.random() * 1000),
key: parseInt(Math.random() * 1000), type: 2,
type: 2, paramKey: '',
paramKey: '', paramValue: {
paramValue: { msg: '',
msg: '', select: '',
select: '', order: '',
order: '', orderVal: ''
orderVal: '' }
} }
} ]
] }
} }
} }
}, },
...@@ -162,19 +163,21 @@ export default { ...@@ -162,19 +163,21 @@ export default {
for (const i in scenarioParams.basicForm) { for (const i in scenarioParams.basicForm) {
scenarioParams.basicForm[i] = res[i] scenarioParams.basicForm[i] = res[i]
} }
for (const i in scenarioParams.scenarioRuleForm) { scenarioParams.scenarioRuleForm.conditionRule = scenarioParams.scenarioRuleForm['conditionRule'] = '' + res['conditionRule']
if (i === 'conditionRule') scenarioParams.scenarioRuleForm[i] = '' + res[i] scenarioParams.scenarioRuleForm.executeCycle = scenarioParams.scenarioRuleForm['executeCycle'] = res['executeCycle']
else scenarioParams.scenarioRuleForm[i] = res[i] // for (const i in scenarioParams.scenarioRuleForm) {
} // if (i === 'conditionRule') scenarioParams.scenarioRuleForm[i] = '' + res[i]
// else scenarioParams.scenarioRuleForm[i] = res[i]
// }
scenarioParams.basicForm.id = res.id scenarioParams.basicForm.id = res.id
const templateList = res.templateList const templateList = res.templateList
scenarioParams.conditionList = [] scenarioParams.scenarioRuleForm.conditionList = []
scenarioParams.contentList = [] scenarioParams.scenarioRuleForm.contentList = []
if (templateList.length !== 0) { if (templateList.length !== 0) {
templateList.forEach(item => { templateList.forEach(item => {
item.paramValue = JSON.parse(item.paramValue) item.paramValue = JSON.parse(item.paramValue)
if (item.type === 1) scenarioParams.conditionList.push(item) if (item.type === 1) scenarioParams.scenarioRuleForm.conditionList.push(item)
else if (item.type === 2) scenarioParams.contentList.push(item) else if (item.type === 2) scenarioParams.scenarioRuleForm.contentList.push(item)
}) })
} }
this.hideDialog() this.hideDialog()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!