Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/FiDA_Front
This commit is contained in:
@@ -29,7 +29,7 @@ const projectStore = useProjectStore()
|
|||||||
let oldProjectId:any = ''
|
let oldProjectId:any = ''
|
||||||
watch(()=>props.versionTreeData?.drawer, (newVal, oldVal) => {
|
watch(()=>props.versionTreeData?.drawer, (newVal, oldVal) => {
|
||||||
console.log(newVal,oldProjectId,projectStore.state.id)
|
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()
|
getVersionTree()
|
||||||
oldProjectId = JSON.parse(JSON.stringify(projectStore.state.id))
|
oldProjectId = JSON.parse(JSON.stringify(projectStore.state.id))
|
||||||
}
|
}
|
||||||
@@ -41,6 +41,7 @@ const getVersionTree = ()=>{
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(!res)return
|
if(!res)return
|
||||||
setVersionsList([res])
|
setVersionsList([res])
|
||||||
|
treeKey.value++
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ const initialize = ()=>{
|
|||||||
|
|
||||||
const setSelectItem = (item)=>{
|
const setSelectItem = (item)=>{
|
||||||
if(!item.versionId)return
|
if(!item.versionId)return
|
||||||
console.log(item)
|
|
||||||
projectStore.setProject({nodeId: item.id})
|
projectStore.setProject({nodeId: item.id})
|
||||||
emit('update:selectItem', {...item})
|
emit('update:selectItem', {...item})
|
||||||
emit('selectNode')
|
emit('selectNode')
|
||||||
@@ -97,10 +96,6 @@ watch(()=>treeStateTime.value,(newVal,oldVal)=>{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(()=>props.selectItem,(newVal,oldVal)=>{
|
|
||||||
// scrollToActive()
|
|
||||||
},{immediate: true})
|
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
initialize()
|
initialize()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ defineExpose({push})
|
|||||||
</template> -->
|
</template> -->
|
||||||
</VueFlow>
|
</VueFlow>
|
||||||
<div class="btnBox">
|
<div class="btnBox">
|
||||||
<div class="item" v-if="selectItem.url" @click="versionRestore">
|
<div class="item" :class="{'active':!selectItem.url}" @click="versionRestore">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<SvgIcon name="versionRestore" size="12" />
|
<SvgIcon name="versionRestore" size="12" />
|
||||||
</div>
|
</div>
|
||||||
@@ -225,6 +225,11 @@ defineExpose({push})
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
pointer-events: none;
|
||||||
|
&.active{
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
&:hover{
|
&:hover{
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,10 +63,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleGetProjectInfoAndHistory = () => {
|
const handleGetProjectInfoAndHistory = () => {
|
||||||
getProjectInfo({ id: projectStore.state.id }).then((res) => {
|
getProjectInfo({ id: route.params.id }).then((res) => {
|
||||||
// console.log('1111111',res);
|
if(res?.conversation)agentRef.value.setChatInfo(res.conversation)
|
||||||
agentRef.value.setChatInfo(res.conversation)
|
let data = res?.project || res
|
||||||
projectStore.setProject(res.project)
|
if(data?.latestNodeId)data.nodeId = data.latestNodeId
|
||||||
|
projectStore.setProject({
|
||||||
|
...data,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,15 +78,7 @@
|
|||||||
watch(
|
watch(
|
||||||
() => proJectId.value,
|
() => proJectId.value,
|
||||||
(newVal, oldVal) => {
|
(newVal, oldVal) => {
|
||||||
if (newVal) {
|
projectStore.clearProject()
|
||||||
projectStore.clearProject()
|
|
||||||
projectStore.setId(newVal)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
watch(
|
|
||||||
() => projectStore.state.id,
|
|
||||||
(newVal, oldVal) => {
|
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
handleGetProjectInfoAndHistory()
|
handleGetProjectInfoAndHistory()
|
||||||
}
|
}
|
||||||
@@ -91,7 +86,8 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (projectStore.state.id) {
|
projectStore.clearProject()
|
||||||
|
if (proJectId.value) {
|
||||||
handleGetProjectInfoAndHistory()
|
handleGetProjectInfoAndHistory()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user