Commit 259769bce5e2c11e11508f1a7133874487125360
1 parent
bf37ef7f
perf(views/chart): 优化动态表单包含有entityType,则自动回填DEVICE
Showing
1 changed file
with
13 additions
and
0 deletions
| @@ -113,6 +113,19 @@ const setDynamicFormValue = (request: ExtraRequestConfigType) => { | @@ -113,6 +113,19 @@ const setDynamicFormValue = (request: ExtraRequestConfigType) => { | ||
| 113 | if (unref(bodyContentEl)) { | 113 | if (unref(bodyContentEl)) { |
| 114 | unref(bodyContentEl)?.setConfigurationData(unref(getSelectedInterfaceBody), Body) | 114 | unref(bodyContentEl)?.setConfigurationData(unref(getSelectedInterfaceBody), Body) |
| 115 | } | 115 | } |
| 116 | + /** | ||
| 117 | + * ft 修改动态表单包含有entityType,则自动回填DEVICE | ||
| 118 | + */ | ||
| 119 | + if(typeof request.requestParams ==='string' && request.requestParams) { | ||
| 120 | + const DEVICE='DEVICE' | ||
| 121 | + const {Params:includeEntityTypeByParams}=JSON.parse(request.requestParams as unknown as string) | ||
| 122 | + const findEntityType = includeEntityTypeByParams.find((item:Record<string,string>)=>item.key==='scope' && item.value==='entityType') | ||
| 123 | + if(!findEntityType) return | ||
| 124 | + if (unref(paramsDynamicFormEl)) unref(paramsDynamicFormEl)?.setConfigurationData({ | ||
| 125 | + [findEntityType?.value]:DEVICE | ||
| 126 | + }) | ||
| 127 | + } | ||
| 128 | + //ft | ||
| 116 | } | 129 | } |
| 117 | 130 | ||
| 118 | const getDynamicFormValue = (): Recordable => { | 131 | const getDynamicFormValue = (): Recordable => { |