shaogen1995 2 месяцев назад
Родитель
Сommit
9b5daf24bb

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

@@ -410,7 +410,7 @@ function Z3upFilesRef(
           <>
             <Button
               onClick={() => myInput.current?.click()}
-              icon={<UploadOutlined />}
+              icon={<UploadOutlined rev={undefined} />}
               type='primary'
             >
               上传附件

+ 21 - 0
src/pages/Bresource/B1overview/B1import/index.module.scss

@@ -0,0 +1,21 @@
+.B1import {
+  padding: 15px;
+  :global {
+    .B1Itop {
+      display: flex;
+      font-size: 14px;
+      margin-bottom: 15px;
+    }
+
+    .B1IrightTop {
+      position: absolute;
+      right: 15px;
+      top: 10px;
+      height: 31px;
+      width: 1200px;
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  }
+}

+ 74 - 0
src/pages/Bresource/B1overview/B1import/index.tsx

@@ -0,0 +1,74 @@
+import React, { useEffect, useMemo, useState } from 'react'
+import styles from './index.module.scss'
+import { Button } from 'antd'
+import { backPageFu } from '@/utils/history'
+import { antdSelectType } from '@/utils/dataChange'
+import { getKuListByOpenFu } from '@/pages/Zother/data'
+import { useParams } from 'react-router-dom'
+import { MessageFu } from '@/utils/message'
+import B1tab1 from '../B1tab1'
+
+const tabArr = ['导入资源数据', '导入封面', '导入附件']
+
+function B1import() {
+  const { fId } = useParams<any>()
+
+  const [kuList, setKuList] = useState<antdSelectType[]>([])
+
+  const [loding, setLoding] = useState(false)
+
+  const [kuTxt, setkuTxt] = useState('')
+
+  const closeFlag = useMemo(() => {
+    return kuTxt.includes('关闭状态')
+  }, [kuTxt])
+
+  useEffect(() => {
+    if (closeFlag) MessageFu.warning('该表为 关闭状态 无法编辑数据')
+  }, [closeFlag])
+
+  useEffect(() => {
+    getKuListByOpenFu(data => {
+      setLoding(true)
+      if (data && data.length) {
+        setKuList(data)
+        const obj = data.find(v => v.value === Number(fId))
+        if (obj) setkuTxt(obj.label)
+      }
+    })
+  }, [fId])
+
+  const [tabAc, setTabAc] = useState('导入资源数据')
+
+  return (
+    <div className={styles.B1import}>
+      <div className='pageTitle'>资源总览-数据导入 资源库:{kuTxt}</div>
+
+      {loding && kuList.length === 0 ? (
+        <div className='Z0null'>资源库数据异常 或 资源库状态被停用</div>
+      ) : (
+        <>
+          <div className='B1Itop'>
+            <Button onClick={() => backPageFu('overview')}>返回</Button>&emsp;
+            {tabArr.map(v => (
+              <Button
+                onClick={() => setTabAc(v)}
+                type={tabAc === v ? 'primary' : 'default'}
+                key={v}
+              >
+                {v}
+              </Button>
+            ))}
+          </div>
+          {tabAc === '导入资源数据' ? (
+            <B1tab1 fId={fId} kuList={kuList} isLook={closeFlag} />
+          ) : null}
+        </>
+      )}
+    </div>
+  )
+}
+
+const MemoB1import = React.memo(B1import)
+
+export default MemoB1import

+ 40 - 0
src/pages/Bresource/B1overview/B1res/index.module.scss

@@ -0,0 +1,40 @@
+.B1res {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+    .ant-modal {
+      width: 1400px !important;
+    }
+
+    .B1Rtit {
+      display: flex;
+      align-items: center;
+      font-weight: 400;
+    }
+
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+
+      .ant-table-cell {
+        padding: 8px !important;
+      }
+
+      .B1Rtop {
+        display: flex;
+        margin: 10px 0;
+        .ant-btn {
+          margin-left: 15px;
+        }
+      }
+
+      .B1Rbtn {
+        margin-top: 30px;
+        text-align: center;
+        .ant-btn {
+          margin: 0 10px;
+        }
+      }
+    }
+  }
+}

+ 211 - 0
src/pages/Bresource/B1overview/B1res/index.tsx

@@ -0,0 +1,211 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, Input, Modal, Select } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import MyTable from '@/components/MyTable'
+import { MessageFu } from '@/utils/message'
+
+type Props = {
+  upFile: any
+  fId: number
+  closeFu: () => void
+  anewFu: () => void
+  succApi: any
+  succFu: () => void
+  type: 'excel' | 'zip' | 'thumb'
+  tableArr: { name: string; key: string }[]
+}
+
+function B1res({ upFile, closeFu, anewFu, succApi, succFu, fId, type, tableArr }: Props) {
+  const isLook = useMemo(() => {
+    let flag = false
+    if (upFile.myType === '查看') flag = true
+    return flag
+  }, [upFile.myType])
+
+  // 点击导入
+  const succBtn = useCallback(async () => {
+    const obj = {
+      ...upFile,
+      formDefId: fId,
+      type,
+      formData: upFile.formData.filter((v: any) => v.isTrue === 1)
+    }
+    const res = await succApi(obj)
+
+    if (res.code === 0) {
+      MessageFu.success('导入成功')
+      closeFu()
+      succFu()
+    }
+  }, [closeFu, fId, succApi, succFu, type, upFile])
+
+  const tableLastBtn = useMemo(() => {
+    const arr = []
+    if (type === 'excel') {
+      arr.push({
+        width: 80,
+        title: '行数',
+        render: (item: any) => item.rowNum
+      })
+    }
+
+    tableArr.forEach(v => {
+      arr.push({
+        title: v.name,
+        render: (item: any) => item[v.key] || '(空)'
+      })
+    })
+
+    arr.push({
+      width: 80,
+      title: '校验结果',
+      render: (item: any) => (item.isTrue === 1 ? '成功' : '失败')
+    })
+
+    arr.push({
+      title: '失败原因',
+      width: 700,
+      render: (item: any) => {
+        let txt: string[] = []
+        const arr: string[] = item.errors || []
+        arr.forEach(v => {
+          txt.push(v)
+        })
+        return txt.length ? (
+          <div
+            style={{ textAlign: 'left' }}
+            dangerouslySetInnerHTML={{ __html: txt.join('<br/>') }}
+          ></div>
+        ) : (
+          '-'
+        )
+      }
+    })
+
+    return arr
+  }, [tableArr, type])
+
+  const [formData, setFormData] = useState({ txt: '', res: '' })
+
+  const formDataRef = useRef<any>({ txt: '', res: '' })
+
+  useEffect(() => {
+    formDataRef.current = { ...formData }
+  }, [formData])
+
+  const [time, setTime] = useState(1)
+
+  const list = useMemo(() => {
+    if (time) {
+      const arr = [...(upFile.formData || [])]
+      let arrRes: any[] = []
+      arr.forEach(v1 => {
+        if (formDataRef.current.txt) {
+          tableArr.forEach(v2 => {
+            if (v1[v2.key] && v1[v2.key].includes(formDataRef.current.txt)) {
+              if (!arrRes.map(c => c.rowNum).includes(v1.rowNum)) arrRes.push(v1)
+            }
+          })
+        } else arrRes.push(v1)
+      })
+
+      if (formDataRef.current.res || formDataRef.current.res === 0) {
+        arrRes = arrRes.filter(v => v.isTrue === formDataRef.current.res)
+      }
+
+      return arrRes
+    }
+  }, [tableArr, upFile.formData, time])
+
+  // 点击重置
+  const chongZhiFu = useCallback(() => {
+    setFormData({ txt: '', res: '' })
+    setTimeout(() => {
+      setTime(1)
+    }, 100)
+  }, [])
+
+  // 重新上传之后清理查询参数
+  useEffect(() => {
+    chongZhiFu()
+  }, [upFile, chongZhiFu])
+
+  return (
+    <Modal
+      getContainer={() => document.querySelector('#root')!}
+      wrapClassName={styles.B1res}
+      open={true}
+      title={
+        <div className='B1Rtit'>
+          <h2>{upFile.fileName}</h2>&emsp;
+          <p>导入数据条数:{upFile.pcsTotal || 0}</p>&emsp;
+          <p>校验成功条数:{upFile.pcsSuccess || 0}</p>&emsp;
+          <p>校验失败条数:{upFile.pcsError || 0}</p>
+        </div>
+      }
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='B1Rmain'>
+        <div className='B1Rtop'>
+          <Input
+            allowClear
+            value={formData.txt}
+            onChange={e => setFormData({ ...formData, txt: e.target.value.trim() })}
+            style={{ width: 300 }}
+            placeholder={`请输入${tableArr.map(v => v.name).join('/')}`}
+            maxLength={30}
+            showCount
+          />
+          <Select
+            allowClear
+            style={{ width: 150 }}
+            value={formData.res === '' ? null : formData.res}
+            onChange={e => setFormData({ ...formData, res: e })}
+            placeholder='校验结果'
+            options={[
+              { value: 1, label: '成功' },
+              { value: 0, label: '失败' }
+            ]}
+          />
+          <Button type='primary' onClick={() => setTime(Date.now())}>
+            查询
+          </Button>
+          <Button onClick={chongZhiFu}>重置</Button>
+        </div>
+
+        <MyTable
+          rowKey='rowNum'
+          yHeight={550}
+          classKey='B1res'
+          list={list}
+          columnsTemp={[]}
+          lastBtn={tableLastBtn}
+          pagingInfo={false}
+        />
+      </div>
+
+      <div className='B1Rbtn'>
+        {isLook ? (
+          <Button onClick={closeFu}>关闭</Button>
+        ) : (
+          <>
+            <Button type='primary' onClick={anewFu}>
+              重新上传表格
+            </Button>
+            <Button type='primary' onClick={succBtn}>
+              导入校验成功的数据
+            </Button>
+            <MyPopconfirm txtK='取消' onConfirm={closeFu} Dom={<Button>取消导入</Button>} />
+          </>
+        )}
+      </div>
+    </Modal>
+  )
+}
+
+const MemoB1res = React.memo(B1res)
+
+export default MemoB1res

+ 28 - 0
src/pages/Bresource/B1overview/B1tab1/index.module.scss

@@ -0,0 +1,28 @@
+.B1tab1 {
+  :global {
+    .B1IrightTop {
+      & > i {
+        cursor: pointer;
+        text-decoration: underline;
+      }
+    }
+  }
+}
+
+.B1t1M {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+    }
+    .B1t1MRow {
+      margin-top: 30px;
+    }
+    .B1t1MBtn {
+      margin-top: 30px;
+      text-align: center;
+    }
+  }
+}

+ 214 - 0
src/pages/Bresource/B1overview/B1tab1/index.tsx

@@ -0,0 +1,214 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { QuestionCircleOutlined } from '@ant-design/icons'
+import { Button, Modal } from 'antd'
+import {
+  APIdelImExcel,
+  APIdownXlsx,
+  APIimExcel,
+  APIlookImExcel,
+  APIsuccExcel
+} from '@/store/action/Bresource/B1overview'
+import { antdSelectType } from '@/utils/dataChange'
+import { downloadFileByUrl } from '@/utils'
+import { MessageFu } from '@/utils/message'
+import { B1handeUpFu } from '../data'
+import MyTable from '@/components/MyTable'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import B1res from '../B1res'
+
+type Props = {
+  fId: number
+  kuList: antdSelectType[]
+  isLook: boolean
+}
+
+function B1tab1({ fId, kuList, isLook }: Props) {
+  // 点击下载模版
+  const downXlsxFu = useCallback(async () => {
+    if (fId) {
+      const res = await APIdownXlsx(fId)
+      if (res.code === 0) {
+        let fileName: any = undefined
+        const obj = kuList.find(v => v.value === fId)
+        if (obj) fileName = obj.label
+        downloadFileByUrl(res.data, fileName)
+      }
+    } else MessageFu.warning('资源库表ID错误')
+  }, [fId, kuList])
+
+  const [formData, setFormData] = useState({ pageNum: 1, pageSize: 10 })
+
+  const [tableInfo, setTableInfo] = useState<any>({ list: [], total: 0 })
+
+  const getList = useCallback(async () => {
+    const res = await APIimExcel(formData, fId)
+    if (res.code === 0) {
+      setTableInfo({ list: res.data.records || [], total: res.data.total })
+    }
+  }, [fId, formData])
+
+  useEffect(() => {
+    getList()
+  }, [getList])
+
+  const myInput = useRef<HTMLInputElement>(null)
+
+  // 导入规则
+  const [show, setShow] = useState(false)
+
+  const [upFile, setUpFile] = useState<any>({})
+
+  // 上传单个xlsx
+  const handeUpPhoto = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      B1handeUpFu(e, fId, 10, 'xlsx', 'cms/importExcel/uploadExcel', info => {
+        setUpFile({ ...info, myType: '编辑' })
+      })
+    },
+    [fId]
+  )
+
+  // 页码变化
+  const paginationChange = useCallback(
+    (pageNum: number, pageSize: number) => {
+      setFormData({ ...formData, pageNum, pageSize })
+    },
+    [formData]
+  )
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res: any = await APIdelImExcel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功!')
+        getList()
+      }
+    },
+    [getList]
+  )
+
+  // 点击查看
+  const lookFu = useCallback(
+    async (id: number) => {
+      const res = await APIlookImExcel(id, fId)
+      if (res.code === 0) {
+        // 待完善
+        console.log('-------', res)
+      }
+    },
+    [fId]
+  )
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: any) => (
+          <>
+            <Button size='small' type='text' onClick={() => lookFu(item.id)}>
+              查看
+            </Button>
+            {isLook ? null : (
+              <MyPopconfirm
+                txtK='删除'
+                onConfirm={() => delTableFu(item.id)}
+                Dom={
+                  <Button danger disabled={isLook} size='small' type='text'>
+                    删除记录
+                  </Button>
+                }
+              />
+            )}
+          </>
+        )
+      }
+    ]
+  }, [delTableFu, isLook, lookFu])
+
+  return (
+    <div className={styles.B1tab1}>
+      <input
+        id='upInput'
+        type='file'
+        ref={myInput}
+        onChange={handeUpPhoto}
+        multiple
+        accept='.xlsx'
+        style={{ display: 'none' }}
+      />
+
+      <div className='B1IrightTop'>
+        <span>仅支持xlsx格式,文件不得大于10M,单次最多上传100条</span>&emsp;
+        <i onClick={() => setShow(true)}>
+          关于导入规则 <QuestionCircleOutlined rev={undefined} />
+        </i>
+        &emsp;
+        <Button onClick={downXlsxFu}>下载模版</Button>&emsp;
+        <Button disabled={isLook} type='primary' onClick={() => myInput.current?.click()}>
+          上传资源数据
+        </Button>
+      </div>
+
+      <MyTable
+        yHeight={660}
+        classKey='B1tab1'
+        list={tableInfo.list}
+        columnsTemp={[
+          ['txt', '文件名称', 'fileName'],
+          ['txt', '导入数据', 'pcsTotal'],
+          ['txt', '成功数据', 'pcsSuccess'],
+          ['txt', '失败数据', 'pcsError'],
+          ['txt', '导入日期', 'updateTime'],
+          ['txt', '导入用户', 'creatorName']
+        ]}
+        lastBtn={tableLastBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
+
+      {show ? (
+        <Modal
+          getContainer={() => document.querySelector('#root')!}
+          wrapClassName={styles.B1t1M}
+          open={true}
+          title='导入规则'
+          footer={
+            [] // 设置footer为空,去掉 取消 确定默认按钮
+          }
+        >
+          <div className='B1t1MRow'>1:下载模板</div>
+          <div className='B1t1MRow'>2:在模板中填入内容,注意必填项</div>
+          <div className='B1t1MRow'>3:上传已填写的模板文件</div>
+          <div className='B1t1MBtn'>
+            <Button onClick={() => setShow(false)}>关闭</Button>
+          </div>
+        </Modal>
+      ) : null}
+
+      {/* 上传成功之后 */}
+      {upFile.myType ? (
+        <B1res
+          upFile={upFile}
+          fId={Number(fId)}
+          closeFu={() => setUpFile({})}
+          anewFu={() => myInput.current?.click()}
+          succApi={APIsuccExcel}
+          type='excel'
+          tableArr={[
+            { name: '资源名称', key: 'name' },
+            { name: '责任者', key: 'create_by' }
+          ]}
+          succFu={getList}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoB1tab1 = React.memo(B1tab1)
+
+export default MemoB1tab1

+ 46 - 0
src/pages/Bresource/B1overview/data.ts

@@ -1,2 +1,48 @@
+import { API_upFile } from '@/store/action/layout'
+import { fileDomInitialFu } from '@/utils/domShow'
+import { MessageFu } from '@/utils/message'
+
 // 顶部搜索需要过滤的字典
 export const B1searchFile = ['资源名称', '责任者', '资源编码']
+
+// 上传文件函数
+export const B1handeUpFu = async (
+  e: React.ChangeEvent<HTMLInputElement>,
+  fId: number,
+  size: number,
+  flagName: string,
+  url: string,
+  backFu: (info: any) => void
+) => {
+  if (e.target.files) {
+    // 拿到files信息
+    const filesInfo = e.target.files[0]
+    const lastName = filesInfo.name.toLocaleLowerCase()
+    if (!lastName.endsWith(`.${flagName}`)) {
+      e.target.value = ''
+      return MessageFu.warning(`只支持${flagName}格式!`)
+    }
+    // 校验大小
+    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('formDefId', fId + '')
+    fd.append('file', filesInfo)
+
+    e.target.value = ''
+    try {
+      const res = await API_upFile(fd, url)
+      if (res.code === 0) {
+        MessageFu.success('上传成功!')
+        backFu(res.data)
+      }
+      fileDomInitialFu()
+    } catch (error) {
+      fileDomInitialFu()
+    }
+  }
+}

+ 2 - 3
src/pages/Bresource/B1overview/index.module.scss

@@ -14,9 +14,8 @@
           .Z0ku1 {
             display: flex;
             margin-top: 10px;
-            .ant-btn {
-              margin-right: 10px;
-            }
+            justify-content: space-around;
+            padding-left: 24px;
           }
         }
 

+ 7 - 18
src/pages/Bresource/B1overview/index.tsx

@@ -5,7 +5,7 @@ import { useDispatch, useSelector } from 'react-redux'
 import { selectTopBase } from '@/pages/Zother/SelectGoods/data'
 import { getKuListByOpenFu } from '@/pages/Zother/data'
 import { ziyuanAcGet, ziyuanAcSet } from '@/utils/storage'
-import { APIdelTable, APIdownXlsx, B1_APIgetList } from '@/store/action/Bresource/B1overview'
+import { APIdelTable, B1_APIgetList } from '@/store/action/Bresource/B1overview'
 import { RootState } from '@/store'
 import { Button, Cascader, Input, Select, message } from 'antd'
 import { Z1_APIgetFormZiDuan } from '@/store/action/Zsystem/Z1sysSet'
@@ -14,9 +14,9 @@ import { treeOneIdByResFu } from '@/pages/Zother/Z1formSet/data'
 import { B1searchFile } from './data'
 import { MessageFu } from '@/utils/message'
 import Z0sonTable from '@/components/Z0sonTable'
-import { openLink } from '@/utils/history'
+import history, { openLink } from '@/utils/history'
 import MyPopconfirm from '@/components/MyPopconfirm'
-import { downloadFileByUrl, transformTableDataForExport, downloadExcel } from '@/utils'
+import { transformTableDataForExport, downloadExcel } from '@/utils'
 function B1overview() {
   const [kuList, setKuList] = useState<antdSelectType[]>([])
 
@@ -200,19 +200,6 @@ function B1overview() {
     ]
   }, [formData.formDefId, tableBtnFu])
 
-  // 点击下载模版
-  const downXlsxFu = useCallback(async () => {
-    if (formData.formDefId) {
-      const res = await APIdownXlsx(formData.formDefId)
-      if (res.code === 0) {
-        let fileName: any = undefined
-        const obj = kuList.find(v => v.value === formData.formDefId)
-        if (obj) fileName = obj.label
-        downloadFileByUrl(res.data, fileName)
-      }
-    } else MessageFu.warning('资源库表ID错误')
-  }, [formData.formDefId, kuList])
-
   // 点击数据导出
   const deriveFu = useCallback(async () => {
     if (!formZi.length) {
@@ -280,8 +267,10 @@ function B1overview() {
                 options={kuList}
               />
               <div className='Z0ku1'>
-                <Button onClick={downXlsxFu}>下载模版</Button>
-                <Button type='primary' onClick={() => MessageFu.warning('开发中')}>
+                <Button
+                  type='primary'
+                  onClick={() => history.push(`overview_edit/${formData.formDefId}`)}
+                >
                   数据导入
                 </Button>
                 <Button type='primary' onClick={deriveFu}>

+ 6 - 0
src/pages/Layout/data.ts

@@ -203,5 +203,11 @@ export const routerSon: RouterTypeRow[] = [
     name: '资源发布-详情页',
     path: '/resIssue_edit/:key/:id/:fId',
     Com: React.lazy(() => import('../Dissue/D1resIssue/D1edit'))
+  },
+  {
+    id: 210,
+    name: '资源总览-导入',
+    path: '/overview_edit/:fId',
+    Com: React.lazy(() => import('../Bresource/B1overview/B1import'))
   }
 ]

+ 1 - 1
src/pages/Zsystem/Z3ipSet/index.tsx

@@ -10,7 +10,7 @@ import MyTable from '@/components/MyTable'
 import Z3edit from './Z3edit'
 function Z3ipSet() {
   const dispatch = useDispatch()
-
+  // 待完善
   // 顶部筛选
   const [fromData, setFromData] = useState({
     pageNum: 1,

+ 55 - 1
src/store/action/Bresource/B1overview.ts

@@ -51,8 +51,62 @@ export const APIdelTable = (formDefId: number, id: number) => {
 }
 
 /**
- * 资源总览 -下载模版
+ * 资源总览-导入 -下载模版
  */
 export const APIdownXlsx = (formDefId: number) => {
   return http.get(`cms/importExcel/getTemplateByFormDefId/${formDefId}`)
 }
+
+/**
+ * 资源总览-导入 -列表
+ */
+export const APIimExcel = (data: any, fId: number) => {
+  const obj = {
+    ...data,
+    type: 'excel',
+    formDefId: Number(fId)
+  }
+  return http.post('cms/importExcel/pageList', obj)
+}
+
+export const APIimEZip = (data: any, type: 'zip' | 'thumb', fId: number) => {
+  const obj = {
+    ...data,
+    type,
+    formDefId: Number(fId)
+  }
+  return http.post('cms/importZip/pageList', obj)
+}
+
+/**
+ * 资源总览-导入 -删除记录
+ */
+export const APIdelImExcel = (id: number) => {
+  return http.get(`cms/importExcel/remove/${id}`)
+}
+
+export const APIdelImZip = (id: number) => {
+  return http.get(`cms/importZip/remove/${id}`)
+}
+
+/**
+ * 资源总览-导入 -查看
+ */
+export const APIlookImExcel = (id: number, formDefId: number) => {
+  return http.get(`cms/importExcel/detail/${id}/${formDefId}`)
+}
+
+export const APIlookImZip = (id: number) => {
+  return http.get(`cms/importZip/detail/${id}`)
+}
+
+/**
+ * 资源总览-导入 -导入校验成功的数据
+ */
+export const APIsuccExcel = (data: any) => {
+  return http.post('cms/importExcel/addData', data)
+}
+
+export const APIsuccZip = (data: any) => {
+  return http.post('cms/importZip/addData', data)
+}

+ 1 - 1
src/utils/http.ts

@@ -95,7 +95,7 @@ http.interceptors.response.use(
           err.response &&
           err.response.data &&
           err.response.data.msg &&
-          err.response.data.msg.length < 30
+          err.response.data.msg.length < 200
         ) {
           MessageFu.error(err.response.data.msg)
           // 没有权限