Browse Source

feat(frontend): 添加历史记录功能并优化高级生成菜单

- 在高级生成菜单中添加历史记录选项
- 实现历史记录功能,允许用户查看生成记录
-优化高级生成菜单的布局和样式
- 更新生成视频功能的API路径
panqiuyao 5 months ago
parent
commit
b5ae3cb9b3
2 changed files with 37 additions and 27 deletions
  1. 30 23
      frontend/src/utils/menus/generate.ts
  2. 7 4
      frontend/src/views/Photography/shot.vue

+ 30 - 23
frontend/src/utils/menus/generate.ts

@@ -7,31 +7,35 @@ import { getWebUrlrUrl } from '@/utils/appfun'
 const Router = useRouter()
 
 const clientStore = client()
-const generate =
-        {
-            name:'高级生成',
-            children:[
-                {
-                    name:'模特图',
-                    click(configs){
-                        console.log(configs);
-                        openGaenrate('onFeetImage',configs)
-                    },
+const generate =  {
+        name:'高级生成',
+        children:[
+            {
+                name:'模特图',
+                click(configs){
+                    console.log(configs);
+                    openGaenrate('onFeetImage',configs)
                 },
-                {
-                    name:'场景图',
-                    click(configs){
-                        openGaenrate('attachScenarios',configs)
-                    },
+            },
+            {
+                name:'场景图',
+                click(configs){
+                    openGaenrate('attachScenarios',configs)
                 },
-                {
-                    name:'生成视频',
-                    click(configs){
-                        openGaenrate('生成视频',configs)
-                    },
+            },
+            {
+                name:'生成视频',
+                click(configs){
+                    openGaenrate('video',configs)
                 },
-            ]
-        }
+            },{
+                name:'历史记录',
+                click(configs){
+                    openGaenrate('mine',configs)
+                },
+            }
+        ]
+    }
 
 
 
@@ -47,7 +51,10 @@ export function openGaenrate(type,configs) {
             url:"/attachScenarios"
         },
         "video":{
-            url:"/attachScenarios"
+            url:"/create_video"
+        },
+        "mine":{
+            url:"/mine"
         }
     }
 

+ 7 - 4
frontend/src/views/Photography/shot.vue

@@ -98,7 +98,7 @@
 -->
 
                     <el-dropdown @command="handleGenerateCommand" :disabled="runLoading || takePictureLoading" >
-                      <el-button :disabled="runLoading || takePictureLoading" size="small"  plain >高级生成</el-button>
+                      <el-button :disabled="runLoading || takePictureLoading" size="small"  plain style="margin-right: 5px" >高级生成</el-button>
                       <template #dropdown>
                         <el-dropdown-menu>
                           <el-dropdown-item
@@ -200,8 +200,7 @@ import {useRouter} from "vue-router";
 import HardwareCheck from '@/components/check/index.vue'
 import checkInfo from "@/stores/modules/check";
 import RemoteControl from '@/views/RemoteControl/index'
-import  generate,{openGaenrate}  from '@/utils/menus/generate'
-
+import  generate from '@/utils/menus/generate'
 
 const loading = ref(false)
 const runLoading = ref(false)
@@ -820,11 +819,15 @@ function openPhotographyDetail() {
 
 /*高级生成*/
 const onGenerateCLick = (menu,item)=>{
+  if(menu.name === '历史记录'){
+
+    menu.click()
+    return
+  }
   const firstWithImagePath = item.items.find(
       (image) => image.PhotoRecord.image_path
   );
 
-  console.log(firstWithImagePath.PhotoRecord.image_path);
   if (firstWithImagePath) {
     menu.click({
       query:{