Commit 0a16ecd196b0a67e6a846dfa17b0a505f595f9b4

Authored by xp.Huang
2 parents 3e1f5268 fc4d9241

Merge branch 'fix/line-form-setFormData' into 'main_dev'

fix: 修复折线图和柱状图属性物模型表单赋值问题

See merge request yunteng/thingskit-view!203
... ... @@ -65,7 +65,8 @@ export const useDynamicPublicForm = (paramsItemList: Ref<ParamsItemType[]>) => {
65 65 const builtInVariable = ref<BuiltInVariableRecord>()
66 66
67 67 const params = reactive<Recordable & { [key in BuiltInVariable]?: any }>({
68   - [BuiltInVariable.SELECT_TIME_AGGREGATION]: {}
  68 + [BuiltInVariable.SELECT_TIME_AGGREGATION]: {},
  69 + [BuiltInVariable.ATTR_NAME]: []
69 70 })
70 71
71 72 const optionsSet = reactive<Recordable>({})
... ... @@ -112,7 +113,6 @@ export const useDynamicPublicForm = (paramsItemList: Ref<ParamsItemType[]>) => {
112 113 if( !organizationId) return
113 114 if (!validIsExist(BuiltInVariable.ORGANIZATION_ID)) return
114 115 optionsSet[BuiltInVariable.ORGANIZATION_ID] = await getOrgList({organizationId})
115   - console.log(optionsSet[BuiltInVariable.ORGANIZATION_ID])
116 116 }
117 117
118 118 const getDeviceProfileOption = async () => {
... ... @@ -167,7 +167,6 @@ export const useDynamicPublicForm = (paramsItemList: Ref<ParamsItemType[]>) => {
167 167 }
168 168 Reflect.deleteProperty(value, BuiltInVariable.SELECT_TIME_AGGREGATION)
169 169 }
170   -
171 170 return value
172 171 })
173 172
... ... @@ -235,6 +234,7 @@ export const useDynamicPublicForm = (paramsItemList: Ref<ParamsItemType[]>) => {
235 234 const attrNameList = unref(optionsSet[BuiltInVariable.KEYS])
236 235
237 236 params[BuiltInVariable.ATTR_NAME] = value.map((item:any) => attrNameList.find((temp:any)=>temp.identifier==item).name)
  237 +
238 238 }
239 239 }
240 240 })
... ... @@ -439,6 +439,7 @@ export const useDynamicPublicForm = (paramsItemList: Ref<ParamsItemType[]>) => {
439 439 for (const temp of splitKeys) {
440 440 params[temp] = Params[temp]
441 441 }
  442 + params[BuiltInVariable.ATTR_NAME] = Params[BuiltInVariable.ATTR_NAME]
442 443 }
443 444 }
444 445
... ...