gemercheung 9 mēneši atpakaļ
vecāks
revīzija
9a8e3734d4
3 mainītis faili ar 20 papildinājumiem un 4 dzēšanām
  1. 2 0
      src/App.vue
  2. 17 0
      src/store/main.ts
  3. 1 4
      src/views/topicNavigation/index.vue

+ 2 - 0
src/App.vue

@@ -282,6 +282,8 @@ const handleEditorSave = async () => {
   await editorSave(data)
   message.success('保存成功!')
 }
+
+
 </script>
 
 <style lang="sass">

+ 17 - 0
src/store/main.ts

@@ -91,9 +91,26 @@ export const useMainStore = defineStore('main', {
     async getSceneInfo() {
       const data = await getInfo(this.sceneCode)
       console.log('data', data)
+
       this.sceneInfo = data as any as {
         boxVideos: string
         boxModels: string
+        scrbInfo: {
+          aiSetting: any
+          navigation: any
+          baseSetting: any
+        }
+      }
+      if (this.sceneInfo) {
+        if (this.sceneInfo?.scrbInfo.aiSetting) {
+          this.aiSetting = this.sceneInfo.scrbInfo.aiSetting
+        }
+        if ('navigation' in this.sceneInfo.scrbInfo) {
+          this.navigation = this.sceneInfo.scrbInfo.navigation
+        }
+        if ('baseSetting' in this.sceneInfo.scrbInfo) {
+          this.basicConfig = this.sceneInfo.scrbInfo.baseSetting
+        }
       }
     },
     syncNavigation(navigation: any[]) {

+ 1 - 4
src/views/topicNavigation/index.vue

@@ -165,10 +165,7 @@ const handleAdd = () => {
     panos: []
   })
 
-  if (panos.value.length === 0) {
-  } else {
-    // message.warning('请先保存数据!')
-  }
+  main.syncNavigation(dataList.value)
 }
 watchEffect(() => {
   if (naviData.value) {