This commit is contained in:
lzp
2026-02-27 17:32:57 +08:00

View File

@@ -18,15 +18,18 @@
</template>
<script setup lang="ts">
import { ref, watch, onMounted } from 'vue'
import { ref, watch, onMounted, computed } from 'vue'
import Agent from './components/Agent.vue'
import Preview from './components/Preview.vue'
import VersionTreeIndex from './components/versionTree/index.vue'
import { useProjectStore } from '@/stores'
import { getProjectInfo } from '@/api/agent'
import { useRoute } from 'vue-router'
const agentTitle = ref('Retro Sofa Sketch')
const previewType = ref<'sketch' | 'report'>('sketch')
const route = useRoute()
const VersionTreeIndexRef = ref()
const agentRef = ref()
@@ -47,7 +50,17 @@
agentRef.value?.inputRef?.addReportTag('Restore')
}
const proJectId = computed(() => route.params.id)
const projectStore = useProjectStore()
watch(
() => proJectId.value,
(newVal, oldVal) => {
if (newVal) {
projectStore.setId(newVal)
}
}
)
watch(
() => projectStore.state.id,
(newVal, oldVal) => {