Просмотр исходного кода

feat(photography): 添加拍摄历史记录同步功能并优化商品配置检查

- 实现了拍摄历史记录同步接口和功能
- 在商品列表中添加了配置同步状态检查
- 优化了重拍按钮的显示逻辑,仅在有效配置时显示
- 为下载模板按钮添加了title提示信息
- 修复了商品配置缺失时的提示显示问题
- 添加了对action_name为空情况的处理和按钮显示控制
panqiuyao 3 дней назад
Родитель
Сommit
2bd2ca3c5f

+ 1 - 0
electron/utils/config.default.json

@@ -6,5 +6,6 @@
   "SmartShooterPath":"C:\\Program Files\\Smart Shooter 5",
   "pyapp": "127.0.0.1",
   "remoteUrl": false,
+  "PORT": "3001",
   "env": "prod"
 }

+ 9 - 4
frontend/src/utils/generateServer.ts

@@ -6,24 +6,28 @@
 
 // @ts-ignore - 路径别名在构建时会被正确解析
 import { generateImagesBase64 } from '@/views/components/marketingEdit/generateImagesRender'
+import pinia from "@/stores/index";
 
 // @ts-ignore - Node.js require 在Electron环境中可用
 type NodeRequire = typeof require
 
 let started = false
 
-export function startGenerateServer() {
+export async function startGenerateServer( ) {
+  setTimeout(() => {
+
   if (started) return
+
   // 仅在具有 Node 能力(Electron 渲染进程)时启动
   const nodeRequire: NodeRequire | undefined = (window as any)?.require
   if (!nodeRequire) {
     return
   }
 
+    const appConfig = pinia.state.value.config?.appConfig;
+  const PORT = appConfig.PORT || 3001
   const http = nodeRequire('http')
-
-  const PORT = 3001
-  started = true
+    started = true
 
   http
     .createServer(async (req: any, res: any) => {
@@ -64,6 +68,7 @@ export function startGenerateServer() {
     .listen(PORT, () => {
       console.log(`[generateServer] listening on http://localhost:${PORT}/generate`)
     })
+  }, 2000)
 }
 
 // 自动启动(在 Electron 渲染进程)

+ 2 - 1
frontend/src/utils/ipc.ts

@@ -41,7 +41,8 @@ const icpList = {
         updateSysConfigs: 'controller.setting.updateSysConfigs',
         updateTabName: 'controller.setting.updateTabName',
         syncSysConfigs: 'controller.setting.syncSysConfigs',
-        syncActions: 'controller.setting.syncActions'
+        syncActions: 'controller.setting.syncActions',
+        syncPhotoRecord: 'controller.setting.syncPhotoRecord'
     },
     takePhoto:{
         getPhotoRecords: 'controller.takephoto.getPhotoRecords',