shaogen1995 8 mesi fa
parent
commit
6f9d26780c
31 ha cambiato i file con 724 aggiunte e 350 eliminazioni
  1. 3 2
      后台管理/src/components/MyPopconfirm.tsx
  2. 24 9
      后台管理/src/components/ZRichTexts/index.tsx
  3. 2 2
      后台管理/src/pages/A1webuser/index.module.scss
  4. 83 1
      后台管理/src/pages/A1webuser/index.tsx
  5. 22 0
      后台管理/src/pages/A1webuser/type.d.ts
  6. 52 30
      后台管理/src/pages/A4proveSuo/A4main/A4auth.tsx
  7. 13 1
      后台管理/src/pages/A4proveSuo/A4main/index.module.scss
  8. 6 7
      后台管理/src/pages/A4proveSuo/A4main/index.tsx
  9. 14 2
      后台管理/src/pages/A4proveSuo/type.d.ts
  10. 33 0
      后台管理/src/store/action/A1webuser.ts
  11. 2 6
      后台管理/src/store/action/A6record.ts
  12. 28 0
      后台管理/src/store/reducer/A1webuser.ts
  13. 2 0
      后台管理/src/store/reducer/index.ts
  14. 24 18
      后台管理/src/types/api/layot.d.ts
  15. 25 10
      后台管理/src/utils/tableData.ts
  16. 4 0
      展示端/src/App.tsx
  17. 4 0
      展示端/src/assets/styles/base.css
  18. 6 0
      展示端/src/assets/styles/base.less
  19. 1 1
      展示端/src/components/RouterOrder.tsx
  20. 42 0
      展示端/src/components/UpAsyncLoding/index.module.scss
  21. 15 0
      展示端/src/components/UpAsyncLoding/index.tsx
  22. 8 38
      展示端/src/pages/A3selectDay/index.tsx
  23. 32 20
      展示端/src/pages/A4selectCourse/A4look/index.tsx
  24. 19 78
      展示端/src/pages/A4selectCourse/index.tsx
  25. 60 85
      展示端/src/pages/A6my/index.tsx
  26. 14 0
      展示端/src/pages/A6my/type.d.ts
  27. 14 8
      展示端/src/pages/A7team/index.tsx
  28. 107 31
      展示端/src/pages/A8proof/index.tsx
  29. 46 1
      展示端/src/store/action/all.ts
  30. 5 0
      展示端/src/types/api/layot.d.ts
  31. 14 0
      展示端/src/utils/domShow.ts

+ 3 - 2
后台管理/src/components/MyPopconfirm.tsx

@@ -2,7 +2,7 @@ import React, { useMemo } from 'react'
 import { Button, Popconfirm } from 'antd'
 
 type Props = {
-  txtK: '删除' | '取消' | '重置密码' | '退出登录' | '清空'
+  txtK: '删除' | '取消' | '重置密码' | '退出登录' | '清空' | '取消认证'
   onConfirm: () => void
   Dom?: React.ReactNode
   loc?: 'bottom'
@@ -15,7 +15,8 @@ function MyPopconfirm({ txtK, onConfirm, Dom, loc }: Props) {
       取消: ['放弃编辑后,信息将不会保存!', '放弃'],
       重置密码: ['密码重制后为123456,是否重置?', '重置'],
       退出登录: ['确定退出吗?', '确定'],
-      清空: ['确定清空吗?', '确定']
+      清空: ['确定清空吗?', '确定'],
+      取消认证: ['是否移除该用户的团队认证资格及信息?', '移除']
     }
     return Reflect.get(obj, txtK) || ['', '']
   }, [txtK])

+ 24 - 9
后台管理/src/components/ZRichTexts/index.tsx

@@ -42,7 +42,15 @@ type Props = {
 }
 
 function ZRichTexts(
-  { check, dirCode, isLook, myUrl, isOne = false, upAudioBtnNone = false, otherArr }: Props,
+  {
+    check,
+    dirCode,
+    isLook,
+    myUrl,
+    isOne = false,
+    upAudioBtnNone = false,
+    otherArr
+  }: Props,
   ref: any
 ) {
   const [sectionArr, setSectionArr] = useState<SectionArrType[]>([
@@ -130,12 +138,15 @@ function ZRichTexts(
           if (res.code === 0) {
             MessageFu.success('上传成功!')
             // 在光标位置插入图片
-            const newTxt = ContentUtils.insertMedias(sectionArr[nowIndexRef.current].txt, [
-              {
-                type: 'IMAGE',
-                url: baseURL + res.data.filePath
-              }
-            ])
+            const newTxt = ContentUtils.insertMedias(
+              sectionArr[nowIndexRef.current].txt,
+              [
+                {
+                  type: 'IMAGE',
+                  url: baseURL + res.data.filePath
+                }
+              ]
+            )
             const arr = [...sectionArr]
             arr[nowIndexRef.current].txt = newTxt
             setSectionArr(arr)
@@ -176,7 +187,8 @@ function ZRichTexts(
 
     const obj = {
       isSection: isSection, //是否按章节发布
-      txtArr: arr
+      txtArr: arr,
+      isTxtFlag
     }
 
     return { val: obj, flag: isTxtFlag }
@@ -361,7 +373,10 @@ function ZRichTexts(
                 &emsp;
                 <div
                   hidden={isLook}
-                  className={classNames('zztxtRow1_2Icon', index === 0 ? 'zztxtRow1_2IconNo' : '')}
+                  className={classNames(
+                    'zztxtRow1_2Icon',
+                    index === 0 ? 'zztxtRow1_2IconNo' : ''
+                  )}
                   onClick={() => moveSectionFu(index, -1)}
                 >
                   <ArrowUpOutlined title='上移' />

+ 2 - 2
后台管理/src/pages/A1webuser/index.module.scss

@@ -1,4 +1,4 @@
 .A1webuser {
-  :global {
-  }
+  background-color: #fff;
+  border-radius: 10px;
 }

+ 83 - 1
后台管理/src/pages/A1webuser/index.tsx

@@ -1,9 +1,91 @@
-import React from 'react'
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import styles from './index.module.scss'
+import MyTable from '@/components/MyTable'
+import { useDispatch, useSelector } from 'react-redux'
+import { A1_APIcancel, A1_APIdel, A1_APIgetList } from '@/store/action/A1webuser'
+import { RootState } from '@/store'
+import { MessageFu } from '@/utils/message'
+import { A1tableType } from './type'
+import { Button } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { A1tableC } from '@/utils/tableData'
 function A1webuser() {
+  const dispatch = useDispatch()
+
+  const [fromData, setFromData] = useState({ pageNum: 1, pageSize: 10 })
+
+  const getListFu = useCallback(() => {
+    dispatch(A1_APIgetList(fromData))
+  }, [dispatch, fromData])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu])
+
+  const { tableInfo } = useSelector((state: RootState) => state.A1webuser)
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await A1_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功!')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
+  // 点击取消认证
+  const cancelTableFu = useCallback(
+    async (id: number) => {
+      const res = await A1_APIcancel(id)
+      if (res.code === 0) {
+        MessageFu.success('取消成功!')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: A1tableType) => (
+          <>
+            {item.isAuth === 1 ? (
+              <MyPopconfirm
+                txtK='取消认证'
+                onConfirm={() => cancelTableFu(item.id)}
+                Dom={
+                  <Button size='small' type='text'>
+                    取消认证
+                  </Button>
+                }
+              />
+            ) : null}
+            <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+          </>
+        )
+      }
+    ]
+  }, [cancelTableFu, delTableFu])
+
   return (
     <div className={styles.A1webuser}>
       <div className='pageTitle'>用户管理</div>
+
+      <MyTable
+        yHeight={700}
+        list={tableInfo.list}
+        columnsTemp={A1tableC}
+        lastBtn={tableLastBtn}
+        pageNum={fromData.pageNum}
+        pageSize={fromData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => setFromData({ ...fromData, pageNum, pageSize })}
+      />
     </div>
   )
 }

+ 22 - 0
后台管理/src/pages/A1webuser/type.d.ts

@@ -0,0 +1,22 @@
+export type A1tableType = {
+  authType: string
+  avatarUrl: string
+  city: string
+  country: string
+  createTime: string
+  creatorName: string
+  gender: string
+  id: number
+  isAuth: number
+  isEnabled: number
+  lastIp: string
+  lastLoginTime: string
+  nickName: string
+  openId: string
+  phone: string
+  province: string
+  type: string
+  unionId: string
+  unit: string
+  updateTime: string
+}

+ 52 - 30
后台管理/src/pages/A4proveSuo/A4main/A4auth.tsx

@@ -1,9 +1,13 @@
-import React, { useCallback, useState } from 'react'
+import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, Modal } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { MessageFu } from '@/utils/message'
-import { DownloadOutlined } from '@ant-design/icons'
+import { DownloadOutlined, EyeOutlined } from '@ant-design/icons'
+import { A4_APIauth, A4_APIgetInfo } from '@/store/action/A4proveSuo'
+import { FileType } from '@/types'
+import store from '@/store'
+import { baseURL } from '@/utils/http'
 
 type Props = {
   sId: number
@@ -11,24 +15,6 @@ type Props = {
   editTableFu: () => void
 }
 
-const fileArr = [
-  {
-    id: 1,
-    name: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.pdf',
-    filePath: '/favicon.ico'
-  },
-  {
-    id: 2,
-    name: 'xxxxxxxxxxxxxx.pdf',
-    filePath: '/favicon.ico'
-  },
-  {
-    id: 3,
-    name: 'xxxxxxxxxxxxxx.pdf',
-    filePath: '/favicon.ico'
-  }
-]
-
 export const btnArr = [
   {
     value: 0,
@@ -42,17 +28,39 @@ export const btnArr = [
     value: 2,
     label: '已拒绝'
   }
+  // {
+  //   value: 3,
+  //   label: '已失效'
+  // }
 ]
 
 function A4auth({ sId, closeFu, editTableFu }: Props) {
+  // 附件信息
+  const [fileArr, setFileArr] = useState<FileType[]>([])
+
   const [btnAc, setBtnAc] = useState(-1)
 
+  const getInfo = useCallback(async (id: number) => {
+    const res = await A4_APIgetInfo(id)
+    if (res.code === 0) {
+      setFileArr(res.data.file || [])
+      setBtnAc(res.data.status)
+    }
+  }, [])
+
+  useEffect(() => {
+    getInfo(sId)
+  }, [getInfo, sId])
+
   // 点击提交
-  const btnOk = useCallback(() => {
-    MessageFu.success('审核成功!')
-    editTableFu()
-    closeFu()
-  }, [closeFu, editTableFu])
+  const btnOk = useCallback(async () => {
+    const res = await A4_APIauth(sId, btnAc)
+    if (res.code === 0) {
+      MessageFu.success('审核成功!')
+      editTableFu()
+      closeFu()
+    }
+  }, [btnAc, closeFu, editTableFu, sId])
 
   return (
     <Modal
@@ -68,17 +76,31 @@ function A4auth({ sId, closeFu, editTableFu }: Props) {
         {fileArr.length ? (
           <div className='A4Arowrr A4Arowrr0'>
             {fileArr.map(item => (
-              <div className='A4Arowrr1Down' title={item.name}>
+              <div className='A4Arowrr1Down' title={item.filePath} key={item.id}>
                 <a
-                  key={item.id}
-                  href={item.filePath}
+                  href={baseURL + item.filePath}
                   target='_blank'
                   rel='noopener noreferrer'
-                  download={item.name}
+                  download={item.fileName}
                 >
                   <DownloadOutlined />
                 </a>
-                <div>{item.name}</div>
+                {item.fileName.endsWith('.pdf') ||
+                item.fileName.endsWith('.PDF') ? null : (
+                  <span className='A4lookImg'>
+                    <EyeOutlined
+                      onClick={() =>
+                        store.dispatch({
+                          type: 'layout/lookBigImg',
+                          payload: { url: baseURL + item.filePath, show: true }
+                        })
+                      }
+                      rev={undefined}
+                    />
+                  </span>
+                )}
+
+                <div>{item.fileName}</div>
               </div>
             ))}
           </div>

+ 13 - 1
后台管理/src/pages/A4proveSuo/A4main/index.module.scss

@@ -32,13 +32,25 @@
             display: flex;
             & > a {
               font-size: 20px;
+              color: var(--themeColor);
             }
+
+            .A4lookImg {
+              display: block;
+              margin-left: 10px;
+              font-size: 20px;
+              position: relative;
+              color: var(--themeColor);
+              position: relative;
+              top: 1px;
+            }
+
             & > div {
               position: relative;
               top: 3px;
               margin-left: 10px;
               font-size: 18px;
-              width: calc(100% - 40px);
+              width: calc(100% - 80px);
               overflow: hidden;
               text-overflow: ellipsis;
               white-space: nowrap;

+ 6 - 7
后台管理/src/pages/A4proveSuo/A4main/index.tsx

@@ -11,8 +11,6 @@ import { MessageFu } from '@/utils/message'
 import { A4tableC } from '@/utils/tableData'
 import A4auth from './A4auth'
 
-// 待完善
-
 type Props = {
   type: 'live' | 'neighbour'
 }
@@ -49,10 +47,11 @@ function A4main({ type }: Props) {
         title: '操作',
         render: (item: A4tableType) => (
           <>
-            <Button size='small' type='text'>
-              审核
-            </Button>
-
+            {item.status === 0 ? (
+              <Button size='small' type='text' onClick={() => setAuthId(item.id)}>
+                审核
+              </Button>
+            ) : null}
             <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
           </>
         )
@@ -65,7 +64,7 @@ function A4main({ type }: Props) {
 
   return (
     <div className={styles.A4main}>
-      <div className='pageTitle' onClick={() => setAuthId(1)}>
+      <div className='pageTitle'>
         团队认证({type === 'live' ? '民生事务局' : '街坊会联合总会'})
       </div>
       <MyTable

+ 14 - 2
后台管理/src/pages/A4proveSuo/type.d.ts

@@ -1,2 +1,14 @@
-export type A4tableType = any
-// 待完善
+export type A4tableType = {
+  createTime: string
+  creatorName: string
+  file: FileType[]
+  fileIds: string
+  id: number
+  name: string
+  phone: string
+  status: number
+  type: string
+  unit: string
+  updateTime: string
+  wxUserId: number
+}

+ 33 - 0
后台管理/src/store/action/A1webuser.ts

@@ -0,0 +1,33 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+
+/**
+ *前台用户-列表
+ */
+
+export const A1_APIgetList = (data: any): any => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post('cms/user/pageList', data)
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total
+      }
+      dispatch({ type: 'A1/getList', payload: obj })
+    }
+  }
+}
+
+/**
+ * 前台用户-删除
+ */
+export const A1_APIdel = (id: number) => {
+  return http.get(`cms/user/removes/${id}`)
+}
+
+/**
+ * 前台用户-取消认证
+ */
+export const A1_APIcancel = (id: number) => {
+  return http.get(`cms/user/update/${id}`)
+}

+ 2 - 6
后台管理/src/store/action/A6record.ts

@@ -9,13 +9,9 @@ export const A6_APIgetList = (data: any): any => {
   return async (dispatch: AppDispatch) => {
     const res = await http.post('cms/apply/pageList', data)
     if (res.code === 0) {
-      console.log(123, res)
-
-      // 待完善 多封装了一层data
-
       const obj = {
-        list: res.data.data.records,
-        total: res.data.data.total
+        list: res.data.records,
+        total: res.data.total
       }
       dispatch({ type: 'A6/getList', payload: obj })
     }

+ 28 - 0
后台管理/src/store/reducer/A1webuser.ts

@@ -0,0 +1,28 @@
+import { A1tableType } from '@/pages/A1webuser/type'
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as A1tableType[],
+    total: 0
+  }
+}
+
+// 定义 action 类型
+type Props = {
+  type: 'A1/getList'
+  payload: { list: A1tableType[]; total: number }
+}
+
+// reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case 'A1/getList':
+      return { ...state, tableInfo: action.payload }
+
+    default:
+      return state
+  }
+}

+ 2 - 0
后台管理/src/store/reducer/index.ts

@@ -3,6 +3,7 @@ import { combineReducers } from 'redux'
 
 // 导入 登录 模块的 reducer
 import A0Layout from './layout'
+import A1webuser from './A1webuser'
 import A3course from './A3course'
 import A4proveSuo from './A4proveSuo'
 import A6record from './A6record'
@@ -14,6 +15,7 @@ import Z2log from './Z2log'
 // 合并 reducer
 const rootReducer = combineReducers({
   A0Layout,
+  A1webuser,
   A3course,
   A4proveSuo,
   A6record,

+ 24 - 18
后台管理/src/types/api/layot.d.ts

@@ -1,25 +1,31 @@
 export type LookDomType = {
-  src: string;
-  type: "video" | "audio" | "model" | "";
-  flag?: boolean;
-};
+  src: string
+  type: 'video' | 'audio' | 'model' | ''
+  flag?: boolean
+}
 
 export type RouterTypeRow = {
-  id: number;
-  name: string;
-  path: string;
-  Com: React.LazyExoticComponent<React.MemoExoticComponent<() => JSX.Element>>;
-}[];
+  id: number
+  name: string
+  path: string
+  Com: React.LazyExoticComponent<React.MemoExoticComponent<() => JSX.Element>>
+}[]
 
 export type RouterType = {
-  id: number;
-  name: string;
-  son: RouterTypeRow;
-}[];
+  id: number
+  name: string
+  son: RouterTypeRow
+}[]
 
 export type FileImgListType = {
-  id: number;
-  fileName: string;
-  filePath: string;
-  type: "img" | "video" | "doc";
-};
+  id: number
+  fileName: string
+  filePath: string
+  type: 'img' | 'video' | 'doc'
+}
+
+export type FileType = {
+  id: number
+  fileName: string
+  filePath: string
+}

+ 25 - 10
后台管理/src/utils/tableData.ts

@@ -14,15 +14,19 @@
 //     ["text", "创建日期",'description', 50,A],
 //   ];
 
-export const B1tableC = [
-  ['txt', '时段', 'time'],
-  ['txt', '周一', 'monday'],
-  ['txt', '周二', 'tuesday'],
-  ['txt', '周三', 'wednesday'],
-  ['txt', '周四', 'thursday'],
-  ['txt', '周五', 'friday'],
-  ['txt', '周六', 'saturday'],
-  ['txt', '周日', 'sunday']
+export const A1tableC = [
+  ['txt', 'openId', 'openId'],
+  ['txt', '姓名', 'nickName'],
+  ['txt', '联系方式', 'phone'],
+  ['text', '单位名称', 'unit', 50],
+  ['txtChange', '团体认证', 'isAuth', { 0: '未认证', 1: '已认证' }],
+  [
+    'txtChange',
+    '认证单位',
+    'authType',
+    { neighbour: '澳门街坊会联合总会广东办事处', live: '横琴粤澳深度合作区民生事务局' }
+  ],
+  ['txt', '注册时间', 'createTime']
 ]
 
 export const A3tableC = [
@@ -38,7 +42,7 @@ export const A3tableCtype = [
 
 export const A4tableC = [
   ['txt', '负责人姓名', 'name'],
-  ['txt', '联系方式', 'sort'],
+  ['txt', '联系方式', 'phone'],
   ['txt', '单位名称', 'unit'],
   [
     'txtChange',
@@ -74,6 +78,17 @@ export const A6tableC = [
   ['txt', '申请时间', 'createTime']
 ]
 
+export const B1tableC = [
+  ['txt', '时段', 'time'],
+  ['txt', '周一', 'monday'],
+  ['txt', '周二', 'tuesday'],
+  ['txt', '周三', 'wednesday'],
+  ['txt', '周四', 'thursday'],
+  ['txt', '周五', 'friday'],
+  ['txt', '周六', 'saturday'],
+  ['txt', '周日', 'sunday']
+]
+
 export const B2tableC = [
   ['txt', '申请时间', 'createTime'],
   ['txt', '姓名', 'name'],

+ 4 - 0
展示端/src/App.tsx

@@ -6,6 +6,7 @@ import RouterOrder from './components/RouterOrder'
 import screenImg from '@/assets/img/landtip.png'
 import AsyncSpinLoding from './components/AsyncSpinLoding'
 import { homeJudgeFu, isMobileFu } from './utils/history'
+import UpAsyncLoding from './components/UpAsyncLoding'
 
 export default function AppM() {
   const setFullFu = useCallback(() => {
@@ -48,6 +49,9 @@ export default function AppM() {
       {/* 发送请求的加载组件 */}
       <AsyncSpinLoding />
 
+      {/* 上传附件的进度条元素 */}
+      <UpAsyncLoding />
+
       {/* antd 轻提示 ---兼容360浏览器 */}
       <MessageCom />
 

+ 4 - 0
展示端/src/assets/styles/base.css

@@ -75,6 +75,7 @@ textarea {
   overflow: hidden;
   max-width: 500px;
   margin: 0 auto;
+  position: relative;
 }
 #root #AppM > div {
   width: 100%;
@@ -184,3 +185,6 @@ textarea {
 .myTextBox p {
   min-height: 20px;
 }
+#upInput {
+  display: none;
+}

+ 6 - 0
展示端/src/assets/styles/base.less

@@ -90,6 +90,7 @@ textarea {
     overflow: hidden;
     max-width: 500px;
     margin: 0 auto;
+    position: relative;
     & > div {
       width: 100%;
       height: 100%;
@@ -226,3 +227,8 @@ textarea {
     min-height: 20px;
   }
 }
+
+// 上传的input
+#upInput {
+  display: none;
+}

+ 1 - 1
展示端/src/components/RouterOrder.tsx

@@ -62,7 +62,7 @@ const routerArr = [
   {
     id: 8,
     name: '团体认证表单',
-    path: '/proof/:id',
+    path: '/proof/:val',
     exact: true,
     Com: React.lazy(() => import('@/pages/A8proof'))
   },

+ 42 - 0
展示端/src/components/UpAsyncLoding/index.module.scss

@@ -0,0 +1,42 @@
+.UpAsyncLoding {
+  opacity: 0;
+  pointer-events: none;
+  position: fixed;
+  z-index: 10000;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.4);
+
+  :global {
+    .progressBox {
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translate(-50%, -50%);
+      width: 90%;
+      height: 6px;
+      max-width: 500px;
+      border-radius: 3px;
+      border: 1px solid var(--themeColor);
+      overflow: hidden;
+
+      #progress {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 0%;
+        height: 100%;
+        background-color: var(--themeColor);
+      }
+    }
+
+    .closeUpBtn {
+      position: absolute;
+      top: 70%;
+      left: 50%;
+      transform: translate(-50%, -50%);
+    }
+  }
+}

+ 15 - 0
展示端/src/components/UpAsyncLoding/index.tsx

@@ -0,0 +1,15 @@
+import React from 'react'
+import styles from './index.module.scss'
+function UpAsyncLoding() {
+  return (
+    <div id='UpAsyncLoding' className={styles.UpAsyncLoding}>
+      <div className='progressBox'>
+        <div id='progress'></div>
+      </div>
+    </div>
+  )
+}
+
+const MemoUpAsyncLoding = React.memo(UpAsyncLoding)
+
+export default MemoUpAsyncLoding

+ 8 - 38
展示端/src/pages/A3selectDay/index.tsx

@@ -7,43 +7,10 @@ import history from '@/utils/history'
 import { A3ListApiType, A3ListType } from './type'
 import getWeekList from '@/utils/timeChange'
 import { A3timeChageObj } from './data'
-import { A3_APIgetInfoByDay } from '@/store/action/all'
+import { A3_APIgetInfoByDay, A3_APIgetList } from '@/store/action/all'
 import dayjs from 'dayjs'
 import { MessageFu } from '@/utils/message'
 
-// 待完善后端接口没有(还应该在 当该时间段存在已通过/待审核的申请 把num变成0)
-const baseList: A3ListApiType[] = [
-  {
-    createTime: '2024-04-16 17:02:48',
-    creatorId: 1,
-    creatorName: '',
-    friday: 1,
-    id: 1,
-    monday: 1,
-    saturday: 1,
-    sunday: 1,
-    thursday: 1,
-    time: 'am',
-    tuesday: 1,
-    updateTime: '2024-12-14 16:22:25',
-    wednesday: 0
-  },
-  {
-    createTime: '2024-04-16 18:07:02',
-    creatorId: 1,
-    creatorName: '',
-    friday: 0,
-    id: 2,
-    monday: 0,
-    saturday: 1,
-    sunday: 1,
-    thursday: 0,
-    time: 'pm',
-    tuesday: 1,
-    updateTime: '2024-12-14 17:40:03',
-    wednesday: 0
-  }
-]
 function A3selectDay() {
   const [list, setList] = useState<A3ListType[]>([])
 
@@ -57,7 +24,11 @@ function A3selectDay() {
       noTime = noTime.replaceAll('月', '-').replaceAll('日', '')
       const noTimeArr = noTime.split(',')
 
-      setTimeout(() => {
+      const res2 = await A3_APIgetList()
+
+      if (res2.code === 0) {
+        const baseList: A3ListApiType[] = res2.data
+
         setLoding(true)
 
         const arr: A3ListType[] = []
@@ -88,7 +59,7 @@ function A3selectDay() {
         if (noeXisoShi >= 17) arr[0].xiaNum = -1
 
         setList(arr)
-      }, 100)
+      }
     }
   }, [])
 
@@ -102,14 +73,13 @@ function A3selectDay() {
   })
 
   // 点击上午和下午
-  // 待完善 接口返回的 usable字段 含义不明确
   const AmPmclick = useCallback(async (idCuo: number, val: 'am' | 'pm') => {
     const time = dayjs(idCuo).format('YYYY-MM-DD')
     const res = await A3_APIgetInfoByDay(time)
 
     if (res.code === 0) {
       const flag = res.data.time.usable
-      if (flag === 0) setAcObj({ id: idCuo, AmPm: val })
+      if (flag === 0 && res.data.time[val] !== 0) setAcObj({ id: idCuo, AmPm: val })
       else MessageFu.info('当前预约时段已满')
     }
   }, [])

+ 32 - 20
展示端/src/pages/A4selectCourse/A4look/index.tsx

@@ -19,35 +19,47 @@ function A4look({ info, closeFu }: Props) {
     }, 100)
   }, [topAc])
 
+  const txtChange = useCallback((val: string, key: 'txt' | 'flag') => {
+    if (key === 'txt') {
+      let txt = ''
+      if (val) {
+        let obj = JSON.parse(val)
+        txt = obj.txtArr[0].txt
+      }
+
+      return txt
+    } else if (key === 'flag') {
+      const obj = JSON.parse(val)
+
+      return !obj.isTxtFlag as boolean
+    }
+  }, [])
+
   useEffect(() => {
-    const { introRtf, teamRtf, infoRtf } = info
+    let { introRtf, teamRtf, infoRtf } = info
+
+    let introRtfFlag = txtChange(introRtf, 'flag')
+    let teamRtfFlag = txtChange(teamRtf, 'flag')
+    let infoRtfFlag = txtChange(infoRtf, 'flag')
+
     let arr: string[] = []
-    if (introRtf) arr.push('课程简介')
-    if (teamRtf) arr.push('教师简介')
-    if (infoRtf) arr.push('预约须知')
+    if (introRtfFlag) arr.push('课程简介')
+    if (teamRtfFlag) arr.push('教师简介')
+    if (infoRtfFlag) arr.push('预约须知')
     setTopArr(arr)
 
-    if (introRtf) setTopAc('课程简介')
-    else if (teamRtf) setTopAc('教师简介')
-    else if (infoRtf) setTopAc('预约须知')
-  }, [info])
+    if (introRtfFlag) setTopAc('课程简介')
+    else if (teamRtfFlag) setTopAc('教师简介')
+    else if (infoRtfFlag) setTopAc('预约须知')
+  }, [info, txtChange])
 
   const sollrRef = useRef<HTMLDivElement>(null)
 
-  const txtChange = useCallback((val: string) => {
-    let txt = ''
-    if (val) {
-      let obj = JSON.parse(val)
-      txt = obj.txtArr[0].txt
-    }
-    return txt
-  }, [])
-
   const txtRes = useMemo(() => {
     const obj = {
-      课程简介: txtChange(info.introRtf),
-      教师简介: txtChange(info.teamRtf),
-      预约须知: txtChange(info.infoRtf)
+      课程简介: txtChange(info.introRtf, 'txt'),
+      教师简介: txtChange(info.teamRtf, 'txt'),
+      预约须知: txtChange(info.infoRtf, 'txt')
     }
     return Reflect.get(obj, topAc)
   }, [info, topAc, txtChange])

File diff suppressed because it is too large
+ 19 - 78
展示端/src/pages/A4selectCourse/index.tsx


+ 60 - 85
展示端/src/pages/A6my/index.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback, useState } from 'react'
+import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
 import TopCom from '@/components/TopCom'
 import classNames from 'classnames'
@@ -7,6 +7,11 @@ import succImg from '@/assets/img/my/succ.png'
 import errImg from '@/assets/img/my/err.png'
 import succImg2 from '@/assets/img/my/succ2.png'
 import errImg2 from '@/assets/img/my/err2.png'
+import { A6_APIcancelAuth, A6_APIgetListRenZheng } from '@/store/action/all'
+import { A6tableType2 } from './type'
+import { FileType } from '@/types'
+import { baseURL } from '@/utils/http'
+import { MessageFu } from '@/utils/message'
 
 const list1 = [
   {
@@ -64,82 +69,42 @@ const list1 = [
   }
 ]
 
-const list2 = [
-  {
-    id: 1,
-    title: '横琴粤澳深度合作区民生事务局',
-    name: '撒大苏打水水',
-    done: 1,
-    phone: '18702025050',
-    danwei:
-      '为哇饿啊为为哇饿啊为为哇饿啊为为哇饿啊为为哇饿啊为为哇饿啊为为哇饿啊为为哇饿啊为为哇饿啊为为哇饿啊为',
-    file: [
-      {
-        id: 1.1,
-        name: 'xxxxxxxxxxxxxx啊实打实大撒大苏打撒旦苏打xxxx.pdf',
-        src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-      },
-      {
-        id: 1.2,
-        name: '666.jpg',
-        src: ''
-      }
-    ]
-  },
-  {
-    id: 2,
-    title: '澳门街坊会联合总会广东办事处',
-    name: '撒大苏',
-    done: 2,
-    phone: '18702025050',
-    danwei: '为哇饿啊为为',
-    file: [
-      {
-        id: 2.1,
-        name: 'xxxxxxxxxxxxxx啊实打实大苏打xxxx.pdf',
-        src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-      }
-    ]
-  },
-  {
-    id: 3,
-    title: '澳门街坊会联合总会广东办事处',
-    name: '撒大苏',
-    done: 3,
-    phone: '18702025050',
-    danwei: '为哇饿啊为为',
-    file: [
-      {
-        id: 3.1,
-        name: 'xxxxxxxxxxxxxx啊实打实大苏打xxxx.pdf',
-        src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-      }
-    ]
-  },
-  {
-    id: 4,
-    title: '澳门街坊会联合总会广东办事处',
-    name: '撒大苏',
-    done: 0,
-    phone: '18702025050',
-    danwei: '为哇饿啊为为',
-    file: [
-      {
-        id: 3.1,
-        name: 'xxxxxxxxxxxxxx啊实打实大苏打xxxx.pdf',
-        src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-      }
-    ]
-  }
-]
+// 待完善
 
 function A6my() {
   const [topAc, setTopAc] = useState(
     window.location.hash.includes('?m=1') ? '认证申请' : '预约申请'
   )
 
-  // 点击撤回
-  const recallFu = useCallback((id: number) => {}, [])
+  const [list2, setList2] = useState<A6tableType2[]>([])
+  const [loding2, setLoding2] = useState(false)
+
+  // 获取认证申请
+  const getList2 = useCallback(async () => {
+    const res = await A6_APIgetListRenZheng()
+    if (res.code === 0) {
+      setLoding2(true)
+      setList2(res.data)
+    }
+  }, [])
+
+  useEffect(() => {
+    getList2()
+  }, [getList2])
+
+  // 点击撤回 待完善
+  const recallFu = useCallback(
+    async (id: number, type: 'apply' | 'auth') => {
+      const res = await A6_APIcancelAuth(id, type)
+      if (res.code === 0) {
+        MessageFu.success('撤回申请成功!')
+        if (type === 'apply') {
+          // 待完善
+        } else getList2()
+      }
+    },
+    [getList2]
+  )
 
   return (
     <div className={styles.A6my}>
@@ -233,7 +198,7 @@ function A6my() {
                   <div className={classNames('A6row3', item.done !== 1 ? 'A6row3No' : '')}>
                     <MyPopconfirm
                       txtK='撤回'
-                      onConfirm={() => recallFu(item.id)}
+                      onConfirm={() => recallFu(item.id, 'apply')}
                       Dom={<div>撤回申请</div>}
                     />
                   </div>
@@ -253,20 +218,24 @@ function A6my() {
                 <div className='A6_2row' key={item.id}>
                   <div className='A6_2Top'>
                     <p>认证单位</p>
-                    <div>{item.title}</div>
+                    <div>
+                      {item.type === 'neighbour'
+                        ? '澳门街坊会联合总会广东办事处'
+                        : '横琴粤澳深度合作区民生事务局'}
+                    </div>
 
-                    {[0, 1].includes(item.done) ? (
+                    {[3, 0].includes(item.status) ? (
                       <div
                         className='A6row1_1'
                         style={{
-                          borderColor: item.done === 0 ? '#aeaeae' : '#fff',
-                          backgroundColor: item.done === 0 ? '#aeaeae' : ''
+                          borderColor: item.status === 3 ? '#aeaeae' : '#fff',
+                          backgroundColor: item.status === 3 ? '#aeaeae' : ''
                         }}
                       >
-                        {item.done === 0 ? '已失效' : '待审核'}
+                        {item.status === 3 ? '已失效' : '待审核'}
                       </div>
                     ) : (
-                      <img src={item.done === 2 ? succImg2 : errImg2} alt='' />
+                      <img src={item.status === 1 ? succImg2 : errImg2} alt='' />
                     )}
                   </div>
 
@@ -282,17 +251,21 @@ function A6my() {
                     </p>
                     <div>
                       <span>单位名称:</span>
-                      <p>{item.danwei}</p>
+                      <p>{item.unit}</p>
                     </div>
                   </div>
 
                   <div className='A6_2file'>
                     <div className='A6_2file1'>
                       <div className='A6_2file1_1'>授权或同意文件:</div>
-                      {item.file.map(item2 => (
+                      {item.file.map((item2: FileType) => (
                         <div key={item2.id} className='A6_2fileRow'>
-                          <div className='A6_2filell'>{item2.name}</div>
-                          <a href={item2.src} className='A6_2filerr' download={item2.name}>
+                          <div className='A6_2filell'>{item2.fileName}</div>
+                          <a
+                            href={baseURL + item2.filePath}
+                            className='A6_2filerr'
+                            download={item2.fileName}
+                          >
                             下载
                           </a>
                         </div>
@@ -300,10 +273,10 @@ function A6my() {
                     </div>
                   </div>
 
-                  <div className={classNames('A6_2btn', item.done !== 1 ? 'A6_2btnNo' : '')}>
+                  <div className={classNames('A6_2btn', item.status !== 0 ? 'A6_2btnNo' : '')}>
                     <MyPopconfirm
                       txtK='撤回'
-                      onConfirm={() => recallFu(item.id)}
+                      onConfirm={() => recallFu(item.id, 'auth')}
                       Dom={<div>撤回申请</div>}
                     />
                   </div>
@@ -311,7 +284,9 @@ function A6my() {
               ))}
             </>
           ) : (
-            <div className='A6No'>暂无认证申请</div>
+            <div className='A6No' hidden={!loding2}>
+              暂无认证申请
+            </div>
           )}
         </div>
       </div>

+ 14 - 0
展示端/src/pages/A6my/type.d.ts

@@ -0,0 +1,14 @@
+export type A6tableType2 = {
+  createTime: string
+  creatorName: string
+  file: FileType[]
+  fileIds: string
+  id: number
+  name: string
+  phone: string
+  status: number
+  type: string
+  unit: string
+  updateTime: string
+  wxUserId: number
+}

+ 14 - 8
展示端/src/pages/A7team/index.tsx

@@ -5,14 +5,20 @@ import TopCom from '@/components/TopCom'
 import topImg from '@/assets/img/team/top.png'
 import history from '@/utils/history'
 import ZinfoPop from '@/components/ZinfoPop'
+import { A4_APIcheck } from '@/store/action/all'
 
 function A7team() {
-  const toFromFu = useCallback((can: '1' | '2') => {
-    // history.push(`/proof/${can}`)
-    setTitPop({
-      txt1: can === '1' ? '您已完成认证' : '申请审核中',
-      txt2: can === '1' ? '无需重复申请' : '请勿重复申请'
-    })
+  const toFromFu = useCallback(async (can: string) => {
+    const res = await A4_APIcheck()
+
+    if (res.code === 0) {
+      if (res.data) {
+        setTitPop({
+          txt1: '您已完成认证',
+          txt2: '无需重复申请'
+        })
+      } else history.push(`/proof/${can}`)
+    }
   }, [])
 
   // 打开提示弹窗
@@ -28,10 +34,10 @@ function A7team() {
         <img src={topImg} alt='' />
         <div className='A7tit'>请选择认证单位</div>
 
-        <div className='A7dan1' onClick={() => toFromFu('1')}>
+        <div className='A7dan1' onClick={() => toFromFu('live')}>
           <div>横琴粤澳深度合作区民生事务局</div>
         </div>
-        <div className='A7dan1' onClick={() => toFromFu('2')}>
+        <div className='A7dan1' onClick={() => toFromFu('neighbour')}>
           <div className='A7dan1_1'>澳门街坊会联合总会广东办事处</div>
         </div>
       </div>

+ 107 - 31
展示端/src/pages/A8proof/index.tsx

@@ -9,6 +9,11 @@ import TextArea from 'antd/es/input/TextArea'
 import { CloudUploadOutlined, EyeOutlined, CloseOutlined } from '@ant-design/icons'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { ImageViewer } from 'antd-mobile'
+import { MessageFu } from '@/utils/message'
+import { A8_APIsave, API_upFile } from '@/store/action/all'
+import { fileDomInitialFu } from '@/utils/domShow'
+import { FileType } from '@/types'
+import { baseURL } from '@/utils/http'
 
 function A8proof() {
   const urlObj: any = useParams()
@@ -16,19 +21,21 @@ function A8proof() {
   const canRef = useRef('')
 
   useEffect(() => {
-    if (urlObj.id) {
-      canRef.current =
-        urlObj.id === '1' ? '横琴粤澳深度合作区民生事务局' : '澳门街坊会联合总会广东办事处'
+    if (urlObj.val) {
+      canRef.current = urlObj.val
     }
-  }, [urlObj.id])
+  }, [urlObj.val])
 
-  useEffect(() => {
-    FormBoxRef.current?.setFieldsValue({
-      name: '王大锤',
-      phone: '18702025091',
-      danwei: '阿三大苏打'
-    })
-  }, [])
+  // useEffect(() => {
+  //   FormBoxRef.current?.setFieldsValue({
+  //     name: '王大锤',
+  //     phone: '18702025091',
+  //     unit: '阿三大苏打'
+  //   })
+  // }, [])
+
+  // 附件列表
+  const [fileArr, setFileArr] = useState<FileType[]>([])
 
   // 表单的ref
   const FormBoxRef = useRef<FormInstance>(null)
@@ -37,28 +44,94 @@ function A8proof() {
   const onFinishFailed = useCallback(() => {}, [])
 
   //  通过校验点击确定
-  const onFinish = useCallback(async (values: any) => {
-    setTitPop('succ')
-  }, [])
+  const onFinish = useCallback(
+    async (values: any) => {
+      if (fileArr.length <= 0) return MessageFu.warning('请上传授权或同意文件!')
+
+      let fileIds = ''
+      fileIds = fileArr.map(v => v.id).join(',')
+      const obj = {
+        ...values,
+        fileIds,
+        type: canRef.current
+      }
+
+      const res = await A8_APIsave(obj)
+      if (res.code === 0) {
+        setTitPop('succ')
+      }
+    },
+    [fileArr]
+  )
 
   // 打开提示弹窗
   const [titPop, setTitPop] = useState('')
 
-  const [fileArr, setFileArr] = useState([
-    {
-      id: 1,
-      name: '啊实打实大苏打实打实大苏打啊实打实大苏打实打实大苏打啊实打实大苏打实打实大苏打.jpg',
-      src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
+  const myInput = useRef<HTMLInputElement>(null)
+
+  // 上传
+  const handeUpPhoto = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (e.target.files) {
+        // 拿到files信息
+        const filesInfo = e.target.files[0]
+        // console.log("-----", filesInfo.type);
+
+        // 校验格式
+        const type = ['image/jpeg', 'image/png', 'application/pdf']
+
+        if (!type.includes(filesInfo.type)) {
+          e.target.value = ''
+          return MessageFu.warning(`只支持.pdf,.jpg,.png格式!`)
+        }
+
+        const size = 5
+
+        // 校验大小
+        if (filesInfo.size > size * 1024 * 1024) {
+          e.target.value = ''
+          return MessageFu.warning(`最大支持${size}M!`)
+        }
+        // 创建FormData对象
+        const fd = new FormData()
+        fd.append('type', 'doc')
+        fd.append('dirCode', 'ProofDoc')
+        fd.append('moduleName', 'auth')
+        fd.append('isDb', 'true')
+        fd.append('file', filesInfo)
+
+        // if (filesInfo.size > 1 * 1024 * 1024) {
+        //   // 开启压缩图片
+        //   fd.append('isCompress', 'true')
+        // }
+
+        e.target.value = ''
+
+        try {
+          const res = await API_upFile(fd, 'wx/upload')
+          if (res.code === 0) {
+            MessageFu.success('上传成功!')
+            setFileArr([...fileArr, res.data])
+          }
+          fileDomInitialFu()
+        } catch (error) {
+          fileDomInitialFu()
+        }
+      }
     },
-    {
-      id: 2,
-      name: 'cccc.pdf',
-      src: '//cccc.pdf'
-    }
-  ])
+    [fileArr]
+  )
 
   return (
     <div className={styles.A8proof}>
+      <input
+        id='upInput'
+        type='file'
+        accept='.pdf,.jpg,.png'
+        ref={myInput}
+        onChange={e => handeUpPhoto(e)}
+      />
+
       <TopCom txt='团体认证' />
       <div className='A8main'>
         <div className='A8Center'>
@@ -101,7 +174,7 @@ function A8proof() {
               <Form.Item
                 className='A8Text'
                 label='单位名称'
-                name='danwei'
+                name='unit'
                 rules={[{ required: true, message: '请输入单位名称!' }]}
                 // getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
               >
@@ -119,6 +192,7 @@ function A8proof() {
                   <div className='A8K2ll_2'>仅限PDF,jpg,png格式;大小不超过5M;最多3个文件</div>
                 </div>
                 <div
+                  onClick={() => myInput.current?.click()}
                   className='A8K2rr'
                   style={{
                     opacity: fileArr.length >= 3 ? '0' : '1',
@@ -131,17 +205,19 @@ function A8proof() {
               </div>
               {fileArr.length ? (
                 <div className='A8lKa2File'>
-                  {fileArr.map(item => (
+                  {fileArr.map((item, index) => (
                     <div key={item.id} className='A8Frow'>
-                      <div className='A8Frowll'>{item.name}</div>
+                      <div className='A8Frowll'>{item.fileName}</div>
                       <div className='A8Frowrr'>
-                        {item.name.includes('.pdf') || item.name.includes('.PDF') ? null : (
-                          <EyeOutlined onClick={() => ImageViewer.show({ image: item.src })} />
+                        {item.fileName.endsWith('.pdf') || item.fileName.endsWith('.PDF') ? null : (
+                          <EyeOutlined
+                            onClick={() => ImageViewer.show({ image: baseURL + item.filePath })}
+                          />
                         )}
 
                         <MyPopconfirm
                           txtK='删除'
-                          onConfirm={() => setFileArr(fileArr.filter(v => v.id !== item.id))}
+                          onConfirm={() => setFileArr(fileArr.filter((v, i) => i !== index))}
                           Dom={<CloseOutlined className='clearCover' />}
                         />
                       </div>

+ 46 - 1
展示端/src/store/action/all.ts

@@ -1,3 +1,4 @@
+import { domShowFu, progressDomFu } from '@/utils/domShow'
 import http from '@/utils/http'
 
 /**
@@ -8,6 +9,13 @@ export const A3_APIgetInfoByDay = (day: string) => {
 }
 
 /**
+ * 选择日期-上午-下午列表
+ */
+export const A3_APIgetList = () => {
+  return http.get('wx/subject/config')
+}
+
+/**
  * 获取课堂列表(选择课程)
  */
 export const A4_APIgetList = () => {
@@ -30,7 +38,28 @@ export const A4_APIcheck = () => {
   return http.get('wx/auth/check')
 }
 
-// ------------------展馆
+/**
+ * 团体认证 - 提交
+ */
+export const A8_APIsave = (data: any) => {
+  return http.post('wx/auth', data)
+}
+
+/**
+ * 我的申请-认证申请
+ */
+export const A6_APIgetListRenZheng = () => {
+  return http.get('wx/my/auth')
+}
+
+/**
+ * 我的申请-取消认证
+ */
+export const A6_APIcancelAuth = (id: number, type: 'apply' | 'auth') => {
+  return http.get(`wx/my/${type}/cancel/${id}`)
+}
+
+// ------------------展馆------------------------
 
 /**
  * 获取当前日期的配置信息(发送当天日期拿不可预约日期)
@@ -38,3 +67,19 @@ export const A4_APIcheck = () => {
 export const B1_APIgetInfoByDay = (day: string) => {
   return http.get(`exhibition/book/config?date=${day}`)
 }
+
+/**
+ * 上传封面图和附件
+ */
+export const API_upFile = (data: any, url: string) => {
+  domShowFu('#UpAsyncLoding', true)
+
+  return http.post(url, data, {
+    timeout: 0,
+    // 显示进度条
+    onUploadProgress: (e: any) => {
+      const complete = (e.loaded / e.total) * 100 || 0
+      progressDomFu(complete + '%')
+    }
+  })
+}

+ 5 - 0
展示端/src/types/api/layot.d.ts

@@ -0,0 +1,5 @@
+export type FileType = {
+  id: number
+  fileName: string
+  filePath: string
+}

+ 14 - 0
展示端/src/utils/domShow.ts

@@ -11,3 +11,17 @@ export const domShowFu = (ele: string, val: boolean) => {
     }
   }
 }
+
+// 上传附件的进度条
+let progressDom: HTMLDivElement = document.querySelector('#progress')!
+export const progressDomFu = (val: string) => {
+  if (!progressDom) progressDom = document.querySelector('#progress')!
+  progressDom.style.width = val
+}
+
+// 上传附件的dom操作
+export const fileDomInitialFu = () => {
+  // 隐藏进度条的dom
+  domShowFu('#UpAsyncLoding', false)
+  progressDomFu('0%')
+}