lanxin 2 月之前
父節點
當前提交
ee4ac1cb08

+ 1 - 2
src/assets/styles/base.css

@@ -27,7 +27,7 @@ ul {
 }
 body {
   overflow: auto;
-  overflow-y: overlay;
+  overflow-y: auto;
 }
 /* 文本域取消下拉 */
 textarea {
@@ -141,7 +141,6 @@ textarea {
   font-size: 18px;
   font-weight: 700;
   position: absolute;
-  z-index: 11;
   top: -56px;
   left: -18px;
   padding-left: 40px;

+ 50 - 0
src/components/PreviewOperate/index.module.scss

@@ -0,0 +1,50 @@
+.PreviewOperate {
+  width: 100%;
+  height: 100%;
+  background: rgba(91, 91, 91, 1);
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+
+  :global {
+    .PreviewOperateMain {
+      width: 100%;
+      height: 100%;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      .pageBox {
+        width: calc(430px * 0.9);
+        height: calc(932px * 0.9 + 32px);
+        display: flex;
+        flex-direction: column;
+        gap: 10px;
+        iframe {
+          width: 100%;
+          height: 100%;
+          border: none;
+          pointer-events: auto;
+        }
+        .noData {
+          width: 100%;
+          height: 100%;
+          background: #fff;
+          font-size: 26px;
+          display: flex;
+          justify-content: center;
+          align-items: center;
+        }
+        .copyLink {
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          .ant-btn {
+            width: 100px;
+            height: 32px;
+          }
+        }
+      }
+    }
+  }
+}

+ 37 - 0
src/components/PreviewOperate/index.tsx

@@ -0,0 +1,37 @@
+import React, { useCallback } from 'react'
+import styles from './index.module.scss'
+import { Button } from 'antd'
+import { useDispatch } from 'react-redux'
+import { editPreview } from '@/store/action/layout'
+import { handleCopyClick } from '@/utils/copyTxt'
+import { MessageFu } from '@/utils/message'
+
+function PreviewOperate({ src }: { src?: string }) {
+  const dispatch = useDispatch()
+
+  const copyLink = useCallback(() => {
+    if (src) {
+      handleCopyClick(src)
+    } else {
+      MessageFu.error('暂无数据')
+    }
+  }, [src])
+
+  return (
+    <div className={styles.PreviewOperate}>
+      <div className='PreviewOperateMain'>
+        <div className='pageBox'>
+          {src ? <iframe src={src} title='preview' /> : <div className='noData'>暂无数据</div>}
+          <div className='copyLink'>
+            <Button onClick={copyLink}>复制链接</Button>
+            <Button onClick={() => dispatch(editPreview({ isOpenPreview: false }))}>关闭</Button>
+          </div>
+        </div>
+      </div>
+    </div>
+  )
+}
+
+const MemoPreviewOperate = React.memo(PreviewOperate)
+
+export default MemoPreviewOperate

+ 50 - 36
src/pages/A1banner/index.tsx

@@ -11,6 +11,7 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import MyTable from '@/components/MyTable'
 import { A1tableC } from '@/utils/tableData'
 import A1add from './A1add'
+import { editPreview } from '@/store/action/layout'
 
 const pageDataBase = {
   pageNum: 1,
@@ -67,7 +68,18 @@ function A1banner() {
         render: (item: A1tbType) => (
           <>
             {item.status === 0 && (
-              <Button size='small' type='text'>
+              <Button
+                size='small'
+                type='text'
+                onClick={() => {
+                  dispatch(
+                    editPreview({
+                      isOpenPreview: true,
+                      src: 'https://sit-kelamayi.4dage.com/mini/#/indexPage?preview=1'
+                    })
+                  )
+                }}
+              >
                 预览
               </Button>
             )}
@@ -88,7 +100,7 @@ function A1banner() {
         )
       }
     ]
-  }, [delTableFu, publishFu])
+  }, [delTableFu, dispatch, publishFu])
 
   //新增、编辑
   const [editInfo, setEditInfo] = useState<A1EditInfoType>({
@@ -97,41 +109,43 @@ function A1banner() {
   })
 
   return (
-    <div className={styles.A1banner}>
-      <div className='pageTitle'>首页轮播图 {editInfo.id ? ` - ${editInfo.txt}` : ''}</div>
-
-      {/* 顶部筛选 */}
-      <div className='A1top'>
-        <Button type='primary' onClick={() => setEditInfo({ id: -1, txt: '新增' })}>
-          新增
-        </Button>
+    <>
+      <div className={styles.A1banner}>
+        <div className='pageTitle'>首页轮播图 {editInfo.id ? ` - ${editInfo.txt}` : ''}</div>
+
+        {/* 顶部筛选 */}
+        <div className='A1top'>
+          <Button type='primary' onClick={() => setEditInfo({ id: -1, txt: '新增' })}>
+            新增
+          </Button>
+        </div>
+
+        {/* 表格主体 */}
+        <div className='A1tableBox'>
+          <MyTable
+            myKey='carouselId'
+            yHeight={625}
+            list={tableInfo.list}
+            columnsTemp={A1tableC}
+            lastBtn={tableLastBtn}
+            pageNum={pageData.pageNum}
+            pageSize={pageData.pageSize}
+            total={tableInfo.total}
+            onChange={(pageNum, pageSize) => setPageData({ ...pageData, pageNum, pageSize })}
+          />
+        </div>
+
+        {/* 新增 / 编辑 */}
+        {editInfo.id ? (
+          <A1add
+            editInfo={editInfo}
+            closeFu={() => setEditInfo({ id: 0, txt: '新增' })}
+            addTableFu={resetSelectFu}
+            editTableFu={getListFu}
+          ></A1add>
+        ) : null}
       </div>
-
-      {/* 表格主体 */}
-      <div className='A1tableBox'>
-        <MyTable
-          myKey='carouselId'
-          yHeight={625}
-          list={tableInfo.list}
-          columnsTemp={A1tableC}
-          lastBtn={tableLastBtn}
-          pageNum={pageData.pageNum}
-          pageSize={pageData.pageSize}
-          total={tableInfo.total}
-          onChange={(pageNum, pageSize) => setPageData({ ...pageData, pageNum, pageSize })}
-        />
-      </div>
-
-      {/* 新增 / 编辑 */}
-      {editInfo.id ? (
-        <A1add
-          editInfo={editInfo}
-          closeFu={() => setEditInfo({ id: 0, txt: '新增' })}
-          addTableFu={resetSelectFu}
-          editTableFu={getListFu}
-        ></A1add>
-      ) : null}
-    </div>
+    </>
   )
 }
 

+ 19 - 2
src/pages/A4news/index.tsx

@@ -11,6 +11,8 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import MyTable from '@/components/MyTable'
 import { A4tableC } from '@/utils/tableData'
 import A4add from './A4add'
+import { handleCopyClick } from '@/utils/copyTxt'
+import { editPreview } from '@/store/action/layout'
 
 const pageDataBase = {
   pageNum: 1,
@@ -69,8 +71,23 @@ function A4news() {
         title: '操作',
         render: (item: A4tableType) => (
           <>
+            <Button
+              size='small'
+              type='text'
+              onClick={() =>
+                handleCopyClick(
+                  `/allDetailsShow?id=${item.informationId}&type=information&isFromPage=indexPage/news`
+                )
+              }
+            >
+              复制地址
+            </Button>
             {item.status === 0 && (
-              <Button size='small' type='text'>
+              <Button
+                size='small'
+                type='text'
+                onClick={() => dispatch(editPreview({ isOpenPreview: true, src: '' }))}
+              >
                 预览
               </Button>
             )}
@@ -91,7 +108,7 @@ function A4news() {
         )
       }
     ]
-  }, [delTableFu, publishFu])
+  }, [delTableFu, dispatch, publishFu])
 
   //新增、编辑
   const [editInfo, setEditInfo] = useState<A1EditInfoType>({

+ 19 - 2
src/pages/A5activity/index.tsx

@@ -11,6 +11,8 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import MyTable from '@/components/MyTable'
 import { A4tableC } from '@/utils/tableData'
 import A5add from './A5add'
+import { handleCopyClick } from '@/utils/copyTxt'
+import { editPreview } from '@/store/action/layout'
 
 const pageDataBase = {
   pageNum: 1,
@@ -69,8 +71,23 @@ function A5activity() {
         title: '操作',
         render: (item: A5tableType) => (
           <>
+            <Button
+              size='small'
+              type='text'
+              onClick={() =>
+                handleCopyClick(
+                  `/allDetailsShow?id=${item.activityId}&type=activity&isFromPage=indexPage/activity`
+                )
+              }
+            >
+              复制地址
+            </Button>
             {item.status === 0 && (
-              <Button size='small' type='text'>
+              <Button
+                size='small'
+                type='text'
+                onClick={() => dispatch(editPreview({ isOpenPreview: true, src: '' }))}
+              >
                 预览
               </Button>
             )}
@@ -91,7 +108,7 @@ function A5activity() {
         )
       }
     ]
-  }, [delTableFu, publishFu])
+  }, [delTableFu, dispatch, publishFu])
 
   //新增、编辑
   const [editInfo, setEditInfo] = useState<A1EditInfoType>({

+ 19 - 2
src/pages/A6exhibition/index.tsx

@@ -11,6 +11,8 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import MyTable from '@/components/MyTable'
 import { A6tableC } from '@/utils/tableData'
 import A6add from './A6add'
+import { handleCopyClick } from '@/utils/copyTxt'
+import { editPreview } from '@/store/action/layout'
 
 const pageDataBase = {
   pageNum: 1,
@@ -70,8 +72,23 @@ function A6exhibition() {
         title: '操作',
         render: (item: A6tableType) => (
           <>
+            <Button
+              size='small'
+              type='text'
+              onClick={() =>
+                handleCopyClick(
+                  `/allDetailsShow?id=${item.exhibitId}&type=exhibition&isFromPage=exhibition`
+                )
+              }
+            >
+              复制地址
+            </Button>
             {item.status === 0 && (
-              <Button size='small' type='text'>
+              <Button
+                size='small'
+                type='text'
+                onClick={() => dispatch(editPreview({ isOpenPreview: true, src: '' }))}
+              >
                 预览
               </Button>
             )}
@@ -92,7 +109,7 @@ function A6exhibition() {
         )
       }
     ]
-  }, [delTableFu, publishFu])
+  }, [delTableFu, dispatch, publishFu])
 
   //新增、编辑
   const [editInfo, setEditInfo] = useState<A1EditInfoType>({

+ 8 - 2
src/pages/A7collection/A7add/index.tsx

@@ -52,7 +52,8 @@ function A7add({ editInfo, closeFu, addTableFu, editTableFu }: Props) {
         imageFiles: info.imageFilesB,
         videoFile: info.videoFileB,
         audioFile: info.audioFileB,
-        webSite: info.webSiteB
+        webSite: info.webSiteB,
+        level: info.levelB
       }
     } else {
       editObj = { ...info }
@@ -185,7 +186,8 @@ function A7add({ editInfo, closeFu, addTableFu, editTableFu }: Props) {
         typeModelB: sonType.includes('model') || false,
         typeVideoB: sonType.includes('video') || false,
         videoFileB: fileList.video.filePath || '',
-        webSiteB: ''
+        webSiteB: '',
+        levelB: values.level
       }
 
       let res: any
@@ -244,6 +246,10 @@ function A7add({ editInfo, closeFu, addTableFu, editTableFu }: Props) {
             />
           </Form.Item>
 
+          <Form.Item label='级别' name='level'>
+            <Input placeholder='请输入内容,最多10字' maxLength={10} showCount />
+          </Form.Item>
+
           <Form.Item label='年代' name='era'>
             <Input placeholder='请输入内容,最多10字' maxLength={10} showCount />
           </Form.Item>

+ 15 - 2
src/pages/A7collection/index.tsx

@@ -11,6 +11,8 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import MyTable from '@/components/MyTable'
 import { A7tableC } from '@/utils/tableData'
 import A7add from './A7add'
+import { handleCopyClick } from '@/utils/copyTxt'
+import { editPreview } from '@/store/action/layout'
 
 const pageDataBase = {
   pageNum: 1,
@@ -70,8 +72,19 @@ function A7collection() {
         title: '操作',
         render: (item: A7tableType) => (
           <>
+            <Button
+              size='small'
+              type='text'
+              onClick={() => handleCopyClick(`/collectDetail?id=${item.artifactId}&preview=1`)}
+            >
+              复制地址
+            </Button>
             {item.status === 0 && (
-              <Button size='small' type='text'>
+              <Button
+                size='small'
+                type='text'
+                onClick={() => dispatch(editPreview({ isOpenPreview: true, src: '' }))}
+              >
                 预览
               </Button>
             )}
@@ -92,7 +105,7 @@ function A7collection() {
         )
       }
     ]
-  }, [delTableFu, publishFu])
+  }, [delTableFu, dispatch, publishFu])
 
   //新增、编辑
   const [editInfo, setEditInfo] = useState<A1EditInfoType>({

+ 41 - 31
src/pages/B1reserve1/B1look/index.tsx

@@ -1,11 +1,11 @@
-import React, { useCallback, useEffect, useRef } from 'react'
+import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
 import classNames from 'classnames'
 import { B1EditInfoType } from '../data'
-import { Button, Form, FormInstance, Divider } from 'antd'
+import { Button, Form, Divider } from 'antd'
+
 import { B_APIgetInfo } from '@/store/action/Breserve'
 import { B1tableType } from '@/types'
-import dayjs from 'dayjs'
 
 type Props = {
   editInfo: B1EditInfoType
@@ -15,12 +15,11 @@ type Props = {
 }
 
 function B1add({ editInfo, closeFu, addTableFu, editTableFu }: Props) {
-  // 表单的ref
-  const FormBoxRef = useRef<FormInstance>(null)
+  const [itemData, setItemData] = useState<B1tableType>()
 
   // 回显数据的方法调用
   const dataShow = useCallback((info: B1tableType) => {
-    FormBoxRef.current?.setFieldsValue(info)
+    setItemData(info)
   }, [])
 
   // 查询数据
@@ -42,39 +41,50 @@ function B1add({ editInfo, closeFu, addTableFu, editTableFu }: Props) {
     if (editInfo.id > 0) {
       getInfoFu(editInfo.id)
     }
-  }, [editInfo.id, getInfoFu])
+  }, [editInfo.id, getInfoFu, editInfo.info])
 
   return (
     <div className={styles.B1add}>
       <div className={classNames('B1aMain')}>
-        <Form
-          ref={FormBoxRef}
-          name='basic'
-          labelCol={{ span: 3 }}
-          autoComplete='off'
-          scrollToFirstError
-        >
-          <Form.Item
-            label='申请时间'
-            name='createTime'
-            rules={[{ required: true, message: '请输入标题!' }]}
-          >
-            {dayjs().format('YYYY-MM-DD HH:mm:ss')}
-          </Form.Item>
+        <Form name='basic' labelCol={{ span: 3 }} autoComplete='off' scrollToFirstError>
+          <Form.Item label='申请时间'>{itemData?.createTime}</Form.Item>
 
-          <Form.Item label='预约日期' name='reserveDate'>
-            {dayjs().format('YYYY-MM-DD')}
-          </Form.Item>
+          <Form.Item label='预约日期'>{itemData?.appointmentTime}</Form.Item>
 
-          <Form.Item label='预约时段' name='reserveTime'>
-            10:00-12:00
-          </Form.Item>
+          <Form.Item label='预约时段'>{itemData?.time}</Form.Item>
 
-          <Form.Item label='预约人数' name='reserveNum'>
-            100
-          </Form.Item>
+          <Form.Item label='预约人数'>{itemData?.pcs}</Form.Item>
 
-          <Divider />
+          <Form.List name='visitors'>
+            {() =>
+              itemData?.visitors.map((item, index) => (
+                <div key={index}>
+                  <Divider />
+                  <Form.Item
+                    label='参观人姓名'
+                    key={index + 'name'}
+                    rules={[{ required: true, message: '请输入参观人姓名' }]}
+                  >
+                    {item.name}
+                  </Form.Item>
+                  <Form.Item
+                    label='参观人电话'
+                    key={index + 'phone'}
+                    rules={[{ required: true, message: '请输入参观人电话' }]}
+                  >
+                    {item.phone}
+                  </Form.Item>
+                  <Form.Item
+                    label='身份证号'
+                    key={index + 'idCard'}
+                    rules={[{ required: true, message: '请输入身份证号' }]}
+                  >
+                    {item.idCard}
+                  </Form.Item>
+                </div>
+              ))
+            }
+          </Form.List>
 
           {/* 确定和取消按钮 */}
           <Form.Item className='B1abtn'>

+ 14 - 2
src/pages/B1reserve1/index.tsx

@@ -10,6 +10,7 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import MyTable from '@/components/MyTable'
 import { B1tableC } from '@/utils/tableData'
 import B1look from './B1look'
+import { MessageFu } from '@/utils/message'
 
 const pageDataBase = {
   pageNum: 1,
@@ -37,6 +38,17 @@ function B1reserve1() {
 
   const tableInfo = useSelector((state: RootState) => state.Breserve.tableInfo)
 
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await B_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功!')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
   const tableLastBtn = useMemo(() => {
     return [
       {
@@ -50,12 +62,12 @@ function B1reserve1() {
             >
               查看
             </Button>
-            <MyPopconfirm txtK='删除' onConfirm={() => B_APIdel(item.id)} />
+            <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
           </>
         )
       }
     ]
-  }, [])
+  }, [delTableFu])
 
   //查看
   const [editInfo, setEditInfo] = useState<B1EditInfoType>({

+ 31 - 32
src/pages/B2reserve2/B2look/index.tsx

@@ -1,11 +1,11 @@
-import React, { useCallback, useEffect, useRef } from 'react'
+import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
 import classNames from 'classnames'
 import { B2EditInfoType } from '../data'
-import { Button, Form, FormInstance, Divider } from 'antd'
+import { Button, Form, Divider } from 'antd'
+
 import { B_APIgetInfo } from '@/store/action/Breserve'
 import { B2tableType } from '@/types'
-import dayjs from 'dayjs'
 
 type Props = {
   editInfo: B2EditInfoType
@@ -15,12 +15,11 @@ type Props = {
 }
 
 function B2look({ editInfo, closeFu, addTableFu, editTableFu }: Props) {
-  // 表单的ref
-  const FormBoxRef = useRef<FormInstance>(null)
+  const [itemData, setItemData] = useState<B2tableType>()
 
   // 回显数据的方法调用
   const dataShow = useCallback((info: B2tableType) => {
-    FormBoxRef.current?.setFieldsValue(info)
+    setItemData(info)
   }, [])
 
   // 查询数据
@@ -42,39 +41,39 @@ function B2look({ editInfo, closeFu, addTableFu, editTableFu }: Props) {
     if (editInfo.id > 0) {
       getInfoFu(editInfo.id)
     }
-  }, [editInfo.id, getInfoFu])
+  }, [editInfo.id, getInfoFu, editInfo.info])
 
   return (
     <div className={styles.B2look}>
       <div className={classNames('B2Main')}>
-        <Form
-          ref={FormBoxRef}
-          name='basic'
-          labelCol={{ span: 3 }}
-          autoComplete='off'
-          scrollToFirstError
-        >
-          <Form.Item
-            label='申请时间'
-            name='createTime'
-            rules={[{ required: true, message: '请输入标题!' }]}
-          >
-            {dayjs().format('YYYY-MM-DD HH:mm:ss')}
-          </Form.Item>
-
-          <Form.Item label='预约日期' name='reserveDate'>
-            {dayjs().format('YYYY-MM-DD')}
-          </Form.Item>
+        <Form name='basic' labelCol={{ span: 3 }} autoComplete='off' scrollToFirstError>
+          <Form.Item label='申请时间'>{itemData?.createTime}</Form.Item>
 
-          <Form.Item label='预约时段' name='reserveTime'>
-            10:00-12:00
-          </Form.Item>
+          <Form.Item label='预约日期'>{itemData?.appointmentTime}</Form.Item>
 
-          <Form.Item label='预约人数' name='reserveNum'>
-            100
-          </Form.Item>
+          <Form.Item label='预约人数'>{itemData?.pcs}</Form.Item>
 
-          <Divider />
+          <Form.List name='visitors'>
+            {() =>
+              itemData?.visitors.map((item, index) => (
+                <div key={index}>
+                  <Divider />
+                  <Form.Item label='活动名称' key={index + 'activityTitle'}>
+                    {itemData.activityTitle}
+                  </Form.Item>
+                  <Form.Item label='参观人姓名' key={index + 'name'}>
+                    {item.name}
+                  </Form.Item>
+                  <Form.Item label='参观人电话' key={index + 'phone'}>
+                    {item.phone}
+                  </Form.Item>
+                  <Form.Item label='身份证号' key={index + 'idCard'}>
+                    {item.idCard}
+                  </Form.Item>
+                </div>
+              ))
+            }
+          </Form.List>
 
           {/* 确定和取消按钮 */}
           <Form.Item className='B2btn'>

+ 14 - 2
src/pages/B2reserve2/index.tsx

@@ -10,6 +10,7 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import MyTable from '@/components/MyTable'
 import { B2tableC } from '@/utils/tableData'
 import B2look from './B2look'
+import { MessageFu } from '@/utils/message'
 
 const pageDataBase = {
   pageNum: 1,
@@ -37,6 +38,17 @@ function B2reserve2() {
 
   const tableInfo = useSelector((state: RootState) => state.Breserve.tableInfo)
 
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await B_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功!')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
   const tableLastBtn = useMemo(() => {
     return [
       {
@@ -50,12 +62,12 @@ function B2reserve2() {
             >
               查看
             </Button>
-            <MyPopconfirm txtK='删除' onConfirm={() => B_APIdel(item.id)} />
+            <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
           </>
         )
       }
     ]
-  }, [])
+  }, [delTableFu])
 
   //查看
   const [editInfo, setEditInfo] = useState<B2EditInfoType>({

+ 1 - 1
src/pages/C1reserveOpt/C1edit/index.tsx

@@ -204,7 +204,7 @@ function C1edit({ list, closeFu, editTableFu }: Props) {
         <Button
           type='primary'
           onClick={() => {
-            if (listRes.length >= 10) return MessageFu.warning('最多10个时段!')
+            if (listRes.length >= 2) return MessageFu.warning('最多2个时段!')
             setTime({
               show: true,
               value: null,

+ 11 - 9
src/pages/Layout/index.tsx

@@ -19,6 +19,9 @@ import { RouterType, RouterTypeRow } from '@/types'
 import tabLeftArr from './data'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { UserListType } from '@/types/api/Z1user'
+import PreviewOperate from '@/components/PreviewOperate'
+import { RootState } from '@/store'
+import { useSelector } from 'react-redux'
 
 function Layout() {
   // 当前路径选中的左侧菜单
@@ -33,15 +36,13 @@ function Layout() {
     setPath(pathTemp)
   }, [location])
 
+  const { isOpenPreview, src } = useSelector((state: RootState) => state.A0Layout.editPreview)
+
   // 获取用户权限信息
   const getUserAuthFu = useCallback(async () => {
     const userInfo = getTokenInfo().user
-    console.log(userInfo)
 
     const res = await getLeftMenuAPI()
-    console.log(res)
-    // const res = await Z1_APIgetAuthByUserId(userInfo.id)
-
     const isOkIdArr: any[] = []
 
     // 测试环境
@@ -56,12 +57,14 @@ function Layout() {
 
     if (res.code === 0) {
       const tempList: UserListType[] = res.data || []
-      // console.log(123, tempList);
+      console.log('tempList', tempList)
       tempList.forEach(v => {
         if (v.children) {
           v.children.forEach(c => {
             isOkIdArr.push(c.id)
           })
+        } else {
+          isOkIdArr.push(v.id)
         }
       })
 
@@ -111,10 +114,6 @@ function Layout() {
   // 路由信息(过滤之后的)
   const [RouterCom, setRouterCom] = useState<RouterTypeRow>([])
 
-  useEffect(() => {
-    console.log(123, list)
-  }, [list])
-
   // 点击跳转
   const pathCutFu = useCallback((path: string) => {
     history.push(path)
@@ -282,6 +281,9 @@ function Layout() {
           </Form.Item>
         </Form>
       </Modal>
+
+      {/* 点击表格的预览操作,打开弹窗 */}
+      {isOpenPreview && <PreviewOperate src={src} />}
     </div>
   )
 }

+ 1 - 1
src/pages/Login/index.tsx

@@ -2,7 +2,7 @@ import styles from './index.module.scss'
 
 import { Input, Button } from 'antd'
 import { useCallback, useEffect, useState } from 'react'
-import { setTokenInfo, setTokenToCookie } from '@/utils/storage'
+import { setTokenInfo } from '@/utils/storage'
 import history from '@/utils/history'
 import { MessageFu } from '@/utils/message'
 import { userLoginAPI, getUserInfoAPI } from '@/store/action/layout'

+ 8 - 0
src/store/action/layout.ts

@@ -62,3 +62,11 @@ export const API_upFile = (data: any, url: string) => {
     })
   })
 }
+
+// 点击表格的预览操作,打开/关闭弹窗
+export const editPreview = (data: { isOpenPreview: boolean; src?: string }) => {
+  return {
+    type: 'layout/editPreview',
+    payload: data
+  }
+}

+ 0 - 2
src/store/reducer/A1banner.ts

@@ -36,7 +36,6 @@ export default function Reducer(state = initState, action: Props | sortProps) {
       const indexUp = state.tableInfo.list[indexSort - 1].sort
       const upId = state.tableInfo.list[indexSort - 1].carouselId
       const downId = state.tableInfo.list[indexSort].carouselId
-      console.log(state.tableInfo.list, 'state.tableInfo.list', indexUp)
       const obj = {
         list: [
           {
@@ -49,7 +48,6 @@ export default function Reducer(state = initState, action: Props | sortProps) {
           }
         ]
       }
-      console.log(obj, 'obj')
       A1_APIsort(obj)
       return {
         ...state,

+ 44 - 32
src/store/reducer/layout.ts

@@ -1,65 +1,77 @@
-import { LookDomType } from "@/types";
-import { MessageType } from "@/utils/message";
+import { LookDomType } from '@/types'
+import { MessageType } from '@/utils/message'
 
 // 初始化状态
 const initState = {
   // 所有图片点击预览查看大图
   lookBigImg: {
-    url: "",
-    show: false,
+    url: '',
+    show: false
   },
   // 查看视频、音频、模型
   lookDom: {
-    src: "",
-    type: "",
+    src: '',
+    type: ''
   } as LookDomType,
 
   // antd轻提示(兼容360浏览器)
   message: {
-    txt: "",
-    type: "info",
-    duration: 3,
+    txt: '',
+    type: 'info',
+    duration: 3
   } as MessageType,
   // 上传文件点击取消
   closeUpFile: {
     fu: () => {},
-    state: false,
+    state: false
   },
-};
+  // 点击表格的预览操作,打开/关闭弹窗
+  editPreview: {
+    isOpenPreview: false,
+    src: ''
+  }
+}
 
 // 定义 action 类型
 type LayoutActionType =
-  | { type: "layout/lookBigImg"; payload: { url: string; show: boolean } }
-  | { type: "layout/lookDom"; payload: LookDomType }
-  | { type: "layout/message"; payload: MessageType }
+  | { type: 'layout/lookBigImg'; payload: { url: string; show: boolean } }
+  | { type: 'layout/lookDom'; payload: LookDomType }
+  | { type: 'layout/message'; payload: MessageType }
+  | {
+      type: 'layout/closeUpFile'
+      payload: {
+        fu: () => void
+        state: boolean
+      }
+    }
   | {
-      type: "layout/closeUpFile";
+      type: 'layout/editPreview'
       payload: {
-        fu: () => void;
-        state: boolean;
-      };
-    };
+        isOpenPreview: boolean
+        src: string
+      }
+    }
 
 // 频道 reducer
-export default function layoutReducer(
-  state = initState,
-  action: LayoutActionType
-) {
+export default function layoutReducer(state = initState, action: LayoutActionType) {
   switch (action.type) {
     // 所有图片点击预览查看大图
-    case "layout/lookBigImg":
-      return { ...state, lookBigImg: action.payload };
+    case 'layout/lookBigImg':
+      return { ...state, lookBigImg: action.payload }
     // 查看视频
-    case "layout/lookDom":
-      return { ...state, lookDom: action.payload };
+    case 'layout/lookDom':
+      return { ...state, lookDom: action.payload }
 
     // antd轻提示(兼容360浏览器)
-    case "layout/message":
-      return { ...state, message: action.payload };
+    case 'layout/message':
+      return { ...state, message: action.payload }
     // 上传文件点击取消
-    case "layout/closeUpFile":
-      return { ...state, closeUpFile: action.payload };
+    case 'layout/closeUpFile':
+      return { ...state, closeUpFile: action.payload }
+    // 点击表格的预览操作,打开/关闭弹窗
+    case 'layout/editPreview':
+      return { ...state, editPreview: action.payload }
     default:
-      return state;
+      return state
   }
 }

+ 2 - 0
src/types/api/A7collection.ts

@@ -23,6 +23,7 @@ export type A7tableType = {
   videoFile: string
   audioFile: string
   webSite: string
+  level: string
   titleB: string
   typeB: 1 | 2 | 3
   eraB: string
@@ -41,6 +42,7 @@ export type A7tableType = {
   videoFileB: string
   audioFileB: string
   webSiteB: string
+  levelB: string
   status: 0 | 1
 }
 

+ 22 - 4
src/types/api/Breserve.d.ts

@@ -2,8 +2,8 @@ export type B1tableType = {
   tbStatus: number
   createTime: string
   updateTime: string
-  createBy: string
-  updateBy: string
+  createBy: null | string
+  updateBy: null | string
   id: number
   wxUserId: number
   appointmentSlotsId: number
@@ -13,7 +13,25 @@ export type B1tableType = {
   status: number
   type: number
   activityId: number
-  personCount: number
+  userName: string
+  phone: string
+  activityTitle: string
+  visitors: B1visitorsType[]
+  idCard: string
 }
 
-export type B2tableType = any
+export type B1visitorsType = {
+  tbStatus: number
+  createTime: string
+  updateTime: string
+  createBy: null | string
+  updateBy: null | string
+  id: number
+  wxUserId: number
+  cardType: string
+  idCard: string
+  name: string
+  phone: string
+}
+
+export type B2tableType = B1tableType

+ 25 - 0
src/utils/copyTxt.ts

@@ -0,0 +1,25 @@
+import { message } from 'antd'
+
+// 点击复制
+const copyWithTextarea = (text: string) => {
+  const textArea = document.createElement('textarea')
+  textArea.value = text
+  textArea.style.position = 'fixed'
+  textArea.style.left = '-9999px'
+  textArea.style.top = '-9999px'
+  document.body.appendChild(textArea)
+  textArea.select()
+  const copyTXT = document.execCommand('copy')
+  document.body.removeChild(textArea)
+  return copyTXT
+}
+export const handleCopyClick = (text: string) => {
+  console.log(text, 'text')
+  if (navigator.clipboard && typeof navigator.clipboard.writeText === 'function') {
+    navigator.clipboard.writeText(text)
+    message.success('链接已复制到剪贴板')
+  } else {
+    copyWithTextarea(text)
+    message.success('链接已复制到剪贴板')
+  }
+}

+ 0 - 26
src/utils/storage.ts

@@ -4,32 +4,6 @@
 const TOKEN_KEY = 'KLMYMU'
 
 /**
- * 保存token到cookie
- */
-export const setTokenToCookie = (token: string): void => {
-  document.cookie = `token=${token}; path=/; max-age=${3 * 24 * 60 * 60};`
-}
-
-/**
- * 删除cookie中的token
- */
-export const removeTokenFromCookie = (): void => {
-  document.cookie = 'token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'
-}
-
-/**
- * 保存token到cookie
- */
-export const getTokenFromCookie = (): string => {
-  return (
-    document.cookie
-      .split('; ')
-      .find(row => row.startsWith('token='))
-      ?.split('=')[1] || ''
-  )
-}
-
-/**
  * 从本地缓存中获取 用户 信息
  */
 export const getTokenInfo = (): any => {

+ 7 - 6
src/utils/tableData.ts

@@ -43,6 +43,7 @@ export const A6tableC = [
 export const A7tableC = [
   ['txt', '标题', 'title', 'titleB'],
   ['txtChange', '类别', 'type', { 1: '平面纸质类', 2: '棉麻丝绸类', 3: '专业器物类' }],
+  ['txt', '级别', 'level', 'levelB'],
   ['txt', '质地', 'texture', 'textureB'],
   ['txt', '年代', 'era', 'eraB'],
   ['img', '封面', 'imgTh', 'imgThB'],
@@ -53,20 +54,20 @@ export const A7tableC = [
 
 export const B1tableC = [
   ['txtNormal', '申请时间', 'createTime'],
-  ['txtNormal', '姓名', 'name'],
+  ['txtNormal', '姓名', 'userName'],
   ['txtNormal', '联系电话', 'phone'],
-  ['txtNormal', '人数', 'people'],
-  ['txtNormal', '预约日期', 'date'],
+  ['txtNormal', '人数', 'pcs'],
+  ['txtNormal', '预约日期', 'appointmentTime'],
   ['txtNormal', '预约时段', 'time']
 ]
 
 export const B2tableC = [
   ['txtNormal', '申请时间', 'createTime'],
-  ['txtNormal', '姓名', 'name'],
-  ['txtNormal', '活动名称', 'activityName'],
+  ['txtNormal', '姓名', 'userName'],
+  ['txtNormal', '活动名称', 'activityTitle'],
   ['txtNormal', '联系电话', 'phone'],
   ['txtNormal', '身份证', 'idCard'],
-  ['txtNormal', '预约说明', 'remark']
+  ['txtNormal', '预约日期', 'appointmentTime']
 ]
 
 export const C1tableC = [