Kaynağa Gözat

编写环境

bill 3 yıl önce
ebeveyn
işleme
8809534af0

+ 21 - 0
craco.config.js

@@ -0,0 +1,21 @@
+const CracoLessPlugin = require('craco-less');
+
+module.exports = {
+  plugins: [
+    {
+      plugin: CracoLessPlugin,
+      options: {
+        lessLoaderOptions: {
+          lessOptions: {
+            modifyVars: { 
+              '@primary-color': '#26559B',
+              '@menu-item-active-bg': '#E6F7FF',
+              '@table-selected-row-bg': '#E6F7FF'
+            },
+            javascriptEnabled: true,
+          },
+        },
+      },
+    },
+  ],
+};

+ 7 - 4
package.json

@@ -4,6 +4,7 @@
   "private": true,
   "dependencies": {
     "@ant-design/icons": "^4.7.0",
+    "@craco/craco": "^6.4.5",
     "@reduxjs/toolkit": "^1.8.3",
     "@testing-library/jest-dom": "^5.16.4",
     "@testing-library/react": "^13.3.0",
@@ -21,6 +22,7 @@
     "icons": "link:@types/@ant-design/icons",
     "js-base64": "^3.7.2",
     "lodash": "^4.17.21",
+    "minimist": "^1.2.6",
     "mitt": "^3.0.0",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
@@ -33,10 +35,11 @@
     "web-vitals": "^2.1.4"
   },
   "scripts": {
-    "start": "react-scripts start",
-    "build": "react-scripts build",
-    "test": "react-scripts test",
-    "eject": "react-scripts eject"
+    "start": "craco start --env dev",
+    "start-prod": "craco start --env prod",
+    "build": "craco build",
+    "test": "craco test",
+    "eject": "craco eject"
   },
   "eslintConfig": {
     "extends": [

+ 142 - 2
pnpm-lock.yaml

@@ -2,6 +2,7 @@ lockfileVersion: 5.3
 
 specifiers:
   '@ant-design/icons': ^4.7.0
+  '@craco/craco': ^6.4.5
   '@reduxjs/toolkit': ^1.8.3
   '@testing-library/jest-dom': ^5.16.4
   '@testing-library/react': ^13.3.0
@@ -20,6 +21,7 @@ specifiers:
   icons: link:@types/@ant-design/icons
   js-base64: ^3.7.2
   lodash: ^4.17.21
+  minimist: ^1.2.6
   mitt: ^3.0.0
   react: ^18.2.0
   react-dom: ^18.2.0
@@ -33,6 +35,7 @@ specifiers:
 
 dependencies:
   '@ant-design/icons': 4.7.0_react-dom@18.2.0+react@18.2.0
+  '@craco/craco': 6.4.5_cff57e763d310e1978de1ddaf2665a46
   '@reduxjs/toolkit': 1.8.4_react-redux@8.0.2+react@18.2.0
   '@testing-library/jest-dom': 5.16.5
   '@testing-library/react': 13.3.0_react-dom@18.2.0+react@18.2.0
@@ -46,10 +49,11 @@ dependencies:
   axios: 0.27.2
   canvas-nest.js: 2.0.4
   classnames: 2.3.1
-  craco-less: 2.0.0_react-scripts@5.0.1
+  craco-less: 2.0.0_b9aed5549a32ad879f0a0e5669e4f762
   icons: link:@types/@ant-design/icons
   js-base64: 3.7.2
   lodash: 4.17.21
+  minimist: 1.2.6
   mitt: 3.0.0
   react: 18.2.0
   react-dom: 18.2.0_react@18.2.0
@@ -1492,6 +1496,34 @@ packages:
     resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
     dev: false
 
+  /@craco/craco/6.4.5_cff57e763d310e1978de1ddaf2665a46:
+    resolution: {integrity: sha512-8F2rIAao8sEh0FPP52ViEvDM9GjJ7acq0knu1c8UgI+EuZMD5/ZB270ol6jV4iNY7it9Umg/RoGBvNRUNr8U8w==}
+    engines: {node: '>=6'}
+    hasBin: true
+    peerDependencies:
+      react-scripts: ^4.0.0
+    dependencies:
+      cosmiconfig: 7.0.1
+      cosmiconfig-typescript-loader: 1.0.9_60bae0c035ea2da850d0895cc23c8bdb
+      cross-spawn: 7.0.3
+      lodash: 4.17.21
+      react-scripts: 5.0.1_b063fde05bde7ede0ca70a4a9bfd25ff
+      semver: 7.3.7
+      webpack-merge: 4.2.2
+    transitivePeerDependencies:
+      - '@swc/core'
+      - '@swc/wasm'
+      - '@types/node'
+      - typescript
+    dev: false
+
+  /@cspotcode/source-map-support/0.8.1:
+    resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
+    engines: {node: '>=12'}
+    dependencies:
+      '@jridgewell/trace-mapping': 0.3.9
+    dev: false
+
   /@csstools/normalize.css/12.0.0:
     resolution: {integrity: sha512-M0qqxAcwCsIVfpFQSlGN5XjXWu8l5JDZN+fPt1LeW5SZexQTgnaEvgXAY+CeygRw0EeppWHi12JxESWiWrB0Sg==}
     dev: false
@@ -1965,6 +1997,13 @@ packages:
       '@jridgewell/sourcemap-codec': 1.4.14
     dev: false
 
+  /@jridgewell/trace-mapping/0.3.9:
+    resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
+    dependencies:
+      '@jridgewell/resolve-uri': 3.1.0
+      '@jridgewell/sourcemap-codec': 1.4.14
+    dev: false
+
   /@leichtgewicht/ip-codec/2.0.4:
     resolution: {integrity: sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==}
     dev: false
@@ -2310,6 +2349,22 @@ packages:
     engines: {node: '>=10.13.0'}
     dev: false
 
+  /@tsconfig/node10/1.0.9:
+    resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
+    dev: false
+
+  /@tsconfig/node12/1.0.11:
+    resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
+    dev: false
+
+  /@tsconfig/node14/1.0.3:
+    resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
+    dev: false
+
+  /@tsconfig/node16/1.0.3:
+    resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==}
+    dev: false
+
   /@types/aria-query/4.2.2:
     resolution: {integrity: sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==}
     dev: false
@@ -2888,6 +2943,11 @@ packages:
     engines: {node: '>=0.4.0'}
     dev: false
 
+  /acorn-walk/8.2.0:
+    resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
+    engines: {node: '>=0.4.0'}
+    dev: false
+
   /acorn/7.4.1:
     resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==}
     engines: {node: '>=0.4.0'}
@@ -3073,6 +3133,10 @@ packages:
       picomatch: 2.3.1
     dev: false
 
+  /arg/4.1.3:
+    resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
+    dev: false
+
   /arg/5.0.2:
     resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
     dev: false
@@ -3835,6 +3899,22 @@ packages:
     resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
     dev: false
 
+  /cosmiconfig-typescript-loader/1.0.9_60bae0c035ea2da850d0895cc23c8bdb:
+    resolution: {integrity: sha512-tRuMRhxN4m1Y8hP9SNYfz7jRwt8lZdWxdjg/ohg5esKmsndJIn4yT96oJVcf5x0eA11taXl+sIp+ielu529k6g==}
+    engines: {node: '>=12', npm: '>=6'}
+    peerDependencies:
+      '@types/node': '*'
+      typescript: '>=3'
+    dependencies:
+      '@types/node': 16.11.49
+      cosmiconfig: 7.0.1
+      ts-node: 10.9.1_60bae0c035ea2da850d0895cc23c8bdb
+      typescript: 4.7.4
+    transitivePeerDependencies:
+      - '@swc/core'
+      - '@swc/wasm'
+    dev: false
+
   /cosmiconfig/6.0.0:
     resolution: {integrity: sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==}
     engines: {node: '>=8'}
@@ -3857,12 +3937,13 @@ packages:
       yaml: 1.10.2
     dev: false
 
-  /craco-less/2.0.0_react-scripts@5.0.1:
+  /craco-less/2.0.0_b9aed5549a32ad879f0a0e5669e4f762:
     resolution: {integrity: sha512-980mQaZVrC4ZsvOwvud6/AgvW7fLY3mW5m5+gR4sw4krxszgHb+qoRyOjqsYPD0F4oUmQoSiZSrlYY/bFGD9kQ==}
     peerDependencies:
       '@craco/craco': ^6.0.0
       react-scripts: ^5.0.0
     dependencies:
+      '@craco/craco': 6.4.5_cff57e763d310e1978de1ddaf2665a46
       less: 4.1.3
       less-loader: 7.3.0_less@4.1.3
       react-scripts: 5.0.1_b063fde05bde7ede0ca70a4a9bfd25ff
@@ -3870,6 +3951,10 @@ packages:
       - webpack
     dev: false
 
+  /create-require/1.1.1:
+    resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
+    dev: false
+
   /cross-spawn/7.0.3:
     resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
     engines: {node: '>= 8'}
@@ -4262,6 +4347,11 @@ packages:
     engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
     dev: false
 
+  /diff/4.0.2:
+    resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
+    engines: {node: '>=0.3.1'}
+    dev: false
+
   /dir-glob/3.0.1:
     resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
     engines: {node: '>=8'}
@@ -6803,6 +6893,10 @@ packages:
       semver: 6.3.0
     dev: false
 
+  /make-error/1.3.6:
+    resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
+    dev: false
+
   /makeerror/1.0.12:
     resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==}
     dependencies:
@@ -10050,6 +10144,37 @@ packages:
     resolution: {integrity: sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==}
     dev: false
 
+  /ts-node/10.9.1_60bae0c035ea2da850d0895cc23c8bdb:
+    resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
+    hasBin: true
+    peerDependencies:
+      '@swc/core': '>=1.2.50'
+      '@swc/wasm': '>=1.2.50'
+      '@types/node': '*'
+      typescript: '>=2.7'
+    peerDependenciesMeta:
+      '@swc/core':
+        optional: true
+      '@swc/wasm':
+        optional: true
+    dependencies:
+      '@cspotcode/source-map-support': 0.8.1
+      '@tsconfig/node10': 1.0.9
+      '@tsconfig/node12': 1.0.11
+      '@tsconfig/node14': 1.0.3
+      '@tsconfig/node16': 1.0.3
+      '@types/node': 16.11.49
+      acorn: 8.8.0
+      acorn-walk: 8.2.0
+      arg: 4.1.3
+      create-require: 1.1.1
+      diff: 4.0.2
+      make-error: 1.3.6
+      typescript: 4.7.4
+      v8-compile-cache-lib: 3.0.1
+      yn: 3.1.1
+    dev: false
+
   /tsconfig-paths/3.14.1:
     resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==}
     dependencies:
@@ -10246,6 +10371,10 @@ packages:
     hasBin: true
     dev: false
 
+  /v8-compile-cache-lib/3.0.1:
+    resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
+    dev: false
+
   /v8-compile-cache/2.3.0:
     resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==}
     dev: false
@@ -10388,6 +10517,12 @@ packages:
       webpack-sources: 2.3.1
     dev: false
 
+  /webpack-merge/4.2.2:
+    resolution: {integrity: sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==}
+    dependencies:
+      lodash: 4.17.21
+    dev: false
+
   /webpack-sources/1.4.3:
     resolution: {integrity: sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==}
     dependencies:
@@ -10779,6 +10914,11 @@ packages:
       yargs-parser: 20.2.9
     dev: false
 
+  /yn/3.1.1:
+    resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
+    engines: {node: '>=6'}
+    dev: false
+
   /yocto-queue/0.1.0:
     resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
     engines: {node: '>=10'}

BIN
public/favicon.ico


+ 1 - 1
public/index.html

@@ -9,7 +9,7 @@
       name="description"
       content="Web site created using create-react-app"
     />
-    <title>React App</title>
+    <title>三维数据融合平台</title>
   </head>
   <body>
     <noscript>You need to enable JavaScript to run this app.</noscript>

+ 19 - 3
src/api/example.ts

@@ -5,13 +5,14 @@ import {
   DELETE_EXAMPLE,
   EXAMPLE_SCENE_LIST,
   REP_EXAMPLE_SCENES,
+  SceneType,
  } from 'constant'
 
 import type { 
   PagingRequest, 
   PagingResult,
   QuoteScene,
-  ModelScene
+  ModelScene,
 } from 'api'
 
 import type { QuoteSceneType, ModelSceneType } from 'constant'
@@ -39,8 +40,23 @@ export const setExample = (props: SetExampleParams) =>
 export const deleteExample = (props: Pick<Example, 'caseId'>) =>
   axios.post<undefined>(DELETE_EXAMPLE, props)
 
-export const getExampleScenes = (props: Pick<Example, 'caseId'>) => 
-  axios.post<QuoteScene[]>(EXAMPLE_SCENE_LIST, props)
+export const getExampleScenes = async (props: Pick<Example, 'caseId'>) => {
+  const scenes = await axios.post(EXAMPLE_SCENE_LIST, props)
+  return scenes.map((scene: any) => {
+    if (scene.type === SceneType.SWMX) {
+      return {
+        ...scene,
+        id: scene.modelId,
+        title: scene.modelTitle,
+        time: scene.createTime,
+        type: SceneType.SWMX,
+      }
+    } else {
+      return scene
+    }
+  }) as QuoteScene[]
+}
+  
 
 export type SceneIdents = Array<
   { type: QuoteSceneType, numList: QuoteScene['num'][] } | 

+ 1 - 1
src/api/scene.ts

@@ -60,7 +60,7 @@ export type Scenes = Scene[]
 export type GetSceneByTypeParams = PagingRequest<{type: SceneType, sceneName?: string, status?: QuoteScene['status']}>
 export const getSceneByType = async (data: GetSceneByTypeParams): Promise<PagingResult<Scene[]>> => {
   if (data.type === SceneType.SWMX) {
-    const modelScenes = await axios.post<PagingResult<ServeModelScene[]>>(MODEL_SCENE_LIST, data)
+    const modelScenes = await axios.post<PagingResult<ServeModelScene[]>>(MODEL_SCENE_LIST, { modelTitle: data.sceneName })
     return {
       ...modelScenes,
       list: modelScenes.list.map(scene => ({

+ 9 - 9
src/constant/scene.ts

@@ -17,18 +17,18 @@ export const SceneTypeDesc: { [key in SceneType]: string }  = {
   // [SceneType.QJKK]: '全景看看',
 }
 
-export const SceneTypeDomain: { [key in SceneType]: string } = {
-  [SceneType.SWKK]: 'https://test.4dkankan.com',
-  [SceneType.SWKJ]: 'https://test.4dkankan.com',
-  [SceneType.SWSS]: 'https://uat-laser.4dkankan.com/uat',
-  [SceneType.SWMX]: process.env.NODE_ENV === 'development' ? 'http://localhost:5173' : 'https://uat-laser.4dkankan.com/uat',
+export const SceneTypeDomain: { [key in SceneType]?: string } = {
+  [SceneType.SWKK]: window.location.href,
+  [SceneType.SWKJ]: window.location.href,
+  [SceneType.SWSS]: window.location.href,
+  [SceneType.SWMX]: process.env.NODE_ENV === 'development' ? 'http://localhost:5173' : window.location.href,
 }
 
 export const SceneTypePaths: { [key in SceneType]: string[] } = {
-  [SceneType.SWKK]: ['spc.html', 'epc.html'],
-  [SceneType.SWKJ]: ['spc.html', 'epc.html'],
-  [SceneType.SWSS]: ['index.html'],
-  [SceneType.SWMX]: ['index.html'],
+  [SceneType.SWKK]: ['/swkk/spg.html', '/swkk/epg.html'],
+  [SceneType.SWKJ]: ['/swkk/spg.html', '/swkk/epg.html'],
+  [SceneType.SWSS]: ['/swss/index.html', '/swss/index.html'],
+  [SceneType.SWMX]: ['index.html', 'index.html'],
 }
 
 

+ 1 - 0
src/index.tsx

@@ -3,6 +3,7 @@ import ReactDOM from 'react-dom/client';
 import { AppRouter } from 'router'
 import { AppStore } from 'store'
 import './public.scss'
+import 'antd/dist/antd.less';
 
 const root = ReactDOM.createRoot(
   document.getElementById('root') as HTMLElement

+ 5 - 2
src/layout/header/index.tsx

@@ -1,15 +1,18 @@
 import { Avatar } from 'antd'
 import style from './style.module.scss'
 import { title } from 'constant'
+import { useSelector } from 'store'
 
 
 export const HeaderContent = () => {
+  const user = useSelector(store => store.user.value)
+  
   return (
     <>
       <h2 className={style.title}>{title}</h2>
       <div className={style.avatar}>
-        <Avatar src="https://joeschmoe.io/api/v1/random" />
-        <span className={style.username}>用户</span>
+        <Avatar src={user.head} />
+        <span className={style.username}>{user.nickName}</span>
       </div>
     </>
   )

+ 1 - 1
src/public.scss

@@ -1,4 +1,4 @@
-@import '~antd/dist/antd.css';
+
 
 html, body, #root {
   width: 100%;

+ 38 - 9
src/setupProxy.js

@@ -1,14 +1,43 @@
 // 配置代理 - 用于联调
 const { createProxyMiddleware } = require('http-proxy-middleware')
+const minimist = require('minimist');
+
+const config = minimist(process.argv.slice(2))
+
+const proxys = {
+  '/api': {
+    target: 'http://192.168.0.47:8808',
+    changeOrigin: true,
+    pathRewrite: { '^/api': '' }
+  },
+  '/swkk': {
+    target: config.env === 'dev' ? 'https://test.4dkankan.com' : 'https://www.4dkankan.com',
+    changeOrigin: true,
+    pathRewrite: { '^/swkk': '' }
+  },
+  '/service': {
+    target: config.env === 'dev' ? 'https://test.4dkankan.com' : 'https://www.4dkankan.com',
+    changeOrigin: true,
+  },
+  '/swss': {
+    target: config.env === 'dev' ? 'https://uat-laser.4dkankan.com/uat' : 'https://laser.4dkankan.com',
+    changeOrigin: true,
+    pathRewrite: { '^/swss': '' }
+  },
+  '/laser': {
+    target: config.env === 'dev' ? 'https://uat-laser.4dkankan.com' : 'https://laser.4dkankan.com',
+    changeOrigin: true,
+    pathRewrite: { '^/swss': '' }
+  },
+  '/fdkk': {
+    target: config.env === 'dev' ? 'https://uat-laser.4dkankan.com' : 'https://laser.4dkankan.com',
+    changeOrigin: true,
+    pathRewrite: { '^/swss': '' }
+  }
+}
 
 module.exports = function (app) {
-  app.use(
-    createProxyMiddleware('/api', {
-      target: 'http://192.168.0.47:8808',
-      changeOrigin: true,
-      pathRewrite: {
-        '^/api': ''
-      }
-    })
-  )
+  for (const [prefix, config] of Object.entries(proxys)) {
+    app.use(createProxyMiddleware(prefix, config))
+  }
 }

+ 5 - 2
src/store/scene.ts

@@ -69,13 +69,16 @@ export const getSceneLink = (scene: Scene, flag: SceneLinkFlag): URL => {
 
   if (scene.type !== SceneType.SWMX) {
     url.searchParams.append('m', scene.num)
+  } else {
+    url.searchParams.append('modelId', scene.id)
   }
 
-  if (flag === SceneLinkFlag.edit) {
+  if (flag === SceneLinkFlag.edit || scene.type === SceneType.SWMX) {
     const token = getToken()
     token && url.searchParams.append('token', token)
   }
-  
+
+  url.hash = '#sign-model'
   return url
 }
 

+ 16 - 10
src/views/example/index.tsx

@@ -21,6 +21,7 @@ import type { ExampleColumn } from './columns'
 export type ExampleActionProps = {
   example: Example,
   deleteExample: () => void
+  query: () => void,
   sceneManage?: (example: Example) => void
   fuse?: (example: Example) => void
   getView?: (example: Example) => void
@@ -28,15 +29,15 @@ export type ExampleActionProps = {
   file?: (example: Example) => void
 }
 
-export const ExampleAction = ({ example, deleteExample, ...actionCallback }: ExampleActionProps) => {
+export const ExampleAction = ({ example, query, deleteExample, ...actionCallback }: ExampleActionProps) => {
   const actions: ColumnAction[] = [
-    { text: '查看', action() {} },
+    { text: '查看', action: query },
     { text: '删除', action: deleteExample , bind: { danger: true } }
   ]
   const menus = [
     { key: 'sceneManage', label: '场景管理' },
     { key: 'fuse', label: '多元融合' },
-    { key: 'getView', label: '图提取' },
+    { key: 'getView', label: '图提取' },
     { key: 'record', label: '屏幕录制' },
     { key: 'file', label: '卷宗管理' },
   ]
@@ -73,6 +74,14 @@ export const ExamplePage = () => {
   const [scenesCaseId, setScenesCaseId] = useState<Example['caseId'] | null>(null)
   const [fileCaseId, setFileCaseId] = useState<Example['caseId'] | null>(null)
   const [inInsert, setInInsert] = useState(false)
+  const getFuseCodeLink = (caseId: Example['caseId']) => {
+    const params = { 
+      token: getToken(),
+      caseId: caseId.toString()
+    }
+    return getHref(fuseCodeDomain, '', params)
+  }
+
   const columns: ExampleColumn[] = [
     {
       ...exampleTitleColumn,
@@ -101,13 +110,10 @@ export const ExamplePage = () => {
           example={record}
           sceneManage={() => setScenesCaseId(record.caseId)}
           file={() => setFileCaseId(record.caseId)}
-          fuse={() => {
-            const params = { 
-              token: getToken(),
-              caseId: record.caseId.toString()
-            }
-            window.open(getHref(fuseCodeDomain, '', params))
-          }}
+          query={() => window.open(`${getFuseCodeLink(record.caseId)}#show/summary`)}
+          fuse={() => window.open(`${getFuseCodeLink(record.caseId)}#fuseEdit/merge`)}
+          getView={() => window.open(`${getFuseCodeLink(record.caseId)}#sceneEdit/view`)}
+          record={() =>window.open(`${getFuseCodeLink(record.caseId)}#sceneEdit/record`)} 
         /> 
       )
     }

+ 11 - 4
src/views/example/scene/list.tsx

@@ -1,9 +1,9 @@
 import { getExampleScenes } from 'api'
 import { useEffect, useState } from 'react'
 import { SceneTypeDesc } from 'constant';
-import { Table } from 'components'
+import { ActionsButton, Table } from 'components'
 import { Modal, Button } from 'antd'
-import { sceneTitleColumn, sceneTimeColumn, sceneActionColumn } from 'views/scene'
+import { sceneTitleColumn, sceneTimeColumn, getSceneActions } from 'views/scene'
 import { getScenesIdents } from 'store'
 import { SelectScenes } from './select'
 import style from '../style.module.scss'
@@ -23,14 +23,21 @@ export const ExampleScenes = (props: ExampleScenesProps) => {
   const [inSelectMode, setInSelectMode] = useState(false)
   const idents = getScenesIdents(scenes)
   const columns: SceneColumn[] = [
-    sceneTitleColumn, 
+    sceneTitleColumn,
     {
       title: '类型',
       key: 'title',
       render: (_, scene) => SceneTypeDesc[scene.type]
     },
     sceneTimeColumn, 
-    sceneActionColumn
+    {
+      title: '操作',
+      key: 'action',
+      render: (_, record) => {
+        const actions = getSceneActions(record, true)
+        return <ActionsButton actions={actions} /> 
+      }
+    }
   ]
   const fetchExampleScenes = () => {
     getExampleScenes({ caseId: props.caseId })

+ 3 - 2
src/views/example/scene/select.tsx

@@ -1,7 +1,7 @@
 import { SceneType, QuoteSceneStatus } from 'constant';
 import { Table } from 'components'
 import { Modal, Input } from 'antd'
-import { ScenePage, sceneTitleColumn, sceneTimeColumn } from 'views/scene'
+import { ScenePage, sceneTitleColumn, sceneTimeColumn, modelSceneTimeColumn } from 'views/scene'
 import { fetchScenes, filterScenesSelector, useSelector, getSceneIdent } from 'store'
 import { useThunkPaging, useRefersh } from 'hook'
 import style from '../style.module.scss'
@@ -61,6 +61,7 @@ export const SelectScenes = ({ sceneIdents, ...props }: SelectScenesProps) => {
       }
     };
     
+    console.log(scenes)
     return (
       <div>
         <div className={style['model-header']}>
@@ -72,7 +73,7 @@ export const SelectScenes = ({ sceneIdents, ...props }: SelectScenesProps) => {
           />
         </div>
         <Table 
-          columns={[sceneTitleColumn, sceneTimeColumn]}
+          columns={[sceneTitleColumn, type === SceneType.SWMX ? modelSceneTimeColumn : sceneTimeColumn] as any}
           rowSelection={rowSelection}
           data={scenes}
           paging={paging}

+ 0 - 0
src/views/example/sign.tsx


+ 19 - 7
src/views/scene/columns.tsx

@@ -43,6 +43,13 @@ export const modelSceneRawTypeColumn: SceneColumn<ModelScene> = {
   key: 'rawType',
 }
 
+export const modelSceneTimeColumn: SceneColumn<ModelScene> = {
+  title: '拍摄时间',
+  dataIndex: 'time',
+  key: 'time',
+}
+
+
 export const modelSceneStatusColumn: SceneColumn<ModelScene> = {
   title: '状态',
   dataIndex: 'status',
@@ -64,13 +71,18 @@ export const modelSceneStatusColumn: SceneColumn<ModelScene> = {
   }
 }
 
-export const getSceneActions = (scene: Scene): ColumnAction[] => {
-  return sceneIsSuccess(scene) 
-    ? [
-        { text: '查看', action: openSceneQueryPage.bind(null, scene) },
-        { text: '编辑', action: openSceneEditPage.bind(null, scene) }
-      ]
-    : []
+export const getSceneActions = (scene: Scene, fource = false): ColumnAction[] => {
+  if (!(fource || sceneIsSuccess(scene))) {
+    return []
+  } else {
+    const query = { text: '查看', action: openSceneQueryPage.bind(null, scene) }
+    return scene.type === SceneType.SWMX
+      ? [query]
+      : [
+          query,
+          { text: '编辑', action: openSceneEditPage.bind(null, scene) }
+        ]
+  }
 }
 
 export const sceneActionColumn: SceneColumn = {