lanxin 2 днів тому
батько
коміт
d52b87473d

+ 0 - 3
src/pages/Abench/A4proof/A4edit/index.module.scss

@@ -1,3 +0,0 @@
-// .B1edit {
-//   // :global {}
-// }

+ 0 - 44
src/pages/Abench/A4proof/A4edit/index.tsx

@@ -1,44 +0,0 @@
-import React from 'react'
-import styles from './index.module.scss'
-import EditTop from '@/pages/Zother/EditTop'
-import EditBtn from '@/pages/Zother/EditBtn'
-import { InfoProvider } from '@/pages/Zother/InfoContext'
-import { rowArrTemp } from '@/pages/Zother/data'
-import { A4API_obj } from '@/store/action/Abench/A4proof'
-import SonClueList from '@/pages/Zother/SonClueList'
-import FileArchive from '@/pages/Zother/FileArchive'
-
-const rowArr = rowArrTemp('征集')
-
-function A4edit() {
-  return (
-    <InfoProvider>
-      <div className={styles.A4edit} id='editBox'>
-        <div className='editMain'>
-          {/* 顶部 */}
-          <EditTop
-            pageTxt='凭证中心'
-            rowArr={rowArr}
-            APIobj={A4API_obj}
-            fileUpInfo={{ myUrl: 'cms/order/collect/upload', dirCode: 'collect' }}
-          />
-
-          {/* 线索清单 */}
-          <SonClueList
-            fileUpInfo={{ myUrl: 'cms/order/collect/son/upload', dirCode: 'collectClues' }}
-          />
-
-          {/* 附件归档 */}
-          <FileArchive />
-
-          {/* 底部按钮 */}
-          <EditBtn path='/collect' APIobj={A4API_obj} checkListTxt='请添加线索' />
-        </div>
-      </div>
-    </InfoProvider>
-  )
-}
-
-const MemoA4edit = React.memo(A4edit)
-
-export default MemoA4edit

+ 25 - 17
src/pages/Abench/A4proof/index.tsx

@@ -11,6 +11,8 @@ import { voucherCenterTableC } from '@/utils/tableData'
 import { Button, message } from 'antd'
 import tabLeftArr from '@/pages/Layout/data'
 import { downloadFileByUrl } from '@/utils'
+import { authorityFu } from '@/utils/authority'
+import { MessageFu } from '@/utils/message'
 
 function A4proof() {
   const tableInfo = useSelector((state: RootState) => state.A4proof.tableInfo)
@@ -89,8 +91,10 @@ function A4proof() {
   }, [])
 
   // 点击各种操作按钮
-  const tableBtnFu = useCallback((id: number, key: string) => {
-    history.push(`/proof_edit/${key}/${id}`)
+  const btnFu = useCallback((pageKey: '3' | '4', obj: any, id: number) => {
+    if (obj) {
+      authorityFu(obj.id, obj.name, () => history.push(`${obj.path}_edit/${pageKey}/${id}`))
+    } else MessageFu.warning('业务类型错误')
   }, [])
 
   const staBtn = useMemo(() => {
@@ -163,23 +167,27 @@ function A4proof() {
     return [
       {
         title: '操作',
-        render: (item: any) => (
-          <>
-            <Button size='small' type='text' onClick={() => tableBtnFu(item.moduleId, '4')}>
-              查看
-            </Button>
-            <Button
-              size='small'
-              type='text'
-              onClick={() => downloadFileByUrl(item.filePath, item.fileName)}
-            >
-              下载
-            </Button>
-          </>
-        )
+        render: (item: any) => {
+          const obj = list.find(v => v.value === item.moduleName)
+          console.log('obj', obj)
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => btnFu('4', obj, item.moduleId)}>
+                查看
+              </Button>
+              <Button
+                size='small'
+                type='text'
+                onClick={() => downloadFileByUrl(item.filePath, item.fileName)}
+              >
+                下载
+              </Button>
+            </>
+          )
+        }
       }
     ]
-  }, [tableBtnFu])
+  }, [btnFu, list])
 
   return (
     <div className={styles.A4proof}>

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

@@ -348,12 +348,6 @@ export default tabLeftArr
 // 这里的id要和tab栏的id相同,不然没有权限进入页面
 export const routerSon: RouterTypeRow[] = [
   {
-    id: 140,
-    name: '凭证中心-详情页',
-    path: '/proof_edit/:key/:id',
-    Com: React.lazy(() => import('../Abench/A4proof/A4edit'))
-  },
-  {
     id: 210,
     name: '藏品征集-详情页',
     path: '/collect_edit/:key/:id',