|
|
@ -422,7 +422,7 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
|
formData.value.status = data.status == 0 ? true : false |
|
|
|
if (formData.value.priority == 0) { |
|
|
|
Butttondata.value = [ |
|
|
|
defaultButtons.formSaveBtn({disabled:true}), // 保存 |
|
|
|
defaultButtons.formSaveBtn({ disabled: true }), // 保存 |
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
] |
|
|
|
} else { |
|
|
@ -433,6 +433,11 @@ 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(',') |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if (data.configuration) { |
|
|
|
formData.value.configuration = JSON.parse(data.configuration) |
|
|
@ -458,14 +463,25 @@ const submitForm = async () => { |
|
|
|
if (!formRef) return |
|
|
|
const valid = await formRef.value.validate() |
|
|
|
if (!valid) return |
|
|
|
|
|
|
|
if(formData.value.priority == 0){ |
|
|
|
|
|
|
|
if (formData.value.priority == 0) { |
|
|
|
message.error('优先级不可以为0') |
|
|
|
return |
|
|
|
} |
|
|
|
// 提交请求 |
|
|
|
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, //策略代码 |
|
|
@ -474,7 +490,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') { |
|
|
|