Explorar o código

添加深时模型

bill %!s(int64=2) %!d(string=hai) anos
pai
achega
6f21b57dc9
Modificáronse 4 ficheiros con 16 adicións e 23 borrados
  1. 5 1
      src/constant/scene.ts
  2. 2 1
      src/store/scene.ts
  3. 1 0
      src/views/scene/columns.tsx
  4. 8 21
      src/views/test/index.tsx

+ 5 - 1
src/constant/scene.ts

@@ -3,10 +3,11 @@ export enum SceneType {
   SWKJ,
   SWSS,
   SWMX,
+  SWSSMX
   // QJKK
 }
 
-export type QuoteSceneType = SceneType.SWKJ | SceneType.SWKK | SceneType.SWSS
+export type QuoteSceneType = SceneType.SWKJ | SceneType.SWKK | SceneType.SWSS | SceneType.SWSSMX
 export type ModelSceneType = SceneType.SWMX
 
 export const SceneTypeDesc: { [key in SceneType]: string }  = {
@@ -14,6 +15,7 @@ export const SceneTypeDesc: { [key in SceneType]: string }  = {
   [SceneType.SWKJ]: '四维看见',
   [SceneType.SWSS]: '四维深时',
   [SceneType.SWMX]: '三维模型',
+  [SceneType.SWSSMX]: '四维深时模型'
   // [SceneType.QJKK]: '全景看看',
 }
 
@@ -22,6 +24,7 @@ export const SceneTypeDomain: { [key in SceneType]: string } = {
   [SceneType.SWKJ]: window.location.href,
   [SceneType.SWSS]: window.location.href,
   [SceneType.SWMX]: process.env.NODE_ENV === 'development' ? 'http://localhost:5173' : window.location.href,
+  [SceneType.SWSSMX]: process.env.NODE_ENV === 'development' ? 'http://localhost:5173' : window.location.href,
 }
 
 export const SceneTypePaths: { [key in SceneType]: string[] } = {
@@ -29,6 +32,7 @@ export const SceneTypePaths: { [key in SceneType]: string[] } = {
   [SceneType.SWKJ]: ['/swkk/spg.html', '/swkk/epg.html'],
   [SceneType.SWSS]: ['/swss/index.html', '/swss/index.html'],
   [SceneType.SWMX]: process.env.NODE_ENV === 'development' ? ['index.html', 'index.html'] : ['/code/index.html', '/code/index.html'],
+  [SceneType.SWSSMX]: process.env.NODE_ENV === 'development' ? ['index.html', 'index.html'] : ['/code/index.html', '/code/index.html'],
 }
 
 

+ 2 - 1
src/store/scene.ts

@@ -137,7 +137,8 @@ export const getScenesIdents = (scenes: Scene[]): SceneIdents => {
     { type: SceneType.SWKJ, numList: [] },
     { type: SceneType.SWKK, numList: [] },
     { type: SceneType.SWMX, numList: [] },
-    { type: SceneType.SWSS, numList: [] }
+    { type: SceneType.SWSS, numList: [] },
+    { type: SceneType.SWSSMX, numList: [] }
   ]
 
   for (const scene of scenes) {

+ 1 - 0
src/views/scene/columns.tsx

@@ -104,6 +104,7 @@ export const getSceneColumns = (type: SceneType, actionColumn: SceneColumn = sce
   switch(type) {
     case SceneType.SWKJ:
     case SceneType.SWSS:
+    case SceneType.SWSSMX:
     case SceneType.SWKK:
       return [
         sceneTitleColumn,

+ 8 - 21
src/views/test/index.tsx

@@ -1,30 +1,17 @@
 import { useEffect, useState } from "react"
 
-const TP = (props: { children: string }) => {
-  useEffect(() => {
-    console.log(props.children, 'mount')
-    return () => console.log(props.children, 'unmount')
-  }, [props.children])
-
-  return <p>{ props.children }</p>
-}
-
-const TP1 = () => <TP children="111" />
-const TP2 = () => <TP children="222" />
-const TP3 = () => <TP children="333" />
-const TP4 = () => <TP children="444" />
-
 const Test = () => {
-  const [show, setShow] = useState(false)
-  const children = show ? [ TP1, TP2, TP3 ] : [ TP4, TP1, TP2, TP3 ]
+  const [show, setShow] = useState({ current: 1 })
+
+  const aaa = () => {
+    show.current = 2
+    setShow(show)
+  }
 
   return (
     <>
-      <button onClick={() => setShow(show => !show)}>切换</button>
-      { show && <TP4 /> }
-      <TP1 />
-      <TP2 />
-      <TP3 />
+      <button onClick={aaa}>切换</button>
+      { show.current }
     </>
   )
 }