瀏覽代碼

feat: 新增权限控制组件

lanjianrong 4 年之前
父節點
當前提交
50cf51907c

+ 21 - 0
src/components/Authorization/index.tsx

@@ -0,0 +1,21 @@
+import { tenderStore } from '@/store/mobx'
+// import { observer } from 'mobx-react'
+import React, { PropsWithChildren } from 'react'
+interface Authorization {
+  type: 'contract' | 'safe' | 'quality'
+  auth: 'access' | 'add' | 'delete'
+  children: React.ReactNode
+}
+/** auth的格式化为:delete | add | access */
+const Index: React.FC<Authorization> = ({ type, auth, children }) => {
+  const authPass = 1
+  // 获取store存储的权限
+  const permission = tenderStore.permission[type]
+  if (permission[auth] === authPass) {
+    return <>{children}</>
+  }
+  return null
+}
+
+
+export default Index

+ 18 - 15
src/pages/Quality/Content/Info/Detail/components/Modal/index.tsx

@@ -5,15 +5,24 @@ import { iAuditor, iLatestAuditorState } from '@/types/safe'
 import { iAccountGroupItem, iUserInfo } from '@/types/setting'
 import { getUserGroup } from '@/utils/common/user'
 import { Button, Form, Input, message, Modal, Popover } from 'antd'
-import React, { ChangeEvent, useEffect, useMemo, useState } from 'react'
+import React, { ChangeEvent, useEffect, useMemo, useState, memo } from 'react'
 interface iAuditModalProps {
-  visible: boolean
   onCancel: () => void
-  type: string
+  modalObj: {
+    visible: boolean
+    type: string
+    loading: boolean
+  }
   auditors: iAuditor[]
   onCreate: (values?: any) => void
   curAuditor: iLatestAuditorState
 }
+interface iModalObjState {
+  searchValue: string
+  visible: boolean
+  auditType: string
+}
+
 const textObj = {
   start: {
     title: '提交审批',
@@ -37,14 +46,10 @@ const textObj = {
   }
 }
 
-interface iModalObjState {
-  searchValue: string
-  visible: boolean
-  auditType: string
-}
+
 const AuditModal: React.FC<iAuditModalProps> = props => {
   const [ form ] = Form.useForm()
-  const { visible, type, onCancel, onCreate, auditors, curAuditor } = props
+  const { modalObj: { visible, type, loading },onCancel, onCreate, auditors, curAuditor } = props
   const [ modal, setModal ] = useState<iModalObjState>({
     searchValue: '',
     visible: false,
@@ -111,8 +116,6 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
 
   // 初始化审批退回下拉选择框
   const initAuditBackGroup = () => {
-    console.log(auditors)
-
     const newGroup: iAccountGroupItem[] = []
     for (let index = 0; index < 3; index++) {
       if (index === 0) {
@@ -165,19 +168,19 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
   const renderOkBtn = (type: string) => {
     if (type === 'start' || type === 'pass') {
       return (
-        <ZhSubmitButton size="small" onClick={comfirmBtnClick}>
+        <ZhSubmitButton size="small" onClick={comfirmBtnClick} loading={loading}>
           {textObj[type]?.okText}
         </ZhSubmitButton>
       )
     } else if (type === 'delete' || type === 'close') {
       return (
-        <Button danger size="small" onClick={comfirmBtnClick}>
+        <Button danger size="small" onClick={comfirmBtnClick} loading={loading}>
           {textObj[type]?.okText}
         </Button>
       )
     } else if (type === 'back') {
       return (
-        <ZhAuditBackButton size="small" onClick={comfirmBtnClick}>
+        <ZhAuditBackButton size="small" onClick={comfirmBtnClick} loading={loading}>
           {textObj[type]?.okText}
         </ZhAuditBackButton>
       )
@@ -325,4 +328,4 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
   )
 }
 
-export default AuditModal
+export default memo(AuditModal)

+ 78 - 38
src/pages/Quality/Content/Info/Detail/index.tsx

@@ -28,13 +28,15 @@ interface iModalObj {
   auditModal: boolean
   auditType: string
   curPage: number
+  loading: boolean
 }
 const Detail: React.FC<RouteComponentProps> = props => {
   const { saveId = '' } = props.location.state as any
-  const [ visible, setVisible ] = useState<iModalObj>({
+  const [ modalObj, setModalObj ] = useState<iModalObj>({
     ossModal: false,
     auditModal: false,
     auditType: '',
+    loading: false,
     curPage: 1
   })
   const [ detail, setDetail ] = useState<iDetailState>({
@@ -97,14 +99,14 @@ const Detail: React.FC<RouteComponentProps> = props => {
         })
       )
       setDetail({ ...detail, file: { ...detail.file, total: newFiles.length } })
-      await fileListChange(visible.curPage)
+      await fileListChange(modalObj.curPage)
     }
   }
-  const onOssModalShow = (show: boolean) => setVisible({ ...visible, ossModal: show })
+  const onOssModalShow = (show: boolean) => setModalObj({ ...modalObj, ossModal: show })
   const fileListChange = async (pageNo: number = 1, pageSize: number = 10) => {
     const { code = -1, data, total } = await apiGetFileList(consts.DATA_TYPE.QUALITY, detail.id, pageNo, pageSize)
     if (code === consts.RET_CODE.SUCCESS) {
-      setVisible({ ...visible, curPage: pageNo, ossModal: false })
+      setModalObj({ ...modalObj, curPage: pageNo, ossModal: false })
       setDetail({ ...detail, file: { ...detail.file, fileList: data, total } })
     }
   }
@@ -112,9 +114,8 @@ const Detail: React.FC<RouteComponentProps> = props => {
   const delFile = async (id: string, isLast: boolean) => {
     const { code = -1 } = await apiDelFile(id)
     if (code === consts.RET_CODE.SUCCESS) {
-      console.log(visible.curPage - 1)
-      await fileListChange(isLast ? visible.curPage - 1 : visible.curPage)
-      isLast && (setVisible({ ...visible, curPage: visible.curPage - 1 }))
+      await fileListChange(isLast ? modalObj.curPage - 1 : modalObj.curPage)
+      isLast && setModalObj({ ...modalObj, curPage: modalObj.curPage - 1 })
     }
   }
 
@@ -168,11 +169,16 @@ const Detail: React.FC<RouteComponentProps> = props => {
   }
 
   const btnClick = (type: string) => {
-    setVisible({ ...visible, auditType: type, auditModal: true })
+    setModalObj({ ...modalObj, auditType: type, auditModal: true })
   }
   const onModalConfirm = (values?: object) => {
+    setModalObj({ ...modalObj, loading: true })
     let payload: any = { quality_id: detail.id, bidsection_id: detail.bidsectionId, ...values }
-    if (visible.auditType === 'start') {
+    if (modalObj.auditType === 'start') {
+      payload.inspection = detail.inspection
+      payload.inspectionDetail = detail.inspectionDetail
+      payload.demand = detail.demand
+      payload.createTime = detail.createTime
       payload.auditors = detail.auditors.filter(item => item.progress === '0').map(item => item.audit_id)
       payload.reAuditors = detail.auditors.filter(item => item.progress === '2').map(item => item.audit_id)
       payload.times = detail.times
@@ -181,11 +187,11 @@ const Detail: React.FC<RouteComponentProps> = props => {
       }
     }
 
-    if (visible.auditType === 'delete') {
+    if (modalObj.auditType === 'delete') {
       payload = { id: detail.id }
     }
 
-    if (visible.auditType === 'pass' || visible.auditType === 'back') {
+    if (modalObj.auditType === 'pass' || modalObj.auditType === 'back') {
       payload.id = detail.latestAuditor.id
       if (detail.latestAuditor.progress === '1') {
         if (!detail.checkOrder.opinion) {
@@ -196,20 +202,22 @@ const Detail: React.FC<RouteComponentProps> = props => {
       }
     }
 
-    if (visible.auditType === 'close') {
+    if (modalObj.auditType === 'close') {
       payload.id = detail.latestAuditor.id
     }
-    apiResful(visible.auditType, payload)
+    apiResful(modalObj.auditType, payload)
   }
   const apiResful = async (type: string, payload: any) => {
     const { code } = await apiResfulQualityAudit(type, payload)
     if (code === consts.RET_CODE.SUCCESS) {
-      setVisible({ ...visible, auditModal: false })
+      setModalObj({ ...modalObj, auditModal: false, loading: false })
       if (type === 'delete') {
         props.history.goBack()
       } else {
         initData()
       }
+    } else {
+      setModalObj({ ...modalObj, loading: false })
     }
   }
   const renderHeaderBtn = (status: number) => {
@@ -254,6 +262,9 @@ const Detail: React.FC<RouteComponentProps> = props => {
     }
   }
 
+  const modalProps = useMemo(() => {
+    return { visible: modalObj.auditModal, loading: modalObj.loading, type: modalObj.auditType }
+  }, [ modalObj.auditType ])
   return (
     <div className="wrap-contaniner">
       <Header title="质量巡检">
@@ -273,15 +284,45 @@ const Detail: React.FC<RouteComponentProps> = props => {
             <tbody>
               <tr>
                 <th style={{ width: '150px' }}>检查项目</th>
-                <td>{isEdited ? <span>{detail.inspection}</span> : <TextArea value={detail.inspection}></TextArea>}</td>
+                <td>
+                  {isEdited ? (
+                    <span>{detail.inspection}</span>
+                  ) : (
+                    <TextArea
+                      value={detail.inspection}
+                      onChange={e => {
+                        setDetail({ ...detail, inspection: e.currentTarget.value })
+                      }}></TextArea>
+                  )}
+                </td>
               </tr>
               <tr>
                 <th style={{ width: '150px' }}>现场检查情况</th>
-                <td>{isEdited ? <span>{detail.inspectionDetail}</span> : <TextArea value={detail.inspectionDetail}></TextArea>}</td>
+                <td>
+                  {isEdited ? (
+                    <span>{detail.inspectionDetail}</span>
+                  ) : (
+                    <TextArea
+                      value={detail.inspectionDetail}
+                      onChange={e => {
+                        setDetail({ ...detail, inspectionDetail: e.currentTarget.value })
+                      }}></TextArea>
+                  )}
+                </td>
               </tr>
               <tr>
                 <th style={{ width: '150px' }}>处理要求及措施</th>
-                <td>{isEdited ? <span>{detail.demand}</span> : <TextArea value={detail.demand}></TextArea>}</td>
+                <td>
+                  {isEdited ? (
+                    <span>{detail.demand}</span>
+                  ) : (
+                    <TextArea
+                      value={detail.demand}
+                      onChange={e => {
+                        setDetail({ ...detail, demand: e.currentTarget.value })
+                      }}></TextArea>
+                  )}
+                </td>
               </tr>
               <tr>
                 <th style={{ width: '150px' }}>检查日期</th>
@@ -304,7 +345,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
               </tr>
             </tbody>
           </table>
-          {detail.status === auditProgress.checked && detail.latestAuditor.progress === '1' ? (
+          {detail.status === auditProgress.checked && detail.latestAuditor.audit_id === userStore.userInfo.id ? (
             <table className="pi-table pi-bordered">
               <thead>
                 <tr>
@@ -381,7 +422,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
             <tbody>
               <tr>
                 <td colSpan={5}>
-                  <ZhUploadButton size="small" icon={<SvgIcon type="xxh-cloud-upload" />} onClick={() => setVisible({ ...visible, ossModal: true })}>
+                  <ZhUploadButton size="small" icon={<SvgIcon type="xxh-cloud-upload" />} onClick={() => setModalObj({ ...modalObj, ossModal: true })}>
                     上传附件
                   </ZhUploadButton>
                 </td>
@@ -389,26 +430,26 @@ const Detail: React.FC<RouteComponentProps> = props => {
 
               {detail.file.fileList?.map((file, idx) => (
                 <tr key={idx}>
-                <td className="pi-width-70">{idx + 1}</td>
-                <td style={{ width: 383, maxWidth: 383, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>
-                  <a href={consts.OSS_PATH.REVIEW + file.filepath} target="_blank" rel="noopener noreferrer">
-                    {file.filename}
-                  </a>
-                </td>
-                <td className="pi-text-center">{file.accountName}</td>
-                <td className="pi-text-center">{dayjsFormat(file.createTime)}</td>
-                <td className="pi-text-center pi-width-90">
-                  <Tooltip title="移除">
-                    <Button size="small" type="text" icon={<SvgIcon type="xxh-times-circle1" />} style={{ color: '#df3f45' }} onClick={() => delFile(file.id, !idx)}></Button>
-                  </Tooltip>
-                </td>
-              </tr>
+                  <td className="pi-width-70">{idx + 1}</td>
+                  <td style={{ width: 383, maxWidth: 383, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>
+                    <a href={consts.OSS_PATH.REVIEW + file.filepath} target="_blank" rel="noopener noreferrer">
+                      {file.filename}
+                    </a>
+                  </td>
+                  <td className="pi-text-center">{file.accountName}</td>
+                  <td className="pi-text-center">{dayjsFormat(file.createTime)}</td>
+                  <td className="pi-text-center pi-width-90">
+                    <Tooltip title="移除">
+                      <Button size="small" type="text" icon={<SvgIcon type="xxh-times-circle1" />} style={{ color: '#df3f45' }} onClick={() => delFile(file.id, !idx)}></Button>
+                    </Tooltip>
+                  </td>
+                </tr>
               ))}
               {detail.file.total > consts.PAGE_SIZE ? (
                 <tr>
                   <td colSpan={5} className="pi-text-right">
                     <Pagination
-                      current={visible.curPage}
+                      current={modalObj.curPage}
                       size="small"
                       pageSize={consts.PAGE_SIZE}
                       hideOnSinglePage={true}
@@ -429,11 +470,10 @@ const Detail: React.FC<RouteComponentProps> = props => {
             uName={detail.auditName}></AuditContent>
         </div>
       </div>
-      <OssUploadModal visible={visible.ossModal} onCancel={() => setVisible({ ...visible, ossModal: false })} onCreate={onCreate} onShow={onOssModalShow}></OssUploadModal>
+      <OssUploadModal visible={modalObj.ossModal} onCancel={() => setModalObj({ ...modalObj, ossModal: false })} onCreate={onCreate} onShow={onOssModalShow}></OssUploadModal>
       <AuditModal
-        type={visible.auditType}
-        visible={visible.auditModal}
-        onCancel={() => setVisible({ ...visible, auditModal: false })}
+        modalObj = {modalProps}
+        onCancel={() => setModalObj({ ...modalObj, auditModal: false })}
         onCreate={onModalConfirm}
         auditors={detail.auditors}
         curAuditor={detail.latestAuditor}></AuditModal>

+ 13 - 29
src/pages/Quality/List/index.tsx

@@ -58,52 +58,36 @@ const List: React.FC<RouteComponentProps> = (props) => {
       title: '名称',
       dataIndex: 'name',
       key: 'name',
-      width: '25%',
+      width: '40%',
       render: (text: string, record: ContractTree) => {
         if (record.isfolder) {
           return <div style={{ verticalAlign: "baseline" }}><SvgIcon type={record.hasFolder ? "xxh-folder-open" : "xxh-folder"} /><span className="pi-mg-left-2">{text}</span></div>
         } else {
         return <div><span style={{ color: '#6c757d', marginRight: '.5rem' }}>{record.isEnd ? '└' : '├'}</span>
-          {/* <Link to={{ pathname: '/console/safe/content/summary', search: `?bid=${record.id}` }}>{text}</Link> */}
           <span className="pi-link-blue" onClick={() => linkHandler(record.bidsectionId, record.name)}>{text}</span>
         </div>
         }
       }
     },
     {
-      title: '合同总数',
-      dataIndex: 'contracts',
-      key: 'contracts',
-      width: '12%',
-      align: 'right'
+      title: '总数',
+      dataIndex: 'qualityTotal',
+      key: 'qualityTotal'
     },
     {
-      title: '收入合同金额',
-      dataIndex: 'contractsIncome',
-      key: 'contractsIncome',
-      width: '18%',
-      align: 'right'
+      title: '待整改',
+      dataIndex: 'quality_rectification',
+      key: 'quality_rectification'
     },
     {
-      title: '回款进度',
-      dataIndex: 'contractsIncomeProgress',
-      key: 'contractsIncomeProgress',
-      width: '12%',
-      align: 'center'
+      title: '整改中',
+      dataIndex: 'quality_rectification_in',
+      key: 'quality_rectification_in'
     },
     {
-      title: '支出合同金额',
-      dataIndex: 'contractsPay',
-      key: 'contractsPay',
-      width: '18%',
-      align: 'right'
-    },
-    {
-      title: '支付进度',
-      dataIndex: 'contractsPayProgress',
-      key: 'contractsPayProgress',
-      width: '12%',
-      align: 'center'
+      title: '已整改',
+      dataIndex: 'quality_rectification_finish',
+      key: 'quality_rectification_finish'
     }
   ]
   const handleMenuClick = ({ key }: any) => {

+ 1 - 1
src/pages/Safe/Content/Info/Detail/index.tsx

@@ -287,7 +287,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
             </tbody>
           </table>
           {
-            detail.status === auditProgress.checked && detail.latestAuditor.progress === '1'?
+            detail.status === auditProgress.checked && detail.latestAuditor.audit_id === userStore.userInfo.id?
             <table className="pi-table pi-bordered">
             <thead>
               <tr>

+ 20 - 30
src/pages/Safe/List/index.tsx

@@ -39,7 +39,13 @@ const List: React.FC<RouteComponentProps> = (props) => {
     isfolder: 0,
     name: '',
     parentId: '',
-    projectId: ''
+    projectId: '',
+    qualityRectificationIn: 0,
+    qualityTotal: 0,
+    safeRectification: 0,
+    safeRectificationIn: 0,
+    safeTotal: 0,
+    qualityRectification: 0
   })
   const getTree = async () => {
     const { data, code = -1 } = await apiContractList()
@@ -50,7 +56,6 @@ const List: React.FC<RouteComponentProps> = (props) => {
 
   const linkHandler = (id: string, name: string) => {
     tenderStore.saveTenderInfo({ bidsectionId: id, name })
-    // tenderStore.saveName(name)
     props.history.push('/console/safe/content/summary')
   }
   const columns:ColumnsType<ContractTree> = [
@@ -58,7 +63,7 @@ const List: React.FC<RouteComponentProps> = (props) => {
       title: '名称',
       dataIndex: 'name',
       key: 'name',
-      width: '25%',
+      width: '40%',
       render: (text: string, record: ContractTree) => {
         if (record.isfolder) {
           return <div style={{ verticalAlign: "baseline" }}><SvgIcon type={record.hasFolder ? "xxh-folder-open" : "xxh-folder"} /><span className="pi-mg-left-2">{text}</span></div>
@@ -71,39 +76,24 @@ const List: React.FC<RouteComponentProps> = (props) => {
       }
     },
     {
-      title: '合同总数',
-      dataIndex: 'contracts',
-      key: 'contracts',
-      width: '12%',
-      align: 'right'
+      title: '总数',
+      dataIndex: 'safeTotal',
+      key: 'safeTotal'
     },
     {
-      title: '收入合同金额',
-      dataIndex: 'contractsIncome',
-      key: 'contractsIncome',
-      width: '18%',
-      align: 'right'
+      title: '待整改',
+      dataIndex: 'safe_rectification',
+      key: 'safe_rectification'
     },
     {
-      title: '回款进度',
-      dataIndex: 'contractsIncomeProgress',
-      key: 'contractsIncomeProgress',
-      width: '12%',
-      align: 'center'
+      title: '整改中',
+      dataIndex: 'safe_rectification_in',
+      key: 'safe_rectification_in'
     },
     {
-      title: '支出合同金额',
-      dataIndex: 'contractsPay',
-      key: 'contractsPay',
-      width: '18%',
-      align: 'right'
-    },
-    {
-      title: '支付进度',
-      dataIndex: 'contractsPayProgress',
-      key: 'contractsPayProgress',
-      width: '12%',
-      align: 'center'
+      title: '已整改',
+      dataIndex: 'safe_rectification_finish',
+      key: 'safe_rectification_finish'
     }
   ]
   const handleMenuClick = ({ key }: any) => {

+ 22 - 0
src/store/mobx/tender/index.ts

@@ -1,3 +1,6 @@
+import { iPermission } from "@/types/setting"
+import { apiGetPermissionWithBid } from "@/utils/common/api"
+import consts from "@/utils/consts"
 import { storage } from "@/utils/util"
 import { action, computed, observable } from "mobx"
 
@@ -5,18 +8,37 @@ interface iTenderState {
   bidsectionId: string
   name: string
 }
+
+interface AuthController {
+  contract: iPermission
+  quality: iPermission
+  safe: iPermission
+}
 class Tender {
   @observable tender:iTenderState = {
     bidsectionId: '',
     name: ''
   }
 
+  @observable permission:AuthController = {
+    contract: { access: 0, add: 0, delete: 0 },
+    quality: { access: 0, add: 0, delete: 0 },
+    safe: { access: 0, add: 0, delete: 0 }
+  }
+
   @action saveTenderInfo(payload: iTenderState) {
     this.tender = payload
     storage.set('tenderInfo', payload)
 
   }
 
+  @action updatePermission(bid: string) {
+    apiGetPermissionWithBid(bid).then(({ code = -1, data }) => {
+      if (code === consts.RET_CODE.SUCCESS) {
+        this.permission = data
+      }
+    })
+  }
   @computed get bid() {
     if (!this.tender.bidsectionId) {
       const tender = storage.get('tenderInfo')

+ 71 - 66
src/types/contract.d.ts

@@ -1,54 +1,60 @@
 export interface ContractTree {
-  bidsectionId: string;
-  children: ContractTree[] | null[];
-  childsTotal: number;
-  contracts: number;
-  contractsIncome: string;
-  contractsIncomeProgress: string;
-  contractsPaid: string;
-  contractsPay: string;
-  contractsPayProgress: string;
-  contractsReturned: string;
-  csrf: string;
-  hasFolder: boolean;
-  id: string;
-  isBid: boolean;
-  isEnd: boolean;
-  isfolder: number;
-  name: string;
-  parentId: string;
-  projectId: string;
+  bidsectionId: string
+  children: ContractTree[] | null[]
+  childsTotal: number
+  contracts: number
+  contractsIncome: string
+  contractsIncomeProgress: string
+  contractsPaid: string
+  contractsPay: string
+  contractsPayProgress: string
+  contractsReturned: string
+  csrf: string
+  hasFolder: boolean
+  id: string
+  isBid: boolean
+  isEnd: boolean
+  isfolder: number
+  name: string
+  parentId: string
+  projectId: string
+  qualityRectification: number
+  qualityRectificationIn: number
+  qualityTotal: number
+  safeRectification: number
+  safeRectificationIn: number
+  safeTotal: number
 }
 
 export interface iIncomeTree {
-  elderBrother: boolean;
-  isEnd: boolean;
-  attribsortution: number;
-  attribution: string;
-  bidsectionId: string;
-  children: iIncomeTree[] | undefined;
-  code: string;
-  contractCode: string;
-  contractId: string;
-  contractName: string;
-  contractPrice: string;
-  contractReturned: string;
-  contractStatus: number;
-  contractsPaid: string;
-  createTime: string;
-  depth: number;
-  id: string;
-  name: string;
-  operation: string;
-  parentId: string;
-  projectId: string;
-  serial: number;
-  templateNumber: number;
-  isEdit?: boolean;
+  elderBrother: boolean
+  isEnd: boolean
+  attribsortution: number
+  attribution: string
+  bidsectionId: string
+  children: iIncomeTree[] | undefined
+  code: string
+  contractCode: string
+  contractId: string
+  contractName: string
+  contractPrice: string
+  contractReturned: string
+  contractStatus: number
+  contractsPaid: string
+  createTime: string
+  depth: number
+  id: string
+  name: string
+  operation: string
+  parentId: string
+  projectId: string
+  serial: number
+  templateNumber: number
+  isEdit?: boolean
   isNew?: boolean
 }
 export interface iModalBooleanProps {
-  type : string
+  type: string
   visible: boolean
   confirmLoading: boolean
 }
@@ -85,31 +91,30 @@ export interface iContractState {
 }
 
 export interface iReceivableState {
-  accountId: string;
-  annexes: number;
-  bidsectionId: string;
-  contractsId: string;
-  createTime: string;
-  createUser: string;
-  fileCounts: number;
-  id: string;
-  page: number;
-  price: string;
-  projectId: string;
-  remarks: string;
-  time: string;
-  way: string;
+  accountId: string
+  annexes: number
+  bidsectionId: string
+  contractsId: string
+  createTime: string
+  createUser: string
+  fileCounts: number
+  id: string
+  page: number
+  price: string
+  projectId: string
+  remarks: string
+  time: string
+  way: string
 }
 
-
 export interface iEditableCellProps extends React.HTMLAttributes<HTMLElement> {
-  editing: boolean;
-  dataIndex: string;
-  title: any;
-  cellType: 'DatePicker' | 'text';
-  record: iReceivableState;
-  index: number;
-  children: React.ReactNode;
+  editing: boolean
+  dataIndex: string
+  title: any
+  cellType: 'DatePicker' | 'text'
+  record: iReceivableState
+  index: number
+  children: React.ReactNode
 }
 
 export interface iTemplateState {

+ 6 - 0
src/types/setting.d.ts

@@ -61,3 +61,9 @@ export interface iPermissionData {
   permissions: string[]
   type: string
 }
+
+export interface iPermission {
+  access: number
+  add: number
+  delete: number
+}

+ 7 - 3
src/utils/common/api.ts

@@ -37,16 +37,20 @@ export async function getSignature() {
   return data
 }
 
-// 获取账号分组信息
+/** 获取账号分组信息 */
 export async function apiGetGroupList() {
   const { data } = await request.get("/api/projectAccount/group")
   return data
 }
 
-// 获取账号列表(检索)
+/** 获取账号列表(检索) */
 export async function apiGetAccountWithSearch(name?: string) {
   const { data } = await request.get("/api/projectAccount/search", { name })
   return data
-
 }
 
+/** 获取权限列表 */
+export async function apiGetPermissionWithBid(bidsectionId: string) {
+  const { data } = await request.get('', { bidsectionId })
+  return data
+}