修复对话生成没有更新树
This commit is contained in:
@@ -29,7 +29,7 @@ const projectStore = useProjectStore()
|
||||
let oldProjectId:any = ''
|
||||
watch(()=>props.versionTreeData?.drawer, (newVal, oldVal) => {
|
||||
console.log(newVal,oldProjectId,projectStore.state.id)
|
||||
if(newVal && oldProjectId !== projectStore.state.id && projectStore.state.id){
|
||||
if(newVal || (oldProjectId !== projectStore.state.id && projectStore.state.id)){
|
||||
getVersionTree()
|
||||
oldProjectId = JSON.parse(JSON.stringify(projectStore.state.id))
|
||||
}
|
||||
@@ -41,6 +41,7 @@ const getVersionTree = ()=>{
|
||||
}).then(res => {
|
||||
if(!res)return
|
||||
setVersionsList([res])
|
||||
treeKey.value++
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,6 @@ const initialize = ()=>{
|
||||
|
||||
const setSelectItem = (item)=>{
|
||||
if(!item.versionId)return
|
||||
console.log(item)
|
||||
projectStore.setProject({nodeId: item.id})
|
||||
emit('update:selectItem', {...item})
|
||||
emit('selectNode')
|
||||
@@ -97,10 +96,6 @@ watch(()=>treeStateTime.value,(newVal,oldVal)=>{
|
||||
}
|
||||
})
|
||||
|
||||
watch(()=>props.selectItem,(newVal,oldVal)=>{
|
||||
// scrollToActive()
|
||||
},{immediate: true})
|
||||
|
||||
onMounted(()=>{
|
||||
initialize()
|
||||
})
|
||||
|
||||
@@ -125,7 +125,7 @@ defineExpose({push})
|
||||
</template> -->
|
||||
</VueFlow>
|
||||
<div class="btnBox">
|
||||
<div class="item" :class="{'active':selectItem.url}" @click="versionRestore">
|
||||
<div class="item" :class="{'active':!selectItem.url}" @click="versionRestore">
|
||||
<div class="icon">
|
||||
<SvgIcon name="versionRestore" size="12" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user