fix(嵌入式): div嵌入的仪表板树界面,使用模板新建仪表板失败

This commit is contained in:
dataeaseShu 2024-05-31 11:09:46 +08:00
parent c8c1eea7f1
commit cf383b9724
2 changed files with 13 additions and 2 deletions

View File

@ -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')

View File

@ -450,7 +450,7 @@ const apply = template => {
'changeCurrentComponent',
['dataV', 'SCREEN'].includes(state.dvCreateForm.nodeType)
? 'VisualizationEditor'
: 'Dashboard'
: 'DashboardEditor'
)
return
}