Commit 381778581ede31572b2530bddd06a39ff1852484

Authored by xp.Huang
2 parents e11c6272 5caf3e5a

Merge branch 'fix/form-validate/08-05' into 'main_dev'

perf(src/packages): 优化公共接口下拉选择,切换其他接口,参数未置空

See merge request yunteng/thingskit-view!279
... ... @@ -451,6 +451,8 @@ export const useDynamicPublicForm = (paramsItemList: Ref<ParamsItemType[]>) => {
451 451 params[BuiltInVariable.SELECT_TIME_AGGREGATION].agg = null
452 452 params[BuiltInVariable.SELECT_TIME_AGGREGATION].limit = 7
453 453 params[BuiltInVariable.SELECT_TIME_AGGREGATION].interval = null
  454 + params.page = null
  455 + params.pageSize = null
454 456 getSelectDeviceAttr.value.value = null
455 457 getSelectOrgTree.value.value = null
456 458 getSelectDeviceProfile.value.value = null
... ...
... ... @@ -163,7 +163,6 @@ const setConfigurationData = async (request: ExtraRequestConfigType) => {
163 163 * 源代码 selectedPublicInterface.value = requestDataPondId
164 164 * 修改后代码 selectedPublicInterface.value = publicInterfaceList.value.find(it=>it.id === requestDataPondId)?.id||''
165 165 */
166   - console.log(publicInterfaceList.value)
167 166 selectedPublicInterface.value = publicInterfaceList.value.find(it => it.id === publicInterfaceSelectId)?.id || ''
168 167 //ft
169 168 requestContentTypeRef.value = requestContentType
... ...
... ... @@ -13,13 +13,18 @@ import Preview from './index.vue'
13 13
14 14 let key = ref(Date.now())
15 15
16   -// 数据变更 -> 组件销毁重建
17   -;[SavePageEnum.JSON, SavePageEnum.CHART_TO_PREVIEW].forEach((saveEvent: string) => {
18   - if (!window.opener && !window.opener.addEventListener) return
19   - window.opener.addEventListener(saveEvent, async (e: any) => {
20   - const localStorageInfo: ChartEditStorageType = await getSessionStorageInfo() as unknown as ChartEditStorageType
21   - setSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST, [{ ...e.detail, id: localStorageInfo.id }])
22   - key.value = Date.now()
23   - })
24   -})
  16 +// 数据变更 -> 组件销毁重建
  17 +try {
  18 + const listenerArr = [SavePageEnum.JSON, SavePageEnum.CHART_TO_PREVIEW]
  19 + listenerArr.forEach((saveEvent: string) => {
  20 + if (!window.opener || !window.opener.addEventListener) return
  21 + window.opener.addEventListener(saveEvent, async (e: any) => {
  22 + const localStorageInfo: ChartEditStorageType = (await getSessionStorageInfo()) as unknown as ChartEditStorageType
  23 + setSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST, [{ ...e.detail, id: localStorageInfo.id }])
  24 + key.value = Date.now()
  25 + })
  26 + })
  27 +} catch (error) {
  28 + console.log(error)
  29 +}
25 30 </script>
... ...