forked from github/dataease
fix(嵌入式): div嵌入的仪表板树界面,使用模板新建仪表板失败
This commit is contained in:
parent
c8c1eea7f1
commit
cf383b9724
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, watch } from 'vue'
|
||||
import { ref, computed, onMounted, watch, onUnmounted } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
@ -160,12 +160,23 @@ const getTree = async () => {
|
||||
if (nodeData.length && nodeData[0]['id'] === '0' && nodeData[0]['name'] === 'root') {
|
||||
tableData.value = dfsTableData(nodeData[0]['children'] || [])
|
||||
rawTableData = cloneDeep(tableData.value)
|
||||
setSortType()
|
||||
return
|
||||
}
|
||||
tableData.value = dfsTableData(nodeData)
|
||||
rawTableData = cloneDeep(tableData.value)
|
||||
setSortType()
|
||||
}
|
||||
|
||||
const setSortType = () => {
|
||||
const type = wsCache.get('mobile-sort-type')
|
||||
sortTypeChange(type || curSortType.value)
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
wsCache.set('mobile-sort-type', curSortType.value)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getTree()
|
||||
activeDirectName.value = wsCache.get('activeDirectName')
|
||||
|
@ -450,7 +450,7 @@ const apply = template => {
|
||||
'changeCurrentComponent',
|
||||
['dataV', 'SCREEN'].includes(state.dvCreateForm.nodeType)
|
||||
? 'VisualizationEditor'
|
||||
: 'Dashboard'
|
||||
: 'DashboardEditor'
|
||||
)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user