shaogen1995 пре 3 месеци
родитељ
комит
34eedd8a1d

+ 4 - 2
src/components/MyPopconfirm.tsx

@@ -15,9 +15,10 @@ type Props = {
   onConfirm: () => void
   Dom?: React.ReactNode
   loc?: 'bottom'
+  disabled?: boolean
 }
 
-function MyPopconfirm({ txtK, onConfirm, Dom, loc }: Props) {
+function MyPopconfirm({ txtK, onConfirm, Dom, loc, disabled }: Props) {
   const txt = useMemo(() => {
     const obj = {
       删除: ['删除后无法恢复,是否删除?', '删除'],
@@ -35,6 +36,7 @@ function MyPopconfirm({ txtK, onConfirm, Dom, loc }: Props) {
 
   return (
     <Popconfirm
+      disabled={disabled}
       placement={loc}
       title={txt[0]}
       okText={txt[1]}
@@ -45,7 +47,7 @@ function MyPopconfirm({ txtK, onConfirm, Dom, loc }: Props) {
       {Dom ? (
         Dom
       ) : ['删除', '恢复', '导入当前合格数据', '清空数据'].includes(txtK) ? (
-        <Button size='small' type='text' danger>
+        <Button disabled={disabled} size='small' type='text' danger>
           {txtK}
         </Button>
       ) : (

+ 3 - 0
src/components/MyTable/index.tsx

@@ -136,6 +136,9 @@ const MyTable = forwardRef<MyTableMethods, MyTableProps>(
             ) : (
               item[v[2]] || isNull
             ),
+          txtArr: (item: any) => (
+            <div dangerouslySetInnerHTML={{ __html: (item[v[2]] || []).join('<br/>') }}></div>
+          ),
           // 多个字段拼接
           ping: (item: any) => (item[v[2]] || '') + (resJiLianFu(item[v[3]]) || '') || isNull,
           // 这个模块特有的级联控制

+ 5 - 5
src/components/Z3upFiles/index.tsx

@@ -11,6 +11,8 @@ import classNames from 'classnames'
 import { baseURL } from '@/utils/http'
 import { authFilesLookFu } from './data'
 
+const size = Infinity
+
 export type GoodFileType = {
   createTime: string
   creatorId: number
@@ -46,7 +48,6 @@ type Props = {
   // result:成果 | list:清单
   tips?: string
   // 文件大小
-  size?: number
   noShowList?: boolean //不回显列表
   fileRes?: (obj: GoodFileType) => void
 }
@@ -61,8 +62,7 @@ function Z3upFiles(
     fromData,
     lookData,
     accept = '*',
-    tips = '最多支持10个附件;单个附件不得超过500M',
-    size,
+    tips = '',
     noShowList = false,
     fileRes
   }: Props,
@@ -133,7 +133,7 @@ function Z3upFiles(
         }
       }
     },
-    [accept, dirCode, fileList, fileRes, fromData, myUrl, size]
+    [accept, dirCode, fileList, fileRes, fromData, myUrl]
   )
 
   // 列表删除某一个文件
@@ -218,7 +218,7 @@ function Z3upFiles(
         )}
 
         <div className='fileTit' hidden={isLook || noShowList}>
-          {tips}
+          {tips ? tips : null}
           <br />
           <div
             className={classNames(

+ 6 - 6
src/components/ZRichTexts/index.tsx

@@ -92,9 +92,9 @@ function ZRichTexts(
         const filesInfo = e.target.files[0]
 
         let type = ['image/jpeg', 'image/png']
-        let size = 5
+        // let size = 5
         let txt = '图片只支持png、jpg和jpeg格式!'
-        let txt2 = '图片最大支持5M!'
+        // let txt2 = '图片最大支持5M!'
 
         // 校验格式
         if (!type.includes(filesInfo.type)) {
@@ -103,10 +103,10 @@ function ZRichTexts(
         }
 
         // 校验大小
-        if (filesInfo.size > size * 1024 * 1024) {
-          e.target.value = ''
-          return MessageFu.warning(txt2)
-        }
+        // if (filesInfo.size > size * 1024 * 1024) {
+        //   e.target.value = ''
+        //   return MessageFu.warning(txt2)
+        // }
 
         // 创建FormData对象
         const fd = new FormData()

+ 6 - 7
src/components/ZupFileTable/index.tsx

@@ -17,11 +17,10 @@ type Props = {
   listTemp: FileListType[]
   dirCode: string //文件的code码
   myUrl: string //请求地址
-  size?: number
   fromData?: any
 }
 
-function ZupFileTable({ listTemp, dirCode, myUrl, size = 500, fromData }: Props) {
+function ZupFileTable({ listTemp, dirCode, myUrl, fromData }: Props) {
   const [list, setList] = useState<FileListType[]>([])
 
   useEffect(() => {
@@ -39,10 +38,10 @@ function ZupFileTable({ listTemp, dirCode, myUrl, size = 500, fromData }: Props)
         const filesInfo = e.target.files[0]
 
         // 校验大小
-        if (filesInfo.size > size * 1024 * 1024) {
-          e.target.value = ''
-          return MessageFu.warning(`最大支持${size}M!`)
-        }
+        // if (filesInfo.size > size * 1024 * 1024) {
+        //   e.target.value = ''
+        //   return MessageFu.warning(`最大支持${size}M!`)
+        // }
         // 创建FormData对象
         const fd = new FormData()
         // 把files添加进FormData对象(‘photo’为后端需要的字段)
@@ -76,7 +75,7 @@ function ZupFileTable({ listTemp, dirCode, myUrl, size = 500, fromData }: Props)
         }
       }
     },
-    [dirCode, fromData, list, myUrl, size]
+    [dirCode, fromData, list, myUrl]
   )
 
   const userInfo = useSelector((state: RootState) => state.A0Layout.userInfo)

+ 6 - 8
src/components/ZupOne/index.tsx

@@ -24,7 +24,6 @@ type MyTypeType = 'thumb' | 'video' | 'audio' | 'model' | 'pdf' | 'epub'
 
 type Props = {
   fileCheck: boolean //有没有点击过确定
-  size: number //上传附件大小(M)
   dirCode: string //文件的code码
   myUrl: string //请求地址
   format: string[] //上传格式 ["image/jpeg", "image/png"] ["video/mp4"] ,application/pdf
@@ -41,7 +40,6 @@ type Props = {
 function ZupOne(
   {
     fileCheck,
-    size,
     dirCode,
     myUrl,
     format,
@@ -92,10 +90,10 @@ function ZupOne(
         }
 
         // 校验大小
-        if (filesInfo.size > size * 1024 * 1024) {
-          e.target.value = ''
-          return MessageFu.warning(`最大支持${size}M!`)
-        }
+        // if (filesInfo.size > size * 1024 * 1024) {
+        //   e.target.value = ''
+        //   return MessageFu.warning(`最大支持${size}M!`)
+        // }
         // 创建FormData对象
         const fd = new FormData()
         // 把files添加进FormData对象(‘photo’为后端需要的字段)
@@ -128,7 +126,7 @@ function ZupOne(
         }
       }
     },
-    [dirCode, format, formatTxt, fromData, myType, myUrl, size]
+    [dirCode, format, formatTxt, fromData, myType, myUrl]
   )
 
   // 让父组件调用的 回显 附件 地址
@@ -282,7 +280,7 @@ function ZupOne(
       ) : null}
 
       <div className='fileBoxRow_r_tit' hidden={isLook}>
-        格式要求:支持{formatTxt}格式;最大支持{size}M。{upTxt}
+        格式要求:支持{formatTxt}格式。{upTxt}
         <br />
         <div
           className={classNames('noUpThumb', !fileUrl.filePath && fileCheck ? 'noUpThumbAc' : '')}

+ 4 - 15
src/components/ZupTypes/index.tsx

@@ -20,6 +20,8 @@ import classNames from 'classnames'
 import MyPopconfirm from '../MyPopconfirm'
 // import { A2_APIchangeImgName } from "@/store/action/A2exhibition";
 
+const imgSize = Infinity
+
 export type FileListType = {
   fileName: string
   thumb?: string
@@ -39,7 +41,6 @@ type Props = {
   isEdit: boolean //是否是编辑
   isLook?: boolean //是不是查看
   modelSize?: number //模型文件大小限制
-  imgSize?: number //图片大小限制
   imgLength?: number //图片数量限制
   audioSize?: number //音频大小限制
   videoSize?: number //视频大小限制
@@ -61,7 +62,6 @@ function ZupTypes(
     isEdit,
     isLook = false,
     modelSize = 500,
-    imgSize = 5,
     imgLength = 9,
     audioSize = 10,
     videoSize = 500,
@@ -223,18 +223,7 @@ function ZupTypes(
         }
       }
     },
-    [
-      audioSize,
-      dirCode,
-      fileList,
-      fileOneType,
-      fromData,
-      imgSize,
-      isUpName,
-      modelSize,
-      myUrl,
-      videoSize
-    ]
+    [audioSize, dirCode, fileList, fileOneType, fromData, isUpName, modelSize, myUrl, videoSize]
   )
 
   // 附件图片的拖动
@@ -564,7 +553,7 @@ function ZupTypes(
               <br />
             </>
           ) : null}
-          支持png、jpg的图片格式;最大支持5M;最多支持{imgLength}张。
+          支持png、jpg的图片格式;最多支持{imgLength}张。
           {lastImgTxt}
         </div>
       </div>

+ 0 - 1
src/pages/A_workbench/A2business/A2editUser/index.tsx

@@ -91,7 +91,6 @@ function A2editUser({ closeFu, userInfo, succFu }: Props) {
               ref={ZupThumbRef}
               isLook={false}
               fileCheck={fileCheck}
-              size={1}
               dirCode='businessEditUser'
               myUrl='sys/user/upload'
               format={['image/jpeg', 'image/png']}

+ 5 - 1
src/pages/A_workbench/A2business/A2setStock/index.tsx

@@ -73,7 +73,11 @@ function A2setStock({ arr, closeFu, succFu, sId }: Props) {
       <div className='A2Smain'>
         <div className='Z5eboxrr'>
           {roleArr.map(v => (
-            <div key={v.id} className='Z5eRow' hidden={v.son.length === 0}>
+            <div
+              key={v.id}
+              className='Z5eRow'
+              hidden={v.son.length === 0 || (v.son.length === 1 && v.son[0].name === '业务中心')}
+            >
               <div className='Z5eRow1'>{v.name}</div>
               <div className='Z5eRow2'>
                 {v.son.map(c =>

+ 5 - 0
src/pages/A_workbench/A2business/data.ts

@@ -0,0 +1,5 @@
+import { envFlag } from '@/utils/http'
+
+export const A2imgBaseUrl = envFlag
+  ? 'https://sit-yiwubwg.4dage.com/baseData/tabImg/'
+  : '/baseData/tabImg/'

+ 11 - 6
src/pages/A_workbench/A2business/index.module.scss

@@ -90,26 +90,31 @@
           flex-wrap: wrap;
           align-items: center;
           .A2ll2Row {
-            border: 2px solid #dddddd;
             cursor: pointer;
             transition: all 0.3s;
             margin-right: 20px;
             margin-bottom: 20px;
             height: 90px;
             width: 100px;
-            background-color: #dddddd;
-            border-radius: 10px;
             display: flex;
             flex-direction: column;
             justify-content: center;
             align-items: center;
-            font-weight: 700;
-            &:hover {
-              border-color: var(--themeColor);
+            & > img {
+              width: 40px;
+              height: auto;
+              transition: all 0.3s;
             }
             & > p {
+              font-size: 14px;
               margin-top: 10px;
             }
+            &:hover {
+              color: var(--themeColor);
+              & > img {
+                transform: scale(1.1);
+              }
+            }
           }
         }
       }

+ 28 - 5
src/pages/A_workbench/A2business/index.tsx

@@ -15,6 +15,7 @@ import A2editUser from './A2editUser'
 import A2setStock from './A2setStock'
 import { RouterType } from '@/types'
 import A2table from './A2table'
+import { A2imgBaseUrl } from './data'
 
 const userInfoJting = getTokenInfo().user
 
@@ -28,10 +29,30 @@ function A2business() {
     const res = await getUserInfoByIdAPI(userInfoJting.id)
     if (res.code === 0) {
       store.dispatch({ type: 'layout/userInfo', payload: res.data })
-
       // 设置常用功能
-      if (res.data.permRtf) setStockList(JSON.parse(res.data.permRtf || '[]'))
-      else setStockList(userRolePermissions)
+      if (res.data.permRtf) {
+        // 权限中有的页面id集合
+        // const acArr = userRolePermissions.flatMap(parent => parent.son.map(child => child.id))
+
+        // const resArr: RouterType = []
+
+        // const reaArr: RouterType = JSON.parse(res.data.permRtf || '[]')
+
+        // reaArr.forEach(v1 => {
+        //   const obj1 = {
+        //     ...v1,
+        //     son: [] as RouterTypeRow[]
+        //   }
+        //   if (v1.son) {
+        //     v1.son.forEach(v2 => {
+        //       if (v2.id !== 120) obj1.son.push(v2)
+        //     })
+        //   }
+        //   resArr.push(obj1)
+        // })
+
+        setStockList(JSON.parse(res.data.permRtf || '[]'))
+      } else setStockList(userRolePermissions)
     }
   }, [userRolePermissions])
 
@@ -122,7 +143,8 @@ function A2business() {
                 v1.son.map(v2 =>
                   v2.authority && v2.name !== '业务中心' ? (
                     <div key={v2.id} className='A2ll2Row' onClick={() => history.push(v2.path)}>
-                      {v2.name}
+                      <img src={A2imgBaseUrl + v2.name + '.png'} alt='' />
+                      <p>{v2.name}</p>
                     </div>
                   ) : null
                 )
@@ -136,7 +158,8 @@ function A2business() {
               {changGetFu().length ? (
                 changGetFu().map((v, i) => (
                   <div key={i} className='A2ll2Row' onClick={() => history.push(v.path)}>
-                    {v.name}
+                    <img src={A2imgBaseUrl + v.name + '.png'} alt='' />
+                    <p>{v.name}</p>
                   </div>
                 ))
               ) : (

+ 53 - 29
src/pages/B_enterTibet/B1collect/B1edit/B1MoAdd/index.tsx

@@ -4,48 +4,73 @@ import { Button, Cascader, Form, FormInstance, Input, InputNumber, Modal } from
 import MyPopconfirm from '@/components/MyPopconfirm'
 import TextArea from 'antd/es/input/TextArea'
 import Z3upFiles from '@/components/Z3upFiles'
-import { B1X_APIgetInfo, B1X_APIsave } from '@/store/action/B1collect'
+import { B1X_APIsave } from '@/store/action/B1collect'
 import { MessageFu } from '@/utils/message'
 import { cascaderObjFu } from '@/utils/history'
 import ZupTypes from '@/components/ZupTypes'
 import { B1Xtype } from '../../data'
 import { cascaderChArr } from '@/pages/C_goodsManage/C1register/AddGoods'
+import { API_C2getListByIds } from '@/store/action/C2files'
 
 type Props = {
-  sId: number
+  info: B1Xtype
   closeFu: () => void
   succFu: (val: B1Xtype, txt: '新增' | '编辑') => void
   look?: boolean
 }
 
-function B1MoAdd({ sId, closeFu, succFu, look = false }: Props) {
+function B1MoAdd({ info, closeFu, succFu, look = false }: Props) {
   const [file, setFile] = useState([])
 
-  const getInfoFu = useCallback(async (id: number) => {
-    const res = await B1X_APIgetInfo(id)
-    if (res.code === 0) {
-      const obj: any = { ...res.data }
-      cascaderChArr.forEach(v => {
-        if (obj[v]) obj[v] = obj[v].split(',')
-      })
-      FormBoxRef.current?.setFieldsValue({
-        ...obj
-      })
-
+  const getInfoFu = useCallback(async () => {
+    // const res = await B1X_APIgetInfo(id)
+    // if (res.code === 0) {
+    //   const obj: any = { ...res.data }
+    //   cascaderChArr.forEach(v => {
+    //     if (obj[v]) obj[v] = obj[v].split(',')
+    //   })
+    //   FormBoxRef.current?.setFieldsValue({
+    //     ...obj
+    //   })
+    //   // 设置附件
+    //   setFile(obj.file || [])
+    //   // 设置图片
+    //   imgRef.current?.setFileComFileFu({
+    //     type: 'img',
+    //     fileList: obj.img || []
+    //   })
+    // }
+
+    const obj: any = { ...info }
+
+    cascaderChArr.forEach(v => {
+      if (obj[v]) obj[v] = obj[v].split(',')
+    })
+    FormBoxRef.current?.setFieldsValue(obj)
+
+    if (info.fileIds) {
       // 设置附件
-      setFile(obj.file || [])
+      const res = await API_C2getListByIds(info.fileIds.split(','))
+      if (res.code === 0) {
+        setFile(res.data || [])
+      }
+    }
 
+    if (info.imgIds) {
       // 设置图片
-      imgRef.current?.setFileComFileFu({
-        type: 'img',
-        fileList: obj.img || []
-      })
+      const res = await API_C2getListByIds(info.imgIds.split(','))
+      if (res.code === 0) {
+        imgRef.current?.setFileComFileFu({
+          type: 'img',
+          fileList: res.data || []
+        })
+      }
     }
-  }, [])
+  }, [info])
 
   useEffect(() => {
-    if (sId > 0) getInfoFu(sId)
-  }, [getInfoFu, sId])
+    if (info.id > 0) getInfoFu()
+  }, [getInfoFu, info.id])
 
   // 设置表单初始数据(区分编辑和新增)
   const FormBoxRef = useRef<FormInstance>(null)
@@ -67,7 +92,7 @@ function B1MoAdd({ sId, closeFu, succFu, look = false }: Props) {
       const obj = {
         ...values,
         fileIds: filesRes.join(','),
-        id: sId > 0 ? sId : null,
+        id: info.id > 0 ? info.id : null,
         imgIds: sonFileIds.join(','),
         thumb: coverUrl,
         thumbPc: coverPcUrl
@@ -90,12 +115,12 @@ function B1MoAdd({ sId, closeFu, succFu, look = false }: Props) {
       const res = await B1X_APIsave(obj)
 
       if (res.code === 0) {
-        MessageFu.success(sId > 0 ? '编辑成功' : '新增成功')
-        succFu(res.data, sId > 0 ? '编辑' : '新增')
+        MessageFu.success(info.id > 0 ? '编辑成功' : '新增成功')
+        succFu(res.data, info.id > 0 ? '编辑' : '新增')
         closeFu()
       }
     },
-    [closeFu, sId, succFu]
+    [closeFu, info.id, succFu]
   )
 
   // 上传附件的ref
@@ -109,7 +134,7 @@ function B1MoAdd({ sId, closeFu, succFu, look = false }: Props) {
       wrapClassName={styles.B1MoAdd}
       destroyOnClose
       open={true}
-      title={look ? '查看' : sId > 0 ? '编辑' : '新增'}
+      title={look ? '查看' : info.id > 0 ? '编辑' : '新增'}
       footer={
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
@@ -272,14 +297,13 @@ function B1MoAdd({ sId, closeFu, succFu, look = false }: Props) {
               <div className='B1Mrowll'>附件:</div>
               <div className='B1Mrowrr'>
                 <Z3upFiles
-                  max={10}
+                  max={10000}
                   isLook={look}
                   ref={filesRef}
                   fileCheck={false}
                   dirCode='B1collectSon'
                   myUrl='cms/goods/upload'
                   lookData={file}
-                  size={500}
                 />
               </div>
             </div>

+ 31 - 0
src/pages/B_enterTibet/B1collect/B1edit/B1upXLSX/index.module.scss

@@ -0,0 +1,31 @@
+.B1upXLSX {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+    .ant-modal {
+      width: 1000px !important;
+    }
+    .B1XLmain {
+      border-top: 1px solid #999999;
+      padding-top: 15px;
+      width: 100%;
+      .B1XLtop {
+        margin-bottom: 15px;
+        .ant-btn {
+          margin-right: 15px;
+        }
+      }
+
+      .ant-table-cell {
+        padding: 8px !important;
+        text-align: center !important;
+      }
+
+      .B1XLbtn {
+        margin-top: 20px;
+        text-align: center;
+      }
+    }
+  }
+}

+ 166 - 0
src/pages/B_enterTibet/B1collect/B1edit/B1upXLSX/index.tsx

@@ -0,0 +1,166 @@
+import React, { useCallback, useRef, useState } from 'react'
+import { Button, Modal } from 'antd'
+import { MessageFu } from '@/utils/message'
+import { API_upFile } from '@/store/action/layout'
+import { fileDomInitialFu } from '@/utils/domShow'
+import styles from './index.module.scss'
+import { TypeinfoXLSX } from '../../type'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { B1Xtype } from '../../data'
+import MyTable from '@/components/MyTable'
+import { B1TableC2up } from '@/utils/tableData'
+import { B1X_APIadds } from '@/store/action/B1collect'
+// 删掉前面2个
+const arrTemp = ['dictAge', 'dictAgeFirst', 'dictType', 'source']
+
+type Props = {
+  closeFu: () => void
+  infoXLSX: TypeinfoXLSX
+  upSuccFu: (succArr: B1Xtype[], errArr: B1Xtype[]) => void
+  clickSuccFu: (arr: B1Xtype[]) => void
+}
+
+function B1upXLSX({ closeFu, infoXLSX, clickSuccFu, upSuccFu }: Props) {
+  // 上传表格数据
+  const upBiaoGeRef = useRef<HTMLInputElement>(null)
+
+  // 上传表格处理函数
+  const upBiaoGeFu = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (e.target.files) {
+        // 拿到files信息
+        const filesInfo = e.target.files[0]
+
+        // 校验格式
+        if (!filesInfo.name.includes('.xlsx')) {
+          e.target.value = ''
+          return MessageFu.warning(`只支持xlsx格式!`)
+        }
+
+        // 创建FormData对象
+        const fd = new FormData()
+
+        fd.append('file', filesInfo)
+        fd.append('type', 'doc')
+        fd.append('dirCode', 'B1collectXLSX')
+        fd.append('isDb', 'true')
+
+        e.target.value = ''
+
+        try {
+          const res = await API_upFile(fd, 'cms/orderCollect/uploadZj')
+
+          if (res.code === 0) {
+            MessageFu.success('上传成功!')
+            const arrAll: any[] = res.data || []
+            const succArr: B1Xtype[] = []
+            const errArr: B1Xtype[] = []
+
+            arrAll.forEach((v, i) => {
+              arrTemp.forEach(c => {
+                if (v[c] && v[c] !== '-1') {
+                  let tttt: string[] = v[c].split(',')
+                  v[c] = tttt.slice(3).join(',')
+                }
+              })
+
+              if (v.isTrue === 1) succArr.push(v)
+              else errArr.push(v)
+            })
+            upSuccFu(succArr, errArr)
+          }
+          fileDomInitialFu()
+        } catch (error) {
+          console.error(error)
+
+          fileDomInitialFu()
+        }
+      }
+    },
+    [upSuccFu]
+  )
+
+  const [btnAc, setBtnAc] = useState('成功')
+
+  // 点击导入当前数据
+  const btnOk = useCallback(async () => {
+    const res = await B1X_APIadds(
+      infoXLSX.succ.map(v => ({
+        ...v,
+        id: null
+      }))
+    )
+    if (res.code === 0) {
+      MessageFu.success('导入成功')
+      clickSuccFu(res.data)
+      closeFu()
+    }
+  }, [clickSuccFu, closeFu, infoXLSX.succ])
+
+  return (
+    <>
+      <Button onClick={() => upBiaoGeRef.current?.click()}>上传表格数据</Button>
+      <input
+        id='upInput'
+        type='file'
+        accept='.xlsx'
+        ref={upBiaoGeRef}
+        onChange={e => upBiaoGeFu(e)}
+      />
+      {infoXLSX.show ? (
+        <Modal
+          wrapClassName={styles.B1upXLSX}
+          destroyOnClose
+          open={true}
+          title={
+            <>
+              导入数据条数:{infoXLSX.succ.length + infoXLSX.err.length}&emsp;&emsp;校验成功条数:
+              {infoXLSX.succ.length}&emsp;&emsp;校验失败条数:{infoXLSX.err.length}
+            </>
+          }
+          footer={[]}
+        >
+          <div className='B1XLmain'>
+            <div className='B1XLtop'>
+              {['成功', '失败'].map(v => (
+                <Button
+                  key={v}
+                  type={v === btnAc ? 'primary' : 'default'}
+                  onClick={() => setBtnAc(v)}
+                >
+                  {v} {v === '成功' ? infoXLSX.succ.length : infoXLSX.err.length}
+                </Button>
+              ))}
+            </div>
+
+            <MyTable
+              rowKey='row'
+              classKey='B1upXLSX'
+              yHeight={500}
+              list={btnAc === '成功' ? infoXLSX.succ : infoXLSX.err}
+              columnsTemp={B1TableC2up(btnAc)}
+              lastBtn={[]}
+              pagingInfo={false}
+            />
+
+            <div className='B1XLbtn'>
+              <Button type='primary' onClick={() => upBiaoGeRef.current?.click()}>
+                重新上传表格
+              </Button>
+              &emsp;
+              <Button type='primary' disabled={infoXLSX.succ.length === 0} onClick={btnOk}>
+                导入当前数据
+              </Button>
+              &emsp;
+              <MyPopconfirm txtK='取消' onConfirm={closeFu} Dom={<Button>取消导入</Button>} />
+            </div>
+          </div>
+        </Modal>
+      ) : null}
+    </>
+  )
+}
+
+const MemoB1upXLSX = React.memo(B1upXLSX)
+
+export default MemoB1upXLSX

+ 31 - 12
src/pages/B_enterTibet/B1collect/B1edit/index.tsx

@@ -25,7 +25,8 @@ import X3auditInfo from '@/pages/X_stock/X3auditInfo'
 import B1MoAdd from './B1MoAdd'
 import { B1Xtype } from '../data'
 import ZupFileTable from '@/components/ZupFileTable'
-import { FourTableType } from '../type'
+import { FourTableType, TypeinfoXLSX } from '../type'
+import B1upXLSX from './B1upXLSX'
 
 function B1edit() {
   const { key, id } = useParams<any>()
@@ -35,7 +36,7 @@ function B1edit() {
   const sollrDom = useRef<HTMLDivElement>(null)
 
   // -------新增藏品-------------
-  const [openId, setOpenId] = useState(0)
+  const [addInfo, setAddInfo] = useState({} as B1Xtype)
 
   const [clueArr, setClueArr] = useState<B1Xtype[]>([])
 
@@ -43,14 +44,14 @@ function B1edit() {
     return [
       {
         title: '附件数量',
-        render: (item: any) => (item.fileIds ? item.fileIds.split(',').length : 0)
+        render: (item: B1Xtype) => (item.fileIds ? item.fileIds.split(',').length : 0)
       },
       {
         title: '操作',
-        render: (item: any) => {
+        render: (item: B1Xtype) => {
           return (
             <>
-              <Button size='small' type='text' onClick={() => setOpenId(item.id)}>
+              <Button size='small' type='text' onClick={() => setAddInfo(item)}>
                 {['3', '4'].includes(key) ? '查看' : '编辑'}
               </Button>
               {['3', '4'].includes(key) ? null : (
@@ -277,6 +278,13 @@ function B1edit() {
   // 申请记录
   const [auditsShow, setAuditsShow] = useState(false)
 
+  // 上传表格数据
+  const [infoXLSX, setInfoXLSX] = useState<TypeinfoXLSX>({
+    show: false,
+    succ: [],
+    err: []
+  })
+
   return (
     <div className={styles.B1edit}>
       <div className='pageTitle'>藏品征集-{Reflect.get(pageTitTxtObj, key)}</div>
@@ -346,10 +354,21 @@ function B1edit() {
             <div className='B1Tit2rr'>
               {['3', '4'].includes(key) ? null : (
                 <>
-                  <Button type='primary' onClick={() => MessageFu.warning('待完善')}>
-                    批量导入
-                  </Button>
-                  <Button type='primary' onClick={() => setOpenId(-1)}>
+                  <a
+                    href={`/baseData/ZJ_TEMP.xlsx`}
+                    download='藏品征集模板'
+                    target='_blank'
+                    rel='noreferrer'
+                  >
+                    <Button>下载模板</Button>
+                  </a>
+                  <B1upXLSX
+                    closeFu={() => setInfoXLSX({ show: false, succ: [], err: [] })}
+                    infoXLSX={infoXLSX}
+                    upSuccFu={(succ, err) => setInfoXLSX({ show: true, succ, err })}
+                    clickSuccFu={arr => setClueArr([...arr, ...clueArr])}
+                  />
+                  <Button type='primary' onClick={() => setAddInfo({ id: -1 } as B1Xtype)}>
                     新增
                   </Button>
                 </>
@@ -419,11 +438,11 @@ function B1edit() {
       </div>
 
       {/* 新增弹窗 */}
-      {openId ? (
+      {addInfo.id ? (
         <B1MoAdd
           look={['3', '4'].includes(key)}
-          sId={openId}
-          closeFu={() => setOpenId(0)}
+          info={addInfo}
+          closeFu={() => setAddInfo({} as B1Xtype)}
           succFu={(obj, txt) => {
             if (txt === '新增') setClueArr([obj, ...clueArr])
             else {

+ 5 - 0
src/pages/B_enterTibet/B1collect/data.ts

@@ -36,6 +36,7 @@ export type B1Xtype = {
   creatorName: string
   file: []
   fileIds: string
+  imgIds: string
   id: number
   linkman: string
   name: string
@@ -44,6 +45,10 @@ export type B1Xtype = {
   type: string
   updateTime: string
   img: []
+
+  // 导入
+  row: number
+  error: string[]
 }
 
 export const B3aForm1 = [

+ 7 - 0
src/pages/B_enterTibet/B1collect/type.d.ts

@@ -112,3 +112,10 @@ export type FourTableType = {
   // 移库
   storageOutId: number | null
 }
+
+// 上传表格数据
+export type TypeinfoXLSX = {
+  show: boolean
+  succ: B1Xtype[]
+  err: B1Xtype[]
+}

+ 1 - 2
src/pages/C_goodsManage/C1register/AddGoods/index.tsx

@@ -935,14 +935,13 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
                 <span>附件类型为图像并且格式为图片的第一份数据为封面图</span>
               </div>
               <Z3upFiles
-                max={1000}
+                max={10000}
                 isLook={false}
                 ref={filesRef}
                 fileCheck={false}
                 dirCode='goodsAdd'
                 myUrl='cms/goods/upload'
                 lookData={[]}
-                size={500}
                 noShowList={true}
                 fileRes={obj => setTable([...table, obj])}
               />

+ 1 - 2
src/pages/E_goodsStorage/E1accident/E1edit/index.tsx

@@ -497,14 +497,13 @@ function E1edit() {
             <div className='E1rowll'>附件:</div>
             <div className='E1rowrr'>
               <Z3upFiles
-                max={10}
+                max={10000}
                 isLook={['3', '4'].includes(key)}
                 ref={filesRef}
                 fileCheck={false}
                 dirCode='E1accident'
                 myUrl='cms/orderPreserveAccident/upload'
                 lookData={topInfo.files || []}
-                size={500}
                 fromData={{ moduleId: topInfo.id }}
               />
             </div>

+ 1 - 2
src/pages/E_goodsStorage/E3actuality/E3edit/index.tsx

@@ -475,14 +475,13 @@ function E3edit() {
             <div className='E3rowll'>附件:</div>
             <div className='E3rowrr'>
               <Z3upFiles
-                max={10}
+                max={10000}
                 isLook={['3', '4'].includes(key)}
                 ref={filesRef}
                 fileCheck={false}
                 dirCode='E3actuality'
                 myUrl='cms/orderPreserveCurrent/upload'
                 lookData={topInfo.files || []}
-                size={500}
                 fromData={{ moduleId: topInfo.id }}
               />
             </div>

+ 1 - 2
src/pages/E_goodsStorage/E4repair/E4edit/index.tsx

@@ -513,14 +513,13 @@ function E4edit() {
             <div className='E4rowll'>附件:</div>
             <div className='E4rowrr'>
               <Z3upFiles
-                max={10}
+                max={10000}
                 isLook={['3', '4'].includes(key)}
                 ref={filesRef}
                 fileCheck={false}
                 dirCode='E4repair'
                 myUrl='cms/orderPreserveFix/upload'
                 lookData={topInfo.files || []}
-                size={500}
                 fromData={{ moduleId: topInfo.id }}
               />
             </div>

+ 34 - 3
src/pages/Z_system/Z1dict/index.tsx

@@ -11,6 +11,27 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import { MessageFu } from '@/utils/message'
 import { filterTreeByName } from '@/utils/history'
 
+// 不可编辑的id集合
+const noIdArr = [
+  '12592',
+  '12593',
+  '12594',
+  '12595',
+  '12596',
+  '12597',
+  '12561',
+  '12635',
+  '12535',
+  '12568',
+  '12569',
+  '12572',
+  '12573',
+  '12574',
+  '12577',
+  '12545',
+  '12500'
+]
+
 function Z1dict() {
   const [loding, setLoding] = useState(false)
 
@@ -239,13 +260,23 @@ function Z1dict() {
         <div className='Z1m1rr'>
           {rightData.id ? (
             <>
-              <div className='Z1mr1'>操作</div>
+              <div className='Z1mr1'>
+                操作{noIdArr.includes(rightData.id) ? '(不可编辑)' : ''}
+              </div>
               <div className='Z1mr2'>
-                <Button type='text' onClick={() => addSonFu(rightData.id)}>
+                <Button
+                  type='text'
+                  onClick={() => addSonFu(rightData.id)}
+                  disabled={noIdArr.includes(rightData.id)}
+                >
                   编辑
                 </Button>
                 &emsp;
-                <MyPopconfirm txtK='删除' onConfirm={() => delTree(rightData.id)} />
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() => delTree(rightData.id)}
+                  disabled={noIdArr.includes(rightData.id)}
+                />
               </div>
 
               {/* <div className='Z1mr3'>

+ 7 - 0
src/store/action/B1collect.ts

@@ -90,3 +90,10 @@ export const B1X_APIsave = (data: any) => {
 export const B1X_APIgetInfo = (id: number) => {
   return http.get(`cms/orderCollect/collect/detail/${id}`)
 }
+
+/**
+ * 藏品征集-批量导入-批量新增藏品
+ */
+export const B1X_APIadds = (data: any) => {
+  return http.post('cms/orderCollect/collect/batch/add', data)
+}

+ 1 - 1
src/utils/http.ts

@@ -5,7 +5,7 @@ import store from '@/store'
 import { MessageFu } from './message'
 import { domShowFu } from './domShow'
 
-const envFlag = process.env.NODE_ENV === 'development'
+export const envFlag = process.env.NODE_ENV === 'development'
 
 // const baseUrlTemp = 'https://sit-yiwubwg.4dage.com' // 测试环境
 const baseUrlTemp = 'http://192.168.20.61:8096' // 线下环境

+ 12 - 0
src/utils/tableData.ts

@@ -92,6 +92,18 @@ export const B1TableC2 = [
   ['txtC', '征集方式', 'source']
 ]
 
+// 藏品征集表格导入
+export const B1TableC2up = (val: string) => {
+  let arr: any = [
+    ['txt', '数据行数', 'row'],
+    ['txt', '藏品名称', 'name']
+  ]
+  if (val === '失败') {
+    arr.push(['txtArr', '失败原因', 'error'])
+  }
+  return arr
+}
+
 // 藏品鉴定里面的藏品清单
 export const B2TableC2 = [
   ['txt', '登记号类型', 'numName'],