|
|
@ -519,6 +519,12 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
|
} |
|
|
|
if (data.condition) { |
|
|
|
formData.value.condition = JSON.parse(data.condition) |
|
|
|
formData.value.condition.forEach((item, index) => { |
|
|
|
if (item.Operator == 'IN' || item.Operator == 'NOT IN') { |
|
|
|
item.Value = item.Value.split(',') |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(formData.value.condition) |
|
|
|
} |
|
|
|
if (data.configuration) { |
|
|
|
formData.value.configuration = JSON.parse(data.configuration) |
|
|
@ -566,6 +572,17 @@ const submitForm = async () => { |
|
|
|
// 提交请求 |
|
|
|
formLoading.value = true |
|
|
|
try { |
|
|
|
const arr = formData.value.condition.map(item=> { |
|
|
|
let str = item.Value |
|
|
|
if ((item.Operator == 'IN' || item.Operator == 'NOT IN')&& Array.isArray(item.Value)) { |
|
|
|
str = item.Value.join(',') |
|
|
|
} |
|
|
|
return { |
|
|
|
ParamCode:item.ParamCode, |
|
|
|
Operator:item.Operator, |
|
|
|
Value:str |
|
|
|
} |
|
|
|
}) |
|
|
|
let data = { |
|
|
|
id: formData.value.id, |
|
|
|
strategyCode: formData.value.strategyCode, //策略代码 |
|
|
@ -574,7 +591,7 @@ const submitForm = async () => { |
|
|
|
priority: formData.value.priority, //优先级 |
|
|
|
status: formData.value.status ? 0 : 1, //状态 |
|
|
|
//规则条件集合 |
|
|
|
condition: JSON.stringify(formData.value.condition), |
|
|
|
condition: JSON.stringify(arr), |
|
|
|
configuration: JSON.stringify(formData.value.configuration) |
|
|
|
} |
|
|
|
if (formType.value === 'create') { |
|
|
|