mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-24 16:22:57 +08:00
perf: 优化获取id 的旧代码
This commit is contained in:
parent
1bd67a6ea7
commit
2f2d87826c
@ -66,7 +66,7 @@ import { ref, computed, h, watch } from 'vue'
|
|||||||
import { useSettingStore } from '@/store/modules/settingStore/settingStore'
|
import { useSettingStore } from '@/store/modules/settingStore/settingStore'
|
||||||
import { ToolsStatusEnum } from '@/store/modules/settingStore/settingStore.d'
|
import { ToolsStatusEnum } from '@/store/modules/settingStore/settingStore.d'
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||||
import { fetchPathByName, routerTurnByPath, setSessionStorage, getLocalStorage } from '@/utils'
|
import { fetchRouteParamsLocation, fetchPathByName, routerTurnByPath, setSessionStorage, getLocalStorage } from '@/utils'
|
||||||
import { editToJsonInterval } from '@/settings/designSetting'
|
import { editToJsonInterval } from '@/settings/designSetting'
|
||||||
import { EditEnum, ChartEnum } from '@/enums/pageEnum'
|
import { EditEnum, ChartEnum } from '@/enums/pageEnum'
|
||||||
import { StorageEnum } from '@/enums/storageEnum'
|
import { StorageEnum } from '@/enums/storageEnum'
|
||||||
@ -143,8 +143,7 @@ const editHandle = () => {
|
|||||||
// 获取id路径
|
// 获取id路径
|
||||||
const path = fetchPathByName(EditEnum.CHART_EDIT_NAME, 'href')
|
const path = fetchPathByName(EditEnum.CHART_EDIT_NAME, 'href')
|
||||||
if (!path) return
|
if (!path) return
|
||||||
let { id } = routerParamsInfo.params as any
|
const id = fetchRouteParamsLocation()
|
||||||
id = typeof id === 'string' ? id : id[0]
|
|
||||||
updateToSession(id)
|
updateToSession(id)
|
||||||
routerTurnByPath(path, [id], undefined, true)
|
routerTurnByPath(path, [id], undefined, true)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, nextTick, computed } from 'vue'
|
import { ref, nextTick, computed } from 'vue'
|
||||||
import { fetchRouteParams } from '@/utils'
|
import { fetchRouteParamsLocation } from '@/utils'
|
||||||
import { icon } from '@/plugins'
|
import { icon } from '@/plugins'
|
||||||
const { FishIcon } = icon.ionicons5
|
const { FishIcon } = icon.ionicons5
|
||||||
|
|
||||||
@ -39,9 +39,7 @@ const inputInstRef = ref(null)
|
|||||||
|
|
||||||
// 根据路由 id 参数获取项目信息
|
// 根据路由 id 参数获取项目信息
|
||||||
const fetchProhectInfoById = () => {
|
const fetchProhectInfoById = () => {
|
||||||
const routeParamsRes = fetchRouteParams()
|
const id = fetchRouteParamsLocation()
|
||||||
if (!routeParamsRes) return
|
|
||||||
const { id } = routeParamsRes
|
|
||||||
if (id.length) {
|
if (id.length) {
|
||||||
return id[0]
|
return id[0]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user