shaogen1995 1 месяц назад
Родитель
Сommit
648c3a9f90

+ 36 - 0
src/pages/Zother/AuditList/index.module.scss

@@ -0,0 +1,36 @@
+.AuditList {
+  position: fixed;
+  z-index: 999;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.6);
+  padding: 50px 80px;
+  border-radius: 10px;
+  :global {
+    .ALbox {
+      width: 100%;
+      height: 100%;
+      border-radius: 10px;
+      padding: 20px;
+      background-color: var(--boxBcaColor);
+      .ALtit {
+        margin-bottom: 24px;
+        border-bottom: 1px solid #ccc;
+        padding-bottom: 15px;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        & > div {
+          font-size: 18px;
+          font-weight: 700;
+          padding-left: 18px;
+        }
+      }
+      .ant-table-cell {
+        padding: 8px !important;
+      }
+    }
+  }
+}

+ 62 - 0
src/pages/Zother/AuditList/index.tsx

@@ -0,0 +1,62 @@
+import React, { useMemo } from 'react'
+import styles from './index.module.scss'
+import { TypetableAuditList } from '../data'
+import { Button } from 'antd'
+import MyTable from '@/components/MyTable'
+
+type Props = {
+  list: TypetableAuditList[]
+  closeFu: () => void
+}
+
+function AuditList({ list, closeFu }: Props) {
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '审批结果',
+        render: (item: TypetableAuditList) => {
+          let txt1 = item.status === 1 ? '同意' : item.status === 2 ? '不同意' : '待处理'
+          if (item.isUse === 0) txt1 = '(空)'
+          const txt2 = item.isAuto === 1 ? '(自动)' : ''
+          return txt1 + txt2
+        }
+      },
+      {
+        title: '审批日期',
+        render: (item: TypetableAuditList) => item.auditTime || '(空)'
+      },
+      {
+        title: '审批意见',
+        render: (item: TypetableAuditList) => item.rtfOpinion || '(空)'
+      }
+    ]
+  }, [])
+
+  return (
+    <div className={styles.AuditList}>
+      <div className='ALbox'>
+        <div className='ALtit'>
+          <div>申请记录</div>
+          <Button onClick={closeFu}>关闭</Button>
+        </div>
+
+        {/* 表格 */}
+        <MyTable
+          classKey='AuditListTable'
+          list={list}
+          columnsTemp={[
+            ['txt', '节点名称', 'name'],
+            ['txt', '提交日期', 'createTime'],
+            ['txt', '处理人', 'handler']
+          ]}
+          lastBtn={tableLastBtn}
+          pagingInfo={false}
+        />
+      </div>
+    </div>
+  )
+}
+
+const MemoAuditList = React.memo(AuditList)
+
+export default MemoAuditList

+ 6 - 6
src/pages/Zother/EditBtn/index.tsx

@@ -9,7 +9,7 @@ import { useInfo } from '../InfoContext'
 import { MessageFu } from '@/utils/message'
 import { fileIdsResFu } from '@/utils'
 import { API_objType } from '@/store/action/Dmanage/D1register'
-import { TypetableAuditList } from '../data'
+import AuditList from '../AuditList'
 
 type Props = {
   path: string
@@ -135,7 +135,7 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
   )
 
   // 申请记录的显示
-  const [auditListShow, setAuditListShow] = useState<TypetableAuditList[]>([])
+  const [auditListShow, setAuditListShow] = useState(false)
 
   return (
     <div className={styles.EditBtn}>
@@ -193,11 +193,11 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
         ) : null}
       </div>
 
-      <div>
-        {isLook ? <Button onClick={() => setAuditListShow(info.audits)}>申请记录</Button> : null}
-      </div>
+      <div>{isLook ? <Button onClick={() => setAuditListShow(true)}>申请记录</Button> : null}</div>
 
-      {/* {auditListShow.length ? <AuditList /> : null} */}
+      {auditListShow ? (
+        <AuditList list={info.audits} closeFu={() => setAuditListShow(false)} />
+      ) : null}
     </div>
   )
 }