fix
This commit is contained in:
@@ -9,30 +9,50 @@
|
||||
<Preview :type="previewType" :sketchList="sketchList" />
|
||||
</div>
|
||||
</div>
|
||||
<VersionTreeIndex v-model:versionTreeData="versionTreeData" />
|
||||
<VersionTreeIndex ref="VersionTreeIndexRef" v-model:versionTreeData="versionTreeData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, watch, onMounted } 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'
|
||||
|
||||
|
||||
const agentTitle = ref('Retro Sofa Sketch')
|
||||
const previewType = ref<'sketch' | 'report'>('sketch')
|
||||
|
||||
const VersionTreeIndexRef = ref()
|
||||
|
||||
const sketchList = ref([])
|
||||
const updateSketchList = (newVal) => {
|
||||
console.log('newVal', newVal)
|
||||
sketchList.value = newVal
|
||||
// VersionTreeIndexRef.value.getVersionTree()
|
||||
}
|
||||
|
||||
const versionTreeData = ref({
|
||||
drawer: false,
|
||||
list: computed(() => {
|
||||
return []
|
||||
})
|
||||
})
|
||||
|
||||
const projectStore = useProjectStore()
|
||||
watch(()=>projectStore.state.id, (newVal, oldVal) => {
|
||||
if(newVal){
|
||||
getProjectInfo({ id: newVal }).then(res => {
|
||||
projectStore.setProject(res.project)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(()=>{
|
||||
if(projectStore.state.id){
|
||||
getProjectInfo({ id: projectStore.state.id }).then(res => {
|
||||
projectStore.setProject(res.project)
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user