shaogen1995 6 дней назад
Родитель
Сommit
55656f912b

+ 15 - 32
后台管理/src/pages/A4screen/A4look/index.tsx

@@ -4,15 +4,12 @@ import { Button } from 'antd'
 import { baseURL } from '@/utils/http'
 
 const pageObj: any = {
-  户外裸眼3D短屏侧: [2240, 1920, 900],
-  户外裸眼3D长屏侧: [12800, 1920, 1900],
+  户外裸眼3D: [15040, 1920, 1900],
   文物互动墙: [19440, 3840, 1900],
   数字艺术触摸屏: [3840, 2160, 1200],
   AI数字人: [3840, 2160, 1200]
 }
 
-const btnArr = ['短屏侧', '长屏侧']
-
 type Props = {
   html: string
   closeFu: (val: any) => void
@@ -22,8 +19,6 @@ type Props = {
 }
 
 function A4look({ html, closeFu, name, url, txtMoveTemp }: Props) {
-  const [cut, setCut] = useState('短屏侧')
-
   const [txtMove, setTxtMove] = useState({
     1: { left: 10, top: 10, scale: 5 },
     2: { left: 10, top: 10, scale: 5 }
@@ -34,10 +29,8 @@ function A4look({ html, closeFu, name, url, txtMoveTemp }: Props) {
   }, [txtMoveTemp])
 
   const page = useMemo(() => {
-    let txt = name
-    if (name === '户外裸眼3D') txt += cut
-    return pageObj[txt]
-  }, [cut, name])
+    return pageObj[name]
+  }, [name])
 
   // 根据真实宽高设置元素宽高
   const domSize = useMemo(() => {
@@ -64,11 +57,11 @@ function A4look({ html, closeFu, name, url, txtMoveTemp }: Props) {
         isDragging: true,
         startX: e.clientX,
         startY: e.clientY,
-        startLeft: txtMove[cut === '短屏侧' ? '1' : '2'].left,
-        startTop: txtMove[cut === '短屏侧' ? '1' : '2'].top
+        startLeft: txtMove['1'].left,
+        startTop: txtMove['1'].top
       }
     },
-    [cut, txtMove]
+    [txtMove]
   )
 
   // 滑块拖动相关
@@ -85,10 +78,10 @@ function A4look({ html, closeFu, name, url, txtMoveTemp }: Props) {
       scaleDragRef.current = {
         isDragging: true,
         startX: e.clientX,
-        startScale: txtMove[cut === '短屏侧' ? '1' : '2'].scale
+        startScale: txtMove['1'].scale
       }
     },
-    [cut, txtMove]
+    [txtMove]
   )
 
   // 全局鼠标移动和抬起事件
@@ -103,7 +96,7 @@ function A4look({ html, closeFu, name, url, txtMoveTemp }: Props) {
         const percentY = (deltaY / page[1]) * 100 * (1 / domSize)
         const newLeft = Math.max(0, Math.min(100, txtDragRef.current.startLeft + percentX))
         const newTop = Math.max(0, Math.min(100, txtDragRef.current.startTop + percentY))
-        const key = cut === '短屏侧' ? '1' : '2'
+        const key = '1'
         setTxtMove(prev => ({ ...prev, [key]: { ...prev[key], left: newLeft, top: newTop } }))
       }
       // 滑块拖动
@@ -115,7 +108,7 @@ function A4look({ html, closeFu, name, url, txtMoveTemp }: Props) {
           1,
           Math.min(100, scaleDragRef.current.startScale + deltaX * percentPerPixel)
         )
-        const key = cut === '短屏侧' ? '1' : '2'
+        const key = '1'
         setTxtMove(prev => ({ ...prev, [key]: { ...prev[key], scale: newScale } }))
       }
     }
@@ -132,7 +125,7 @@ function A4look({ html, closeFu, name, url, txtMoveTemp }: Props) {
       document.removeEventListener('mousemove', handleMouseMove)
       document.removeEventListener('mouseup', handleMouseUp)
     }
-  }, [page, domSize, setTxtMove, cut])
+  }, [page, domSize, setTxtMove])
 
   return (
     <div className={styles.A4look}>
@@ -149,9 +142,9 @@ function A4look({ html, closeFu, name, url, txtMoveTemp }: Props) {
           className='A4Lmove'
           dangerouslySetInnerHTML={{ __html: html }}
           style={{
-            left: txtMove[cut === '短屏侧' ? '1' : '2'].left + '%',
-            top: txtMove[cut === '短屏侧' ? '1' : '2'].top + '%',
-            transform: `scale(${txtMove[cut === '短屏侧' ? '1' : '2'].scale})`
+            left: txtMove['1'].left + '%',
+            top: txtMove['1'].top + '%',
+            transform: `scale(${txtMove['1'].scale})`
           }}
           onMouseDown={handleTxtMouseDown}
         ></div>
@@ -162,22 +155,12 @@ function A4look({ html, closeFu, name, url, txtMoveTemp }: Props) {
         <h3>鼠标移入文字,按住可拖动文字移动;鼠标按住下方白色手柄拖动调节文字大小</h3>
         <div className='A4Lscale2' ref={scaleBarRef}>
           <div
-            style={{ left: ((txtMove[cut === '短屏侧' ? '1' : '2'].scale - 1) / 99) * 100 + '%' }}
+            style={{ left: ((txtMove['1'].scale - 1) / 99) * 100 + '%' }}
             onMouseDown={handleScaleMouseDown}
           ></div>
         </div>
       </div>
 
-      {name === '户外裸眼3D' ? (
-        <div className='A4Lbtn'>
-          {btnArr.map(v => (
-            <Button onClick={() => setCut(v)} key={v} type={v === cut ? 'primary' : 'default'}>
-              {v}
-            </Button>
-          ))}
-        </div>
-      ) : null}
-
       <Button className='A4Lx' onClick={() => closeFu(txtMove)}>
         关闭
       </Button>

+ 33 - 33
后台管理/src/pages/A4screen/A4set/index.tsx

@@ -1,8 +1,8 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
-import { Button, Checkbox, Radio, Select, Table } from 'antd'
+import { Button, Checkbox, Radio, Table } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
-import { API_A4getInfo, API_A4save, API_A4setScreen } from '@/store/action/A4screen'
+import { API_A4getInfo, API_A4save } from '@/store/action/A4screen'
 import { A4RowType } from '../data'
 import UpBtn from '@/utils/UpBtn'
 import { MessageFu } from '@/utils/message'
@@ -133,21 +133,21 @@ function A4set({ id, closeFu }: Props) {
   )
 
   // 长短屏切换
-  const screenChange = useCallback(
-    async (id: number, type: string) => {
-      const res = await API_A4setScreen(id, type)
-      if (res.code === 0) {
-        setInfo({
-          ...info,
-          file: info.file.map(v => ({
-            ...v,
-            subType: v.id === id ? type : v.subType
-          }))
-        })
-      }
-    },
-    [info]
-  )
+  // const screenChange = useCallback(
+  //   async (id: number, type: string) => {
+  //     const res = await API_A4setScreen(id, type)
+  //     if (res.code === 0) {
+  //       setInfo({
+  //         ...info,
+  //         file: info.file.map(v => ({
+  //           ...v,
+  //           subType: v.id === id ? type : v.subType
+  //         }))
+  //       })
+  //     }
+  //   },
+  //   [info]
+  // )
 
   const tableLastBtn = useMemo(() => {
     const arr: any[] = [
@@ -180,22 +180,22 @@ function A4set({ id, closeFu }: Props) {
       }
     ]
 
-    if (info.name === '户外裸眼3D') {
-      arr.push({
-        width: 200,
-        title: '类型',
-        render: (item: any) => (
-          <Select
-            value={item.subType}
-            onChange={e => screenChange(item.id, e)}
-            options={[
-              { value: '1', label: '短屏侧' },
-              { value: '2', label: '长屏侧' }
-            ]}
-          />
-        )
-      })
-    }
+    // if (info.name === '户外裸眼3D') {
+    //   arr.push({
+    //     width: 200,
+    //     title: '类型',
+    //     render: (item: any) => (
+    //       <Select
+    //         value={item.subType}
+    //         onChange={e => screenChange(item.id, e)}
+    //         options={[
+    //           { value: '1', label: '短屏侧' },
+    //           { value: '2', label: '长屏侧' }
+    //         ]}
+    //       />
+    //     )
+    //   })
+    // }
 
     arr.push({
       width: 150,

+ 2 - 2
后台管理/src/utils/http.ts

@@ -7,8 +7,8 @@ import history, { loginOutFu } from './history'
 
 export const envFlag = process.env.NODE_ENV === 'development'
 
-// const baseUrlTemp = baseUrlTempOne // 测试环境
-export const baseUrlTemp = 'http://192.168.20.61:8113' // 线下环境
+const baseUrlTemp = baseUrlTempOne // build环境
+// export const baseUrlTemp = 'http://192.168.20.61:8113' // 线下环境
 
 const baseFlag = baseUrlTemp.includes('https://') || !envFlag